]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20201128
[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 CLANG_VERSION=none
1853
1854 if test "x$CLANG_COMPILER" = "xyes" ; then
1855         case "$CC" in
1856         (c[1-9][0-9]|*/c[1-9][0-9])
1857                 { echo "$as_me:1857: WARNING: replacing broken compiler alias $CC" >&5
1858 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1859                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1860                 CC=clang
1861                 ;;
1862         esac
1863
1864         echo "$as_me:1864: checking version of $CC" >&5
1865 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1866         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1867         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1868         echo "$as_me:1868: result: $CLANG_VERSION" >&5
1869 echo "${ECHO_T}$CLANG_VERSION" >&6
1870
1871         for cf_clang_opt in \
1872                 -Qunused-arguments \
1873                 -Wno-error=implicit-function-declaration
1874         do
1875                 echo "$as_me:1875: checking if option $cf_clang_opt works" >&5
1876 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1877                 cf_save_CFLAGS="$CFLAGS"
1878                 CFLAGS="$CFLAGS $cf_clang_opt"
1879                 cat >conftest.$ac_ext <<_ACEOF
1880 #line 1880 "configure"
1881 #include "confdefs.h"
1882
1883                         #include <stdio.h>
1884 int
1885 main (void)
1886 {
1887
1888                         printf("hello!\n");
1889   ;
1890   return 0;
1891 }
1892 _ACEOF
1893 rm -f conftest.$ac_objext conftest$ac_exeext
1894 if { (eval echo "$as_me:1894: \"$ac_link\"") >&5
1895   (eval $ac_link) 2>&5
1896   ac_status=$?
1897   echo "$as_me:1897: \$? = $ac_status" >&5
1898   (exit $ac_status); } &&
1899          { ac_try='test -s conftest$ac_exeext'
1900   { (eval echo "$as_me:1900: \"$ac_try\"") >&5
1901   (eval $ac_try) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit $ac_status); }; }; then
1905
1906                         cf_clang_optok=yes
1907 else
1908   echo "$as_me: failed program was:" >&5
1909 cat conftest.$ac_ext >&5
1910
1911                         cf_clang_optok=no
1912 fi
1913 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
1914                 echo "$as_me:1914: result: $cf_clang_optok" >&5
1915 echo "${ECHO_T}$cf_clang_optok" >&6
1916                 CFLAGS="$cf_save_CFLAGS"
1917                 if test $cf_clang_optok = yes; then
1918                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
1919
1920 echo "${as_me:-configure}:1920: testing adding option $cf_clang_opt ..." 1>&5
1921
1922         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1923         CFLAGS="${CFLAGS}$cf_clang_opt"
1924
1925                 fi
1926         done
1927 fi
1928
1929 echo "$as_me:1929: checking for $CC option to accept ANSI C" >&5
1930 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1931 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1932   echo $ECHO_N "(cached) $ECHO_C" >&6
1933 else
1934   ac_cv_prog_cc_stdc=no
1935 ac_save_CC=$CC
1936 cat >conftest.$ac_ext <<_ACEOF
1937 #line 1937 "configure"
1938 #include "confdefs.h"
1939 #include <stdarg.h>
1940 #include <stdio.h>
1941 #include <sys/types.h>
1942 #include <sys/stat.h>
1943 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1944 struct buf { int x; };
1945 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1946 static char *e (p, i)
1947      char **p;
1948      int i;
1949 {
1950   return p[i];
1951 }
1952 static char *f (char * (*g) (char **, int), char **p, ...)
1953 {
1954   char *s;
1955   va_list v;
1956   va_start (v,p);
1957   s = g (p, va_arg (v,int));
1958   va_end (v);
1959   return s;
1960 }
1961 int test (int i, double x);
1962 struct s1 {int (*f) (int a);};
1963 struct s2 {int (*f) (double a);};
1964 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1965 int argc;
1966 char **argv;
1967 int
1968 main (void)
1969 {
1970 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1971   ;
1972   return 0;
1973 }
1974 _ACEOF
1975 # Don't try gcc -ansi; that turns off useful extensions and
1976 # breaks some systems' header files.
1977 # AIX                   -qlanglvl=ansi
1978 # Ultrix and OSF/1      -std1
1979 # HP-UX 10.20 and later -Ae
1980 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1981 # SVR4                  -Xc -D__EXTENSIONS__
1982 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1983 do
1984   CC="$ac_save_CC $ac_arg"
1985   rm -f conftest.$ac_objext
1986 if { (eval echo "$as_me:1986: \"$ac_compile\"") >&5
1987   (eval $ac_compile) 2>&5
1988   ac_status=$?
1989   echo "$as_me:1989: \$? = $ac_status" >&5
1990   (exit $ac_status); } &&
1991          { ac_try='test -s conftest.$ac_objext'
1992   { (eval echo "$as_me:1992: \"$ac_try\"") >&5
1993   (eval $ac_try) 2>&5
1994   ac_status=$?
1995   echo "$as_me:1995: \$? = $ac_status" >&5
1996   (exit $ac_status); }; }; then
1997   ac_cv_prog_cc_stdc=$ac_arg
1998 break
1999 else
2000   echo "$as_me: failed program was:" >&5
2001 cat conftest.$ac_ext >&5
2002 fi
2003 rm -f conftest.$ac_objext
2004 done
2005 rm -f conftest.$ac_ext conftest.$ac_objext
2006 CC=$ac_save_CC
2007
2008 fi
2009
2010 case "x$ac_cv_prog_cc_stdc" in
2011   x|xno)
2012     echo "$as_me:2012: result: none needed" >&5
2013 echo "${ECHO_T}none needed" >&6 ;;
2014   *)
2015     echo "$as_me:2015: result: $ac_cv_prog_cc_stdc" >&5
2016 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2017     CC="$CC $ac_cv_prog_cc_stdc" ;;
2018 esac
2019
2020 # This should have been defined by AC_PROG_CC
2021 : ${CC:=cc}
2022
2023 echo "$as_me:2023: checking \$CFLAGS variable" >&5
2024 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2025 case "x$CFLAGS" in
2026 (*-[IUD]*)
2027         echo "$as_me:2027: result: broken" >&5
2028 echo "${ECHO_T}broken" >&6
2029         { echo "$as_me:2029: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2030 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2031         cf_flags="$CFLAGS"
2032         CFLAGS=
2033         for cf_arg in $cf_flags
2034         do
2035
2036 cf_fix_cppflags=no
2037 cf_new_cflags=
2038 cf_new_cppflags=
2039 cf_new_extra_cppflags=
2040
2041 for cf_add_cflags in $cf_arg
2042 do
2043 case $cf_fix_cppflags in
2044 (no)
2045         case $cf_add_cflags in
2046         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2047                 case $cf_add_cflags in
2048                 (-D*)
2049                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2050
2051                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2052                                 && test -z "${cf_tst_cflags}" \
2053                                 && cf_fix_cppflags=yes
2054
2055                         if test $cf_fix_cppflags = yes ; then
2056
2057         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2058         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2059
2060                                 continue
2061                         elif test "${cf_tst_cflags}" = "\"'" ; then
2062
2063         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2064         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2065
2066                                 continue
2067                         fi
2068                         ;;
2069                 esac
2070                 case "$CPPFLAGS" in
2071                 (*$cf_add_cflags)
2072                         ;;
2073                 (*)
2074                         case $cf_add_cflags in
2075                         (-D*)
2076                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2077
2078 CPPFLAGS=`echo "$CPPFLAGS" | \
2079         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2080                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2081
2082                                 ;;
2083                         esac
2084
2085         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2086         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2087
2088                         ;;
2089                 esac
2090                 ;;
2091         (*)
2092
2093         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2094         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2095
2096                 ;;
2097         esac
2098         ;;
2099 (yes)
2100
2101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2103
2104         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2105
2106         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2107                 && test -z "${cf_tst_cflags}" \
2108                 && cf_fix_cppflags=no
2109         ;;
2110 esac
2111 done
2112
2113 if test -n "$cf_new_cflags" ; then
2114
2115         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2116         CFLAGS="${CFLAGS}$cf_new_cflags"
2117
2118 fi
2119
2120 if test -n "$cf_new_cppflags" ; then
2121
2122         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2123         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2124
2125 fi
2126
2127 if test -n "$cf_new_extra_cppflags" ; then
2128
2129         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2130         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2131
2132 fi
2133
2134         done
2135         ;;
2136 (*)
2137         echo "$as_me:2137: result: ok" >&5
2138 echo "${ECHO_T}ok" >&6
2139         ;;
2140 esac
2141
2142 echo "$as_me:2142: checking \$CC variable" >&5
2143 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2144 case "$CC" in
2145 (*[\ \  ]-*)
2146         echo "$as_me:2146: result: broken" >&5
2147 echo "${ECHO_T}broken" >&6
2148         { echo "$as_me:2148: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2149 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2150         # humor him...
2151         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2152         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2153         CC="$cf_prog"
2154         for cf_arg in $cf_flags
2155         do
2156                 case "x$cf_arg" in
2157                 (x-[IUDfgOW]*)
2158
2159 cf_fix_cppflags=no
2160 cf_new_cflags=
2161 cf_new_cppflags=
2162 cf_new_extra_cppflags=
2163
2164 for cf_add_cflags in $cf_arg
2165 do
2166 case $cf_fix_cppflags in
2167 (no)
2168         case $cf_add_cflags in
2169         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2170                 case $cf_add_cflags in
2171                 (-D*)
2172                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2173
2174                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2175                                 && test -z "${cf_tst_cflags}" \
2176                                 && cf_fix_cppflags=yes
2177
2178                         if test $cf_fix_cppflags = yes ; then
2179
2180         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2181         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2182
2183                                 continue
2184                         elif test "${cf_tst_cflags}" = "\"'" ; then
2185
2186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2188
2189                                 continue
2190                         fi
2191                         ;;
2192                 esac
2193                 case "$CPPFLAGS" in
2194                 (*$cf_add_cflags)
2195                         ;;
2196                 (*)
2197                         case $cf_add_cflags in
2198                         (-D*)
2199                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2200
2201 CPPFLAGS=`echo "$CPPFLAGS" | \
2202         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2203                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2204
2205                                 ;;
2206                         esac
2207
2208         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2209         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2210
2211                         ;;
2212                 esac
2213                 ;;
2214         (*)
2215
2216         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2217         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2218
2219                 ;;
2220         esac
2221         ;;
2222 (yes)
2223
2224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2226
2227         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2228
2229         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2230                 && test -z "${cf_tst_cflags}" \
2231                 && cf_fix_cppflags=no
2232         ;;
2233 esac
2234 done
2235
2236 if test -n "$cf_new_cflags" ; then
2237
2238         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2239         CFLAGS="${CFLAGS}$cf_new_cflags"
2240
2241 fi
2242
2243 if test -n "$cf_new_cppflags" ; then
2244
2245         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2246         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2247
2248 fi
2249
2250 if test -n "$cf_new_extra_cppflags" ; then
2251
2252         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2253         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2254
2255 fi
2256
2257                         ;;
2258                 (*)
2259                         CC="$CC $cf_arg"
2260                         ;;
2261                 esac
2262         done
2263         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2264
2265 echo "${as_me:-configure}:2265: testing resulting CC: '$CC' ..." 1>&5
2266
2267         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2268
2269 echo "${as_me:-configure}:2269: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2270
2271         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2272
2273 echo "${as_me:-configure}:2273: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2274
2275         ;;
2276 (*)
2277         echo "$as_me:2277: result: ok" >&5
2278 echo "${ECHO_T}ok" >&6
2279         ;;
2280 esac
2281
2282 ac_ext=c
2283 ac_cpp='$CPP $CPPFLAGS'
2284 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2285 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2286 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2287 ac_main_return=return
2288 echo "$as_me:2288: checking how to run the C preprocessor" >&5
2289 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2290 # On Suns, sometimes $CPP names a directory.
2291 if test -n "$CPP" && test -d "$CPP"; then
2292   CPP=
2293 fi
2294 if test -z "$CPP"; then
2295   if test "${ac_cv_prog_CPP+set}" = set; then
2296   echo $ECHO_N "(cached) $ECHO_C" >&6
2297 else
2298       # Double quotes because CPP needs to be expanded
2299     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2300     do
2301       ac_preproc_ok=false
2302 for ac_c_preproc_warn_flag in '' yes
2303 do
2304   # Use a header file that comes with gcc, so configuring glibc
2305   # with a fresh cross-compiler works.
2306   # On the NeXT, cc -E runs the code through the compiler's parser,
2307   # not just through cpp. "Syntax error" is here to catch this case.
2308   cat >conftest.$ac_ext <<_ACEOF
2309 #line 2309 "configure"
2310 #include "confdefs.h"
2311 #include <assert.h>
2312                      Syntax error
2313 _ACEOF
2314 if { (eval echo "$as_me:2314: \"$ac_cpp conftest.$ac_ext\"") >&5
2315   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2316   ac_status=$?
2317   egrep -v '^ *\+' conftest.er1 >conftest.err
2318   rm -f conftest.er1
2319   cat conftest.err >&5
2320   echo "$as_me:2320: \$? = $ac_status" >&5
2321   (exit $ac_status); } >/dev/null; then
2322   if test -s conftest.err; then
2323     ac_cpp_err=$ac_c_preproc_warn_flag
2324   else
2325     ac_cpp_err=
2326   fi
2327 else
2328   ac_cpp_err=yes
2329 fi
2330 if test -z "$ac_cpp_err"; then
2331   :
2332 else
2333   echo "$as_me: failed program was:" >&5
2334   cat conftest.$ac_ext >&5
2335   # Broken: fails on valid input.
2336 continue
2337 fi
2338 rm -f conftest.err conftest.$ac_ext
2339
2340   # OK, works on sane cases.  Now check whether non-existent headers
2341   # can be detected and how.
2342   cat >conftest.$ac_ext <<_ACEOF
2343 #line 2343 "configure"
2344 #include "confdefs.h"
2345 #include <ac_nonexistent.h>
2346 _ACEOF
2347 if { (eval echo "$as_me:2347: \"$ac_cpp conftest.$ac_ext\"") >&5
2348   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2349   ac_status=$?
2350   egrep -v '^ *\+' conftest.er1 >conftest.err
2351   rm -f conftest.er1
2352   cat conftest.err >&5
2353   echo "$as_me:2353: \$? = $ac_status" >&5
2354   (exit $ac_status); } >/dev/null; then
2355   if test -s conftest.err; then
2356     ac_cpp_err=$ac_c_preproc_warn_flag
2357   else
2358     ac_cpp_err=
2359   fi
2360 else
2361   ac_cpp_err=yes
2362 fi
2363 if test -z "$ac_cpp_err"; then
2364   # Broken: success on invalid input.
2365 continue
2366 else
2367   echo "$as_me: failed program was:" >&5
2368   cat conftest.$ac_ext >&5
2369   # Passes both tests.
2370 ac_preproc_ok=:
2371 break
2372 fi
2373 rm -f conftest.err conftest.$ac_ext
2374
2375 done
2376 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2377 rm -f conftest.err conftest.$ac_ext
2378 if $ac_preproc_ok; then
2379   break
2380 fi
2381
2382     done
2383     ac_cv_prog_CPP=$CPP
2384
2385 fi
2386   CPP=$ac_cv_prog_CPP
2387 else
2388   ac_cv_prog_CPP=$CPP
2389 fi
2390 echo "$as_me:2390: result: $CPP" >&5
2391 echo "${ECHO_T}$CPP" >&6
2392 ac_preproc_ok=false
2393 for ac_c_preproc_warn_flag in '' yes
2394 do
2395   # Use a header file that comes with gcc, so configuring glibc
2396   # with a fresh cross-compiler works.
2397   # On the NeXT, cc -E runs the code through the compiler's parser,
2398   # not just through cpp. "Syntax error" is here to catch this case.
2399   cat >conftest.$ac_ext <<_ACEOF
2400 #line 2400 "configure"
2401 #include "confdefs.h"
2402 #include <assert.h>
2403                      Syntax error
2404 _ACEOF
2405 if { (eval echo "$as_me:2405: \"$ac_cpp conftest.$ac_ext\"") >&5
2406   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2407   ac_status=$?
2408   egrep -v '^ *\+' conftest.er1 >conftest.err
2409   rm -f conftest.er1
2410   cat conftest.err >&5
2411   echo "$as_me:2411: \$? = $ac_status" >&5
2412   (exit $ac_status); } >/dev/null; then
2413   if test -s conftest.err; then
2414     ac_cpp_err=$ac_c_preproc_warn_flag
2415   else
2416     ac_cpp_err=
2417   fi
2418 else
2419   ac_cpp_err=yes
2420 fi
2421 if test -z "$ac_cpp_err"; then
2422   :
2423 else
2424   echo "$as_me: failed program was:" >&5
2425   cat conftest.$ac_ext >&5
2426   # Broken: fails on valid input.
2427 continue
2428 fi
2429 rm -f conftest.err conftest.$ac_ext
2430
2431   # OK, works on sane cases.  Now check whether non-existent headers
2432   # can be detected and how.
2433   cat >conftest.$ac_ext <<_ACEOF
2434 #line 2434 "configure"
2435 #include "confdefs.h"
2436 #include <ac_nonexistent.h>
2437 _ACEOF
2438 if { (eval echo "$as_me:2438: \"$ac_cpp conftest.$ac_ext\"") >&5
2439   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2440   ac_status=$?
2441   egrep -v '^ *\+' conftest.er1 >conftest.err
2442   rm -f conftest.er1
2443   cat conftest.err >&5
2444   echo "$as_me:2444: \$? = $ac_status" >&5
2445   (exit $ac_status); } >/dev/null; then
2446   if test -s conftest.err; then
2447     ac_cpp_err=$ac_c_preproc_warn_flag
2448   else
2449     ac_cpp_err=
2450   fi
2451 else
2452   ac_cpp_err=yes
2453 fi
2454 if test -z "$ac_cpp_err"; then
2455   # Broken: success on invalid input.
2456 continue
2457 else
2458   echo "$as_me: failed program was:" >&5
2459   cat conftest.$ac_ext >&5
2460   # Passes both tests.
2461 ac_preproc_ok=:
2462 break
2463 fi
2464 rm -f conftest.err conftest.$ac_ext
2465
2466 done
2467 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2468 rm -f conftest.err conftest.$ac_ext
2469 if $ac_preproc_ok; then
2470   :
2471 else
2472   { { echo "$as_me:2472: error: C preprocessor \"$CPP\" fails sanity check" >&5
2473 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2474    { (exit 1); exit 1; }; }
2475 fi
2476
2477 ac_ext=c
2478 ac_cpp='$CPP $CPPFLAGS'
2479 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2480 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2481 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2482 ac_main_return=return
2483
2484 if test $ac_cv_c_compiler_gnu = yes; then
2485     echo "$as_me:2485: checking whether $CC needs -traditional" >&5
2486 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2487 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2488   echo $ECHO_N "(cached) $ECHO_C" >&6
2489 else
2490     ac_pattern="Autoconf.*'x'"
2491   cat >conftest.$ac_ext <<_ACEOF
2492 #line 2492 "configure"
2493 #include "confdefs.h"
2494 #include <sgtty.h>
2495 int Autoconf = TIOCGETP;
2496 _ACEOF
2497 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2498   egrep "$ac_pattern" >/dev/null 2>&1; then
2499   ac_cv_prog_gcc_traditional=yes
2500 else
2501   ac_cv_prog_gcc_traditional=no
2502 fi
2503 rm -rf conftest*
2504
2505   if test $ac_cv_prog_gcc_traditional = no; then
2506     cat >conftest.$ac_ext <<_ACEOF
2507 #line 2507 "configure"
2508 #include "confdefs.h"
2509 #include <termio.h>
2510 int Autoconf = TCGETA;
2511 _ACEOF
2512 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2513   egrep "$ac_pattern" >/dev/null 2>&1; then
2514   ac_cv_prog_gcc_traditional=yes
2515 fi
2516 rm -rf conftest*
2517
2518   fi
2519 fi
2520 echo "$as_me:2520: result: $ac_cv_prog_gcc_traditional" >&5
2521 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2522   if test $ac_cv_prog_gcc_traditional = yes; then
2523     CC="$CC -traditional"
2524   fi
2525 fi
2526
2527 echo "$as_me:2527: checking whether $CC understands -c and -o together" >&5
2528 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2529 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2530   echo $ECHO_N "(cached) $ECHO_C" >&6
2531 else
2532
2533 cat > conftest.$ac_ext <<CF_EOF
2534 int main(void)
2535 {
2536         ${cf_cv_main_return:-return}(0);
2537 }
2538 CF_EOF
2539 # We do the test twice because some compilers refuse to overwrite an
2540 # existing .o file with -o, though they will create one.
2541 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2542 if { (eval echo "$as_me:2542: \"$ac_try\"") >&5
2543   (eval $ac_try) 2>&5
2544   ac_status=$?
2545   echo "$as_me:2545: \$? = $ac_status" >&5
2546   (exit $ac_status); } &&
2547   test -f conftest2.$ac_objext && { (eval echo "$as_me:2547: \"$ac_try\"") >&5
2548   (eval $ac_try) 2>&5
2549   ac_status=$?
2550   echo "$as_me:2550: \$? = $ac_status" >&5
2551   (exit $ac_status); };
2552 then
2553   eval cf_cv_prog_CC_c_o=yes
2554 else
2555   eval cf_cv_prog_CC_c_o=no
2556 fi
2557 rm -rf conftest*
2558
2559 fi
2560 if test $cf_cv_prog_CC_c_o = yes; then
2561   echo "$as_me:2561: result: yes" >&5
2562 echo "${ECHO_T}yes" >&6
2563 else
2564   echo "$as_me:2564: result: no" >&5
2565 echo "${ECHO_T}no" >&6
2566 fi
2567
2568 test "$program_prefix" != NONE &&
2569   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2570 # Use a double $ so make ignores it.
2571 test "$program_suffix" != NONE &&
2572   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2573 # Double any \ or $.  echo might interpret backslashes.
2574 # By default was `s,x,x', remove it if useless.
2575 cat <<\_ACEOF >conftest.sed
2576 s/[\\$]/&&/g;s/;s,x,x,$//
2577 _ACEOF
2578 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2579 rm conftest.sed
2580
2581 for ac_prog in mawk gawk nawk awk
2582 do
2583   # Extract the first word of "$ac_prog", so it can be a program name with args.
2584 set dummy $ac_prog; ac_word=$2
2585 echo "$as_me:2585: checking for $ac_word" >&5
2586 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2587 if test "${ac_cv_prog_AWK+set}" = set; then
2588   echo $ECHO_N "(cached) $ECHO_C" >&6
2589 else
2590   if test -n "$AWK"; then
2591   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2592 else
2593   ac_save_IFS=$IFS; IFS=$ac_path_separator
2594 ac_dummy="$PATH"
2595 for ac_dir in $ac_dummy; do
2596   IFS=$ac_save_IFS
2597   test -z "$ac_dir" && ac_dir=.
2598   $as_executable_p "$ac_dir/$ac_word" || continue
2599 ac_cv_prog_AWK="$ac_prog"
2600 echo "$as_me:2600: found $ac_dir/$ac_word" >&5
2601 break
2602 done
2603
2604 fi
2605 fi
2606 AWK=$ac_cv_prog_AWK
2607 if test -n "$AWK"; then
2608   echo "$as_me:2608: result: $AWK" >&5
2609 echo "${ECHO_T}$AWK" >&6
2610 else
2611   echo "$as_me:2611: result: no" >&5
2612 echo "${ECHO_T}no" >&6
2613 fi
2614
2615   test -n "$AWK" && break
2616 done
2617
2618 test -z "$AWK" && { { echo "$as_me:2618: error: No awk program found" >&5
2619 echo "$as_me: error: No awk program found" >&2;}
2620    { (exit 1); exit 1; }; }
2621
2622 echo "$as_me:2622: checking for egrep" >&5
2623 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2624 if test "${ac_cv_prog_egrep+set}" = set; then
2625   echo $ECHO_N "(cached) $ECHO_C" >&6
2626 else
2627   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2628                 then ac_cv_prog_egrep='grep -E'
2629                 else ac_cv_prog_egrep='egrep'
2630         fi
2631 fi
2632 echo "$as_me:2632: result: $ac_cv_prog_egrep" >&5
2633 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2634         EGREP=$ac_cv_prog_egrep
2635
2636         test -z "$EGREP" && { { echo "$as_me:2636: error: No egrep program found" >&5
2637 echo "$as_me: error: No egrep program found" >&2;}
2638    { (exit 1); exit 1; }; }
2639
2640 # Find a good install program.  We prefer a C program (faster),
2641 # so one script is as good as another.  But avoid the broken or
2642 # incompatible versions:
2643 # SysV /etc/install, /usr/sbin/install
2644 # SunOS /usr/etc/install
2645 # IRIX /sbin/install
2646 # AIX /bin/install
2647 # AmigaOS /C/install, which installs bootblocks on floppy discs
2648 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2649 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2650 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2651 # ./install, which can be erroneously created by make from ./install.sh.
2652 echo "$as_me:2652: checking for a BSD compatible install" >&5
2653 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2654 if test -z "$INSTALL"; then
2655 if test "${ac_cv_path_install+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_save_IFS=$IFS; IFS=$ac_path_separator
2659   for ac_dir in $PATH; do
2660     IFS=$ac_save_IFS
2661     # Account for people who put trailing slashes in PATH elements.
2662     case $ac_dir/ in
2663     / | ./ | .// | /cC/* \
2664     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2665     | /usr/ucb/* ) ;;
2666     *)
2667       # OSF1 and SCO ODT 3.0 have their own names for install.
2668       # Don't use installbsd from OSF since it installs stuff as root
2669       # by default.
2670       for ac_prog in ginstall scoinst install; do
2671         if $as_executable_p "$ac_dir/$ac_prog"; then
2672           if test $ac_prog = install &&
2673             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2674             # AIX install.  It has an incompatible calling convention.
2675             :
2676           elif test $ac_prog = install &&
2677             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2678             # program-specific install script used by HP pwplus--don't use.
2679             :
2680           else
2681             ac_cv_path_install="$ac_dir/$ac_prog -c"
2682             break 2
2683           fi
2684         fi
2685       done
2686       ;;
2687     esac
2688   done
2689
2690 fi
2691   if test "${ac_cv_path_install+set}" = set; then
2692     INSTALL=$ac_cv_path_install
2693   else
2694     # As a last resort, use the slow shell script.  We don't cache a
2695     # path for INSTALL within a source directory, because that will
2696     # break other packages using the cache if that directory is
2697     # removed, or if the path is relative.
2698     INSTALL=$ac_install_sh
2699   fi
2700 fi
2701 echo "$as_me:2701: result: $INSTALL" >&5
2702 echo "${ECHO_T}$INSTALL" >&6
2703
2704 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2705 # It thinks the first close brace ends the variable substitution.
2706 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2707
2708 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2709
2710 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2711
2712 echo "$as_me:2712: checking whether ln -s works" >&5
2713 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2714 LN_S=$as_ln_s
2715 if test "$LN_S" = "ln -s"; then
2716   echo "$as_me:2716: result: yes" >&5
2717 echo "${ECHO_T}yes" >&6
2718 else
2719   echo "$as_me:2719: result: no, using $LN_S" >&5
2720 echo "${ECHO_T}no, using $LN_S" >&6
2721 fi
2722
2723 echo "$as_me:2723: checking if $LN_S -f options work" >&5
2724 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2725
2726 rm -f conf$$.src conf$$dst
2727 echo >conf$$.dst
2728 echo first >conf$$.src
2729 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2730         cf_prog_ln_sf=yes
2731 else
2732         cf_prog_ln_sf=no
2733 fi
2734 rm -f conf$$.dst conf$$src
2735 echo "$as_me:2735: result: $cf_prog_ln_sf" >&5
2736 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2737
2738 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2739
2740 # Find a good install program.  We prefer a C program (faster),
2741 # so one script is as good as another.  But avoid the broken or
2742 # incompatible versions:
2743 # SysV /etc/install, /usr/sbin/install
2744 # SunOS /usr/etc/install
2745 # IRIX /sbin/install
2746 # AIX /bin/install
2747 # AmigaOS /C/install, which installs bootblocks on floppy discs
2748 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2749 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2750 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2751 # ./install, which can be erroneously created by make from ./install.sh.
2752 echo "$as_me:2752: checking for a BSD compatible install" >&5
2753 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2754 if test -z "$INSTALL"; then
2755 if test "${ac_cv_path_install+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758     ac_save_IFS=$IFS; IFS=$ac_path_separator
2759   for ac_dir in $PATH; do
2760     IFS=$ac_save_IFS
2761     # Account for people who put trailing slashes in PATH elements.
2762     case $ac_dir/ in
2763     / | ./ | .// | /cC/* \
2764     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2765     | /usr/ucb/* ) ;;
2766     *)
2767       # OSF1 and SCO ODT 3.0 have their own names for install.
2768       # Don't use installbsd from OSF since it installs stuff as root
2769       # by default.
2770       for ac_prog in ginstall scoinst install; do
2771         if $as_executable_p "$ac_dir/$ac_prog"; then
2772           if test $ac_prog = install &&
2773             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2774             # AIX install.  It has an incompatible calling convention.
2775             :
2776           elif test $ac_prog = install &&
2777             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2778             # program-specific install script used by HP pwplus--don't use.
2779             :
2780           else
2781             ac_cv_path_install="$ac_dir/$ac_prog -c"
2782             break 2
2783           fi
2784         fi
2785       done
2786       ;;
2787     esac
2788   done
2789
2790 fi
2791   if test "${ac_cv_path_install+set}" = set; then
2792     INSTALL=$ac_cv_path_install
2793   else
2794     # As a last resort, use the slow shell script.  We don't cache a
2795     # path for INSTALL within a source directory, because that will
2796     # break other packages using the cache if that directory is
2797     # removed, or if the path is relative.
2798     INSTALL=$ac_install_sh
2799   fi
2800 fi
2801 echo "$as_me:2801: result: $INSTALL" >&5
2802 echo "${ECHO_T}$INSTALL" >&6
2803
2804 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2805 # It thinks the first close brace ends the variable substitution.
2806 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2807
2808 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2809
2810 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2811
2812 case $INSTALL in
2813 (/*)
2814         ;;
2815 (*)
2816         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2817         test -z "$cf_dir" && cf_dir=.
2818         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2819         ;;
2820 esac
2821
2822 echo "$as_me:2822: checking if you want to install stripped executables" >&5
2823 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2824
2825 # Check whether --enable-stripping or --disable-stripping was given.
2826 if test "${enable_stripping+set}" = set; then
2827   enableval="$enable_stripping"
2828   test "$enableval" != no && enableval=yes
2829         if test "$enableval" != "yes" ; then
2830     with_stripping=no
2831         else
2832                 with_stripping=yes
2833         fi
2834 else
2835   enableval=yes
2836         with_stripping=yes
2837
2838 fi;
2839 echo "$as_me:2839: result: $with_stripping" >&5
2840 echo "${ECHO_T}$with_stripping" >&6
2841
2842 if test "$with_stripping" = yes
2843 then
2844         INSTALL_OPT_S="-s"
2845 else
2846         INSTALL_OPT_S=
2847 fi
2848
2849 : ${INSTALL:=install}
2850 echo "$as_me:2850: checking if install accepts -p option" >&5
2851 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2852 if test "${cf_cv_install_p+set}" = set; then
2853   echo $ECHO_N "(cached) $ECHO_C" >&6
2854 else
2855
2856         rm -rf conftest*
2857         date >conftest.in
2858         mkdir conftest.out
2859         sleep 3
2860         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2861         then
2862                 if test -f conftest.out/conftest.in
2863                 then
2864                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2865                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2866                         if test -s conftest.err
2867                         then
2868                                 cf_cv_install_p=no
2869                         else
2870                                 cf_cv_install_p=yes
2871                         fi
2872                 else
2873                         cf_cv_install_p=no
2874                 fi
2875         else
2876                 cf_cv_install_p=no
2877         fi
2878         rm -rf conftest*
2879
2880 fi
2881 echo "$as_me:2881: result: $cf_cv_install_p" >&5
2882 echo "${ECHO_T}$cf_cv_install_p" >&6
2883
2884 echo "$as_me:2884: checking if install needs to be told about ownership" >&5
2885 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2886 case `$ac_config_guess` in
2887 (*minix)
2888         with_install_o=yes
2889         ;;
2890 (*)
2891         with_install_o=no
2892         ;;
2893 esac
2894
2895 echo "$as_me:2895: result: $with_install_o" >&5
2896 echo "${ECHO_T}$with_install_o" >&6
2897 if test "x$with_install_o" = xyes
2898 then
2899         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'`
2900 else
2901         INSTALL_OPT_O=
2902 fi
2903
2904 echo "$as_me:2904: checking for long file names" >&5
2905 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2906 if test "${ac_cv_sys_long_file_names+set}" = set; then
2907   echo $ECHO_N "(cached) $ECHO_C" >&6
2908 else
2909   ac_cv_sys_long_file_names=yes
2910 # Test for long file names in all the places we know might matter:
2911 #      .                the current directory, where building will happen
2912 #      $prefix/lib      where we will be installing things
2913 #      $exec_prefix/lib likewise
2914 # eval it to expand exec_prefix.
2915 #      $TMPDIR          if set, where it might want to write temporary files
2916 # if $TMPDIR is not set:
2917 #      /tmp             where it might want to write temporary files
2918 #      /var/tmp         likewise
2919 #      /usr/tmp         likewise
2920 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2921   ac_tmpdirs=$TMPDIR
2922 else
2923   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2924 fi
2925 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2926   test -d $ac_dir || continue
2927   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2928   ac_xdir=$ac_dir/cf$$
2929   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2930   ac_tf1=$ac_xdir/conftest9012345
2931   ac_tf2=$ac_xdir/conftest9012346
2932   (echo 1 >$ac_tf1) 2>/dev/null
2933   (echo 2 >$ac_tf2) 2>/dev/null
2934   ac_val=`cat $ac_tf1 2>/dev/null`
2935   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2936     ac_cv_sys_long_file_names=no
2937     rm -rf $ac_xdir 2>/dev/null
2938     break
2939   fi
2940   rm -rf $ac_xdir 2>/dev/null
2941 done
2942 fi
2943 echo "$as_me:2943: result: $ac_cv_sys_long_file_names" >&5
2944 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2945 if test $ac_cv_sys_long_file_names = yes; then
2946
2947 cat >>confdefs.h <<\EOF
2948 #define HAVE_LONG_FILE_NAMES 1
2949 EOF
2950
2951 fi
2952
2953 # if we find pkg-config, check if we should install the ".pc" files.
2954
2955 echo "$as_me:2955: checking if you want to use pkg-config" >&5
2956 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2957
2958 # Check whether --with-pkg-config or --without-pkg-config was given.
2959 if test "${with_pkg_config+set}" = set; then
2960   withval="$with_pkg_config"
2961   cf_pkg_config=$withval
2962 else
2963   cf_pkg_config=yes
2964 fi;
2965 echo "$as_me:2965: result: $cf_pkg_config" >&5
2966 echo "${ECHO_T}$cf_pkg_config" >&6
2967
2968 case $cf_pkg_config in
2969 (no)
2970         PKG_CONFIG=none
2971         ;;
2972 (yes)
2973
2974 if test -n "$ac_tool_prefix"; then
2975   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2976 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2977 echo "$as_me:2977: checking for $ac_word" >&5
2978 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2979 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2980   echo $ECHO_N "(cached) $ECHO_C" >&6
2981 else
2982   case $PKG_CONFIG in
2983   [\\/]* | ?:[\\/]*)
2984   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2985   ;;
2986   *)
2987   ac_save_IFS=$IFS; IFS=$ac_path_separator
2988 ac_dummy="$PATH"
2989 for ac_dir in $ac_dummy; do
2990   IFS=$ac_save_IFS
2991   test -z "$ac_dir" && ac_dir=.
2992   if $as_executable_p "$ac_dir/$ac_word"; then
2993    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2994    echo "$as_me:2994: found $ac_dir/$ac_word" >&5
2995    break
2996 fi
2997 done
2998
2999   ;;
3000 esac
3001 fi
3002 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3003
3004 if test -n "$PKG_CONFIG"; then
3005   echo "$as_me:3005: result: $PKG_CONFIG" >&5
3006 echo "${ECHO_T}$PKG_CONFIG" >&6
3007 else
3008   echo "$as_me:3008: result: no" >&5
3009 echo "${ECHO_T}no" >&6
3010 fi
3011
3012 fi
3013 if test -z "$ac_cv_path_PKG_CONFIG"; then
3014   ac_pt_PKG_CONFIG=$PKG_CONFIG
3015   # Extract the first word of "pkg-config", so it can be a program name with args.
3016 set dummy pkg-config; ac_word=$2
3017 echo "$as_me:3017: checking for $ac_word" >&5
3018 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3019 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3020   echo $ECHO_N "(cached) $ECHO_C" >&6
3021 else
3022   case $ac_pt_PKG_CONFIG in
3023   [\\/]* | ?:[\\/]*)
3024   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3025   ;;
3026   *)
3027   ac_save_IFS=$IFS; IFS=$ac_path_separator
3028 ac_dummy="$PATH"
3029 for ac_dir in $ac_dummy; do
3030   IFS=$ac_save_IFS
3031   test -z "$ac_dir" && ac_dir=.
3032   if $as_executable_p "$ac_dir/$ac_word"; then
3033    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3034    echo "$as_me:3034: found $ac_dir/$ac_word" >&5
3035    break
3036 fi
3037 done
3038
3039   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3040   ;;
3041 esac
3042 fi
3043 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3044
3045 if test -n "$ac_pt_PKG_CONFIG"; then
3046   echo "$as_me:3046: result: $ac_pt_PKG_CONFIG" >&5
3047 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3048 else
3049   echo "$as_me:3049: result: no" >&5
3050 echo "${ECHO_T}no" >&6
3051 fi
3052
3053   PKG_CONFIG=$ac_pt_PKG_CONFIG
3054 else
3055   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3056 fi
3057
3058         ;;
3059 (*)
3060         PKG_CONFIG=$withval
3061         ;;
3062 esac
3063
3064 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3065 if test "$PKG_CONFIG" != none ; then
3066
3067 if test "x$prefix" != xNONE; then
3068         cf_path_syntax="$prefix"
3069 else
3070         cf_path_syntax="$ac_default_prefix"
3071 fi
3072
3073 case ".$PKG_CONFIG" in
3074 (.\$\(*\)*|.\'*\'*)
3075         ;;
3076 (..|./*|.\\*)
3077         ;;
3078 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3079         ;;
3080 (.\${*prefix}*|.\${*dir}*)
3081         eval PKG_CONFIG="$PKG_CONFIG"
3082         case ".$PKG_CONFIG" in
3083         (.NONE/*)
3084                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3085                 ;;
3086         esac
3087         ;;
3088 (.no|.NONE/*)
3089         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
3090         ;;
3091 (*)
3092         { { echo "$as_me:3092: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3093 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3094    { (exit 1); exit 1; }; }
3095         ;;
3096 esac
3097
3098 elif test "x$cf_pkg_config" != xno ; then
3099         { echo "$as_me:3099: WARNING: pkg-config is not installed" >&5
3100 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3101 fi
3102
3103 case $PKG_CONFIG in
3104 (no|none|yes)
3105         echo "$as_me:3105: checking for pkg-config library directory" >&5
3106 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3107         ;;
3108 (*)
3109         echo "$as_me:3109: checking for $PKG_CONFIG library directory" >&5
3110 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3111         ;;
3112 esac
3113
3114 PKG_CONFIG_LIBDIR=no
3115
3116 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3117 if test "${with_pkg_config_libdir+set}" = set; then
3118   withval="$with_pkg_config_libdir"
3119   PKG_CONFIG_LIBDIR=$withval
3120 else
3121   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3122 fi;
3123
3124 case x$PKG_CONFIG_LIBDIR in
3125 (x/*)
3126         ;;
3127 (xyes)
3128         # Look for the library directory using the same prefix as the executable
3129         if test "x$PKG_CONFIG" = xnone
3130         then
3131                 cf_path=$prefix
3132         else
3133                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3134         fi
3135
3136         # If you don't like using the default architecture, you have to specify the
3137         # intended library directory and corresponding compiler/linker options.
3138         #
3139         # This case allows for Debian's 2014-flavor of multiarch, along with the
3140         # most common variations before that point.  Some other variants spell the
3141         # directory differently, e.g., "pkg-config", and put it in unusual places.
3142         # pkg-config has always been poorly standardized, which is ironic...
3143         case x`(arch) 2>/dev/null` in
3144         (*64)
3145                 cf_search_path="\
3146                         $cf_path/lib/*64-linux-gnu \
3147                         $cf_path/share \
3148                         $cf_path/lib64 \
3149                         $cf_path/lib32 \
3150                         $cf_path/lib"
3151                 ;;
3152         (*)
3153                 cf_search_path="\
3154                         $cf_path/lib/*-linux-gnu \
3155                         $cf_path/share \
3156                         $cf_path/lib32 \
3157                         $cf_path/lib \
3158                         $cf_path/libdata"
3159                 ;;
3160         esac
3161
3162         test -n "$verbose" && echo "    list..." 1>&6
3163
3164 echo "${as_me:-configure}:3164: testing list... ..." 1>&5
3165
3166         for cf_config in $cf_search_path
3167         do
3168                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3169
3170 echo "${as_me:-configure}:3170: testing checking $cf_config/pkgconfig ..." 1>&5
3171
3172                 if test -d $cf_config/pkgconfig
3173                 then
3174                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3175                         echo "$as_me:3175: checking done" >&5
3176 echo $ECHO_N "checking done... $ECHO_C" >&6
3177                         break
3178                 fi
3179         done
3180         ;;
3181 (*)
3182         ;;
3183 esac
3184
3185 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3186         echo "$as_me:3186: result: $PKG_CONFIG_LIBDIR" >&5
3187 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3188 fi
3189
3190 echo "$as_me:3190: checking if you want to build test-programs" >&5
3191 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3192
3193 # Check whether --with-tests or --without-tests was given.
3194 if test "${with_tests+set}" = set; then
3195   withval="$with_tests"
3196   cf_with_tests=$withval
3197 else
3198   cf_with_tests=yes
3199 fi;
3200 echo "$as_me:3200: result: $cf_with_tests" >&5
3201 echo "${ECHO_T}$cf_with_tests" >&6
3202
3203 echo "$as_me:3203: checking if we should assume mixed-case filenames" >&5
3204 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3205
3206 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3207 if test "${enable_mixed_case+set}" = set; then
3208   enableval="$enable_mixed_case"
3209   enable_mixedcase=$enableval
3210 else
3211   enable_mixedcase=auto
3212 fi;
3213 echo "$as_me:3213: result: $enable_mixedcase" >&5
3214 echo "${ECHO_T}$enable_mixedcase" >&6
3215 if test "$enable_mixedcase" = "auto" ; then
3216
3217 echo "$as_me:3217: checking if filesystem supports mixed-case filenames" >&5
3218 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3219 if test "${cf_cv_mixedcase+set}" = set; then
3220   echo $ECHO_N "(cached) $ECHO_C" >&6
3221 else
3222
3223 if test "$cross_compiling" = yes ; then
3224         case $target_alias in
3225         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3226                 cf_cv_mixedcase=no
3227                 ;;
3228         (*)
3229                 cf_cv_mixedcase=yes
3230                 ;;
3231         esac
3232 else
3233         rm -f conftest CONFTEST
3234         echo test >conftest
3235         if test -f CONFTEST ; then
3236                 cf_cv_mixedcase=no
3237         else
3238                 cf_cv_mixedcase=yes
3239         fi
3240         rm -f conftest CONFTEST
3241 fi
3242
3243 fi
3244 echo "$as_me:3244: result: $cf_cv_mixedcase" >&5
3245 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3246 test "$cf_cv_mixedcase" = yes &&
3247 cat >>confdefs.h <<\EOF
3248 #define MIXEDCASE_FILENAMES 1
3249 EOF
3250
3251 else
3252         cf_cv_mixedcase=$enable_mixedcase
3253         if test "$enable_mixedcase" = "yes" ; then
3254                 cat >>confdefs.h <<\EOF
3255 #define MIXEDCASE_FILENAMES 1
3256 EOF
3257
3258         fi
3259 fi
3260
3261 # do this after mixed-case option (tags/TAGS is not as important as tic).
3262 echo "$as_me:3262: checking whether ${MAKE-make} sets \${MAKE}" >&5
3263 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3264 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3265 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3266   echo $ECHO_N "(cached) $ECHO_C" >&6
3267 else
3268   cat >conftest.make <<\EOF
3269 all:
3270         @echo 'ac_maketemp="${MAKE}"'
3271 EOF
3272 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3273 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3274 if test -n "$ac_maketemp"; then
3275   eval ac_cv_prog_make_${ac_make}_set=yes
3276 else
3277   eval ac_cv_prog_make_${ac_make}_set=no
3278 fi
3279 rm -f conftest.make
3280 fi
3281 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3282   echo "$as_me:3282: result: yes" >&5
3283 echo "${ECHO_T}yes" >&6
3284   SET_MAKE=
3285 else
3286   echo "$as_me:3286: result: no" >&5
3287 echo "${ECHO_T}no" >&6
3288   SET_MAKE="MAKE=${MAKE-make}"
3289 fi
3290
3291 for ac_prog in exctags ctags
3292 do
3293   # Extract the first word of "$ac_prog", so it can be a program name with args.
3294 set dummy $ac_prog; ac_word=$2
3295 echo "$as_me:3295: checking for $ac_word" >&5
3296 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3297 if test "${ac_cv_prog_CTAGS+set}" = set; then
3298   echo $ECHO_N "(cached) $ECHO_C" >&6
3299 else
3300   if test -n "$CTAGS"; then
3301   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3302 else
3303   ac_save_IFS=$IFS; IFS=$ac_path_separator
3304 ac_dummy="$PATH"
3305 for ac_dir in $ac_dummy; do
3306   IFS=$ac_save_IFS
3307   test -z "$ac_dir" && ac_dir=.
3308   $as_executable_p "$ac_dir/$ac_word" || continue
3309 ac_cv_prog_CTAGS="$ac_prog"
3310 echo "$as_me:3310: found $ac_dir/$ac_word" >&5
3311 break
3312 done
3313
3314 fi
3315 fi
3316 CTAGS=$ac_cv_prog_CTAGS
3317 if test -n "$CTAGS"; then
3318   echo "$as_me:3318: result: $CTAGS" >&5
3319 echo "${ECHO_T}$CTAGS" >&6
3320 else
3321   echo "$as_me:3321: result: no" >&5
3322 echo "${ECHO_T}no" >&6
3323 fi
3324
3325   test -n "$CTAGS" && break
3326 done
3327
3328 for ac_prog in exetags etags
3329 do
3330   # Extract the first word of "$ac_prog", so it can be a program name with args.
3331 set dummy $ac_prog; ac_word=$2
3332 echo "$as_me:3332: checking for $ac_word" >&5
3333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3334 if test "${ac_cv_prog_ETAGS+set}" = set; then
3335   echo $ECHO_N "(cached) $ECHO_C" >&6
3336 else
3337   if test -n "$ETAGS"; then
3338   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3339 else
3340   ac_save_IFS=$IFS; IFS=$ac_path_separator
3341 ac_dummy="$PATH"
3342 for ac_dir in $ac_dummy; do
3343   IFS=$ac_save_IFS
3344   test -z "$ac_dir" && ac_dir=.
3345   $as_executable_p "$ac_dir/$ac_word" || continue
3346 ac_cv_prog_ETAGS="$ac_prog"
3347 echo "$as_me:3347: found $ac_dir/$ac_word" >&5
3348 break
3349 done
3350
3351 fi
3352 fi
3353 ETAGS=$ac_cv_prog_ETAGS
3354 if test -n "$ETAGS"; then
3355   echo "$as_me:3355: result: $ETAGS" >&5
3356 echo "${ECHO_T}$ETAGS" >&6
3357 else
3358   echo "$as_me:3358: result: no" >&5
3359 echo "${ECHO_T}no" >&6
3360 fi
3361
3362   test -n "$ETAGS" && break
3363 done
3364
3365 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3366 set dummy ${CTAGS:-ctags}; ac_word=$2
3367 echo "$as_me:3367: checking for $ac_word" >&5
3368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3369 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3370   echo $ECHO_N "(cached) $ECHO_C" >&6
3371 else
3372   if test -n "$MAKE_LOWER_TAGS"; then
3373   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3374 else
3375   ac_save_IFS=$IFS; IFS=$ac_path_separator
3376 ac_dummy="$PATH"
3377 for ac_dir in $ac_dummy; do
3378   IFS=$ac_save_IFS
3379   test -z "$ac_dir" && ac_dir=.
3380   $as_executable_p "$ac_dir/$ac_word" || continue
3381 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3382 echo "$as_me:3382: found $ac_dir/$ac_word" >&5
3383 break
3384 done
3385
3386   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3387 fi
3388 fi
3389 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3390 if test -n "$MAKE_LOWER_TAGS"; then
3391   echo "$as_me:3391: result: $MAKE_LOWER_TAGS" >&5
3392 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3393 else
3394   echo "$as_me:3394: result: no" >&5
3395 echo "${ECHO_T}no" >&6
3396 fi
3397
3398 if test "$cf_cv_mixedcase" = yes ; then
3399         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3400 set dummy ${ETAGS:-etags}; ac_word=$2
3401 echo "$as_me:3401: checking for $ac_word" >&5
3402 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3403 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3404   echo $ECHO_N "(cached) $ECHO_C" >&6
3405 else
3406   if test -n "$MAKE_UPPER_TAGS"; then
3407   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3408 else
3409   ac_save_IFS=$IFS; IFS=$ac_path_separator
3410 ac_dummy="$PATH"
3411 for ac_dir in $ac_dummy; do
3412   IFS=$ac_save_IFS
3413   test -z "$ac_dir" && ac_dir=.
3414   $as_executable_p "$ac_dir/$ac_word" || continue
3415 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3416 echo "$as_me:3416: found $ac_dir/$ac_word" >&5
3417 break
3418 done
3419
3420   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3421 fi
3422 fi
3423 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3424 if test -n "$MAKE_UPPER_TAGS"; then
3425   echo "$as_me:3425: result: $MAKE_UPPER_TAGS" >&5
3426 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3427 else
3428   echo "$as_me:3428: result: no" >&5
3429 echo "${ECHO_T}no" >&6
3430 fi
3431
3432 else
3433         MAKE_UPPER_TAGS=no
3434 fi
3435
3436 if test "$MAKE_UPPER_TAGS" = yes ; then
3437         MAKE_UPPER_TAGS=
3438 else
3439         MAKE_UPPER_TAGS="#"
3440 fi
3441
3442 if test "$MAKE_LOWER_TAGS" = yes ; then
3443         MAKE_LOWER_TAGS=
3444 else
3445         MAKE_LOWER_TAGS="#"
3446 fi
3447
3448 echo "$as_me:3448: checking for makeflags variable" >&5
3449 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3450 if test "${cf_cv_makeflags+set}" = set; then
3451   echo $ECHO_N "(cached) $ECHO_C" >&6
3452 else
3453
3454         cf_cv_makeflags=''
3455         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3456         do
3457                 cat >cf_makeflags.tmp <<CF_EOF
3458 SHELL = $SHELL
3459 all :
3460         @ echo '.$cf_option'
3461 CF_EOF
3462                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3463                 case "$cf_result" in
3464                 (.*k|.*kw)
3465                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3466                         case "$cf_result" in
3467                         (.*CC=*)        cf_cv_makeflags=
3468                                 ;;
3469                         (*)     cf_cv_makeflags=$cf_option
3470                                 ;;
3471                         esac
3472                         break
3473                         ;;
3474                 (.-)
3475                         ;;
3476                 (*)
3477
3478 echo "${as_me:-configure}:3478: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3479
3480                         ;;
3481                 esac
3482         done
3483         rm -f cf_makeflags.tmp
3484
3485 fi
3486 echo "$as_me:3486: result: $cf_cv_makeflags" >&5
3487 echo "${ECHO_T}$cf_cv_makeflags" >&6
3488
3489 if test -n "$ac_tool_prefix"; then
3490   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3491 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3492 echo "$as_me:3492: checking for $ac_word" >&5
3493 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3494 if test "${ac_cv_prog_RANLIB+set}" = set; then
3495   echo $ECHO_N "(cached) $ECHO_C" >&6
3496 else
3497   if test -n "$RANLIB"; then
3498   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3499 else
3500   ac_save_IFS=$IFS; IFS=$ac_path_separator
3501 ac_dummy="$PATH"
3502 for ac_dir in $ac_dummy; do
3503   IFS=$ac_save_IFS
3504   test -z "$ac_dir" && ac_dir=.
3505   $as_executable_p "$ac_dir/$ac_word" || continue
3506 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3507 echo "$as_me:3507: found $ac_dir/$ac_word" >&5
3508 break
3509 done
3510
3511 fi
3512 fi
3513 RANLIB=$ac_cv_prog_RANLIB
3514 if test -n "$RANLIB"; then
3515   echo "$as_me:3515: result: $RANLIB" >&5
3516 echo "${ECHO_T}$RANLIB" >&6
3517 else
3518   echo "$as_me:3518: result: no" >&5
3519 echo "${ECHO_T}no" >&6
3520 fi
3521
3522 fi
3523 if test -z "$ac_cv_prog_RANLIB"; then
3524   ac_ct_RANLIB=$RANLIB
3525   # Extract the first word of "ranlib", so it can be a program name with args.
3526 set dummy ranlib; ac_word=$2
3527 echo "$as_me:3527: checking for $ac_word" >&5
3528 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3529 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3530   echo $ECHO_N "(cached) $ECHO_C" >&6
3531 else
3532   if test -n "$ac_ct_RANLIB"; then
3533   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3534 else
3535   ac_save_IFS=$IFS; IFS=$ac_path_separator
3536 ac_dummy="$PATH"
3537 for ac_dir in $ac_dummy; do
3538   IFS=$ac_save_IFS
3539   test -z "$ac_dir" && ac_dir=.
3540   $as_executable_p "$ac_dir/$ac_word" || continue
3541 ac_cv_prog_ac_ct_RANLIB="ranlib"
3542 echo "$as_me:3542: found $ac_dir/$ac_word" >&5
3543 break
3544 done
3545
3546   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3547 fi
3548 fi
3549 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3550 if test -n "$ac_ct_RANLIB"; then
3551   echo "$as_me:3551: result: $ac_ct_RANLIB" >&5
3552 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3553 else
3554   echo "$as_me:3554: result: no" >&5
3555 echo "${ECHO_T}no" >&6
3556 fi
3557
3558   RANLIB=$ac_ct_RANLIB
3559 else
3560   RANLIB="$ac_cv_prog_RANLIB"
3561 fi
3562
3563 if test -n "$ac_tool_prefix"; then
3564   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3565 set dummy ${ac_tool_prefix}ld; ac_word=$2
3566 echo "$as_me:3566: checking for $ac_word" >&5
3567 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3568 if test "${ac_cv_prog_LD+set}" = set; then
3569   echo $ECHO_N "(cached) $ECHO_C" >&6
3570 else
3571   if test -n "$LD"; then
3572   ac_cv_prog_LD="$LD" # Let the user override the test.
3573 else
3574   ac_save_IFS=$IFS; IFS=$ac_path_separator
3575 ac_dummy="$PATH"
3576 for ac_dir in $ac_dummy; do
3577   IFS=$ac_save_IFS
3578   test -z "$ac_dir" && ac_dir=.
3579   $as_executable_p "$ac_dir/$ac_word" || continue
3580 ac_cv_prog_LD="${ac_tool_prefix}ld"
3581 echo "$as_me:3581: found $ac_dir/$ac_word" >&5
3582 break
3583 done
3584
3585 fi
3586 fi
3587 LD=$ac_cv_prog_LD
3588 if test -n "$LD"; then
3589   echo "$as_me:3589: result: $LD" >&5
3590 echo "${ECHO_T}$LD" >&6
3591 else
3592   echo "$as_me:3592: result: no" >&5
3593 echo "${ECHO_T}no" >&6
3594 fi
3595
3596 fi
3597 if test -z "$ac_cv_prog_LD"; then
3598   ac_ct_LD=$LD
3599   # Extract the first word of "ld", so it can be a program name with args.
3600 set dummy ld; ac_word=$2
3601 echo "$as_me:3601: checking for $ac_word" >&5
3602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3603 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3604   echo $ECHO_N "(cached) $ECHO_C" >&6
3605 else
3606   if test -n "$ac_ct_LD"; then
3607   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3608 else
3609   ac_save_IFS=$IFS; IFS=$ac_path_separator
3610 ac_dummy="$PATH"
3611 for ac_dir in $ac_dummy; do
3612   IFS=$ac_save_IFS
3613   test -z "$ac_dir" && ac_dir=.
3614   $as_executable_p "$ac_dir/$ac_word" || continue
3615 ac_cv_prog_ac_ct_LD="ld"
3616 echo "$as_me:3616: found $ac_dir/$ac_word" >&5
3617 break
3618 done
3619
3620   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3621 fi
3622 fi
3623 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3624 if test -n "$ac_ct_LD"; then
3625   echo "$as_me:3625: result: $ac_ct_LD" >&5
3626 echo "${ECHO_T}$ac_ct_LD" >&6
3627 else
3628   echo "$as_me:3628: result: no" >&5
3629 echo "${ECHO_T}no" >&6
3630 fi
3631
3632   LD=$ac_ct_LD
3633 else
3634   LD="$ac_cv_prog_LD"
3635 fi
3636
3637 if test -n "$ac_tool_prefix"; then
3638   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3639 set dummy ${ac_tool_prefix}ar; ac_word=$2
3640 echo "$as_me:3640: checking for $ac_word" >&5
3641 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3642 if test "${ac_cv_prog_AR+set}" = set; then
3643   echo $ECHO_N "(cached) $ECHO_C" >&6
3644 else
3645   if test -n "$AR"; then
3646   ac_cv_prog_AR="$AR" # Let the user override the test.
3647 else
3648   ac_save_IFS=$IFS; IFS=$ac_path_separator
3649 ac_dummy="$PATH"
3650 for ac_dir in $ac_dummy; do
3651   IFS=$ac_save_IFS
3652   test -z "$ac_dir" && ac_dir=.
3653   $as_executable_p "$ac_dir/$ac_word" || continue
3654 ac_cv_prog_AR="${ac_tool_prefix}ar"
3655 echo "$as_me:3655: found $ac_dir/$ac_word" >&5
3656 break
3657 done
3658
3659 fi
3660 fi
3661 AR=$ac_cv_prog_AR
3662 if test -n "$AR"; then
3663   echo "$as_me:3663: result: $AR" >&5
3664 echo "${ECHO_T}$AR" >&6
3665 else
3666   echo "$as_me:3666: result: no" >&5
3667 echo "${ECHO_T}no" >&6
3668 fi
3669
3670 fi
3671 if test -z "$ac_cv_prog_AR"; then
3672   ac_ct_AR=$AR
3673   # Extract the first word of "ar", so it can be a program name with args.
3674 set dummy ar; ac_word=$2
3675 echo "$as_me:3675: checking for $ac_word" >&5
3676 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3677 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3678   echo $ECHO_N "(cached) $ECHO_C" >&6
3679 else
3680   if test -n "$ac_ct_AR"; then
3681   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3682 else
3683   ac_save_IFS=$IFS; IFS=$ac_path_separator
3684 ac_dummy="$PATH"
3685 for ac_dir in $ac_dummy; do
3686   IFS=$ac_save_IFS
3687   test -z "$ac_dir" && ac_dir=.
3688   $as_executable_p "$ac_dir/$ac_word" || continue
3689 ac_cv_prog_ac_ct_AR="ar"
3690 echo "$as_me:3690: found $ac_dir/$ac_word" >&5
3691 break
3692 done
3693
3694   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3695 fi
3696 fi
3697 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3698 if test -n "$ac_ct_AR"; then
3699   echo "$as_me:3699: result: $ac_ct_AR" >&5
3700 echo "${ECHO_T}$ac_ct_AR" >&6
3701 else
3702   echo "$as_me:3702: result: no" >&5
3703 echo "${ECHO_T}no" >&6
3704 fi
3705
3706   AR=$ac_ct_AR
3707 else
3708   AR="$ac_cv_prog_AR"
3709 fi
3710
3711 if test -n "$ac_tool_prefix"; then
3712   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3713 set dummy ${ac_tool_prefix}ar; ac_word=$2
3714 echo "$as_me:3714: checking for $ac_word" >&5
3715 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3716 if test "${ac_cv_prog_AR+set}" = set; then
3717   echo $ECHO_N "(cached) $ECHO_C" >&6
3718 else
3719   if test -n "$AR"; then
3720   ac_cv_prog_AR="$AR" # Let the user override the test.
3721 else
3722   ac_save_IFS=$IFS; IFS=$ac_path_separator
3723 ac_dummy="$PATH"
3724 for ac_dir in $ac_dummy; do
3725   IFS=$ac_save_IFS
3726   test -z "$ac_dir" && ac_dir=.
3727   $as_executable_p "$ac_dir/$ac_word" || continue
3728 ac_cv_prog_AR="${ac_tool_prefix}ar"
3729 echo "$as_me:3729: found $ac_dir/$ac_word" >&5
3730 break
3731 done
3732
3733 fi
3734 fi
3735 AR=$ac_cv_prog_AR
3736 if test -n "$AR"; then
3737   echo "$as_me:3737: result: $AR" >&5
3738 echo "${ECHO_T}$AR" >&6
3739 else
3740   echo "$as_me:3740: result: no" >&5
3741 echo "${ECHO_T}no" >&6
3742 fi
3743
3744 fi
3745 if test -z "$ac_cv_prog_AR"; then
3746   ac_ct_AR=$AR
3747   # Extract the first word of "ar", so it can be a program name with args.
3748 set dummy ar; ac_word=$2
3749 echo "$as_me:3749: checking for $ac_word" >&5
3750 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3751 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3752   echo $ECHO_N "(cached) $ECHO_C" >&6
3753 else
3754   if test -n "$ac_ct_AR"; then
3755   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3756 else
3757   ac_save_IFS=$IFS; IFS=$ac_path_separator
3758 ac_dummy="$PATH"
3759 for ac_dir in $ac_dummy; do
3760   IFS=$ac_save_IFS
3761   test -z "$ac_dir" && ac_dir=.
3762   $as_executable_p "$ac_dir/$ac_word" || continue
3763 ac_cv_prog_ac_ct_AR="ar"
3764 echo "$as_me:3764: found $ac_dir/$ac_word" >&5
3765 break
3766 done
3767
3768   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3769 fi
3770 fi
3771 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3772 if test -n "$ac_ct_AR"; then
3773   echo "$as_me:3773: result: $ac_ct_AR" >&5
3774 echo "${ECHO_T}$ac_ct_AR" >&6
3775 else
3776   echo "$as_me:3776: result: no" >&5
3777 echo "${ECHO_T}no" >&6
3778 fi
3779
3780   AR=$ac_ct_AR
3781 else
3782   AR="$ac_cv_prog_AR"
3783 fi
3784
3785 echo "$as_me:3785: checking for options to update archives" >&5
3786 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3787 if test "${cf_cv_ar_flags+set}" = set; then
3788   echo $ECHO_N "(cached) $ECHO_C" >&6
3789 else
3790
3791         case $cf_cv_system_name in
3792         (*-msvc*)
3793                 cf_cv_ar_flags=''
3794                 cat >mk_static_lib.sh <<-EOF
3795                 #!$SHELL
3796                 MSVC_BIN="$AR"
3797                 out="\$1"
3798                 shift
3799                 exec \$MSVC_BIN -out:"\$out" \$@
3800                 EOF
3801                 chmod +x mk_static_lib.sh
3802                 AR=`pwd`/mk_static_lib.sh
3803                 ;;
3804         (*)
3805                 cf_cv_ar_flags=unknown
3806                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3807                 do
3808
3809                         # check if $ARFLAGS already contains this choice
3810                         if test "x$ARFLAGS" != "x" ; then
3811                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3812                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3813                                         cf_cv_ar_flags=
3814                                         break
3815                                 fi
3816                         fi
3817
3818                         rm -f conftest.$ac_cv_objext
3819                         rm -f conftest.a
3820
3821                         cat >conftest.$ac_ext <<EOF
3822 #line 3822 "configure"
3823 int     testdata[3] = { 123, 456, 789 };
3824 EOF
3825                         if { (eval echo "$as_me:3825: \"$ac_compile\"") >&5
3826   (eval $ac_compile) 2>&5
3827   ac_status=$?
3828   echo "$as_me:3828: \$? = $ac_status" >&5
3829   (exit $ac_status); } ; then
3830                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3831                                 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3832                                 if test -f conftest.a ; then
3833                                         cf_cv_ar_flags=$cf_ar_flags
3834                                         break
3835                                 fi
3836                         else
3837                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3838
3839 echo "${as_me:-configure}:3839: testing cannot compile test-program ..." 1>&5
3840
3841                                 break
3842                         fi
3843                 done
3844                 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3845                 ;;
3846         esac
3847
3848 fi
3849 echo "$as_me:3849: result: $cf_cv_ar_flags" >&5
3850 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3851
3852 if test -n "$ARFLAGS" ; then
3853         if test -n "$cf_cv_ar_flags" ; then
3854                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3855         fi
3856 else
3857         ARFLAGS=$cf_cv_ar_flags
3858 fi
3859
3860         echo "$as_me:3860: checking for PATH separator" >&5
3861 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3862         case $cf_cv_system_name in
3863         (os2*)  PATH_SEPARATOR=';'  ;;
3864         (*)     ${PATH_SEPARATOR:=':'}  ;;
3865         esac
3866
3867         echo "$as_me:3867: result: $PATH_SEPARATOR" >&5
3868 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3869
3870 echo "$as_me:3870: checking if you have specified an install-prefix" >&5
3871 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3872
3873 # Check whether --with-install-prefix or --without-install-prefix was given.
3874 if test "${with_install_prefix+set}" = set; then
3875   withval="$with_install_prefix"
3876   case "$withval" in
3877         (yes|no)
3878                 ;;
3879         (*)     DESTDIR="$withval"
3880                 ;;
3881         esac
3882 fi;
3883 echo "$as_me:3883: result: $DESTDIR" >&5
3884 echo "${ECHO_T}$DESTDIR" >&6
3885
3886 ###############################################################################
3887
3888 # If we're cross-compiling, allow the user to override the tools and their
3889 # options.  The configure script is oriented toward identifying the host
3890 # compiler, etc., but we need a build compiler to generate parts of the source.
3891
3892 if test "$cross_compiling" = yes ; then
3893
3894         # defaults that we might want to override
3895         : ${BUILD_CFLAGS:=''}
3896         : ${BUILD_CPPFLAGS:=''}
3897         : ${BUILD_LDFLAGS:=''}
3898         : ${BUILD_LIBS:=''}
3899         : ${BUILD_EXEEXT:='$x'}
3900         : ${BUILD_OBJEXT:='o'}
3901
3902 # Check whether --with-build-cc or --without-build-cc was given.
3903 if test "${with_build_cc+set}" = set; then
3904   withval="$with_build_cc"
3905   BUILD_CC="$withval"
3906 else
3907   for ac_prog in gcc clang c99 c89 cc cl
3908 do
3909   # Extract the first word of "$ac_prog", so it can be a program name with args.
3910 set dummy $ac_prog; ac_word=$2
3911 echo "$as_me:3911: checking for $ac_word" >&5
3912 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3913 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3914   echo $ECHO_N "(cached) $ECHO_C" >&6
3915 else
3916   if test -n "$BUILD_CC"; then
3917   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3918 else
3919   ac_save_IFS=$IFS; IFS=$ac_path_separator
3920 ac_dummy="$PATH"
3921 for ac_dir in $ac_dummy; do
3922   IFS=$ac_save_IFS
3923   test -z "$ac_dir" && ac_dir=.
3924   $as_executable_p "$ac_dir/$ac_word" || continue
3925 ac_cv_prog_BUILD_CC="$ac_prog"
3926 echo "$as_me:3926: found $ac_dir/$ac_word" >&5
3927 break
3928 done
3929
3930 fi
3931 fi
3932 BUILD_CC=$ac_cv_prog_BUILD_CC
3933 if test -n "$BUILD_CC"; then
3934   echo "$as_me:3934: result: $BUILD_CC" >&5
3935 echo "${ECHO_T}$BUILD_CC" >&6
3936 else
3937   echo "$as_me:3937: result: no" >&5
3938 echo "${ECHO_T}no" >&6
3939 fi
3940
3941   test -n "$BUILD_CC" && break
3942 done
3943 test -n "$BUILD_CC" || BUILD_CC="none"
3944
3945 fi;
3946         echo "$as_me:3946: checking for native build C compiler" >&5
3947 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3948         echo "$as_me:3948: result: $BUILD_CC" >&5
3949 echo "${ECHO_T}$BUILD_CC" >&6
3950
3951         echo "$as_me:3951: checking for native build C preprocessor" >&5
3952 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3953
3954 # Check whether --with-build-cpp or --without-build-cpp was given.
3955 if test "${with_build_cpp+set}" = set; then
3956   withval="$with_build_cpp"
3957   BUILD_CPP="$withval"
3958 else
3959   BUILD_CPP='${BUILD_CC} -E'
3960 fi;
3961         echo "$as_me:3961: result: $BUILD_CPP" >&5
3962 echo "${ECHO_T}$BUILD_CPP" >&6
3963
3964         echo "$as_me:3964: checking for native build C flags" >&5
3965 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3966
3967 # Check whether --with-build-cflags or --without-build-cflags was given.
3968 if test "${with_build_cflags+set}" = set; then
3969   withval="$with_build_cflags"
3970   BUILD_CFLAGS="$withval"
3971 fi;
3972         echo "$as_me:3972: result: $BUILD_CFLAGS" >&5
3973 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3974
3975         echo "$as_me:3975: checking for native build C preprocessor-flags" >&5
3976 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3977
3978 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3979 if test "${with_build_cppflags+set}" = set; then
3980   withval="$with_build_cppflags"
3981   BUILD_CPPFLAGS="$withval"
3982 fi;
3983         echo "$as_me:3983: result: $BUILD_CPPFLAGS" >&5
3984 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3985
3986         echo "$as_me:3986: checking for native build linker-flags" >&5
3987 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3988
3989 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3990 if test "${with_build_ldflags+set}" = set; then
3991   withval="$with_build_ldflags"
3992   BUILD_LDFLAGS="$withval"
3993 fi;
3994         echo "$as_me:3994: result: $BUILD_LDFLAGS" >&5
3995 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3996
3997         echo "$as_me:3997: checking for native build linker-libraries" >&5
3998 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3999
4000 # Check whether --with-build-libs or --without-build-libs was given.
4001 if test "${with_build_libs+set}" = set; then
4002   withval="$with_build_libs"
4003   BUILD_LIBS="$withval"
4004 fi;
4005         echo "$as_me:4005: result: $BUILD_LIBS" >&5
4006 echo "${ECHO_T}$BUILD_LIBS" >&6
4007
4008         # this assumes we're on Unix.
4009         BUILD_EXEEXT=
4010         BUILD_OBJEXT=o
4011
4012         : ${BUILD_CC:='${CC}'}
4013
4014         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
4015                 { { echo "$as_me:4015: error: Cross-build requires two compilers.
4016 Use --with-build-cc to specify the native compiler." >&5
4017 echo "$as_me: error: Cross-build requires two compilers.
4018 Use --with-build-cc to specify the native compiler." >&2;}
4019    { (exit 1); exit 1; }; }
4020         fi
4021
4022 else
4023         : ${BUILD_CC:='${CC}'}
4024         : ${BUILD_CPP:='${CPP}'}
4025         : ${BUILD_CFLAGS:='${CFLAGS}'}
4026         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4027         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4028         : ${BUILD_LIBS:='${LIBS}'}
4029         : ${BUILD_EXEEXT:='$x'}
4030         : ${BUILD_OBJEXT:='o'}
4031 fi
4032
4033 ###############################################################################
4034
4035 ### Options to allow the user to specify the set of libraries which are used.
4036 ### Use "--without-normal --with-shared" to allow the default model to be
4037 ### shared, for example.
4038 cf_list_models=""
4039
4040 echo "$as_me:4040: checking if you want to build shared C-objects" >&5
4041 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4042
4043 # Check whether --with-shared or --without-shared was given.
4044 if test "${with_shared+set}" = set; then
4045   withval="$with_shared"
4046   with_shared=$withval
4047 else
4048   with_shared=no
4049 fi;
4050 echo "$as_me:4050: result: $with_shared" >&5
4051 echo "${ECHO_T}$with_shared" >&6
4052 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4053
4054 echo "$as_me:4054: checking for specified models" >&5
4055 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4056 test -z "$cf_list_models" && cf_list_models=normal
4057 echo "$as_me:4057: result: $cf_list_models" >&5
4058 echo "${ECHO_T}$cf_list_models" >&6
4059
4060 ### Use the first model as the default, and save its suffix for use in building
4061 ### up test-applications.
4062 echo "$as_me:4062: checking for default model" >&5
4063 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4064 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4065 echo "$as_me:4065: result: $DFT_LWR_MODEL" >&5
4066 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4067
4068 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4069
4070 echo "$as_me:4070: checking for specific curses-directory" >&5
4071 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4072
4073 # Check whether --with-curses-dir or --without-curses-dir was given.
4074 if test "${with_curses_dir+set}" = set; then
4075   withval="$with_curses_dir"
4076   cf_cv_curses_dir=$withval
4077 else
4078   cf_cv_curses_dir=no
4079 fi;
4080 echo "$as_me:4080: result: $cf_cv_curses_dir" >&5
4081 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4082
4083 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4084 then
4085
4086 if test "x$prefix" != xNONE; then
4087         cf_path_syntax="$prefix"
4088 else
4089         cf_path_syntax="$ac_default_prefix"
4090 fi
4091
4092 case ".$withval" in
4093 (.\$\(*\)*|.\'*\'*)
4094         ;;
4095 (..|./*|.\\*)
4096         ;;
4097 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4098         ;;
4099 (.\${*prefix}*|.\${*dir}*)
4100         eval withval="$withval"
4101         case ".$withval" in
4102         (.NONE/*)
4103                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4104                 ;;
4105         esac
4106         ;;
4107 (.no|.NONE/*)
4108         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4109         ;;
4110 (*)
4111         { { echo "$as_me:4111: error: expected a pathname, not \"$withval\"" >&5
4112 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4113    { (exit 1); exit 1; }; }
4114         ;;
4115 esac
4116
4117         if test -d "$cf_cv_curses_dir"
4118         then
4119
4120 if test -n "$cf_cv_curses_dir/include" ; then
4121   for cf_add_incdir in $cf_cv_curses_dir/include
4122   do
4123         while test $cf_add_incdir != /usr/include
4124         do
4125           if test -d $cf_add_incdir
4126           then
4127                 cf_have_incdir=no
4128                 if test -n "$CFLAGS$CPPFLAGS" ; then
4129                   # a loop is needed to ensure we can add subdirs of existing dirs
4130                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4131                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4132                           cf_have_incdir=yes; break
4133                         fi
4134                   done
4135                 fi
4136
4137                 if test "$cf_have_incdir" = no ; then
4138                   if test "$cf_add_incdir" = /usr/local/include ; then
4139                         if test "$GCC" = yes
4140                         then
4141                           cf_save_CPPFLAGS=$CPPFLAGS
4142
4143         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4144         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4145
4146                           cat >conftest.$ac_ext <<_ACEOF
4147 #line 4147 "configure"
4148 #include "confdefs.h"
4149 #include <stdio.h>
4150 int
4151 main (void)
4152 {
4153 printf("Hello")
4154   ;
4155   return 0;
4156 }
4157 _ACEOF
4158 rm -f conftest.$ac_objext
4159 if { (eval echo "$as_me:4159: \"$ac_compile\"") >&5
4160   (eval $ac_compile) 2>&5
4161   ac_status=$?
4162   echo "$as_me:4162: \$? = $ac_status" >&5
4163   (exit $ac_status); } &&
4164          { ac_try='test -s conftest.$ac_objext'
4165   { (eval echo "$as_me:4165: \"$ac_try\"") >&5
4166   (eval $ac_try) 2>&5
4167   ac_status=$?
4168   echo "$as_me:4168: \$? = $ac_status" >&5
4169   (exit $ac_status); }; }; then
4170   :
4171 else
4172   echo "$as_me: failed program was:" >&5
4173 cat conftest.$ac_ext >&5
4174 cf_have_incdir=yes
4175 fi
4176 rm -f conftest.$ac_objext conftest.$ac_ext
4177                           CPPFLAGS=$cf_save_CPPFLAGS
4178                         fi
4179                   fi
4180                 fi
4181
4182                 if test "$cf_have_incdir" = no ; then
4183                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4184
4185 echo "${as_me:-configure}:4185: testing adding $cf_add_incdir to include-path ..." 1>&5
4186
4187                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4188
4189                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4190                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4191                   cf_add_incdir="$cf_top_incdir"
4192                 else
4193                   break
4194                 fi
4195           else
4196                 break
4197           fi
4198         done
4199   done
4200 fi
4201
4202 if test -n "$cf_cv_curses_dir/lib" ; then
4203         for cf_add_libdir in $cf_cv_curses_dir/lib
4204         do
4205                 if test $cf_add_libdir = /usr/lib ; then
4206                         :
4207                 elif test -d $cf_add_libdir
4208                 then
4209                         cf_have_libdir=no
4210                         if test -n "$LDFLAGS$LIBS" ; then
4211                                 # a loop is needed to ensure we can add subdirs of existing dirs
4212                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4213                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4214                                                 cf_have_libdir=yes; break
4215                                         fi
4216                                 done
4217                         fi
4218                         if test "$cf_have_libdir" = no ; then
4219                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4220
4221 echo "${as_me:-configure}:4221: testing adding $cf_add_libdir to library-path ..." 1>&5
4222
4223                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4224                         fi
4225                 fi
4226         done
4227 fi
4228
4229         fi
4230 fi
4231
4232 cf_ncuconfig_root=ncurses
4233 cf_have_ncuconfig=no
4234
4235 if test "x${PKG_CONFIG:=none}" != xnone; then
4236         echo "$as_me:4236: checking pkg-config for $cf_ncuconfig_root" >&5
4237 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4238         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4239                 echo "$as_me:4239: result: yes" >&5
4240 echo "${ECHO_T}yes" >&6
4241
4242                 echo "$as_me:4242: checking if the $cf_ncuconfig_root package files work" >&5
4243 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4244                 cf_have_ncuconfig=unknown
4245
4246                 cf_save_CFLAGS="$CFLAGS"
4247                 cf_save_CPPFLAGS="$CPPFLAGS"
4248                 cf_save_LIBS="$LIBS"
4249
4250                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
4251                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
4252
4253                 # while -W for passing linker flags is prevalent, it is not "standard".
4254                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4255                 # incompatible _and_ non-standard -W option which gives an error.  Work
4256                 # around that pitfall.
4257                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4258                 (x*c[89]9@@*-W*)
4259
4260 cf_fix_cppflags=no
4261 cf_new_cflags=
4262 cf_new_cppflags=
4263 cf_new_extra_cppflags=
4264
4265 for cf_add_cflags in $cf_pkg_cflags
4266 do
4267 case $cf_fix_cppflags in
4268 (no)
4269         case $cf_add_cflags in
4270         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4271                 case $cf_add_cflags in
4272                 (-D*)
4273                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4274
4275                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4276                                 && test -z "${cf_tst_cflags}" \
4277                                 && cf_fix_cppflags=yes
4278
4279                         if test $cf_fix_cppflags = yes ; then
4280
4281         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4282         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4283
4284                                 continue
4285                         elif test "${cf_tst_cflags}" = "\"'" ; then
4286
4287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4289
4290                                 continue
4291                         fi
4292                         ;;
4293                 esac
4294                 case "$CPPFLAGS" in
4295                 (*$cf_add_cflags)
4296                         ;;
4297                 (*)
4298                         case $cf_add_cflags in
4299                         (-D*)
4300                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4301
4302 CPPFLAGS=`echo "$CPPFLAGS" | \
4303         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4304                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4305
4306                                 ;;
4307                         esac
4308
4309         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4310         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4311
4312                         ;;
4313                 esac
4314                 ;;
4315         (*)
4316
4317         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4318         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4319
4320                 ;;
4321         esac
4322         ;;
4323 (yes)
4324
4325         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4326         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4327
4328         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4329
4330         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4331                 && test -z "${cf_tst_cflags}" \
4332                 && cf_fix_cppflags=no
4333         ;;
4334 esac
4335 done
4336
4337 if test -n "$cf_new_cflags" ; then
4338
4339         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4340         CFLAGS="${CFLAGS}$cf_new_cflags"
4341
4342 fi
4343
4344 if test -n "$cf_new_cppflags" ; then
4345
4346         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4347         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4348
4349 fi
4350
4351 if test -n "$cf_new_extra_cppflags" ; then
4352
4353         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4354         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4355
4356 fi
4357
4358 cf_add_libs="$LIBS"
4359 # reverse order
4360 cf_add_0lib=
4361 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4362 # filter duplicates
4363 for cf_add_1lib in $cf_add_0lib; do
4364         for cf_add_2lib in $cf_add_libs; do
4365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4366                         cf_add_1lib=
4367                         break
4368                 fi
4369         done
4370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4371 done
4372 LIBS="$cf_add_libs"
4373
4374                         cat >conftest.$ac_ext <<_ACEOF
4375 #line 4375 "configure"
4376 #include "confdefs.h"
4377 #include <${cf_cv_ncurses_header:-curses.h}>
4378 int
4379 main (void)
4380 {
4381 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4382   ;
4383   return 0;
4384 }
4385 _ACEOF
4386 rm -f conftest.$ac_objext conftest$ac_exeext
4387 if { (eval echo "$as_me:4387: \"$ac_link\"") >&5
4388   (eval $ac_link) 2>&5
4389   ac_status=$?
4390   echo "$as_me:4390: \$? = $ac_status" >&5
4391   (exit $ac_status); } &&
4392          { ac_try='test -s conftest$ac_exeext'
4393   { (eval echo "$as_me:4393: \"$ac_try\"") >&5
4394   (eval $ac_try) 2>&5
4395   ac_status=$?
4396   echo "$as_me:4396: \$? = $ac_status" >&5
4397   (exit $ac_status); }; }; then
4398   if test "$cross_compiling" = yes; then
4399   cf_test_ncuconfig=maybe
4400 else
4401   cat >conftest.$ac_ext <<_ACEOF
4402 #line 4402 "configure"
4403 #include "confdefs.h"
4404 #include <${cf_cv_ncurses_header:-curses.h}>
4405                                         int main(void)
4406                                         { char *xx = curses_version(); return (xx == 0); }
4407 _ACEOF
4408 rm -f conftest$ac_exeext
4409 if { (eval echo "$as_me:4409: \"$ac_link\"") >&5
4410   (eval $ac_link) 2>&5
4411   ac_status=$?
4412   echo "$as_me:4412: \$? = $ac_status" >&5
4413   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4414   { (eval echo "$as_me:4414: \"$ac_try\"") >&5
4415   (eval $ac_try) 2>&5
4416   ac_status=$?
4417   echo "$as_me:4417: \$? = $ac_status" >&5
4418   (exit $ac_status); }; }; then
4419   cf_test_ncuconfig=yes
4420 else
4421   echo "$as_me: program exited with status $ac_status" >&5
4422 echo "$as_me: failed program was:" >&5
4423 cat conftest.$ac_ext >&5
4424 cf_test_ncuconfig=no
4425 fi
4426 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4427 fi
4428 else
4429   echo "$as_me: failed program was:" >&5
4430 cat conftest.$ac_ext >&5
4431 cf_test_ncuconfig=no
4432 fi
4433 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4434
4435                         CFLAGS="$cf_save_CFLAGS"
4436                         CPPFLAGS="$cf_save_CPPFLAGS"
4437                         LIBS="$cf_save_LIBS"
4438
4439                         if test "x$cf_test_ncuconfig" != xyes; then
4440                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4441                                 cf_pkg_cflags="$cf_temp"
4442                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4443                                 cf_pkg_libs="$cf_temp"
4444                         fi
4445                         ;;
4446                 esac
4447
4448 cf_fix_cppflags=no
4449 cf_new_cflags=
4450 cf_new_cppflags=
4451 cf_new_extra_cppflags=
4452
4453 for cf_add_cflags in $cf_pkg_cflags
4454 do
4455 case $cf_fix_cppflags in
4456 (no)
4457         case $cf_add_cflags in
4458         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4459                 case $cf_add_cflags in
4460                 (-D*)
4461                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4462
4463                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4464                                 && test -z "${cf_tst_cflags}" \
4465                                 && cf_fix_cppflags=yes
4466
4467                         if test $cf_fix_cppflags = yes ; then
4468
4469         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4470         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4471
4472                                 continue
4473                         elif test "${cf_tst_cflags}" = "\"'" ; then
4474
4475         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4476         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4477
4478                                 continue
4479                         fi
4480                         ;;
4481                 esac
4482                 case "$CPPFLAGS" in
4483                 (*$cf_add_cflags)
4484                         ;;
4485                 (*)
4486                         case $cf_add_cflags in
4487                         (-D*)
4488                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4489
4490 CPPFLAGS=`echo "$CPPFLAGS" | \
4491         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4492                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4493
4494                                 ;;
4495                         esac
4496
4497         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4498         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4499
4500                         ;;
4501                 esac
4502                 ;;
4503         (*)
4504
4505         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4506         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4507
4508                 ;;
4509         esac
4510         ;;
4511 (yes)
4512
4513         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4514         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4515
4516         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4517
4518         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4519                 && test -z "${cf_tst_cflags}" \
4520                 && cf_fix_cppflags=no
4521         ;;
4522 esac
4523 done
4524
4525 if test -n "$cf_new_cflags" ; then
4526
4527         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4528         CFLAGS="${CFLAGS}$cf_new_cflags"
4529
4530 fi
4531
4532 if test -n "$cf_new_cppflags" ; then
4533
4534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4535         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4536
4537 fi
4538
4539 if test -n "$cf_new_extra_cppflags" ; then
4540
4541         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4542         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4543
4544 fi
4545
4546 cf_add_libs="$LIBS"
4547 # reverse order
4548 cf_add_0lib=
4549 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4550 # filter duplicates
4551 for cf_add_1lib in $cf_add_0lib; do
4552         for cf_add_2lib in $cf_add_libs; do
4553                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4554                         cf_add_1lib=
4555                         break
4556                 fi
4557         done
4558         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4559 done
4560 LIBS="$cf_add_libs"
4561
4562                 cat >conftest.$ac_ext <<_ACEOF
4563 #line 4563 "configure"
4564 #include "confdefs.h"
4565 #include <${cf_cv_ncurses_header:-curses.h}>
4566 int
4567 main (void)
4568 {
4569 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4570   ;
4571   return 0;
4572 }
4573 _ACEOF
4574 rm -f conftest.$ac_objext conftest$ac_exeext
4575 if { (eval echo "$as_me:4575: \"$ac_link\"") >&5
4576   (eval $ac_link) 2>&5
4577   ac_status=$?
4578   echo "$as_me:4578: \$? = $ac_status" >&5
4579   (exit $ac_status); } &&
4580          { ac_try='test -s conftest$ac_exeext'
4581   { (eval echo "$as_me:4581: \"$ac_try\"") >&5
4582   (eval $ac_try) 2>&5
4583   ac_status=$?
4584   echo "$as_me:4584: \$? = $ac_status" >&5
4585   (exit $ac_status); }; }; then
4586   if test "$cross_compiling" = yes; then
4587   cf_have_ncuconfig=maybe
4588 else
4589   cat >conftest.$ac_ext <<_ACEOF
4590 #line 4590 "configure"
4591 #include "confdefs.h"
4592 #include <${cf_cv_ncurses_header:-curses.h}>
4593                                 int main(void)
4594                                 { char *xx = curses_version(); return (xx == 0); }
4595 _ACEOF
4596 rm -f conftest$ac_exeext
4597 if { (eval echo "$as_me:4597: \"$ac_link\"") >&5
4598   (eval $ac_link) 2>&5
4599   ac_status=$?
4600   echo "$as_me:4600: \$? = $ac_status" >&5
4601   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4602   { (eval echo "$as_me:4602: \"$ac_try\"") >&5
4603   (eval $ac_try) 2>&5
4604   ac_status=$?
4605   echo "$as_me:4605: \$? = $ac_status" >&5
4606   (exit $ac_status); }; }; then
4607   cf_have_ncuconfig=yes
4608 else
4609   echo "$as_me: program exited with status $ac_status" >&5
4610 echo "$as_me: failed program was:" >&5
4611 cat conftest.$ac_ext >&5
4612 cf_have_ncuconfig=no
4613 fi
4614 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4615 fi
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat conftest.$ac_ext >&5
4619 cf_have_ncuconfig=no
4620 fi
4621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4622                 echo "$as_me:4622: result: $cf_have_ncuconfig" >&5
4623 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4624                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4625                 if test "$cf_have_ncuconfig" != "yes"
4626                 then
4627                         CPPFLAGS="$cf_save_CPPFLAGS"
4628                         LIBS="$cf_save_LIBS"
4629                         NCURSES_CONFIG_PKG=none
4630                 else
4631
4632 cat >>confdefs.h <<\EOF
4633 #define NCURSES 1
4634 EOF
4635
4636                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4637
4638 echo "$as_me:4638: checking for terminfo header" >&5
4639 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4640 if test "${cf_cv_term_header+set}" = set; then
4641   echo $ECHO_N "(cached) $ECHO_C" >&6
4642 else
4643
4644 case ${cf_cv_ncurses_header} in
4645 (*/ncurses.h|*/ncursesw.h)
4646         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4647         ;;
4648 (*)
4649         cf_term_header=term.h
4650         ;;
4651 esac
4652
4653 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4654 do
4655 cat >conftest.$ac_ext <<_ACEOF
4656 #line 4656 "configure"
4657 #include "confdefs.h"
4658 #include <stdio.h>
4659 #include <${cf_cv_ncurses_header:-curses.h}>
4660 #include <$cf_test>
4661
4662 int
4663 main (void)
4664 {
4665 int x = auto_left_margin; (void)x
4666   ;
4667   return 0;
4668 }
4669 _ACEOF
4670 rm -f conftest.$ac_objext
4671 if { (eval echo "$as_me:4671: \"$ac_compile\"") >&5
4672   (eval $ac_compile) 2>&5
4673   ac_status=$?
4674   echo "$as_me:4674: \$? = $ac_status" >&5
4675   (exit $ac_status); } &&
4676          { ac_try='test -s conftest.$ac_objext'
4677   { (eval echo "$as_me:4677: \"$ac_try\"") >&5
4678   (eval $ac_try) 2>&5
4679   ac_status=$?
4680   echo "$as_me:4680: \$? = $ac_status" >&5
4681   (exit $ac_status); }; }; then
4682
4683         cf_cv_term_header="$cf_test"
4684 else
4685   echo "$as_me: failed program was:" >&5
4686 cat conftest.$ac_ext >&5
4687
4688         cf_cv_term_header=unknown
4689
4690 fi
4691 rm -f conftest.$ac_objext conftest.$ac_ext
4692         test "$cf_cv_term_header" != unknown && break
4693 done
4694
4695 fi
4696 echo "$as_me:4696: result: $cf_cv_term_header" >&5
4697 echo "${ECHO_T}$cf_cv_term_header" >&6
4698
4699 # Set definitions to allow ifdef'ing to accommodate subdirectories
4700
4701 case $cf_cv_term_header in
4702 (*term.h)
4703
4704 cat >>confdefs.h <<\EOF
4705 #define HAVE_TERM_H 1
4706 EOF
4707
4708         ;;
4709 esac
4710
4711 case $cf_cv_term_header in
4712 (ncurses/term.h)
4713
4714 cat >>confdefs.h <<\EOF
4715 #define HAVE_NCURSES_TERM_H 1
4716 EOF
4717
4718         ;;
4719 (ncursesw/term.h)
4720
4721 cat >>confdefs.h <<\EOF
4722 #define HAVE_NCURSESW_TERM_H 1
4723 EOF
4724
4725         ;;
4726 esac
4727
4728                 fi
4729
4730         else
4731                 echo "$as_me:4731: result: no" >&5
4732 echo "${ECHO_T}no" >&6
4733                 NCURSES_CONFIG_PKG=none
4734         fi
4735 else
4736         NCURSES_CONFIG_PKG=none
4737 fi
4738
4739 if test "x$cf_have_ncuconfig" = "xno"; then
4740         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4741
4742 if test -n "$ac_tool_prefix"; then
4743   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4744   do
4745     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4746 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4747 echo "$as_me:4747: checking for $ac_word" >&5
4748 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4749 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4750   echo $ECHO_N "(cached) $ECHO_C" >&6
4751 else
4752   if test -n "$NCURSES_CONFIG"; then
4753   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4754 else
4755   ac_save_IFS=$IFS; IFS=$ac_path_separator
4756 ac_dummy="$PATH"
4757 for ac_dir in $ac_dummy; do
4758   IFS=$ac_save_IFS
4759   test -z "$ac_dir" && ac_dir=.
4760   $as_executable_p "$ac_dir/$ac_word" || continue
4761 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4762 echo "$as_me:4762: found $ac_dir/$ac_word" >&5
4763 break
4764 done
4765
4766 fi
4767 fi
4768 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4769 if test -n "$NCURSES_CONFIG"; then
4770   echo "$as_me:4770: result: $NCURSES_CONFIG" >&5
4771 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4772 else
4773   echo "$as_me:4773: result: no" >&5
4774 echo "${ECHO_T}no" >&6
4775 fi
4776
4777     test -n "$NCURSES_CONFIG" && break
4778   done
4779 fi
4780 if test -z "$NCURSES_CONFIG"; then
4781   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4782   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4783 do
4784   # Extract the first word of "$ac_prog", so it can be a program name with args.
4785 set dummy $ac_prog; ac_word=$2
4786 echo "$as_me:4786: checking for $ac_word" >&5
4787 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4788 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4789   echo $ECHO_N "(cached) $ECHO_C" >&6
4790 else
4791   if test -n "$ac_ct_NCURSES_CONFIG"; then
4792   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4793 else
4794   ac_save_IFS=$IFS; IFS=$ac_path_separator
4795 ac_dummy="$PATH"
4796 for ac_dir in $ac_dummy; do
4797   IFS=$ac_save_IFS
4798   test -z "$ac_dir" && ac_dir=.
4799   $as_executable_p "$ac_dir/$ac_word" || continue
4800 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4801 echo "$as_me:4801: found $ac_dir/$ac_word" >&5
4802 break
4803 done
4804
4805 fi
4806 fi
4807 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4808 if test -n "$ac_ct_NCURSES_CONFIG"; then
4809   echo "$as_me:4809: result: $ac_ct_NCURSES_CONFIG" >&5
4810 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4811 else
4812   echo "$as_me:4812: result: no" >&5
4813 echo "${ECHO_T}no" >&6
4814 fi
4815
4816   test -n "$ac_ct_NCURSES_CONFIG" && break
4817 done
4818 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4819
4820   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4821 fi
4822
4823         if test "$NCURSES_CONFIG" != none ; then
4824
4825 cf_fix_cppflags=no
4826 cf_new_cflags=
4827 cf_new_cppflags=
4828 cf_new_extra_cppflags=
4829
4830 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4831 do
4832 case $cf_fix_cppflags in
4833 (no)
4834         case $cf_add_cflags in
4835         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4836                 case $cf_add_cflags in
4837                 (-D*)
4838                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4839
4840                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4841                                 && test -z "${cf_tst_cflags}" \
4842                                 && cf_fix_cppflags=yes
4843
4844                         if test $cf_fix_cppflags = yes ; then
4845
4846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4848
4849                                 continue
4850                         elif test "${cf_tst_cflags}" = "\"'" ; then
4851
4852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4854
4855                                 continue
4856                         fi
4857                         ;;
4858                 esac
4859                 case "$CPPFLAGS" in
4860                 (*$cf_add_cflags)
4861                         ;;
4862                 (*)
4863                         case $cf_add_cflags in
4864                         (-D*)
4865                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4866
4867 CPPFLAGS=`echo "$CPPFLAGS" | \
4868         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4869                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4870
4871                                 ;;
4872                         esac
4873
4874         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4875         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4876
4877                         ;;
4878                 esac
4879                 ;;
4880         (*)
4881
4882         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4883         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4884
4885                 ;;
4886         esac
4887         ;;
4888 (yes)
4889
4890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4892
4893         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4894
4895         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4896                 && test -z "${cf_tst_cflags}" \
4897                 && cf_fix_cppflags=no
4898         ;;
4899 esac
4900 done
4901
4902 if test -n "$cf_new_cflags" ; then
4903
4904         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4905         CFLAGS="${CFLAGS}$cf_new_cflags"
4906
4907 fi
4908
4909 if test -n "$cf_new_cppflags" ; then
4910
4911         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4912         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4913
4914 fi
4915
4916 if test -n "$cf_new_extra_cppflags" ; then
4917
4918         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4919         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4920
4921 fi
4922
4923 cf_add_libs="$LIBS"
4924 # reverse order
4925 cf_add_0lib=
4926 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4927 # filter duplicates
4928 for cf_add_1lib in $cf_add_0lib; do
4929         for cf_add_2lib in $cf_add_libs; do
4930                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4931                         cf_add_1lib=
4932                         break
4933                 fi
4934         done
4935         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4936 done
4937 LIBS="$cf_add_libs"
4938
4939                 # even with config script, some packages use no-override for curses.h
4940
4941 echo "$as_me:4941: checking if we have identified curses headers" >&5
4942 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4943 if test "${cf_cv_ncurses_header+set}" = set; then
4944   echo $ECHO_N "(cached) $ECHO_C" >&6
4945 else
4946
4947 cf_cv_ncurses_header=none
4948 for cf_header in \
4949         ncurses.h ncurses/ncurses.h \
4950         curses.h ncurses/curses.h
4951 do
4952 cat >conftest.$ac_ext <<_ACEOF
4953 #line 4953 "configure"
4954 #include "confdefs.h"
4955 #include <${cf_header}>
4956 int
4957 main (void)
4958 {
4959 initscr(); tgoto("?", 0,0)
4960   ;
4961   return 0;
4962 }
4963 _ACEOF
4964 rm -f conftest.$ac_objext
4965 if { (eval echo "$as_me:4965: \"$ac_compile\"") >&5
4966   (eval $ac_compile) 2>&5
4967   ac_status=$?
4968   echo "$as_me:4968: \$? = $ac_status" >&5
4969   (exit $ac_status); } &&
4970          { ac_try='test -s conftest.$ac_objext'
4971   { (eval echo "$as_me:4971: \"$ac_try\"") >&5
4972   (eval $ac_try) 2>&5
4973   ac_status=$?
4974   echo "$as_me:4974: \$? = $ac_status" >&5
4975   (exit $ac_status); }; }; then
4976   cf_cv_ncurses_header=$cf_header; break
4977 else
4978   echo "$as_me: failed program was:" >&5
4979 cat conftest.$ac_ext >&5
4980 fi
4981 rm -f conftest.$ac_objext conftest.$ac_ext
4982 done
4983
4984 fi
4985 echo "$as_me:4985: result: $cf_cv_ncurses_header" >&5
4986 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4987
4988 if test "$cf_cv_ncurses_header" = none ; then
4989         { { echo "$as_me:4989: error: No curses header-files found" >&5
4990 echo "$as_me: error: No curses header-files found" >&2;}
4991    { (exit 1); exit 1; }; }
4992 fi
4993
4994 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4995
4996 for ac_header in $cf_cv_ncurses_header
4997 do
4998 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4999 echo "$as_me:4999: checking for $ac_header" >&5
5000 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5001 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5002   echo $ECHO_N "(cached) $ECHO_C" >&6
5003 else
5004   cat >conftest.$ac_ext <<_ACEOF
5005 #line 5005 "configure"
5006 #include "confdefs.h"
5007 #include <$ac_header>
5008 _ACEOF
5009 if { (eval echo "$as_me:5009: \"$ac_cpp conftest.$ac_ext\"") >&5
5010   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5011   ac_status=$?
5012   egrep -v '^ *\+' conftest.er1 >conftest.err
5013   rm -f conftest.er1
5014   cat conftest.err >&5
5015   echo "$as_me:5015: \$? = $ac_status" >&5
5016   (exit $ac_status); } >/dev/null; then
5017   if test -s conftest.err; then
5018     ac_cpp_err=$ac_c_preproc_warn_flag
5019   else
5020     ac_cpp_err=
5021   fi
5022 else
5023   ac_cpp_err=yes
5024 fi
5025 if test -z "$ac_cpp_err"; then
5026   eval "$as_ac_Header=yes"
5027 else
5028   echo "$as_me: failed program was:" >&5
5029   cat conftest.$ac_ext >&5
5030   eval "$as_ac_Header=no"
5031 fi
5032 rm -f conftest.err conftest.$ac_ext
5033 fi
5034 echo "$as_me:5034: result: `eval echo '${'$as_ac_Header'}'`" >&5
5035 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5036 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5037   cat >>confdefs.h <<EOF
5038 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5039 EOF
5040
5041 fi
5042 done
5043
5044 cat >>confdefs.h <<\EOF
5045 #define NCURSES 1
5046 EOF
5047
5048 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5049
5050                 cat >>confdefs.h <<EOF
5051 #define $cf_nculib_ROOT 1
5052 EOF
5053
5054                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
5055
5056         else
5057
5058 cf_ncuhdr_root=ncurses
5059
5060 test -n "$cf_cv_curses_dir" && \
5061 test "$cf_cv_curses_dir" != "no" && { \
5062
5063 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5064   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5065   do
5066         while test $cf_add_incdir != /usr/include
5067         do
5068           if test -d $cf_add_incdir
5069           then
5070                 cf_have_incdir=no
5071                 if test -n "$CFLAGS$CPPFLAGS" ; then
5072                   # a loop is needed to ensure we can add subdirs of existing dirs
5073                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5074                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5075                           cf_have_incdir=yes; break
5076                         fi
5077                   done
5078                 fi
5079
5080                 if test "$cf_have_incdir" = no ; then
5081                   if test "$cf_add_incdir" = /usr/local/include ; then
5082                         if test "$GCC" = yes
5083                         then
5084                           cf_save_CPPFLAGS=$CPPFLAGS
5085
5086         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5087         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5088
5089                           cat >conftest.$ac_ext <<_ACEOF
5090 #line 5090 "configure"
5091 #include "confdefs.h"
5092 #include <stdio.h>
5093 int
5094 main (void)
5095 {
5096 printf("Hello")
5097   ;
5098   return 0;
5099 }
5100 _ACEOF
5101 rm -f conftest.$ac_objext
5102 if { (eval echo "$as_me:5102: \"$ac_compile\"") >&5
5103   (eval $ac_compile) 2>&5
5104   ac_status=$?
5105   echo "$as_me:5105: \$? = $ac_status" >&5
5106   (exit $ac_status); } &&
5107          { ac_try='test -s conftest.$ac_objext'
5108   { (eval echo "$as_me:5108: \"$ac_try\"") >&5
5109   (eval $ac_try) 2>&5
5110   ac_status=$?
5111   echo "$as_me:5111: \$? = $ac_status" >&5
5112   (exit $ac_status); }; }; then
5113   :
5114 else
5115   echo "$as_me: failed program was:" >&5
5116 cat conftest.$ac_ext >&5
5117 cf_have_incdir=yes
5118 fi
5119 rm -f conftest.$ac_objext conftest.$ac_ext
5120                           CPPFLAGS=$cf_save_CPPFLAGS
5121                         fi
5122                   fi
5123                 fi
5124
5125                 if test "$cf_have_incdir" = no ; then
5126                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5127
5128 echo "${as_me:-configure}:5128: testing adding $cf_add_incdir to include-path ..." 1>&5
5129
5130                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5131
5132                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5133                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5134                   cf_add_incdir="$cf_top_incdir"
5135                 else
5136                   break
5137                 fi
5138           else
5139                 break
5140           fi
5141         done
5142   done
5143 fi
5144
5145 }
5146
5147 echo "$as_me:5147: checking for $cf_ncuhdr_root header in include-path" >&5
5148 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5149 if test "${cf_cv_ncurses_h+set}" = set; then
5150   echo $ECHO_N "(cached) $ECHO_C" >&6
5151 else
5152
5153         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5154         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
5155         for cf_header in $cf_header_list
5156         do
5157
5158         cat >conftest.$ac_ext <<_ACEOF
5159 #line 5159 "configure"
5160 #include "confdefs.h"
5161
5162 #include <$cf_header>
5163 int
5164 main (void)
5165 {
5166
5167 #ifdef NCURSES_VERSION
5168
5169 printf("%s\n", NCURSES_VERSION);
5170 #else
5171 #ifdef __NCURSES_H
5172 printf("old\n");
5173 #else
5174         make an error
5175 #endif
5176 #endif
5177
5178   ;
5179   return 0;
5180 }
5181 _ACEOF
5182 rm -f conftest.$ac_objext
5183 if { (eval echo "$as_me:5183: \"$ac_compile\"") >&5
5184   (eval $ac_compile) 2>&5
5185   ac_status=$?
5186   echo "$as_me:5186: \$? = $ac_status" >&5
5187   (exit $ac_status); } &&
5188          { ac_try='test -s conftest.$ac_objext'
5189   { (eval echo "$as_me:5189: \"$ac_try\"") >&5
5190   (eval $ac_try) 2>&5
5191   ac_status=$?
5192   echo "$as_me:5192: \$? = $ac_status" >&5
5193   (exit $ac_status); }; }; then
5194   cf_cv_ncurses_h=$cf_header
5195
5196 else
5197   echo "$as_me: failed program was:" >&5
5198 cat conftest.$ac_ext >&5
5199 cf_cv_ncurses_h=no
5200 fi
5201 rm -f conftest.$ac_objext conftest.$ac_ext
5202
5203                 test "$cf_cv_ncurses_h" != no && break
5204         done
5205
5206 fi
5207 echo "$as_me:5207: result: $cf_cv_ncurses_h" >&5
5208 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5209
5210 if test "$cf_cv_ncurses_h" != no ; then
5211         cf_cv_ncurses_header=$cf_cv_ncurses_h
5212 else
5213
5214 echo "$as_me:5214: checking for $cf_ncuhdr_root include-path" >&5
5215 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5216 if test "${cf_cv_ncurses_h2+set}" = set; then
5217   echo $ECHO_N "(cached) $ECHO_C" >&6
5218 else
5219
5220         test -n "$verbose" && echo
5221
5222 cf_search=
5223
5224 # collect the current set of include-directories from compiler flags
5225 cf_header_path_list=""
5226 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5227         for cf_header_path in $CPPFLAGS $CFLAGS
5228         do
5229                 case $cf_header_path in
5230                 (-I*)
5231                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5232
5233 test "x$cf_header_path" != "xNONE" && \
5234 test -d "$cf_header_path" && \
5235  {
5236         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5237         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5238         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5239         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5240         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5241         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"
5242 }
5243
5244                         cf_header_path_list="$cf_header_path_list $cf_search"
5245                         ;;
5246                 esac
5247         done
5248 fi
5249
5250 # add the variations for the package we are looking for
5251
5252 cf_search=
5253
5254 test "x$prefix" != "xNONE" && \
5255 test -d "$prefix" && \
5256  {
5257         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5258         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5259         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5260         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5261         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5262         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5263 }
5264
5265 for cf_subdir_prefix in \
5266         /usr \
5267         /usr/local \
5268         /usr/pkg \
5269         /opt \
5270         /opt/local \
5271         $HOME
5272 do
5273
5274 test "x$cf_subdir_prefix" != "x$prefix" && \
5275 test -d "$cf_subdir_prefix" && \
5276 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5277         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5278         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5279         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5280         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5281         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5282         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"
5283 }
5284
5285 done
5286
5287 test "$includedir" != NONE && \
5288 test "$includedir" != "/usr/include" && \
5289 test -d "$includedir" && {
5290         test -d $includedir &&    cf_search="$cf_search $includedir"
5291         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5292 }
5293
5294 test "$oldincludedir" != NONE && \
5295 test "$oldincludedir" != "/usr/include" && \
5296 test -d "$oldincludedir" && {
5297         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5298         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5299 }
5300
5301 cf_search="$cf_search $cf_header_path_list"
5302
5303         test -n "$verbose" && echo search path $cf_search
5304         cf_save2_CPPFLAGS="$CPPFLAGS"
5305         for cf_incdir in $cf_search
5306         do
5307
5308 if test -n "$cf_incdir" ; then
5309   for cf_add_incdir in $cf_incdir
5310   do
5311         while test $cf_add_incdir != /usr/include
5312         do
5313           if test -d $cf_add_incdir
5314           then
5315                 cf_have_incdir=no
5316                 if test -n "$CFLAGS$CPPFLAGS" ; then
5317                   # a loop is needed to ensure we can add subdirs of existing dirs
5318                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5319                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5320                           cf_have_incdir=yes; break
5321                         fi
5322                   done
5323                 fi
5324
5325                 if test "$cf_have_incdir" = no ; then
5326                   if test "$cf_add_incdir" = /usr/local/include ; then
5327                         if test "$GCC" = yes
5328                         then
5329                           cf_save_CPPFLAGS=$CPPFLAGS
5330
5331         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5332         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5333
5334                           cat >conftest.$ac_ext <<_ACEOF
5335 #line 5335 "configure"
5336 #include "confdefs.h"
5337 #include <stdio.h>
5338 int
5339 main (void)
5340 {
5341 printf("Hello")
5342   ;
5343   return 0;
5344 }
5345 _ACEOF
5346 rm -f conftest.$ac_objext
5347 if { (eval echo "$as_me:5347: \"$ac_compile\"") >&5
5348   (eval $ac_compile) 2>&5
5349   ac_status=$?
5350   echo "$as_me:5350: \$? = $ac_status" >&5
5351   (exit $ac_status); } &&
5352          { ac_try='test -s conftest.$ac_objext'
5353   { (eval echo "$as_me:5353: \"$ac_try\"") >&5
5354   (eval $ac_try) 2>&5
5355   ac_status=$?
5356   echo "$as_me:5356: \$? = $ac_status" >&5
5357   (exit $ac_status); }; }; then
5358   :
5359 else
5360   echo "$as_me: failed program was:" >&5
5361 cat conftest.$ac_ext >&5
5362 cf_have_incdir=yes
5363 fi
5364 rm -f conftest.$ac_objext conftest.$ac_ext
5365                           CPPFLAGS=$cf_save_CPPFLAGS
5366                         fi
5367                   fi
5368                 fi
5369
5370                 if test "$cf_have_incdir" = no ; then
5371                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5372
5373 echo "${as_me:-configure}:5373: testing adding $cf_add_incdir to include-path ..." 1>&5
5374
5375                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5376
5377                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5378                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5379                   cf_add_incdir="$cf_top_incdir"
5380                 else
5381                   break
5382                 fi
5383           else
5384                 break
5385           fi
5386         done
5387   done
5388 fi
5389
5390                 for cf_header in \
5391                         ncurses.h \
5392                         curses.h
5393                 do
5394
5395         cat >conftest.$ac_ext <<_ACEOF
5396 #line 5396 "configure"
5397 #include "confdefs.h"
5398
5399 #include <$cf_header>
5400 int
5401 main (void)
5402 {
5403
5404 #ifdef NCURSES_VERSION
5405
5406 printf("%s\n", NCURSES_VERSION);
5407 #else
5408 #ifdef __NCURSES_H
5409 printf("old\n");
5410 #else
5411         make an error
5412 #endif
5413 #endif
5414
5415   ;
5416   return 0;
5417 }
5418 _ACEOF
5419 rm -f conftest.$ac_objext
5420 if { (eval echo "$as_me:5420: \"$ac_compile\"") >&5
5421   (eval $ac_compile) 2>&5
5422   ac_status=$?
5423   echo "$as_me:5423: \$? = $ac_status" >&5
5424   (exit $ac_status); } &&
5425          { ac_try='test -s conftest.$ac_objext'
5426   { (eval echo "$as_me:5426: \"$ac_try\"") >&5
5427   (eval $ac_try) 2>&5
5428   ac_status=$?
5429   echo "$as_me:5429: \$? = $ac_status" >&5
5430   (exit $ac_status); }; }; then
5431   cf_cv_ncurses_h2=$cf_header
5432
5433 else
5434   echo "$as_me: failed program was:" >&5
5435 cat conftest.$ac_ext >&5
5436 cf_cv_ncurses_h2=no
5437 fi
5438 rm -f conftest.$ac_objext conftest.$ac_ext
5439
5440                         if test "$cf_cv_ncurses_h2" != no ; then
5441                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5442                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5443                                 break
5444                         fi
5445                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5446                 done
5447                 CPPFLAGS="$cf_save2_CPPFLAGS"
5448                 test "$cf_cv_ncurses_h2" != no && break
5449         done
5450         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5450: error: not found" >&5
5451 echo "$as_me: error: not found" >&2;}
5452    { (exit 1); exit 1; }; }
5453
5454 fi
5455 echo "$as_me:5455: result: $cf_cv_ncurses_h2" >&5
5456 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5457
5458         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5459         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5460         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5461                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5462         fi
5463
5464 if test -n "$cf_1st_incdir" ; then
5465   for cf_add_incdir in $cf_1st_incdir
5466   do
5467         while test $cf_add_incdir != /usr/include
5468         do
5469           if test -d $cf_add_incdir
5470           then
5471                 cf_have_incdir=no
5472                 if test -n "$CFLAGS$CPPFLAGS" ; then
5473                   # a loop is needed to ensure we can add subdirs of existing dirs
5474                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5475                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5476                           cf_have_incdir=yes; break
5477                         fi
5478                   done
5479                 fi
5480
5481                 if test "$cf_have_incdir" = no ; then
5482                   if test "$cf_add_incdir" = /usr/local/include ; then
5483                         if test "$GCC" = yes
5484                         then
5485                           cf_save_CPPFLAGS=$CPPFLAGS
5486
5487         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5488         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5489
5490                           cat >conftest.$ac_ext <<_ACEOF
5491 #line 5491 "configure"
5492 #include "confdefs.h"
5493 #include <stdio.h>
5494 int
5495 main (void)
5496 {
5497 printf("Hello")
5498   ;
5499   return 0;
5500 }
5501 _ACEOF
5502 rm -f conftest.$ac_objext
5503 if { (eval echo "$as_me:5503: \"$ac_compile\"") >&5
5504   (eval $ac_compile) 2>&5
5505   ac_status=$?
5506   echo "$as_me:5506: \$? = $ac_status" >&5
5507   (exit $ac_status); } &&
5508          { ac_try='test -s conftest.$ac_objext'
5509   { (eval echo "$as_me:5509: \"$ac_try\"") >&5
5510   (eval $ac_try) 2>&5
5511   ac_status=$?
5512   echo "$as_me:5512: \$? = $ac_status" >&5
5513   (exit $ac_status); }; }; then
5514   :
5515 else
5516   echo "$as_me: failed program was:" >&5
5517 cat conftest.$ac_ext >&5
5518 cf_have_incdir=yes
5519 fi
5520 rm -f conftest.$ac_objext conftest.$ac_ext
5521                           CPPFLAGS=$cf_save_CPPFLAGS
5522                         fi
5523                   fi
5524                 fi
5525
5526                 if test "$cf_have_incdir" = no ; then
5527                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5528
5529 echo "${as_me:-configure}:5529: testing adding $cf_add_incdir to include-path ..." 1>&5
5530
5531                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5532
5533                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5534                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5535                   cf_add_incdir="$cf_top_incdir"
5536                 else
5537                   break
5538                 fi
5539           else
5540                 break
5541           fi
5542         done
5543   done
5544 fi
5545
5546 fi
5547
5548 # Set definitions to allow ifdef'ing for ncurses.h
5549
5550 case $cf_cv_ncurses_header in
5551 (*ncurses.h)
5552
5553 cat >>confdefs.h <<\EOF
5554 #define HAVE_NCURSES_H 1
5555 EOF
5556
5557         ;;
5558 esac
5559
5560 case $cf_cv_ncurses_header in
5561 (ncurses/curses.h|ncurses/ncurses.h)
5562
5563 cat >>confdefs.h <<\EOF
5564 #define HAVE_NCURSES_NCURSES_H 1
5565 EOF
5566
5567         ;;
5568 (ncursesw/curses.h|ncursesw/ncurses.h)
5569
5570 cat >>confdefs.h <<\EOF
5571 #define HAVE_NCURSESW_NCURSES_H 1
5572 EOF
5573
5574         ;;
5575 esac
5576
5577 echo "$as_me:5577: checking for terminfo header" >&5
5578 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5579 if test "${cf_cv_term_header+set}" = set; then
5580   echo $ECHO_N "(cached) $ECHO_C" >&6
5581 else
5582
5583 case ${cf_cv_ncurses_header} in
5584 (*/ncurses.h|*/ncursesw.h)
5585         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5586         ;;
5587 (*)
5588         cf_term_header=term.h
5589         ;;
5590 esac
5591
5592 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5593 do
5594 cat >conftest.$ac_ext <<_ACEOF
5595 #line 5595 "configure"
5596 #include "confdefs.h"
5597 #include <stdio.h>
5598 #include <${cf_cv_ncurses_header:-curses.h}>
5599 #include <$cf_test>
5600
5601 int
5602 main (void)
5603 {
5604 int x = auto_left_margin; (void)x
5605   ;
5606   return 0;
5607 }
5608 _ACEOF
5609 rm -f conftest.$ac_objext
5610 if { (eval echo "$as_me:5610: \"$ac_compile\"") >&5
5611   (eval $ac_compile) 2>&5
5612   ac_status=$?
5613   echo "$as_me:5613: \$? = $ac_status" >&5
5614   (exit $ac_status); } &&
5615          { ac_try='test -s conftest.$ac_objext'
5616   { (eval echo "$as_me:5616: \"$ac_try\"") >&5
5617   (eval $ac_try) 2>&5
5618   ac_status=$?
5619   echo "$as_me:5619: \$? = $ac_status" >&5
5620   (exit $ac_status); }; }; then
5621
5622         cf_cv_term_header="$cf_test"
5623 else
5624   echo "$as_me: failed program was:" >&5
5625 cat conftest.$ac_ext >&5
5626
5627         cf_cv_term_header=unknown
5628
5629 fi
5630 rm -f conftest.$ac_objext conftest.$ac_ext
5631         test "$cf_cv_term_header" != unknown && break
5632 done
5633
5634 fi
5635 echo "$as_me:5635: result: $cf_cv_term_header" >&5
5636 echo "${ECHO_T}$cf_cv_term_header" >&6
5637
5638 # Set definitions to allow ifdef'ing to accommodate subdirectories
5639
5640 case $cf_cv_term_header in
5641 (*term.h)
5642
5643 cat >>confdefs.h <<\EOF
5644 #define HAVE_TERM_H 1
5645 EOF
5646
5647         ;;
5648 esac
5649
5650 case $cf_cv_term_header in
5651 (ncurses/term.h)
5652
5653 cat >>confdefs.h <<\EOF
5654 #define HAVE_NCURSES_TERM_H 1
5655 EOF
5656
5657         ;;
5658 (ncursesw/term.h)
5659
5660 cat >>confdefs.h <<\EOF
5661 #define HAVE_NCURSESW_TERM_H 1
5662 EOF
5663
5664         ;;
5665 esac
5666
5667 # some applications need this, but should check for NCURSES_VERSION
5668
5669 cat >>confdefs.h <<\EOF
5670 #define NCURSES 1
5671 EOF
5672
5673 echo "$as_me:5673: checking for ncurses version" >&5
5674 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5675 if test "${cf_cv_ncurses_version+set}" = set; then
5676   echo $ECHO_N "(cached) $ECHO_C" >&6
5677 else
5678
5679         cf_cv_ncurses_version=no
5680         cf_tempfile=out$$
5681         rm -f $cf_tempfile
5682         if test "$cross_compiling" = yes; then
5683
5684         # This will not work if the preprocessor splits the line after the
5685         # Autoconf token.  The 'unproto' program does that.
5686         cat > conftest.$ac_ext <<EOF
5687 #include <${cf_cv_ncurses_header:-curses.h}>
5688 #undef Autoconf
5689 #ifdef NCURSES_VERSION
5690 Autoconf NCURSES_VERSION
5691 #else
5692 #ifdef __NCURSES_H
5693 Autoconf "old"
5694 #endif
5695 ;
5696 #endif
5697 EOF
5698         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5699         { (eval echo "$as_me:5699: \"$cf_try\"") >&5
5700   (eval $cf_try) 2>&5
5701   ac_status=$?
5702   echo "$as_me:5702: \$? = $ac_status" >&5
5703   (exit $ac_status); }
5704         if test -f conftest.out ; then
5705                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5706                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5707                 rm -f conftest.out
5708         fi
5709
5710 else
5711   cat >conftest.$ac_ext <<_ACEOF
5712 #line 5712 "configure"
5713 #include "confdefs.h"
5714
5715 #include <${cf_cv_ncurses_header:-curses.h}>
5716 #include <stdio.h>
5717 int main(void)
5718 {
5719         FILE *fp = fopen("$cf_tempfile", "w");
5720 #ifdef NCURSES_VERSION
5721 # ifdef NCURSES_VERSION_PATCH
5722         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5723 # else
5724         fprintf(fp, "%s\n", NCURSES_VERSION);
5725 # endif
5726 #else
5727 # ifdef __NCURSES_H
5728         fprintf(fp, "old\n");
5729 # else
5730         make an error
5731 # endif
5732 #endif
5733         ${cf_cv_main_return:-return}(0);
5734 }
5735 _ACEOF
5736 rm -f conftest$ac_exeext
5737 if { (eval echo "$as_me:5737: \"$ac_link\"") >&5
5738   (eval $ac_link) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5742   { (eval echo "$as_me:5742: \"$ac_try\"") >&5
5743   (eval $ac_try) 2>&5
5744   ac_status=$?
5745   echo "$as_me:5745: \$? = $ac_status" >&5
5746   (exit $ac_status); }; }; then
5747
5748         cf_cv_ncurses_version=`cat $cf_tempfile`
5749 else
5750   echo "$as_me: program exited with status $ac_status" >&5
5751 echo "$as_me: failed program was:" >&5
5752 cat conftest.$ac_ext >&5
5753 fi
5754 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5755 fi
5756         rm -f $cf_tempfile
5757
5758 fi
5759 echo "$as_me:5759: result: $cf_cv_ncurses_version" >&5
5760 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5761 test "$cf_cv_ncurses_version" = no ||
5762 cat >>confdefs.h <<\EOF
5763 #define NCURSES 1
5764 EOF
5765
5766 cf_nculib_root=ncurses
5767         # This works, except for the special case where we find gpm, but
5768         # ncurses is in a nonstandard location via $LIBS, and we really want
5769         # to link gpm.
5770 cf_ncurses_LIBS=""
5771 cf_ncurses_SAVE="$LIBS"
5772 echo "$as_me:5772: checking for Gpm_Open in -lgpm" >&5
5773 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5774 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5775   echo $ECHO_N "(cached) $ECHO_C" >&6
5776 else
5777   ac_check_lib_save_LIBS=$LIBS
5778 LIBS="-lgpm  $LIBS"
5779 cat >conftest.$ac_ext <<_ACEOF
5780 #line 5780 "configure"
5781 #include "confdefs.h"
5782
5783 /* Override any gcc2 internal prototype to avoid an error.  */
5784 #ifdef __cplusplus
5785 extern "C"
5786 #endif
5787 /* We use char because int might match the return type of a gcc2
5788    builtin and then its argument prototype would still apply.  */
5789 char Gpm_Open ();
5790 int
5791 main (void)
5792 {
5793 Gpm_Open ();
5794   ;
5795   return 0;
5796 }
5797 _ACEOF
5798 rm -f conftest.$ac_objext conftest$ac_exeext
5799 if { (eval echo "$as_me:5799: \"$ac_link\"") >&5
5800   (eval $ac_link) 2>&5
5801   ac_status=$?
5802   echo "$as_me:5802: \$? = $ac_status" >&5
5803   (exit $ac_status); } &&
5804          { ac_try='test -s conftest$ac_exeext'
5805   { (eval echo "$as_me:5805: \"$ac_try\"") >&5
5806   (eval $ac_try) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit $ac_status); }; }; then
5810   ac_cv_lib_gpm_Gpm_Open=yes
5811 else
5812   echo "$as_me: failed program was:" >&5
5813 cat conftest.$ac_ext >&5
5814 ac_cv_lib_gpm_Gpm_Open=no
5815 fi
5816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5817 LIBS=$ac_check_lib_save_LIBS
5818 fi
5819 echo "$as_me:5819: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5820 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5821 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5822   echo "$as_me:5822: checking for initscr in -lgpm" >&5
5823 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5824 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5825   echo $ECHO_N "(cached) $ECHO_C" >&6
5826 else
5827   ac_check_lib_save_LIBS=$LIBS
5828 LIBS="-lgpm  $LIBS"
5829 cat >conftest.$ac_ext <<_ACEOF
5830 #line 5830 "configure"
5831 #include "confdefs.h"
5832
5833 /* Override any gcc2 internal prototype to avoid an error.  */
5834 #ifdef __cplusplus
5835 extern "C"
5836 #endif
5837 /* We use char because int might match the return type of a gcc2
5838    builtin and then its argument prototype would still apply.  */
5839 char initscr ();
5840 int
5841 main (void)
5842 {
5843 initscr ();
5844   ;
5845   return 0;
5846 }
5847 _ACEOF
5848 rm -f conftest.$ac_objext conftest$ac_exeext
5849 if { (eval echo "$as_me:5849: \"$ac_link\"") >&5
5850   (eval $ac_link) 2>&5
5851   ac_status=$?
5852   echo "$as_me:5852: \$? = $ac_status" >&5
5853   (exit $ac_status); } &&
5854          { ac_try='test -s conftest$ac_exeext'
5855   { (eval echo "$as_me:5855: \"$ac_try\"") >&5
5856   (eval $ac_try) 2>&5
5857   ac_status=$?
5858   echo "$as_me:5858: \$? = $ac_status" >&5
5859   (exit $ac_status); }; }; then
5860   ac_cv_lib_gpm_initscr=yes
5861 else
5862   echo "$as_me: failed program was:" >&5
5863 cat conftest.$ac_ext >&5
5864 ac_cv_lib_gpm_initscr=no
5865 fi
5866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5867 LIBS=$ac_check_lib_save_LIBS
5868 fi
5869 echo "$as_me:5869: result: $ac_cv_lib_gpm_initscr" >&5
5870 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5871 if test $ac_cv_lib_gpm_initscr = yes; then
5872   LIBS="$cf_ncurses_SAVE"
5873 else
5874   cf_ncurses_LIBS="-lgpm"
5875 fi
5876
5877 fi
5878
5879 case $host_os in
5880 (freebsd*)
5881         # This is only necessary if you are linking against an obsolete
5882         # version of ncurses (but it should do no harm, since it's static).
5883         if test "$cf_nculib_root" = ncurses ; then
5884                 echo "$as_me:5884: checking for tgoto in -lmytinfo" >&5
5885 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5886 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5887   echo $ECHO_N "(cached) $ECHO_C" >&6
5888 else
5889   ac_check_lib_save_LIBS=$LIBS
5890 LIBS="-lmytinfo  $LIBS"
5891 cat >conftest.$ac_ext <<_ACEOF
5892 #line 5892 "configure"
5893 #include "confdefs.h"
5894
5895 /* Override any gcc2 internal prototype to avoid an error.  */
5896 #ifdef __cplusplus
5897 extern "C"
5898 #endif
5899 /* We use char because int might match the return type of a gcc2
5900    builtin and then its argument prototype would still apply.  */
5901 char tgoto ();
5902 int
5903 main (void)
5904 {
5905 tgoto ();
5906   ;
5907   return 0;
5908 }
5909 _ACEOF
5910 rm -f conftest.$ac_objext conftest$ac_exeext
5911 if { (eval echo "$as_me:5911: \"$ac_link\"") >&5
5912   (eval $ac_link) 2>&5
5913   ac_status=$?
5914   echo "$as_me:5914: \$? = $ac_status" >&5
5915   (exit $ac_status); } &&
5916          { ac_try='test -s conftest$ac_exeext'
5917   { (eval echo "$as_me:5917: \"$ac_try\"") >&5
5918   (eval $ac_try) 2>&5
5919   ac_status=$?
5920   echo "$as_me:5920: \$? = $ac_status" >&5
5921   (exit $ac_status); }; }; then
5922   ac_cv_lib_mytinfo_tgoto=yes
5923 else
5924   echo "$as_me: failed program was:" >&5
5925 cat conftest.$ac_ext >&5
5926 ac_cv_lib_mytinfo_tgoto=no
5927 fi
5928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5929 LIBS=$ac_check_lib_save_LIBS
5930 fi
5931 echo "$as_me:5931: result: $ac_cv_lib_mytinfo_tgoto" >&5
5932 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5933 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5934   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5935 fi
5936
5937         fi
5938         ;;
5939 esac
5940
5941 cf_add_libs="$LIBS"
5942 # reverse order
5943 cf_add_0lib=
5944 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5945 # filter duplicates
5946 for cf_add_1lib in $cf_add_0lib; do
5947         for cf_add_2lib in $cf_add_libs; do
5948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5949                         cf_add_1lib=
5950                         break
5951                 fi
5952         done
5953         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5954 done
5955 LIBS="$cf_add_libs"
5956
5957 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5958 then
5959
5960 cf_add_libs="$LIBS"
5961 # reverse order
5962 cf_add_0lib=
5963 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5964 # filter duplicates
5965 for cf_add_1lib in $cf_add_0lib; do
5966         for cf_add_2lib in $cf_add_libs; do
5967                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5968                         cf_add_1lib=
5969                         break
5970                 fi
5971         done
5972         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5973 done
5974 LIBS="$cf_add_libs"
5975
5976 else
5977
5978         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5979         cf_libdir=""
5980         echo "$as_me:5980: checking for initscr" >&5
5981 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5982 if test "${ac_cv_func_initscr+set}" = set; then
5983   echo $ECHO_N "(cached) $ECHO_C" >&6
5984 else
5985   cat >conftest.$ac_ext <<_ACEOF
5986 #line 5986 "configure"
5987 #include "confdefs.h"
5988 #define initscr autoconf_temporary
5989 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
5990 #undef initscr
5991
5992 #ifdef __cplusplus
5993 extern "C"
5994 #endif
5995
5996 /* We use char because int might match the return type of a gcc2
5997    builtin and then its argument prototype would still apply.  */
5998 char initscr (void);
5999
6000 int
6001 main (void)
6002 {
6003
6004 /* The GNU C library defines stubs for functions which it implements
6005     to always fail with ENOSYS.  Some functions are actually named
6006     something starting with __ and the normal name is an alias.  */
6007 #if defined (__stub_initscr) || defined (__stub___initscr)
6008 #error found stub for initscr
6009 #endif
6010
6011         return initscr ();
6012   ;
6013   return 0;
6014 }
6015 _ACEOF
6016 rm -f conftest.$ac_objext conftest$ac_exeext
6017 if { (eval echo "$as_me:6017: \"$ac_link\"") >&5
6018   (eval $ac_link) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit $ac_status); } &&
6022          { ac_try='test -s conftest$ac_exeext'
6023   { (eval echo "$as_me:6023: \"$ac_try\"") >&5
6024   (eval $ac_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit $ac_status); }; }; then
6028   ac_cv_func_initscr=yes
6029 else
6030   echo "$as_me: failed program was:" >&5
6031 cat conftest.$ac_ext >&5
6032 ac_cv_func_initscr=no
6033 fi
6034 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6035 fi
6036 echo "$as_me:6036: result: $ac_cv_func_initscr" >&5
6037 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6038 if test $ac_cv_func_initscr = yes; then
6039   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6040 else
6041
6042                 cf_save_LIBS="$LIBS"
6043                 echo "$as_me:6043: checking for initscr in -l$cf_nculib_root" >&5
6044 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6045                 LIBS="-l$cf_nculib_root $LIBS"
6046                 cat >conftest.$ac_ext <<_ACEOF
6047 #line 6047 "configure"
6048 #include "confdefs.h"
6049 #include <${cf_cv_ncurses_header:-curses.h}>
6050 int
6051 main (void)
6052 {
6053 initscr()
6054   ;
6055   return 0;
6056 }
6057 _ACEOF
6058 rm -f conftest.$ac_objext conftest$ac_exeext
6059 if { (eval echo "$as_me:6059: \"$ac_link\"") >&5
6060   (eval $ac_link) 2>&5
6061   ac_status=$?
6062   echo "$as_me:6062: \$? = $ac_status" >&5
6063   (exit $ac_status); } &&
6064          { ac_try='test -s conftest$ac_exeext'
6065   { (eval echo "$as_me:6065: \"$ac_try\"") >&5
6066   (eval $ac_try) 2>&5
6067   ac_status=$?
6068   echo "$as_me:6068: \$? = $ac_status" >&5
6069   (exit $ac_status); }; }; then
6070   echo "$as_me:6070: result: yes" >&5
6071 echo "${ECHO_T}yes" >&6
6072                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6073
6074 else
6075   echo "$as_me: failed program was:" >&5
6076 cat conftest.$ac_ext >&5
6077 echo "$as_me:6077: result: no" >&5
6078 echo "${ECHO_T}no" >&6
6079
6080 cf_search=
6081 cf_library_path_list=""
6082 if test -n "${LDFLAGS}${LIBS}" ; then
6083         for cf_library_path in $LDFLAGS $LIBS
6084         do
6085                 case $cf_library_path in
6086                 (-L*)
6087                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6088
6089 test "x$cf_library_path" != "xNONE" && \
6090 test -d "$cf_library_path" && \
6091  {
6092         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6093         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6094         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6095         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6096         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6097         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"
6098 }
6099
6100                         cf_library_path_list="$cf_library_path_list $cf_search"
6101                         ;;
6102                 esac
6103         done
6104 fi
6105
6106 cf_search=
6107
6108 test "x$prefix" != "xNONE" && \
6109 test -d "$prefix" && \
6110  {
6111         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6112         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6113         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6114         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6115         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6116         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6117 }
6118
6119 for cf_subdir_prefix in \
6120         /usr \
6121         /usr/local \
6122         /usr/pkg \
6123         /opt \
6124         /opt/local \
6125         $HOME
6126 do
6127
6128 test "x$cf_subdir_prefix" != "x$prefix" && \
6129 test -d "$cf_subdir_prefix" && \
6130 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6131         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6132         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6133         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6134         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6135         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6136         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"
6137 }
6138
6139 done
6140
6141 cf_search="$cf_library_path_list $cf_search"
6142
6143                         for cf_libdir in $cf_search
6144                         do
6145                                 echo "$as_me:6145: checking for -l$cf_nculib_root in $cf_libdir" >&5
6146 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6147                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6148                                 cat >conftest.$ac_ext <<_ACEOF
6149 #line 6149 "configure"
6150 #include "confdefs.h"
6151 #include <${cf_cv_ncurses_header:-curses.h}>
6152 int
6153 main (void)
6154 {
6155 initscr()
6156   ;
6157   return 0;
6158 }
6159 _ACEOF
6160 rm -f conftest.$ac_objext conftest$ac_exeext
6161 if { (eval echo "$as_me:6161: \"$ac_link\"") >&5
6162   (eval $ac_link) 2>&5
6163   ac_status=$?
6164   echo "$as_me:6164: \$? = $ac_status" >&5
6165   (exit $ac_status); } &&
6166          { ac_try='test -s conftest$ac_exeext'
6167   { (eval echo "$as_me:6167: \"$ac_try\"") >&5
6168   (eval $ac_try) 2>&5
6169   ac_status=$?
6170   echo "$as_me:6170: \$? = $ac_status" >&5
6171   (exit $ac_status); }; }; then
6172   echo "$as_me:6172: result: yes" >&5
6173 echo "${ECHO_T}yes" >&6
6174                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
6175                                          break
6176 else
6177   echo "$as_me: failed program was:" >&5
6178 cat conftest.$ac_ext >&5
6179 echo "$as_me:6179: result: no" >&5
6180 echo "${ECHO_T}no" >&6
6181                                          LIBS="$cf_save_LIBS"
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184                         done
6185
6186 fi
6187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6188
6189 fi
6190
6191 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
6192
6193 if test $cf_found_library = no ; then
6194         { { echo "$as_me:6194: error: Cannot link $cf_nculib_root library" >&5
6195 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6196    { (exit 1); exit 1; }; }
6197 fi
6198
6199 fi
6200
6201 if test -n "$cf_ncurses_LIBS" ; then
6202         echo "$as_me:6202: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6203 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6204         cf_ncurses_SAVE="$LIBS"
6205         for p in $cf_ncurses_LIBS ; do
6206                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
6207                 if test "$q" != "$LIBS" ; then
6208                         LIBS="$q"
6209                 fi
6210         done
6211         cat >conftest.$ac_ext <<_ACEOF
6212 #line 6212 "configure"
6213 #include "confdefs.h"
6214 #include <${cf_cv_ncurses_header:-curses.h}>
6215 int
6216 main (void)
6217 {
6218 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6219   ;
6220   return 0;
6221 }
6222 _ACEOF
6223 rm -f conftest.$ac_objext conftest$ac_exeext
6224 if { (eval echo "$as_me:6224: \"$ac_link\"") >&5
6225   (eval $ac_link) 2>&5
6226   ac_status=$?
6227   echo "$as_me:6227: \$? = $ac_status" >&5
6228   (exit $ac_status); } &&
6229          { ac_try='test -s conftest$ac_exeext'
6230   { (eval echo "$as_me:6230: \"$ac_try\"") >&5
6231   (eval $ac_try) 2>&5
6232   ac_status=$?
6233   echo "$as_me:6233: \$? = $ac_status" >&5
6234   (exit $ac_status); }; }; then
6235   echo "$as_me:6235: result: yes" >&5
6236 echo "${ECHO_T}yes" >&6
6237 else
6238   echo "$as_me: failed program was:" >&5
6239 cat conftest.$ac_ext >&5
6240 echo "$as_me:6240: result: no" >&5
6241 echo "${ECHO_T}no" >&6
6242                  LIBS="$cf_ncurses_SAVE"
6243 fi
6244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6245 fi
6246
6247 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6248
6249 cat >>confdefs.h <<EOF
6250 #define $cf_nculib_ROOT 1
6251 EOF
6252
6253         fi
6254 else
6255         NCURSES_CONFIG=none
6256 fi
6257
6258 echo "$as_me:6258: checking if you want wide-character code" >&5
6259 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6260
6261 # Check whether --enable-widec or --disable-widec was given.
6262 if test "${enable_widec+set}" = set; then
6263   enableval="$enable_widec"
6264   with_widec=$enableval
6265 else
6266   with_widec=no
6267 fi;
6268 echo "$as_me:6268: result: $with_widec" >&5
6269 echo "${ECHO_T}$with_widec" >&6
6270 if test "$with_widec" = yes ; then
6271
6272 echo "$as_me:6272: checking for multibyte character support" >&5
6273 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6274 if test "${cf_cv_utf8_lib+set}" = set; then
6275   echo $ECHO_N "(cached) $ECHO_C" >&6
6276 else
6277
6278         cf_save_LIBS="$LIBS"
6279         cat >conftest.$ac_ext <<_ACEOF
6280 #line 6280 "configure"
6281 #include "confdefs.h"
6282
6283 #include <stdlib.h>
6284 int
6285 main (void)
6286 {
6287 putwc(0,0);
6288   ;
6289   return 0;
6290 }
6291 _ACEOF
6292 rm -f conftest.$ac_objext conftest$ac_exeext
6293 if { (eval echo "$as_me:6293: \"$ac_link\"") >&5
6294   (eval $ac_link) 2>&5
6295   ac_status=$?
6296   echo "$as_me:6296: \$? = $ac_status" >&5
6297   (exit $ac_status); } &&
6298          { ac_try='test -s conftest$ac_exeext'
6299   { (eval echo "$as_me:6299: \"$ac_try\"") >&5
6300   (eval $ac_try) 2>&5
6301   ac_status=$?
6302   echo "$as_me:6302: \$? = $ac_status" >&5
6303   (exit $ac_status); }; }; then
6304   cf_cv_utf8_lib=yes
6305 else
6306   echo "$as_me: failed program was:" >&5
6307 cat conftest.$ac_ext >&5
6308
6309 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6310 # will be set on completion of the AC_TRY_LINK below.
6311 cf_cv_header_path_utf8=
6312 cf_cv_library_path_utf8=
6313
6314 echo "${as_me:-configure}:6314: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6315
6316 cf_save_LIBS="$LIBS"
6317
6318 cat >conftest.$ac_ext <<_ACEOF
6319 #line 6319 "configure"
6320 #include "confdefs.h"
6321
6322 #include <libutf8.h>
6323 int
6324 main (void)
6325 {
6326 putwc(0,0);
6327   ;
6328   return 0;
6329 }
6330 _ACEOF
6331 rm -f conftest.$ac_objext conftest$ac_exeext
6332 if { (eval echo "$as_me:6332: \"$ac_link\"") >&5
6333   (eval $ac_link) 2>&5
6334   ac_status=$?
6335   echo "$as_me:6335: \$? = $ac_status" >&5
6336   (exit $ac_status); } &&
6337          { ac_try='test -s conftest$ac_exeext'
6338   { (eval echo "$as_me:6338: \"$ac_try\"") >&5
6339   (eval $ac_try) 2>&5
6340   ac_status=$?
6341   echo "$as_me:6341: \$? = $ac_status" >&5
6342   (exit $ac_status); }; }; then
6343
6344         cf_cv_find_linkage_utf8=yes
6345         cf_cv_header_path_utf8=/usr/include
6346         cf_cv_library_path_utf8=/usr/lib
6347
6348 else
6349   echo "$as_me: failed program was:" >&5
6350 cat conftest.$ac_ext >&5
6351
6352 LIBS="-lutf8  $cf_save_LIBS"
6353
6354 cat >conftest.$ac_ext <<_ACEOF
6355 #line 6355 "configure"
6356 #include "confdefs.h"
6357
6358 #include <libutf8.h>
6359 int
6360 main (void)
6361 {
6362 putwc(0,0);
6363   ;
6364   return 0;
6365 }
6366 _ACEOF
6367 rm -f conftest.$ac_objext conftest$ac_exeext
6368 if { (eval echo "$as_me:6368: \"$ac_link\"") >&5
6369   (eval $ac_link) 2>&5
6370   ac_status=$?
6371   echo "$as_me:6371: \$? = $ac_status" >&5
6372   (exit $ac_status); } &&
6373          { ac_try='test -s conftest$ac_exeext'
6374   { (eval echo "$as_me:6374: \"$ac_try\"") >&5
6375   (eval $ac_try) 2>&5
6376   ac_status=$?
6377   echo "$as_me:6377: \$? = $ac_status" >&5
6378   (exit $ac_status); }; }; then
6379
6380         cf_cv_find_linkage_utf8=yes
6381         cf_cv_header_path_utf8=/usr/include
6382         cf_cv_library_path_utf8=/usr/lib
6383         cf_cv_library_file_utf8="-lutf8"
6384
6385 else
6386   echo "$as_me: failed program was:" >&5
6387 cat conftest.$ac_ext >&5
6388
6389         cf_cv_find_linkage_utf8=no
6390         LIBS="$cf_save_LIBS"
6391
6392         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6393
6394 echo "${as_me:-configure}:6394: testing find linkage for utf8 library ..." 1>&5
6395
6396 echo "${as_me:-configure}:6396: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6397
6398         cf_save_CPPFLAGS="$CPPFLAGS"
6399         cf_test_CPPFLAGS="$CPPFLAGS"
6400
6401 cf_search=
6402
6403 # collect the current set of include-directories from compiler flags
6404 cf_header_path_list=""
6405 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6406         for cf_header_path in $CPPFLAGS $CFLAGS
6407         do
6408                 case $cf_header_path in
6409                 (-I*)
6410                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6411
6412 test "x$cf_header_path" != "xNONE" && \
6413 test -d "$cf_header_path" && \
6414  {
6415         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6416         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6417         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6418         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6419         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6420         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6421 }
6422
6423                         cf_header_path_list="$cf_header_path_list $cf_search"
6424                         ;;
6425                 esac
6426         done
6427 fi
6428
6429 # add the variations for the package we are looking for
6430
6431 cf_search=
6432
6433 test "x$prefix" != "xNONE" && \
6434 test -d "$prefix" && \
6435  {
6436         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6437         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6438         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6439         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6440         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6441         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6442 }
6443
6444 for cf_subdir_prefix in \
6445         /usr \
6446         /usr/local \
6447         /usr/pkg \
6448         /opt \
6449         /opt/local \
6450         $HOME
6451 do
6452
6453 test "x$cf_subdir_prefix" != "x$prefix" && \
6454 test -d "$cf_subdir_prefix" && \
6455 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6456         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6457         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6458         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6459         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6460         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6461         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6462 }
6463
6464 done
6465
6466 test "$includedir" != NONE && \
6467 test "$includedir" != "/usr/include" && \
6468 test -d "$includedir" && {
6469         test -d $includedir &&    cf_search="$cf_search $includedir"
6470         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6471 }
6472
6473 test "$oldincludedir" != NONE && \
6474 test "$oldincludedir" != "/usr/include" && \
6475 test -d "$oldincludedir" && {
6476         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6477         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6478 }
6479
6480 cf_search="$cf_search $cf_header_path_list"
6481
6482         for cf_cv_header_path_utf8 in $cf_search
6483         do
6484                 if test -d $cf_cv_header_path_utf8 ; then
6485                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6486
6487 echo "${as_me:-configure}:6487: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6488
6489                         CPPFLAGS="$cf_save_CPPFLAGS"
6490
6491         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6492         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6493
6494                         cat >conftest.$ac_ext <<_ACEOF
6495 #line 6495 "configure"
6496 #include "confdefs.h"
6497
6498 #include <libutf8.h>
6499 int
6500 main (void)
6501 {
6502 putwc(0,0);
6503   ;
6504   return 0;
6505 }
6506 _ACEOF
6507 rm -f conftest.$ac_objext
6508 if { (eval echo "$as_me:6508: \"$ac_compile\"") >&5
6509   (eval $ac_compile) 2>&5
6510   ac_status=$?
6511   echo "$as_me:6511: \$? = $ac_status" >&5
6512   (exit $ac_status); } &&
6513          { ac_try='test -s conftest.$ac_objext'
6514   { (eval echo "$as_me:6514: \"$ac_try\"") >&5
6515   (eval $ac_try) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); }; }; then
6519
6520                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6521
6522 echo "${as_me:-configure}:6522: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6523
6524                                 cf_cv_find_linkage_utf8=maybe
6525                                 cf_test_CPPFLAGS="$CPPFLAGS"
6526                                 break
6527 else
6528   echo "$as_me: failed program was:" >&5
6529 cat conftest.$ac_ext >&5
6530
6531                                 CPPFLAGS="$cf_save_CPPFLAGS"
6532
6533 fi
6534 rm -f conftest.$ac_objext conftest.$ac_ext
6535                 fi
6536         done
6537
6538         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6539
6540 echo "${as_me:-configure}:6540: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6541
6542                 cf_save_LIBS="$LIBS"
6543                 cf_save_LDFLAGS="$LDFLAGS"
6544
6545                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6546
6547 cf_search=
6548 cf_library_path_list=""
6549 if test -n "${LDFLAGS}${LIBS}" ; then
6550         for cf_library_path in $LDFLAGS $LIBS
6551         do
6552                 case $cf_library_path in
6553                 (-L*)
6554                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6555
6556 test "x$cf_library_path" != "xNONE" && \
6557 test -d "$cf_library_path" && \
6558  {
6559         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6560         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6561         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6562         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6563         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6564         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6565 }
6566
6567                         cf_library_path_list="$cf_library_path_list $cf_search"
6568                         ;;
6569                 esac
6570         done
6571 fi
6572
6573 cf_search=
6574
6575 test "x$prefix" != "xNONE" && \
6576 test -d "$prefix" && \
6577  {
6578         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6579         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6580         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6581         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6582         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6583         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6584 }
6585
6586 for cf_subdir_prefix in \
6587         /usr \
6588         /usr/local \
6589         /usr/pkg \
6590         /opt \
6591         /opt/local \
6592         $HOME
6593 do
6594
6595 test "x$cf_subdir_prefix" != "x$prefix" && \
6596 test -d "$cf_subdir_prefix" && \
6597 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6598         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6599         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6600         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6601         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6602         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6603         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6604 }
6605
6606 done
6607
6608 cf_search="$cf_library_path_list $cf_search"
6609
6610                         for cf_cv_library_path_utf8 in $cf_search
6611                         do
6612                                 if test -d $cf_cv_library_path_utf8 ; then
6613                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6614
6615 echo "${as_me:-configure}:6615: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6616
6617                                         CPPFLAGS="$cf_test_CPPFLAGS"
6618                                         LIBS="-lutf8  $cf_save_LIBS"
6619                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6620                                         cat >conftest.$ac_ext <<_ACEOF
6621 #line 6621 "configure"
6622 #include "confdefs.h"
6623
6624 #include <libutf8.h>
6625 int
6626 main (void)
6627 {
6628 putwc(0,0);
6629   ;
6630   return 0;
6631 }
6632 _ACEOF
6633 rm -f conftest.$ac_objext conftest$ac_exeext
6634 if { (eval echo "$as_me:6634: \"$ac_link\"") >&5
6635   (eval $ac_link) 2>&5
6636   ac_status=$?
6637   echo "$as_me:6637: \$? = $ac_status" >&5
6638   (exit $ac_status); } &&
6639          { ac_try='test -s conftest$ac_exeext'
6640   { (eval echo "$as_me:6640: \"$ac_try\"") >&5
6641   (eval $ac_try) 2>&5
6642   ac_status=$?
6643   echo "$as_me:6643: \$? = $ac_status" >&5
6644   (exit $ac_status); }; }; then
6645
6646                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6647
6648 echo "${as_me:-configure}:6648: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6649
6650                                         cf_cv_find_linkage_utf8=yes
6651                                         cf_cv_library_file_utf8="-lutf8"
6652                                         break
6653 else
6654   echo "$as_me: failed program was:" >&5
6655 cat conftest.$ac_ext >&5
6656
6657                                         CPPFLAGS="$cf_save_CPPFLAGS"
6658                                         LIBS="$cf_save_LIBS"
6659                                         LDFLAGS="$cf_save_LDFLAGS"
6660
6661 fi
6662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6663                                 fi
6664                         done
6665                         CPPFLAGS="$cf_save_CPPFLAGS"
6666                         LDFLAGS="$cf_save_LDFLAGS"
6667                 fi
6668
6669         else
6670                 cf_cv_find_linkage_utf8=no
6671         fi
6672
6673 fi
6674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6675
6676 fi
6677 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6678
6679 LIBS="$cf_save_LIBS"
6680
6681 if test "$cf_cv_find_linkage_utf8" = yes ; then
6682 cf_cv_utf8_lib=add-on
6683 else
6684 cf_cv_utf8_lib=no
6685 fi
6686
6687 fi
6688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6689 fi
6690 echo "$as_me:6690: result: $cf_cv_utf8_lib" >&5
6691 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6692
6693 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6694 # ncurses/ncursesw:
6695 if test "$cf_cv_utf8_lib" = "add-on" ; then
6696
6697 cat >>confdefs.h <<\EOF
6698 #define HAVE_LIBUTF8_H 1
6699 EOF
6700
6701 if test -n "$cf_cv_header_path_utf8" ; then
6702   for cf_add_incdir in $cf_cv_header_path_utf8
6703   do
6704         while test $cf_add_incdir != /usr/include
6705         do
6706           if test -d $cf_add_incdir
6707           then
6708                 cf_have_incdir=no
6709                 if test -n "$CFLAGS$CPPFLAGS" ; then
6710                   # a loop is needed to ensure we can add subdirs of existing dirs
6711                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6712                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6713                           cf_have_incdir=yes; break
6714                         fi
6715                   done
6716                 fi
6717
6718                 if test "$cf_have_incdir" = no ; then
6719                   if test "$cf_add_incdir" = /usr/local/include ; then
6720                         if test "$GCC" = yes
6721                         then
6722                           cf_save_CPPFLAGS=$CPPFLAGS
6723
6724         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6725         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6726
6727                           cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730 #include <stdio.h>
6731 int
6732 main (void)
6733 {
6734 printf("Hello")
6735   ;
6736   return 0;
6737 }
6738 _ACEOF
6739 rm -f conftest.$ac_objext
6740 if { (eval echo "$as_me:6740: \"$ac_compile\"") >&5
6741   (eval $ac_compile) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit $ac_status); } &&
6745          { ac_try='test -s conftest.$ac_objext'
6746   { (eval echo "$as_me:6746: \"$ac_try\"") >&5
6747   (eval $ac_try) 2>&5
6748   ac_status=$?
6749   echo "$as_me:6749: \$? = $ac_status" >&5
6750   (exit $ac_status); }; }; then
6751   :
6752 else
6753   echo "$as_me: failed program was:" >&5
6754 cat conftest.$ac_ext >&5
6755 cf_have_incdir=yes
6756 fi
6757 rm -f conftest.$ac_objext conftest.$ac_ext
6758                           CPPFLAGS=$cf_save_CPPFLAGS
6759                         fi
6760                   fi
6761                 fi
6762
6763                 if test "$cf_have_incdir" = no ; then
6764                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6765
6766 echo "${as_me:-configure}:6766: testing adding $cf_add_incdir to include-path ..." 1>&5
6767
6768                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6769
6770                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6771                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6772                   cf_add_incdir="$cf_top_incdir"
6773                 else
6774                   break
6775                 fi
6776           else
6777                 break
6778           fi
6779         done
6780   done
6781 fi
6782
6783 if test -n "$cf_cv_library_path_utf8" ; then
6784         for cf_add_libdir in $cf_cv_library_path_utf8
6785         do
6786                 if test $cf_add_libdir = /usr/lib ; then
6787                         :
6788                 elif test -d $cf_add_libdir
6789                 then
6790                         cf_have_libdir=no
6791                         if test -n "$LDFLAGS$LIBS" ; then
6792                                 # a loop is needed to ensure we can add subdirs of existing dirs
6793                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6794                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6795                                                 cf_have_libdir=yes; break
6796                                         fi
6797                                 done
6798                         fi
6799                         if test "$cf_have_libdir" = no ; then
6800                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6801
6802 echo "${as_me:-configure}:6802: testing adding $cf_add_libdir to library-path ..." 1>&5
6803
6804                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6805                         fi
6806                 fi
6807         done
6808 fi
6809
6810 cf_add_libs="$LIBS"
6811 # reverse order
6812 cf_add_0lib=
6813 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6814 # filter duplicates
6815 for cf_add_1lib in $cf_add_0lib; do
6816         for cf_add_2lib in $cf_add_libs; do
6817                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6818                         cf_add_1lib=
6819                         break
6820                 fi
6821         done
6822         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6823 done
6824 LIBS="$cf_add_libs"
6825
6826 fi
6827
6828 cf_ncuconfig_root=ncursesw
6829 cf_have_ncuconfig=no
6830
6831 if test "x${PKG_CONFIG:=none}" != xnone; then
6832         echo "$as_me:6832: checking pkg-config for $cf_ncuconfig_root" >&5
6833 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6834         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6835                 echo "$as_me:6835: result: yes" >&5
6836 echo "${ECHO_T}yes" >&6
6837
6838                 echo "$as_me:6838: checking if the $cf_ncuconfig_root package files work" >&5
6839 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6840                 cf_have_ncuconfig=unknown
6841
6842                 cf_save_CFLAGS="$CFLAGS"
6843                 cf_save_CPPFLAGS="$CPPFLAGS"
6844                 cf_save_LIBS="$LIBS"
6845
6846                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
6847                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
6848
6849                 # while -W for passing linker flags is prevalent, it is not "standard".
6850                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
6851                 # incompatible _and_ non-standard -W option which gives an error.  Work
6852                 # around that pitfall.
6853                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
6854                 (x*c[89]9@@*-W*)
6855
6856 cf_fix_cppflags=no
6857 cf_new_cflags=
6858 cf_new_cppflags=
6859 cf_new_extra_cppflags=
6860
6861 for cf_add_cflags in $cf_pkg_cflags
6862 do
6863 case $cf_fix_cppflags in
6864 (no)
6865         case $cf_add_cflags in
6866         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6867                 case $cf_add_cflags in
6868                 (-D*)
6869                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6870
6871                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6872                                 && test -z "${cf_tst_cflags}" \
6873                                 && cf_fix_cppflags=yes
6874
6875                         if test $cf_fix_cppflags = yes ; then
6876
6877         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6878         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6879
6880                                 continue
6881                         elif test "${cf_tst_cflags}" = "\"'" ; then
6882
6883         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6884         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6885
6886                                 continue
6887                         fi
6888                         ;;
6889                 esac
6890                 case "$CPPFLAGS" in
6891                 (*$cf_add_cflags)
6892                         ;;
6893                 (*)
6894                         case $cf_add_cflags in
6895                         (-D*)
6896                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6897
6898 CPPFLAGS=`echo "$CPPFLAGS" | \
6899         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6900                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6901
6902                                 ;;
6903                         esac
6904
6905         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6906         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6907
6908                         ;;
6909                 esac
6910                 ;;
6911         (*)
6912
6913         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6914         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6915
6916                 ;;
6917         esac
6918         ;;
6919 (yes)
6920
6921         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6922         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6923
6924         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6925
6926         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6927                 && test -z "${cf_tst_cflags}" \
6928                 && cf_fix_cppflags=no
6929         ;;
6930 esac
6931 done
6932
6933 if test -n "$cf_new_cflags" ; then
6934
6935         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6936         CFLAGS="${CFLAGS}$cf_new_cflags"
6937
6938 fi
6939
6940 if test -n "$cf_new_cppflags" ; then
6941
6942         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6943         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6944
6945 fi
6946
6947 if test -n "$cf_new_extra_cppflags" ; then
6948
6949         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6950         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6951
6952 fi
6953
6954 cf_add_libs="$LIBS"
6955 # reverse order
6956 cf_add_0lib=
6957 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6958 # filter duplicates
6959 for cf_add_1lib in $cf_add_0lib; do
6960         for cf_add_2lib in $cf_add_libs; do
6961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6962                         cf_add_1lib=
6963                         break
6964                 fi
6965         done
6966         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6967 done
6968 LIBS="$cf_add_libs"
6969
6970                         cat >conftest.$ac_ext <<_ACEOF
6971 #line 6971 "configure"
6972 #include "confdefs.h"
6973 #include <${cf_cv_ncurses_header:-curses.h}>
6974 int
6975 main (void)
6976 {
6977 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6978   ;
6979   return 0;
6980 }
6981 _ACEOF
6982 rm -f conftest.$ac_objext conftest$ac_exeext
6983 if { (eval echo "$as_me:6983: \"$ac_link\"") >&5
6984   (eval $ac_link) 2>&5
6985   ac_status=$?
6986   echo "$as_me:6986: \$? = $ac_status" >&5
6987   (exit $ac_status); } &&
6988          { ac_try='test -s conftest$ac_exeext'
6989   { (eval echo "$as_me:6989: \"$ac_try\"") >&5
6990   (eval $ac_try) 2>&5
6991   ac_status=$?
6992   echo "$as_me:6992: \$? = $ac_status" >&5
6993   (exit $ac_status); }; }; then
6994   if test "$cross_compiling" = yes; then
6995   cf_test_ncuconfig=maybe
6996 else
6997   cat >conftest.$ac_ext <<_ACEOF
6998 #line 6998 "configure"
6999 #include "confdefs.h"
7000 #include <${cf_cv_ncurses_header:-curses.h}>
7001                                         int main(void)
7002                                         { char *xx = curses_version(); return (xx == 0); }
7003 _ACEOF
7004 rm -f conftest$ac_exeext
7005 if { (eval echo "$as_me:7005: \"$ac_link\"") >&5
7006   (eval $ac_link) 2>&5
7007   ac_status=$?
7008   echo "$as_me:7008: \$? = $ac_status" >&5
7009   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7010   { (eval echo "$as_me:7010: \"$ac_try\"") >&5
7011   (eval $ac_try) 2>&5
7012   ac_status=$?
7013   echo "$as_me:7013: \$? = $ac_status" >&5
7014   (exit $ac_status); }; }; then
7015   cf_test_ncuconfig=yes
7016 else
7017   echo "$as_me: program exited with status $ac_status" >&5
7018 echo "$as_me: failed program was:" >&5
7019 cat conftest.$ac_ext >&5
7020 cf_test_ncuconfig=no
7021 fi
7022 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7023 fi
7024 else
7025   echo "$as_me: failed program was:" >&5
7026 cat conftest.$ac_ext >&5
7027 cf_test_ncuconfig=no
7028 fi
7029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7030
7031                         CFLAGS="$cf_save_CFLAGS"
7032                         CPPFLAGS="$cf_save_CPPFLAGS"
7033                         LIBS="$cf_save_LIBS"
7034
7035                         if test "x$cf_test_ncuconfig" != xyes; then
7036                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7037                                 cf_pkg_cflags="$cf_temp"
7038                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7039                                 cf_pkg_libs="$cf_temp"
7040                         fi
7041                         ;;
7042                 esac
7043
7044 cf_fix_cppflags=no
7045 cf_new_cflags=
7046 cf_new_cppflags=
7047 cf_new_extra_cppflags=
7048
7049 for cf_add_cflags in $cf_pkg_cflags
7050 do
7051 case $cf_fix_cppflags in
7052 (no)
7053         case $cf_add_cflags in
7054         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7055                 case $cf_add_cflags in
7056                 (-D*)
7057                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7058
7059                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7060                                 && test -z "${cf_tst_cflags}" \
7061                                 && cf_fix_cppflags=yes
7062
7063                         if test $cf_fix_cppflags = yes ; then
7064
7065         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7066         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7067
7068                                 continue
7069                         elif test "${cf_tst_cflags}" = "\"'" ; then
7070
7071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7073
7074                                 continue
7075                         fi
7076                         ;;
7077                 esac
7078                 case "$CPPFLAGS" in
7079                 (*$cf_add_cflags)
7080                         ;;
7081                 (*)
7082                         case $cf_add_cflags in
7083                         (-D*)
7084                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7085
7086 CPPFLAGS=`echo "$CPPFLAGS" | \
7087         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7088                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7089
7090                                 ;;
7091                         esac
7092
7093         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7094         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7095
7096                         ;;
7097                 esac
7098                 ;;
7099         (*)
7100
7101         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7102         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7103
7104                 ;;
7105         esac
7106         ;;
7107 (yes)
7108
7109         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7110         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7111
7112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7113
7114         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7115                 && test -z "${cf_tst_cflags}" \
7116                 && cf_fix_cppflags=no
7117         ;;
7118 esac
7119 done
7120
7121 if test -n "$cf_new_cflags" ; then
7122
7123         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7124         CFLAGS="${CFLAGS}$cf_new_cflags"
7125
7126 fi
7127
7128 if test -n "$cf_new_cppflags" ; then
7129
7130         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7131         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7132
7133 fi
7134
7135 if test -n "$cf_new_extra_cppflags" ; then
7136
7137         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7138         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7139
7140 fi
7141
7142 cf_add_libs="$LIBS"
7143 # reverse order
7144 cf_add_0lib=
7145 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7146 # filter duplicates
7147 for cf_add_1lib in $cf_add_0lib; do
7148         for cf_add_2lib in $cf_add_libs; do
7149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7150                         cf_add_1lib=
7151                         break
7152                 fi
7153         done
7154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7155 done
7156 LIBS="$cf_add_libs"
7157
7158                 cat >conftest.$ac_ext <<_ACEOF
7159 #line 7159 "configure"
7160 #include "confdefs.h"
7161 #include <${cf_cv_ncurses_header:-curses.h}>
7162 int
7163 main (void)
7164 {
7165 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7166   ;
7167   return 0;
7168 }
7169 _ACEOF
7170 rm -f conftest.$ac_objext conftest$ac_exeext
7171 if { (eval echo "$as_me:7171: \"$ac_link\"") >&5
7172   (eval $ac_link) 2>&5
7173   ac_status=$?
7174   echo "$as_me:7174: \$? = $ac_status" >&5
7175   (exit $ac_status); } &&
7176          { ac_try='test -s conftest$ac_exeext'
7177   { (eval echo "$as_me:7177: \"$ac_try\"") >&5
7178   (eval $ac_try) 2>&5
7179   ac_status=$?
7180   echo "$as_me:7180: \$? = $ac_status" >&5
7181   (exit $ac_status); }; }; then
7182   if test "$cross_compiling" = yes; then
7183   cf_have_ncuconfig=maybe
7184 else
7185   cat >conftest.$ac_ext <<_ACEOF
7186 #line 7186 "configure"
7187 #include "confdefs.h"
7188 #include <${cf_cv_ncurses_header:-curses.h}>
7189                                 int main(void)
7190                                 { char *xx = curses_version(); return (xx == 0); }
7191 _ACEOF
7192 rm -f conftest$ac_exeext
7193 if { (eval echo "$as_me:7193: \"$ac_link\"") >&5
7194   (eval $ac_link) 2>&5
7195   ac_status=$?
7196   echo "$as_me:7196: \$? = $ac_status" >&5
7197   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7198   { (eval echo "$as_me:7198: \"$ac_try\"") >&5
7199   (eval $ac_try) 2>&5
7200   ac_status=$?
7201   echo "$as_me:7201: \$? = $ac_status" >&5
7202   (exit $ac_status); }; }; then
7203   cf_have_ncuconfig=yes
7204 else
7205   echo "$as_me: program exited with status $ac_status" >&5
7206 echo "$as_me: failed program was:" >&5
7207 cat conftest.$ac_ext >&5
7208 cf_have_ncuconfig=no
7209 fi
7210 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7211 fi
7212 else
7213   echo "$as_me: failed program was:" >&5
7214 cat conftest.$ac_ext >&5
7215 cf_have_ncuconfig=no
7216 fi
7217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7218                 echo "$as_me:7218: result: $cf_have_ncuconfig" >&5
7219 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7220                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7221                 if test "$cf_have_ncuconfig" != "yes"
7222                 then
7223                         CPPFLAGS="$cf_save_CPPFLAGS"
7224                         LIBS="$cf_save_LIBS"
7225                         NCURSES_CONFIG_PKG=none
7226                 else
7227
7228 cat >>confdefs.h <<\EOF
7229 #define NCURSES 1
7230 EOF
7231
7232                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7233
7234 echo "$as_me:7234: checking for terminfo header" >&5
7235 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7236 if test "${cf_cv_term_header+set}" = set; then
7237   echo $ECHO_N "(cached) $ECHO_C" >&6
7238 else
7239
7240 case ${cf_cv_ncurses_header} in
7241 (*/ncurses.h|*/ncursesw.h)
7242         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7243         ;;
7244 (*)
7245         cf_term_header=term.h
7246         ;;
7247 esac
7248
7249 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7250 do
7251 cat >conftest.$ac_ext <<_ACEOF
7252 #line 7252 "configure"
7253 #include "confdefs.h"
7254 #include <stdio.h>
7255 #include <${cf_cv_ncurses_header:-curses.h}>
7256 #include <$cf_test>
7257
7258 int
7259 main (void)
7260 {
7261 int x = auto_left_margin; (void)x
7262   ;
7263   return 0;
7264 }
7265 _ACEOF
7266 rm -f conftest.$ac_objext
7267 if { (eval echo "$as_me:7267: \"$ac_compile\"") >&5
7268   (eval $ac_compile) 2>&5
7269   ac_status=$?
7270   echo "$as_me:7270: \$? = $ac_status" >&5
7271   (exit $ac_status); } &&
7272          { ac_try='test -s conftest.$ac_objext'
7273   { (eval echo "$as_me:7273: \"$ac_try\"") >&5
7274   (eval $ac_try) 2>&5
7275   ac_status=$?
7276   echo "$as_me:7276: \$? = $ac_status" >&5
7277   (exit $ac_status); }; }; then
7278
7279         cf_cv_term_header="$cf_test"
7280 else
7281   echo "$as_me: failed program was:" >&5
7282 cat conftest.$ac_ext >&5
7283
7284         cf_cv_term_header=unknown
7285
7286 fi
7287 rm -f conftest.$ac_objext conftest.$ac_ext
7288         test "$cf_cv_term_header" != unknown && break
7289 done
7290
7291 fi
7292 echo "$as_me:7292: result: $cf_cv_term_header" >&5
7293 echo "${ECHO_T}$cf_cv_term_header" >&6
7294
7295 # Set definitions to allow ifdef'ing to accommodate subdirectories
7296
7297 case $cf_cv_term_header in
7298 (*term.h)
7299
7300 cat >>confdefs.h <<\EOF
7301 #define HAVE_TERM_H 1
7302 EOF
7303
7304         ;;
7305 esac
7306
7307 case $cf_cv_term_header in
7308 (ncurses/term.h)
7309
7310 cat >>confdefs.h <<\EOF
7311 #define HAVE_NCURSES_TERM_H 1
7312 EOF
7313
7314         ;;
7315 (ncursesw/term.h)
7316
7317 cat >>confdefs.h <<\EOF
7318 #define HAVE_NCURSESW_TERM_H 1
7319 EOF
7320
7321         ;;
7322 esac
7323
7324                 fi
7325
7326         else
7327                 echo "$as_me:7327: result: no" >&5
7328 echo "${ECHO_T}no" >&6
7329                 NCURSES_CONFIG_PKG=none
7330         fi
7331 else
7332         NCURSES_CONFIG_PKG=none
7333 fi
7334
7335 if test "x$cf_have_ncuconfig" = "xno"; then
7336         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7337
7338 if test -n "$ac_tool_prefix"; then
7339   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7340   do
7341     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7342 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7343 echo "$as_me:7343: checking for $ac_word" >&5
7344 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7345 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7346   echo $ECHO_N "(cached) $ECHO_C" >&6
7347 else
7348   if test -n "$NCURSES_CONFIG"; then
7349   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7350 else
7351   ac_save_IFS=$IFS; IFS=$ac_path_separator
7352 ac_dummy="$PATH"
7353 for ac_dir in $ac_dummy; do
7354   IFS=$ac_save_IFS
7355   test -z "$ac_dir" && ac_dir=.
7356   $as_executable_p "$ac_dir/$ac_word" || continue
7357 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7358 echo "$as_me:7358: found $ac_dir/$ac_word" >&5
7359 break
7360 done
7361
7362 fi
7363 fi
7364 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7365 if test -n "$NCURSES_CONFIG"; then
7366   echo "$as_me:7366: result: $NCURSES_CONFIG" >&5
7367 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7368 else
7369   echo "$as_me:7369: result: no" >&5
7370 echo "${ECHO_T}no" >&6
7371 fi
7372
7373     test -n "$NCURSES_CONFIG" && break
7374   done
7375 fi
7376 if test -z "$NCURSES_CONFIG"; then
7377   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7378   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7379 do
7380   # Extract the first word of "$ac_prog", so it can be a program name with args.
7381 set dummy $ac_prog; ac_word=$2
7382 echo "$as_me:7382: checking for $ac_word" >&5
7383 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7384 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7385   echo $ECHO_N "(cached) $ECHO_C" >&6
7386 else
7387   if test -n "$ac_ct_NCURSES_CONFIG"; then
7388   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7389 else
7390   ac_save_IFS=$IFS; IFS=$ac_path_separator
7391 ac_dummy="$PATH"
7392 for ac_dir in $ac_dummy; do
7393   IFS=$ac_save_IFS
7394   test -z "$ac_dir" && ac_dir=.
7395   $as_executable_p "$ac_dir/$ac_word" || continue
7396 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7397 echo "$as_me:7397: found $ac_dir/$ac_word" >&5
7398 break
7399 done
7400
7401 fi
7402 fi
7403 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7404 if test -n "$ac_ct_NCURSES_CONFIG"; then
7405   echo "$as_me:7405: result: $ac_ct_NCURSES_CONFIG" >&5
7406 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7407 else
7408   echo "$as_me:7408: result: no" >&5
7409 echo "${ECHO_T}no" >&6
7410 fi
7411
7412   test -n "$ac_ct_NCURSES_CONFIG" && break
7413 done
7414 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7415
7416   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7417 fi
7418
7419         if test "$NCURSES_CONFIG" != none ; then
7420
7421 cf_fix_cppflags=no
7422 cf_new_cflags=
7423 cf_new_cppflags=
7424 cf_new_extra_cppflags=
7425
7426 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7427 do
7428 case $cf_fix_cppflags in
7429 (no)
7430         case $cf_add_cflags in
7431         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7432                 case $cf_add_cflags in
7433                 (-D*)
7434                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7435
7436                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7437                                 && test -z "${cf_tst_cflags}" \
7438                                 && cf_fix_cppflags=yes
7439
7440                         if test $cf_fix_cppflags = yes ; then
7441
7442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7444
7445                                 continue
7446                         elif test "${cf_tst_cflags}" = "\"'" ; then
7447
7448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7450
7451                                 continue
7452                         fi
7453                         ;;
7454                 esac
7455                 case "$CPPFLAGS" in
7456                 (*$cf_add_cflags)
7457                         ;;
7458                 (*)
7459                         case $cf_add_cflags in
7460                         (-D*)
7461                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7462
7463 CPPFLAGS=`echo "$CPPFLAGS" | \
7464         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7465                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7466
7467                                 ;;
7468                         esac
7469
7470         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7471         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7472
7473                         ;;
7474                 esac
7475                 ;;
7476         (*)
7477
7478         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7479         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7480
7481                 ;;
7482         esac
7483         ;;
7484 (yes)
7485
7486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7488
7489         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7490
7491         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7492                 && test -z "${cf_tst_cflags}" \
7493                 && cf_fix_cppflags=no
7494         ;;
7495 esac
7496 done
7497
7498 if test -n "$cf_new_cflags" ; then
7499
7500         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7501         CFLAGS="${CFLAGS}$cf_new_cflags"
7502
7503 fi
7504
7505 if test -n "$cf_new_cppflags" ; then
7506
7507         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7508         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7509
7510 fi
7511
7512 if test -n "$cf_new_extra_cppflags" ; then
7513
7514         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7515         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7516
7517 fi
7518
7519 cf_add_libs="$LIBS"
7520 # reverse order
7521 cf_add_0lib=
7522 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7523 # filter duplicates
7524 for cf_add_1lib in $cf_add_0lib; do
7525         for cf_add_2lib in $cf_add_libs; do
7526                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7527                         cf_add_1lib=
7528                         break
7529                 fi
7530         done
7531         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7532 done
7533 LIBS="$cf_add_libs"
7534
7535                 # even with config script, some packages use no-override for curses.h
7536
7537 echo "$as_me:7537: checking if we have identified curses headers" >&5
7538 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7539 if test "${cf_cv_ncurses_header+set}" = set; then
7540   echo $ECHO_N "(cached) $ECHO_C" >&6
7541 else
7542
7543 cf_cv_ncurses_header=none
7544 for cf_header in \
7545         ncurses.h ncursesw/ncurses.h \
7546         curses.h ncursesw/curses.h
7547 do
7548 cat >conftest.$ac_ext <<_ACEOF
7549 #line 7549 "configure"
7550 #include "confdefs.h"
7551 #include <${cf_header}>
7552 int
7553 main (void)
7554 {
7555 initscr(); tgoto("?", 0,0)
7556   ;
7557   return 0;
7558 }
7559 _ACEOF
7560 rm -f conftest.$ac_objext
7561 if { (eval echo "$as_me:7561: \"$ac_compile\"") >&5
7562   (eval $ac_compile) 2>&5
7563   ac_status=$?
7564   echo "$as_me:7564: \$? = $ac_status" >&5
7565   (exit $ac_status); } &&
7566          { ac_try='test -s conftest.$ac_objext'
7567   { (eval echo "$as_me:7567: \"$ac_try\"") >&5
7568   (eval $ac_try) 2>&5
7569   ac_status=$?
7570   echo "$as_me:7570: \$? = $ac_status" >&5
7571   (exit $ac_status); }; }; then
7572   cf_cv_ncurses_header=$cf_header; break
7573 else
7574   echo "$as_me: failed program was:" >&5
7575 cat conftest.$ac_ext >&5
7576 fi
7577 rm -f conftest.$ac_objext conftest.$ac_ext
7578 done
7579
7580 fi
7581 echo "$as_me:7581: result: $cf_cv_ncurses_header" >&5
7582 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7583
7584 if test "$cf_cv_ncurses_header" = none ; then
7585         { { echo "$as_me:7585: error: No curses header-files found" >&5
7586 echo "$as_me: error: No curses header-files found" >&2;}
7587    { (exit 1); exit 1; }; }
7588 fi
7589
7590 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7591
7592 for ac_header in $cf_cv_ncurses_header
7593 do
7594 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7595 echo "$as_me:7595: checking for $ac_header" >&5
7596 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7597 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7598   echo $ECHO_N "(cached) $ECHO_C" >&6
7599 else
7600   cat >conftest.$ac_ext <<_ACEOF
7601 #line 7601 "configure"
7602 #include "confdefs.h"
7603 #include <$ac_header>
7604 _ACEOF
7605 if { (eval echo "$as_me:7605: \"$ac_cpp conftest.$ac_ext\"") >&5
7606   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7607   ac_status=$?
7608   egrep -v '^ *\+' conftest.er1 >conftest.err
7609   rm -f conftest.er1
7610   cat conftest.err >&5
7611   echo "$as_me:7611: \$? = $ac_status" >&5
7612   (exit $ac_status); } >/dev/null; then
7613   if test -s conftest.err; then
7614     ac_cpp_err=$ac_c_preproc_warn_flag
7615   else
7616     ac_cpp_err=
7617   fi
7618 else
7619   ac_cpp_err=yes
7620 fi
7621 if test -z "$ac_cpp_err"; then
7622   eval "$as_ac_Header=yes"
7623 else
7624   echo "$as_me: failed program was:" >&5
7625   cat conftest.$ac_ext >&5
7626   eval "$as_ac_Header=no"
7627 fi
7628 rm -f conftest.err conftest.$ac_ext
7629 fi
7630 echo "$as_me:7630: result: `eval echo '${'$as_ac_Header'}'`" >&5
7631 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7632 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7633   cat >>confdefs.h <<EOF
7634 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7635 EOF
7636
7637 fi
7638 done
7639
7640 cat >>confdefs.h <<\EOF
7641 #define NCURSES 1
7642 EOF
7643
7644 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7645
7646                 cat >>confdefs.h <<EOF
7647 #define $cf_nculib_ROOT 1
7648 EOF
7649
7650                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7651
7652         else
7653
7654 cf_ncuhdr_root=ncursesw
7655
7656 test -n "$cf_cv_curses_dir" && \
7657 test "$cf_cv_curses_dir" != "no" && { \
7658
7659 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7660   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7661   do
7662         while test $cf_add_incdir != /usr/include
7663         do
7664           if test -d $cf_add_incdir
7665           then
7666                 cf_have_incdir=no
7667                 if test -n "$CFLAGS$CPPFLAGS" ; then
7668                   # a loop is needed to ensure we can add subdirs of existing dirs
7669                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7670                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7671                           cf_have_incdir=yes; break
7672                         fi
7673                   done
7674                 fi
7675
7676                 if test "$cf_have_incdir" = no ; then
7677                   if test "$cf_add_incdir" = /usr/local/include ; then
7678                         if test "$GCC" = yes
7679                         then
7680                           cf_save_CPPFLAGS=$CPPFLAGS
7681
7682         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7683         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7684
7685                           cat >conftest.$ac_ext <<_ACEOF
7686 #line 7686 "configure"
7687 #include "confdefs.h"
7688 #include <stdio.h>
7689 int
7690 main (void)
7691 {
7692 printf("Hello")
7693   ;
7694   return 0;
7695 }
7696 _ACEOF
7697 rm -f conftest.$ac_objext
7698 if { (eval echo "$as_me:7698: \"$ac_compile\"") >&5
7699   (eval $ac_compile) 2>&5
7700   ac_status=$?
7701   echo "$as_me:7701: \$? = $ac_status" >&5
7702   (exit $ac_status); } &&
7703          { ac_try='test -s conftest.$ac_objext'
7704   { (eval echo "$as_me:7704: \"$ac_try\"") >&5
7705   (eval $ac_try) 2>&5
7706   ac_status=$?
7707   echo "$as_me:7707: \$? = $ac_status" >&5
7708   (exit $ac_status); }; }; then
7709   :
7710 else
7711   echo "$as_me: failed program was:" >&5
7712 cat conftest.$ac_ext >&5
7713 cf_have_incdir=yes
7714 fi
7715 rm -f conftest.$ac_objext conftest.$ac_ext
7716                           CPPFLAGS=$cf_save_CPPFLAGS
7717                         fi
7718                   fi
7719                 fi
7720
7721                 if test "$cf_have_incdir" = no ; then
7722                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7723
7724 echo "${as_me:-configure}:7724: testing adding $cf_add_incdir to include-path ..." 1>&5
7725
7726                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7727
7728                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7729                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7730                   cf_add_incdir="$cf_top_incdir"
7731                 else
7732                   break
7733                 fi
7734           else
7735                 break
7736           fi
7737         done
7738   done
7739 fi
7740
7741 }
7742
7743 echo "$as_me:7743: checking for $cf_ncuhdr_root header in include-path" >&5
7744 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7745 if test "${cf_cv_ncurses_h+set}" = set; then
7746   echo $ECHO_N "(cached) $ECHO_C" >&6
7747 else
7748
7749         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7750         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7751         for cf_header in $cf_header_list
7752         do
7753
7754         cat >conftest.$ac_ext <<_ACEOF
7755 #line 7755 "configure"
7756 #include "confdefs.h"
7757
7758 #define _XOPEN_SOURCE_EXTENDED
7759 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7760 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7761
7762 #include <$cf_header>
7763 int
7764 main (void)
7765 {
7766
7767 #ifdef NCURSES_VERSION
7768
7769 #ifndef WACS_BSSB
7770         make an error
7771 #endif
7772
7773 printf("%s\n", NCURSES_VERSION);
7774 #else
7775 #ifdef __NCURSES_H
7776 printf("old\n");
7777 #else
7778         make an error
7779 #endif
7780 #endif
7781
7782   ;
7783   return 0;
7784 }
7785 _ACEOF
7786 rm -f conftest.$ac_objext
7787 if { (eval echo "$as_me:7787: \"$ac_compile\"") >&5
7788   (eval $ac_compile) 2>&5
7789   ac_status=$?
7790   echo "$as_me:7790: \$? = $ac_status" >&5
7791   (exit $ac_status); } &&
7792          { ac_try='test -s conftest.$ac_objext'
7793   { (eval echo "$as_me:7793: \"$ac_try\"") >&5
7794   (eval $ac_try) 2>&5
7795   ac_status=$?
7796   echo "$as_me:7796: \$? = $ac_status" >&5
7797   (exit $ac_status); }; }; then
7798   cf_cv_ncurses_h=$cf_header
7799
7800 else
7801   echo "$as_me: failed program was:" >&5
7802 cat conftest.$ac_ext >&5
7803 cf_cv_ncurses_h=no
7804 fi
7805 rm -f conftest.$ac_objext conftest.$ac_ext
7806
7807                 test "$cf_cv_ncurses_h" != no && break
7808         done
7809
7810 fi
7811 echo "$as_me:7811: result: $cf_cv_ncurses_h" >&5
7812 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7813
7814 if test "$cf_cv_ncurses_h" != no ; then
7815         cf_cv_ncurses_header=$cf_cv_ncurses_h
7816 else
7817
7818 echo "$as_me:7818: checking for $cf_ncuhdr_root include-path" >&5
7819 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7820 if test "${cf_cv_ncurses_h2+set}" = set; then
7821   echo $ECHO_N "(cached) $ECHO_C" >&6
7822 else
7823
7824         test -n "$verbose" && echo
7825
7826 cf_search=
7827
7828 # collect the current set of include-directories from compiler flags
7829 cf_header_path_list=""
7830 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7831         for cf_header_path in $CPPFLAGS $CFLAGS
7832         do
7833                 case $cf_header_path in
7834                 (-I*)
7835                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7836
7837 test "x$cf_header_path" != "xNONE" && \
7838 test -d "$cf_header_path" && \
7839  {
7840         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7841         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7842         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7843         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7844         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7845         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"
7846 }
7847
7848                         cf_header_path_list="$cf_header_path_list $cf_search"
7849                         ;;
7850                 esac
7851         done
7852 fi
7853
7854 # add the variations for the package we are looking for
7855
7856 cf_search=
7857
7858 test "x$prefix" != "xNONE" && \
7859 test -d "$prefix" && \
7860  {
7861         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7862         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7863         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7864         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7865         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7866         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7867 }
7868
7869 for cf_subdir_prefix in \
7870         /usr \
7871         /usr/local \
7872         /usr/pkg \
7873         /opt \
7874         /opt/local \
7875         $HOME
7876 do
7877
7878 test "x$cf_subdir_prefix" != "x$prefix" && \
7879 test -d "$cf_subdir_prefix" && \
7880 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7881         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7882         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7883         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7884         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7885         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7886         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"
7887 }
7888
7889 done
7890
7891 test "$includedir" != NONE && \
7892 test "$includedir" != "/usr/include" && \
7893 test -d "$includedir" && {
7894         test -d $includedir &&    cf_search="$cf_search $includedir"
7895         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7896 }
7897
7898 test "$oldincludedir" != NONE && \
7899 test "$oldincludedir" != "/usr/include" && \
7900 test -d "$oldincludedir" && {
7901         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7902         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7903 }
7904
7905 cf_search="$cf_search $cf_header_path_list"
7906
7907         test -n "$verbose" && echo search path $cf_search
7908         cf_save2_CPPFLAGS="$CPPFLAGS"
7909         for cf_incdir in $cf_search
7910         do
7911
7912 if test -n "$cf_incdir" ; then
7913   for cf_add_incdir in $cf_incdir
7914   do
7915         while test $cf_add_incdir != /usr/include
7916         do
7917           if test -d $cf_add_incdir
7918           then
7919                 cf_have_incdir=no
7920                 if test -n "$CFLAGS$CPPFLAGS" ; then
7921                   # a loop is needed to ensure we can add subdirs of existing dirs
7922                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7923                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7924                           cf_have_incdir=yes; break
7925                         fi
7926                   done
7927                 fi
7928
7929                 if test "$cf_have_incdir" = no ; then
7930                   if test "$cf_add_incdir" = /usr/local/include ; then
7931                         if test "$GCC" = yes
7932                         then
7933                           cf_save_CPPFLAGS=$CPPFLAGS
7934
7935         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7936         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7937
7938                           cat >conftest.$ac_ext <<_ACEOF
7939 #line 7939 "configure"
7940 #include "confdefs.h"
7941 #include <stdio.h>
7942 int
7943 main (void)
7944 {
7945 printf("Hello")
7946   ;
7947   return 0;
7948 }
7949 _ACEOF
7950 rm -f conftest.$ac_objext
7951 if { (eval echo "$as_me:7951: \"$ac_compile\"") >&5
7952   (eval $ac_compile) 2>&5
7953   ac_status=$?
7954   echo "$as_me:7954: \$? = $ac_status" >&5
7955   (exit $ac_status); } &&
7956          { ac_try='test -s conftest.$ac_objext'
7957   { (eval echo "$as_me:7957: \"$ac_try\"") >&5
7958   (eval $ac_try) 2>&5
7959   ac_status=$?
7960   echo "$as_me:7960: \$? = $ac_status" >&5
7961   (exit $ac_status); }; }; then
7962   :
7963 else
7964   echo "$as_me: failed program was:" >&5
7965 cat conftest.$ac_ext >&5
7966 cf_have_incdir=yes
7967 fi
7968 rm -f conftest.$ac_objext conftest.$ac_ext
7969                           CPPFLAGS=$cf_save_CPPFLAGS
7970                         fi
7971                   fi
7972                 fi
7973
7974                 if test "$cf_have_incdir" = no ; then
7975                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7976
7977 echo "${as_me:-configure}:7977: testing adding $cf_add_incdir to include-path ..." 1>&5
7978
7979                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7980
7981                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7982                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7983                   cf_add_incdir="$cf_top_incdir"
7984                 else
7985                   break
7986                 fi
7987           else
7988                 break
7989           fi
7990         done
7991   done
7992 fi
7993
7994                 for cf_header in \
7995                         ncurses.h \
7996                         curses.h
7997                 do
7998
7999         cat >conftest.$ac_ext <<_ACEOF
8000 #line 8000 "configure"
8001 #include "confdefs.h"
8002
8003 #include <$cf_header>
8004 int
8005 main (void)
8006 {
8007
8008 #ifdef NCURSES_VERSION
8009
8010 printf("%s\n", NCURSES_VERSION);
8011 #else
8012 #ifdef __NCURSES_H
8013 printf("old\n");
8014 #else
8015         make an error
8016 #endif
8017 #endif
8018
8019   ;
8020   return 0;
8021 }
8022 _ACEOF
8023 rm -f conftest.$ac_objext
8024 if { (eval echo "$as_me:8024: \"$ac_compile\"") >&5
8025   (eval $ac_compile) 2>&5
8026   ac_status=$?
8027   echo "$as_me:8027: \$? = $ac_status" >&5
8028   (exit $ac_status); } &&
8029          { ac_try='test -s conftest.$ac_objext'
8030   { (eval echo "$as_me:8030: \"$ac_try\"") >&5
8031   (eval $ac_try) 2>&5
8032   ac_status=$?
8033   echo "$as_me:8033: \$? = $ac_status" >&5
8034   (exit $ac_status); }; }; then
8035   cf_cv_ncurses_h2=$cf_header
8036
8037 else
8038   echo "$as_me: failed program was:" >&5
8039 cat conftest.$ac_ext >&5
8040 cf_cv_ncurses_h2=no
8041 fi
8042 rm -f conftest.$ac_objext conftest.$ac_ext
8043
8044                         if test "$cf_cv_ncurses_h2" != no ; then
8045                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8046                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8047                                 break
8048                         fi
8049                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8050                 done
8051                 CPPFLAGS="$cf_save2_CPPFLAGS"
8052                 test "$cf_cv_ncurses_h2" != no && break
8053         done
8054         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8054: error: not found" >&5
8055 echo "$as_me: error: not found" >&2;}
8056    { (exit 1); exit 1; }; }
8057
8058 fi
8059 echo "$as_me:8059: result: $cf_cv_ncurses_h2" >&5
8060 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8061
8062         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8063         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8064         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8065                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8066         fi
8067
8068 if test -n "$cf_1st_incdir" ; then
8069   for cf_add_incdir in $cf_1st_incdir
8070   do
8071         while test $cf_add_incdir != /usr/include
8072         do
8073           if test -d $cf_add_incdir
8074           then
8075                 cf_have_incdir=no
8076                 if test -n "$CFLAGS$CPPFLAGS" ; then
8077                   # a loop is needed to ensure we can add subdirs of existing dirs
8078                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8079                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8080                           cf_have_incdir=yes; break
8081                         fi
8082                   done
8083                 fi
8084
8085                 if test "$cf_have_incdir" = no ; then
8086                   if test "$cf_add_incdir" = /usr/local/include ; then
8087                         if test "$GCC" = yes
8088                         then
8089                           cf_save_CPPFLAGS=$CPPFLAGS
8090
8091         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8092         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8093
8094                           cat >conftest.$ac_ext <<_ACEOF
8095 #line 8095 "configure"
8096 #include "confdefs.h"
8097 #include <stdio.h>
8098 int
8099 main (void)
8100 {
8101 printf("Hello")
8102   ;
8103   return 0;
8104 }
8105 _ACEOF
8106 rm -f conftest.$ac_objext
8107 if { (eval echo "$as_me:8107: \"$ac_compile\"") >&5
8108   (eval $ac_compile) 2>&5
8109   ac_status=$?
8110   echo "$as_me:8110: \$? = $ac_status" >&5
8111   (exit $ac_status); } &&
8112          { ac_try='test -s conftest.$ac_objext'
8113   { (eval echo "$as_me:8113: \"$ac_try\"") >&5
8114   (eval $ac_try) 2>&5
8115   ac_status=$?
8116   echo "$as_me:8116: \$? = $ac_status" >&5
8117   (exit $ac_status); }; }; then
8118   :
8119 else
8120   echo "$as_me: failed program was:" >&5
8121 cat conftest.$ac_ext >&5
8122 cf_have_incdir=yes
8123 fi
8124 rm -f conftest.$ac_objext conftest.$ac_ext
8125                           CPPFLAGS=$cf_save_CPPFLAGS
8126                         fi
8127                   fi
8128                 fi
8129
8130                 if test "$cf_have_incdir" = no ; then
8131                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8132
8133 echo "${as_me:-configure}:8133: testing adding $cf_add_incdir to include-path ..." 1>&5
8134
8135                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8136
8137                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8138                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8139                   cf_add_incdir="$cf_top_incdir"
8140                 else
8141                   break
8142                 fi
8143           else
8144                 break
8145           fi
8146         done
8147   done
8148 fi
8149
8150 fi
8151
8152 # Set definitions to allow ifdef'ing for ncurses.h
8153
8154 case $cf_cv_ncurses_header in
8155 (*ncurses.h)
8156
8157 cat >>confdefs.h <<\EOF
8158 #define HAVE_NCURSES_H 1
8159 EOF
8160
8161         ;;
8162 esac
8163
8164 case $cf_cv_ncurses_header in
8165 (ncurses/curses.h|ncurses/ncurses.h)
8166
8167 cat >>confdefs.h <<\EOF
8168 #define HAVE_NCURSES_NCURSES_H 1
8169 EOF
8170
8171         ;;
8172 (ncursesw/curses.h|ncursesw/ncurses.h)
8173
8174 cat >>confdefs.h <<\EOF
8175 #define HAVE_NCURSESW_NCURSES_H 1
8176 EOF
8177
8178         ;;
8179 esac
8180
8181 echo "$as_me:8181: checking for terminfo header" >&5
8182 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8183 if test "${cf_cv_term_header+set}" = set; then
8184   echo $ECHO_N "(cached) $ECHO_C" >&6
8185 else
8186
8187 case ${cf_cv_ncurses_header} in
8188 (*/ncurses.h|*/ncursesw.h)
8189         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8190         ;;
8191 (*)
8192         cf_term_header=term.h
8193         ;;
8194 esac
8195
8196 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8197 do
8198 cat >conftest.$ac_ext <<_ACEOF
8199 #line 8199 "configure"
8200 #include "confdefs.h"
8201 #include <stdio.h>
8202 #include <${cf_cv_ncurses_header:-curses.h}>
8203 #include <$cf_test>
8204
8205 int
8206 main (void)
8207 {
8208 int x = auto_left_margin; (void)x
8209   ;
8210   return 0;
8211 }
8212 _ACEOF
8213 rm -f conftest.$ac_objext
8214 if { (eval echo "$as_me:8214: \"$ac_compile\"") >&5
8215   (eval $ac_compile) 2>&5
8216   ac_status=$?
8217   echo "$as_me:8217: \$? = $ac_status" >&5
8218   (exit $ac_status); } &&
8219          { ac_try='test -s conftest.$ac_objext'
8220   { (eval echo "$as_me:8220: \"$ac_try\"") >&5
8221   (eval $ac_try) 2>&5
8222   ac_status=$?
8223   echo "$as_me:8223: \$? = $ac_status" >&5
8224   (exit $ac_status); }; }; then
8225
8226         cf_cv_term_header="$cf_test"
8227 else
8228   echo "$as_me: failed program was:" >&5
8229 cat conftest.$ac_ext >&5
8230
8231         cf_cv_term_header=unknown
8232
8233 fi
8234 rm -f conftest.$ac_objext conftest.$ac_ext
8235         test "$cf_cv_term_header" != unknown && break
8236 done
8237
8238 fi
8239 echo "$as_me:8239: result: $cf_cv_term_header" >&5
8240 echo "${ECHO_T}$cf_cv_term_header" >&6
8241
8242 # Set definitions to allow ifdef'ing to accommodate subdirectories
8243
8244 case $cf_cv_term_header in
8245 (*term.h)
8246
8247 cat >>confdefs.h <<\EOF
8248 #define HAVE_TERM_H 1
8249 EOF
8250
8251         ;;
8252 esac
8253
8254 case $cf_cv_term_header in
8255 (ncurses/term.h)
8256
8257 cat >>confdefs.h <<\EOF
8258 #define HAVE_NCURSES_TERM_H 1
8259 EOF
8260
8261         ;;
8262 (ncursesw/term.h)
8263
8264 cat >>confdefs.h <<\EOF
8265 #define HAVE_NCURSESW_TERM_H 1
8266 EOF
8267
8268         ;;
8269 esac
8270
8271 # some applications need this, but should check for NCURSES_VERSION
8272
8273 cat >>confdefs.h <<\EOF
8274 #define NCURSES 1
8275 EOF
8276
8277 echo "$as_me:8277: checking for ncurses version" >&5
8278 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8279 if test "${cf_cv_ncurses_version+set}" = set; then
8280   echo $ECHO_N "(cached) $ECHO_C" >&6
8281 else
8282
8283         cf_cv_ncurses_version=no
8284         cf_tempfile=out$$
8285         rm -f $cf_tempfile
8286         if test "$cross_compiling" = yes; then
8287
8288         # This will not work if the preprocessor splits the line after the
8289         # Autoconf token.  The 'unproto' program does that.
8290         cat > conftest.$ac_ext <<EOF
8291 #include <${cf_cv_ncurses_header:-curses.h}>
8292 #undef Autoconf
8293 #ifdef NCURSES_VERSION
8294 Autoconf NCURSES_VERSION
8295 #else
8296 #ifdef __NCURSES_H
8297 Autoconf "old"
8298 #endif
8299 ;
8300 #endif
8301 EOF
8302         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8303         { (eval echo "$as_me:8303: \"$cf_try\"") >&5
8304   (eval $cf_try) 2>&5
8305   ac_status=$?
8306   echo "$as_me:8306: \$? = $ac_status" >&5
8307   (exit $ac_status); }
8308         if test -f conftest.out ; then
8309                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8310                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8311                 rm -f conftest.out
8312         fi
8313
8314 else
8315   cat >conftest.$ac_ext <<_ACEOF
8316 #line 8316 "configure"
8317 #include "confdefs.h"
8318
8319 #include <${cf_cv_ncurses_header:-curses.h}>
8320 #include <stdio.h>
8321 int main(void)
8322 {
8323         FILE *fp = fopen("$cf_tempfile", "w");
8324 #ifdef NCURSES_VERSION
8325 # ifdef NCURSES_VERSION_PATCH
8326         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8327 # else
8328         fprintf(fp, "%s\n", NCURSES_VERSION);
8329 # endif
8330 #else
8331 # ifdef __NCURSES_H
8332         fprintf(fp, "old\n");
8333 # else
8334         make an error
8335 # endif
8336 #endif
8337         ${cf_cv_main_return:-return}(0);
8338 }
8339 _ACEOF
8340 rm -f conftest$ac_exeext
8341 if { (eval echo "$as_me:8341: \"$ac_link\"") >&5
8342   (eval $ac_link) 2>&5
8343   ac_status=$?
8344   echo "$as_me:8344: \$? = $ac_status" >&5
8345   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8346   { (eval echo "$as_me:8346: \"$ac_try\"") >&5
8347   (eval $ac_try) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); }; }; then
8351
8352         cf_cv_ncurses_version=`cat $cf_tempfile`
8353 else
8354   echo "$as_me: program exited with status $ac_status" >&5
8355 echo "$as_me: failed program was:" >&5
8356 cat conftest.$ac_ext >&5
8357 fi
8358 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8359 fi
8360         rm -f $cf_tempfile
8361
8362 fi
8363 echo "$as_me:8363: result: $cf_cv_ncurses_version" >&5
8364 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8365 test "$cf_cv_ncurses_version" = no ||
8366 cat >>confdefs.h <<\EOF
8367 #define NCURSES 1
8368 EOF
8369
8370 cf_nculib_root=ncursesw
8371         # This works, except for the special case where we find gpm, but
8372         # ncurses is in a nonstandard location via $LIBS, and we really want
8373         # to link gpm.
8374 cf_ncurses_LIBS=""
8375 cf_ncurses_SAVE="$LIBS"
8376 echo "$as_me:8376: checking for Gpm_Open in -lgpm" >&5
8377 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8378 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8379   echo $ECHO_N "(cached) $ECHO_C" >&6
8380 else
8381   ac_check_lib_save_LIBS=$LIBS
8382 LIBS="-lgpm  $LIBS"
8383 cat >conftest.$ac_ext <<_ACEOF
8384 #line 8384 "configure"
8385 #include "confdefs.h"
8386
8387 /* Override any gcc2 internal prototype to avoid an error.  */
8388 #ifdef __cplusplus
8389 extern "C"
8390 #endif
8391 /* We use char because int might match the return type of a gcc2
8392    builtin and then its argument prototype would still apply.  */
8393 char Gpm_Open ();
8394 int
8395 main (void)
8396 {
8397 Gpm_Open ();
8398   ;
8399   return 0;
8400 }
8401 _ACEOF
8402 rm -f conftest.$ac_objext conftest$ac_exeext
8403 if { (eval echo "$as_me:8403: \"$ac_link\"") >&5
8404   (eval $ac_link) 2>&5
8405   ac_status=$?
8406   echo "$as_me:8406: \$? = $ac_status" >&5
8407   (exit $ac_status); } &&
8408          { ac_try='test -s conftest$ac_exeext'
8409   { (eval echo "$as_me:8409: \"$ac_try\"") >&5
8410   (eval $ac_try) 2>&5
8411   ac_status=$?
8412   echo "$as_me:8412: \$? = $ac_status" >&5
8413   (exit $ac_status); }; }; then
8414   ac_cv_lib_gpm_Gpm_Open=yes
8415 else
8416   echo "$as_me: failed program was:" >&5
8417 cat conftest.$ac_ext >&5
8418 ac_cv_lib_gpm_Gpm_Open=no
8419 fi
8420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8421 LIBS=$ac_check_lib_save_LIBS
8422 fi
8423 echo "$as_me:8423: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8424 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8425 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8426   echo "$as_me:8426: checking for initscr in -lgpm" >&5
8427 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8428 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8429   echo $ECHO_N "(cached) $ECHO_C" >&6
8430 else
8431   ac_check_lib_save_LIBS=$LIBS
8432 LIBS="-lgpm  $LIBS"
8433 cat >conftest.$ac_ext <<_ACEOF
8434 #line 8434 "configure"
8435 #include "confdefs.h"
8436
8437 /* Override any gcc2 internal prototype to avoid an error.  */
8438 #ifdef __cplusplus
8439 extern "C"
8440 #endif
8441 /* We use char because int might match the return type of a gcc2
8442    builtin and then its argument prototype would still apply.  */
8443 char initscr ();
8444 int
8445 main (void)
8446 {
8447 initscr ();
8448   ;
8449   return 0;
8450 }
8451 _ACEOF
8452 rm -f conftest.$ac_objext conftest$ac_exeext
8453 if { (eval echo "$as_me:8453: \"$ac_link\"") >&5
8454   (eval $ac_link) 2>&5
8455   ac_status=$?
8456   echo "$as_me:8456: \$? = $ac_status" >&5
8457   (exit $ac_status); } &&
8458          { ac_try='test -s conftest$ac_exeext'
8459   { (eval echo "$as_me:8459: \"$ac_try\"") >&5
8460   (eval $ac_try) 2>&5
8461   ac_status=$?
8462   echo "$as_me:8462: \$? = $ac_status" >&5
8463   (exit $ac_status); }; }; then
8464   ac_cv_lib_gpm_initscr=yes
8465 else
8466   echo "$as_me: failed program was:" >&5
8467 cat conftest.$ac_ext >&5
8468 ac_cv_lib_gpm_initscr=no
8469 fi
8470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8471 LIBS=$ac_check_lib_save_LIBS
8472 fi
8473 echo "$as_me:8473: result: $ac_cv_lib_gpm_initscr" >&5
8474 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8475 if test $ac_cv_lib_gpm_initscr = yes; then
8476   LIBS="$cf_ncurses_SAVE"
8477 else
8478   cf_ncurses_LIBS="-lgpm"
8479 fi
8480
8481 fi
8482
8483 case $host_os in
8484 (freebsd*)
8485         # This is only necessary if you are linking against an obsolete
8486         # version of ncurses (but it should do no harm, since it's static).
8487         if test "$cf_nculib_root" = ncurses ; then
8488                 echo "$as_me:8488: checking for tgoto in -lmytinfo" >&5
8489 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8490 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8491   echo $ECHO_N "(cached) $ECHO_C" >&6
8492 else
8493   ac_check_lib_save_LIBS=$LIBS
8494 LIBS="-lmytinfo  $LIBS"
8495 cat >conftest.$ac_ext <<_ACEOF
8496 #line 8496 "configure"
8497 #include "confdefs.h"
8498
8499 /* Override any gcc2 internal prototype to avoid an error.  */
8500 #ifdef __cplusplus
8501 extern "C"
8502 #endif
8503 /* We use char because int might match the return type of a gcc2
8504    builtin and then its argument prototype would still apply.  */
8505 char tgoto ();
8506 int
8507 main (void)
8508 {
8509 tgoto ();
8510   ;
8511   return 0;
8512 }
8513 _ACEOF
8514 rm -f conftest.$ac_objext conftest$ac_exeext
8515 if { (eval echo "$as_me:8515: \"$ac_link\"") >&5
8516   (eval $ac_link) 2>&5
8517   ac_status=$?
8518   echo "$as_me:8518: \$? = $ac_status" >&5
8519   (exit $ac_status); } &&
8520          { ac_try='test -s conftest$ac_exeext'
8521   { (eval echo "$as_me:8521: \"$ac_try\"") >&5
8522   (eval $ac_try) 2>&5
8523   ac_status=$?
8524   echo "$as_me:8524: \$? = $ac_status" >&5
8525   (exit $ac_status); }; }; then
8526   ac_cv_lib_mytinfo_tgoto=yes
8527 else
8528   echo "$as_me: failed program was:" >&5
8529 cat conftest.$ac_ext >&5
8530 ac_cv_lib_mytinfo_tgoto=no
8531 fi
8532 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8533 LIBS=$ac_check_lib_save_LIBS
8534 fi
8535 echo "$as_me:8535: result: $ac_cv_lib_mytinfo_tgoto" >&5
8536 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8537 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8538   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8539 fi
8540
8541         fi
8542         ;;
8543 esac
8544
8545 cf_add_libs="$LIBS"
8546 # reverse order
8547 cf_add_0lib=
8548 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8549 # filter duplicates
8550 for cf_add_1lib in $cf_add_0lib; do
8551         for cf_add_2lib in $cf_add_libs; do
8552                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8553                         cf_add_1lib=
8554                         break
8555                 fi
8556         done
8557         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8558 done
8559 LIBS="$cf_add_libs"
8560
8561 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8562 then
8563
8564 cf_add_libs="$LIBS"
8565 # reverse order
8566 cf_add_0lib=
8567 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8568 # filter duplicates
8569 for cf_add_1lib in $cf_add_0lib; do
8570         for cf_add_2lib in $cf_add_libs; do
8571                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8572                         cf_add_1lib=
8573                         break
8574                 fi
8575         done
8576         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8577 done
8578 LIBS="$cf_add_libs"
8579
8580 else
8581
8582         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8583         cf_libdir=""
8584         echo "$as_me:8584: checking for initscr" >&5
8585 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8586 if test "${ac_cv_func_initscr+set}" = set; then
8587   echo $ECHO_N "(cached) $ECHO_C" >&6
8588 else
8589   cat >conftest.$ac_ext <<_ACEOF
8590 #line 8590 "configure"
8591 #include "confdefs.h"
8592 #define initscr autoconf_temporary
8593 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8594 #undef initscr
8595
8596 #ifdef __cplusplus
8597 extern "C"
8598 #endif
8599
8600 /* We use char because int might match the return type of a gcc2
8601    builtin and then its argument prototype would still apply.  */
8602 char initscr (void);
8603
8604 int
8605 main (void)
8606 {
8607
8608 /* The GNU C library defines stubs for functions which it implements
8609     to always fail with ENOSYS.  Some functions are actually named
8610     something starting with __ and the normal name is an alias.  */
8611 #if defined (__stub_initscr) || defined (__stub___initscr)
8612 #error found stub for initscr
8613 #endif
8614
8615         return initscr ();
8616   ;
8617   return 0;
8618 }
8619 _ACEOF
8620 rm -f conftest.$ac_objext conftest$ac_exeext
8621 if { (eval echo "$as_me:8621: \"$ac_link\"") >&5
8622   (eval $ac_link) 2>&5
8623   ac_status=$?
8624   echo "$as_me:8624: \$? = $ac_status" >&5
8625   (exit $ac_status); } &&
8626          { ac_try='test -s conftest$ac_exeext'
8627   { (eval echo "$as_me:8627: \"$ac_try\"") >&5
8628   (eval $ac_try) 2>&5
8629   ac_status=$?
8630   echo "$as_me:8630: \$? = $ac_status" >&5
8631   (exit $ac_status); }; }; then
8632   ac_cv_func_initscr=yes
8633 else
8634   echo "$as_me: failed program was:" >&5
8635 cat conftest.$ac_ext >&5
8636 ac_cv_func_initscr=no
8637 fi
8638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8639 fi
8640 echo "$as_me:8640: result: $ac_cv_func_initscr" >&5
8641 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8642 if test $ac_cv_func_initscr = yes; then
8643   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8644 else
8645
8646                 cf_save_LIBS="$LIBS"
8647                 echo "$as_me:8647: checking for initscr in -l$cf_nculib_root" >&5
8648 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8649                 LIBS="-l$cf_nculib_root $LIBS"
8650                 cat >conftest.$ac_ext <<_ACEOF
8651 #line 8651 "configure"
8652 #include "confdefs.h"
8653 #include <${cf_cv_ncurses_header:-curses.h}>
8654 int
8655 main (void)
8656 {
8657 initscr()
8658   ;
8659   return 0;
8660 }
8661 _ACEOF
8662 rm -f conftest.$ac_objext conftest$ac_exeext
8663 if { (eval echo "$as_me:8663: \"$ac_link\"") >&5
8664   (eval $ac_link) 2>&5
8665   ac_status=$?
8666   echo "$as_me:8666: \$? = $ac_status" >&5
8667   (exit $ac_status); } &&
8668          { ac_try='test -s conftest$ac_exeext'
8669   { (eval echo "$as_me:8669: \"$ac_try\"") >&5
8670   (eval $ac_try) 2>&5
8671   ac_status=$?
8672   echo "$as_me:8672: \$? = $ac_status" >&5
8673   (exit $ac_status); }; }; then
8674   echo "$as_me:8674: result: yes" >&5
8675 echo "${ECHO_T}yes" >&6
8676                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8677
8678 else
8679   echo "$as_me: failed program was:" >&5
8680 cat conftest.$ac_ext >&5
8681 echo "$as_me:8681: result: no" >&5
8682 echo "${ECHO_T}no" >&6
8683
8684 cf_search=
8685 cf_library_path_list=""
8686 if test -n "${LDFLAGS}${LIBS}" ; then
8687         for cf_library_path in $LDFLAGS $LIBS
8688         do
8689                 case $cf_library_path in
8690                 (-L*)
8691                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8692
8693 test "x$cf_library_path" != "xNONE" && \
8694 test -d "$cf_library_path" && \
8695  {
8696         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8697         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8698         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8699         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8700         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8701         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"
8702 }
8703
8704                         cf_library_path_list="$cf_library_path_list $cf_search"
8705                         ;;
8706                 esac
8707         done
8708 fi
8709
8710 cf_search=
8711
8712 test "x$prefix" != "xNONE" && \
8713 test -d "$prefix" && \
8714  {
8715         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8716         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8717         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8718         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8719         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8720         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8721 }
8722
8723 for cf_subdir_prefix in \
8724         /usr \
8725         /usr/local \
8726         /usr/pkg \
8727         /opt \
8728         /opt/local \
8729         $HOME
8730 do
8731
8732 test "x$cf_subdir_prefix" != "x$prefix" && \
8733 test -d "$cf_subdir_prefix" && \
8734 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8735         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8736         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8737         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8738         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8739         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8740         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"
8741 }
8742
8743 done
8744
8745 cf_search="$cf_library_path_list $cf_search"
8746
8747                         for cf_libdir in $cf_search
8748                         do
8749                                 echo "$as_me:8749: checking for -l$cf_nculib_root in $cf_libdir" >&5
8750 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8751                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8752                                 cat >conftest.$ac_ext <<_ACEOF
8753 #line 8753 "configure"
8754 #include "confdefs.h"
8755 #include <${cf_cv_ncurses_header:-curses.h}>
8756 int
8757 main (void)
8758 {
8759 initscr()
8760   ;
8761   return 0;
8762 }
8763 _ACEOF
8764 rm -f conftest.$ac_objext conftest$ac_exeext
8765 if { (eval echo "$as_me:8765: \"$ac_link\"") >&5
8766   (eval $ac_link) 2>&5
8767   ac_status=$?
8768   echo "$as_me:8768: \$? = $ac_status" >&5
8769   (exit $ac_status); } &&
8770          { ac_try='test -s conftest$ac_exeext'
8771   { (eval echo "$as_me:8771: \"$ac_try\"") >&5
8772   (eval $ac_try) 2>&5
8773   ac_status=$?
8774   echo "$as_me:8774: \$? = $ac_status" >&5
8775   (exit $ac_status); }; }; then
8776   echo "$as_me:8776: result: yes" >&5
8777 echo "${ECHO_T}yes" >&6
8778                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8779                                          break
8780 else
8781   echo "$as_me: failed program was:" >&5
8782 cat conftest.$ac_ext >&5
8783 echo "$as_me:8783: result: no" >&5
8784 echo "${ECHO_T}no" >&6
8785                                          LIBS="$cf_save_LIBS"
8786 fi
8787 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8788                         done
8789
8790 fi
8791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8792
8793 fi
8794
8795 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8796
8797 if test $cf_found_library = no ; then
8798         { { echo "$as_me:8798: error: Cannot link $cf_nculib_root library" >&5
8799 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8800    { (exit 1); exit 1; }; }
8801 fi
8802
8803 fi
8804
8805 if test -n "$cf_ncurses_LIBS" ; then
8806         echo "$as_me:8806: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8807 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8808         cf_ncurses_SAVE="$LIBS"
8809         for p in $cf_ncurses_LIBS ; do
8810                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8811                 if test "$q" != "$LIBS" ; then
8812                         LIBS="$q"
8813                 fi
8814         done
8815         cat >conftest.$ac_ext <<_ACEOF
8816 #line 8816 "configure"
8817 #include "confdefs.h"
8818 #include <${cf_cv_ncurses_header:-curses.h}>
8819 int
8820 main (void)
8821 {
8822 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8823   ;
8824   return 0;
8825 }
8826 _ACEOF
8827 rm -f conftest.$ac_objext conftest$ac_exeext
8828 if { (eval echo "$as_me:8828: \"$ac_link\"") >&5
8829   (eval $ac_link) 2>&5
8830   ac_status=$?
8831   echo "$as_me:8831: \$? = $ac_status" >&5
8832   (exit $ac_status); } &&
8833          { ac_try='test -s conftest$ac_exeext'
8834   { (eval echo "$as_me:8834: \"$ac_try\"") >&5
8835   (eval $ac_try) 2>&5
8836   ac_status=$?
8837   echo "$as_me:8837: \$? = $ac_status" >&5
8838   (exit $ac_status); }; }; then
8839   echo "$as_me:8839: result: yes" >&5
8840 echo "${ECHO_T}yes" >&6
8841 else
8842   echo "$as_me: failed program was:" >&5
8843 cat conftest.$ac_ext >&5
8844 echo "$as_me:8844: result: no" >&5
8845 echo "${ECHO_T}no" >&6
8846                  LIBS="$cf_ncurses_SAVE"
8847 fi
8848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8849 fi
8850
8851 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8852
8853 cat >>confdefs.h <<EOF
8854 #define $cf_nculib_ROOT 1
8855 EOF
8856
8857         fi
8858 else
8859         NCURSES_CONFIG=none
8860 fi
8861
8862 else
8863
8864 cf_ncuconfig_root=ncurses
8865 cf_have_ncuconfig=no
8866
8867 if test "x${PKG_CONFIG:=none}" != xnone; then
8868         echo "$as_me:8868: checking pkg-config for $cf_ncuconfig_root" >&5
8869 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8870         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8871                 echo "$as_me:8871: result: yes" >&5
8872 echo "${ECHO_T}yes" >&6
8873
8874                 echo "$as_me:8874: checking if the $cf_ncuconfig_root package files work" >&5
8875 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8876                 cf_have_ncuconfig=unknown
8877
8878                 cf_save_CFLAGS="$CFLAGS"
8879                 cf_save_CPPFLAGS="$CPPFLAGS"
8880                 cf_save_LIBS="$LIBS"
8881
8882                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
8883                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
8884
8885                 # while -W for passing linker flags is prevalent, it is not "standard".
8886                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
8887                 # incompatible _and_ non-standard -W option which gives an error.  Work
8888                 # around that pitfall.
8889                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
8890                 (x*c[89]9@@*-W*)
8891
8892 cf_fix_cppflags=no
8893 cf_new_cflags=
8894 cf_new_cppflags=
8895 cf_new_extra_cppflags=
8896
8897 for cf_add_cflags in $cf_pkg_cflags
8898 do
8899 case $cf_fix_cppflags in
8900 (no)
8901         case $cf_add_cflags in
8902         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8903                 case $cf_add_cflags in
8904                 (-D*)
8905                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8906
8907                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8908                                 && test -z "${cf_tst_cflags}" \
8909                                 && cf_fix_cppflags=yes
8910
8911                         if test $cf_fix_cppflags = yes ; then
8912
8913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8915
8916                                 continue
8917                         elif test "${cf_tst_cflags}" = "\"'" ; then
8918
8919         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8920         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8921
8922                                 continue
8923                         fi
8924                         ;;
8925                 esac
8926                 case "$CPPFLAGS" in
8927                 (*$cf_add_cflags)
8928                         ;;
8929                 (*)
8930                         case $cf_add_cflags in
8931                         (-D*)
8932                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8933
8934 CPPFLAGS=`echo "$CPPFLAGS" | \
8935         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8936                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8937
8938                                 ;;
8939                         esac
8940
8941         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8942         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8943
8944                         ;;
8945                 esac
8946                 ;;
8947         (*)
8948
8949         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8950         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8951
8952                 ;;
8953         esac
8954         ;;
8955 (yes)
8956
8957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8959
8960         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8961
8962         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8963                 && test -z "${cf_tst_cflags}" \
8964                 && cf_fix_cppflags=no
8965         ;;
8966 esac
8967 done
8968
8969 if test -n "$cf_new_cflags" ; then
8970
8971         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8972         CFLAGS="${CFLAGS}$cf_new_cflags"
8973
8974 fi
8975
8976 if test -n "$cf_new_cppflags" ; then
8977
8978         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8979         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8980
8981 fi
8982
8983 if test -n "$cf_new_extra_cppflags" ; then
8984
8985         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8986         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8987
8988 fi
8989
8990 cf_add_libs="$LIBS"
8991 # reverse order
8992 cf_add_0lib=
8993 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8994 # filter duplicates
8995 for cf_add_1lib in $cf_add_0lib; do
8996         for cf_add_2lib in $cf_add_libs; do
8997                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8998                         cf_add_1lib=
8999                         break
9000                 fi
9001         done
9002         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9003 done
9004 LIBS="$cf_add_libs"
9005
9006                         cat >conftest.$ac_ext <<_ACEOF
9007 #line 9007 "configure"
9008 #include "confdefs.h"
9009 #include <${cf_cv_ncurses_header:-curses.h}>
9010 int
9011 main (void)
9012 {
9013 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9014   ;
9015   return 0;
9016 }
9017 _ACEOF
9018 rm -f conftest.$ac_objext conftest$ac_exeext
9019 if { (eval echo "$as_me:9019: \"$ac_link\"") >&5
9020   (eval $ac_link) 2>&5
9021   ac_status=$?
9022   echo "$as_me:9022: \$? = $ac_status" >&5
9023   (exit $ac_status); } &&
9024          { ac_try='test -s conftest$ac_exeext'
9025   { (eval echo "$as_me:9025: \"$ac_try\"") >&5
9026   (eval $ac_try) 2>&5
9027   ac_status=$?
9028   echo "$as_me:9028: \$? = $ac_status" >&5
9029   (exit $ac_status); }; }; then
9030   if test "$cross_compiling" = yes; then
9031   cf_test_ncuconfig=maybe
9032 else
9033   cat >conftest.$ac_ext <<_ACEOF
9034 #line 9034 "configure"
9035 #include "confdefs.h"
9036 #include <${cf_cv_ncurses_header:-curses.h}>
9037                                         int main(void)
9038                                         { char *xx = curses_version(); return (xx == 0); }
9039 _ACEOF
9040 rm -f conftest$ac_exeext
9041 if { (eval echo "$as_me:9041: \"$ac_link\"") >&5
9042   (eval $ac_link) 2>&5
9043   ac_status=$?
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9046   { (eval echo "$as_me:9046: \"$ac_try\"") >&5
9047   (eval $ac_try) 2>&5
9048   ac_status=$?
9049   echo "$as_me:9049: \$? = $ac_status" >&5
9050   (exit $ac_status); }; }; then
9051   cf_test_ncuconfig=yes
9052 else
9053   echo "$as_me: program exited with status $ac_status" >&5
9054 echo "$as_me: failed program was:" >&5
9055 cat conftest.$ac_ext >&5
9056 cf_test_ncuconfig=no
9057 fi
9058 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9059 fi
9060 else
9061   echo "$as_me: failed program was:" >&5
9062 cat conftest.$ac_ext >&5
9063 cf_test_ncuconfig=no
9064 fi
9065 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9066
9067                         CFLAGS="$cf_save_CFLAGS"
9068                         CPPFLAGS="$cf_save_CPPFLAGS"
9069                         LIBS="$cf_save_LIBS"
9070
9071                         if test "x$cf_test_ncuconfig" != xyes; then
9072                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9073                                 cf_pkg_cflags="$cf_temp"
9074                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9075                                 cf_pkg_libs="$cf_temp"
9076                         fi
9077                         ;;
9078                 esac
9079
9080 cf_fix_cppflags=no
9081 cf_new_cflags=
9082 cf_new_cppflags=
9083 cf_new_extra_cppflags=
9084
9085 for cf_add_cflags in $cf_pkg_cflags
9086 do
9087 case $cf_fix_cppflags in
9088 (no)
9089         case $cf_add_cflags in
9090         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9091                 case $cf_add_cflags in
9092                 (-D*)
9093                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9094
9095                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9096                                 && test -z "${cf_tst_cflags}" \
9097                                 && cf_fix_cppflags=yes
9098
9099                         if test $cf_fix_cppflags = yes ; then
9100
9101         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9102         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9103
9104                                 continue
9105                         elif test "${cf_tst_cflags}" = "\"'" ; then
9106
9107         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9108         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9109
9110                                 continue
9111                         fi
9112                         ;;
9113                 esac
9114                 case "$CPPFLAGS" in
9115                 (*$cf_add_cflags)
9116                         ;;
9117                 (*)
9118                         case $cf_add_cflags in
9119                         (-D*)
9120                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9121
9122 CPPFLAGS=`echo "$CPPFLAGS" | \
9123         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9124                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9125
9126                                 ;;
9127                         esac
9128
9129         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9130         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9131
9132                         ;;
9133                 esac
9134                 ;;
9135         (*)
9136
9137         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9138         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9139
9140                 ;;
9141         esac
9142         ;;
9143 (yes)
9144
9145         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9146         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9147
9148         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9149
9150         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9151                 && test -z "${cf_tst_cflags}" \
9152                 && cf_fix_cppflags=no
9153         ;;
9154 esac
9155 done
9156
9157 if test -n "$cf_new_cflags" ; then
9158
9159         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9160         CFLAGS="${CFLAGS}$cf_new_cflags"
9161
9162 fi
9163
9164 if test -n "$cf_new_cppflags" ; then
9165
9166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9167         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9168
9169 fi
9170
9171 if test -n "$cf_new_extra_cppflags" ; then
9172
9173         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9174         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9175
9176 fi
9177
9178 cf_add_libs="$LIBS"
9179 # reverse order
9180 cf_add_0lib=
9181 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9182 # filter duplicates
9183 for cf_add_1lib in $cf_add_0lib; do
9184         for cf_add_2lib in $cf_add_libs; do
9185                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9186                         cf_add_1lib=
9187                         break
9188                 fi
9189         done
9190         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9191 done
9192 LIBS="$cf_add_libs"
9193
9194                 cat >conftest.$ac_ext <<_ACEOF
9195 #line 9195 "configure"
9196 #include "confdefs.h"
9197 #include <${cf_cv_ncurses_header:-curses.h}>
9198 int
9199 main (void)
9200 {
9201 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9202   ;
9203   return 0;
9204 }
9205 _ACEOF
9206 rm -f conftest.$ac_objext conftest$ac_exeext
9207 if { (eval echo "$as_me:9207: \"$ac_link\"") >&5
9208   (eval $ac_link) 2>&5
9209   ac_status=$?
9210   echo "$as_me:9210: \$? = $ac_status" >&5
9211   (exit $ac_status); } &&
9212          { ac_try='test -s conftest$ac_exeext'
9213   { (eval echo "$as_me:9213: \"$ac_try\"") >&5
9214   (eval $ac_try) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit $ac_status); }; }; then
9218   if test "$cross_compiling" = yes; then
9219   cf_have_ncuconfig=maybe
9220 else
9221   cat >conftest.$ac_ext <<_ACEOF
9222 #line 9222 "configure"
9223 #include "confdefs.h"
9224 #include <${cf_cv_ncurses_header:-curses.h}>
9225                                 int main(void)
9226                                 { char *xx = curses_version(); return (xx == 0); }
9227 _ACEOF
9228 rm -f conftest$ac_exeext
9229 if { (eval echo "$as_me:9229: \"$ac_link\"") >&5
9230   (eval $ac_link) 2>&5
9231   ac_status=$?
9232   echo "$as_me:9232: \$? = $ac_status" >&5
9233   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9234   { (eval echo "$as_me:9234: \"$ac_try\"") >&5
9235   (eval $ac_try) 2>&5
9236   ac_status=$?
9237   echo "$as_me:9237: \$? = $ac_status" >&5
9238   (exit $ac_status); }; }; then
9239   cf_have_ncuconfig=yes
9240 else
9241   echo "$as_me: program exited with status $ac_status" >&5
9242 echo "$as_me: failed program was:" >&5
9243 cat conftest.$ac_ext >&5
9244 cf_have_ncuconfig=no
9245 fi
9246 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9247 fi
9248 else
9249   echo "$as_me: failed program was:" >&5
9250 cat conftest.$ac_ext >&5
9251 cf_have_ncuconfig=no
9252 fi
9253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9254                 echo "$as_me:9254: result: $cf_have_ncuconfig" >&5
9255 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9256                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9257                 if test "$cf_have_ncuconfig" != "yes"
9258                 then
9259                         CPPFLAGS="$cf_save_CPPFLAGS"
9260                         LIBS="$cf_save_LIBS"
9261                         NCURSES_CONFIG_PKG=none
9262                 else
9263
9264 cat >>confdefs.h <<\EOF
9265 #define NCURSES 1
9266 EOF
9267
9268                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9269
9270 echo "$as_me:9270: checking for terminfo header" >&5
9271 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9272 if test "${cf_cv_term_header+set}" = set; then
9273   echo $ECHO_N "(cached) $ECHO_C" >&6
9274 else
9275
9276 case ${cf_cv_ncurses_header} in
9277 (*/ncurses.h|*/ncursesw.h)
9278         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9279         ;;
9280 (*)
9281         cf_term_header=term.h
9282         ;;
9283 esac
9284
9285 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9286 do
9287 cat >conftest.$ac_ext <<_ACEOF
9288 #line 9288 "configure"
9289 #include "confdefs.h"
9290 #include <stdio.h>
9291 #include <${cf_cv_ncurses_header:-curses.h}>
9292 #include <$cf_test>
9293
9294 int
9295 main (void)
9296 {
9297 int x = auto_left_margin; (void)x
9298   ;
9299   return 0;
9300 }
9301 _ACEOF
9302 rm -f conftest.$ac_objext
9303 if { (eval echo "$as_me:9303: \"$ac_compile\"") >&5
9304   (eval $ac_compile) 2>&5
9305   ac_status=$?
9306   echo "$as_me:9306: \$? = $ac_status" >&5
9307   (exit $ac_status); } &&
9308          { ac_try='test -s conftest.$ac_objext'
9309   { (eval echo "$as_me:9309: \"$ac_try\"") >&5
9310   (eval $ac_try) 2>&5
9311   ac_status=$?
9312   echo "$as_me:9312: \$? = $ac_status" >&5
9313   (exit $ac_status); }; }; then
9314
9315         cf_cv_term_header="$cf_test"
9316 else
9317   echo "$as_me: failed program was:" >&5
9318 cat conftest.$ac_ext >&5
9319
9320         cf_cv_term_header=unknown
9321
9322 fi
9323 rm -f conftest.$ac_objext conftest.$ac_ext
9324         test "$cf_cv_term_header" != unknown && break
9325 done
9326
9327 fi
9328 echo "$as_me:9328: result: $cf_cv_term_header" >&5
9329 echo "${ECHO_T}$cf_cv_term_header" >&6
9330
9331 # Set definitions to allow ifdef'ing to accommodate subdirectories
9332
9333 case $cf_cv_term_header in
9334 (*term.h)
9335
9336 cat >>confdefs.h <<\EOF
9337 #define HAVE_TERM_H 1
9338 EOF
9339
9340         ;;
9341 esac
9342
9343 case $cf_cv_term_header in
9344 (ncurses/term.h)
9345
9346 cat >>confdefs.h <<\EOF
9347 #define HAVE_NCURSES_TERM_H 1
9348 EOF
9349
9350         ;;
9351 (ncursesw/term.h)
9352
9353 cat >>confdefs.h <<\EOF
9354 #define HAVE_NCURSESW_TERM_H 1
9355 EOF
9356
9357         ;;
9358 esac
9359
9360                 fi
9361
9362         else
9363                 echo "$as_me:9363: result: no" >&5
9364 echo "${ECHO_T}no" >&6
9365                 NCURSES_CONFIG_PKG=none
9366         fi
9367 else
9368         NCURSES_CONFIG_PKG=none
9369 fi
9370
9371 if test "x$cf_have_ncuconfig" = "xno"; then
9372         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9373
9374 if test -n "$ac_tool_prefix"; then
9375   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9376   do
9377     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9378 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9379 echo "$as_me:9379: checking for $ac_word" >&5
9380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9381 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9382   echo $ECHO_N "(cached) $ECHO_C" >&6
9383 else
9384   if test -n "$NCURSES_CONFIG"; then
9385   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9386 else
9387   ac_save_IFS=$IFS; IFS=$ac_path_separator
9388 ac_dummy="$PATH"
9389 for ac_dir in $ac_dummy; do
9390   IFS=$ac_save_IFS
9391   test -z "$ac_dir" && ac_dir=.
9392   $as_executable_p "$ac_dir/$ac_word" || continue
9393 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9394 echo "$as_me:9394: found $ac_dir/$ac_word" >&5
9395 break
9396 done
9397
9398 fi
9399 fi
9400 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9401 if test -n "$NCURSES_CONFIG"; then
9402   echo "$as_me:9402: result: $NCURSES_CONFIG" >&5
9403 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9404 else
9405   echo "$as_me:9405: result: no" >&5
9406 echo "${ECHO_T}no" >&6
9407 fi
9408
9409     test -n "$NCURSES_CONFIG" && break
9410   done
9411 fi
9412 if test -z "$NCURSES_CONFIG"; then
9413   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9414   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9415 do
9416   # Extract the first word of "$ac_prog", so it can be a program name with args.
9417 set dummy $ac_prog; ac_word=$2
9418 echo "$as_me:9418: checking for $ac_word" >&5
9419 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9420 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9421   echo $ECHO_N "(cached) $ECHO_C" >&6
9422 else
9423   if test -n "$ac_ct_NCURSES_CONFIG"; then
9424   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9425 else
9426   ac_save_IFS=$IFS; IFS=$ac_path_separator
9427 ac_dummy="$PATH"
9428 for ac_dir in $ac_dummy; do
9429   IFS=$ac_save_IFS
9430   test -z "$ac_dir" && ac_dir=.
9431   $as_executable_p "$ac_dir/$ac_word" || continue
9432 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9433 echo "$as_me:9433: found $ac_dir/$ac_word" >&5
9434 break
9435 done
9436
9437 fi
9438 fi
9439 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9440 if test -n "$ac_ct_NCURSES_CONFIG"; then
9441   echo "$as_me:9441: result: $ac_ct_NCURSES_CONFIG" >&5
9442 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9443 else
9444   echo "$as_me:9444: result: no" >&5
9445 echo "${ECHO_T}no" >&6
9446 fi
9447
9448   test -n "$ac_ct_NCURSES_CONFIG" && break
9449 done
9450 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9451
9452   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9453 fi
9454
9455         if test "$NCURSES_CONFIG" != none ; then
9456
9457 cf_fix_cppflags=no
9458 cf_new_cflags=
9459 cf_new_cppflags=
9460 cf_new_extra_cppflags=
9461
9462 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9463 do
9464 case $cf_fix_cppflags in
9465 (no)
9466         case $cf_add_cflags in
9467         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9468                 case $cf_add_cflags in
9469                 (-D*)
9470                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9471
9472                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9473                                 && test -z "${cf_tst_cflags}" \
9474                                 && cf_fix_cppflags=yes
9475
9476                         if test $cf_fix_cppflags = yes ; then
9477
9478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9480
9481                                 continue
9482                         elif test "${cf_tst_cflags}" = "\"'" ; then
9483
9484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9486
9487                                 continue
9488                         fi
9489                         ;;
9490                 esac
9491                 case "$CPPFLAGS" in
9492                 (*$cf_add_cflags)
9493                         ;;
9494                 (*)
9495                         case $cf_add_cflags in
9496                         (-D*)
9497                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9498
9499 CPPFLAGS=`echo "$CPPFLAGS" | \
9500         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9501                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9502
9503                                 ;;
9504                         esac
9505
9506         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9507         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9508
9509                         ;;
9510                 esac
9511                 ;;
9512         (*)
9513
9514         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9515         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9516
9517                 ;;
9518         esac
9519         ;;
9520 (yes)
9521
9522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9524
9525         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9526
9527         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9528                 && test -z "${cf_tst_cflags}" \
9529                 && cf_fix_cppflags=no
9530         ;;
9531 esac
9532 done
9533
9534 if test -n "$cf_new_cflags" ; then
9535
9536         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9537         CFLAGS="${CFLAGS}$cf_new_cflags"
9538
9539 fi
9540
9541 if test -n "$cf_new_cppflags" ; then
9542
9543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9544         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9545
9546 fi
9547
9548 if test -n "$cf_new_extra_cppflags" ; then
9549
9550         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9551         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9552
9553 fi
9554
9555 cf_add_libs="$LIBS"
9556 # reverse order
9557 cf_add_0lib=
9558 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9559 # filter duplicates
9560 for cf_add_1lib in $cf_add_0lib; do
9561         for cf_add_2lib in $cf_add_libs; do
9562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9563                         cf_add_1lib=
9564                         break
9565                 fi
9566         done
9567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9568 done
9569 LIBS="$cf_add_libs"
9570
9571                 # even with config script, some packages use no-override for curses.h
9572
9573 echo "$as_me:9573: checking if we have identified curses headers" >&5
9574 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9575 if test "${cf_cv_ncurses_header+set}" = set; then
9576   echo $ECHO_N "(cached) $ECHO_C" >&6
9577 else
9578
9579 cf_cv_ncurses_header=none
9580 for cf_header in \
9581         ncurses.h ncurses/ncurses.h \
9582         curses.h ncurses/curses.h
9583 do
9584 cat >conftest.$ac_ext <<_ACEOF
9585 #line 9585 "configure"
9586 #include "confdefs.h"
9587 #include <${cf_header}>
9588 int
9589 main (void)
9590 {
9591 initscr(); tgoto("?", 0,0)
9592   ;
9593   return 0;
9594 }
9595 _ACEOF
9596 rm -f conftest.$ac_objext
9597 if { (eval echo "$as_me:9597: \"$ac_compile\"") >&5
9598   (eval $ac_compile) 2>&5
9599   ac_status=$?
9600   echo "$as_me:9600: \$? = $ac_status" >&5
9601   (exit $ac_status); } &&
9602          { ac_try='test -s conftest.$ac_objext'
9603   { (eval echo "$as_me:9603: \"$ac_try\"") >&5
9604   (eval $ac_try) 2>&5
9605   ac_status=$?
9606   echo "$as_me:9606: \$? = $ac_status" >&5
9607   (exit $ac_status); }; }; then
9608   cf_cv_ncurses_header=$cf_header; break
9609 else
9610   echo "$as_me: failed program was:" >&5
9611 cat conftest.$ac_ext >&5
9612 fi
9613 rm -f conftest.$ac_objext conftest.$ac_ext
9614 done
9615
9616 fi
9617 echo "$as_me:9617: result: $cf_cv_ncurses_header" >&5
9618 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9619
9620 if test "$cf_cv_ncurses_header" = none ; then
9621         { { echo "$as_me:9621: error: No curses header-files found" >&5
9622 echo "$as_me: error: No curses header-files found" >&2;}
9623    { (exit 1); exit 1; }; }
9624 fi
9625
9626 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9627
9628 for ac_header in $cf_cv_ncurses_header
9629 do
9630 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9631 echo "$as_me:9631: checking for $ac_header" >&5
9632 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9633 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9634   echo $ECHO_N "(cached) $ECHO_C" >&6
9635 else
9636   cat >conftest.$ac_ext <<_ACEOF
9637 #line 9637 "configure"
9638 #include "confdefs.h"
9639 #include <$ac_header>
9640 _ACEOF
9641 if { (eval echo "$as_me:9641: \"$ac_cpp conftest.$ac_ext\"") >&5
9642   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9643   ac_status=$?
9644   egrep -v '^ *\+' conftest.er1 >conftest.err
9645   rm -f conftest.er1
9646   cat conftest.err >&5
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit $ac_status); } >/dev/null; then
9649   if test -s conftest.err; then
9650     ac_cpp_err=$ac_c_preproc_warn_flag
9651   else
9652     ac_cpp_err=
9653   fi
9654 else
9655   ac_cpp_err=yes
9656 fi
9657 if test -z "$ac_cpp_err"; then
9658   eval "$as_ac_Header=yes"
9659 else
9660   echo "$as_me: failed program was:" >&5
9661   cat conftest.$ac_ext >&5
9662   eval "$as_ac_Header=no"
9663 fi
9664 rm -f conftest.err conftest.$ac_ext
9665 fi
9666 echo "$as_me:9666: result: `eval echo '${'$as_ac_Header'}'`" >&5
9667 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9668 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9669   cat >>confdefs.h <<EOF
9670 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9671 EOF
9672
9673 fi
9674 done
9675
9676 cat >>confdefs.h <<\EOF
9677 #define NCURSES 1
9678 EOF
9679
9680 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9681
9682                 cat >>confdefs.h <<EOF
9683 #define $cf_nculib_ROOT 1
9684 EOF
9685
9686                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9687
9688         else
9689
9690 cf_ncuhdr_root=ncurses
9691
9692 test -n "$cf_cv_curses_dir" && \
9693 test "$cf_cv_curses_dir" != "no" && { \
9694
9695 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9696   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9697   do
9698         while test $cf_add_incdir != /usr/include
9699         do
9700           if test -d $cf_add_incdir
9701           then
9702                 cf_have_incdir=no
9703                 if test -n "$CFLAGS$CPPFLAGS" ; then
9704                   # a loop is needed to ensure we can add subdirs of existing dirs
9705                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9706                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9707                           cf_have_incdir=yes; break
9708                         fi
9709                   done
9710                 fi
9711
9712                 if test "$cf_have_incdir" = no ; then
9713                   if test "$cf_add_incdir" = /usr/local/include ; then
9714                         if test "$GCC" = yes
9715                         then
9716                           cf_save_CPPFLAGS=$CPPFLAGS
9717
9718         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9719         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9720
9721                           cat >conftest.$ac_ext <<_ACEOF
9722 #line 9722 "configure"
9723 #include "confdefs.h"
9724 #include <stdio.h>
9725 int
9726 main (void)
9727 {
9728 printf("Hello")
9729   ;
9730   return 0;
9731 }
9732 _ACEOF
9733 rm -f conftest.$ac_objext
9734 if { (eval echo "$as_me:9734: \"$ac_compile\"") >&5
9735   (eval $ac_compile) 2>&5
9736   ac_status=$?
9737   echo "$as_me:9737: \$? = $ac_status" >&5
9738   (exit $ac_status); } &&
9739          { ac_try='test -s conftest.$ac_objext'
9740   { (eval echo "$as_me:9740: \"$ac_try\"") >&5
9741   (eval $ac_try) 2>&5
9742   ac_status=$?
9743   echo "$as_me:9743: \$? = $ac_status" >&5
9744   (exit $ac_status); }; }; then
9745   :
9746 else
9747   echo "$as_me: failed program was:" >&5
9748 cat conftest.$ac_ext >&5
9749 cf_have_incdir=yes
9750 fi
9751 rm -f conftest.$ac_objext conftest.$ac_ext
9752                           CPPFLAGS=$cf_save_CPPFLAGS
9753                         fi
9754                   fi
9755                 fi
9756
9757                 if test "$cf_have_incdir" = no ; then
9758                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9759
9760 echo "${as_me:-configure}:9760: testing adding $cf_add_incdir to include-path ..." 1>&5
9761
9762                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9763
9764                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9765                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9766                   cf_add_incdir="$cf_top_incdir"
9767                 else
9768                   break
9769                 fi
9770           else
9771                 break
9772           fi
9773         done
9774   done
9775 fi
9776
9777 }
9778
9779 echo "$as_me:9779: checking for $cf_ncuhdr_root header in include-path" >&5
9780 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9781 if test "${cf_cv_ncurses_h+set}" = set; then
9782   echo $ECHO_N "(cached) $ECHO_C" >&6
9783 else
9784
9785         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9786         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9787         for cf_header in $cf_header_list
9788         do
9789
9790         cat >conftest.$ac_ext <<_ACEOF
9791 #line 9791 "configure"
9792 #include "confdefs.h"
9793
9794 #include <$cf_header>
9795 int
9796 main (void)
9797 {
9798
9799 #ifdef NCURSES_VERSION
9800
9801 printf("%s\n", NCURSES_VERSION);
9802 #else
9803 #ifdef __NCURSES_H
9804 printf("old\n");
9805 #else
9806         make an error
9807 #endif
9808 #endif
9809
9810   ;
9811   return 0;
9812 }
9813 _ACEOF
9814 rm -f conftest.$ac_objext
9815 if { (eval echo "$as_me:9815: \"$ac_compile\"") >&5
9816   (eval $ac_compile) 2>&5
9817   ac_status=$?
9818   echo "$as_me:9818: \$? = $ac_status" >&5
9819   (exit $ac_status); } &&
9820          { ac_try='test -s conftest.$ac_objext'
9821   { (eval echo "$as_me:9821: \"$ac_try\"") >&5
9822   (eval $ac_try) 2>&5
9823   ac_status=$?
9824   echo "$as_me:9824: \$? = $ac_status" >&5
9825   (exit $ac_status); }; }; then
9826   cf_cv_ncurses_h=$cf_header
9827
9828 else
9829   echo "$as_me: failed program was:" >&5
9830 cat conftest.$ac_ext >&5
9831 cf_cv_ncurses_h=no
9832 fi
9833 rm -f conftest.$ac_objext conftest.$ac_ext
9834
9835                 test "$cf_cv_ncurses_h" != no && break
9836         done
9837
9838 fi
9839 echo "$as_me:9839: result: $cf_cv_ncurses_h" >&5
9840 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9841
9842 if test "$cf_cv_ncurses_h" != no ; then
9843         cf_cv_ncurses_header=$cf_cv_ncurses_h
9844 else
9845
9846 echo "$as_me:9846: checking for $cf_ncuhdr_root include-path" >&5
9847 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9848 if test "${cf_cv_ncurses_h2+set}" = set; then
9849   echo $ECHO_N "(cached) $ECHO_C" >&6
9850 else
9851
9852         test -n "$verbose" && echo
9853
9854 cf_search=
9855
9856 # collect the current set of include-directories from compiler flags
9857 cf_header_path_list=""
9858 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9859         for cf_header_path in $CPPFLAGS $CFLAGS
9860         do
9861                 case $cf_header_path in
9862                 (-I*)
9863                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9864
9865 test "x$cf_header_path" != "xNONE" && \
9866 test -d "$cf_header_path" && \
9867  {
9868         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9869         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9870         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9871         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9872         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9873         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"
9874 }
9875
9876                         cf_header_path_list="$cf_header_path_list $cf_search"
9877                         ;;
9878                 esac
9879         done
9880 fi
9881
9882 # add the variations for the package we are looking for
9883
9884 cf_search=
9885
9886 test "x$prefix" != "xNONE" && \
9887 test -d "$prefix" && \
9888  {
9889         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9890         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9891         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9892         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9893         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9894         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9895 }
9896
9897 for cf_subdir_prefix in \
9898         /usr \
9899         /usr/local \
9900         /usr/pkg \
9901         /opt \
9902         /opt/local \
9903         $HOME
9904 do
9905
9906 test "x$cf_subdir_prefix" != "x$prefix" && \
9907 test -d "$cf_subdir_prefix" && \
9908 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9909         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9910         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9911         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9912         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9913         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9914         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"
9915 }
9916
9917 done
9918
9919 test "$includedir" != NONE && \
9920 test "$includedir" != "/usr/include" && \
9921 test -d "$includedir" && {
9922         test -d $includedir &&    cf_search="$cf_search $includedir"
9923         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9924 }
9925
9926 test "$oldincludedir" != NONE && \
9927 test "$oldincludedir" != "/usr/include" && \
9928 test -d "$oldincludedir" && {
9929         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9930         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9931 }
9932
9933 cf_search="$cf_search $cf_header_path_list"
9934
9935         test -n "$verbose" && echo search path $cf_search
9936         cf_save2_CPPFLAGS="$CPPFLAGS"
9937         for cf_incdir in $cf_search
9938         do
9939
9940 if test -n "$cf_incdir" ; then
9941   for cf_add_incdir in $cf_incdir
9942   do
9943         while test $cf_add_incdir != /usr/include
9944         do
9945           if test -d $cf_add_incdir
9946           then
9947                 cf_have_incdir=no
9948                 if test -n "$CFLAGS$CPPFLAGS" ; then
9949                   # a loop is needed to ensure we can add subdirs of existing dirs
9950                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9951                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9952                           cf_have_incdir=yes; break
9953                         fi
9954                   done
9955                 fi
9956
9957                 if test "$cf_have_incdir" = no ; then
9958                   if test "$cf_add_incdir" = /usr/local/include ; then
9959                         if test "$GCC" = yes
9960                         then
9961                           cf_save_CPPFLAGS=$CPPFLAGS
9962
9963         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9964         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9965
9966                           cat >conftest.$ac_ext <<_ACEOF
9967 #line 9967 "configure"
9968 #include "confdefs.h"
9969 #include <stdio.h>
9970 int
9971 main (void)
9972 {
9973 printf("Hello")
9974   ;
9975   return 0;
9976 }
9977 _ACEOF
9978 rm -f conftest.$ac_objext
9979 if { (eval echo "$as_me:9979: \"$ac_compile\"") >&5
9980   (eval $ac_compile) 2>&5
9981   ac_status=$?
9982   echo "$as_me:9982: \$? = $ac_status" >&5
9983   (exit $ac_status); } &&
9984          { ac_try='test -s conftest.$ac_objext'
9985   { (eval echo "$as_me:9985: \"$ac_try\"") >&5
9986   (eval $ac_try) 2>&5
9987   ac_status=$?
9988   echo "$as_me:9988: \$? = $ac_status" >&5
9989   (exit $ac_status); }; }; then
9990   :
9991 else
9992   echo "$as_me: failed program was:" >&5
9993 cat conftest.$ac_ext >&5
9994 cf_have_incdir=yes
9995 fi
9996 rm -f conftest.$ac_objext conftest.$ac_ext
9997                           CPPFLAGS=$cf_save_CPPFLAGS
9998                         fi
9999                   fi
10000                 fi
10001
10002                 if test "$cf_have_incdir" = no ; then
10003                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10004
10005 echo "${as_me:-configure}:10005: testing adding $cf_add_incdir to include-path ..." 1>&5
10006
10007                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10008
10009                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10010                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10011                   cf_add_incdir="$cf_top_incdir"
10012                 else
10013                   break
10014                 fi
10015           else
10016                 break
10017           fi
10018         done
10019   done
10020 fi
10021
10022                 for cf_header in \
10023                         ncurses.h \
10024                         curses.h
10025                 do
10026
10027         cat >conftest.$ac_ext <<_ACEOF
10028 #line 10028 "configure"
10029 #include "confdefs.h"
10030
10031 #include <$cf_header>
10032 int
10033 main (void)
10034 {
10035
10036 #ifdef NCURSES_VERSION
10037
10038 printf("%s\n", NCURSES_VERSION);
10039 #else
10040 #ifdef __NCURSES_H
10041 printf("old\n");
10042 #else
10043         make an error
10044 #endif
10045 #endif
10046
10047   ;
10048   return 0;
10049 }
10050 _ACEOF
10051 rm -f conftest.$ac_objext
10052 if { (eval echo "$as_me:10052: \"$ac_compile\"") >&5
10053   (eval $ac_compile) 2>&5
10054   ac_status=$?
10055   echo "$as_me:10055: \$? = $ac_status" >&5
10056   (exit $ac_status); } &&
10057          { ac_try='test -s conftest.$ac_objext'
10058   { (eval echo "$as_me:10058: \"$ac_try\"") >&5
10059   (eval $ac_try) 2>&5
10060   ac_status=$?
10061   echo "$as_me:10061: \$? = $ac_status" >&5
10062   (exit $ac_status); }; }; then
10063   cf_cv_ncurses_h2=$cf_header
10064
10065 else
10066   echo "$as_me: failed program was:" >&5
10067 cat conftest.$ac_ext >&5
10068 cf_cv_ncurses_h2=no
10069 fi
10070 rm -f conftest.$ac_objext conftest.$ac_ext
10071
10072                         if test "$cf_cv_ncurses_h2" != no ; then
10073                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10074                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10075                                 break
10076                         fi
10077                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10078                 done
10079                 CPPFLAGS="$cf_save2_CPPFLAGS"
10080                 test "$cf_cv_ncurses_h2" != no && break
10081         done
10082         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10082: error: not found" >&5
10083 echo "$as_me: error: not found" >&2;}
10084    { (exit 1); exit 1; }; }
10085
10086 fi
10087 echo "$as_me:10087: result: $cf_cv_ncurses_h2" >&5
10088 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10089
10090         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10091         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10092         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10093                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10094         fi
10095
10096 if test -n "$cf_1st_incdir" ; then
10097   for cf_add_incdir in $cf_1st_incdir
10098   do
10099         while test $cf_add_incdir != /usr/include
10100         do
10101           if test -d $cf_add_incdir
10102           then
10103                 cf_have_incdir=no
10104                 if test -n "$CFLAGS$CPPFLAGS" ; then
10105                   # a loop is needed to ensure we can add subdirs of existing dirs
10106                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10107                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10108                           cf_have_incdir=yes; break
10109                         fi
10110                   done
10111                 fi
10112
10113                 if test "$cf_have_incdir" = no ; then
10114                   if test "$cf_add_incdir" = /usr/local/include ; then
10115                         if test "$GCC" = yes
10116                         then
10117                           cf_save_CPPFLAGS=$CPPFLAGS
10118
10119         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10120         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10121
10122                           cat >conftest.$ac_ext <<_ACEOF
10123 #line 10123 "configure"
10124 #include "confdefs.h"
10125 #include <stdio.h>
10126 int
10127 main (void)
10128 {
10129 printf("Hello")
10130   ;
10131   return 0;
10132 }
10133 _ACEOF
10134 rm -f conftest.$ac_objext
10135 if { (eval echo "$as_me:10135: \"$ac_compile\"") >&5
10136   (eval $ac_compile) 2>&5
10137   ac_status=$?
10138   echo "$as_me:10138: \$? = $ac_status" >&5
10139   (exit $ac_status); } &&
10140          { ac_try='test -s conftest.$ac_objext'
10141   { (eval echo "$as_me:10141: \"$ac_try\"") >&5
10142   (eval $ac_try) 2>&5
10143   ac_status=$?
10144   echo "$as_me:10144: \$? = $ac_status" >&5
10145   (exit $ac_status); }; }; then
10146   :
10147 else
10148   echo "$as_me: failed program was:" >&5
10149 cat conftest.$ac_ext >&5
10150 cf_have_incdir=yes
10151 fi
10152 rm -f conftest.$ac_objext conftest.$ac_ext
10153                           CPPFLAGS=$cf_save_CPPFLAGS
10154                         fi
10155                   fi
10156                 fi
10157
10158                 if test "$cf_have_incdir" = no ; then
10159                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10160
10161 echo "${as_me:-configure}:10161: testing adding $cf_add_incdir to include-path ..." 1>&5
10162
10163                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10164
10165                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10166                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10167                   cf_add_incdir="$cf_top_incdir"
10168                 else
10169                   break
10170                 fi
10171           else
10172                 break
10173           fi
10174         done
10175   done
10176 fi
10177
10178 fi
10179
10180 # Set definitions to allow ifdef'ing for ncurses.h
10181
10182 case $cf_cv_ncurses_header in
10183 (*ncurses.h)
10184
10185 cat >>confdefs.h <<\EOF
10186 #define HAVE_NCURSES_H 1
10187 EOF
10188
10189         ;;
10190 esac
10191
10192 case $cf_cv_ncurses_header in
10193 (ncurses/curses.h|ncurses/ncurses.h)
10194
10195 cat >>confdefs.h <<\EOF
10196 #define HAVE_NCURSES_NCURSES_H 1
10197 EOF
10198
10199         ;;
10200 (ncursesw/curses.h|ncursesw/ncurses.h)
10201
10202 cat >>confdefs.h <<\EOF
10203 #define HAVE_NCURSESW_NCURSES_H 1
10204 EOF
10205
10206         ;;
10207 esac
10208
10209 echo "$as_me:10209: checking for terminfo header" >&5
10210 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10211 if test "${cf_cv_term_header+set}" = set; then
10212   echo $ECHO_N "(cached) $ECHO_C" >&6
10213 else
10214
10215 case ${cf_cv_ncurses_header} in
10216 (*/ncurses.h|*/ncursesw.h)
10217         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10218         ;;
10219 (*)
10220         cf_term_header=term.h
10221         ;;
10222 esac
10223
10224 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10225 do
10226 cat >conftest.$ac_ext <<_ACEOF
10227 #line 10227 "configure"
10228 #include "confdefs.h"
10229 #include <stdio.h>
10230 #include <${cf_cv_ncurses_header:-curses.h}>
10231 #include <$cf_test>
10232
10233 int
10234 main (void)
10235 {
10236 int x = auto_left_margin; (void)x
10237   ;
10238   return 0;
10239 }
10240 _ACEOF
10241 rm -f conftest.$ac_objext
10242 if { (eval echo "$as_me:10242: \"$ac_compile\"") >&5
10243   (eval $ac_compile) 2>&5
10244   ac_status=$?
10245   echo "$as_me:10245: \$? = $ac_status" >&5
10246   (exit $ac_status); } &&
10247          { ac_try='test -s conftest.$ac_objext'
10248   { (eval echo "$as_me:10248: \"$ac_try\"") >&5
10249   (eval $ac_try) 2>&5
10250   ac_status=$?
10251   echo "$as_me:10251: \$? = $ac_status" >&5
10252   (exit $ac_status); }; }; then
10253
10254         cf_cv_term_header="$cf_test"
10255 else
10256   echo "$as_me: failed program was:" >&5
10257 cat conftest.$ac_ext >&5
10258
10259         cf_cv_term_header=unknown
10260
10261 fi
10262 rm -f conftest.$ac_objext conftest.$ac_ext
10263         test "$cf_cv_term_header" != unknown && break
10264 done
10265
10266 fi
10267 echo "$as_me:10267: result: $cf_cv_term_header" >&5
10268 echo "${ECHO_T}$cf_cv_term_header" >&6
10269
10270 # Set definitions to allow ifdef'ing to accommodate subdirectories
10271
10272 case $cf_cv_term_header in
10273 (*term.h)
10274
10275 cat >>confdefs.h <<\EOF
10276 #define HAVE_TERM_H 1
10277 EOF
10278
10279         ;;
10280 esac
10281
10282 case $cf_cv_term_header in
10283 (ncurses/term.h)
10284
10285 cat >>confdefs.h <<\EOF
10286 #define HAVE_NCURSES_TERM_H 1
10287 EOF
10288
10289         ;;
10290 (ncursesw/term.h)
10291
10292 cat >>confdefs.h <<\EOF
10293 #define HAVE_NCURSESW_TERM_H 1
10294 EOF
10295
10296         ;;
10297 esac
10298
10299 # some applications need this, but should check for NCURSES_VERSION
10300
10301 cat >>confdefs.h <<\EOF
10302 #define NCURSES 1
10303 EOF
10304
10305 echo "$as_me:10305: checking for ncurses version" >&5
10306 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10307 if test "${cf_cv_ncurses_version+set}" = set; then
10308   echo $ECHO_N "(cached) $ECHO_C" >&6
10309 else
10310
10311         cf_cv_ncurses_version=no
10312         cf_tempfile=out$$
10313         rm -f $cf_tempfile
10314         if test "$cross_compiling" = yes; then
10315
10316         # This will not work if the preprocessor splits the line after the
10317         # Autoconf token.  The 'unproto' program does that.
10318         cat > conftest.$ac_ext <<EOF
10319 #include <${cf_cv_ncurses_header:-curses.h}>
10320 #undef Autoconf
10321 #ifdef NCURSES_VERSION
10322 Autoconf NCURSES_VERSION
10323 #else
10324 #ifdef __NCURSES_H
10325 Autoconf "old"
10326 #endif
10327 ;
10328 #endif
10329 EOF
10330         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10331         { (eval echo "$as_me:10331: \"$cf_try\"") >&5
10332   (eval $cf_try) 2>&5
10333   ac_status=$?
10334   echo "$as_me:10334: \$? = $ac_status" >&5
10335   (exit $ac_status); }
10336         if test -f conftest.out ; then
10337                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10338                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10339                 rm -f conftest.out
10340         fi
10341
10342 else
10343   cat >conftest.$ac_ext <<_ACEOF
10344 #line 10344 "configure"
10345 #include "confdefs.h"
10346
10347 #include <${cf_cv_ncurses_header:-curses.h}>
10348 #include <stdio.h>
10349 int main(void)
10350 {
10351         FILE *fp = fopen("$cf_tempfile", "w");
10352 #ifdef NCURSES_VERSION
10353 # ifdef NCURSES_VERSION_PATCH
10354         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10355 # else
10356         fprintf(fp, "%s\n", NCURSES_VERSION);
10357 # endif
10358 #else
10359 # ifdef __NCURSES_H
10360         fprintf(fp, "old\n");
10361 # else
10362         make an error
10363 # endif
10364 #endif
10365         ${cf_cv_main_return:-return}(0);
10366 }
10367 _ACEOF
10368 rm -f conftest$ac_exeext
10369 if { (eval echo "$as_me:10369: \"$ac_link\"") >&5
10370   (eval $ac_link) 2>&5
10371   ac_status=$?
10372   echo "$as_me:10372: \$? = $ac_status" >&5
10373   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10374   { (eval echo "$as_me:10374: \"$ac_try\"") >&5
10375   (eval $ac_try) 2>&5
10376   ac_status=$?
10377   echo "$as_me:10377: \$? = $ac_status" >&5
10378   (exit $ac_status); }; }; then
10379
10380         cf_cv_ncurses_version=`cat $cf_tempfile`
10381 else
10382   echo "$as_me: program exited with status $ac_status" >&5
10383 echo "$as_me: failed program was:" >&5
10384 cat conftest.$ac_ext >&5
10385 fi
10386 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10387 fi
10388         rm -f $cf_tempfile
10389
10390 fi
10391 echo "$as_me:10391: result: $cf_cv_ncurses_version" >&5
10392 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10393 test "$cf_cv_ncurses_version" = no ||
10394 cat >>confdefs.h <<\EOF
10395 #define NCURSES 1
10396 EOF
10397
10398 cf_nculib_root=ncurses
10399         # This works, except for the special case where we find gpm, but
10400         # ncurses is in a nonstandard location via $LIBS, and we really want
10401         # to link gpm.
10402 cf_ncurses_LIBS=""
10403 cf_ncurses_SAVE="$LIBS"
10404 echo "$as_me:10404: checking for Gpm_Open in -lgpm" >&5
10405 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10406 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10407   echo $ECHO_N "(cached) $ECHO_C" >&6
10408 else
10409   ac_check_lib_save_LIBS=$LIBS
10410 LIBS="-lgpm  $LIBS"
10411 cat >conftest.$ac_ext <<_ACEOF
10412 #line 10412 "configure"
10413 #include "confdefs.h"
10414
10415 /* Override any gcc2 internal prototype to avoid an error.  */
10416 #ifdef __cplusplus
10417 extern "C"
10418 #endif
10419 /* We use char because int might match the return type of a gcc2
10420    builtin and then its argument prototype would still apply.  */
10421 char Gpm_Open ();
10422 int
10423 main (void)
10424 {
10425 Gpm_Open ();
10426   ;
10427   return 0;
10428 }
10429 _ACEOF
10430 rm -f conftest.$ac_objext conftest$ac_exeext
10431 if { (eval echo "$as_me:10431: \"$ac_link\"") >&5
10432   (eval $ac_link) 2>&5
10433   ac_status=$?
10434   echo "$as_me:10434: \$? = $ac_status" >&5
10435   (exit $ac_status); } &&
10436          { ac_try='test -s conftest$ac_exeext'
10437   { (eval echo "$as_me:10437: \"$ac_try\"") >&5
10438   (eval $ac_try) 2>&5
10439   ac_status=$?
10440   echo "$as_me:10440: \$? = $ac_status" >&5
10441   (exit $ac_status); }; }; then
10442   ac_cv_lib_gpm_Gpm_Open=yes
10443 else
10444   echo "$as_me: failed program was:" >&5
10445 cat conftest.$ac_ext >&5
10446 ac_cv_lib_gpm_Gpm_Open=no
10447 fi
10448 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10449 LIBS=$ac_check_lib_save_LIBS
10450 fi
10451 echo "$as_me:10451: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10452 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10453 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10454   echo "$as_me:10454: checking for initscr in -lgpm" >&5
10455 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10456 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10457   echo $ECHO_N "(cached) $ECHO_C" >&6
10458 else
10459   ac_check_lib_save_LIBS=$LIBS
10460 LIBS="-lgpm  $LIBS"
10461 cat >conftest.$ac_ext <<_ACEOF
10462 #line 10462 "configure"
10463 #include "confdefs.h"
10464
10465 /* Override any gcc2 internal prototype to avoid an error.  */
10466 #ifdef __cplusplus
10467 extern "C"
10468 #endif
10469 /* We use char because int might match the return type of a gcc2
10470    builtin and then its argument prototype would still apply.  */
10471 char initscr ();
10472 int
10473 main (void)
10474 {
10475 initscr ();
10476   ;
10477   return 0;
10478 }
10479 _ACEOF
10480 rm -f conftest.$ac_objext conftest$ac_exeext
10481 if { (eval echo "$as_me:10481: \"$ac_link\"") >&5
10482   (eval $ac_link) 2>&5
10483   ac_status=$?
10484   echo "$as_me:10484: \$? = $ac_status" >&5
10485   (exit $ac_status); } &&
10486          { ac_try='test -s conftest$ac_exeext'
10487   { (eval echo "$as_me:10487: \"$ac_try\"") >&5
10488   (eval $ac_try) 2>&5
10489   ac_status=$?
10490   echo "$as_me:10490: \$? = $ac_status" >&5
10491   (exit $ac_status); }; }; then
10492   ac_cv_lib_gpm_initscr=yes
10493 else
10494   echo "$as_me: failed program was:" >&5
10495 cat conftest.$ac_ext >&5
10496 ac_cv_lib_gpm_initscr=no
10497 fi
10498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10499 LIBS=$ac_check_lib_save_LIBS
10500 fi
10501 echo "$as_me:10501: result: $ac_cv_lib_gpm_initscr" >&5
10502 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10503 if test $ac_cv_lib_gpm_initscr = yes; then
10504   LIBS="$cf_ncurses_SAVE"
10505 else
10506   cf_ncurses_LIBS="-lgpm"
10507 fi
10508
10509 fi
10510
10511 case $host_os in
10512 (freebsd*)
10513         # This is only necessary if you are linking against an obsolete
10514         # version of ncurses (but it should do no harm, since it's static).
10515         if test "$cf_nculib_root" = ncurses ; then
10516                 echo "$as_me:10516: checking for tgoto in -lmytinfo" >&5
10517 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10518 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10519   echo $ECHO_N "(cached) $ECHO_C" >&6
10520 else
10521   ac_check_lib_save_LIBS=$LIBS
10522 LIBS="-lmytinfo  $LIBS"
10523 cat >conftest.$ac_ext <<_ACEOF
10524 #line 10524 "configure"
10525 #include "confdefs.h"
10526
10527 /* Override any gcc2 internal prototype to avoid an error.  */
10528 #ifdef __cplusplus
10529 extern "C"
10530 #endif
10531 /* We use char because int might match the return type of a gcc2
10532    builtin and then its argument prototype would still apply.  */
10533 char tgoto ();
10534 int
10535 main (void)
10536 {
10537 tgoto ();
10538   ;
10539   return 0;
10540 }
10541 _ACEOF
10542 rm -f conftest.$ac_objext conftest$ac_exeext
10543 if { (eval echo "$as_me:10543: \"$ac_link\"") >&5
10544   (eval $ac_link) 2>&5
10545   ac_status=$?
10546   echo "$as_me:10546: \$? = $ac_status" >&5
10547   (exit $ac_status); } &&
10548          { ac_try='test -s conftest$ac_exeext'
10549   { (eval echo "$as_me:10549: \"$ac_try\"") >&5
10550   (eval $ac_try) 2>&5
10551   ac_status=$?
10552   echo "$as_me:10552: \$? = $ac_status" >&5
10553   (exit $ac_status); }; }; then
10554   ac_cv_lib_mytinfo_tgoto=yes
10555 else
10556   echo "$as_me: failed program was:" >&5
10557 cat conftest.$ac_ext >&5
10558 ac_cv_lib_mytinfo_tgoto=no
10559 fi
10560 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10561 LIBS=$ac_check_lib_save_LIBS
10562 fi
10563 echo "$as_me:10563: result: $ac_cv_lib_mytinfo_tgoto" >&5
10564 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10565 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10566   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10567 fi
10568
10569         fi
10570         ;;
10571 esac
10572
10573 cf_add_libs="$LIBS"
10574 # reverse order
10575 cf_add_0lib=
10576 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10577 # filter duplicates
10578 for cf_add_1lib in $cf_add_0lib; do
10579         for cf_add_2lib in $cf_add_libs; do
10580                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10581                         cf_add_1lib=
10582                         break
10583                 fi
10584         done
10585         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10586 done
10587 LIBS="$cf_add_libs"
10588
10589 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10590 then
10591
10592 cf_add_libs="$LIBS"
10593 # reverse order
10594 cf_add_0lib=
10595 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10596 # filter duplicates
10597 for cf_add_1lib in $cf_add_0lib; do
10598         for cf_add_2lib in $cf_add_libs; do
10599                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10600                         cf_add_1lib=
10601                         break
10602                 fi
10603         done
10604         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10605 done
10606 LIBS="$cf_add_libs"
10607
10608 else
10609
10610         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10611         cf_libdir=""
10612         echo "$as_me:10612: checking for initscr" >&5
10613 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10614 if test "${ac_cv_func_initscr+set}" = set; then
10615   echo $ECHO_N "(cached) $ECHO_C" >&6
10616 else
10617   cat >conftest.$ac_ext <<_ACEOF
10618 #line 10618 "configure"
10619 #include "confdefs.h"
10620 #define initscr autoconf_temporary
10621 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10622 #undef initscr
10623
10624 #ifdef __cplusplus
10625 extern "C"
10626 #endif
10627
10628 /* We use char because int might match the return type of a gcc2
10629    builtin and then its argument prototype would still apply.  */
10630 char initscr (void);
10631
10632 int
10633 main (void)
10634 {
10635
10636 /* The GNU C library defines stubs for functions which it implements
10637     to always fail with ENOSYS.  Some functions are actually named
10638     something starting with __ and the normal name is an alias.  */
10639 #if defined (__stub_initscr) || defined (__stub___initscr)
10640 #error found stub for initscr
10641 #endif
10642
10643         return initscr ();
10644   ;
10645   return 0;
10646 }
10647 _ACEOF
10648 rm -f conftest.$ac_objext conftest$ac_exeext
10649 if { (eval echo "$as_me:10649: \"$ac_link\"") >&5
10650   (eval $ac_link) 2>&5
10651   ac_status=$?
10652   echo "$as_me:10652: \$? = $ac_status" >&5
10653   (exit $ac_status); } &&
10654          { ac_try='test -s conftest$ac_exeext'
10655   { (eval echo "$as_me:10655: \"$ac_try\"") >&5
10656   (eval $ac_try) 2>&5
10657   ac_status=$?
10658   echo "$as_me:10658: \$? = $ac_status" >&5
10659   (exit $ac_status); }; }; then
10660   ac_cv_func_initscr=yes
10661 else
10662   echo "$as_me: failed program was:" >&5
10663 cat conftest.$ac_ext >&5
10664 ac_cv_func_initscr=no
10665 fi
10666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10667 fi
10668 echo "$as_me:10668: result: $ac_cv_func_initscr" >&5
10669 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10670 if test $ac_cv_func_initscr = yes; then
10671   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10672 else
10673
10674                 cf_save_LIBS="$LIBS"
10675                 echo "$as_me:10675: checking for initscr in -l$cf_nculib_root" >&5
10676 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10677                 LIBS="-l$cf_nculib_root $LIBS"
10678                 cat >conftest.$ac_ext <<_ACEOF
10679 #line 10679 "configure"
10680 #include "confdefs.h"
10681 #include <${cf_cv_ncurses_header:-curses.h}>
10682 int
10683 main (void)
10684 {
10685 initscr()
10686   ;
10687   return 0;
10688 }
10689 _ACEOF
10690 rm -f conftest.$ac_objext conftest$ac_exeext
10691 if { (eval echo "$as_me:10691: \"$ac_link\"") >&5
10692   (eval $ac_link) 2>&5
10693   ac_status=$?
10694   echo "$as_me:10694: \$? = $ac_status" >&5
10695   (exit $ac_status); } &&
10696          { ac_try='test -s conftest$ac_exeext'
10697   { (eval echo "$as_me:10697: \"$ac_try\"") >&5
10698   (eval $ac_try) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit $ac_status); }; }; then
10702   echo "$as_me:10702: result: yes" >&5
10703 echo "${ECHO_T}yes" >&6
10704                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10705
10706 else
10707   echo "$as_me: failed program was:" >&5
10708 cat conftest.$ac_ext >&5
10709 echo "$as_me:10709: result: no" >&5
10710 echo "${ECHO_T}no" >&6
10711
10712 cf_search=
10713 cf_library_path_list=""
10714 if test -n "${LDFLAGS}${LIBS}" ; then
10715         for cf_library_path in $LDFLAGS $LIBS
10716         do
10717                 case $cf_library_path in
10718                 (-L*)
10719                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10720
10721 test "x$cf_library_path" != "xNONE" && \
10722 test -d "$cf_library_path" && \
10723  {
10724         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10725         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10726         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10727         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10728         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10729         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"
10730 }
10731
10732                         cf_library_path_list="$cf_library_path_list $cf_search"
10733                         ;;
10734                 esac
10735         done
10736 fi
10737
10738 cf_search=
10739
10740 test "x$prefix" != "xNONE" && \
10741 test -d "$prefix" && \
10742  {
10743         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10744         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10745         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10746         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10747         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10748         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10749 }
10750
10751 for cf_subdir_prefix in \
10752         /usr \
10753         /usr/local \
10754         /usr/pkg \
10755         /opt \
10756         /opt/local \
10757         $HOME
10758 do
10759
10760 test "x$cf_subdir_prefix" != "x$prefix" && \
10761 test -d "$cf_subdir_prefix" && \
10762 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10763         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10764         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10765         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10766         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10767         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10768         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"
10769 }
10770
10771 done
10772
10773 cf_search="$cf_library_path_list $cf_search"
10774
10775                         for cf_libdir in $cf_search
10776                         do
10777                                 echo "$as_me:10777: checking for -l$cf_nculib_root in $cf_libdir" >&5
10778 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10779                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10780                                 cat >conftest.$ac_ext <<_ACEOF
10781 #line 10781 "configure"
10782 #include "confdefs.h"
10783 #include <${cf_cv_ncurses_header:-curses.h}>
10784 int
10785 main (void)
10786 {
10787 initscr()
10788   ;
10789   return 0;
10790 }
10791 _ACEOF
10792 rm -f conftest.$ac_objext conftest$ac_exeext
10793 if { (eval echo "$as_me:10793: \"$ac_link\"") >&5
10794   (eval $ac_link) 2>&5
10795   ac_status=$?
10796   echo "$as_me:10796: \$? = $ac_status" >&5
10797   (exit $ac_status); } &&
10798          { ac_try='test -s conftest$ac_exeext'
10799   { (eval echo "$as_me:10799: \"$ac_try\"") >&5
10800   (eval $ac_try) 2>&5
10801   ac_status=$?
10802   echo "$as_me:10802: \$? = $ac_status" >&5
10803   (exit $ac_status); }; }; then
10804   echo "$as_me:10804: result: yes" >&5
10805 echo "${ECHO_T}yes" >&6
10806                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10807                                          break
10808 else
10809   echo "$as_me: failed program was:" >&5
10810 cat conftest.$ac_ext >&5
10811 echo "$as_me:10811: result: no" >&5
10812 echo "${ECHO_T}no" >&6
10813                                          LIBS="$cf_save_LIBS"
10814 fi
10815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10816                         done
10817
10818 fi
10819 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10820
10821 fi
10822
10823 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10824
10825 if test $cf_found_library = no ; then
10826         { { echo "$as_me:10826: error: Cannot link $cf_nculib_root library" >&5
10827 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10828    { (exit 1); exit 1; }; }
10829 fi
10830
10831 fi
10832
10833 if test -n "$cf_ncurses_LIBS" ; then
10834         echo "$as_me:10834: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10835 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10836         cf_ncurses_SAVE="$LIBS"
10837         for p in $cf_ncurses_LIBS ; do
10838                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10839                 if test "$q" != "$LIBS" ; then
10840                         LIBS="$q"
10841                 fi
10842         done
10843         cat >conftest.$ac_ext <<_ACEOF
10844 #line 10844 "configure"
10845 #include "confdefs.h"
10846 #include <${cf_cv_ncurses_header:-curses.h}>
10847 int
10848 main (void)
10849 {
10850 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10851   ;
10852   return 0;
10853 }
10854 _ACEOF
10855 rm -f conftest.$ac_objext conftest$ac_exeext
10856 if { (eval echo "$as_me:10856: \"$ac_link\"") >&5
10857   (eval $ac_link) 2>&5
10858   ac_status=$?
10859   echo "$as_me:10859: \$? = $ac_status" >&5
10860   (exit $ac_status); } &&
10861          { ac_try='test -s conftest$ac_exeext'
10862   { (eval echo "$as_me:10862: \"$ac_try\"") >&5
10863   (eval $ac_try) 2>&5
10864   ac_status=$?
10865   echo "$as_me:10865: \$? = $ac_status" >&5
10866   (exit $ac_status); }; }; then
10867   echo "$as_me:10867: result: yes" >&5
10868 echo "${ECHO_T}yes" >&6
10869 else
10870   echo "$as_me: failed program was:" >&5
10871 cat conftest.$ac_ext >&5
10872 echo "$as_me:10872: result: no" >&5
10873 echo "${ECHO_T}no" >&6
10874                  LIBS="$cf_ncurses_SAVE"
10875 fi
10876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10877 fi
10878
10879 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10880
10881 cat >>confdefs.h <<EOF
10882 #define $cf_nculib_ROOT 1
10883 EOF
10884
10885         fi
10886 else
10887         NCURSES_CONFIG=none
10888 fi
10889
10890 fi
10891
10892 if test "$NCURSES_CONFIG_PKG" != none ; then
10893         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10894
10895         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10896         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10897         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10898
10899         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10900         if test -z "$cf_cv_abi_version"
10901         then
10902                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10903         fi
10904
10905 elif test "$NCURSES_CONFIG" != none ; then
10906
10907         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10908
10909         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10910         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10911         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10912
10913         # ABI version is not available from headers
10914         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10915
10916 else
10917
10918         for cf_name in MAJOR MINOR PATCH
10919         do
10920         cat >conftest.$ac_ext <<CF_EOF
10921         #include <${cf_cv_ncurses_header:-curses.h}>
10922         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10923 CF_EOF
10924                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10925                 { (eval echo "$as_me:10925: \"$cf_try\"") >&5
10926   (eval $cf_try) 2>&5
10927   ac_status=$?
10928   echo "$as_me:10928: \$? = $ac_status" >&5
10929   (exit $ac_status); }
10930                 if test -f conftest.out ; then
10931                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10932                         eval NCURSES_$cf_name=\"$cf_result\"
10933                         # cat conftest.$ac_ext
10934                         # cat conftest.out
10935                 fi
10936         done
10937
10938         cf_cv_abi_version=${NCURSES_MAJOR}
10939
10940 fi
10941
10942 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10943
10944 cf_cv_timestamp=`date`
10945
10946 echo "$as_me:10946: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10947 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10948
10949 echo "$as_me:10949: checking if you want to have a library-prefix" >&5
10950 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10951
10952 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10953 if test "${with_lib_prefix+set}" = set; then
10954   withval="$with_lib_prefix"
10955   with_lib_prefix=$withval
10956 else
10957   with_lib_prefix=auto
10958 fi;
10959 echo "$as_me:10959: result: $with_lib_prefix" >&5
10960 echo "${ECHO_T}$with_lib_prefix" >&6
10961
10962 if test $with_lib_prefix = auto
10963 then
10964
10965         case $cf_cv_system_name in
10966         (OS/2*|os2*)
10967                 if test "$DFT_LWR_MODEL" = libtool; then
10968                         LIB_PREFIX='lib'
10969                 else
10970                         LIB_PREFIX=''
10971                 fi
10972                 ;;
10973         (*-msvc*)
10974                 LIB_PREFIX=''
10975                 ;;
10976         (*)     LIB_PREFIX='lib'
10977                 ;;
10978         esac
10979 cf_prefix=$LIB_PREFIX
10980
10981 elif test $with_lib_prefix = no
10982 then
10983         LIB_PREFIX=
10984 else
10985         LIB_PREFIX=$with_lib_prefix
10986 fi
10987
10988 LIB_SUFFIX=
10989
10990 ###############################################################################
10991
10992 if test X"$CC_G_OPT" = X"" ; then
10993         CC_G_OPT='-g'
10994         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10995 fi
10996
10997 echo "$as_me:10997: checking for default loader flags" >&5
10998 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10999 case $DFT_LWR_MODEL in
11000 (normal)  LD_MODEL=''   ;;
11001 (debug)   LD_MODEL=$CC_G_OPT ;;
11002 (profile) LD_MODEL='-pg';;
11003 (shared)  LD_MODEL=''   ;;
11004 esac
11005 echo "$as_me:11005: result: $LD_MODEL" >&5
11006 echo "${ECHO_T}$LD_MODEL" >&6
11007
11008 LD_RPATH_OPT=
11009 if test "x$cf_cv_enable_rpath" != xno
11010 then
11011         echo "$as_me:11011: checking for an rpath option" >&5
11012 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11013         case $cf_cv_system_name in
11014         (irix*)
11015                 if test "$GCC" = yes; then
11016                         LD_RPATH_OPT="-Wl,-rpath,"
11017                 else
11018                         LD_RPATH_OPT="-rpath "
11019                 fi
11020                 ;;
11021         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11022                 LD_RPATH_OPT="-Wl,-rpath,"
11023                 ;;
11024         (openbsd[2-9].*|mirbsd*)
11025                 LD_RPATH_OPT="-Wl,-rpath,"
11026                 ;;
11027         (dragonfly*)
11028                 LD_RPATH_OPT="-rpath "
11029                 ;;
11030         (netbsd*)
11031                 LD_RPATH_OPT="-Wl,-rpath,"
11032                 ;;
11033         (osf*|mls+*)
11034                 LD_RPATH_OPT="-rpath "
11035                 ;;
11036         (solaris2*)
11037                 LD_RPATH_OPT="-R"
11038                 ;;
11039         (*)
11040                 ;;
11041         esac
11042         echo "$as_me:11042: result: $LD_RPATH_OPT" >&5
11043 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11044
11045         case "x$LD_RPATH_OPT" in
11046         (x-R*)
11047                 echo "$as_me:11047: checking if we need a space after rpath option" >&5
11048 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11049                 cf_save_LIBS="$LIBS"
11050
11051 cf_add_libs="$LIBS"
11052 # reverse order
11053 cf_add_0lib=
11054 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11055 # filter duplicates
11056 for cf_add_1lib in $cf_add_0lib; do
11057         for cf_add_2lib in $cf_add_libs; do
11058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11059                         cf_add_1lib=
11060                         break
11061                 fi
11062         done
11063         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11064 done
11065 LIBS="$cf_add_libs"
11066
11067                 cat >conftest.$ac_ext <<_ACEOF
11068 #line 11068 "configure"
11069 #include "confdefs.h"
11070
11071 int
11072 main (void)
11073 {
11074
11075   ;
11076   return 0;
11077 }
11078 _ACEOF
11079 rm -f conftest.$ac_objext conftest$ac_exeext
11080 if { (eval echo "$as_me:11080: \"$ac_link\"") >&5
11081   (eval $ac_link) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit $ac_status); } &&
11085          { ac_try='test -s conftest$ac_exeext'
11086   { (eval echo "$as_me:11086: \"$ac_try\"") >&5
11087   (eval $ac_try) 2>&5
11088   ac_status=$?
11089   echo "$as_me:11089: \$? = $ac_status" >&5
11090   (exit $ac_status); }; }; then
11091   cf_rpath_space=no
11092 else
11093   echo "$as_me: failed program was:" >&5
11094 cat conftest.$ac_ext >&5
11095 cf_rpath_space=yes
11096 fi
11097 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11098                 LIBS="$cf_save_LIBS"
11099                 echo "$as_me:11099: result: $cf_rpath_space" >&5
11100 echo "${ECHO_T}$cf_rpath_space" >&6
11101                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11102                 ;;
11103         esac
11104 fi
11105
11106         RM_SHARED_OPTS=
11107         LOCAL_LDFLAGS=
11108         LOCAL_LDFLAGS2=
11109         LD_SHARED_OPTS=
11110         INSTALL_LIB="-m 644"
11111         : ${rel_builddir:=.}
11112
11113         shlibdir=$libdir
11114
11115         MAKE_DLLS="#"
11116
11117         cf_cv_do_symlinks=no
11118         cf_ld_rpath_opt=
11119         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11120
11121         echo "$as_me:11121: checking if release/abi version should be used for shared libs" >&5
11122 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11123
11124 # Check whether --with-shlib-version or --without-shlib-version was given.
11125 if test "${with_shlib_version+set}" = set; then
11126   withval="$with_shlib_version"
11127   test -z "$withval" && withval=auto
11128         case $withval in
11129         (yes)
11130                 cf_cv_shlib_version=auto
11131                 ;;
11132         (rel|abi|auto)
11133                 cf_cv_shlib_version=$withval
11134                 ;;
11135         (*)
11136                 echo "$as_me:11136: result: $withval" >&5
11137 echo "${ECHO_T}$withval" >&6
11138                 { { echo "$as_me:11138: error: option value must be one of: rel, abi, or auto" >&5
11139 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11140    { (exit 1); exit 1; }; }
11141                 ;;
11142         esac
11143
11144 else
11145   cf_cv_shlib_version=auto
11146 fi;
11147         echo "$as_me:11147: result: $cf_cv_shlib_version" >&5
11148 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11149
11150         cf_cv_rm_so_locs=no
11151         cf_try_cflags=
11152
11153         # Some less-capable ports of gcc support only -fpic
11154         CC_SHARED_OPTS=
11155
11156         cf_try_fPIC=no
11157         if test "$GCC" = yes
11158         then
11159                 cf_try_fPIC=yes
11160         else
11161                 case $cf_cv_system_name in
11162                 (*linux*)       # e.g., PGI compiler
11163                         cf_try_fPIC=yes
11164                         ;;
11165                 esac
11166         fi
11167
11168         if test "$cf_try_fPIC" = yes
11169         then
11170                 echo "$as_me:11170: checking which $CC option to use" >&5
11171 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11172                 cf_save_CFLAGS="$CFLAGS"
11173                 for CC_SHARED_OPTS in -fPIC -fpic ''
11174                 do
11175                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11176                         cat >conftest.$ac_ext <<_ACEOF
11177 #line 11177 "configure"
11178 #include "confdefs.h"
11179 #include <stdio.h>
11180 int
11181 main (void)
11182 {
11183 int x = 1
11184   ;
11185   return 0;
11186 }
11187 _ACEOF
11188 rm -f conftest.$ac_objext
11189 if { (eval echo "$as_me:11189: \"$ac_compile\"") >&5
11190   (eval $ac_compile) 2>&5
11191   ac_status=$?
11192   echo "$as_me:11192: \$? = $ac_status" >&5
11193   (exit $ac_status); } &&
11194          { ac_try='test -s conftest.$ac_objext'
11195   { (eval echo "$as_me:11195: \"$ac_try\"") >&5
11196   (eval $ac_try) 2>&5
11197   ac_status=$?
11198   echo "$as_me:11198: \$? = $ac_status" >&5
11199   (exit $ac_status); }; }; then
11200   break
11201 else
11202   echo "$as_me: failed program was:" >&5
11203 cat conftest.$ac_ext >&5
11204 fi
11205 rm -f conftest.$ac_objext conftest.$ac_ext
11206                 done
11207                 echo "$as_me:11207: result: $CC_SHARED_OPTS" >&5
11208 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11209                 CFLAGS="$cf_save_CFLAGS"
11210         fi
11211
11212         cf_cv_shlib_version_infix=no
11213
11214         case $cf_cv_system_name in
11215         (aix4.3-9*|aix[5-7]*)
11216                 if test "$GCC" = yes; then
11217                         CC_SHARED_OPTS='-Wl,-brtl'
11218                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11219                 else
11220                         CC_SHARED_OPTS='-brtl'
11221                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11222                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11223                 fi
11224                 ;;
11225         (beos*)
11226                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11227                 ;;
11228         (cygwin*)
11229                 CC_SHARED_OPTS=
11230                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11231                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11232                 cf_cv_shlib_version=cygdll
11233                 cf_cv_shlib_version_infix=cygdll
11234                 shlibdir=$bindir
11235                 MAKE_DLLS=
11236                 cat >mk_shared_lib.sh <<-CF_EOF
11237                 #!$SHELL
11238                 SHARED_LIB=\$1
11239                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11240                 shift
11241                 cat <<-EOF
11242                 Linking shared library
11243                 ** SHARED_LIB \$SHARED_LIB
11244                 ** IMPORT_LIB \$IMPORT_LIB
11245 EOF
11246                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11247 CF_EOF
11248                 chmod +x mk_shared_lib.sh
11249                 ;;
11250         (msys*)
11251                 CC_SHARED_OPTS=
11252                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11253                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11254                 cf_cv_shlib_version=msysdll
11255                 cf_cv_shlib_version_infix=msysdll
11256                 shlibdir=$bindir
11257                 MAKE_DLLS=
11258                 cat >mk_shared_lib.sh <<-CF_EOF
11259                 #!$SHELL
11260                 SHARED_LIB=\$1
11261                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11262                 shift
11263                 cat <<-EOF
11264                 Linking shared library
11265                 ** SHARED_LIB \$SHARED_LIB
11266                 ** IMPORT_LIB \$IMPORT_LIB
11267 EOF
11268                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11269 CF_EOF
11270                 chmod +x mk_shared_lib.sh
11271                 ;;
11272         (darwin*)
11273                 cf_try_cflags="no-cpp-precomp"
11274                 CC_SHARED_OPTS="-dynamic"
11275                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11276                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11277                 cf_cv_shlib_version_infix=yes
11278                 echo "$as_me:11278: checking if ld -search_paths_first works" >&5
11279 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11280 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11281   echo $ECHO_N "(cached) $ECHO_C" >&6
11282 else
11283
11284                         cf_save_LDFLAGS=$LDFLAGS
11285                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11286                         cat >conftest.$ac_ext <<_ACEOF
11287 #line 11287 "configure"
11288 #include "confdefs.h"
11289
11290 int
11291 main (void)
11292 {
11293 int i;
11294   ;
11295   return 0;
11296 }
11297 _ACEOF
11298 rm -f conftest.$ac_objext conftest$ac_exeext
11299 if { (eval echo "$as_me:11299: \"$ac_link\"") >&5
11300   (eval $ac_link) 2>&5
11301   ac_status=$?
11302   echo "$as_me:11302: \$? = $ac_status" >&5
11303   (exit $ac_status); } &&
11304          { ac_try='test -s conftest$ac_exeext'
11305   { (eval echo "$as_me:11305: \"$ac_try\"") >&5
11306   (eval $ac_try) 2>&5
11307   ac_status=$?
11308   echo "$as_me:11308: \$? = $ac_status" >&5
11309   (exit $ac_status); }; }; then
11310   cf_cv_ldflags_search_paths_first=yes
11311 else
11312   echo "$as_me: failed program was:" >&5
11313 cat conftest.$ac_ext >&5
11314 cf_cv_ldflags_search_paths_first=no
11315 fi
11316 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11317                                 LDFLAGS=$cf_save_LDFLAGS
11318 fi
11319 echo "$as_me:11319: result: $cf_cv_ldflags_search_paths_first" >&5
11320 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11321                 if test $cf_cv_ldflags_search_paths_first = yes; then
11322                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11323                 fi
11324                 ;;
11325         (hpux[7-8]*)
11326                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11327                 if test "$GCC" != yes; then
11328                         CC_SHARED_OPTS='+Z'
11329                 fi
11330                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11331                 INSTALL_LIB="-m 555"
11332                 ;;
11333         (hpux*)
11334                 # (tested with gcc 2.7.2 -- I don't have c89)
11335                 if test "$GCC" = yes; then
11336                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11337                 else
11338                         CC_SHARED_OPTS='+Z'
11339                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11340                 fi
11341                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11342                 # HP-UX shared libraries must be executable, and should be
11343                 # readonly to exploit a quirk in the memory manager.
11344                 INSTALL_LIB="-m 555"
11345                 ;;
11346         (interix*)
11347                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11348                 if test "$cf_cv_shlib_version" = rel; then
11349                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11350                 else
11351                         cf_shared_soname='`basename $@`'
11352                 fi
11353                 CC_SHARED_OPTS=
11354                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11355                 ;;
11356         (irix*)
11357                 if test "$cf_cv_enable_rpath" = yes ; then
11358                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11359                 fi
11360                 # tested with IRIX 5.2 and 'cc'.
11361                 if test "$GCC" != yes; then
11362                         CC_SHARED_OPTS='-KPIC'
11363                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11364                 else
11365                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11366                 fi
11367                 cf_cv_rm_so_locs=yes
11368                 ;;
11369         (linux*|gnu*|k*bsd*-gnu)
11370                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11371                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11372                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11373                 fi
11374                 if test "$cf_cv_enable_rpath" = yes ; then
11375                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11376                 fi
11377
11378         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11379         if test "$cf_cv_shlib_version" = rel; then
11380                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11381         else
11382                 cf_cv_shared_soname='`basename $@`'
11383         fi
11384
11385                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11386                 ;;
11387         (mingw*msvc*)
11388                 cf_cv_shlib_version=msvcdll
11389                 cf_cv_shlib_version_infix=msvcdll
11390                 shlibdir=$bindir
11391                 MAKE_DLLS=
11392                 if test "$DFT_LWR_MODEL" = "shared" ; then
11393                         LOCAL_LDFLAGS="-link -dll"
11394                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11395                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11396                 fi
11397                 CC_SHARED_OPTS=
11398                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11399                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11400                 cat >mk_shared_lib.sh <<-CF_EOF
11401                 #!$SHELL
11402                 SHARED_LIB=\$1
11403                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11404                 shift
11405                 my_ld=\$1
11406                 shift
11407                 cat <<-EOF
11408                 Linking shared library
11409                 ** SHARED LIB \$SHARED_LIB
11410                 ** IMPORT_LIB \$IMPORT_LIB
11411 EOF
11412                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11413                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11414                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11415 CF_EOF
11416                 chmod +x mk_shared_lib.sh
11417                 cat >mk_prog.sh <<-CF_EOF
11418                 #!$SHELL
11419                 shift
11420                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11421                 LD="$LD"
11422                 clopts=()
11423                 ldopts=("/subsystem:console")
11424                 libs=()
11425                 isdll=0
11426                 while test \$# -gt 0; do
11427                         case "\$1" in
11428                                 -link)
11429                                         # ignore -link argument
11430                                         ;;
11431                                 -M[TD] | -M[TD]d)
11432                                         # ignore runtime-library option
11433                                         ;;
11434                                 -dll)
11435                                         isdll=1
11436                                         ;;
11437                                 -W* | -w*)
11438                                         # ignore warnings
11439                                         ;;
11440                                 -D*)
11441                                         clopts+=("\$1")
11442                                         ;;
11443                                 -I*)
11444                                         clopts+=("\$1")
11445                                         ;;
11446                                 -l*)
11447                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11448                                         ;;
11449                                 -L*)
11450                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11451                                         ;;
11452                                 *.obj | *.o)
11453                                         ldopts+=("\$1")
11454                                         ;;
11455                                 -Wl,*)
11456                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11457                                                 ldopts+=("\${linkarg}")
11458                                         done
11459                                         ;;
11460                                 *.lib)
11461                                         ldopts+=("\$1")
11462                                         ;;
11463                                 -o)
11464                                         shift
11465                                         ldopts+=("-out:\$1")
11466                                         ;;
11467                                 *)
11468                                         clopts+=("\$1")
11469                                         ldopts+=("\$1")
11470                                         ;;
11471                         esac
11472                         shift
11473                 done
11474                 if [ "\$isdll" -ne 0 ]; then
11475                         for lib in \${libs[*]}; do
11476                                 ldopts+=("\$lib.dll.lib")
11477                         done
11478                 else
11479                         for lib in \${libs[*]}; do
11480                                 ldopts+=("\$lib.lib")
11481                         done
11482                 fi
11483                 cat <<-EOF
11484                 Creating program
11485                 ** ld options:   "\${ldopts[@]}"
11486 EOF
11487                 exec \$LD \${ldopts[@]}
11488 CF_EOF
11489                 chmod +x mk_prog.sh
11490                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11491                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11492                 ;;
11493         (mingw*)
11494                 cf_cv_shlib_version=mingw
11495                 cf_cv_shlib_version_infix=mingw
11496                 shlibdir=$bindir
11497                 MAKE_DLLS=
11498                 if test "$DFT_LWR_MODEL" = "shared" ; then
11499                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11500                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11501                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11502                 fi
11503                 CC_SHARED_OPTS=
11504                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11505                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11506                 cat >mk_shared_lib.sh <<-CF_EOF
11507                 #!$SHELL
11508                 SHARED_LIB=\$1
11509                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11510                 shift
11511                 cat <<-EOF
11512                 Linking shared library
11513                 ** SHARED_LIB \$SHARED_LIB
11514                 ** IMPORT_LIB \$IMPORT_LIB
11515 EOF
11516                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11517 CF_EOF
11518                 chmod +x mk_shared_lib.sh
11519                 ;;
11520         (openbsd[2-9].*|mirbsd*)
11521                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11522                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11523                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11524                 fi
11525                 if test "$cf_cv_enable_rpath" = yes ; then
11526                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11527                 fi
11528                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11529
11530         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11531         if test "$cf_cv_shlib_version" = rel; then
11532                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11533         else
11534                 cf_cv_shared_soname='`basename $@`'
11535         fi
11536
11537                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11538                 ;;
11539         (nskJ*)
11540                 CC_SHARED_OPTS=
11541                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11542                 ;;
11543         (nskL*)
11544                 CC_SHARED_OPTS=
11545                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11546                 ;;
11547         (nto-qnx*|openbsd*|freebsd[12].*)
11548                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11549                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11550                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11551                 ;;
11552         (dragonfly*|freebsd*)
11553                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11554                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11555                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11556                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11557                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11558                 fi
11559
11560         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11561         if test "$cf_cv_shlib_version" = rel; then
11562                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11563         else
11564                 cf_cv_shared_soname='`basename $@`'
11565         fi
11566
11567                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11568                 ;;
11569         (netbsd*)
11570                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11571                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11572                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11573                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11574                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11575                         if test "$cf_cv_shlib_version" = auto; then
11576                         if test -f /usr/libexec/ld.elf_so; then
11577                                 cf_cv_shlib_version=abi
11578                         else
11579                                 cf_cv_shlib_version=rel
11580                         fi
11581                         fi
11582
11583         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11584         if test "$cf_cv_shlib_version" = rel; then
11585                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11586         else
11587                 cf_cv_shared_soname='`basename $@`'
11588         fi
11589
11590                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11591                 else
11592                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11593                 fi
11594                 ;;
11595         (osf*|mls+*)
11596                 # tested with OSF/1 V3.2 and 'cc'
11597                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11598                 # link with shared libs).
11599                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11600                 case $host_os in
11601                 (osf4*)
11602                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11603                         ;;
11604                 esac
11605                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11606                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11607                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11608                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11609                 fi
11610                 cf_cv_rm_so_locs=yes
11611                 ;;
11612         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11613                 # tested with osr5.0.5
11614                 if test "$GCC" != yes; then
11615                         CC_SHARED_OPTS='-belf -KPIC'
11616                 fi
11617                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11618                 if test "$cf_cv_enable_rpath" = yes ; then
11619                         # only way is to set LD_RUN_PATH but no switch for it
11620                         RUN_PATH=$libdir
11621                 fi
11622                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11623                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11624                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11625                 ;;
11626         (sunos4*)
11627                 # tested with SunOS 4.1.1 and gcc 2.7.0
11628                 if test "$GCC" != yes; then
11629                         CC_SHARED_OPTS='-KPIC'
11630                 fi
11631                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11632                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11633                 ;;
11634         (solaris2*)
11635                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11636                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11637                 if test "$DFT_LWR_MODEL" = "shared" ; then
11638                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11639                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11640                 fi
11641                 if test "$cf_cv_enable_rpath" = yes ; then
11642                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11643                 fi
11644
11645         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11646         if test "$cf_cv_shlib_version" = rel; then
11647                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11648         else
11649                 cf_cv_shared_soname='`basename $@`'
11650         fi
11651
11652                 if test "$GCC" != yes; then
11653                         cf_save_CFLAGS="$CFLAGS"
11654                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11655                         do
11656                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11657                                 cat >conftest.$ac_ext <<_ACEOF
11658 #line 11658 "configure"
11659 #include "confdefs.h"
11660 #include <stdio.h>
11661 int
11662 main (void)
11663 {
11664 printf("Hello\n");
11665   ;
11666   return 0;
11667 }
11668 _ACEOF
11669 rm -f conftest.$ac_objext
11670 if { (eval echo "$as_me:11670: \"$ac_compile\"") >&5
11671   (eval $ac_compile) 2>&5
11672   ac_status=$?
11673   echo "$as_me:11673: \$? = $ac_status" >&5
11674   (exit $ac_status); } &&
11675          { ac_try='test -s conftest.$ac_objext'
11676   { (eval echo "$as_me:11676: \"$ac_try\"") >&5
11677   (eval $ac_try) 2>&5
11678   ac_status=$?
11679   echo "$as_me:11679: \$? = $ac_status" >&5
11680   (exit $ac_status); }; }; then
11681   break
11682 else
11683   echo "$as_me: failed program was:" >&5
11684 cat conftest.$ac_ext >&5
11685 fi
11686 rm -f conftest.$ac_objext conftest.$ac_ext
11687                         done
11688                         CFLAGS="$cf_save_CFLAGS"
11689                         CC_SHARED_OPTS=$cf_shared_opts
11690                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11691                 else
11692                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11693                 fi
11694                 ;;
11695         (sysv5uw7*|unix_sv*)
11696                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11697                 if test "$GCC" != yes; then
11698                         CC_SHARED_OPTS='-KPIC'
11699                 fi
11700                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11701                 ;;
11702         (*)
11703                 CC_SHARED_OPTS='unknown'
11704                 MK_SHARED_LIB='echo unknown'
11705                 ;;
11706         esac
11707
11708         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11709         case "$cf_cv_shlib_version" in
11710         (rel|abi)
11711                 case "$MK_SHARED_LIB" in
11712                 (*'-o $@')
11713                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11714                         ;;
11715                 (*)
11716                         { echo "$as_me:11716: WARNING: ignored --with-shlib-version" >&5
11717 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11718                         ;;
11719                 esac
11720                 ;;
11721         esac
11722
11723         if test -n "$cf_try_cflags"
11724         then
11725 cat > conftest.$ac_ext <<EOF
11726 #line 11726 "${as_me:-configure}"
11727 #include <stdio.h>
11728 int main(int argc, char *argv[])
11729 {
11730         printf("hello\n");
11731         return (argv[argc-1] == 0) ;
11732 }
11733 EOF
11734                 cf_save_CFLAGS="$CFLAGS"
11735                 for cf_opt in $cf_try_cflags
11736                 do
11737                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11738                         echo "$as_me:11738: checking if CFLAGS option -$cf_opt works" >&5
11739 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11740                         if { (eval echo "$as_me:11740: \"$ac_compile\"") >&5
11741   (eval $ac_compile) 2>&5
11742   ac_status=$?
11743   echo "$as_me:11743: \$? = $ac_status" >&5
11744   (exit $ac_status); }; then
11745                                 echo "$as_me:11745: result: yes" >&5
11746 echo "${ECHO_T}yes" >&6
11747                                 cf_save_CFLAGS="$CFLAGS"
11748                         else
11749                                 echo "$as_me:11749: result: no" >&5
11750 echo "${ECHO_T}no" >&6
11751                         fi
11752                 done
11753                 CFLAGS="$cf_save_CFLAGS"
11754         fi
11755
11756         # RPATH_LIST is a colon-separated list of directories
11757         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11758         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11759
11760         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11761
11762         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11763
11764 echo "${as_me:-configure}:11764: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11765
11766         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11767
11768 echo "${as_me:-configure}:11768: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11769
11770 # The test/sample programs in the original tree link using rpath option.
11771 # Make it optional for packagers.
11772 if test -n "$LOCAL_LDFLAGS"
11773 then
11774         echo "$as_me:11774: checking if you want to link sample programs with rpath option" >&5
11775 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11776
11777 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11778 if test "${enable_rpath_link+set}" = set; then
11779   enableval="$enable_rpath_link"
11780   with_rpath_link=$enableval
11781 else
11782   with_rpath_link=yes
11783 fi;
11784         echo "$as_me:11784: result: $with_rpath_link" >&5
11785 echo "${ECHO_T}$with_rpath_link" >&6
11786         if test "$with_rpath_link" = no
11787         then
11788                 LOCAL_LDFLAGS=
11789                 LOCAL_LDFLAGS2=
11790         fi
11791 fi
11792
11793 ###############################################################################
11794
11795 ###   use option --enable-broken-linker to force on use of broken-linker support
11796
11797 echo "$as_me:11797: checking if you want broken-linker support code" >&5
11798 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11799
11800 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11801 if test "${enable_broken_linker+set}" = set; then
11802   enableval="$enable_broken_linker"
11803   with_broken_linker=$enableval
11804 else
11805   with_broken_linker=no
11806 fi;
11807 echo "$as_me:11807: result: $with_broken_linker" >&5
11808 echo "${ECHO_T}$with_broken_linker" >&6
11809
11810 : ${BROKEN_LINKER:=0}
11811 if test "x$with_broken_linker" = xyes ; then
11812
11813 cat >>confdefs.h <<\EOF
11814 #define BROKEN_LINKER 1
11815 EOF
11816
11817         BROKEN_LINKER=1
11818 fi
11819
11820 # Check to define _XOPEN_SOURCE "automatically"
11821
11822 echo "$as_me:11822: checking if the POSIX test-macros are already defined" >&5
11823 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11824 if test "${cf_cv_posix_visible+set}" = set; then
11825   echo $ECHO_N "(cached) $ECHO_C" >&6
11826 else
11827
11828 cat >conftest.$ac_ext <<_ACEOF
11829 #line 11829 "configure"
11830 #include "confdefs.h"
11831 #include <stdio.h>
11832 int
11833 main (void)
11834 {
11835
11836 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
11837         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
11838         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
11839         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
11840 #error conflicting symbols found
11841 #endif
11842
11843   ;
11844   return 0;
11845 }
11846 _ACEOF
11847 rm -f conftest.$ac_objext
11848 if { (eval echo "$as_me:11848: \"$ac_compile\"") >&5
11849   (eval $ac_compile) 2>&5
11850   ac_status=$?
11851   echo "$as_me:11851: \$? = $ac_status" >&5
11852   (exit $ac_status); } &&
11853          { ac_try='test -s conftest.$ac_objext'
11854   { (eval echo "$as_me:11854: \"$ac_try\"") >&5
11855   (eval $ac_try) 2>&5
11856   ac_status=$?
11857   echo "$as_me:11857: \$? = $ac_status" >&5
11858   (exit $ac_status); }; }; then
11859   cf_cv_posix_visible=no
11860 else
11861   echo "$as_me: failed program was:" >&5
11862 cat conftest.$ac_ext >&5
11863 cf_cv_posix_visible=yes
11864 fi
11865 rm -f conftest.$ac_objext conftest.$ac_ext
11866
11867 fi
11868 echo "$as_me:11868: result: $cf_cv_posix_visible" >&5
11869 echo "${ECHO_T}$cf_cv_posix_visible" >&6
11870
11871 if test "$cf_cv_posix_visible" = no; then
11872
11873 cf_XOPEN_SOURCE=600
11874 cf_POSIX_C_SOURCE=199506L
11875 cf_xopen_source=
11876
11877 case $host_os in
11878 (aix[4-7]*)
11879         cf_xopen_source="-D_ALL_SOURCE"
11880         ;;
11881 (msys)
11882         cf_XOPEN_SOURCE=600
11883         ;;
11884 (darwin[0-8].*)
11885         cf_xopen_source="-D_APPLE_C_SOURCE"
11886         ;;
11887 (darwin*)
11888         cf_xopen_source="-D_DARWIN_C_SOURCE"
11889         cf_XOPEN_SOURCE=
11890         ;;
11891 (freebsd*|dragonfly*|midnightbsd*)
11892         # 5.x headers associate
11893         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
11894         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
11895         cf_POSIX_C_SOURCE=200112L
11896         cf_XOPEN_SOURCE=600
11897         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11898         ;;
11899 (hpux11*)
11900         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
11901         ;;
11902 (hpux*)
11903         cf_xopen_source="-D_HPUX_SOURCE"
11904         ;;
11905 (irix[56].*)
11906         cf_xopen_source="-D_SGI_SOURCE"
11907         cf_XOPEN_SOURCE=
11908         ;;
11909 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
11910
11911 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
11912
11913 echo "$as_me:11913: checking if this is the GNU C library" >&5
11914 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
11915 if test "${cf_cv_gnu_library+set}" = set; then
11916   echo $ECHO_N "(cached) $ECHO_C" >&6
11917 else
11918
11919 cat >conftest.$ac_ext <<_ACEOF
11920 #line 11920 "configure"
11921 #include "confdefs.h"
11922 #include <sys/types.h>
11923 int
11924 main (void)
11925 {
11926
11927         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
11928                 return 0;
11929         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
11930                 return 0;
11931         #else
11932         #       error not GNU C library
11933         #endif
11934   ;
11935   return 0;
11936 }
11937 _ACEOF
11938 rm -f conftest.$ac_objext
11939 if { (eval echo "$as_me:11939: \"$ac_compile\"") >&5
11940   (eval $ac_compile) 2>&5
11941   ac_status=$?
11942   echo "$as_me:11942: \$? = $ac_status" >&5
11943   (exit $ac_status); } &&
11944          { ac_try='test -s conftest.$ac_objext'
11945   { (eval echo "$as_me:11945: \"$ac_try\"") >&5
11946   (eval $ac_try) 2>&5
11947   ac_status=$?
11948   echo "$as_me:11948: \$? = $ac_status" >&5
11949   (exit $ac_status); }; }; then
11950   cf_cv_gnu_library=yes
11951 else
11952   echo "$as_me: failed program was:" >&5
11953 cat conftest.$ac_ext >&5
11954 cf_cv_gnu_library=no
11955 fi
11956 rm -f conftest.$ac_objext conftest.$ac_ext
11957
11958 fi
11959 echo "$as_me:11959: result: $cf_cv_gnu_library" >&5
11960 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11961
11962 if test x$cf_cv_gnu_library = xyes; then
11963
11964         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11965         # was changed to help a little.  newlib incorporated the change about 4
11966         # years later.
11967         echo "$as_me:11967: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11968 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11969 if test "${cf_cv_gnu_library_219+set}" = set; then
11970   echo $ECHO_N "(cached) $ECHO_C" >&6
11971 else
11972
11973                 cf_save="$CPPFLAGS"
11974
11975         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11976         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11977
11978                 cat >conftest.$ac_ext <<_ACEOF
11979 #line 11979 "configure"
11980 #include "confdefs.h"
11981 #include <sys/types.h>
11982 int
11983 main (void)
11984 {
11985
11986                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11987                                 return 0;
11988                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
11989                                 return 0;
11990                         #else
11991                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11992                         #endif
11993   ;
11994   return 0;
11995 }
11996 _ACEOF
11997 rm -f conftest.$ac_objext
11998 if { (eval echo "$as_me:11998: \"$ac_compile\"") >&5
11999   (eval $ac_compile) 2>&5
12000   ac_status=$?
12001   echo "$as_me:12001: \$? = $ac_status" >&5
12002   (exit $ac_status); } &&
12003          { ac_try='test -s conftest.$ac_objext'
12004   { (eval echo "$as_me:12004: \"$ac_try\"") >&5
12005   (eval $ac_try) 2>&5
12006   ac_status=$?
12007   echo "$as_me:12007: \$? = $ac_status" >&5
12008   (exit $ac_status); }; }; then
12009   cf_cv_gnu_library_219=yes
12010 else
12011   echo "$as_me: failed program was:" >&5
12012 cat conftest.$ac_ext >&5
12013 cf_cv_gnu_library_219=no
12014 fi
12015 rm -f conftest.$ac_objext conftest.$ac_ext
12016                 CPPFLAGS="$cf_save"
12017
12018 fi
12019 echo "$as_me:12019: result: $cf_cv_gnu_library_219" >&5
12020 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12021
12022         if test "x$cf_cv_gnu_library_219" = xyes; then
12023                 cf_save="$CPPFLAGS"
12024                 echo "$as_me:12024: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12025 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12026 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12027   echo $ECHO_N "(cached) $ECHO_C" >&6
12028 else
12029
12030 cf_fix_cppflags=no
12031 cf_new_cflags=
12032 cf_new_cppflags=
12033 cf_new_extra_cppflags=
12034
12035 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12036 do
12037 case $cf_fix_cppflags in
12038 (no)
12039         case $cf_add_cflags in
12040         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12041                 case $cf_add_cflags in
12042                 (-D*)
12043                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12044
12045                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12046                                 && test -z "${cf_tst_cflags}" \
12047                                 && cf_fix_cppflags=yes
12048
12049                         if test $cf_fix_cppflags = yes ; then
12050
12051         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12052         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12053
12054                                 continue
12055                         elif test "${cf_tst_cflags}" = "\"'" ; then
12056
12057         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12058         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12059
12060                                 continue
12061                         fi
12062                         ;;
12063                 esac
12064                 case "$CPPFLAGS" in
12065                 (*$cf_add_cflags)
12066                         ;;
12067                 (*)
12068                         case $cf_add_cflags in
12069                         (-D*)
12070                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12071
12072 CPPFLAGS=`echo "$CPPFLAGS" | \
12073         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12074                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12075
12076                                 ;;
12077                         esac
12078
12079         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12080         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12081
12082                         ;;
12083                 esac
12084                 ;;
12085         (*)
12086
12087         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12088         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12089
12090                 ;;
12091         esac
12092         ;;
12093 (yes)
12094
12095         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12096         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12097
12098         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12099
12100         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12101                 && test -z "${cf_tst_cflags}" \
12102                 && cf_fix_cppflags=no
12103         ;;
12104 esac
12105 done
12106
12107 if test -n "$cf_new_cflags" ; then
12108
12109         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12110         CFLAGS="${CFLAGS}$cf_new_cflags"
12111
12112 fi
12113
12114 if test -n "$cf_new_cppflags" ; then
12115
12116         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12117         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12118
12119 fi
12120
12121 if test -n "$cf_new_extra_cppflags" ; then
12122
12123         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12124         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12125
12126 fi
12127
12128                         cat >conftest.$ac_ext <<_ACEOF
12129 #line 12129 "configure"
12130 #include "confdefs.h"
12131
12132                                 #include <limits.h>
12133                                 #include <sys/types.h>
12134
12135 int
12136 main (void)
12137 {
12138
12139                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12140                                         return 0;
12141                                 #else
12142                                 #       error GNU C library is too old
12143                                 #endif
12144   ;
12145   return 0;
12146 }
12147 _ACEOF
12148 rm -f conftest.$ac_objext
12149 if { (eval echo "$as_me:12149: \"$ac_compile\"") >&5
12150   (eval $ac_compile) 2>&5
12151   ac_status=$?
12152   echo "$as_me:12152: \$? = $ac_status" >&5
12153   (exit $ac_status); } &&
12154          { ac_try='test -s conftest.$ac_objext'
12155   { (eval echo "$as_me:12155: \"$ac_try\"") >&5
12156   (eval $ac_try) 2>&5
12157   ac_status=$?
12158   echo "$as_me:12158: \$? = $ac_status" >&5
12159   (exit $ac_status); }; }; then
12160   cf_cv_gnu_dftsrc_219=yes
12161 else
12162   echo "$as_me: failed program was:" >&5
12163 cat conftest.$ac_ext >&5
12164 cf_cv_gnu_dftsrc_219=no
12165 fi
12166 rm -f conftest.$ac_objext conftest.$ac_ext
12167
12168 fi
12169 echo "$as_me:12169: result: $cf_cv_gnu_dftsrc_219" >&5
12170 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12171                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12172         else
12173                 cf_cv_gnu_dftsrc_219=maybe
12174         fi
12175
12176         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12177
12178                 echo "$as_me:12178: checking if we must define _GNU_SOURCE" >&5
12179 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12180 if test "${cf_cv_gnu_source+set}" = set; then
12181   echo $ECHO_N "(cached) $ECHO_C" >&6
12182 else
12183
12184                 cat >conftest.$ac_ext <<_ACEOF
12185 #line 12185 "configure"
12186 #include "confdefs.h"
12187 #include <sys/types.h>
12188 int
12189 main (void)
12190 {
12191
12192                         #ifndef _XOPEN_SOURCE
12193                         #error  expected _XOPEN_SOURCE to be defined
12194                         #endif
12195   ;
12196   return 0;
12197 }
12198 _ACEOF
12199 rm -f conftest.$ac_objext
12200 if { (eval echo "$as_me:12200: \"$ac_compile\"") >&5
12201   (eval $ac_compile) 2>&5
12202   ac_status=$?
12203   echo "$as_me:12203: \$? = $ac_status" >&5
12204   (exit $ac_status); } &&
12205          { ac_try='test -s conftest.$ac_objext'
12206   { (eval echo "$as_me:12206: \"$ac_try\"") >&5
12207   (eval $ac_try) 2>&5
12208   ac_status=$?
12209   echo "$as_me:12209: \$? = $ac_status" >&5
12210   (exit $ac_status); }; }; then
12211   cf_cv_gnu_source=no
12212 else
12213   echo "$as_me: failed program was:" >&5
12214 cat conftest.$ac_ext >&5
12215 cf_save="$CPPFLAGS"
12216
12217 cf_fix_cppflags=no
12218 cf_new_cflags=
12219 cf_new_cppflags=
12220 cf_new_extra_cppflags=
12221
12222 for cf_add_cflags in -D_GNU_SOURCE
12223 do
12224 case $cf_fix_cppflags in
12225 (no)
12226         case $cf_add_cflags in
12227         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12228                 case $cf_add_cflags in
12229                 (-D*)
12230                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12231
12232                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12233                                 && test -z "${cf_tst_cflags}" \
12234                                 && cf_fix_cppflags=yes
12235
12236                         if test $cf_fix_cppflags = yes ; then
12237
12238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12240
12241                                 continue
12242                         elif test "${cf_tst_cflags}" = "\"'" ; then
12243
12244         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12245         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12246
12247                                 continue
12248                         fi
12249                         ;;
12250                 esac
12251                 case "$CPPFLAGS" in
12252                 (*$cf_add_cflags)
12253                         ;;
12254                 (*)
12255                         case $cf_add_cflags in
12256                         (-D*)
12257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12258
12259 CPPFLAGS=`echo "$CPPFLAGS" | \
12260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12262
12263                                 ;;
12264                         esac
12265
12266         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12267         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12268
12269                         ;;
12270                 esac
12271                 ;;
12272         (*)
12273
12274         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12275         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12276
12277                 ;;
12278         esac
12279         ;;
12280 (yes)
12281
12282         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12283         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12284
12285         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12286
12287         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12288                 && test -z "${cf_tst_cflags}" \
12289                 && cf_fix_cppflags=no
12290         ;;
12291 esac
12292 done
12293
12294 if test -n "$cf_new_cflags" ; then
12295
12296         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12297         CFLAGS="${CFLAGS}$cf_new_cflags"
12298
12299 fi
12300
12301 if test -n "$cf_new_cppflags" ; then
12302
12303         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12304         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12305
12306 fi
12307
12308 if test -n "$cf_new_extra_cppflags" ; then
12309
12310         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12311         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12312
12313 fi
12314
12315                          cat >conftest.$ac_ext <<_ACEOF
12316 #line 12316 "configure"
12317 #include "confdefs.h"
12318 #include <sys/types.h>
12319 int
12320 main (void)
12321 {
12322
12323                                 #ifdef _XOPEN_SOURCE
12324                                 #error  expected _XOPEN_SOURCE to be undefined
12325                                 #endif
12326   ;
12327   return 0;
12328 }
12329 _ACEOF
12330 rm -f conftest.$ac_objext
12331 if { (eval echo "$as_me:12331: \"$ac_compile\"") >&5
12332   (eval $ac_compile) 2>&5
12333   ac_status=$?
12334   echo "$as_me:12334: \$? = $ac_status" >&5
12335   (exit $ac_status); } &&
12336          { ac_try='test -s conftest.$ac_objext'
12337   { (eval echo "$as_me:12337: \"$ac_try\"") >&5
12338   (eval $ac_try) 2>&5
12339   ac_status=$?
12340   echo "$as_me:12340: \$? = $ac_status" >&5
12341   (exit $ac_status); }; }; then
12342   cf_cv_gnu_source=no
12343 else
12344   echo "$as_me: failed program was:" >&5
12345 cat conftest.$ac_ext >&5
12346 cf_cv_gnu_source=yes
12347 fi
12348 rm -f conftest.$ac_objext conftest.$ac_ext
12349                         CPPFLAGS="$cf_save"
12350
12351 fi
12352 rm -f conftest.$ac_objext conftest.$ac_ext
12353
12354 fi
12355 echo "$as_me:12355: result: $cf_cv_gnu_source" >&5
12356 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12357
12358                 if test "$cf_cv_gnu_source" = yes
12359                 then
12360                 echo "$as_me:12360: checking if we should also define _DEFAULT_SOURCE" >&5
12361 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12362 if test "${cf_cv_default_source+set}" = set; then
12363   echo $ECHO_N "(cached) $ECHO_C" >&6
12364 else
12365
12366         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12367         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12368
12369                         cat >conftest.$ac_ext <<_ACEOF
12370 #line 12370 "configure"
12371 #include "confdefs.h"
12372 #include <sys/types.h>
12373 int
12374 main (void)
12375 {
12376
12377                                 #ifdef _DEFAULT_SOURCE
12378                                 #error  expected _DEFAULT_SOURCE to be undefined
12379                                 #endif
12380   ;
12381   return 0;
12382 }
12383 _ACEOF
12384 rm -f conftest.$ac_objext
12385 if { (eval echo "$as_me:12385: \"$ac_compile\"") >&5
12386   (eval $ac_compile) 2>&5
12387   ac_status=$?
12388   echo "$as_me:12388: \$? = $ac_status" >&5
12389   (exit $ac_status); } &&
12390          { ac_try='test -s conftest.$ac_objext'
12391   { (eval echo "$as_me:12391: \"$ac_try\"") >&5
12392   (eval $ac_try) 2>&5
12393   ac_status=$?
12394   echo "$as_me:12394: \$? = $ac_status" >&5
12395   (exit $ac_status); }; }; then
12396   cf_cv_default_source=no
12397 else
12398   echo "$as_me: failed program was:" >&5
12399 cat conftest.$ac_ext >&5
12400 cf_cv_default_source=yes
12401 fi
12402 rm -f conftest.$ac_objext conftest.$ac_ext
12403
12404 fi
12405 echo "$as_me:12405: result: $cf_cv_default_source" >&5
12406 echo "${ECHO_T}$cf_cv_default_source" >&6
12407                         if test "$cf_cv_default_source" = yes
12408                         then
12409
12410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12411         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12412
12413                         fi
12414                 fi
12415         fi
12416
12417 fi
12418
12419         ;;
12420 (minix*)
12421         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12422         ;;
12423 (mirbsd*)
12424         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12425         cf_XOPEN_SOURCE=
12426
12427 if test "$cf_cv_posix_visible" = no; then
12428
12429 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12430
12431 cf_save_CFLAGS="$CFLAGS"
12432 cf_save_CPPFLAGS="$CPPFLAGS"
12433
12434 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12435         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12436                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12437
12438 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12439         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12440                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12441
12442 echo "$as_me:12442: checking if we should define _POSIX_C_SOURCE" >&5
12443 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12444 if test "${cf_cv_posix_c_source+set}" = set; then
12445   echo $ECHO_N "(cached) $ECHO_C" >&6
12446 else
12447
12448 echo "${as_me:-configure}:12448: testing if the symbol is already defined go no further ..." 1>&5
12449
12450         cat >conftest.$ac_ext <<_ACEOF
12451 #line 12451 "configure"
12452 #include "confdefs.h"
12453 #include <sys/types.h>
12454 int
12455 main (void)
12456 {
12457
12458 #ifndef _POSIX_C_SOURCE
12459 make an error
12460 #endif
12461   ;
12462   return 0;
12463 }
12464 _ACEOF
12465 rm -f conftest.$ac_objext
12466 if { (eval echo "$as_me:12466: \"$ac_compile\"") >&5
12467   (eval $ac_compile) 2>&5
12468   ac_status=$?
12469   echo "$as_me:12469: \$? = $ac_status" >&5
12470   (exit $ac_status); } &&
12471          { ac_try='test -s conftest.$ac_objext'
12472   { (eval echo "$as_me:12472: \"$ac_try\"") >&5
12473   (eval $ac_try) 2>&5
12474   ac_status=$?
12475   echo "$as_me:12475: \$? = $ac_status" >&5
12476   (exit $ac_status); }; }; then
12477   cf_cv_posix_c_source=no
12478 else
12479   echo "$as_me: failed program was:" >&5
12480 cat conftest.$ac_ext >&5
12481 cf_want_posix_source=no
12482          case .$cf_POSIX_C_SOURCE in
12483          (.[12]??*)
12484                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12485                 ;;
12486          (.2)
12487                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12488                 cf_want_posix_source=yes
12489                 ;;
12490          (.*)
12491                 cf_want_posix_source=yes
12492                 ;;
12493          esac
12494          if test "$cf_want_posix_source" = yes ; then
12495                 cat >conftest.$ac_ext <<_ACEOF
12496 #line 12496 "configure"
12497 #include "confdefs.h"
12498 #include <sys/types.h>
12499 int
12500 main (void)
12501 {
12502
12503 #ifdef _POSIX_SOURCE
12504 make an error
12505 #endif
12506   ;
12507   return 0;
12508 }
12509 _ACEOF
12510 rm -f conftest.$ac_objext
12511 if { (eval echo "$as_me:12511: \"$ac_compile\"") >&5
12512   (eval $ac_compile) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit $ac_status); } &&
12516          { ac_try='test -s conftest.$ac_objext'
12517   { (eval echo "$as_me:12517: \"$ac_try\"") >&5
12518   (eval $ac_try) 2>&5
12519   ac_status=$?
12520   echo "$as_me:12520: \$? = $ac_status" >&5
12521   (exit $ac_status); }; }; then
12522   :
12523 else
12524   echo "$as_me: failed program was:" >&5
12525 cat conftest.$ac_ext >&5
12526 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12527 fi
12528 rm -f conftest.$ac_objext conftest.$ac_ext
12529          fi
12530
12531 echo "${as_me:-configure}:12531: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12532
12533          CFLAGS="$cf_trim_CFLAGS"
12534          CPPFLAGS="$cf_trim_CPPFLAGS"
12535
12536         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12537         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12538
12539 echo "${as_me:-configure}:12539: testing if the second compile does not leave our definition intact error ..." 1>&5
12540
12541          cat >conftest.$ac_ext <<_ACEOF
12542 #line 12542 "configure"
12543 #include "confdefs.h"
12544 #include <sys/types.h>
12545 int
12546 main (void)
12547 {
12548
12549 #ifndef _POSIX_C_SOURCE
12550 make an error
12551 #endif
12552   ;
12553   return 0;
12554 }
12555 _ACEOF
12556 rm -f conftest.$ac_objext
12557 if { (eval echo "$as_me:12557: \"$ac_compile\"") >&5
12558   (eval $ac_compile) 2>&5
12559   ac_status=$?
12560   echo "$as_me:12560: \$? = $ac_status" >&5
12561   (exit $ac_status); } &&
12562          { ac_try='test -s conftest.$ac_objext'
12563   { (eval echo "$as_me:12563: \"$ac_try\"") >&5
12564   (eval $ac_try) 2>&5
12565   ac_status=$?
12566   echo "$as_me:12566: \$? = $ac_status" >&5
12567   (exit $ac_status); }; }; then
12568   :
12569 else
12570   echo "$as_me: failed program was:" >&5
12571 cat conftest.$ac_ext >&5
12572 cf_cv_posix_c_source=no
12573 fi
12574 rm -f conftest.$ac_objext conftest.$ac_ext
12575          CFLAGS="$cf_save_CFLAGS"
12576          CPPFLAGS="$cf_save_CPPFLAGS"
12577
12578 fi
12579 rm -f conftest.$ac_objext conftest.$ac_ext
12580
12581 fi
12582 echo "$as_me:12582: result: $cf_cv_posix_c_source" >&5
12583 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12584
12585 if test "$cf_cv_posix_c_source" != no ; then
12586         CFLAGS="$cf_trim_CFLAGS"
12587         CPPFLAGS="$cf_trim_CPPFLAGS"
12588
12589 cf_fix_cppflags=no
12590 cf_new_cflags=
12591 cf_new_cppflags=
12592 cf_new_extra_cppflags=
12593
12594 for cf_add_cflags in $cf_cv_posix_c_source
12595 do
12596 case $cf_fix_cppflags in
12597 (no)
12598         case $cf_add_cflags in
12599         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12600                 case $cf_add_cflags in
12601                 (-D*)
12602                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12603
12604                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12605                                 && test -z "${cf_tst_cflags}" \
12606                                 && cf_fix_cppflags=yes
12607
12608                         if test $cf_fix_cppflags = yes ; then
12609
12610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12612
12613                                 continue
12614                         elif test "${cf_tst_cflags}" = "\"'" ; then
12615
12616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12618
12619                                 continue
12620                         fi
12621                         ;;
12622                 esac
12623                 case "$CPPFLAGS" in
12624                 (*$cf_add_cflags)
12625                         ;;
12626                 (*)
12627                         case $cf_add_cflags in
12628                         (-D*)
12629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12630
12631 CPPFLAGS=`echo "$CPPFLAGS" | \
12632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12634
12635                                 ;;
12636                         esac
12637
12638         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12639         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12640
12641                         ;;
12642                 esac
12643                 ;;
12644         (*)
12645
12646         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12647         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12648
12649                 ;;
12650         esac
12651         ;;
12652 (yes)
12653
12654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12656
12657         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12658
12659         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12660                 && test -z "${cf_tst_cflags}" \
12661                 && cf_fix_cppflags=no
12662         ;;
12663 esac
12664 done
12665
12666 if test -n "$cf_new_cflags" ; then
12667
12668         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12669         CFLAGS="${CFLAGS}$cf_new_cflags"
12670
12671 fi
12672
12673 if test -n "$cf_new_cppflags" ; then
12674
12675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12676         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12677
12678 fi
12679
12680 if test -n "$cf_new_extra_cppflags" ; then
12681
12682         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12683         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12684
12685 fi
12686
12687 fi
12688
12689 fi # cf_cv_posix_visible
12690
12691         ;;
12692 (netbsd*)
12693         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12694         ;;
12695 (openbsd[4-9]*)
12696         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12697         cf_xopen_source="-D_BSD_SOURCE"
12698         cf_XOPEN_SOURCE=600
12699         ;;
12700 (openbsd*)
12701         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12702         ;;
12703 (osf[45]*)
12704         cf_xopen_source="-D_OSF_SOURCE"
12705         ;;
12706 (nto-qnx*)
12707         cf_xopen_source="-D_QNX_SOURCE"
12708         ;;
12709 (sco*)
12710         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12711         ;;
12712 (solaris2.*)
12713         cf_xopen_source="-D__EXTENSIONS__"
12714         cf_cv_xopen_source=broken
12715         ;;
12716 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12717         cf_XOPEN_SOURCE=
12718         cf_POSIX_C_SOURCE=
12719         ;;
12720 (*)
12721
12722 echo "$as_me:12722: checking if we should define _XOPEN_SOURCE" >&5
12723 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12724 if test "${cf_cv_xopen_source+set}" = set; then
12725   echo $ECHO_N "(cached) $ECHO_C" >&6
12726 else
12727
12728         cat >conftest.$ac_ext <<_ACEOF
12729 #line 12729 "configure"
12730 #include "confdefs.h"
12731
12732 #include <stdlib.h>
12733 #include <string.h>
12734 #include <sys/types.h>
12735
12736 int
12737 main (void)
12738 {
12739
12740 #ifndef _XOPEN_SOURCE
12741 make an error
12742 #endif
12743   ;
12744   return 0;
12745 }
12746 _ACEOF
12747 rm -f conftest.$ac_objext
12748 if { (eval echo "$as_me:12748: \"$ac_compile\"") >&5
12749   (eval $ac_compile) 2>&5
12750   ac_status=$?
12751   echo "$as_me:12751: \$? = $ac_status" >&5
12752   (exit $ac_status); } &&
12753          { ac_try='test -s conftest.$ac_objext'
12754   { (eval echo "$as_me:12754: \"$ac_try\"") >&5
12755   (eval $ac_try) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit $ac_status); }; }; then
12759   cf_cv_xopen_source=no
12760 else
12761   echo "$as_me: failed program was:" >&5
12762 cat conftest.$ac_ext >&5
12763 cf_save="$CPPFLAGS"
12764
12765         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12766         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12767
12768          cat >conftest.$ac_ext <<_ACEOF
12769 #line 12769 "configure"
12770 #include "confdefs.h"
12771
12772 #include <stdlib.h>
12773 #include <string.h>
12774 #include <sys/types.h>
12775
12776 int
12777 main (void)
12778 {
12779
12780 #ifdef _XOPEN_SOURCE
12781 make an error
12782 #endif
12783   ;
12784   return 0;
12785 }
12786 _ACEOF
12787 rm -f conftest.$ac_objext
12788 if { (eval echo "$as_me:12788: \"$ac_compile\"") >&5
12789   (eval $ac_compile) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit $ac_status); } &&
12793          { ac_try='test -s conftest.$ac_objext'
12794   { (eval echo "$as_me:12794: \"$ac_try\"") >&5
12795   (eval $ac_try) 2>&5
12796   ac_status=$?
12797   echo "$as_me:12797: \$? = $ac_status" >&5
12798   (exit $ac_status); }; }; then
12799   cf_cv_xopen_source=no
12800 else
12801   echo "$as_me: failed program was:" >&5
12802 cat conftest.$ac_ext >&5
12803 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12804 fi
12805 rm -f conftest.$ac_objext conftest.$ac_ext
12806         CPPFLAGS="$cf_save"
12807
12808 fi
12809 rm -f conftest.$ac_objext conftest.$ac_ext
12810
12811 fi
12812 echo "$as_me:12812: result: $cf_cv_xopen_source" >&5
12813 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12814
12815 if test "$cf_cv_xopen_source" != no ; then
12816
12817 CFLAGS=`echo "$CFLAGS" | \
12818         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12819                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12820
12821 CPPFLAGS=`echo "$CPPFLAGS" | \
12822         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12823                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12824
12825         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12826
12827 cf_fix_cppflags=no
12828 cf_new_cflags=
12829 cf_new_cppflags=
12830 cf_new_extra_cppflags=
12831
12832 for cf_add_cflags in $cf_temp_xopen_source
12833 do
12834 case $cf_fix_cppflags in
12835 (no)
12836         case $cf_add_cflags in
12837         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12838                 case $cf_add_cflags in
12839                 (-D*)
12840                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12841
12842                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12843                                 && test -z "${cf_tst_cflags}" \
12844                                 && cf_fix_cppflags=yes
12845
12846                         if test $cf_fix_cppflags = yes ; then
12847
12848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12850
12851                                 continue
12852                         elif test "${cf_tst_cflags}" = "\"'" ; then
12853
12854         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12855         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12856
12857                                 continue
12858                         fi
12859                         ;;
12860                 esac
12861                 case "$CPPFLAGS" in
12862                 (*$cf_add_cflags)
12863                         ;;
12864                 (*)
12865                         case $cf_add_cflags in
12866                         (-D*)
12867                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12868
12869 CPPFLAGS=`echo "$CPPFLAGS" | \
12870         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12871                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12872
12873                                 ;;
12874                         esac
12875
12876         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12877         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12878
12879                         ;;
12880                 esac
12881                 ;;
12882         (*)
12883
12884         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12885         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12886
12887                 ;;
12888         esac
12889         ;;
12890 (yes)
12891
12892         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12893         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12894
12895         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12896
12897         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12898                 && test -z "${cf_tst_cflags}" \
12899                 && cf_fix_cppflags=no
12900         ;;
12901 esac
12902 done
12903
12904 if test -n "$cf_new_cflags" ; then
12905
12906         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12907         CFLAGS="${CFLAGS}$cf_new_cflags"
12908
12909 fi
12910
12911 if test -n "$cf_new_cppflags" ; then
12912
12913         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12914         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12915
12916 fi
12917
12918 if test -n "$cf_new_extra_cppflags" ; then
12919
12920         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12921         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12922
12923 fi
12924
12925 fi
12926
12927 if test "$cf_cv_posix_visible" = no; then
12928
12929 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12930
12931 cf_save_CFLAGS="$CFLAGS"
12932 cf_save_CPPFLAGS="$CPPFLAGS"
12933
12934 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12935         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12936                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12937
12938 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12939         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12940                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12941
12942 echo "$as_me:12942: checking if we should define _POSIX_C_SOURCE" >&5
12943 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12944 if test "${cf_cv_posix_c_source+set}" = set; then
12945   echo $ECHO_N "(cached) $ECHO_C" >&6
12946 else
12947
12948 echo "${as_me:-configure}:12948: testing if the symbol is already defined go no further ..." 1>&5
12949
12950         cat >conftest.$ac_ext <<_ACEOF
12951 #line 12951 "configure"
12952 #include "confdefs.h"
12953 #include <sys/types.h>
12954 int
12955 main (void)
12956 {
12957
12958 #ifndef _POSIX_C_SOURCE
12959 make an error
12960 #endif
12961   ;
12962   return 0;
12963 }
12964 _ACEOF
12965 rm -f conftest.$ac_objext
12966 if { (eval echo "$as_me:12966: \"$ac_compile\"") >&5
12967   (eval $ac_compile) 2>&5
12968   ac_status=$?
12969   echo "$as_me:12969: \$? = $ac_status" >&5
12970   (exit $ac_status); } &&
12971          { ac_try='test -s conftest.$ac_objext'
12972   { (eval echo "$as_me:12972: \"$ac_try\"") >&5
12973   (eval $ac_try) 2>&5
12974   ac_status=$?
12975   echo "$as_me:12975: \$? = $ac_status" >&5
12976   (exit $ac_status); }; }; then
12977   cf_cv_posix_c_source=no
12978 else
12979   echo "$as_me: failed program was:" >&5
12980 cat conftest.$ac_ext >&5
12981 cf_want_posix_source=no
12982          case .$cf_POSIX_C_SOURCE in
12983          (.[12]??*)
12984                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12985                 ;;
12986          (.2)
12987                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12988                 cf_want_posix_source=yes
12989                 ;;
12990          (.*)
12991                 cf_want_posix_source=yes
12992                 ;;
12993          esac
12994          if test "$cf_want_posix_source" = yes ; then
12995                 cat >conftest.$ac_ext <<_ACEOF
12996 #line 12996 "configure"
12997 #include "confdefs.h"
12998 #include <sys/types.h>
12999 int
13000 main (void)
13001 {
13002
13003 #ifdef _POSIX_SOURCE
13004 make an error
13005 #endif
13006   ;
13007   return 0;
13008 }
13009 _ACEOF
13010 rm -f conftest.$ac_objext
13011 if { (eval echo "$as_me:13011: \"$ac_compile\"") >&5
13012   (eval $ac_compile) 2>&5
13013   ac_status=$?
13014   echo "$as_me:13014: \$? = $ac_status" >&5
13015   (exit $ac_status); } &&
13016          { ac_try='test -s conftest.$ac_objext'
13017   { (eval echo "$as_me:13017: \"$ac_try\"") >&5
13018   (eval $ac_try) 2>&5
13019   ac_status=$?
13020   echo "$as_me:13020: \$? = $ac_status" >&5
13021   (exit $ac_status); }; }; then
13022   :
13023 else
13024   echo "$as_me: failed program was:" >&5
13025 cat conftest.$ac_ext >&5
13026 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13027 fi
13028 rm -f conftest.$ac_objext conftest.$ac_ext
13029          fi
13030
13031 echo "${as_me:-configure}:13031: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13032
13033          CFLAGS="$cf_trim_CFLAGS"
13034          CPPFLAGS="$cf_trim_CPPFLAGS"
13035
13036         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13037         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13038
13039 echo "${as_me:-configure}:13039: testing if the second compile does not leave our definition intact error ..." 1>&5
13040
13041          cat >conftest.$ac_ext <<_ACEOF
13042 #line 13042 "configure"
13043 #include "confdefs.h"
13044 #include <sys/types.h>
13045 int
13046 main (void)
13047 {
13048
13049 #ifndef _POSIX_C_SOURCE
13050 make an error
13051 #endif
13052   ;
13053   return 0;
13054 }
13055 _ACEOF
13056 rm -f conftest.$ac_objext
13057 if { (eval echo "$as_me:13057: \"$ac_compile\"") >&5
13058   (eval $ac_compile) 2>&5
13059   ac_status=$?
13060   echo "$as_me:13060: \$? = $ac_status" >&5
13061   (exit $ac_status); } &&
13062          { ac_try='test -s conftest.$ac_objext'
13063   { (eval echo "$as_me:13063: \"$ac_try\"") >&5
13064   (eval $ac_try) 2>&5
13065   ac_status=$?
13066   echo "$as_me:13066: \$? = $ac_status" >&5
13067   (exit $ac_status); }; }; then
13068   :
13069 else
13070   echo "$as_me: failed program was:" >&5
13071 cat conftest.$ac_ext >&5
13072 cf_cv_posix_c_source=no
13073 fi
13074 rm -f conftest.$ac_objext conftest.$ac_ext
13075          CFLAGS="$cf_save_CFLAGS"
13076          CPPFLAGS="$cf_save_CPPFLAGS"
13077
13078 fi
13079 rm -f conftest.$ac_objext conftest.$ac_ext
13080
13081 fi
13082 echo "$as_me:13082: result: $cf_cv_posix_c_source" >&5
13083 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13084
13085 if test "$cf_cv_posix_c_source" != no ; then
13086         CFLAGS="$cf_trim_CFLAGS"
13087         CPPFLAGS="$cf_trim_CPPFLAGS"
13088
13089 cf_fix_cppflags=no
13090 cf_new_cflags=
13091 cf_new_cppflags=
13092 cf_new_extra_cppflags=
13093
13094 for cf_add_cflags in $cf_cv_posix_c_source
13095 do
13096 case $cf_fix_cppflags in
13097 (no)
13098         case $cf_add_cflags in
13099         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13100                 case $cf_add_cflags in
13101                 (-D*)
13102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13103
13104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13105                                 && test -z "${cf_tst_cflags}" \
13106                                 && cf_fix_cppflags=yes
13107
13108                         if test $cf_fix_cppflags = yes ; then
13109
13110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13112
13113                                 continue
13114                         elif test "${cf_tst_cflags}" = "\"'" ; then
13115
13116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13118
13119                                 continue
13120                         fi
13121                         ;;
13122                 esac
13123                 case "$CPPFLAGS" in
13124                 (*$cf_add_cflags)
13125                         ;;
13126                 (*)
13127                         case $cf_add_cflags in
13128                         (-D*)
13129                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13130
13131 CPPFLAGS=`echo "$CPPFLAGS" | \
13132         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13133                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13134
13135                                 ;;
13136                         esac
13137
13138         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13139         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13140
13141                         ;;
13142                 esac
13143                 ;;
13144         (*)
13145
13146         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13147         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13148
13149                 ;;
13150         esac
13151         ;;
13152 (yes)
13153
13154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13156
13157         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13158
13159         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13160                 && test -z "${cf_tst_cflags}" \
13161                 && cf_fix_cppflags=no
13162         ;;
13163 esac
13164 done
13165
13166 if test -n "$cf_new_cflags" ; then
13167
13168         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13169         CFLAGS="${CFLAGS}$cf_new_cflags"
13170
13171 fi
13172
13173 if test -n "$cf_new_cppflags" ; then
13174
13175         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13176         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13177
13178 fi
13179
13180 if test -n "$cf_new_extra_cppflags" ; then
13181
13182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13184
13185 fi
13186
13187 fi
13188
13189 fi # cf_cv_posix_visible
13190
13191         ;;
13192 esac
13193
13194 if test -n "$cf_xopen_source" ; then
13195
13196 cf_fix_cppflags=no
13197 cf_new_cflags=
13198 cf_new_cppflags=
13199 cf_new_extra_cppflags=
13200
13201 for cf_add_cflags in $cf_xopen_source
13202 do
13203 case $cf_fix_cppflags in
13204 (no)
13205         case $cf_add_cflags in
13206         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13207                 case $cf_add_cflags in
13208                 (-D*)
13209                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13210
13211                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13212                                 && test -z "${cf_tst_cflags}" \
13213                                 && cf_fix_cppflags=yes
13214
13215                         if test $cf_fix_cppflags = yes ; then
13216
13217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13219
13220                                 continue
13221                         elif test "${cf_tst_cflags}" = "\"'" ; then
13222
13223         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13224         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13225
13226                                 continue
13227                         fi
13228                         ;;
13229                 esac
13230                 case "$CPPFLAGS" in
13231                 (*$cf_add_cflags)
13232                         ;;
13233                 (*)
13234                         case $cf_add_cflags in
13235                         (-D*)
13236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13237
13238 CPPFLAGS=`echo "$CPPFLAGS" | \
13239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13241
13242                                 ;;
13243                         esac
13244
13245         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13246         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13247
13248                         ;;
13249                 esac
13250                 ;;
13251         (*)
13252
13253         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13254         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13255
13256                 ;;
13257         esac
13258         ;;
13259 (yes)
13260
13261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13263
13264         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13265
13266         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13267                 && test -z "${cf_tst_cflags}" \
13268                 && cf_fix_cppflags=no
13269         ;;
13270 esac
13271 done
13272
13273 if test -n "$cf_new_cflags" ; then
13274         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13275
13276 echo "${as_me:-configure}:13276: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13277
13278         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13279         CFLAGS="${CFLAGS}$cf_new_cflags"
13280
13281 fi
13282
13283 if test -n "$cf_new_cppflags" ; then
13284         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13285
13286 echo "${as_me:-configure}:13286: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13287
13288         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13289         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13290
13291 fi
13292
13293 if test -n "$cf_new_extra_cppflags" ; then
13294         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13295
13296 echo "${as_me:-configure}:13296: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13297
13298         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13299         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13300
13301 fi
13302
13303 fi
13304
13305 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13306         echo "$as_me:13306: checking if _XOPEN_SOURCE really is set" >&5
13307 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13308         cat >conftest.$ac_ext <<_ACEOF
13309 #line 13309 "configure"
13310 #include "confdefs.h"
13311 #include <stdlib.h>
13312 int
13313 main (void)
13314 {
13315
13316 #ifndef _XOPEN_SOURCE
13317 make an error
13318 #endif
13319   ;
13320   return 0;
13321 }
13322 _ACEOF
13323 rm -f conftest.$ac_objext
13324 if { (eval echo "$as_me:13324: \"$ac_compile\"") >&5
13325   (eval $ac_compile) 2>&5
13326   ac_status=$?
13327   echo "$as_me:13327: \$? = $ac_status" >&5
13328   (exit $ac_status); } &&
13329          { ac_try='test -s conftest.$ac_objext'
13330   { (eval echo "$as_me:13330: \"$ac_try\"") >&5
13331   (eval $ac_try) 2>&5
13332   ac_status=$?
13333   echo "$as_me:13333: \$? = $ac_status" >&5
13334   (exit $ac_status); }; }; then
13335   cf_XOPEN_SOURCE_set=yes
13336 else
13337   echo "$as_me: failed program was:" >&5
13338 cat conftest.$ac_ext >&5
13339 cf_XOPEN_SOURCE_set=no
13340 fi
13341 rm -f conftest.$ac_objext conftest.$ac_ext
13342         echo "$as_me:13342: result: $cf_XOPEN_SOURCE_set" >&5
13343 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13344         if test $cf_XOPEN_SOURCE_set = yes
13345         then
13346                 cat >conftest.$ac_ext <<_ACEOF
13347 #line 13347 "configure"
13348 #include "confdefs.h"
13349 #include <stdlib.h>
13350 int
13351 main (void)
13352 {
13353
13354 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13355 make an error
13356 #endif
13357   ;
13358   return 0;
13359 }
13360 _ACEOF
13361 rm -f conftest.$ac_objext
13362 if { (eval echo "$as_me:13362: \"$ac_compile\"") >&5
13363   (eval $ac_compile) 2>&5
13364   ac_status=$?
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); } &&
13367          { ac_try='test -s conftest.$ac_objext'
13368   { (eval echo "$as_me:13368: \"$ac_try\"") >&5
13369   (eval $ac_try) 2>&5
13370   ac_status=$?
13371   echo "$as_me:13371: \$? = $ac_status" >&5
13372   (exit $ac_status); }; }; then
13373   cf_XOPEN_SOURCE_set_ok=yes
13374 else
13375   echo "$as_me: failed program was:" >&5
13376 cat conftest.$ac_ext >&5
13377 cf_XOPEN_SOURCE_set_ok=no
13378 fi
13379 rm -f conftest.$ac_objext conftest.$ac_ext
13380                 if test $cf_XOPEN_SOURCE_set_ok = no
13381                 then
13382                         { echo "$as_me:13382: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13383 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13384                 fi
13385         else
13386
13387 echo "$as_me:13387: checking if we should define _XOPEN_SOURCE" >&5
13388 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13389 if test "${cf_cv_xopen_source+set}" = set; then
13390   echo $ECHO_N "(cached) $ECHO_C" >&6
13391 else
13392
13393         cat >conftest.$ac_ext <<_ACEOF
13394 #line 13394 "configure"
13395 #include "confdefs.h"
13396
13397 #include <stdlib.h>
13398 #include <string.h>
13399 #include <sys/types.h>
13400
13401 int
13402 main (void)
13403 {
13404
13405 #ifndef _XOPEN_SOURCE
13406 make an error
13407 #endif
13408   ;
13409   return 0;
13410 }
13411 _ACEOF
13412 rm -f conftest.$ac_objext
13413 if { (eval echo "$as_me:13413: \"$ac_compile\"") >&5
13414   (eval $ac_compile) 2>&5
13415   ac_status=$?
13416   echo "$as_me:13416: \$? = $ac_status" >&5
13417   (exit $ac_status); } &&
13418          { ac_try='test -s conftest.$ac_objext'
13419   { (eval echo "$as_me:13419: \"$ac_try\"") >&5
13420   (eval $ac_try) 2>&5
13421   ac_status=$?
13422   echo "$as_me:13422: \$? = $ac_status" >&5
13423   (exit $ac_status); }; }; then
13424   cf_cv_xopen_source=no
13425 else
13426   echo "$as_me: failed program was:" >&5
13427 cat conftest.$ac_ext >&5
13428 cf_save="$CPPFLAGS"
13429
13430         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13431         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13432
13433          cat >conftest.$ac_ext <<_ACEOF
13434 #line 13434 "configure"
13435 #include "confdefs.h"
13436
13437 #include <stdlib.h>
13438 #include <string.h>
13439 #include <sys/types.h>
13440
13441 int
13442 main (void)
13443 {
13444
13445 #ifdef _XOPEN_SOURCE
13446 make an error
13447 #endif
13448   ;
13449   return 0;
13450 }
13451 _ACEOF
13452 rm -f conftest.$ac_objext
13453 if { (eval echo "$as_me:13453: \"$ac_compile\"") >&5
13454   (eval $ac_compile) 2>&5
13455   ac_status=$?
13456   echo "$as_me:13456: \$? = $ac_status" >&5
13457   (exit $ac_status); } &&
13458          { ac_try='test -s conftest.$ac_objext'
13459   { (eval echo "$as_me:13459: \"$ac_try\"") >&5
13460   (eval $ac_try) 2>&5
13461   ac_status=$?
13462   echo "$as_me:13462: \$? = $ac_status" >&5
13463   (exit $ac_status); }; }; then
13464   cf_cv_xopen_source=no
13465 else
13466   echo "$as_me: failed program was:" >&5
13467 cat conftest.$ac_ext >&5
13468 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13469 fi
13470 rm -f conftest.$ac_objext conftest.$ac_ext
13471         CPPFLAGS="$cf_save"
13472
13473 fi
13474 rm -f conftest.$ac_objext conftest.$ac_ext
13475
13476 fi
13477 echo "$as_me:13477: result: $cf_cv_xopen_source" >&5
13478 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13479
13480 if test "$cf_cv_xopen_source" != no ; then
13481
13482 CFLAGS=`echo "$CFLAGS" | \
13483         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13484                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13485
13486 CPPFLAGS=`echo "$CPPFLAGS" | \
13487         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13488                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13489
13490         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13491
13492 cf_fix_cppflags=no
13493 cf_new_cflags=
13494 cf_new_cppflags=
13495 cf_new_extra_cppflags=
13496
13497 for cf_add_cflags in $cf_temp_xopen_source
13498 do
13499 case $cf_fix_cppflags in
13500 (no)
13501         case $cf_add_cflags in
13502         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13503                 case $cf_add_cflags in
13504                 (-D*)
13505                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13506
13507                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13508                                 && test -z "${cf_tst_cflags}" \
13509                                 && cf_fix_cppflags=yes
13510
13511                         if test $cf_fix_cppflags = yes ; then
13512
13513         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13514         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13515
13516                                 continue
13517                         elif test "${cf_tst_cflags}" = "\"'" ; then
13518
13519         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13520         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13521
13522                                 continue
13523                         fi
13524                         ;;
13525                 esac
13526                 case "$CPPFLAGS" in
13527                 (*$cf_add_cflags)
13528                         ;;
13529                 (*)
13530                         case $cf_add_cflags in
13531                         (-D*)
13532                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13533
13534 CPPFLAGS=`echo "$CPPFLAGS" | \
13535         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13536                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13537
13538                                 ;;
13539                         esac
13540
13541         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13542         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13543
13544                         ;;
13545                 esac
13546                 ;;
13547         (*)
13548
13549         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13550         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13551
13552                 ;;
13553         esac
13554         ;;
13555 (yes)
13556
13557         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13558         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13559
13560         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13561
13562         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13563                 && test -z "${cf_tst_cflags}" \
13564                 && cf_fix_cppflags=no
13565         ;;
13566 esac
13567 done
13568
13569 if test -n "$cf_new_cflags" ; then
13570
13571         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13572         CFLAGS="${CFLAGS}$cf_new_cflags"
13573
13574 fi
13575
13576 if test -n "$cf_new_cppflags" ; then
13577
13578         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13579         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13580
13581 fi
13582
13583 if test -n "$cf_new_extra_cppflags" ; then
13584
13585         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13586         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13587
13588 fi
13589
13590 fi
13591
13592         fi
13593 fi
13594 fi # cf_cv_posix_visible
13595
13596 # Check whether --enable-largefile or --disable-largefile was given.
13597 if test "${enable_largefile+set}" = set; then
13598   enableval="$enable_largefile"
13599
13600 fi;
13601 if test "$enable_largefile" != no; then
13602
13603   echo "$as_me:13603: checking for special C compiler options needed for large files" >&5
13604 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13605 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13606   echo $ECHO_N "(cached) $ECHO_C" >&6
13607 else
13608   ac_cv_sys_largefile_CC=no
13609      if test "$GCC" != yes; then
13610        ac_save_CC=$CC
13611        while :; do
13612          # IRIX 6.2 and later do not support large files by default,
13613          # so use the C compiler's -n32 option if that helps.
13614          cat >conftest.$ac_ext <<_ACEOF
13615 #line 13615 "configure"
13616 #include "confdefs.h"
13617 #include <sys/types.h>
13618  /* Check that off_t can represent 2**63 - 1 correctly.
13619     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13620     since some C++ compilers masquerading as C compilers
13621     incorrectly reject 9223372036854775807.  */
13622 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13623   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13624                        && LARGE_OFF_T % 2147483647 == 1)
13625                       ? 1 : -1];
13626 int
13627 main (void)
13628 {
13629
13630   ;
13631   return 0;
13632 }
13633 _ACEOF
13634          rm -f conftest.$ac_objext
13635 if { (eval echo "$as_me:13635: \"$ac_compile\"") >&5
13636   (eval $ac_compile) 2>&5
13637   ac_status=$?
13638   echo "$as_me:13638: \$? = $ac_status" >&5
13639   (exit $ac_status); } &&
13640          { ac_try='test -s conftest.$ac_objext'
13641   { (eval echo "$as_me:13641: \"$ac_try\"") >&5
13642   (eval $ac_try) 2>&5
13643   ac_status=$?
13644   echo "$as_me:13644: \$? = $ac_status" >&5
13645   (exit $ac_status); }; }; then
13646   break
13647 else
13648   echo "$as_me: failed program was:" >&5
13649 cat conftest.$ac_ext >&5
13650 fi
13651 rm -f conftest.$ac_objext
13652          CC="$CC -n32"
13653          rm -f conftest.$ac_objext
13654 if { (eval echo "$as_me:13654: \"$ac_compile\"") >&5
13655   (eval $ac_compile) 2>&5
13656   ac_status=$?
13657   echo "$as_me:13657: \$? = $ac_status" >&5
13658   (exit $ac_status); } &&
13659          { ac_try='test -s conftest.$ac_objext'
13660   { (eval echo "$as_me:13660: \"$ac_try\"") >&5
13661   (eval $ac_try) 2>&5
13662   ac_status=$?
13663   echo "$as_me:13663: \$? = $ac_status" >&5
13664   (exit $ac_status); }; }; then
13665   ac_cv_sys_largefile_CC=' -n32'; break
13666 else
13667   echo "$as_me: failed program was:" >&5
13668 cat conftest.$ac_ext >&5
13669 fi
13670 rm -f conftest.$ac_objext
13671          break
13672        done
13673        CC=$ac_save_CC
13674        rm -f conftest.$ac_ext
13675     fi
13676 fi
13677 echo "$as_me:13677: result: $ac_cv_sys_largefile_CC" >&5
13678 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13679   if test "$ac_cv_sys_largefile_CC" != no; then
13680     CC=$CC$ac_cv_sys_largefile_CC
13681   fi
13682
13683   echo "$as_me:13683: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13684 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13685 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13686   echo $ECHO_N "(cached) $ECHO_C" >&6
13687 else
13688   while :; do
13689   ac_cv_sys_file_offset_bits=no
13690   cat >conftest.$ac_ext <<_ACEOF
13691 #line 13691 "configure"
13692 #include "confdefs.h"
13693 #include <sys/types.h>
13694  /* Check that off_t can represent 2**63 - 1 correctly.
13695     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13696     since some C++ compilers masquerading as C compilers
13697     incorrectly reject 9223372036854775807.  */
13698 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13699   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13700                        && LARGE_OFF_T % 2147483647 == 1)
13701                       ? 1 : -1];
13702 int
13703 main (void)
13704 {
13705
13706   ;
13707   return 0;
13708 }
13709 _ACEOF
13710 rm -f conftest.$ac_objext
13711 if { (eval echo "$as_me:13711: \"$ac_compile\"") >&5
13712   (eval $ac_compile) 2>&5
13713   ac_status=$?
13714   echo "$as_me:13714: \$? = $ac_status" >&5
13715   (exit $ac_status); } &&
13716          { ac_try='test -s conftest.$ac_objext'
13717   { (eval echo "$as_me:13717: \"$ac_try\"") >&5
13718   (eval $ac_try) 2>&5
13719   ac_status=$?
13720   echo "$as_me:13720: \$? = $ac_status" >&5
13721   (exit $ac_status); }; }; then
13722   break
13723 else
13724   echo "$as_me: failed program was:" >&5
13725 cat conftest.$ac_ext >&5
13726 fi
13727 rm -f conftest.$ac_objext conftest.$ac_ext
13728   cat >conftest.$ac_ext <<_ACEOF
13729 #line 13729 "configure"
13730 #include "confdefs.h"
13731 #define _FILE_OFFSET_BITS 64
13732 #include <sys/types.h>
13733  /* Check that off_t can represent 2**63 - 1 correctly.
13734     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13735     since some C++ compilers masquerading as C compilers
13736     incorrectly reject 9223372036854775807.  */
13737 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13738   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13739                        && LARGE_OFF_T % 2147483647 == 1)
13740                       ? 1 : -1];
13741 int
13742 main (void)
13743 {
13744
13745   ;
13746   return 0;
13747 }
13748 _ACEOF
13749 rm -f conftest.$ac_objext
13750 if { (eval echo "$as_me:13750: \"$ac_compile\"") >&5
13751   (eval $ac_compile) 2>&5
13752   ac_status=$?
13753   echo "$as_me:13753: \$? = $ac_status" >&5
13754   (exit $ac_status); } &&
13755          { ac_try='test -s conftest.$ac_objext'
13756   { (eval echo "$as_me:13756: \"$ac_try\"") >&5
13757   (eval $ac_try) 2>&5
13758   ac_status=$?
13759   echo "$as_me:13759: \$? = $ac_status" >&5
13760   (exit $ac_status); }; }; then
13761   ac_cv_sys_file_offset_bits=64; break
13762 else
13763   echo "$as_me: failed program was:" >&5
13764 cat conftest.$ac_ext >&5
13765 fi
13766 rm -f conftest.$ac_objext conftest.$ac_ext
13767   break
13768 done
13769 fi
13770 echo "$as_me:13770: result: $ac_cv_sys_file_offset_bits" >&5
13771 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13772 if test "$ac_cv_sys_file_offset_bits" != no; then
13773
13774 cat >>confdefs.h <<EOF
13775 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13776 EOF
13777
13778 fi
13779 rm -rf conftest*
13780   echo "$as_me:13780: checking for _LARGE_FILES value needed for large files" >&5
13781 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13782 if test "${ac_cv_sys_large_files+set}" = set; then
13783   echo $ECHO_N "(cached) $ECHO_C" >&6
13784 else
13785   while :; do
13786   ac_cv_sys_large_files=no
13787   cat >conftest.$ac_ext <<_ACEOF
13788 #line 13788 "configure"
13789 #include "confdefs.h"
13790 #include <sys/types.h>
13791  /* Check that off_t can represent 2**63 - 1 correctly.
13792     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13793     since some C++ compilers masquerading as C compilers
13794     incorrectly reject 9223372036854775807.  */
13795 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13796   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13797                        && LARGE_OFF_T % 2147483647 == 1)
13798                       ? 1 : -1];
13799 int
13800 main (void)
13801 {
13802
13803   ;
13804   return 0;
13805 }
13806 _ACEOF
13807 rm -f conftest.$ac_objext
13808 if { (eval echo "$as_me:13808: \"$ac_compile\"") >&5
13809   (eval $ac_compile) 2>&5
13810   ac_status=$?
13811   echo "$as_me:13811: \$? = $ac_status" >&5
13812   (exit $ac_status); } &&
13813          { ac_try='test -s conftest.$ac_objext'
13814   { (eval echo "$as_me:13814: \"$ac_try\"") >&5
13815   (eval $ac_try) 2>&5
13816   ac_status=$?
13817   echo "$as_me:13817: \$? = $ac_status" >&5
13818   (exit $ac_status); }; }; then
13819   break
13820 else
13821   echo "$as_me: failed program was:" >&5
13822 cat conftest.$ac_ext >&5
13823 fi
13824 rm -f conftest.$ac_objext conftest.$ac_ext
13825   cat >conftest.$ac_ext <<_ACEOF
13826 #line 13826 "configure"
13827 #include "confdefs.h"
13828 #define _LARGE_FILES 1
13829 #include <sys/types.h>
13830  /* Check that off_t can represent 2**63 - 1 correctly.
13831     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13832     since some C++ compilers masquerading as C compilers
13833     incorrectly reject 9223372036854775807.  */
13834 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13835   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13836                        && LARGE_OFF_T % 2147483647 == 1)
13837                       ? 1 : -1];
13838 int
13839 main (void)
13840 {
13841
13842   ;
13843   return 0;
13844 }
13845 _ACEOF
13846 rm -f conftest.$ac_objext
13847 if { (eval echo "$as_me:13847: \"$ac_compile\"") >&5
13848   (eval $ac_compile) 2>&5
13849   ac_status=$?
13850   echo "$as_me:13850: \$? = $ac_status" >&5
13851   (exit $ac_status); } &&
13852          { ac_try='test -s conftest.$ac_objext'
13853   { (eval echo "$as_me:13853: \"$ac_try\"") >&5
13854   (eval $ac_try) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); }; }; then
13858   ac_cv_sys_large_files=1; break
13859 else
13860   echo "$as_me: failed program was:" >&5
13861 cat conftest.$ac_ext >&5
13862 fi
13863 rm -f conftest.$ac_objext conftest.$ac_ext
13864   break
13865 done
13866 fi
13867 echo "$as_me:13867: result: $ac_cv_sys_large_files" >&5
13868 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
13869 if test "$ac_cv_sys_large_files" != no; then
13870
13871 cat >>confdefs.h <<EOF
13872 #define _LARGE_FILES $ac_cv_sys_large_files
13873 EOF
13874
13875 fi
13876 rm -rf conftest*
13877 fi
13878
13879         if test "$enable_largefile" != no ; then
13880         echo "$as_me:13880: checking for _LARGEFILE_SOURCE value needed for large files" >&5
13881 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
13882 if test "${ac_cv_sys_largefile_source+set}" = set; then
13883   echo $ECHO_N "(cached) $ECHO_C" >&6
13884 else
13885   while :; do
13886   ac_cv_sys_largefile_source=no
13887   cat >conftest.$ac_ext <<_ACEOF
13888 #line 13888 "configure"
13889 #include "confdefs.h"
13890 #include <stdio.h>
13891 int
13892 main (void)
13893 {
13894 return !fseeko;
13895   ;
13896   return 0;
13897 }
13898 _ACEOF
13899 rm -f conftest.$ac_objext
13900 if { (eval echo "$as_me:13900: \"$ac_compile\"") >&5
13901   (eval $ac_compile) 2>&5
13902   ac_status=$?
13903   echo "$as_me:13903: \$? = $ac_status" >&5
13904   (exit $ac_status); } &&
13905          { ac_try='test -s conftest.$ac_objext'
13906   { (eval echo "$as_me:13906: \"$ac_try\"") >&5
13907   (eval $ac_try) 2>&5
13908   ac_status=$?
13909   echo "$as_me:13909: \$? = $ac_status" >&5
13910   (exit $ac_status); }; }; then
13911   break
13912 else
13913   echo "$as_me: failed program was:" >&5
13914 cat conftest.$ac_ext >&5
13915 fi
13916 rm -f conftest.$ac_objext conftest.$ac_ext
13917   cat >conftest.$ac_ext <<_ACEOF
13918 #line 13918 "configure"
13919 #include "confdefs.h"
13920 #define _LARGEFILE_SOURCE 1
13921 #include <stdio.h>
13922 int
13923 main (void)
13924 {
13925 return !fseeko;
13926   ;
13927   return 0;
13928 }
13929 _ACEOF
13930 rm -f conftest.$ac_objext
13931 if { (eval echo "$as_me:13931: \"$ac_compile\"") >&5
13932   (eval $ac_compile) 2>&5
13933   ac_status=$?
13934   echo "$as_me:13934: \$? = $ac_status" >&5
13935   (exit $ac_status); } &&
13936          { ac_try='test -s conftest.$ac_objext'
13937   { (eval echo "$as_me:13937: \"$ac_try\"") >&5
13938   (eval $ac_try) 2>&5
13939   ac_status=$?
13940   echo "$as_me:13940: \$? = $ac_status" >&5
13941   (exit $ac_status); }; }; then
13942   ac_cv_sys_largefile_source=1; break
13943 else
13944   echo "$as_me: failed program was:" >&5
13945 cat conftest.$ac_ext >&5
13946 fi
13947 rm -f conftest.$ac_objext conftest.$ac_ext
13948   break
13949 done
13950 fi
13951 echo "$as_me:13951: result: $ac_cv_sys_largefile_source" >&5
13952 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
13953 if test "$ac_cv_sys_largefile_source" != no; then
13954
13955 cat >>confdefs.h <<EOF
13956 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
13957 EOF
13958
13959 fi
13960 rm -rf conftest*
13961
13962 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
13963 # in glibc 2.1.3, but that breaks too many other things.
13964 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
13965 echo "$as_me:13965: checking for fseeko" >&5
13966 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
13967 if test "${ac_cv_func_fseeko+set}" = set; then
13968   echo $ECHO_N "(cached) $ECHO_C" >&6
13969 else
13970   cat >conftest.$ac_ext <<_ACEOF
13971 #line 13971 "configure"
13972 #include "confdefs.h"
13973 #include <stdio.h>
13974 int
13975 main (void)
13976 {
13977 return fseeko && fseeko (stdin, 0, 0);
13978   ;
13979   return 0;
13980 }
13981 _ACEOF
13982 rm -f conftest.$ac_objext conftest$ac_exeext
13983 if { (eval echo "$as_me:13983: \"$ac_link\"") >&5
13984   (eval $ac_link) 2>&5
13985   ac_status=$?
13986   echo "$as_me:13986: \$? = $ac_status" >&5
13987   (exit $ac_status); } &&
13988          { ac_try='test -s conftest$ac_exeext'
13989   { (eval echo "$as_me:13989: \"$ac_try\"") >&5
13990   (eval $ac_try) 2>&5
13991   ac_status=$?
13992   echo "$as_me:13992: \$? = $ac_status" >&5
13993   (exit $ac_status); }; }; then
13994   ac_cv_func_fseeko=yes
13995 else
13996   echo "$as_me: failed program was:" >&5
13997 cat conftest.$ac_ext >&5
13998 ac_cv_func_fseeko=no
13999 fi
14000 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14001 fi
14002 echo "$as_me:14002: result: $ac_cv_func_fseeko" >&5
14003 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14004 if test $ac_cv_func_fseeko = yes; then
14005
14006 cat >>confdefs.h <<\EOF
14007 #define HAVE_FSEEKO 1
14008 EOF
14009
14010 fi
14011
14012         # Normally we would collect these definitions in the config.h,
14013         # but (like _XOPEN_SOURCE), some environments rely on having these
14014         # defined before any of the system headers are included.  Another
14015         # case comes up with C++, e.g., on AIX the compiler compiles the
14016         # header files by themselves before looking at the body files it is
14017         # told to compile.  For ncurses, those header files do not include
14018         # the config.h
14019         if test "$ac_cv_sys_large_files" != no
14020         then
14021
14022         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14023         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14024
14025         fi
14026         if test "$ac_cv_sys_largefile_source" != no
14027         then
14028
14029         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14030         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14031
14032         fi
14033         if test "$ac_cv_sys_file_offset_bits" != no
14034         then
14035
14036         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14037         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14038
14039         fi
14040
14041         echo "$as_me:14041: checking whether to use struct dirent64" >&5
14042 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14043 if test "${cf_cv_struct_dirent64+set}" = set; then
14044   echo $ECHO_N "(cached) $ECHO_C" >&6
14045 else
14046
14047                 cat >conftest.$ac_ext <<_ACEOF
14048 #line 14048 "configure"
14049 #include "confdefs.h"
14050
14051 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14052 #include <sys/types.h>
14053 #include <dirent.h>
14054
14055 int
14056 main (void)
14057 {
14058
14059                 /* if transitional largefile support is setup, this is true */
14060                 extern struct dirent64 * readdir(DIR *);
14061                 struct dirent64 *x = readdir((DIR *)0);
14062                 struct dirent *y = readdir((DIR *)0);
14063                 int z = x - y;
14064                 (void)z;
14065
14066   ;
14067   return 0;
14068 }
14069 _ACEOF
14070 rm -f conftest.$ac_objext
14071 if { (eval echo "$as_me:14071: \"$ac_compile\"") >&5
14072   (eval $ac_compile) 2>&5
14073   ac_status=$?
14074   echo "$as_me:14074: \$? = $ac_status" >&5
14075   (exit $ac_status); } &&
14076          { ac_try='test -s conftest.$ac_objext'
14077   { (eval echo "$as_me:14077: \"$ac_try\"") >&5
14078   (eval $ac_try) 2>&5
14079   ac_status=$?
14080   echo "$as_me:14080: \$? = $ac_status" >&5
14081   (exit $ac_status); }; }; then
14082   cf_cv_struct_dirent64=yes
14083 else
14084   echo "$as_me: failed program was:" >&5
14085 cat conftest.$ac_ext >&5
14086 cf_cv_struct_dirent64=no
14087 fi
14088 rm -f conftest.$ac_objext conftest.$ac_ext
14089
14090 fi
14091 echo "$as_me:14091: result: $cf_cv_struct_dirent64" >&5
14092 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14093         test "$cf_cv_struct_dirent64" = yes &&
14094 cat >>confdefs.h <<\EOF
14095 #define HAVE_STRUCT_DIRENT64 1
14096 EOF
14097
14098         fi
14099
14100 ### Enable compiling-in rcs id's
14101 echo "$as_me:14101: checking if RCS identifiers should be compiled-in" >&5
14102 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14103
14104 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14105 if test "${with_rcs_ids+set}" = set; then
14106   withval="$with_rcs_ids"
14107   with_rcs_ids=$withval
14108 else
14109   with_rcs_ids=no
14110 fi;
14111 echo "$as_me:14111: result: $with_rcs_ids" >&5
14112 echo "${ECHO_T}$with_rcs_ids" >&6
14113 test "$with_rcs_ids" = yes &&
14114 cat >>confdefs.h <<\EOF
14115 #define USE_RCS_IDS 1
14116 EOF
14117
14118 ###############################################################################
14119
14120 ### Note that some functions (such as const) are normally disabled anyway.
14121 echo "$as_me:14121: checking if you want to build with function extensions" >&5
14122 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14123
14124 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14125 if test "${enable_ext_funcs+set}" = set; then
14126   enableval="$enable_ext_funcs"
14127   with_ext_funcs=$enableval
14128 else
14129   with_ext_funcs=yes
14130 fi;
14131 echo "$as_me:14131: result: $with_ext_funcs" >&5
14132 echo "${ECHO_T}$with_ext_funcs" >&6
14133 if test "$with_ext_funcs" = yes ; then
14134         NCURSES_EXT_FUNCS=1
14135
14136 cat >>confdefs.h <<\EOF
14137 #define HAVE_USE_DEFAULT_COLORS 1
14138 EOF
14139
14140 cat >>confdefs.h <<\EOF
14141 #define NCURSES_EXT_FUNCS 1
14142 EOF
14143
14144 else
14145         NCURSES_EXT_FUNCS=0
14146 fi
14147
14148 ###   use option --enable-const to turn on use of const beyond that in XSI.
14149 echo "$as_me:14149: checking for extended use of const keyword" >&5
14150 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14151
14152 # Check whether --enable-const or --disable-const was given.
14153 if test "${enable_const+set}" = set; then
14154   enableval="$enable_const"
14155   with_ext_const=$enableval
14156 else
14157   with_ext_const=no
14158 fi;
14159 echo "$as_me:14159: result: $with_ext_const" >&5
14160 echo "${ECHO_T}$with_ext_const" >&6
14161 NCURSES_CONST='/*nothing*/'
14162 if test "$with_ext_const" = yes ; then
14163         NCURSES_CONST=const
14164 fi
14165
14166 ###############################################################################
14167 # These options are relatively safe to experiment with.
14168
14169 echo "$as_me:14169: checking if you want all development code" >&5
14170 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14171
14172 # Check whether --with-develop or --without-develop was given.
14173 if test "${with_develop+set}" = set; then
14174   withval="$with_develop"
14175   with_develop=$withval
14176 else
14177   with_develop=no
14178 fi;
14179 echo "$as_me:14179: result: $with_develop" >&5
14180 echo "${ECHO_T}$with_develop" >&6
14181
14182 ###############################################################################
14183 # These are just experimental, probably should not be in a package:
14184
14185 # This is still experimental (20080329), but should ultimately be moved to
14186 # the script-block --with-normal, etc.
14187
14188 echo "$as_me:14188: checking if you want to link with the pthread library" >&5
14189 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14190
14191 # Check whether --with-pthread or --without-pthread was given.
14192 if test "${with_pthread+set}" = set; then
14193   withval="$with_pthread"
14194   with_pthread=$withval
14195 else
14196   with_pthread=no
14197 fi;
14198 echo "$as_me:14198: result: $with_pthread" >&5
14199 echo "${ECHO_T}$with_pthread" >&6
14200
14201 if test "$with_pthread" != no ; then
14202         echo "$as_me:14202: checking for pthread.h" >&5
14203 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14204 if test "${ac_cv_header_pthread_h+set}" = set; then
14205   echo $ECHO_N "(cached) $ECHO_C" >&6
14206 else
14207   cat >conftest.$ac_ext <<_ACEOF
14208 #line 14208 "configure"
14209 #include "confdefs.h"
14210 #include <pthread.h>
14211 _ACEOF
14212 if { (eval echo "$as_me:14212: \"$ac_cpp conftest.$ac_ext\"") >&5
14213   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14214   ac_status=$?
14215   egrep -v '^ *\+' conftest.er1 >conftest.err
14216   rm -f conftest.er1
14217   cat conftest.err >&5
14218   echo "$as_me:14218: \$? = $ac_status" >&5
14219   (exit $ac_status); } >/dev/null; then
14220   if test -s conftest.err; then
14221     ac_cpp_err=$ac_c_preproc_warn_flag
14222   else
14223     ac_cpp_err=
14224   fi
14225 else
14226   ac_cpp_err=yes
14227 fi
14228 if test -z "$ac_cpp_err"; then
14229   ac_cv_header_pthread_h=yes
14230 else
14231   echo "$as_me: failed program was:" >&5
14232   cat conftest.$ac_ext >&5
14233   ac_cv_header_pthread_h=no
14234 fi
14235 rm -f conftest.err conftest.$ac_ext
14236 fi
14237 echo "$as_me:14237: result: $ac_cv_header_pthread_h" >&5
14238 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14239 if test $ac_cv_header_pthread_h = yes; then
14240
14241 cat >>confdefs.h <<\EOF
14242 #define HAVE_PTHREADS_H 1
14243 EOF
14244
14245         for cf_lib_pthread in pthread c_r
14246         do
14247             echo "$as_me:14247: checking if we can link with the $cf_lib_pthread library" >&5
14248 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14249             cf_save_LIBS="$LIBS"
14250
14251 cf_add_libs="$LIBS"
14252 # reverse order
14253 cf_add_0lib=
14254 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14255 # filter duplicates
14256 for cf_add_1lib in $cf_add_0lib; do
14257         for cf_add_2lib in $cf_add_libs; do
14258                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14259                         cf_add_1lib=
14260                         break
14261                 fi
14262         done
14263         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14264 done
14265 LIBS="$cf_add_libs"
14266
14267             cat >conftest.$ac_ext <<_ACEOF
14268 #line 14268 "configure"
14269 #include "confdefs.h"
14270
14271 #include <pthread.h>
14272
14273 int
14274 main (void)
14275 {
14276
14277                 int rc = pthread_create(0,0,0,0);
14278                 int r2 = pthread_mutexattr_settype(0, 0);
14279
14280   ;
14281   return 0;
14282 }
14283 _ACEOF
14284 rm -f conftest.$ac_objext conftest$ac_exeext
14285 if { (eval echo "$as_me:14285: \"$ac_link\"") >&5
14286   (eval $ac_link) 2>&5
14287   ac_status=$?
14288   echo "$as_me:14288: \$? = $ac_status" >&5
14289   (exit $ac_status); } &&
14290          { ac_try='test -s conftest$ac_exeext'
14291   { (eval echo "$as_me:14291: \"$ac_try\"") >&5
14292   (eval $ac_try) 2>&5
14293   ac_status=$?
14294   echo "$as_me:14294: \$? = $ac_status" >&5
14295   (exit $ac_status); }; }; then
14296   with_pthread=yes
14297 else
14298   echo "$as_me: failed program was:" >&5
14299 cat conftest.$ac_ext >&5
14300 with_pthread=no
14301 fi
14302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14303             LIBS="$cf_save_LIBS"
14304             echo "$as_me:14304: result: $with_pthread" >&5
14305 echo "${ECHO_T}$with_pthread" >&6
14306             test "$with_pthread" = yes && break
14307         done
14308
14309         if test "$with_pthread" = yes ; then
14310
14311 cf_add_libs="$LIBS"
14312 # reverse order
14313 cf_add_0lib=
14314 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14315 # filter duplicates
14316 for cf_add_1lib in $cf_add_0lib; do
14317         for cf_add_2lib in $cf_add_libs; do
14318                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14319                         cf_add_1lib=
14320                         break
14321                 fi
14322         done
14323         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14324 done
14325 LIBS="$cf_add_libs"
14326
14327 cat >>confdefs.h <<\EOF
14328 #define HAVE_LIBPTHREADS 1
14329 EOF
14330
14331         else
14332             { { echo "$as_me:14332: error: Cannot link with pthread library" >&5
14333 echo "$as_me: error: Cannot link with pthread library" >&2;}
14334    { (exit 1); exit 1; }; }
14335         fi
14336
14337 fi
14338
14339 fi
14340
14341 echo "$as_me:14341: checking if you want to use weak-symbols for pthreads" >&5
14342 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14343
14344 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14345 if test "${enable_weak_symbols+set}" = set; then
14346   enableval="$enable_weak_symbols"
14347   use_weak_symbols=$withval
14348 else
14349   use_weak_symbols=no
14350 fi;
14351 echo "$as_me:14351: result: $use_weak_symbols" >&5
14352 echo "${ECHO_T}$use_weak_symbols" >&6
14353 if test "$use_weak_symbols" = yes ; then
14354
14355 echo "$as_me:14355: checking if $CC supports weak symbols" >&5
14356 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14357 if test "${cf_cv_weak_symbols+set}" = set; then
14358   echo $ECHO_N "(cached) $ECHO_C" >&6
14359 else
14360
14361 cat >conftest.$ac_ext <<_ACEOF
14362 #line 14362 "configure"
14363 #include "confdefs.h"
14364
14365 #include <stdio.h>
14366 int
14367 main (void)
14368 {
14369
14370 #if defined(__GNUC__)
14371 #  if defined __USE_ISOC99
14372 #    define _cat_pragma(exp)    _Pragma(#exp)
14373 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14374 #  else
14375 #    define _weak_pragma(exp)
14376 #  endif
14377 #  define _declare(name)        __extension__ extern __typeof__(name) name
14378 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14379 #endif
14380
14381 weak_symbol(fopen);
14382
14383   ;
14384   return 0;
14385 }
14386 _ACEOF
14387 rm -f conftest.$ac_objext
14388 if { (eval echo "$as_me:14388: \"$ac_compile\"") >&5
14389   (eval $ac_compile) 2>&5
14390   ac_status=$?
14391   echo "$as_me:14391: \$? = $ac_status" >&5
14392   (exit $ac_status); } &&
14393          { ac_try='test -s conftest.$ac_objext'
14394   { (eval echo "$as_me:14394: \"$ac_try\"") >&5
14395   (eval $ac_try) 2>&5
14396   ac_status=$?
14397   echo "$as_me:14397: \$? = $ac_status" >&5
14398   (exit $ac_status); }; }; then
14399   cf_cv_weak_symbols=yes
14400 else
14401   echo "$as_me: failed program was:" >&5
14402 cat conftest.$ac_ext >&5
14403 cf_cv_weak_symbols=no
14404 fi
14405 rm -f conftest.$ac_objext conftest.$ac_ext
14406
14407 fi
14408 echo "$as_me:14408: result: $cf_cv_weak_symbols" >&5
14409 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14410
14411 else
14412         cf_cv_weak_symbols=no
14413 fi
14414
14415 if test $cf_cv_weak_symbols = yes ; then
14416
14417 cat >>confdefs.h <<\EOF
14418 #define USE_WEAK_SYMBOLS 1
14419 EOF
14420
14421 fi
14422
14423 PTHREAD=
14424 if test "$with_pthread" = "yes" ; then
14425
14426 cat >>confdefs.h <<\EOF
14427 #define USE_PTHREADS 1
14428 EOF
14429
14430         enable_reentrant=yes
14431         if test $cf_cv_weak_symbols = yes ; then
14432                 PTHREAD=-lpthread
14433         fi
14434 fi
14435
14436 # OpenSUSE is installing ncurses6, using reentrant option.
14437 echo "$as_me:14437: checking for _nc_TABSIZE" >&5
14438 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14439 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14440   echo $ECHO_N "(cached) $ECHO_C" >&6
14441 else
14442   cat >conftest.$ac_ext <<_ACEOF
14443 #line 14443 "configure"
14444 #include "confdefs.h"
14445 #define _nc_TABSIZE autoconf_temporary
14446 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14447 #undef _nc_TABSIZE
14448
14449 #ifdef __cplusplus
14450 extern "C"
14451 #endif
14452
14453 /* We use char because int might match the return type of a gcc2
14454    builtin and then its argument prototype would still apply.  */
14455 char _nc_TABSIZE (void);
14456
14457 int
14458 main (void)
14459 {
14460
14461 /* The GNU C library defines stubs for functions which it implements
14462     to always fail with ENOSYS.  Some functions are actually named
14463     something starting with __ and the normal name is an alias.  */
14464 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14465 #error found stub for _nc_TABSIZE
14466 #endif
14467
14468         return _nc_TABSIZE ();
14469   ;
14470   return 0;
14471 }
14472 _ACEOF
14473 rm -f conftest.$ac_objext conftest$ac_exeext
14474 if { (eval echo "$as_me:14474: \"$ac_link\"") >&5
14475   (eval $ac_link) 2>&5
14476   ac_status=$?
14477   echo "$as_me:14477: \$? = $ac_status" >&5
14478   (exit $ac_status); } &&
14479          { ac_try='test -s conftest$ac_exeext'
14480   { (eval echo "$as_me:14480: \"$ac_try\"") >&5
14481   (eval $ac_try) 2>&5
14482   ac_status=$?
14483   echo "$as_me:14483: \$? = $ac_status" >&5
14484   (exit $ac_status); }; }; then
14485   ac_cv_func__nc_TABSIZE=yes
14486 else
14487   echo "$as_me: failed program was:" >&5
14488 cat conftest.$ac_ext >&5
14489 ac_cv_func__nc_TABSIZE=no
14490 fi
14491 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14492 fi
14493 echo "$as_me:14493: result: $ac_cv_func__nc_TABSIZE" >&5
14494 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14495 if test $ac_cv_func__nc_TABSIZE = yes; then
14496   assume_reentrant=yes
14497 else
14498   assume_reentrant=no
14499 fi
14500
14501 # Reentrant code has to be opaque; there's little advantage to making ncurses
14502 # opaque outside of that, so there is no --enable-opaque option.  We can use
14503 # this option without --with-pthreads, but this will be always set for
14504 # pthreads.
14505 echo "$as_me:14505: checking if you want experimental reentrant code" >&5
14506 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14507
14508 # Check whether --enable-reentrant or --disable-reentrant was given.
14509 if test "${enable_reentrant+set}" = set; then
14510   enableval="$enable_reentrant"
14511   with_reentrant=$enableval
14512 else
14513   with_reentrant=$assume_reentrant
14514 fi;
14515 echo "$as_me:14515: result: $with_reentrant" >&5
14516 echo "${ECHO_T}$with_reentrant" >&6
14517 if test "$with_reentrant" = yes ; then
14518         cf_cv_enable_reentrant=1
14519         if test $cf_cv_weak_symbols = yes ; then
14520
14521 # remove pthread library from $LIBS
14522 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14523
14524         elif test "$assume_reentrant" = no ; then
14525                 LIB_SUFFIX="t${LIB_SUFFIX}"
14526         fi
14527
14528 cat >>confdefs.h <<\EOF
14529 #define USE_REENTRANT 1
14530 EOF
14531
14532 else
14533         cf_cv_enable_reentrant=0
14534 fi
14535
14536 ### Allow using a different wrap-prefix
14537 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14538         echo "$as_me:14538: checking for prefix used to wrap public variables" >&5
14539 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14540
14541 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14542 if test "${with_wrap_prefix+set}" = set; then
14543   withval="$with_wrap_prefix"
14544   NCURSES_WRAP_PREFIX=$withval
14545 else
14546   NCURSES_WRAP_PREFIX=_nc_
14547 fi;
14548         echo "$as_me:14548: result: $NCURSES_WRAP_PREFIX" >&5
14549 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14550 else
14551         NCURSES_WRAP_PREFIX=_nc_
14552 fi
14553
14554 cat >>confdefs.h <<EOF
14555 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14556 EOF
14557
14558 ###############################################################################
14559
14560 ###     use option --disable-echo to suppress full display compiling commands
14561
14562 echo "$as_me:14562: checking if you want to see long compiling messages" >&5
14563 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14564
14565 # Check whether --enable-echo or --disable-echo was given.
14566 if test "${enable_echo+set}" = set; then
14567   enableval="$enable_echo"
14568   test "$enableval" != no && enableval=yes
14569         if test "$enableval" != "yes" ; then
14570
14571         ECHO_LT='--silent'
14572         ECHO_LD='@echo linking $@;'
14573         RULE_CC='@echo compiling $<'
14574         SHOW_CC='@echo compiling $@'
14575         ECHO_CC='@'
14576
14577         else
14578
14579         ECHO_LT=''
14580         ECHO_LD=''
14581         RULE_CC=''
14582         SHOW_CC=''
14583         ECHO_CC=''
14584
14585         fi
14586 else
14587   enableval=yes
14588
14589         ECHO_LT=''
14590         ECHO_LD=''
14591         RULE_CC=''
14592         SHOW_CC=''
14593         ECHO_CC=''
14594
14595 fi;
14596 echo "$as_me:14596: result: $enableval" >&5
14597 echo "${ECHO_T}$enableval" >&6
14598
14599 ###     use option --enable-warnings to turn on all gcc warnings
14600 echo "$as_me:14600: checking if you want to see compiler warnings" >&5
14601 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
14602
14603 # Check whether --enable-warnings or --disable-warnings was given.
14604 if test "${enable_warnings+set}" = set; then
14605   enableval="$enable_warnings"
14606   with_warnings=$enableval
14607 fi;
14608 echo "$as_me:14608: result: $with_warnings" >&5
14609 echo "${ECHO_T}$with_warnings" >&6
14610
14611 if ( test "$GCC" = yes || test "$GXX" = yes )
14612 then
14613
14614 if ( test "$GCC" = yes || test "$GXX" = yes )
14615 then
14616         case $CFLAGS in
14617         (*-Werror=*)
14618                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14619
14620 echo "${as_me:-configure}:14620: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14621
14622                 cf_temp_flags=
14623                 for cf_temp_scan in $CFLAGS
14624                 do
14625                         case "x$cf_temp_scan" in
14626                         (x-Werror=*)
14627
14628         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14629         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14630
14631                                 ;;
14632                         (*)
14633
14634         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14635         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14636
14637                                 ;;
14638                         esac
14639                 done
14640                 CFLAGS="$cf_temp_flags"
14641                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14642
14643 echo "${as_me:-configure}:14643: testing ... fixed $CFLAGS ..." 1>&5
14644
14645                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14646
14647 echo "${as_me:-configure}:14647: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14648
14649                 ;;
14650         esac
14651 fi
14652
14653 if ( test "$GCC" = yes || test "$GXX" = yes )
14654 then
14655         case $CPPFLAGS in
14656         (*-Werror=*)
14657                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14658
14659 echo "${as_me:-configure}:14659: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14660
14661                 cf_temp_flags=
14662                 for cf_temp_scan in $CPPFLAGS
14663                 do
14664                         case "x$cf_temp_scan" in
14665                         (x-Werror=*)
14666
14667         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14668         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14669
14670                                 ;;
14671                         (*)
14672
14673         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14674         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14675
14676                                 ;;
14677                         esac
14678                 done
14679                 CPPFLAGS="$cf_temp_flags"
14680                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14681
14682 echo "${as_me:-configure}:14682: testing ... fixed $CPPFLAGS ..." 1>&5
14683
14684                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14685
14686 echo "${as_me:-configure}:14686: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14687
14688                 ;;
14689         esac
14690 fi
14691
14692 if ( test "$GCC" = yes || test "$GXX" = yes )
14693 then
14694         case $LDFLAGS in
14695         (*-Werror=*)
14696                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14697
14698 echo "${as_me:-configure}:14698: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14699
14700                 cf_temp_flags=
14701                 for cf_temp_scan in $LDFLAGS
14702                 do
14703                         case "x$cf_temp_scan" in
14704                         (x-Werror=*)
14705
14706         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14707         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
14708
14709                                 ;;
14710                         (*)
14711
14712         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14713         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
14714
14715                                 ;;
14716                         esac
14717                 done
14718                 LDFLAGS="$cf_temp_flags"
14719                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14720
14721 echo "${as_me:-configure}:14721: testing ... fixed $LDFLAGS ..." 1>&5
14722
14723                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14724
14725 echo "${as_me:-configure}:14725: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14726
14727                 ;;
14728         esac
14729 fi
14730
14731 echo "$as_me:14731: checking if you want to turn on gcc warnings" >&5
14732 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14733
14734 # Check whether --enable-warnings or --disable-warnings was given.
14735 if test "${enable_warnings+set}" = set; then
14736   enableval="$enable_warnings"
14737   test "$enableval" != yes && enableval=no
14738         if test "$enableval" != "no" ; then
14739     with_warnings=yes
14740         else
14741                 with_warnings=no
14742         fi
14743 else
14744   enableval=no
14745         with_warnings=no
14746
14747 fi;
14748 echo "$as_me:14748: result: $with_warnings" >&5
14749 echo "${ECHO_T}$with_warnings" >&6
14750 if test "$with_warnings" = "yes"
14751 then
14752
14753 if test "x$have_x" = xyes; then
14754
14755 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14756 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14757 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14758 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14759 for cf_X_CFLAGS in $X_CFLAGS
14760 do
14761         case "x$cf_X_CFLAGS" in
14762         x-[IUD]*)
14763                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14764                 ;;
14765         *)
14766                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14767                 ;;
14768         esac
14769 done
14770
14771 cat >conftest.$ac_ext <<_ACEOF
14772 #line 14772 "configure"
14773 #include "confdefs.h"
14774
14775 #include <stdlib.h>
14776 #include <X11/Intrinsic.h>
14777
14778 int
14779 main (void)
14780 {
14781 String foo = malloc(1); (void)foo
14782   ;
14783   return 0;
14784 }
14785 _ACEOF
14786 rm -f conftest.$ac_objext
14787 if { (eval echo "$as_me:14787: \"$ac_compile\"") >&5
14788   (eval $ac_compile) 2>&5
14789   ac_status=$?
14790   echo "$as_me:14790: \$? = $ac_status" >&5
14791   (exit $ac_status); } &&
14792          { ac_try='test -s conftest.$ac_objext'
14793   { (eval echo "$as_me:14793: \"$ac_try\"") >&5
14794   (eval $ac_try) 2>&5
14795   ac_status=$?
14796   echo "$as_me:14796: \$? = $ac_status" >&5
14797   (exit $ac_status); }; }; then
14798
14799 echo "$as_me:14799: checking for X11/Xt const-feature" >&5
14800 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14801 if test "${cf_cv_const_x_string+set}" = set; then
14802   echo $ECHO_N "(cached) $ECHO_C" >&6
14803 else
14804
14805         cat >conftest.$ac_ext <<_ACEOF
14806 #line 14806 "configure"
14807 #include "confdefs.h"
14808
14809 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14810 #undef  XTSTRINGDEFINES /* X11R5 and later */
14811 #include <stdlib.h>
14812 #include <X11/Intrinsic.h>
14813
14814 int
14815 main (void)
14816 {
14817 String foo = malloc(1); *foo = 0
14818   ;
14819   return 0;
14820 }
14821 _ACEOF
14822 rm -f conftest.$ac_objext
14823 if { (eval echo "$as_me:14823: \"$ac_compile\"") >&5
14824   (eval $ac_compile) 2>&5
14825   ac_status=$?
14826   echo "$as_me:14826: \$? = $ac_status" >&5
14827   (exit $ac_status); } &&
14828          { ac_try='test -s conftest.$ac_objext'
14829   { (eval echo "$as_me:14829: \"$ac_try\"") >&5
14830   (eval $ac_try) 2>&5
14831   ac_status=$?
14832   echo "$as_me:14832: \$? = $ac_status" >&5
14833   (exit $ac_status); }; }; then
14834
14835                         cf_cv_const_x_string=no
14836
14837 else
14838   echo "$as_me: failed program was:" >&5
14839 cat conftest.$ac_ext >&5
14840
14841                         cf_cv_const_x_string=yes
14842
14843 fi
14844 rm -f conftest.$ac_objext conftest.$ac_ext
14845
14846 fi
14847 echo "$as_me:14847: result: $cf_cv_const_x_string" >&5
14848 echo "${ECHO_T}$cf_cv_const_x_string" >&6
14849
14850 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
14851 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
14852 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
14853
14854 case $cf_cv_const_x_string in
14855 (no)
14856
14857         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14858         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
14859
14860         ;;
14861 (*)
14862
14863         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14864         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
14865
14866         ;;
14867 esac
14868
14869 else
14870   echo "$as_me: failed program was:" >&5
14871 cat conftest.$ac_ext >&5
14872 fi
14873 rm -f conftest.$ac_objext conftest.$ac_ext
14874  fi
14875 cat > conftest.$ac_ext <<EOF
14876 #line 14876 "${as_me:-configure}"
14877 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
14878 EOF
14879 if test "$INTEL_COMPILER" = yes
14880 then
14881 # The "-wdXXX" options suppress warnings:
14882 # remark #1419: external declaration in primary source file
14883 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
14884 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
14885 # remark #193: zero used for undefined preprocessing identifier
14886 # remark #593: variable "curs_sb_left_arrow" was set but never used
14887 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
14888 # remark #869: parameter "tw" was never referenced
14889 # remark #981: operands are evaluated in unspecified order
14890 # warning #279: controlling expression is constant
14891
14892         { echo "$as_me:14892: checking for $CC warning options..." >&5
14893 echo "$as_me: checking for $CC warning options..." >&6;}
14894         cf_save_CFLAGS="$CFLAGS"
14895         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
14896         for cf_opt in \
14897                 wd1419 \
14898                 wd1683 \
14899                 wd1684 \
14900                 wd193 \
14901                 wd593 \
14902                 wd279 \
14903                 wd810 \
14904                 wd869 \
14905                 wd981
14906         do
14907                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14908                 if { (eval echo "$as_me:14908: \"$ac_compile\"") >&5
14909   (eval $ac_compile) 2>&5
14910   ac_status=$?
14911   echo "$as_me:14911: \$? = $ac_status" >&5
14912   (exit $ac_status); }; then
14913                         test -n "$verbose" && echo "$as_me:14913: result: ... -$cf_opt" >&5
14914 echo "${ECHO_T}... -$cf_opt" >&6
14915                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14916                 fi
14917         done
14918         CFLAGS="$cf_save_CFLAGS"
14919 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
14920 then
14921         { echo "$as_me:14921: checking for $CC warning options..." >&5
14922 echo "$as_me: checking for $CC warning options..." >&6;}
14923         cf_save_CFLAGS="$CFLAGS"
14924         cf_warn_CONST=""
14925         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
14926         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
14927         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
14928         for cf_opt in W Wall \
14929                 Wbad-function-cast \
14930                 Wcast-align \
14931                 Wcast-qual \
14932                 Wdeclaration-after-statement \
14933                 Wextra \
14934                 Winline \
14935                 Wmissing-declarations \
14936                 Wmissing-prototypes \
14937                 Wnested-externs \
14938                 Wpointer-arith \
14939                 Wshadow \
14940                 Wstrict-prototypes \
14941                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
14942         do
14943                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
14944                 if { (eval echo "$as_me:14944: \"$ac_compile\"") >&5
14945   (eval $ac_compile) 2>&5
14946   ac_status=$?
14947   echo "$as_me:14947: \$? = $ac_status" >&5
14948   (exit $ac_status); }; then
14949                         test -n "$verbose" && echo "$as_me:14949: result: ... -$cf_opt" >&5
14950 echo "${ECHO_T}... -$cf_opt" >&6
14951                         case $cf_opt in
14952                         (Winline)
14953                                 case $GCC_VERSION in
14954                                 ([34].*)
14955                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14956
14957 echo "${as_me:-configure}:14957: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14958
14959                                         continue;;
14960                                 esac
14961                                 ;;
14962                         (Wpointer-arith)
14963                                 case $GCC_VERSION in
14964                                 ([12].*)
14965                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
14966
14967 echo "${as_me:-configure}:14967: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
14968
14969                                         continue;;
14970                                 esac
14971                                 ;;
14972                         esac
14973                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
14974                 fi
14975         done
14976         CFLAGS="$cf_save_CFLAGS"
14977 fi
14978 rm -rf conftest*
14979
14980 fi
14981
14982 if ( test "$GCC" = yes || test "$GXX" = yes )
14983 then
14984 cat > conftest.i <<EOF
14985 #ifndef GCC_PRINTF
14986 #define GCC_PRINTF 0
14987 #endif
14988 #ifndef GCC_SCANF
14989 #define GCC_SCANF 0
14990 #endif
14991 #ifndef GCC_NORETURN
14992 #define GCC_NORETURN /* nothing */
14993 #endif
14994 #ifndef GCC_UNUSED
14995 #define GCC_UNUSED /* nothing */
14996 #endif
14997 EOF
14998 if test "$GCC" = yes
14999 then
15000         { echo "$as_me:15000: checking for $CC __attribute__ directives..." >&5
15001 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15002 cat > conftest.$ac_ext <<EOF
15003 #line 15003 "${as_me:-configure}"
15004 #include "confdefs.h"
15005 #include "conftest.h"
15006 #include "conftest.i"
15007 #if     GCC_PRINTF
15008 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15009 #else
15010 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15011 #endif
15012 #if     GCC_SCANF
15013 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15014 #else
15015 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15016 #endif
15017 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15018 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15019 extern void foo(void) GCC_NORETURN;
15020 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15021 EOF
15022         cf_printf_attribute=no
15023         cf_scanf_attribute=no
15024         for cf_attribute in scanf printf unused noreturn
15025         do
15026
15027 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15028
15029                 cf_directive="__attribute__(($cf_attribute))"
15030                 echo "checking for $CC $cf_directive" 1>&5
15031
15032                 case $cf_attribute in
15033                 (printf)
15034                         cf_printf_attribute=yes
15035                         cat >conftest.h <<EOF
15036 #define GCC_$cf_ATTRIBUTE 1
15037 EOF
15038                         ;;
15039                 (scanf)
15040                         cf_scanf_attribute=yes
15041                         cat >conftest.h <<EOF
15042 #define GCC_$cf_ATTRIBUTE 1
15043 EOF
15044                         ;;
15045                 (*)
15046                         cat >conftest.h <<EOF
15047 #define GCC_$cf_ATTRIBUTE $cf_directive
15048 EOF
15049                         ;;
15050                 esac
15051
15052                 if { (eval echo "$as_me:15052: \"$ac_compile\"") >&5
15053   (eval $ac_compile) 2>&5
15054   ac_status=$?
15055   echo "$as_me:15055: \$? = $ac_status" >&5
15056   (exit $ac_status); }; then
15057                         test -n "$verbose" && echo "$as_me:15057: result: ... $cf_attribute" >&5
15058 echo "${ECHO_T}... $cf_attribute" >&6
15059                         cat conftest.h >>confdefs.h
15060                         case $cf_attribute in
15061                         (noreturn)
15062
15063 cat >>confdefs.h <<EOF
15064 #define GCC_NORETURN $cf_directive
15065 EOF
15066
15067                                 ;;
15068                         (printf)
15069                                 cf_value='/* nothing */'
15070                                 if test "$cf_printf_attribute" != no ; then
15071                                         cf_value='__attribute__((format(printf,fmt,var)))'
15072
15073 cat >>confdefs.h <<\EOF
15074 #define GCC_PRINTF 1
15075 EOF
15076
15077                                 fi
15078
15079 cat >>confdefs.h <<EOF
15080 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15081 EOF
15082
15083                                 ;;
15084                         (scanf)
15085                                 cf_value='/* nothing */'
15086                                 if test "$cf_scanf_attribute" != no ; then
15087                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15088
15089 cat >>confdefs.h <<\EOF
15090 #define GCC_SCANF 1
15091 EOF
15092
15093                                 fi
15094
15095 cat >>confdefs.h <<EOF
15096 #define GCC_SCANFLIKE(fmt,var) $cf_value
15097 EOF
15098
15099                                 ;;
15100                         (unused)
15101
15102 cat >>confdefs.h <<EOF
15103 #define GCC_UNUSED $cf_directive
15104 EOF
15105
15106                                 ;;
15107                         esac
15108                 fi
15109         done
15110 else
15111         fgrep define conftest.i >>confdefs.h
15112 fi
15113 rm -rf conftest*
15114 fi
15115
15116 fi
15117
15118 if test "x$with_warnings" = "xyes"; then
15119
15120         ADAFLAGS="$ADAFLAGS -gnatg"
15121
15122 fi
15123
15124 ###     use option --enable-assertions to turn on generation of assertion code
15125 echo "$as_me:15125: checking if you want to enable runtime assertions" >&5
15126 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15127
15128 # Check whether --enable-assertions or --disable-assertions was given.
15129 if test "${enable_assertions+set}" = set; then
15130   enableval="$enable_assertions"
15131   with_assertions=$enableval
15132 else
15133   with_assertions=no
15134 fi;
15135 echo "$as_me:15135: result: $with_assertions" >&5
15136 echo "${ECHO_T}$with_assertions" >&6
15137 if test -n "$GCC"
15138 then
15139         if test "$with_assertions" = no
15140         then
15141                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15142         else
15143
15144         ADAFLAGS="$ADAFLAGS -gnata"
15145
15146         fi
15147 fi
15148
15149 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15150
15151 cat >>confdefs.h <<\EOF
15152 #define HAVE_NC_ALLOC_H 1
15153 EOF
15154
15155 ###     use option --enable-expanded to generate certain macros as functions
15156
15157 # Check whether --enable-expanded or --disable-expanded was given.
15158 if test "${enable_expanded+set}" = set; then
15159   enableval="$enable_expanded"
15160   test "$enableval" = yes &&
15161 cat >>confdefs.h <<\EOF
15162 #define NCURSES_EXPANDED 1
15163 EOF
15164
15165 fi;
15166
15167 ###     use option --disable-macros to suppress macros in favor of functions
15168
15169 # Check whether --enable-macros or --disable-macros was given.
15170 if test "${enable_macros+set}" = set; then
15171   enableval="$enable_macros"
15172   test "$enableval" = no &&
15173 cat >>confdefs.h <<\EOF
15174 #define NCURSES_NOMACROS 1
15175 EOF
15176
15177 fi;
15178
15179 # Normally we only add trace() to the debug-library.  Allow this to be
15180 # extended to all models of the ncurses library:
15181 cf_all_traces=no
15182 case "$CFLAGS $CPPFLAGS" in
15183 (*-DTRACE*)
15184         cf_all_traces=yes
15185         ;;
15186 esac
15187
15188 echo "$as_me:15188: checking whether to add trace feature to all models" >&5
15189 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15190
15191 # Check whether --with-trace or --without-trace was given.
15192 if test "${with_trace+set}" = set; then
15193   withval="$with_trace"
15194   cf_with_trace=$withval
15195 else
15196   cf_with_trace=$cf_all_traces
15197 fi;
15198 echo "$as_me:15198: result: $cf_with_trace" >&5
15199 echo "${ECHO_T}$cf_with_trace" >&6
15200
15201 if test "$cf_with_trace" = yes ; then
15202         ADA_TRACE=TRUE
15203
15204 cf_fix_cppflags=no
15205 cf_new_cflags=
15206 cf_new_cppflags=
15207 cf_new_extra_cppflags=
15208
15209 for cf_add_cflags in -DTRACE
15210 do
15211 case $cf_fix_cppflags in
15212 (no)
15213         case $cf_add_cflags in
15214         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15215                 case $cf_add_cflags in
15216                 (-D*)
15217                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15218
15219                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15220                                 && test -z "${cf_tst_cflags}" \
15221                                 && cf_fix_cppflags=yes
15222
15223                         if test $cf_fix_cppflags = yes ; then
15224
15225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15227
15228                                 continue
15229                         elif test "${cf_tst_cflags}" = "\"'" ; then
15230
15231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15233
15234                                 continue
15235                         fi
15236                         ;;
15237                 esac
15238                 case "$CPPFLAGS" in
15239                 (*$cf_add_cflags)
15240                         ;;
15241                 (*)
15242                         case $cf_add_cflags in
15243                         (-D*)
15244                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15245
15246 CPPFLAGS=`echo "$CPPFLAGS" | \
15247         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15248                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15249
15250                                 ;;
15251                         esac
15252
15253         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15254         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15255
15256                         ;;
15257                 esac
15258                 ;;
15259         (*)
15260
15261         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15262         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15263
15264                 ;;
15265         esac
15266         ;;
15267 (yes)
15268
15269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15271
15272         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15273
15274         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15275                 && test -z "${cf_tst_cflags}" \
15276                 && cf_fix_cppflags=no
15277         ;;
15278 esac
15279 done
15280
15281 if test -n "$cf_new_cflags" ; then
15282
15283         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15284         CFLAGS="${CFLAGS}$cf_new_cflags"
15285
15286 fi
15287
15288 if test -n "$cf_new_cppflags" ; then
15289
15290         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15291         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15292
15293 fi
15294
15295 if test -n "$cf_new_extra_cppflags" ; then
15296
15297         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15298         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15299
15300 fi
15301
15302 else
15303         ADA_TRACE=FALSE
15304 fi
15305
15306 echo "$as_me:15306: checking if we want to use GNAT projects" >&5
15307 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15308
15309 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15310 if test "${enable_gnat_projects+set}" = set; then
15311   enableval="$enable_gnat_projects"
15312   test "$enableval" != no && enableval=yes
15313         if test "$enableval" != "yes" ; then
15314     enable_gnat_projects=no
15315         else
15316                 enable_gnat_projects=yes
15317         fi
15318 else
15319   enableval=yes
15320         enable_gnat_projects=yes
15321
15322 fi;
15323 echo "$as_me:15323: result: $enable_gnat_projects" >&5
15324 echo "${ECHO_T}$enable_gnat_projects" >&6
15325
15326 ###     Checks for libraries.
15327 case $cf_cv_system_name in
15328 (*mingw32*)
15329         ;;
15330 (*)
15331 echo "$as_me:15331: checking for gettimeofday" >&5
15332 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15333 if test "${ac_cv_func_gettimeofday+set}" = set; then
15334   echo $ECHO_N "(cached) $ECHO_C" >&6
15335 else
15336   cat >conftest.$ac_ext <<_ACEOF
15337 #line 15337 "configure"
15338 #include "confdefs.h"
15339 #define gettimeofday autoconf_temporary
15340 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15341 #undef gettimeofday
15342
15343 #ifdef __cplusplus
15344 extern "C"
15345 #endif
15346
15347 /* We use char because int might match the return type of a gcc2
15348    builtin and then its argument prototype would still apply.  */
15349 char gettimeofday (void);
15350
15351 int
15352 main (void)
15353 {
15354
15355 /* The GNU C library defines stubs for functions which it implements
15356     to always fail with ENOSYS.  Some functions are actually named
15357     something starting with __ and the normal name is an alias.  */
15358 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15359 #error found stub for gettimeofday
15360 #endif
15361
15362         return gettimeofday ();
15363   ;
15364   return 0;
15365 }
15366 _ACEOF
15367 rm -f conftest.$ac_objext conftest$ac_exeext
15368 if { (eval echo "$as_me:15368: \"$ac_link\"") >&5
15369   (eval $ac_link) 2>&5
15370   ac_status=$?
15371   echo "$as_me:15371: \$? = $ac_status" >&5
15372   (exit $ac_status); } &&
15373          { ac_try='test -s conftest$ac_exeext'
15374   { (eval echo "$as_me:15374: \"$ac_try\"") >&5
15375   (eval $ac_try) 2>&5
15376   ac_status=$?
15377   echo "$as_me:15377: \$? = $ac_status" >&5
15378   (exit $ac_status); }; }; then
15379   ac_cv_func_gettimeofday=yes
15380 else
15381   echo "$as_me: failed program was:" >&5
15382 cat conftest.$ac_ext >&5
15383 ac_cv_func_gettimeofday=no
15384 fi
15385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15386 fi
15387 echo "$as_me:15387: result: $ac_cv_func_gettimeofday" >&5
15388 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15389 if test $ac_cv_func_gettimeofday = yes; then
15390   cat >>confdefs.h <<\EOF
15391 #define HAVE_GETTIMEOFDAY 1
15392 EOF
15393
15394 else
15395
15396 echo "$as_me:15396: checking for gettimeofday in -lbsd" >&5
15397 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15398 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15399   echo $ECHO_N "(cached) $ECHO_C" >&6
15400 else
15401   ac_check_lib_save_LIBS=$LIBS
15402 LIBS="-lbsd  $LIBS"
15403 cat >conftest.$ac_ext <<_ACEOF
15404 #line 15404 "configure"
15405 #include "confdefs.h"
15406
15407 /* Override any gcc2 internal prototype to avoid an error.  */
15408 #ifdef __cplusplus
15409 extern "C"
15410 #endif
15411 /* We use char because int might match the return type of a gcc2
15412    builtin and then its argument prototype would still apply.  */
15413 char gettimeofday ();
15414 int
15415 main (void)
15416 {
15417 gettimeofday ();
15418   ;
15419   return 0;
15420 }
15421 _ACEOF
15422 rm -f conftest.$ac_objext conftest$ac_exeext
15423 if { (eval echo "$as_me:15423: \"$ac_link\"") >&5
15424   (eval $ac_link) 2>&5
15425   ac_status=$?
15426   echo "$as_me:15426: \$? = $ac_status" >&5
15427   (exit $ac_status); } &&
15428          { ac_try='test -s conftest$ac_exeext'
15429   { (eval echo "$as_me:15429: \"$ac_try\"") >&5
15430   (eval $ac_try) 2>&5
15431   ac_status=$?
15432   echo "$as_me:15432: \$? = $ac_status" >&5
15433   (exit $ac_status); }; }; then
15434   ac_cv_lib_bsd_gettimeofday=yes
15435 else
15436   echo "$as_me: failed program was:" >&5
15437 cat conftest.$ac_ext >&5
15438 ac_cv_lib_bsd_gettimeofday=no
15439 fi
15440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15441 LIBS=$ac_check_lib_save_LIBS
15442 fi
15443 echo "$as_me:15443: result: $ac_cv_lib_bsd_gettimeofday" >&5
15444 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15445 if test $ac_cv_lib_bsd_gettimeofday = yes; then
15446
15447 cat >>confdefs.h <<\EOF
15448 #define HAVE_GETTIMEOFDAY 1
15449 EOF
15450
15451         LIBS="$LIBS -lbsd"
15452 fi
15453
15454 fi
15455         ;;
15456 esac
15457
15458 ###     Checks for header files.
15459 echo "$as_me:15459: checking for ANSI C header files" >&5
15460 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15461 if test "${ac_cv_header_stdc+set}" = set; then
15462   echo $ECHO_N "(cached) $ECHO_C" >&6
15463 else
15464   cat >conftest.$ac_ext <<_ACEOF
15465 #line 15465 "configure"
15466 #include "confdefs.h"
15467 #include <stdlib.h>
15468 #include <stdarg.h>
15469 #include <string.h>
15470 #include <float.h>
15471
15472 _ACEOF
15473 if { (eval echo "$as_me:15473: \"$ac_cpp conftest.$ac_ext\"") >&5
15474   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15475   ac_status=$?
15476   egrep -v '^ *\+' conftest.er1 >conftest.err
15477   rm -f conftest.er1
15478   cat conftest.err >&5
15479   echo "$as_me:15479: \$? = $ac_status" >&5
15480   (exit $ac_status); } >/dev/null; then
15481   if test -s conftest.err; then
15482     ac_cpp_err=$ac_c_preproc_warn_flag
15483   else
15484     ac_cpp_err=
15485   fi
15486 else
15487   ac_cpp_err=yes
15488 fi
15489 if test -z "$ac_cpp_err"; then
15490   ac_cv_header_stdc=yes
15491 else
15492   echo "$as_me: failed program was:" >&5
15493   cat conftest.$ac_ext >&5
15494   ac_cv_header_stdc=no
15495 fi
15496 rm -f conftest.err conftest.$ac_ext
15497
15498 if test $ac_cv_header_stdc = yes; then
15499   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15500   cat >conftest.$ac_ext <<_ACEOF
15501 #line 15501 "configure"
15502 #include "confdefs.h"
15503 #include <string.h>
15504
15505 _ACEOF
15506 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15507   egrep "memchr" >/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   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15518   cat >conftest.$ac_ext <<_ACEOF
15519 #line 15519 "configure"
15520 #include "confdefs.h"
15521 #include <stdlib.h>
15522
15523 _ACEOF
15524 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15525   egrep "free" >/dev/null 2>&1; then
15526   :
15527 else
15528   ac_cv_header_stdc=no
15529 fi
15530 rm -rf conftest*
15531
15532 fi
15533
15534 if test $ac_cv_header_stdc = yes; then
15535   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15536   if test "$cross_compiling" = yes; then
15537   :
15538 else
15539   cat >conftest.$ac_ext <<_ACEOF
15540 #line 15540 "configure"
15541 #include "confdefs.h"
15542 #include <ctype.h>
15543 #if ((' ' & 0x0FF) == 0x020)
15544 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15545 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15546 #else
15547 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15548                      || ('j' <= (c) && (c) <= 'r') \
15549                      || ('s' <= (c) && (c) <= 'z'))
15550 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15551 #endif
15552
15553 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15554 int
15555 main (void)
15556 {
15557   int i;
15558   for (i = 0; i < 256; i++)
15559     if (XOR (islower (i), ISLOWER (i))
15560         || toupper (i) != TOUPPER (i))
15561       $ac_main_return(2);
15562   $ac_main_return (0);
15563 }
15564 _ACEOF
15565 rm -f conftest$ac_exeext
15566 if { (eval echo "$as_me:15566: \"$ac_link\"") >&5
15567   (eval $ac_link) 2>&5
15568   ac_status=$?
15569   echo "$as_me:15569: \$? = $ac_status" >&5
15570   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15571   { (eval echo "$as_me:15571: \"$ac_try\"") >&5
15572   (eval $ac_try) 2>&5
15573   ac_status=$?
15574   echo "$as_me:15574: \$? = $ac_status" >&5
15575   (exit $ac_status); }; }; then
15576   :
15577 else
15578   echo "$as_me: program exited with status $ac_status" >&5
15579 echo "$as_me: failed program was:" >&5
15580 cat conftest.$ac_ext >&5
15581 ac_cv_header_stdc=no
15582 fi
15583 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15584 fi
15585 fi
15586 fi
15587 echo "$as_me:15587: result: $ac_cv_header_stdc" >&5
15588 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15589 if test $ac_cv_header_stdc = yes; then
15590
15591 cat >>confdefs.h <<\EOF
15592 #define STDC_HEADERS 1
15593 EOF
15594
15595 fi
15596
15597 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15598
15599 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15600                   inttypes.h stdint.h unistd.h
15601 do
15602 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15603 echo "$as_me:15603: checking for $ac_header" >&5
15604 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15605 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15606   echo $ECHO_N "(cached) $ECHO_C" >&6
15607 else
15608   cat >conftest.$ac_ext <<_ACEOF
15609 #line 15609 "configure"
15610 #include "confdefs.h"
15611 $ac_includes_default
15612 #include <$ac_header>
15613 _ACEOF
15614 rm -f conftest.$ac_objext
15615 if { (eval echo "$as_me:15615: \"$ac_compile\"") >&5
15616   (eval $ac_compile) 2>&5
15617   ac_status=$?
15618   echo "$as_me:15618: \$? = $ac_status" >&5
15619   (exit $ac_status); } &&
15620          { ac_try='test -s conftest.$ac_objext'
15621   { (eval echo "$as_me:15621: \"$ac_try\"") >&5
15622   (eval $ac_try) 2>&5
15623   ac_status=$?
15624   echo "$as_me:15624: \$? = $ac_status" >&5
15625   (exit $ac_status); }; }; then
15626   eval "$as_ac_Header=yes"
15627 else
15628   echo "$as_me: failed program was:" >&5
15629 cat conftest.$ac_ext >&5
15630 eval "$as_ac_Header=no"
15631 fi
15632 rm -f conftest.$ac_objext conftest.$ac_ext
15633 fi
15634 echo "$as_me:15634: result: `eval echo '${'$as_ac_Header'}'`" >&5
15635 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15636 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15637   cat >>confdefs.h <<EOF
15638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15639 EOF
15640
15641 fi
15642 done
15643
15644 echo "$as_me:15644: checking for signed char" >&5
15645 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15646 if test "${ac_cv_type_signed_char+set}" = set; then
15647   echo $ECHO_N "(cached) $ECHO_C" >&6
15648 else
15649   cat >conftest.$ac_ext <<_ACEOF
15650 #line 15650 "configure"
15651 #include "confdefs.h"
15652 $ac_includes_default
15653 int
15654 main (void)
15655 {
15656 if ((signed char *) 0)
15657   return 0;
15658 if (sizeof (signed char))
15659   return 0;
15660   ;
15661   return 0;
15662 }
15663 _ACEOF
15664 rm -f conftest.$ac_objext
15665 if { (eval echo "$as_me:15665: \"$ac_compile\"") >&5
15666   (eval $ac_compile) 2>&5
15667   ac_status=$?
15668   echo "$as_me:15668: \$? = $ac_status" >&5
15669   (exit $ac_status); } &&
15670          { ac_try='test -s conftest.$ac_objext'
15671   { (eval echo "$as_me:15671: \"$ac_try\"") >&5
15672   (eval $ac_try) 2>&5
15673   ac_status=$?
15674   echo "$as_me:15674: \$? = $ac_status" >&5
15675   (exit $ac_status); }; }; then
15676   ac_cv_type_signed_char=yes
15677 else
15678   echo "$as_me: failed program was:" >&5
15679 cat conftest.$ac_ext >&5
15680 ac_cv_type_signed_char=no
15681 fi
15682 rm -f conftest.$ac_objext conftest.$ac_ext
15683 fi
15684 echo "$as_me:15684: result: $ac_cv_type_signed_char" >&5
15685 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15686
15687 echo "$as_me:15687: checking size of signed char" >&5
15688 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15689 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15690   echo $ECHO_N "(cached) $ECHO_C" >&6
15691 else
15692   if test "$ac_cv_type_signed_char" = yes; then
15693   if test "$cross_compiling" = yes; then
15694   # Depending upon the size, compute the lo and hi bounds.
15695 cat >conftest.$ac_ext <<_ACEOF
15696 #line 15696 "configure"
15697 #include "confdefs.h"
15698 $ac_includes_default
15699 int
15700 main (void)
15701 {
15702 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15703   ;
15704   return 0;
15705 }
15706 _ACEOF
15707 rm -f conftest.$ac_objext
15708 if { (eval echo "$as_me:15708: \"$ac_compile\"") >&5
15709   (eval $ac_compile) 2>&5
15710   ac_status=$?
15711   echo "$as_me:15711: \$? = $ac_status" >&5
15712   (exit $ac_status); } &&
15713          { ac_try='test -s conftest.$ac_objext'
15714   { (eval echo "$as_me:15714: \"$ac_try\"") >&5
15715   (eval $ac_try) 2>&5
15716   ac_status=$?
15717   echo "$as_me:15717: \$? = $ac_status" >&5
15718   (exit $ac_status); }; }; then
15719   ac_lo=0 ac_mid=0
15720   while :; do
15721     cat >conftest.$ac_ext <<_ACEOF
15722 #line 15722 "configure"
15723 #include "confdefs.h"
15724 $ac_includes_default
15725 int
15726 main (void)
15727 {
15728 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15729   ;
15730   return 0;
15731 }
15732 _ACEOF
15733 rm -f conftest.$ac_objext
15734 if { (eval echo "$as_me:15734: \"$ac_compile\"") >&5
15735   (eval $ac_compile) 2>&5
15736   ac_status=$?
15737   echo "$as_me:15737: \$? = $ac_status" >&5
15738   (exit $ac_status); } &&
15739          { ac_try='test -s conftest.$ac_objext'
15740   { (eval echo "$as_me:15740: \"$ac_try\"") >&5
15741   (eval $ac_try) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); }; }; then
15745   ac_hi=$ac_mid; break
15746 else
15747   echo "$as_me: failed program was:" >&5
15748 cat conftest.$ac_ext >&5
15749 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
15750 fi
15751 rm -f conftest.$ac_objext conftest.$ac_ext
15752   done
15753 else
15754   echo "$as_me: failed program was:" >&5
15755 cat conftest.$ac_ext >&5
15756 ac_hi=-1 ac_mid=-1
15757   while :; do
15758     cat >conftest.$ac_ext <<_ACEOF
15759 #line 15759 "configure"
15760 #include "confdefs.h"
15761 $ac_includes_default
15762 int
15763 main (void)
15764 {
15765 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15766   ;
15767   return 0;
15768 }
15769 _ACEOF
15770 rm -f conftest.$ac_objext
15771 if { (eval echo "$as_me:15771: \"$ac_compile\"") >&5
15772   (eval $ac_compile) 2>&5
15773   ac_status=$?
15774   echo "$as_me:15774: \$? = $ac_status" >&5
15775   (exit $ac_status); } &&
15776          { ac_try='test -s conftest.$ac_objext'
15777   { (eval echo "$as_me:15777: \"$ac_try\"") >&5
15778   (eval $ac_try) 2>&5
15779   ac_status=$?
15780   echo "$as_me:15780: \$? = $ac_status" >&5
15781   (exit $ac_status); }; }; then
15782   ac_lo=$ac_mid; break
15783 else
15784   echo "$as_me: failed program was:" >&5
15785 cat conftest.$ac_ext >&5
15786 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
15787 fi
15788 rm -f conftest.$ac_objext conftest.$ac_ext
15789   done
15790 fi
15791 rm -f conftest.$ac_objext conftest.$ac_ext
15792 # Binary search between lo and hi bounds.
15793 while test "x$ac_lo" != "x$ac_hi"; do
15794   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
15795   cat >conftest.$ac_ext <<_ACEOF
15796 #line 15796 "configure"
15797 #include "confdefs.h"
15798 $ac_includes_default
15799 int
15800 main (void)
15801 {
15802 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15803   ;
15804   return 0;
15805 }
15806 _ACEOF
15807 rm -f conftest.$ac_objext
15808 if { (eval echo "$as_me:15808: \"$ac_compile\"") >&5
15809   (eval $ac_compile) 2>&5
15810   ac_status=$?
15811   echo "$as_me:15811: \$? = $ac_status" >&5
15812   (exit $ac_status); } &&
15813          { ac_try='test -s conftest.$ac_objext'
15814   { (eval echo "$as_me:15814: \"$ac_try\"") >&5
15815   (eval $ac_try) 2>&5
15816   ac_status=$?
15817   echo "$as_me:15817: \$? = $ac_status" >&5
15818   (exit $ac_status); }; }; then
15819   ac_hi=$ac_mid
15820 else
15821   echo "$as_me: failed program was:" >&5
15822 cat conftest.$ac_ext >&5
15823 ac_lo=`expr $ac_mid + 1`
15824 fi
15825 rm -f conftest.$ac_objext conftest.$ac_ext
15826 done
15827 ac_cv_sizeof_signed_char=$ac_lo
15828 else
15829   if test "$cross_compiling" = yes; then
15830   { { echo "$as_me:15830: error: cannot run test program while cross compiling" >&5
15831 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15832    { (exit 1); exit 1; }; }
15833 else
15834   cat >conftest.$ac_ext <<_ACEOF
15835 #line 15835 "configure"
15836 #include "confdefs.h"
15837 $ac_includes_default
15838 int
15839 main (void)
15840 {
15841 FILE *f = fopen ("conftest.val", "w");
15842 if (!f)
15843   $ac_main_return (1);
15844 fprintf (f, "%d", (sizeof (signed char)));
15845 fclose (f);
15846   ;
15847   return 0;
15848 }
15849 _ACEOF
15850 rm -f conftest$ac_exeext
15851 if { (eval echo "$as_me:15851: \"$ac_link\"") >&5
15852   (eval $ac_link) 2>&5
15853   ac_status=$?
15854   echo "$as_me:15854: \$? = $ac_status" >&5
15855   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15856   { (eval echo "$as_me:15856: \"$ac_try\"") >&5
15857   (eval $ac_try) 2>&5
15858   ac_status=$?
15859   echo "$as_me:15859: \$? = $ac_status" >&5
15860   (exit $ac_status); }; }; then
15861   ac_cv_sizeof_signed_char=`cat conftest.val`
15862 else
15863   echo "$as_me: program exited with status $ac_status" >&5
15864 echo "$as_me: failed program was:" >&5
15865 cat conftest.$ac_ext >&5
15866 fi
15867 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15868 fi
15869 fi
15870 rm -f conftest.val
15871 else
15872   ac_cv_sizeof_signed_char=0
15873 fi
15874 fi
15875 echo "$as_me:15875: result: $ac_cv_sizeof_signed_char" >&5
15876 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
15877 cat >>confdefs.h <<EOF
15878 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
15879 EOF
15880
15881 echo "$as_me:15881: checking for ANSI C header files" >&5
15882 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15883 if test "${ac_cv_header_stdc+set}" = set; then
15884   echo $ECHO_N "(cached) $ECHO_C" >&6
15885 else
15886   cat >conftest.$ac_ext <<_ACEOF
15887 #line 15887 "configure"
15888 #include "confdefs.h"
15889 #include <stdlib.h>
15890 #include <stdarg.h>
15891 #include <string.h>
15892 #include <float.h>
15893
15894 _ACEOF
15895 if { (eval echo "$as_me:15895: \"$ac_cpp conftest.$ac_ext\"") >&5
15896   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15897   ac_status=$?
15898   egrep -v '^ *\+' conftest.er1 >conftest.err
15899   rm -f conftest.er1
15900   cat conftest.err >&5
15901   echo "$as_me:15901: \$? = $ac_status" >&5
15902   (exit $ac_status); } >/dev/null; then
15903   if test -s conftest.err; then
15904     ac_cpp_err=$ac_c_preproc_warn_flag
15905   else
15906     ac_cpp_err=
15907   fi
15908 else
15909   ac_cpp_err=yes
15910 fi
15911 if test -z "$ac_cpp_err"; then
15912   ac_cv_header_stdc=yes
15913 else
15914   echo "$as_me: failed program was:" >&5
15915   cat conftest.$ac_ext >&5
15916   ac_cv_header_stdc=no
15917 fi
15918 rm -f conftest.err conftest.$ac_ext
15919
15920 if test $ac_cv_header_stdc = yes; then
15921   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15922   cat >conftest.$ac_ext <<_ACEOF
15923 #line 15923 "configure"
15924 #include "confdefs.h"
15925 #include <string.h>
15926
15927 _ACEOF
15928 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15929   egrep "memchr" >/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   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15940   cat >conftest.$ac_ext <<_ACEOF
15941 #line 15941 "configure"
15942 #include "confdefs.h"
15943 #include <stdlib.h>
15944
15945 _ACEOF
15946 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15947   egrep "free" >/dev/null 2>&1; then
15948   :
15949 else
15950   ac_cv_header_stdc=no
15951 fi
15952 rm -rf conftest*
15953
15954 fi
15955
15956 if test $ac_cv_header_stdc = yes; then
15957   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15958   if test "$cross_compiling" = yes; then
15959   :
15960 else
15961   cat >conftest.$ac_ext <<_ACEOF
15962 #line 15962 "configure"
15963 #include "confdefs.h"
15964 #include <ctype.h>
15965 #if ((' ' & 0x0FF) == 0x020)
15966 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15967 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15968 #else
15969 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15970                      || ('j' <= (c) && (c) <= 'r') \
15971                      || ('s' <= (c) && (c) <= 'z'))
15972 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15973 #endif
15974
15975 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15976 int
15977 main (void)
15978 {
15979   int i;
15980   for (i = 0; i < 256; i++)
15981     if (XOR (islower (i), ISLOWER (i))
15982         || toupper (i) != TOUPPER (i))
15983       $ac_main_return(2);
15984   $ac_main_return (0);
15985 }
15986 _ACEOF
15987 rm -f conftest$ac_exeext
15988 if { (eval echo "$as_me:15988: \"$ac_link\"") >&5
15989   (eval $ac_link) 2>&5
15990   ac_status=$?
15991   echo "$as_me:15991: \$? = $ac_status" >&5
15992   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15993   { (eval echo "$as_me:15993: \"$ac_try\"") >&5
15994   (eval $ac_try) 2>&5
15995   ac_status=$?
15996   echo "$as_me:15996: \$? = $ac_status" >&5
15997   (exit $ac_status); }; }; then
15998   :
15999 else
16000   echo "$as_me: program exited with status $ac_status" >&5
16001 echo "$as_me: failed program was:" >&5
16002 cat conftest.$ac_ext >&5
16003 ac_cv_header_stdc=no
16004 fi
16005 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16006 fi
16007 fi
16008 fi
16009 echo "$as_me:16009: result: $ac_cv_header_stdc" >&5
16010 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16011 if test $ac_cv_header_stdc = yes; then
16012
16013 cat >>confdefs.h <<\EOF
16014 #define STDC_HEADERS 1
16015 EOF
16016
16017 fi
16018
16019 ac_header_dirent=no
16020 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16021   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16022 echo "$as_me:16022: checking for $ac_hdr that defines DIR" >&5
16023 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16024 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16025   echo $ECHO_N "(cached) $ECHO_C" >&6
16026 else
16027   cat >conftest.$ac_ext <<_ACEOF
16028 #line 16028 "configure"
16029 #include "confdefs.h"
16030 #include <sys/types.h>
16031 #include <$ac_hdr>
16032
16033 int
16034 main (void)
16035 {
16036 if ((DIR *) 0)
16037 return 0;
16038   ;
16039   return 0;
16040 }
16041 _ACEOF
16042 rm -f conftest.$ac_objext
16043 if { (eval echo "$as_me:16043: \"$ac_compile\"") >&5
16044   (eval $ac_compile) 2>&5
16045   ac_status=$?
16046   echo "$as_me:16046: \$? = $ac_status" >&5
16047   (exit $ac_status); } &&
16048          { ac_try='test -s conftest.$ac_objext'
16049   { (eval echo "$as_me:16049: \"$ac_try\"") >&5
16050   (eval $ac_try) 2>&5
16051   ac_status=$?
16052   echo "$as_me:16052: \$? = $ac_status" >&5
16053   (exit $ac_status); }; }; then
16054   eval "$as_ac_Header=yes"
16055 else
16056   echo "$as_me: failed program was:" >&5
16057 cat conftest.$ac_ext >&5
16058 eval "$as_ac_Header=no"
16059 fi
16060 rm -f conftest.$ac_objext conftest.$ac_ext
16061 fi
16062 echo "$as_me:16062: result: `eval echo '${'$as_ac_Header'}'`" >&5
16063 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16064 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16065   cat >>confdefs.h <<EOF
16066 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16067 EOF
16068
16069 ac_header_dirent=$ac_hdr; break
16070 fi
16071
16072 done
16073 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16074 if test $ac_header_dirent = dirent.h; then
16075   echo "$as_me:16075: checking for opendir in -ldir" >&5
16076 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16077 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16078   echo $ECHO_N "(cached) $ECHO_C" >&6
16079 else
16080   ac_check_lib_save_LIBS=$LIBS
16081 LIBS="-ldir  $LIBS"
16082 cat >conftest.$ac_ext <<_ACEOF
16083 #line 16083 "configure"
16084 #include "confdefs.h"
16085
16086 /* Override any gcc2 internal prototype to avoid an error.  */
16087 #ifdef __cplusplus
16088 extern "C"
16089 #endif
16090 /* We use char because int might match the return type of a gcc2
16091    builtin and then its argument prototype would still apply.  */
16092 char opendir ();
16093 int
16094 main (void)
16095 {
16096 opendir ();
16097   ;
16098   return 0;
16099 }
16100 _ACEOF
16101 rm -f conftest.$ac_objext conftest$ac_exeext
16102 if { (eval echo "$as_me:16102: \"$ac_link\"") >&5
16103   (eval $ac_link) 2>&5
16104   ac_status=$?
16105   echo "$as_me:16105: \$? = $ac_status" >&5
16106   (exit $ac_status); } &&
16107          { ac_try='test -s conftest$ac_exeext'
16108   { (eval echo "$as_me:16108: \"$ac_try\"") >&5
16109   (eval $ac_try) 2>&5
16110   ac_status=$?
16111   echo "$as_me:16111: \$? = $ac_status" >&5
16112   (exit $ac_status); }; }; then
16113   ac_cv_lib_dir_opendir=yes
16114 else
16115   echo "$as_me: failed program was:" >&5
16116 cat conftest.$ac_ext >&5
16117 ac_cv_lib_dir_opendir=no
16118 fi
16119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16120 LIBS=$ac_check_lib_save_LIBS
16121 fi
16122 echo "$as_me:16122: result: $ac_cv_lib_dir_opendir" >&5
16123 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16124 if test $ac_cv_lib_dir_opendir = yes; then
16125   LIBS="$LIBS -ldir"
16126 fi
16127
16128 else
16129   echo "$as_me:16129: checking for opendir in -lx" >&5
16130 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16131 if test "${ac_cv_lib_x_opendir+set}" = set; then
16132   echo $ECHO_N "(cached) $ECHO_C" >&6
16133 else
16134   ac_check_lib_save_LIBS=$LIBS
16135 LIBS="-lx  $LIBS"
16136 cat >conftest.$ac_ext <<_ACEOF
16137 #line 16137 "configure"
16138 #include "confdefs.h"
16139
16140 /* Override any gcc2 internal prototype to avoid an error.  */
16141 #ifdef __cplusplus
16142 extern "C"
16143 #endif
16144 /* We use char because int might match the return type of a gcc2
16145    builtin and then its argument prototype would still apply.  */
16146 char opendir ();
16147 int
16148 main (void)
16149 {
16150 opendir ();
16151   ;
16152   return 0;
16153 }
16154 _ACEOF
16155 rm -f conftest.$ac_objext conftest$ac_exeext
16156 if { (eval echo "$as_me:16156: \"$ac_link\"") >&5
16157   (eval $ac_link) 2>&5
16158   ac_status=$?
16159   echo "$as_me:16159: \$? = $ac_status" >&5
16160   (exit $ac_status); } &&
16161          { ac_try='test -s conftest$ac_exeext'
16162   { (eval echo "$as_me:16162: \"$ac_try\"") >&5
16163   (eval $ac_try) 2>&5
16164   ac_status=$?
16165   echo "$as_me:16165: \$? = $ac_status" >&5
16166   (exit $ac_status); }; }; then
16167   ac_cv_lib_x_opendir=yes
16168 else
16169   echo "$as_me: failed program was:" >&5
16170 cat conftest.$ac_ext >&5
16171 ac_cv_lib_x_opendir=no
16172 fi
16173 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16174 LIBS=$ac_check_lib_save_LIBS
16175 fi
16176 echo "$as_me:16176: result: $ac_cv_lib_x_opendir" >&5
16177 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16178 if test $ac_cv_lib_x_opendir = yes; then
16179   LIBS="$LIBS -lx"
16180 fi
16181
16182 fi
16183
16184 echo "$as_me:16184: checking whether time.h and sys/time.h may both be included" >&5
16185 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16186 if test "${ac_cv_header_time+set}" = set; then
16187   echo $ECHO_N "(cached) $ECHO_C" >&6
16188 else
16189   cat >conftest.$ac_ext <<_ACEOF
16190 #line 16190 "configure"
16191 #include "confdefs.h"
16192 #include <sys/types.h>
16193 #include <sys/time.h>
16194 #include <time.h>
16195
16196 int
16197 main (void)
16198 {
16199 if ((struct tm *) 0)
16200 return 0;
16201   ;
16202   return 0;
16203 }
16204 _ACEOF
16205 rm -f conftest.$ac_objext
16206 if { (eval echo "$as_me:16206: \"$ac_compile\"") >&5
16207   (eval $ac_compile) 2>&5
16208   ac_status=$?
16209   echo "$as_me:16209: \$? = $ac_status" >&5
16210   (exit $ac_status); } &&
16211          { ac_try='test -s conftest.$ac_objext'
16212   { (eval echo "$as_me:16212: \"$ac_try\"") >&5
16213   (eval $ac_try) 2>&5
16214   ac_status=$?
16215   echo "$as_me:16215: \$? = $ac_status" >&5
16216   (exit $ac_status); }; }; then
16217   ac_cv_header_time=yes
16218 else
16219   echo "$as_me: failed program was:" >&5
16220 cat conftest.$ac_ext >&5
16221 ac_cv_header_time=no
16222 fi
16223 rm -f conftest.$ac_objext conftest.$ac_ext
16224 fi
16225 echo "$as_me:16225: result: $ac_cv_header_time" >&5
16226 echo "${ECHO_T}$ac_cv_header_time" >&6
16227 if test $ac_cv_header_time = yes; then
16228
16229 cat >>confdefs.h <<\EOF
16230 #define TIME_WITH_SYS_TIME 1
16231 EOF
16232
16233 fi
16234
16235 ###     checks for compiler characteristics
16236 ac_ext=c
16237 ac_cpp='$CPP $CPPFLAGS'
16238 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16239 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16240 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16241 ac_main_return=return
16242
16243 echo "$as_me:16243: checking for an ANSI C-conforming const" >&5
16244 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16245 if test "${ac_cv_c_const+set}" = set; then
16246   echo $ECHO_N "(cached) $ECHO_C" >&6
16247 else
16248   cat >conftest.$ac_ext <<_ACEOF
16249 #line 16249 "configure"
16250 #include "confdefs.h"
16251
16252 int
16253 main (void)
16254 {
16255 /* FIXME: Include the comments suggested by Paul. */
16256 #ifndef __cplusplus
16257   /* Ultrix mips cc rejects this.  */
16258   typedef int charset[2];
16259   const charset x;
16260   /* SunOS 4.1.1 cc rejects this.  */
16261   char const *const *ccp;
16262   char **p;
16263   /* NEC SVR4.0.2 mips cc rejects this.  */
16264   struct point {int x, y;};
16265   static struct point const zero = {0,0};
16266   /* AIX XL C 1.02.0.0 rejects this.
16267      It does not let you subtract one const X* pointer from another in
16268      an arm of an if-expression whose if-part is not a constant
16269      expression */
16270   const char *g = "string";
16271   ccp = &g + (g ? g-g : 0);
16272   /* HPUX 7.0 cc rejects these. */
16273   ++ccp;
16274   p = (char**) ccp;
16275   ccp = (char const *const *) p;
16276   { /* SCO 3.2v4 cc rejects this.  */
16277     char *t;
16278     char const *s = 0 ? (char *) 0 : (char const *) 0;
16279
16280     *t++ = 0;
16281   }
16282   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16283     int x[] = {25, 17};
16284     const int *foo = &x[0];
16285     ++foo;
16286   }
16287   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16288     typedef const int *iptr;
16289     iptr p = 0;
16290     ++p;
16291   }
16292   { /* AIX XL C 1.02.0.0 rejects this saying
16293        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16294     struct s { int j; const int *ap[3]; };
16295     struct s *b; b->j = 5;
16296   }
16297   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16298     const int foo = 10;
16299   }
16300 #endif
16301
16302   ;
16303   return 0;
16304 }
16305 _ACEOF
16306 rm -f conftest.$ac_objext
16307 if { (eval echo "$as_me:16307: \"$ac_compile\"") >&5
16308   (eval $ac_compile) 2>&5
16309   ac_status=$?
16310   echo "$as_me:16310: \$? = $ac_status" >&5
16311   (exit $ac_status); } &&
16312          { ac_try='test -s conftest.$ac_objext'
16313   { (eval echo "$as_me:16313: \"$ac_try\"") >&5
16314   (eval $ac_try) 2>&5
16315   ac_status=$?
16316   echo "$as_me:16316: \$? = $ac_status" >&5
16317   (exit $ac_status); }; }; then
16318   ac_cv_c_const=yes
16319 else
16320   echo "$as_me: failed program was:" >&5
16321 cat conftest.$ac_ext >&5
16322 ac_cv_c_const=no
16323 fi
16324 rm -f conftest.$ac_objext conftest.$ac_ext
16325 fi
16326 echo "$as_me:16326: result: $ac_cv_c_const" >&5
16327 echo "${ECHO_T}$ac_cv_c_const" >&6
16328 if test $ac_cv_c_const = no; then
16329
16330 cat >>confdefs.h <<\EOF
16331 #define const
16332 EOF
16333
16334 fi
16335
16336 ###     Checks for external-data
16337
16338 echo "$as_me:16338: checking if data-only library module links" >&5
16339 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16340 if test "${cf_cv_link_dataonly+set}" = set; then
16341   echo $ECHO_N "(cached) $ECHO_C" >&6
16342 else
16343
16344         rm -f conftest.a
16345         cat >conftest.$ac_ext <<EOF
16346 #line 16346 "configure"
16347 int     testdata[3] = { 123, 456, 789 };
16348 EOF
16349         if { (eval echo "$as_me:16349: \"$ac_compile\"") >&5
16350   (eval $ac_compile) 2>&5
16351   ac_status=$?
16352   echo "$as_me:16352: \$? = $ac_status" >&5
16353   (exit $ac_status); } ; then
16354                 mv conftest.o data.o && \
16355                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16356         fi
16357         rm -f conftest.$ac_ext data.o
16358         cat >conftest.$ac_ext <<EOF
16359 #line 16359 "configure"
16360 int     testfunc(void)
16361 {
16362 #if defined(NeXT)
16363         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16364 #else
16365         extern int testdata[3];
16366         return testdata[0] == 123
16367            &&  testdata[1] == 456
16368            &&  testdata[2] == 789;
16369 #endif
16370 }
16371 EOF
16372         if { (eval echo "$as_me:16372: \"$ac_compile\"") >&5
16373   (eval $ac_compile) 2>&5
16374   ac_status=$?
16375   echo "$as_me:16375: \$? = $ac_status" >&5
16376   (exit $ac_status); }; then
16377                 mv conftest.o func.o && \
16378                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16379         fi
16380         rm -f conftest.$ac_ext func.o
16381         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16382         cf_saveLIBS="$LIBS"
16383         LIBS="conftest.a $LIBS"
16384         if test "$cross_compiling" = yes; then
16385   cf_cv_link_dataonly=unknown
16386 else
16387   cat >conftest.$ac_ext <<_ACEOF
16388 #line 16388 "configure"
16389 #include "confdefs.h"
16390
16391         int main(void)
16392         {
16393                 extern int testfunc();
16394                 ${cf_cv_main_return:-return} (!testfunc());
16395         }
16396
16397 _ACEOF
16398 rm -f conftest$ac_exeext
16399 if { (eval echo "$as_me:16399: \"$ac_link\"") >&5
16400   (eval $ac_link) 2>&5
16401   ac_status=$?
16402   echo "$as_me:16402: \$? = $ac_status" >&5
16403   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16404   { (eval echo "$as_me:16404: \"$ac_try\"") >&5
16405   (eval $ac_try) 2>&5
16406   ac_status=$?
16407   echo "$as_me:16407: \$? = $ac_status" >&5
16408   (exit $ac_status); }; }; then
16409   cf_cv_link_dataonly=yes
16410 else
16411   echo "$as_me: program exited with status $ac_status" >&5
16412 echo "$as_me: failed program was:" >&5
16413 cat conftest.$ac_ext >&5
16414 cf_cv_link_dataonly=no
16415 fi
16416 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16417 fi
16418         LIBS="$cf_saveLIBS"
16419
16420 fi
16421
16422 echo "$as_me:16422: result: $cf_cv_link_dataonly" >&5
16423 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16424
16425 if test "$cf_cv_link_dataonly" = no ; then
16426
16427 cat >>confdefs.h <<\EOF
16428 #define BROKEN_LINKER 1
16429 EOF
16430
16431         BROKEN_LINKER=1
16432 fi
16433
16434 ###     Checks for library functions.
16435
16436 for ac_header in \
16437 unistd.h \
16438
16439 do
16440 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16441 echo "$as_me:16441: checking for $ac_header" >&5
16442 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16443 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16444   echo $ECHO_N "(cached) $ECHO_C" >&6
16445 else
16446   cat >conftest.$ac_ext <<_ACEOF
16447 #line 16447 "configure"
16448 #include "confdefs.h"
16449 #include <$ac_header>
16450 _ACEOF
16451 if { (eval echo "$as_me:16451: \"$ac_cpp conftest.$ac_ext\"") >&5
16452   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16453   ac_status=$?
16454   egrep -v '^ *\+' conftest.er1 >conftest.err
16455   rm -f conftest.er1
16456   cat conftest.err >&5
16457   echo "$as_me:16457: \$? = $ac_status" >&5
16458   (exit $ac_status); } >/dev/null; then
16459   if test -s conftest.err; then
16460     ac_cpp_err=$ac_c_preproc_warn_flag
16461   else
16462     ac_cpp_err=
16463   fi
16464 else
16465   ac_cpp_err=yes
16466 fi
16467 if test -z "$ac_cpp_err"; then
16468   eval "$as_ac_Header=yes"
16469 else
16470   echo "$as_me: failed program was:" >&5
16471   cat conftest.$ac_ext >&5
16472   eval "$as_ac_Header=no"
16473 fi
16474 rm -f conftest.err conftest.$ac_ext
16475 fi
16476 echo "$as_me:16476: result: `eval echo '${'$as_ac_Header'}'`" >&5
16477 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16478 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16479   cat >>confdefs.h <<EOF
16480 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16481 EOF
16482
16483 fi
16484 done
16485
16486 echo "$as_me:16486: checking for working mkstemp" >&5
16487 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16488 if test "${cf_cv_func_mkstemp+set}" = set; then
16489   echo $ECHO_N "(cached) $ECHO_C" >&6
16490 else
16491
16492 rm -rf conftest*
16493 if test "$cross_compiling" = yes; then
16494   cf_cv_func_mkstemp=maybe
16495 else
16496   cat >conftest.$ac_ext <<_ACEOF
16497 #line 16497 "configure"
16498 #include "confdefs.h"
16499
16500 #include <sys/types.h>
16501 #ifdef HAVE_UNISTD_H
16502 #include <unistd.h>
16503 #endif
16504 #include <stdlib.h>
16505 #include <stdio.h>
16506 #include <string.h>
16507 #include <sys/stat.h>
16508 int main(void)
16509 {
16510         char *tmpl = "conftestXXXXXX";
16511         char name[2][80];
16512         int n;
16513         int result = 0;
16514         int fd;
16515         struct stat sb;
16516
16517         umask(077);
16518         for (n = 0; n < 2; ++n) {
16519                 strcpy(name[n], tmpl);
16520                 if ((fd = mkstemp(name[n])) >= 0) {
16521                         if (!strcmp(name[n], tmpl)
16522                          || stat(name[n], &sb) != 0
16523                          || (sb.st_mode & S_IFMT) != S_IFREG
16524                          || (sb.st_mode & 077) != 0) {
16525                                 result = 1;
16526                         }
16527                         close(fd);
16528                 }
16529         }
16530         if (result == 0
16531          && !strcmp(name[0], name[1]))
16532                 result = 1;
16533         ${cf_cv_main_return:-return}(result);
16534 }
16535
16536 _ACEOF
16537 rm -f conftest$ac_exeext
16538 if { (eval echo "$as_me:16538: \"$ac_link\"") >&5
16539   (eval $ac_link) 2>&5
16540   ac_status=$?
16541   echo "$as_me:16541: \$? = $ac_status" >&5
16542   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16543   { (eval echo "$as_me:16543: \"$ac_try\"") >&5
16544   (eval $ac_try) 2>&5
16545   ac_status=$?
16546   echo "$as_me:16546: \$? = $ac_status" >&5
16547   (exit $ac_status); }; }; then
16548   cf_cv_func_mkstemp=yes
16549
16550 else
16551   echo "$as_me: program exited with status $ac_status" >&5
16552 echo "$as_me: failed program was:" >&5
16553 cat conftest.$ac_ext >&5
16554 cf_cv_func_mkstemp=no
16555
16556 fi
16557 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16558 fi
16559
16560 fi
16561 echo "$as_me:16561: result: $cf_cv_func_mkstemp" >&5
16562 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16563 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16564         echo "$as_me:16564: checking for mkstemp" >&5
16565 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16566 if test "${ac_cv_func_mkstemp+set}" = set; then
16567   echo $ECHO_N "(cached) $ECHO_C" >&6
16568 else
16569   cat >conftest.$ac_ext <<_ACEOF
16570 #line 16570 "configure"
16571 #include "confdefs.h"
16572 #define mkstemp autoconf_temporary
16573 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16574 #undef mkstemp
16575
16576 #ifdef __cplusplus
16577 extern "C"
16578 #endif
16579
16580 /* We use char because int might match the return type of a gcc2
16581    builtin and then its argument prototype would still apply.  */
16582 char mkstemp (void);
16583
16584 int
16585 main (void)
16586 {
16587
16588 /* The GNU C library defines stubs for functions which it implements
16589     to always fail with ENOSYS.  Some functions are actually named
16590     something starting with __ and the normal name is an alias.  */
16591 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16592 #error found stub for mkstemp
16593 #endif
16594
16595         return mkstemp ();
16596   ;
16597   return 0;
16598 }
16599 _ACEOF
16600 rm -f conftest.$ac_objext conftest$ac_exeext
16601 if { (eval echo "$as_me:16601: \"$ac_link\"") >&5
16602   (eval $ac_link) 2>&5
16603   ac_status=$?
16604   echo "$as_me:16604: \$? = $ac_status" >&5
16605   (exit $ac_status); } &&
16606          { ac_try='test -s conftest$ac_exeext'
16607   { (eval echo "$as_me:16607: \"$ac_try\"") >&5
16608   (eval $ac_try) 2>&5
16609   ac_status=$?
16610   echo "$as_me:16610: \$? = $ac_status" >&5
16611   (exit $ac_status); }; }; then
16612   ac_cv_func_mkstemp=yes
16613 else
16614   echo "$as_me: failed program was:" >&5
16615 cat conftest.$ac_ext >&5
16616 ac_cv_func_mkstemp=no
16617 fi
16618 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16619 fi
16620 echo "$as_me:16620: result: $ac_cv_func_mkstemp" >&5
16621 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16622
16623 fi
16624 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16625
16626 cat >>confdefs.h <<\EOF
16627 #define HAVE_MKSTEMP 1
16628 EOF
16629
16630 fi
16631
16632 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16633         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16634         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
16635 fi
16636
16637 cf_with_ada=yes
16638 if test "$cf_with_ada" != "no" ; then
16639
16640 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16641 do
16642
16643 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16644
16645         unset ac_cv_path_cf_TEMP_gnat
16646         unset cf_TEMP_gnat
16647         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16648 set dummy $cf_prog_gnat; ac_word=$2
16649 echo "$as_me:16649: checking for $ac_word" >&5
16650 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16651 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16652   echo $ECHO_N "(cached) $ECHO_C" >&6
16653 else
16654   case $cf_TEMP_gnat in
16655   [\\/]* | ?:[\\/]*)
16656   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16657   ;;
16658   *)
16659   ac_save_IFS=$IFS; IFS=$ac_path_separator
16660 ac_dummy="$PATH"
16661 for ac_dir in $ac_dummy; do
16662   IFS=$ac_save_IFS
16663   test -z "$ac_dir" && ac_dir=.
16664   if $as_executable_p "$ac_dir/$ac_word"; then
16665    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16666    echo "$as_me:16666: found $ac_dir/$ac_word" >&5
16667    break
16668 fi
16669 done
16670
16671   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16672   ;;
16673 esac
16674 fi
16675 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16676
16677 if test -n "$cf_TEMP_gnat"; then
16678   echo "$as_me:16678: result: $cf_TEMP_gnat" >&5
16679 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16680 else
16681   echo "$as_me:16681: result: no" >&5
16682 echo "${ECHO_T}no" >&6
16683 fi
16684
16685         eval cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat
16686
16687         if test "x$cf_TEMP_gnat" != xno; then
16688                 unset cf_cv_gnat_version
16689                 unset cf_TEMP_gnat
16690
16691 echo "$as_me:16691: checking for $cf_prog_gnat version" >&5
16692 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16693 if test "${cf_cv_gnat_version+set}" = set; then
16694   echo $ECHO_N "(cached) $ECHO_C" >&6
16695 else
16696
16697 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16698         grep '[0-9].[0-9][0-9]*' |\
16699         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16700
16701 fi
16702 echo "$as_me:16702: result: $cf_cv_gnat_version" >&5
16703 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16704 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16705 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16706
16707         fi
16708         eval cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat
16709
16710         unset cf_TEMP_gnat
16711         unset cf_cv_gnat_version
16712         unset ac_cv_path_cf_TEMP_gnat
16713 done
16714
16715 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16716         cf_ada_make=
16717         cf_cv_prog_gnat_correct=no
16718 else
16719         cf_ada_make=gnatmake
16720         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16721                 # gprconfig is newer than gnatmake; we can continue...
16722                 cf_ada_config="##"
16723         else
16724                 rm -rf conftest* *~conftest*
16725                 if mkdir conftest.src
16726                 then
16727                         cf_ada_config=""
16728                         cd conftest.src
16729                         for cf_gprconfig in Ada C
16730                         do
16731                                 echo "$as_me:16731: checking for gprconfig name for $cf_gprconfig" >&5
16732 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16733                                 if test $cf_gprconfig = C
16734                                 then
16735                                         for cf_gprconfig_param in \
16736                                                 $cf_gprconfig,,,,GNATGCC \
16737                                                 $cf_gprconfig,,,,GCC \
16738                                                 $cf_gprconfig
16739                                         do
16740                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16741                                                 test -n "$cf_gprconfig_value" && break
16742                                         done
16743                                 else
16744                                         cf_gprconfig_param=$cf_gprconfig
16745                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16746                                 fi
16747                                 if test -n "$cf_gprconfig_value"
16748                                 then
16749                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
16750                                         echo "$as_me:16750: result: $cf_gprconfig_value" >&5
16751 echo "${ECHO_T}$cf_gprconfig_value" >&6
16752                                 else
16753                                         echo "$as_me:16753: result: missing" >&5
16754 echo "${ECHO_T}missing" >&6
16755                                         cf_ada_config="#"
16756                                         break
16757                                 fi
16758                         done
16759                         cd ..
16760                         rm -rf conftest* *~conftest*
16761                 fi
16762         fi
16763         if test "x$cf_ada_config" != "x#"
16764         then
16765
16766 echo "$as_me:16766: checking for gnat version" >&5
16767 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16768 if test "${cf_cv_gnat_version+set}" = set; then
16769   echo $ECHO_N "(cached) $ECHO_C" >&6
16770 else
16771
16772 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16773         grep '[0-9].[0-9][0-9]*' |\
16774         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16775
16776 fi
16777 echo "$as_me:16777: result: $cf_cv_gnat_version" >&5
16778 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16779 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16780
16781 case $cf_cv_gnat_version in
16782 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16783         cf_cv_prog_gnat_correct=yes
16784         ;;
16785 (*)
16786         { echo "$as_me:16786: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16787 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16788         cf_cv_prog_gnat_correct=no
16789         ;;
16790 esac
16791
16792                 # Extract the first word of "m4", so it can be a program name with args.
16793 set dummy m4; ac_word=$2
16794 echo "$as_me:16794: checking for $ac_word" >&5
16795 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16796 if test "${ac_cv_prog_M4_exists+set}" = set; then
16797   echo $ECHO_N "(cached) $ECHO_C" >&6
16798 else
16799   if test -n "$M4_exists"; then
16800   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16801 else
16802   ac_save_IFS=$IFS; IFS=$ac_path_separator
16803 ac_dummy="$PATH"
16804 for ac_dir in $ac_dummy; do
16805   IFS=$ac_save_IFS
16806   test -z "$ac_dir" && ac_dir=.
16807   $as_executable_p "$ac_dir/$ac_word" || continue
16808 ac_cv_prog_M4_exists="yes"
16809 echo "$as_me:16809: found $ac_dir/$ac_word" >&5
16810 break
16811 done
16812
16813   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16814 fi
16815 fi
16816 M4_exists=$ac_cv_prog_M4_exists
16817 if test -n "$M4_exists"; then
16818   echo "$as_me:16818: result: $M4_exists" >&5
16819 echo "${ECHO_T}$M4_exists" >&6
16820 else
16821   echo "$as_me:16821: result: no" >&5
16822 echo "${ECHO_T}no" >&6
16823 fi
16824
16825                 if test "$ac_cv_prog_M4_exists" = no; then
16826                         cf_cv_prog_gnat_correct=no
16827                         { echo "$as_me:16827: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16828 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16829                 fi
16830                 if test "$cf_cv_prog_gnat_correct" = yes; then
16831                         echo "$as_me:16831: checking if GNAT works" >&5
16832 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16833
16834 rm -rf conftest* *~conftest*
16835 cat >>conftest.ads <<CF_EOF
16836 procedure conftest;
16837 CF_EOF
16838 cat >>conftest.adb <<CF_EOF
16839 with Text_IO;
16840 with GNAT.OS_Lib;
16841 procedure conftest is
16842 begin
16843    Text_IO.Put ("Hello World");
16844    Text_IO.New_Line;
16845    GNAT.OS_Lib.OS_Exit (0);
16846 end conftest;
16847 CF_EOF
16848 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16849    if ( ./conftest 1>&5 2>&1 ) ; then
16850       cf_cv_prog_gnat_correct=yes
16851    else
16852       cf_cv_prog_gnat_correct=no
16853    fi
16854 else
16855    cf_cv_prog_gnat_correct=no
16856 fi
16857 rm -rf conftest* *~conftest*
16858
16859                         echo "$as_me:16859: result: $cf_cv_prog_gnat_correct" >&5
16860 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
16861                 fi
16862         else
16863                 cf_cv_prog_gnat_correct=no
16864         fi
16865 fi
16866
16867         if test "$cf_cv_prog_gnat_correct" = yes; then
16868
16869         echo "$as_me:16869: checking optimization options for ADAFLAGS" >&5
16870 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
16871         case "$CFLAGS" in
16872         (*-g*)
16873
16874         ADAFLAGS="$ADAFLAGS -g"
16875
16876                 ;;
16877         esac
16878         case "$CFLAGS" in
16879         (*-O*)
16880                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
16881
16882         ADAFLAGS="$ADAFLAGS $cf_O_flag"
16883
16884                 ;;
16885         esac
16886         echo "$as_me:16886: result: $ADAFLAGS" >&5
16887 echo "${ECHO_T}$ADAFLAGS" >&6
16888
16889 echo "$as_me:16889: checking if GNATPREP supports -T option" >&5
16890 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
16891 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
16892   echo $ECHO_N "(cached) $ECHO_C" >&6
16893 else
16894
16895 cf_cv_gnatprep_opt_t=no
16896 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
16897
16898 fi
16899 echo "$as_me:16899: result: $cf_cv_gnatprep_opt_t" >&5
16900 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
16901 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
16902
16903 echo "$as_me:16903: checking if GNAT supports generics" >&5
16904 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
16905 case $cf_cv_gnat_version in
16906 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16907         cf_gnat_generics=yes
16908         ;;
16909 (*)
16910         cf_gnat_generics=no
16911         ;;
16912 esac
16913 echo "$as_me:16913: result: $cf_gnat_generics" >&5
16914 echo "${ECHO_T}$cf_gnat_generics" >&6
16915
16916 if test "$cf_gnat_generics" = yes
16917 then
16918         cf_compile_generics=generics
16919         cf_generic_objects="\${GENOBJS}"
16920 else
16921         cf_compile_generics=
16922         cf_generic_objects=
16923 fi
16924
16925 echo "$as_me:16925: checking if GNAT supports SIGINT" >&5
16926 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
16927 if test "${cf_cv_gnat_sigint+set}" = set; then
16928   echo $ECHO_N "(cached) $ECHO_C" >&6
16929 else
16930
16931 rm -rf conftest* *~conftest*
16932 cat >>conftest.ads <<CF_EOF
16933 with Ada.Interrupts.Names;
16934
16935 package ConfTest is
16936
16937    pragma Warnings (Off);  --  the next pragma exists since 3.11p
16938    pragma Unreserve_All_Interrupts;
16939    pragma Warnings (On);
16940
16941    protected Process is
16942       procedure Stop;
16943       function Continue return Boolean;
16944       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
16945    private
16946       Done : Boolean := False;
16947    end Process;
16948
16949 end ConfTest;
16950 CF_EOF
16951 cat >>conftest.adb <<CF_EOF
16952 package body ConfTest is
16953    protected body Process is
16954       procedure Stop is
16955       begin
16956          Done := True;
16957       end Stop;
16958       function Continue return Boolean is
16959       begin
16960          return not Done;
16961       end Continue;
16962    end Process;
16963 end ConfTest;
16964 CF_EOF
16965 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
16966       cf_cv_gnat_sigint=yes
16967 else
16968    cf_cv_gnat_sigint=no
16969 fi
16970 rm -rf conftest* *~conftest*
16971
16972 fi
16973 echo "$as_me:16973: result: $cf_cv_gnat_sigint" >&5
16974 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
16975
16976 if test $cf_cv_gnat_sigint = yes ; then
16977         USE_GNAT_SIGINT=""
16978 else
16979         USE_GNAT_SIGINT="#"
16980 fi
16981
16982 cf_gnat_libraries=no
16983 cf_gnat_projects=no
16984
16985 if test "$enable_gnat_projects" != no ; then
16986 echo "$as_me:16986: checking if GNAT supports project files" >&5
16987 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
16988 case $cf_cv_gnat_version in
16989 (3.[0-9]*)
16990         ;;
16991 (*)
16992         case $cf_cv_system_name in
16993         (cygwin*|msys*)
16994                 ;;
16995         (*)
16996                 rm -rf conftest* *~conftest*
16997                 if mkdir conftest.src conftest.bin conftest.lib
16998                 then
16999                         cd conftest.src
17000                         rm -rf conftest* *~conftest*
17001                         cat >>library.gpr <<CF_EOF
17002 project Library is
17003   Kind := External ("LIB_KIND");
17004   for Library_Name use "ConfTest";
17005   for Object_Dir use ".";
17006   for Library_ALI_Dir use External("LIBRARY_DIR");
17007   for Library_Version use External ("SONAME");
17008   for Library_Kind use Kind;
17009   for Library_Dir use External("BUILD_DIR");
17010   Source_Dir := External ("SOURCE_DIR");
17011   for Source_Dirs use (Source_Dir);
17012 end Library;
17013 CF_EOF
17014                         cat >>confpackage.ads <<CF_EOF
17015 package ConfPackage is
17016    procedure conftest;
17017 end ConfPackage;
17018 CF_EOF
17019                         cat >>confpackage.adb <<CF_EOF
17020 with Text_IO;
17021 package body ConfPackage is
17022    procedure conftest is
17023    begin
17024       Text_IO.Put ("Hello World");
17025       Text_IO.New_Line;
17026    end conftest;
17027 end ConfPackage;
17028 CF_EOF
17029                         if ( $cf_ada_make $ADAFLAGS \
17030                                         -Plibrary.gpr \
17031                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
17032                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
17033                                         -XSOURCE_DIR=`pwd` \
17034                                         -XSONAME=libConfTest.so.1 \
17035                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17036                                 cf_gnat_projects=yes
17037                         fi
17038                         cd ..
17039                 fi
17040                 if test -f conftest.lib/confpackage.ali
17041                 then
17042                         cf_gnat_libraries=yes
17043                 fi
17044                 rm -rf conftest* *~conftest*
17045                 ;;
17046         esac
17047         ;;
17048 esac
17049 echo "$as_me:17049: result: $cf_gnat_projects" >&5
17050 echo "${ECHO_T}$cf_gnat_projects" >&6
17051 fi # enable_gnat_projects
17052
17053 if test $cf_gnat_projects = yes
17054 then
17055         echo "$as_me:17055: checking if GNAT supports libraries" >&5
17056 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17057         echo "$as_me:17057: result: $cf_gnat_libraries" >&5
17058 echo "${ECHO_T}$cf_gnat_libraries" >&6
17059 fi
17060
17061 if test "$cf_gnat_projects" = yes
17062 then
17063         USE_OLD_MAKERULES="#"
17064         USE_GNAT_PROJECTS=""
17065 else
17066         USE_OLD_MAKERULES=""
17067         USE_GNAT_PROJECTS="#"
17068 fi
17069
17070 if test "$cf_gnat_libraries" = yes
17071 then
17072         USE_GNAT_LIBRARIES=""
17073 else
17074         USE_GNAT_LIBRARIES="#"
17075 fi
17076
17077 echo "$as_me:17077: checking for ada-compiler" >&5
17078 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17079
17080 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17081 if test "${with_ada_compiler+set}" = set; then
17082   withval="$with_ada_compiler"
17083   cf_ada_compiler=$withval
17084 else
17085   cf_ada_compiler=gnatmake
17086 fi;
17087
17088 echo "$as_me:17088: result: $cf_ada_compiler" >&5
17089 echo "${ECHO_T}$cf_ada_compiler" >&6
17090
17091                 cf_ada_package=terminal_interface
17092
17093 echo "$as_me:17093: checking for ada-include" >&5
17094 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17095
17096 # Check whether --with-ada-include or --without-ada-include was given.
17097 if test "${with_ada_include+set}" = set; then
17098   withval="$with_ada_include"
17099
17100 else
17101   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17102 fi; if test -n "$prefix/share/ada/adainclude" ; then
17103
17104 if test "x$prefix" != xNONE; then
17105         cf_path_syntax="$prefix"
17106 else
17107         cf_path_syntax="$ac_default_prefix"
17108 fi
17109
17110 case ".$withval" in
17111 (.\$\(*\)*|.\'*\'*)
17112         ;;
17113 (..|./*|.\\*)
17114         ;;
17115 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17116         ;;
17117 (.\${*prefix}*|.\${*dir}*)
17118         eval withval="$withval"
17119         case ".$withval" in
17120         (.NONE/*)
17121                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17122                 ;;
17123         esac
17124         ;;
17125 (.no|.NONE/*)
17126         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17127         ;;
17128 (*)
17129         { { echo "$as_me:17129: error: expected a pathname, not \"$withval\"" >&5
17130 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17131    { (exit 1); exit 1; }; }
17132         ;;
17133 esac
17134
17135 fi
17136 eval ADA_INCLUDE="$withval"
17137
17138 echo "$as_me:17138: result: $ADA_INCLUDE" >&5
17139 echo "${ECHO_T}$ADA_INCLUDE" >&6
17140
17141 echo "$as_me:17141: checking for ada-objects" >&5
17142 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17143
17144 # Check whether --with-ada-objects or --without-ada-objects was given.
17145 if test "${with_ada_objects+set}" = set; then
17146   withval="$with_ada_objects"
17147
17148 else
17149   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17150 fi; if test -n "$prefix/lib/ada/adalib" ; then
17151
17152 if test "x$prefix" != xNONE; then
17153         cf_path_syntax="$prefix"
17154 else
17155         cf_path_syntax="$ac_default_prefix"
17156 fi
17157
17158 case ".$withval" in
17159 (.\$\(*\)*|.\'*\'*)
17160         ;;
17161 (..|./*|.\\*)
17162         ;;
17163 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17164         ;;
17165 (.\${*prefix}*|.\${*dir}*)
17166         eval withval="$withval"
17167         case ".$withval" in
17168         (.NONE/*)
17169                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17170                 ;;
17171         esac
17172         ;;
17173 (.no|.NONE/*)
17174         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
17175         ;;
17176 (*)
17177         { { echo "$as_me:17177: error: expected a pathname, not \"$withval\"" >&5
17178 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17179    { (exit 1); exit 1; }; }
17180         ;;
17181 esac
17182
17183 fi
17184 eval ADA_OBJECTS="$withval"
17185
17186 echo "$as_me:17186: result: $ADA_OBJECTS" >&5
17187 echo "${ECHO_T}$ADA_OBJECTS" >&6
17188
17189 echo "$as_me:17189: checking if an Ada95 shared-library should be built" >&5
17190 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17191
17192 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17193 if test "${with_ada_sharedlib+set}" = set; then
17194   withval="$with_ada_sharedlib"
17195   with_ada_sharedlib=$withval
17196 else
17197   with_ada_sharedlib=no
17198 fi;
17199 echo "$as_me:17199: result: $with_ada_sharedlib" >&5
17200 echo "${ECHO_T}$with_ada_sharedlib" >&6
17201
17202 if test "x$with_ada_sharedlib" != xno
17203 then
17204         if test "x$cf_gnat_projects" != xyes
17205         then
17206                 { echo "$as_me:17206: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17207 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17208                 with_ada_sharedlib=no
17209         fi
17210 fi
17211
17212 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17213 MAKE_ADA_SHAREDLIB="#"
17214
17215 if test "x$with_ada_sharedlib" != xno
17216 then
17217         MAKE_ADA_SHAREDLIB=
17218         if test "x$with_ada_sharedlib" != xyes
17219         then
17220                 ADA_SHAREDLIB="$with_ada_sharedlib"
17221         fi
17222 fi
17223
17224                 # allow the Ada binding to be renamed
17225
17226 echo "$as_me:17226: checking for ada-libname" >&5
17227 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17228
17229 # Check whether --with-ada-libname or --without-ada-libname was given.
17230 if test "${with_ada_libname+set}" = set; then
17231   withval="$with_ada_libname"
17232   ADA_LIBNAME=$withval
17233 else
17234   ADA_LIBNAME=AdaCurses
17235 fi;
17236 case "x$ADA_LIBNAME" in
17237 (x|xyes|xno)
17238         ADA_LIBNAME=AdaCurses
17239         ;;
17240 esac
17241
17242 echo "$as_me:17242: result: $ADA_LIBNAME" >&5
17243 echo "${ECHO_T}$ADA_LIBNAME" >&6
17244
17245         else
17246                 { { echo "$as_me:17246: error: No usable Ada compiler found" >&5
17247 echo "$as_me: error: No usable Ada compiler found" >&2;}
17248    { (exit 1); exit 1; }; }
17249         fi
17250 else
17251         { { echo "$as_me:17251: error: The Ada compiler is needed for this package" >&5
17252 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17253    { (exit 1); exit 1; }; }
17254 fi
17255
17256 ################################################################################
17257
17258 # not needed
17259 TINFO_LDFLAGS2=
17260
17261 TINFO_LIBS=
17262
17263 ### Construct the list of include-directories to be generated
17264
17265 if test "$srcdir" != "."; then
17266         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17267 fi
17268 CPPFLAGS="-I../include $CPPFLAGS"
17269 if test "$srcdir" != "."; then
17270         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17271 fi
17272 CPPFLAGS="-I. $CPPFLAGS"
17273
17274 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17275 if test "$srcdir" != "."; then
17276         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17277 fi
17278 if test "$GCC" != yes; then
17279         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17280 elif test "$includedir" != "/usr/include"; then
17281         if test "$includedir" = '${prefix}/include' ; then
17282                 if test x$prefix != x/usr ; then
17283                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17284                 fi
17285         else
17286                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17287         fi
17288 fi
17289
17290 ### Build up pieces for makefile rules
17291 echo "$as_me:17291: checking default library suffix" >&5
17292 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17293
17294         case $DFT_LWR_MODEL in
17295         (libtool) DFT_ARG_SUFFIX=''   ;;
17296         (normal)  DFT_ARG_SUFFIX=''   ;;
17297         (debug)   DFT_ARG_SUFFIX='_g' ;;
17298         (profile) DFT_ARG_SUFFIX='_p' ;;
17299         (shared)  DFT_ARG_SUFFIX=''   ;;
17300         esac
17301         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17302 echo "$as_me:17302: result: $DFT_ARG_SUFFIX" >&5
17303 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17304
17305 echo "$as_me:17305: checking default library-dependency suffix" >&5
17306 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17307
17308         case X$DFT_LWR_MODEL in
17309         (Xlibtool)
17310                 DFT_LIB_SUFFIX='.la'
17311                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17312                 ;;
17313         (Xdebug)
17314                 case $cf_cv_system_name in
17315                 (*-msvc*)
17316                         DFT_LIB_SUFFIX='_g.lib'
17317                         ;;
17318                 (*)
17319                         DFT_LIB_SUFFIX='_g.a'
17320                         ;;
17321                 esac
17322                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17323                 ;;
17324         (Xprofile)
17325                 case $cf_cv_system_name in
17326                 (*-msvc*)
17327                         DFT_LIB_SUFFIX='_p.lib'
17328                         ;;
17329                 (*)
17330                         DFT_LIB_SUFFIX='_p.a'
17331                         ;;
17332                 esac
17333                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17334                 ;;
17335         (Xshared)
17336                 case $cf_cv_system_name in
17337                 (aix[5-7]*)
17338                         DFT_LIB_SUFFIX='.so'
17339                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17340                         ;;
17341                 (*-msvc*)
17342                         DFT_LIB_SUFFIX='.dll'
17343                         DFT_DEP_SUFFIX='.dll.lib'
17344                         ;;
17345                 (cygwin*|msys*|mingw*)
17346                         DFT_LIB_SUFFIX='.dll'
17347                         DFT_DEP_SUFFIX='.dll.a'
17348                         ;;
17349                 (darwin*)
17350                         DFT_LIB_SUFFIX='.dylib'
17351                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17352                         ;;
17353                 (hpux*)
17354                         case $target in
17355                         (ia64*)
17356                                 DFT_LIB_SUFFIX='.so'
17357                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17358                                 ;;
17359                         (*)
17360                                 DFT_LIB_SUFFIX='.sl'
17361                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17362                                 ;;
17363                         esac
17364                         ;;
17365                 (*)
17366                         DFT_LIB_SUFFIX='.so'
17367                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17368                         ;;
17369                 esac
17370                 ;;
17371         (*)
17372                 case $target in
17373                 (*-msvc*)
17374                         DFT_LIB_SUFFIX='.lib'
17375                         ;;
17376                 (*)
17377                         DFT_LIB_SUFFIX='.a'
17378                         ;;
17379                 esac
17380                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17381                 ;;
17382         esac
17383         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17384         then
17385                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17386                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17387         fi
17388 echo "$as_me:17388: result: $DFT_DEP_SUFFIX" >&5
17389 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17390
17391 echo "$as_me:17391: checking default object directory" >&5
17392 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17393
17394         case $DFT_LWR_MODEL in
17395         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17396         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17397         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17398         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17399         (shared)
17400                 case $cf_cv_system_name in
17401                 (cygwin|msys)
17402                         DFT_OBJ_SUBDIR='objects' ;;
17403                 (*)
17404                         DFT_OBJ_SUBDIR='obj_s' ;;
17405                 esac
17406         esac
17407 echo "$as_me:17407: result: $DFT_OBJ_SUBDIR" >&5
17408 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17409
17410 ### Set up low-level terminfo dependencies for makefiles.
17411
17412 if test "$DFT_LWR_MODEL" = shared ; then
17413         case $cf_cv_system_name in
17414         (cygwin*)
17415                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17416                 ;;
17417         (msys*)
17418                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17419                 ;;
17420         esac
17421 fi
17422
17423 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17424
17425 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17426
17427 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17428
17429 ### Construct the list of subdirectories for which we'll customize makefiles
17430 ### with the appropriate compile-rules.
17431
17432 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17433
17434 cat >>confdefs.h <<EOF
17435 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17436 EOF
17437
17438 ################################################################################
17439
17440 TEST_ARG2=
17441
17442 TEST_LIBS2=
17443
17444 NCURSES_SHLIB2="sh -c"
17445
17446 ADA_SUBDIRS="include gen src doc"
17447 if test "x$cf_with_tests" != "xno" ; then
17448         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17449 fi
17450 for cf_dir in $ADA_SUBDIRS
17451 do
17452         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17453 done
17454
17455 NCURSES_TREE="#"
17456
17457 EXTERNAL_TREE=
17458
17459 # match layout used by make-tar.sh
17460 ADAHTML_DIR=../doc/ada
17461
17462 if test "x$cross_compiling" = xyes ; then
17463         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17464 else
17465         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17466 fi
17467
17468 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"
17469 ac_config_commands="$ac_config_commands default"
17470 cat >confcache <<\_ACEOF
17471 # This file is a shell script that caches the results of configure
17472 # tests run on this system so they can be shared between configure
17473 # scripts and configure runs, see configure's option --config-cache.
17474 # It is not useful on other systems.  If it contains results you don't
17475 # want to keep, you may remove or edit it.
17476 #
17477 # config.status only pays attention to the cache file if you give it
17478 # the --recheck option to rerun configure.
17479 #
17480 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17481 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17482 # following values.
17483
17484 _ACEOF
17485
17486 # The following way of writing the cache mishandles newlines in values,
17487 # but we know of no workaround that is simple, portable, and efficient.
17488 # So, don't put newlines in cache variables' values.
17489 # Ultrix sh set writes to stderr and can't be redirected directly,
17490 # and sets the high bit in the cache file unless we assign to the vars.
17491 {
17492   (set) 2>&1 |
17493     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17494     *ac_space=\ *)
17495       # `set' does not quote correctly, so add quotes (double-quote
17496       # substitution turns \\\\ into \\, and sed turns \\ into \).
17497       sed -n \
17498         "s/'/'\\\\''/g;
17499           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17500       ;;
17501     *)
17502       # `set' quotes correctly as required by POSIX, so do not add quotes.
17503       sed -n \
17504         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17505       ;;
17506     esac;
17507 } |
17508   sed '
17509      t clear
17510      : clear
17511      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17512      t end
17513      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17514      : end' >>confcache
17515 if cmp -s $cache_file confcache; then :; else
17516   if test -w $cache_file; then
17517     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17518     cat confcache >$cache_file
17519   else
17520     echo "not updating unwritable cache $cache_file"
17521   fi
17522 fi
17523 rm -f confcache
17524
17525 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17526 # Let make expand exec_prefix.
17527 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17528
17529 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17530 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17531 # trailing colons and then remove the whole line if VPATH becomes empty
17532 # (actually we leave an empty line to preserve line numbers).
17533 if test "x$srcdir" = x.; then
17534   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17535 s/:*\$(srcdir):*/:/;
17536 s/:*\${srcdir}:*/:/;
17537 s/:*@srcdir@:*/:/;
17538 s/^\([^=]*=[    ]*\):*/\1/;
17539 s/:*$//;
17540 s/^[^=]*=[      ]*$//;
17541 }'
17542 fi
17543
17544 DEFS=-DHAVE_CONFIG_H
17545
17546 : ${CONFIG_STATUS=./config.status}
17547 ac_clean_files_save=$ac_clean_files
17548 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17549 { echo "$as_me:17549: creating $CONFIG_STATUS" >&5
17550 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17551 cat >$CONFIG_STATUS <<_ACEOF
17552 #! $SHELL
17553 # Generated automatically by configure.
17554 # Run this file to recreate the current configuration.
17555 # Compiler output produced by configure, useful for debugging
17556 # configure, is in config.log if it exists.
17557
17558 debug=false
17559 SHELL=\${CONFIG_SHELL-$SHELL}
17560 ac_cs_invocation="\$0 \$@"
17561
17562 CLICOLOR_FORCE= GREP_OPTIONS=
17563 unset CLICOLOR_FORCE GREP_OPTIONS
17564 _ACEOF
17565
17566 cat >>$CONFIG_STATUS <<\_ACEOF
17567 # Be Bourne compatible
17568 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17569   emulate sh
17570   NULLCMD=:
17571 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17572   set -o posix
17573 fi
17574
17575 # Name of the executable.
17576 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17577
17578 if expr a : '\(a\)' >/dev/null 2>&1; then
17579   as_expr=expr
17580 else
17581   as_expr=false
17582 fi
17583
17584 rm -f conf$$ conf$$.exe conf$$.file
17585 echo >conf$$.file
17586 if ln -s conf$$.file conf$$ 2>/dev/null; then
17587   # We could just check for DJGPP; but this test a) works b) is more generic
17588   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17589   if test -f conf$$.exe; then
17590     # Don't use ln at all; we don't have any links
17591     as_ln_s='cp -p'
17592   else
17593     as_ln_s='ln -s'
17594   fi
17595 elif ln conf$$.file conf$$ 2>/dev/null; then
17596   as_ln_s=ln
17597 else
17598   as_ln_s='cp -p'
17599 fi
17600 rm -f conf$$ conf$$.exe conf$$.file
17601
17602 as_executable_p="test -f"
17603
17604 # Support unset when possible.
17605 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17606   as_unset=unset
17607 else
17608   as_unset=false
17609 fi
17610
17611 # NLS nuisances.
17612 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17613 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17614 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17615 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17616 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17617 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17618 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17619 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17620
17621 # IFS
17622 # We need space, tab and new line, in precisely that order.
17623 as_nl='
17624 '
17625 IFS="   $as_nl"
17626
17627 # CDPATH.
17628 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17629
17630 exec 6>&1
17631
17632 _ACEOF
17633
17634 # Files that config.status was made for.
17635 if test -n "$ac_config_files"; then
17636   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17637 fi
17638
17639 if test -n "$ac_config_headers"; then
17640   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17641 fi
17642
17643 if test -n "$ac_config_links"; then
17644   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17645 fi
17646
17647 if test -n "$ac_config_commands"; then
17648   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17649 fi
17650
17651 cat >>$CONFIG_STATUS <<\EOF
17652
17653 ac_cs_usage="\
17654 \`$as_me' instantiates files from templates according to the
17655 current configuration.
17656
17657 Usage: $0 [OPTIONS] [FILE]...
17658
17659   -h, --help       print this help, then exit
17660   -V, --version    print version number, then exit
17661   -d, --debug      don't remove temporary files
17662       --recheck    update $as_me by reconfiguring in the same conditions
17663   --file=FILE[:TEMPLATE]
17664                    instantiate the configuration file FILE
17665   --header=FILE[:TEMPLATE]
17666                    instantiate the configuration header FILE
17667
17668 Configuration files:
17669 $config_files
17670
17671 Configuration headers:
17672 $config_headers
17673
17674 Configuration commands:
17675 $config_commands
17676
17677 Report bugs to <dickey@invisible-island.net>."
17678 EOF
17679
17680 cat >>$CONFIG_STATUS <<EOF
17681 ac_cs_version="\\
17682 config.status
17683 configured by $0, generated by GNU Autoconf 2.52.20200802,
17684   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17685
17686 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17687 Free Software Foundation, Inc.
17688 This config.status script is free software; the Free Software Foundation
17689 gives unlimited permission to copy, distribute and modify it."
17690 srcdir=$srcdir
17691 INSTALL="$INSTALL"
17692 EOF
17693
17694 cat >>$CONFIG_STATUS <<\EOF
17695 # If no file are specified by the user, then we need to provide default
17696 # value.  By we need to know if files were specified by the user.
17697 ac_need_defaults=:
17698 while test $# != 0
17699 do
17700   case $1 in
17701   --*=*)
17702     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17703     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17704     shift
17705     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17706     shift
17707     ;;
17708   -*);;
17709   *) # This is not an option, so the user has probably given explicit
17710      # arguments.
17711      ac_need_defaults=false;;
17712   esac
17713
17714   case $1 in
17715   # Handling of the options.
17716 EOF
17717 cat >>$CONFIG_STATUS <<EOF
17718   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17719     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17720     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17721 EOF
17722 cat >>$CONFIG_STATUS <<\EOF
17723   --version | --vers* | -V )
17724     echo "$ac_cs_version"; exit 0 ;;
17725   --he | --h)
17726     # Conflict between --help and --header
17727     { { echo "$as_me:17727: error: ambiguous option: $1
17728 Try \`$0 --help' for more information." >&5
17729 echo "$as_me: error: ambiguous option: $1
17730 Try \`$0 --help' for more information." >&2;}
17731    { (exit 1); exit 1; }; };;
17732   --help | --hel | -h )
17733     echo "$ac_cs_usage"; exit 0 ;;
17734   --debug | --d* | -d )
17735     debug=: ;;
17736   --file | --fil | --fi | --f )
17737     shift
17738     CONFIG_FILES="$CONFIG_FILES $1"
17739     ac_need_defaults=false;;
17740   --header | --heade | --head | --hea )
17741     shift
17742     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17743     ac_need_defaults=false;;
17744
17745   # This is an error.
17746   -*) { { echo "$as_me:17746: error: unrecognized option: $1
17747 Try \`$0 --help' for more information." >&5
17748 echo "$as_me: error: unrecognized option: $1
17749 Try \`$0 --help' for more information." >&2;}
17750    { (exit 1); exit 1; }; } ;;
17751
17752   *) ac_config_targets="$ac_config_targets $1" ;;
17753
17754   esac
17755   shift
17756 done
17757
17758 exec 5>>config.log
17759 cat >&5 << _ACEOF
17760
17761 ## ----------------------- ##
17762 ## Running config.status.  ##
17763 ## ----------------------- ##
17764
17765 This file was extended by $as_me 2.52.20200802, executed with
17766   CONFIG_FILES    = $CONFIG_FILES
17767   CONFIG_HEADERS  = $CONFIG_HEADERS
17768   CONFIG_LINKS    = $CONFIG_LINKS
17769   CONFIG_COMMANDS = $CONFIG_COMMANDS
17770   > $ac_cs_invocation
17771 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17772
17773 _ACEOF
17774 EOF
17775
17776 cat >>$CONFIG_STATUS <<EOF
17777 #
17778 # INIT-COMMANDS section.
17779 #
17780
17781 ### Special initialization commands, used to pass information from the
17782 ### configuration-run into config.status
17783
17784 AWK="$AWK"
17785 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17786 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17787 LIB_NAME="$LIB_NAME"
17788 LIB_PREFIX="$LIB_PREFIX"
17789 LIB_SUFFIX="$LIB_SUFFIX"
17790 LN_S="$LN_S"
17791 NCURSES_MAJOR="$NCURSES_MAJOR"
17792 NCURSES_MINOR="$NCURSES_MINOR"
17793 NCURSES_PATCH="$NCURSES_PATCH"
17794 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17795 cf_cv_abi_version="$cf_cv_abi_version"
17796 cf_cv_rel_version="$cf_cv_rel_version"
17797 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17798 cf_cv_shared_soname='$cf_cv_shared_soname'
17799 cf_cv_shlib_version="$cf_cv_shlib_version"
17800 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17801 cf_cv_system_name="$cf_cv_system_name"
17802 host="$host"
17803 target="$target"
17804
17805 EOF
17806
17807 cat >>$CONFIG_STATUS <<\EOF
17808 for ac_config_target in $ac_config_targets
17809 do
17810   case "$ac_config_target" in
17811   # Handling of arguments.
17812   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17813   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17814   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17815   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17816   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17817   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17818   *) { { echo "$as_me:17818: error: invalid argument: $ac_config_target" >&5
17819 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17820    { (exit 1); exit 1; }; };;
17821   esac
17822 done
17823
17824 # If the user did not use the arguments to specify the items to instantiate,
17825 # then the envvar interface is used.  Set only those that are not.
17826 # We use the long form for the default assignment because of an extremely
17827 # bizarre bug on SunOS 4.1.3.
17828 if $ac_need_defaults; then
17829   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17830   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17831   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17832 fi
17833
17834 # Create a temporary directory, and hook for its removal unless debugging.
17835 $debug ||
17836 {
17837   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17838   trap '{ (exit 1); exit 1; }' 1 2 13 15
17839 }
17840
17841 # Create a (secure) tmp directory for tmp files.
17842 : ${TMPDIR=/tmp}
17843 {
17844   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17845   test -n "$tmp" && test -d "$tmp"
17846 }  ||
17847 {
17848   tmp=$TMPDIR/cs$$-$RANDOM
17849   (umask 077 && mkdir $tmp)
17850 } ||
17851 {
17852    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17853    { (exit 1); exit 1; }
17854 }
17855
17856 EOF
17857
17858 cat >>$CONFIG_STATUS <<EOF
17859
17860 #
17861 # CONFIG_FILES section.
17862 #
17863
17864 # No need to generate the scripts if there are no CONFIG_FILES.
17865 # This happens for instance when ./config.status config.h
17866 if test -n "\$CONFIG_FILES"; then
17867   # Protect against being on the right side of a sed subst in config.status.
17868   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17869    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17870 s,@SHELL@,$SHELL,;t t
17871 s,@exec_prefix@,$exec_prefix,;t t
17872 s,@prefix@,$prefix,;t t
17873 s,@program_transform_name@,$program_transform_name,;t t
17874 s,@bindir@,$bindir,;t t
17875 s,@sbindir@,$sbindir,;t t
17876 s,@libexecdir@,$libexecdir,;t t
17877 s,@datarootdir@,$datarootdir,;t t
17878 s,@datadir@,$datadir,;t t
17879 s,@sysconfdir@,$sysconfdir,;t t
17880 s,@sharedstatedir@,$sharedstatedir,;t t
17881 s,@localstatedir@,$localstatedir,;t t
17882 s,@runstatedir@,$runstatedir,;t t
17883 s,@libdir@,$libdir,;t t
17884 s,@includedir@,$includedir,;t t
17885 s,@oldincludedir@,$oldincludedir,;t t
17886 s,@infodir@,$infodir,;t t
17887 s,@mandir@,$mandir,;t t
17888 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17889 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17890 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17891 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17892 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17893 s,@build_alias@,$build_alias,;t t
17894 s,@host_alias@,$host_alias,;t t
17895 s,@target_alias@,$target_alias,;t t
17896 s,@ECHO_C@,$ECHO_C,;t t
17897 s,@ECHO_N@,$ECHO_N,;t t
17898 s,@ECHO_T@,$ECHO_T,;t t
17899 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17900 s,@DEFS@,$DEFS,;t t
17901 s,@LIBS@,$LIBS,;t t
17902 s,@top_builddir@,$top_builddir,;t t
17903 s,@build@,$build,;t t
17904 s,@build_cpu@,$build_cpu,;t t
17905 s,@build_vendor@,$build_vendor,;t t
17906 s,@build_os@,$build_os,;t t
17907 s,@host@,$host,;t t
17908 s,@host_cpu@,$host_cpu,;t t
17909 s,@host_vendor@,$host_vendor,;t t
17910 s,@host_os@,$host_os,;t t
17911 s,@target@,$target,;t t
17912 s,@target_cpu@,$target_cpu,;t t
17913 s,@target_vendor@,$target_vendor,;t t
17914 s,@target_os@,$target_os,;t t
17915 s,@CC@,$CC,;t t
17916 s,@CFLAGS@,$CFLAGS,;t t
17917 s,@LDFLAGS@,$LDFLAGS,;t t
17918 s,@CPPFLAGS@,$CPPFLAGS,;t t
17919 s,@ac_ct_CC@,$ac_ct_CC,;t t
17920 s,@EXEEXT@,$EXEEXT,;t t
17921 s,@OBJEXT@,$OBJEXT,;t t
17922 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17923 s,@CPP@,$CPP,;t t
17924 s,@AWK@,$AWK,;t t
17925 s,@EGREP@,$EGREP,;t t
17926 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17927 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17928 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17929 s,@LN_S@,$LN_S,;t t
17930 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
17931 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
17932 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17933 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17934 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
17935 s,@SET_MAKE@,$SET_MAKE,;t t
17936 s,@CTAGS@,$CTAGS,;t t
17937 s,@ETAGS@,$ETAGS,;t t
17938 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17939 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17940 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
17941 s,@RANLIB@,$RANLIB,;t t
17942 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
17943 s,@LD@,$LD,;t t
17944 s,@ac_ct_LD@,$ac_ct_LD,;t t
17945 s,@AR@,$AR,;t t
17946 s,@ac_ct_AR@,$ac_ct_AR,;t t
17947 s,@ARFLAGS@,$ARFLAGS,;t t
17948 s,@DESTDIR@,$DESTDIR,;t t
17949 s,@BUILD_CC@,$BUILD_CC,;t t
17950 s,@BUILD_CPP@,$BUILD_CPP,;t t
17951 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
17952 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
17953 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
17954 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
17955 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
17956 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
17957 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
17958 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17959 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17960 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17961 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
17962 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
17963 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
17964 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17965 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17966 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
17967 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
17968 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
17969 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
17970 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
17971 s,@CC_G_OPT@,$CC_G_OPT,;t t
17972 s,@LD_MODEL@,$LD_MODEL,;t t
17973 s,@shlibdir@,$shlibdir,;t t
17974 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
17975 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17976 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
17977 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17978 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
17979 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
17980 s,@LINK_PROGS@,$LINK_PROGS,;t t
17981 s,@LINK_TESTS@,$LINK_TESTS,;t t
17982 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17983 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17984 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
17985 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
17986 s,@RPATH_LIST@,$RPATH_LIST,;t t
17987 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
17988 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
17989 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
17990 s,@PTHREAD@,$PTHREAD,;t t
17991 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
17992 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17993 s,@ECHO_LT@,$ECHO_LT,;t t
17994 s,@ECHO_LD@,$ECHO_LD,;t t
17995 s,@RULE_CC@,$RULE_CC,;t t
17996 s,@SHOW_CC@,$SHOW_CC,;t t
17997 s,@ECHO_CC@,$ECHO_CC,;t t
17998 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17999 s,@ADAFLAGS@,$ADAFLAGS,;t t
18000 s,@ADA_TRACE@,$ADA_TRACE,;t t
18001 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18002 s,@M4_exists@,$M4_exists,;t t
18003 s,@cf_ada_make@,$cf_ada_make,;t t
18004 s,@cf_ada_config@,$cf_ada_config,;t t
18005 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18006 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18007 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18008 s,@cf_compile_generics@,$cf_compile_generics,;t t
18009 s,@cf_generic_objects@,$cf_generic_objects,;t t
18010 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18011 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18012 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18013 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18014 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18015 s,@cf_ada_package@,$cf_ada_package,;t t
18016 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18017 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18018 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18019 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18020 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18021 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18022 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18023 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18024 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18025 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18026 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18027 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18028 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18029 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18030 s,@TEST_ARG2@,$TEST_ARG2,;t t
18031 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18032 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18033 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18034 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18035 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18036 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18037 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18038 CEOF
18039
18040 EOF
18041
18042   cat >>$CONFIG_STATUS <<\EOF
18043   # Split the substitutions into bite-sized pieces for seds with
18044   # small command number limits, like on Digital OSF/1 and HP-UX.
18045   ac_max_sed_lines=48
18046   ac_sed_frag=1 # Number of current file.
18047   ac_beg=1 # First line for current file.
18048   ac_end=$ac_max_sed_lines # Line after last line for current file.
18049   ac_more_lines=:
18050   ac_sed_cmds=
18051   while $ac_more_lines; do
18052     if test $ac_beg -gt 1; then
18053       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18054     else
18055       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18056     fi
18057     if test ! -s $tmp/subs.frag; then
18058       ac_more_lines=false
18059     else
18060       # The purpose of the label and of the branching condition is to
18061       # speed up the sed processing (if there are no `@' at all, there
18062       # is no need to browse any of the substitutions).
18063       # These are the two extra sed commands mentioned above.
18064       (echo ':t
18065   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18066       # It is possible to make a multiline substitution using escaped newlines.
18067       # Ensure that we do not split the substitution between script fragments.
18068       ac_BEG=$ac_end
18069       ac_END=`expr $ac_end + $ac_max_sed_lines`
18070       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18071       if test -s $tmp/subs.next; then
18072         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18073         if test ! -s $tmp/subs.edit; then
18074           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18075           if test ! -s $tmp/subs.edit; then
18076             if test $ac_beg -gt 1; then
18077               ac_end=`expr $ac_end - 1`
18078               continue
18079             fi
18080           fi
18081         fi
18082       fi
18083
18084       if test -z "$ac_sed_cmds"; then
18085         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18086       else
18087         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18088       fi
18089       ac_sed_frag=`expr $ac_sed_frag + 1`
18090       ac_beg=$ac_end
18091       ac_end=`expr $ac_end + $ac_max_sed_lines`
18092     fi
18093   done
18094   if test -z "$ac_sed_cmds"; then
18095     ac_sed_cmds=cat
18096   fi
18097 fi # test -n "$CONFIG_FILES"
18098
18099 EOF
18100 cat >>$CONFIG_STATUS <<\EOF
18101 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18102   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18103   case $ac_file in
18104   - | *:- | *:-:* ) # input from stdin
18105         cat >$tmp/stdin
18106         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18107         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18108   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18109         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18110   * )   ac_file_in=$ac_file.in ;;
18111   esac
18112
18113   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18114   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18115          X"$ac_file" : 'X\(//\)[^/]' \| \
18116          X"$ac_file" : 'X\(//\)$' \| \
18117          X"$ac_file" : 'X\(/\)' \| \
18118          .     : '\(.\)' 2>/dev/null ||
18119 echo X"$ac_file" |
18120     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18121           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18122           /^X\(\/\/\)$/{ s//\1/; q; }
18123           /^X\(\/\).*/{ s//\1/; q; }
18124           s/.*/./; q'`
18125   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18126     { case "$ac_dir" in
18127   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18128   *)                      as_incr_dir=.;;
18129 esac
18130 as_dummy="$ac_dir"
18131 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18132   case $as_mkdir_dir in
18133     # Skip DOS drivespec
18134     ?:) as_incr_dir=$as_mkdir_dir ;;
18135     *)
18136       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18137       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18138     ;;
18139   esac
18140 done; }
18141
18142     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18143     # A "../" for each directory in $ac_dir_suffix.
18144     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18145   else
18146     ac_dir_suffix= ac_dots=
18147   fi
18148
18149   case $srcdir in
18150   .)  ac_srcdir=.
18151       if test -z "$ac_dots"; then
18152          ac_top_srcdir=.
18153       else
18154          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18155       fi ;;
18156   [\\/]* | ?:[\\/]* )
18157       ac_srcdir=$srcdir$ac_dir_suffix;
18158       ac_top_srcdir=$srcdir ;;
18159   *) # Relative path.
18160     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18161     ac_top_srcdir=$ac_dots$srcdir ;;
18162   esac
18163
18164   case $INSTALL in
18165   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18166   *) ac_INSTALL=$ac_dots$INSTALL ;;
18167   esac
18168
18169   if test x"$ac_file" != x-; then
18170     { echo "$as_me:18170: creating $ac_file" >&5
18171 echo "$as_me: creating $ac_file" >&6;}
18172     rm -f "$ac_file"
18173   fi
18174   # Let's still pretend it is `configure' which instantiates (i.e., don't
18175   # use $as_me), people would be surprised to read:
18176   #    /* config.h.  Generated automatically by config.status.  */
18177   configure_input="Generated automatically from `echo $ac_file_in |
18178                                                  sed 's,.*/,,'` by configure."
18179
18180   # First look for the input files in the build tree, otherwise in the
18181   # src tree.
18182   ac_file_inputs=`IFS=:
18183     for f in $ac_file_in; do
18184       case $f in
18185       -) echo $tmp/stdin ;;
18186       [\\/$]*)
18187          # Absolute (can't be DOS-style, as IFS=:)
18188          test -f "$f" || { { echo "$as_me:18188: error: cannot find input file: $f" >&5
18189 echo "$as_me: error: cannot find input file: $f" >&2;}
18190    { (exit 1); exit 1; }; }
18191          echo $f;;
18192       *) # Relative
18193          if test -f "$f"; then
18194            # Build tree
18195            echo $f
18196          elif test -f "$srcdir/$f"; then
18197            # Source tree
18198            echo $srcdir/$f
18199          else
18200            # /dev/null tree
18201            { { echo "$as_me:18201: error: cannot find input file: $f" >&5
18202 echo "$as_me: error: cannot find input file: $f" >&2;}
18203    { (exit 1); exit 1; }; }
18204          fi;;
18205       esac
18206     done` || { (exit 1); exit 1; }
18207 EOF
18208 cat >>$CONFIG_STATUS <<\EOF
18209   ac_warn_datarootdir=no
18210   if test x"$ac_file" != x-; then
18211     for ac_item in $ac_file_inputs
18212     do
18213       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18214       if test -n "$ac_seen"; then
18215         ac_used=`grep '@datarootdir@' $ac_item`
18216         if test -z "$ac_used"; then
18217           { echo "$as_me:18217: WARNING: datarootdir was used implicitly but not set:
18218 $ac_seen" >&5
18219 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18220 $ac_seen" >&2;}
18221           ac_warn_datarootdir=yes
18222         fi
18223       fi
18224       ac_seen=`grep '${datarootdir}' $ac_item`
18225       if test -n "$ac_seen"; then
18226         { echo "$as_me:18226: WARNING: datarootdir was used explicitly but not set:
18227 $ac_seen" >&5
18228 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18229 $ac_seen" >&2;}
18230         ac_warn_datarootdir=yes
18231       fi
18232     done
18233   fi
18234
18235 if test "x$ac_warn_datarootdir" = xyes; then
18236   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18237 fi
18238
18239 EOF
18240 cat >>$CONFIG_STATUS <<EOF
18241   sed "$ac_vpsub
18242 $extrasub
18243 EOF
18244 cat >>$CONFIG_STATUS <<\EOF
18245 :t
18246 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18247 s,@configure_input@,$configure_input,;t t
18248 s,@srcdir@,$ac_srcdir,;t t
18249 s,@top_srcdir@,$ac_top_srcdir,;t t
18250 s,@INSTALL@,$ac_INSTALL,;t t
18251 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18252   rm -f $tmp/stdin
18253   if test x"$ac_file" != x-; then
18254     cp $tmp/out $ac_file
18255
18256     for ac_name in prefix exec_prefix datarootdir
18257     do
18258         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18259         if test -n "$ac_seen"; then
18260             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18261             if test -z "$ac_init"; then
18262               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18263               { echo "$as_me:18263: WARNING: Variable $ac_name is used but was not set:
18264 $ac_seen" >&5
18265 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18266 $ac_seen" >&2;}
18267             fi
18268         fi
18269     done
18270     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18271     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18272     if test -s $tmp/out; then
18273       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18274       { echo "$as_me:18274: WARNING: Some variables may not be substituted:
18275 $ac_seen" >&5
18276 echo "$as_me: WARNING: Some variables may not be substituted:
18277 $ac_seen" >&2;}
18278     fi
18279   else
18280     cat $tmp/out
18281   fi
18282   rm -f $tmp/out
18283
18284 done
18285 EOF
18286 cat >>$CONFIG_STATUS <<\EOF
18287
18288 #
18289 # CONFIG_HEADER section.
18290 #
18291
18292 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18293 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18294 #
18295 # ac_d sets the value in "#define NAME VALUE" lines.
18296 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18297 ac_dB='[        ].*$,\1#\2'
18298 ac_dC=' '
18299 ac_dD=',;t'
18300 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18301 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18302 ac_iB='\([      ]\),\1#\2define\3'
18303 ac_iC=' '
18304 ac_iD='\4,;t'
18305 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18306 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18307 ac_uB='$,\1#\2define\3'
18308 ac_uC=' '
18309 ac_uD=',;t'
18310
18311 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18312   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18313   case $ac_file in
18314   - | *:- | *:-:* ) # input from stdin
18315         cat >$tmp/stdin
18316         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18317         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18318   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18319         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18320   * )   ac_file_in=$ac_file.in ;;
18321   esac
18322
18323   test x"$ac_file" != x- && { echo "$as_me:18323: creating $ac_file" >&5
18324 echo "$as_me: creating $ac_file" >&6;}
18325
18326   # First look for the input files in the build tree, otherwise in the
18327   # src tree.
18328   ac_file_inputs=`IFS=:
18329     for f in $ac_file_in; do
18330       case $f in
18331       -) echo $tmp/stdin ;;
18332       [\\/$]*)
18333          # Absolute (can't be DOS-style, as IFS=:)
18334          test -f "$f" || { { echo "$as_me:18334: error: cannot find input file: $f" >&5
18335 echo "$as_me: error: cannot find input file: $f" >&2;}
18336    { (exit 1); exit 1; }; }
18337          echo $f;;
18338       *) # Relative
18339          if test -f "$f"; then
18340            # Build tree
18341            echo $f
18342          elif test -f "$srcdir/$f"; then
18343            # Source tree
18344            echo $srcdir/$f
18345          else
18346            # /dev/null tree
18347            { { echo "$as_me:18347: error: cannot find input file: $f" >&5
18348 echo "$as_me: error: cannot find input file: $f" >&2;}
18349    { (exit 1); exit 1; }; }
18350          fi;;
18351       esac
18352     done` || { (exit 1); exit 1; }
18353   # Remove the trailing spaces.
18354   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18355
18356 EOF
18357
18358 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18359 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18360 # be either 'cat' or 'sort'.
18361 cat confdefs.h | uniq >conftest.vals
18362
18363 # Break up conftest.vals because some shells have a limit on
18364 # the size of here documents, and old seds have small limits too.
18365
18366 rm -f conftest.tail
18367 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18368 while grep . conftest.vals >/dev/null
18369 do
18370   # Write chunks of a limited-size here document to conftest.frag.
18371   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18372   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18373   echo 'CEOF' >> $CONFIG_STATUS
18374   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18375   rm -f conftest.vals
18376   mv conftest.tail conftest.vals
18377 done
18378 rm -f conftest.vals
18379
18380 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18381 # marker @DEFS@.
18382 echo '  cat >> conftest.edit <<CEOF
18383 /@DEFS@/r conftest.frag
18384 /@DEFS@/d
18385 CEOF
18386 sed -f conftest.edit $tmp/in > $tmp/out
18387 rm -f $tmp/in
18388 mv $tmp/out $tmp/in
18389 rm -f conftest.edit conftest.frag
18390 ' >> $CONFIG_STATUS
18391
18392 cat >>$CONFIG_STATUS <<\EOF
18393   # Let's still pretend it is `configure' which instantiates (i.e., don't
18394   # use $as_me), people would be surprised to read:
18395   #    /* config.h.  Generated automatically by config.status.  */
18396   if test x"$ac_file" = x-; then
18397     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18398   else
18399     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18400   fi
18401   cat $tmp/in >>$tmp/config.h
18402   rm -f $tmp/in
18403   if test x"$ac_file" != x-; then
18404     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18405       { echo "$as_me:18405: $ac_file is unchanged" >&5
18406 echo "$as_me: $ac_file is unchanged" >&6;}
18407     else
18408       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18409          X"$ac_file" : 'X\(//\)[^/]' \| \
18410          X"$ac_file" : 'X\(//\)$' \| \
18411          X"$ac_file" : 'X\(/\)' \| \
18412          .     : '\(.\)' 2>/dev/null ||
18413 echo X"$ac_file" |
18414     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18415           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18416           /^X\(\/\/\)$/{ s//\1/; q; }
18417           /^X\(\/\).*/{ s//\1/; q; }
18418           s/.*/./; q'`
18419       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18420         { case "$ac_dir" in
18421   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18422   *)                      as_incr_dir=.;;
18423 esac
18424 as_dummy="$ac_dir"
18425 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18426   case $as_mkdir_dir in
18427     # Skip DOS drivespec
18428     ?:) as_incr_dir=$as_mkdir_dir ;;
18429     *)
18430       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18431       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18432     ;;
18433   esac
18434 done; }
18435
18436       fi
18437       rm -f $ac_file
18438       mv $tmp/config.h $ac_file
18439     fi
18440   else
18441     cat $tmp/config.h
18442     rm -f $tmp/config.h
18443   fi
18444 done
18445 EOF
18446 cat >>$CONFIG_STATUS <<\EOF
18447 #
18448 # CONFIG_COMMANDS section.
18449 #
18450 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18451   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18452   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18453
18454   case $ac_dest in
18455     default )
18456 if test -z "$USE_OLD_MAKERULES" ; then
18457         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18458 fi
18459  ;;
18460   esac
18461 done
18462 EOF
18463
18464 cat >>$CONFIG_STATUS <<\EOF
18465
18466 { (exit 0); exit 0; }
18467 EOF
18468 chmod +x $CONFIG_STATUS
18469 ac_clean_files=$ac_clean_files_save
18470
18471 # configure is writing to config.log, and then calls config.status.
18472 # config.status does its own redirection, appending to config.log.
18473 # Unfortunately, on DOS this fails, as config.log is still kept open
18474 # by configure, so config.status won't be able to write to it; its
18475 # output is simply discarded.  So we exec the FD to /dev/null,
18476 # effectively closing config.log, so it can be properly (re)opened and
18477 # appended to by config.status.  When coming back to configure, we
18478 # need to make the FD available again.
18479 if test "$no_create" != yes; then
18480   ac_cs_success=:
18481   exec 5>/dev/null
18482   $SHELL $CONFIG_STATUS || ac_cs_success=false
18483   exec 5>>config.log
18484   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18485   # would make configure fail if this is the last instruction.
18486   $ac_cs_success || { (exit 1); exit 1; }
18487 fi
18488 ${MAKE:-make} preinstall