]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
9c86c4ea6221a76ecd02a2a66f10c5f5ca9eb7e5
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.93 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20231210.
5 #
6 # Copyright 2003-2022,2023      Thomas E. Dickey
7 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
9 # This configure script is free software; the Free Software Foundation
10 # gives unlimited permission to copy, distribute and modify it.
11
12 # Avoid depending upon Character Ranges.
13 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
14 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
15 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
16 as_cr_digits='0123456789'
17 as_cr_alnum=$as_cr_Letters$as_cr_digits
18
19 # Sed expression to map a string onto a valid variable name.
20 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
21
22 # Sed expression to map a string onto a valid CPP name.
23 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
24
25 # Be Bourne compatible
26 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
27   emulate sh
28   NULLCMD=:
29 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
30   set -o posix
31 fi
32
33 # Name of the executable.
34 as_me=`echo "$0" |sed 's,.*[\\/],,'`
35
36 if expr a : '\(a\)' >/dev/null 2>&1; then
37   as_expr="expr"
38 else
39   as_expr="false"
40 fi
41
42 rm -f conf$$ conf$$.exe conf$$.file
43 echo >conf$$.file
44 if ln -s conf$$.file conf$$ 2>/dev/null; then
45   # We could just check for DJGPP; but this test a) works b) is more generic
46   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
47   if test -f conf$$.exe; then
48     # Don't use ln at all; we don't have any links
49     as_ln_s='cp -p'
50   else
51     as_ln_s='ln -s'
52   fi
53 elif ln conf$$.file conf$$ 2>/dev/null; then
54   as_ln_s='ln'
55 else
56   as_ln_s='cp -p'
57 fi
58 rm -f conf$$ conf$$.exe conf$$.file
59
60 as_executable_p="test -f"
61
62 # Support unset when possible.
63 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
64   as_unset="unset"
65 else
66   as_unset="false"
67 fi
68
69 # NLS nuisances.
70 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
71 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
72 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
73 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
74 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
75 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
76 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
77 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
78
79 # IFS
80 # We need space, tab and new line, in precisely that order.
81 as_nl='
82 '
83 IFS="   $as_nl"
84
85 # CDPATH.
86 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
87
88 # Name of the host.
89 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
90 # so uname gets run too.
91 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
92
93 exec 6>&1
94
95 #
96 # Initializations.
97 #
98 ac_default_prefix=/usr/local
99 cross_compiling=no
100 subdirs=
101 MFLAGS=
102 MAKEFLAGS=
103 SHELL=${CONFIG_SHELL-/bin/sh}
104
105 # Maximum number of lines to put in a shell here document.
106 # This variable seems obsolete.  It should probably be removed, and
107 # only ac_max_sed_lines should be used.
108 : "${ac_max_here_lines=38}"
109
110 ac_unique_file="gen/gen.c"
111 # Factoring default headers for most tests.
112 ac_includes_default="\
113 #include <stdio.h>
114 #if HAVE_SYS_TYPES_H
115 # include <sys/types.h>
116 #endif
117 #if HAVE_SYS_STAT_H
118 # include <sys/stat.h>
119 #endif
120 #if STDC_HEADERS
121 # include <stdlib.h>
122 # include <stddef.h>
123 #else
124 # if HAVE_STDLIB_H
125 #  include <stdlib.h>
126 # endif
127 #endif
128 #if HAVE_STRING_H
129 # if !STDC_HEADERS && HAVE_MEMORY_H
130 #  include <memory.h>
131 # endif
132 # include <string.h>
133 #endif
134 #if HAVE_STRINGS_H
135 # include <strings.h>
136 #endif
137 #if HAVE_INTTYPES_H
138 # include <inttypes.h>
139 #else
140 # if HAVE_STDINT_H
141 #  include <stdint.h>
142 # endif
143 #endif
144 #if HAVE_UNISTD_H
145 # include <unistd.h>
146 #endif"
147
148 # Initialize some variables set by options.
149 ac_init_help=
150 ac_init_version=false
151 # The variables have the same names as the options, with
152 # dashes changed to underlines.
153 cache_file=/dev/null
154 exec_prefix=NONE
155 no_create=
156 no_recursion=
157 prefix=NONE
158 program_prefix=NONE
159 program_suffix=NONE
160 program_transform_name=s,x,x,
161 silent=
162 site=
163 srcdir=
164 verbose=
165 x_includes=NONE
166 x_libraries=NONE
167
168 # Installation directory options.
169 # These are left unexpanded so users can "make install exec_prefix=/foo"
170 # and all the variables that are supposed to be based on exec_prefix
171 # by default will actually change.
172 # Use braces instead of parens because sh, perl, etc. also accept them.
173 bindir='${exec_prefix}/bin'
174 sbindir='${exec_prefix}/sbin'
175 libexecdir='${exec_prefix}/libexec'
176 datarootdir='${prefix}/share'
177 datadir='${datarootdir}'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 runstatedir='${localstatedir}/run'
182 libdir='${exec_prefix}/lib'
183 includedir='${prefix}/include'
184 oldincludedir='/usr/include'
185 infodir='${datarootdir}/info'
186 mandir='${datarootdir}/man'
187
188 # Identity of this package.
189 PACKAGE_NAME=
190 PACKAGE_TARNAME=
191 PACKAGE_VERSION=
192 PACKAGE_STRING=
193 PACKAGE_BUGREPORT=
194
195 ac_prev=
196 for ac_option
197 do
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
206
207   # Accept the important Cygnus configure options, so we can diagnose typos.
208
209   case "$ac_option" in
210
211   -bindir | --bindir | --bindi | --bind | --bin | --bi)
212     ac_prev=bindir ;;
213   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
214     bindir=$ac_optarg ;;
215
216   -build | --build | --buil | --bui | --bu)
217     ac_prev=build_alias ;;
218   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
219     build_alias=$ac_optarg ;;
220
221   -cache-file | --cache-file | --cache-fil | --cache-fi \
222   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
223     ac_prev=cache_file ;;
224   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
225   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
226     cache_file=$ac_optarg ;;
227
228   --config-cache | -C)
229     cache_file=config.cache ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir=$ac_optarg ;;
236
237   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
238   | --dataroo | --dataro | --datar)
239     ac_prev=datarootdir ;;
240   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
241   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
242     datarootdir=$ac_optarg ;;
243
244   -disable-* | --disable-*)
245     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
246     # Reject names that are not valid shell variable names.
247     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
248       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
249    { (exit 1); exit 1; }; }
250     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
251     eval "enable_$ac_feature=no" ;;
252
253   -enable-* | --enable-*)
254     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
255     # Reject names that are not valid shell variable names.
256     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
257       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
258    { (exit 1); exit 1; }; }
259     ac_feature=`echo "$ac_feature" | sed 's/-/_/g'`
260     case "$ac_option" in
261       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
262       *) ac_optarg=yes ;;
263     esac
264     eval "enable_$ac_feature='$ac_optarg'" ;;
265
266   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
267   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
268   | --exec | --exe | --ex)
269     ac_prev=exec_prefix ;;
270   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
271   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
272   | --exec=* | --exe=* | --ex=*)
273     exec_prefix=$ac_optarg ;;
274
275   -gas | --gas | --ga | --g)
276     # Obsolete; use --with-gas.
277     with_gas=yes ;;
278
279   -help | --help | --hel | --he | -h)
280     ac_init_help=long ;;
281   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
282     ac_init_help=recursive ;;
283   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
284     ac_init_help=short ;;
285
286   -host | --host | --hos | --ho)
287     ac_prev=host_alias ;;
288   -host=* | --host=* | --hos=* | --ho=*)
289     host_alias=$ac_optarg ;;
290
291   -includedir | --includedir | --includedi | --included | --include \
292   | --includ | --inclu | --incl | --inc)
293     ac_prev=includedir ;;
294   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
295   | --includ=* | --inclu=* | --incl=* | --inc=*)
296     includedir=$ac_optarg ;;
297
298   -infodir | --infodir | --infodi | --infod | --info | --inf)
299     ac_prev=infodir ;;
300   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
301     infodir=$ac_optarg ;;
302
303   -libdir | --libdir | --libdi | --libd)
304     ac_prev=libdir ;;
305   -libdir=* | --libdir=* | --libdi=* | --libd=*)
306     libdir=$ac_optarg ;;
307
308   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
309   | --libexe | --libex | --libe)
310     ac_prev=libexecdir ;;
311   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
312   | --libexe=* | --libex=* | --libe=*)
313     libexecdir=$ac_optarg ;;
314
315   -localstatedir | --localstatedir | --localstatedi | --localstated \
316   | --localstate | --localstat | --localsta | --localst \
317   | --locals | --local | --loca | --loc | --lo)
318     ac_prev=localstatedir ;;
319   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
320   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
321   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
322     localstatedir=$ac_optarg ;;
323
324   -runstatedir | --runstatedir | --runstatedi | --runstated \
325   | --runstate | --runstat | --runsta | --runst \
326   | --runs | --run | --ru)
327     ac_prev=runstatedir ;;
328   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
329   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
330   | --runs=* | --run=* | --ru=*)
331     runstatedir=$ac_optarg ;;
332
333   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
334     ac_prev=mandir ;;
335   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
336     mandir=$ac_optarg ;;
337
338   -nfp | --nfp | --nf)
339     # Obsolete; use --without-fp.
340     with_fp=no ;;
341
342   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
343   | --no-cr | --no-c)
344     no_create=yes ;;
345
346   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
347   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
348     no_recursion=yes ;;
349
350   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
351   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
352   | --oldin | --oldi | --old | --ol | --o)
353     ac_prev=oldincludedir ;;
354   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
355   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
356   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
357     oldincludedir=$ac_optarg ;;
358
359   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
360     ac_prev=prefix ;;
361   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
362     prefix=$ac_optarg ;;
363
364   -program-prefix | --program-prefix | --program-prefi | --program-pref \
365   | --program-pre | --program-pr | --program-p)
366     ac_prev=program_prefix ;;
367   -program-prefix=* | --program-prefix=* | --program-prefi=* \
368   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
369     program_prefix=$ac_optarg ;;
370
371   -program-suffix | --program-suffix | --program-suffi | --program-suff \
372   | --program-suf | --program-su | --program-s)
373     ac_prev=program_suffix ;;
374   -program-suffix=* | --program-suffix=* | --program-suffi=* \
375   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
376     program_suffix=$ac_optarg ;;
377
378   -program-transform-name | --program-transform-name \
379   | --program-transform-nam | --program-transform-na \
380   | --program-transform-n | --program-transform- \
381   | --program-transform | --program-transfor \
382   | --program-transfo | --program-transf \
383   | --program-trans | --program-tran \
384   | --progr-tra | --program-tr | --program-t)
385     ac_prev=program_transform_name ;;
386   -program-transform-name=* | --program-transform-name=* \
387   | --program-transform-nam=* | --program-transform-na=* \
388   | --program-transform-n=* | --program-transform-=* \
389   | --program-transform=* | --program-transfor=* \
390   | --program-transfo=* | --program-transf=* \
391   | --program-trans=* | --program-tran=* \
392   | --progr-tra=* | --program-tr=* | --program-t=*)
393     program_transform_name=$ac_optarg ;;
394
395   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
396   | -silent | --silent | --silen | --sile | --sil)
397     silent=yes ;;
398
399   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
400     ac_prev=sbindir ;;
401   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
402   | --sbi=* | --sb=*)
403     sbindir=$ac_optarg ;;
404
405   -sharedstatedir | --sharedstatedir | --sharedstatedi \
406   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
407   | --sharedst | --shareds | --shared | --share | --shar \
408   | --sha | --sh)
409     ac_prev=sharedstatedir ;;
410   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
411   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
412   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
413   | --sha=* | --sh=*)
414     sharedstatedir=$ac_optarg ;;
415
416   -site | --site | --sit)
417     ac_prev=site ;;
418   -site=* | --site=* | --sit=*)
419     site=$ac_optarg ;;
420
421   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
422     ac_prev=srcdir ;;
423   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
424     srcdir=$ac_optarg ;;
425
426   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
427   | --syscon | --sysco | --sysc | --sys | --sy)
428     ac_prev=sysconfdir ;;
429   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
430   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
431     sysconfdir=$ac_optarg ;;
432
433   -target | --target | --targe | --targ | --tar | --ta | --t)
434     ac_prev=target_alias ;;
435   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
436     target_alias=$ac_optarg ;;
437
438   -v | -verbose | --verbose | --verbos | --verbo | --verb)
439     verbose=yes ;;
440
441   -version | --version | --versio | --versi | --vers | -V)
442     ac_init_version=: ;;
443
444   -with-* | --with-*)
445     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
446     # Reject names that are not valid shell variable names.
447     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
448       { echo "$as_me: error: invalid package name: $ac_package" >&2
449    { (exit 1); exit 1; }; }
450     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
451     case "$ac_option" in
452       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
453       *) ac_optarg=yes ;;
454     esac
455     eval "with_$ac_package='$ac_optarg'" ;;
456
457   -without-* | --without-*)
458     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
459     # Reject names that are not valid shell variable names.
460     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
461       { echo "$as_me: error: invalid package name: $ac_package" >&2
462    { (exit 1); exit 1; }; }
463     ac_package=`echo "$ac_package" | sed 's/-/_/g'`
464     eval "with_$ac_package=no" ;;
465
466   --x)
467     # Obsolete; use --with-x.
468     with_x=yes ;;
469
470   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
471   | --x-incl | --x-inc | --x-in | --x-i)
472     ac_prev=x_includes ;;
473   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
474   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
475     x_includes=$ac_optarg ;;
476
477   -x-libraries | --x-libraries | --x-librarie | --x-librari \
478   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
479     ac_prev=x_libraries ;;
480   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
481   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
482     x_libraries=$ac_optarg ;;
483
484   -*) { echo "$as_me: error: unrecognized option: $ac_option
485 Try \`$0 --help' for more information." >&2
486    { (exit 1); exit 1; }; }
487     ;;
488
489   *=*)
490     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
491     # Reject names that are not valid shell variable names.
492     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
493       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
494    { (exit 1); exit 1; }; }
495     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
496     eval "$ac_envvar='$ac_optarg'"
497     export "$ac_envvar" ;;
498
499   *)
500     # FIXME: should be removed in autoconf 3.0.
501     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
502     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
503       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
504     : "${build_alias=$ac_option}" "${host_alias=$ac_option}" "${target_alias=$ac_option}"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   ac_option=--`echo "$ac_prev" | sed 's/_/-/g'`
512   { echo "$as_me: error: missing argument to $ac_option" >&2
513    { (exit 1); exit 1; }; }
514 fi
515
516 # Be sure to have absolute paths.
517 for ac_var in exec_prefix prefix
518 do
519   eval ac_val=$`echo "$ac_var"`
520   case "$ac_val" in
521     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # Be sure to have absolute paths.
528 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
529               localstatedir libdir includedir oldincludedir infodir mandir
530 do
531   eval ac_val=$`echo "$ac_var"`
532   case "$ac_val" in
533     [\\/$]* | ?:[\\/]* ) ;;
534     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
535    { (exit 1); exit 1; }; };;
536   esac
537 done
538
539 # There might be people who depend on the old broken behavior: `$host'
540 # used to hold the argument of --host etc.
541 build=$build_alias
542 host=$host_alias
543 target=$target_alias
544
545 # FIXME: should be removed in autoconf 3.0.
546 if test "x$host_alias" != x; then
547   if test "x$build_alias" = x; then
548     cross_compiling=maybe
549     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
550     If a cross compiler is detected then cross compile mode will be used." >&2
551   elif test "x$build_alias" != "x$host_alias"; then
552     cross_compiling=yes
553   fi
554 fi
555
556 ac_tool_prefix=
557 test -n "$host_alias" && ac_tool_prefix=$host_alias-
558
559 test "$silent" = yes && exec 6>/dev/null
560
561 # Find the source files, if location was not specified.
562 if test -z "$srcdir"; then
563   ac_srcdir_defaulted=yes
564   # Try the directory containing this script, then its parent.
565   ac_prog=$0
566   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
567   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
568   srcdir=$ac_confdir
569   if test ! -r "$srcdir/$ac_unique_file"; then
570     srcdir=..
571   fi
572 else
573   ac_srcdir_defaulted=no
574 fi
575 if test ! -r "$srcdir/$ac_unique_file"; then
576   if test "$ac_srcdir_defaulted" = yes; then
577     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
578    { (exit 1); exit 1; }; }
579   else
580     { echo "$as_me: error: cannot find sources in $srcdir" >&2
581    { (exit 1); exit 1; }; }
582   fi
583 fi
584 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
585 ac_env_build_alias_set=${build_alias+set}
586 ac_env_build_alias_value=$build_alias
587 ac_cv_env_build_alias_set=${build_alias+set}
588 ac_cv_env_build_alias_value=$build_alias
589 ac_env_host_alias_set=${host_alias+set}
590 ac_env_host_alias_value=$host_alias
591 ac_cv_env_host_alias_set=${host_alias+set}
592 ac_cv_env_host_alias_value=$host_alias
593 ac_env_target_alias_set=${target_alias+set}
594 ac_env_target_alias_value=$target_alias
595 ac_cv_env_target_alias_set=${target_alias+set}
596 ac_cv_env_target_alias_value=$target_alias
597 ac_env_CC_set=${CC+set}
598 ac_env_CC_value=$CC
599 ac_cv_env_CC_set=${CC+set}
600 ac_cv_env_CC_value=$CC
601 ac_env_CFLAGS_set=${CFLAGS+set}
602 ac_env_CFLAGS_value=$CFLAGS
603 ac_cv_env_CFLAGS_set=${CFLAGS+set}
604 ac_cv_env_CFLAGS_value=$CFLAGS
605 ac_env_LDFLAGS_set=${LDFLAGS+set}
606 ac_env_LDFLAGS_value=$LDFLAGS
607 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
608 ac_cv_env_LDFLAGS_value=$LDFLAGS
609 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
610 ac_env_CPPFLAGS_value=$CPPFLAGS
611 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
612 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
613 ac_env_CPP_set=${CPP+set}
614 ac_env_CPP_value=$CPP
615 ac_cv_env_CPP_set=${CPP+set}
616 ac_cv_env_CPP_value=$CPP
617
618 #
619 # Report the --help message.
620 #
621 if test "$ac_init_help" = "long"; then
622   # Omit some internal or obsolete options to make the list less imposing.
623   # This message is too long to be a string in the A/UX 3.1 sh.
624   cat <<EOF
625 \`configure' configures this package to adapt to many kinds of systems.
626
627 Usage: $0 [OPTION]... [VAR=VALUE]...
628
629 To assign environment variables (e.g., CC, CFLAGS...), specify them as
630 VAR=VALUE.  See below for descriptions of some of the useful variables.
631
632 Defaults for the options are specified in brackets.
633
634 Configuration:
635   -h, --help              display this help and exit
636       --help=short        display options specific to this package
637       --help=recursive    display the short help of all the included packages
638   -V, --version           display version information and exit
639   -q, --quiet, --silent   do not print \`checking...' messages
640       --cache-file=FILE   cache test results in FILE [disabled]
641   -C, --config-cache      alias for \`--cache-file=config.cache'
642   -n, --no-create         do not create output files
643       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
644
645 EOF
646
647   cat <<EOF
648 Installation directories:
649   --prefix=PREFIX         install architecture-independent files in PREFIX
650                           [$ac_default_prefix]
651   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
652                           [PREFIX]
653
654 By default, \`make install' will install all the files in
655 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
656 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
657 for instance \`--prefix=\$HOME'.
658
659 For better control, use the options below.
660
661 Fine tuning of the installation directories:
662   --bindir=DIR            user executables [EPREFIX/bin]
663   --sbindir=DIR           system admin executables [EPREFIX/sbin]
664   --libexecdir=DIR        program executables [EPREFIX/libexec]
665   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
666   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
667   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
668   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
669   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
670   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
671   --libdir=DIR            object code libraries [EPREFIX/lib]
672   --includedir=DIR        C header files [PREFIX/include]
673   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
674   --infodir=DIR           info documentation [DATAROOTDIR/info]
675   --mandir=DIR            man documentation [DATAROOTDIR/man]
676 EOF
677
678   cat <<\EOF
679
680 Program names:
681   --program-prefix=PREFIX            prepend PREFIX to installed program names
682   --program-suffix=SUFFIX            append SUFFIX to installed program names
683   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
684
685 System types:
686   --build=BUILD           configure for building on BUILD [guessed]
687   --host=HOST       build programs to run on HOST [BUILD]
688   --target=TARGET   configure for building compilers for TARGET [HOST]
689 EOF
690 fi
691
692 if test -n "$ac_init_help"; then
693
694   cat <<\EOF
695
696 Optional Packages:
697   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
698   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
699
700 Optional Features:
701   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
702   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
703
704 General Options:
705   --with-system-type=XXX  test: override derived host system-type
706   --without-ada           suppress check for Ada compiler
707   --disable-stripping     do not strip (debug info) installed executables
708   --with-strip-program=XX specify program to use when stripping in install
709   --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD
710   --with-pkg-config-libdir[=XXX] use given directory for installing pc-files
711   --without-tests         suppress build with test-programs
712   --enable-mixed-case     tic should assume mixed-case filenames
713   --with-install-prefix   prefixes actual install-location ($DESTDIR)
714 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
715   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
716   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
717   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
718   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
719   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
720   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
721 Options to Specify the Libraries Built/Used:
722   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
723   --with-curses-dir=DIR   directory in which (n)curses is installed
724   --with-screen=XXX       use specified curses-libraries
725   --with-lib-prefix       override library-prefix
726   --with-shlib-version[={rel|abi}] use release or ABI version in shared library file names
727   --enable-rpath-link     link sample programs with rpath option
728 Fine-Tuning Your Configuration:
729   --enable-broken_linker  compile with broken-linker support code
730   --disable-largefile     omit support for large files
731   --with-rcs-ids          compile-in RCS identifiers
732 Extensions:
733   --disable-ext-funcs     disable function-extensions
734   --enable-const          compile with extra/non-standard const
735 Development Code:
736   --without-develop       disable development options
737 Experimental Code:
738   --with-pthread          use POSIX thread library
739   --enable-weak-symbols   enable weak-symbols for pthreads
740   --enable-reentrant      compile with experimental reentrant code
741   --with-wrap-prefix=XXX  override prefix used for public variables
742 Testing/development Options:
743   --disable-echo          do not display "compiling" commands
744   --enable-warnings       test: turn on gcc compiler warnings
745   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
746   --enable-assertions     test: turn on generation of assertion code
747   --enable-expanded       test: generate functions for certain macros
748   --disable-macros        test: use functions rather than macros
749   --with-trace            test: add trace() function to all models of ncurses
750   --disable-gnat-projects test: disable GNAT projects even if usable
751 Ada95 Binding Options:
752   --with-ada-compiler[=CMD] use CMD as Ada95 compiler (default: gnatmake)
753   --with-ada-include=DIR  find Ada95 includes in DIR (default: PREFIX/share/ada/adainclude)
754   --with-ada-objects=DIR  find Ada95 objects in DIR (default: PREFIX/lib/ada/adalib)
755   --with-ada-sharedlib    build Ada95 shared library; requires GNAT project support
756   --with-ada-libname[=XXX]  use XXX as Ada95 library name
757
758 Some influential environment variables:
759   CC          C compiler command
760   CFLAGS      C compiler flags
761   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
762               nonstandard directory <lib dir>
763   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
764               headers in a nonstandard directory <include dir>
765   CPP         C preprocessor
766
767 Use these variables to override the choices made by `configure' or to help
768 it to find libraries and programs with nonstandard names/locations.
769
770 EOF
771 fi
772
773 if test "$ac_init_help" = "recursive"; then
774   # If there are subdirs, report their specific --help.
775   ac_popdir=`pwd`
776   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
777     cd "$ac_subdir"
778     # A "../" for each directory in /$ac_subdir.
779     ac_dots=`echo "$ac_subdir" |
780              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
781
782     case "$srcdir" in
783     .) # No --srcdir option.  We are building in place.
784       ac_sub_srcdir="$srcdir" ;;
785     [\\/]* | ?:[\\/]* ) # Absolute path.
786       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
787     *) # Relative path.
788       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
789     esac
790
791     # Check for guested configure; otherwise get Cygnus style configure.
792     if test -f "$ac_sub_srcdir/configure.gnu"; then
793       echo
794       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
795     elif test -f "$ac_sub_srcdir/configure"; then
796       echo
797       $SHELL "$ac_sub_srcdir/configure" --help=recursive
798     elif test -f "$ac_sub_srcdir/configure.ac" ||
799            test -f "$ac_sub_srcdir/configure.in"; then
800       echo
801       "$ac_configure" --help
802     else
803       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
804     fi
805     cd "$ac_popdir"
806   done
807 fi
808
809 test -n "$ac_init_help" && exit 0
810 if "$ac_init_version"; then
811   cat <<\EOF
812
813 Copyright 2003-2022,2023        Thomas E. Dickey
814 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
815 Free Software Foundation, Inc.
816 This configure script is free software; the Free Software Foundation
817 gives unlimited permission to copy, distribute and modify it.
818 EOF
819   exit 0
820 fi
821 exec 5>config.log
822 cat >&5 <<EOF
823 This file contains any messages produced by compilers while
824 running configure, to aid debugging if configure makes a mistake.
825
826 It was created by $as_me, which was
827 generated by GNU Autoconf 2.52.20231210.  Invocation command line was
828
829   $ $0 $@
830
831 EOF
832 {
833 cat <<_ASUNAME
834 ## ---------- ##
835 ## Platform.  ##
836 ## ---------- ##
837
838 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
839 uname -m = `(uname -m) 2>/dev/null || echo unknown`
840 uname -r = `(uname -r) 2>/dev/null || echo unknown`
841 uname -s = `(uname -s) 2>/dev/null || echo unknown`
842 uname -v = `(uname -v) 2>/dev/null || echo unknown`
843
844 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
845 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
846
847 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
848 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
849 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
850 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
851 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
852 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
853 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
854
855 PATH = $PATH
856
857 _ASUNAME
858 } >&5
859
860 cat >&5 <<EOF
861 ## ------------ ##
862 ## Core tests.  ##
863 ## ------------ ##
864
865 EOF
866
867 # Keep a trace of the command line.
868 # Strip out --no-create and --no-recursion so they do not pile up.
869 # Also quote any args containing shell meta-characters.
870 ac_configure_args=
871 ac_sep=
872 for ac_arg
873 do
874   case "$ac_arg" in
875   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
876   | --no-cr | --no-c) ;;
877   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
878   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
879   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
880     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
881     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
882     ac_sep=" " ;;
883   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
884      ac_sep=" " ;;
885   esac
886   # Get rid of the leading space.
887 done
888
889 # When interrupted or exit'd, cleanup temporary files, and complete
890 # config.log.  We remove comments because anyway the quotes in there
891 # would cause problems or look ugly.
892 trap 'exit_status=$?
893   # Save into config.log some information that might help in debugging.
894   echo >&5
895   echo "## ----------------- ##" >&5
896   echo "## Cache variables.  ##" >&5
897   echo "## ----------------- ##" >&5
898   echo >&5
899   # The following way of writing the cache mishandles newlines in values,
900 {
901   (set) 2>&1 |
902     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
903     *ac_space=\ *)
904       sed -n \
905         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
906           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
907       ;;
908     *)
909       sed -n \
910         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
911       ;;
912     esac;
913 } >&5
914   sed "/^$/d" confdefs.h >conftest.log
915   if test -s conftest.log; then
916     echo >&5
917     echo "## ------------ ##" >&5
918     echo "## confdefs.h.  ##" >&5
919     echo "## ------------ ##" >&5
920     echo >&5
921     cat conftest.log >&5
922   fi
923   (echo; echo) >&5
924   test "$ac_signal" != 0 &&
925     echo "$as_me: caught signal $ac_signal" >&5
926   echo "$as_me: exit $exit_status" >&5
927   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
928     exit $exit_status
929      ' 0
930 for ac_signal in 1 2 13 15; do
931   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
932 done
933 ac_signal=0
934
935 # confdefs.h avoids OS command line length limits that DEFS can exceed.
936 rm -rf conftest* confdefs.h
937 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
938 echo >confdefs.h
939
940 # Let the site file select an alternate cache file if it wants to.
941 # Prefer explicitly selected file to automatically selected ones.
942 if test -z "$CONFIG_SITE"; then
943   if test "x$prefix" != xNONE; then
944     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
945   else
946     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
947   fi
948 fi
949 for ac_site_file in $CONFIG_SITE; do
950   if test -r "$ac_site_file"; then
951     { echo "$as_me:951: loading site script $ac_site_file" >&5
952 echo "$as_me: loading site script $ac_site_file" >&6;}
953     cat "$ac_site_file" >&5
954     . "$ac_site_file"
955   fi
956 done
957
958 if test -r "$cache_file"; then
959   # Some versions of bash will fail to source /dev/null (special
960   # files actually), so we avoid doing that.
961   if test -f "$cache_file"; then
962     { echo "$as_me:962: loading cache $cache_file" >&5
963 echo "$as_me: loading cache $cache_file" >&6;}
964     case $cache_file in
965       [\\/]* | ?:[\\/]* ) . $cache_file;;
966       *)                      . ./$cache_file;;
967     esac
968   fi
969 else
970   { echo "$as_me:970: creating cache $cache_file" >&5
971 echo "$as_me: creating cache $cache_file" >&6;}
972   >$cache_file
973 fi
974
975 # Check that the precious variables saved in the cache have kept the same
976 # value.
977 ac_cache_corrupted=false
978 for ac_var in `(set) 2>&1 |
979                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
980   eval ac_old_set=\$ac_cv_env_${ac_var}_set
981   eval ac_new_set=\$ac_env_${ac_var}_set
982   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
983   eval ac_new_val="\$ac_env_${ac_var}_value"
984   case "$ac_old_set,$ac_new_set" in
985     set,)
986       { echo "$as_me:986: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
987 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
988       ac_cache_corrupted=: ;;
989     ,set)
990       { echo "$as_me:990: error: \`$ac_var' was not set in the previous run" >&5
991 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
992       ac_cache_corrupted=: ;;
993     ,);;
994     *)
995       if test "x$ac_old_val" != "x$ac_new_val"; then
996         { echo "$as_me:996: error: \`$ac_var' has changed since the previous run:" >&5
997 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
998         { echo "$as_me:998:   former value:  $ac_old_val" >&5
999 echo "$as_me:   former value:  $ac_old_val" >&2;}
1000         { echo "$as_me:1000:   current value: $ac_new_val" >&5
1001 echo "$as_me:   current value: $ac_new_val" >&2;}
1002         ac_cache_corrupted=:
1003       fi;;
1004   esac
1005   # Pass precious variables to config.status.  It doesn't matter if
1006   # we pass some twice (in addition to the command line arguments).
1007   if test "$ac_new_set" = set; then
1008     case "$ac_new_val" in
1009     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1010       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1011       ac_configure_args="$ac_configure_args '$ac_arg'"
1012       ;;
1013     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1014        ;;
1015     esac
1016   fi
1017 done
1018 if "$ac_cache_corrupted"; then
1019   { echo "$as_me:1019: error: changes in the environment can compromise the build" >&5
1020 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1021   { { echo "$as_me:1021: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1022 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1023    { (exit 1); exit 1; }; }
1024 fi
1025
1026 ac_ext=c
1027 ac_cpp='$CPP $CPPFLAGS'
1028 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1029 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1030 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1031 ac_main_return="return"
1032
1033 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1034   *c*,-n*) ECHO_N=
1035            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1036            ECHO_T='     '
1037            ;;
1038   *c*,*  ) ECHO_N=-n
1039            ECHO_C=
1040            ECHO_T=
1041            ;;
1042   *)       ECHO_N=
1043            ECHO_C='\c'
1044            ECHO_T=
1045            ;;
1046 esac
1047 echo "#! $SHELL" >conftest.sh
1048 echo  "exit 0"   >>conftest.sh
1049 chmod +x conftest.sh
1050 if { (echo "$as_me:1050: PATH=\".;.\"; conftest.sh") >&5
1051   (PATH=".;."; conftest.sh) 2>&5
1052   ac_status=$?
1053   echo "$as_me:1053: \$? = $ac_status" >&5
1054   (exit "$ac_status"); }; then
1055   ac_path_separator=';'
1056 else
1057   ac_path_separator=:
1058 fi
1059 PATH_SEPARATOR="$ac_path_separator"
1060 rm -f conftest.sh
1061
1062 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1063
1064 PACKAGE="AdaCurses"
1065
1066 top_builddir=`pwd`
1067
1068 ac_aux_dir=
1069 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1070   if test -f "$ac_dir/install-sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install-sh -c"
1073     break
1074   elif test -f "$ac_dir/install.sh"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/install.sh -c"
1077     break
1078   elif test -f "$ac_dir/shtool"; then
1079     ac_aux_dir=$ac_dir
1080     ac_install_sh="$ac_aux_dir/shtool install -c"
1081     break
1082   fi
1083 done
1084 if test -z "$ac_aux_dir"; then
1085   { { echo "$as_me:1085: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1086 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1087    { (exit 1); exit 1; }; }
1088 fi
1089 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1090 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1091 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1092
1093 # Make sure we can run config.sub.
1094 $ac_config_sub sun4 >/dev/null 2>&1 ||
1095   { { echo "$as_me:1095: error: cannot run $ac_config_sub" >&5
1096 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1097    { (exit 1); exit 1; }; }
1098
1099 echo "$as_me:1099: checking build system type" >&5
1100 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1101 if test "${ac_cv_build+set}" = set; then
1102   echo $ECHO_N "(cached) $ECHO_C" >&6
1103 else
1104   ac_cv_build_alias=$build_alias
1105 test -z "$ac_cv_build_alias" &&
1106   ac_cv_build_alias=`$ac_config_guess`
1107 test -z "$ac_cv_build_alias" &&
1108   { { echo "$as_me:1108: error: cannot guess build type; you must specify one" >&5
1109 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1110    { (exit 1); exit 1; }; }
1111 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1112   { { echo "$as_me:1112: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1113 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1114    { (exit 1); exit 1; }; }
1115
1116 fi
1117 echo "$as_me:1117: result: $ac_cv_build" >&5
1118 echo "${ECHO_T}$ac_cv_build" >&6
1119 build=$ac_cv_build
1120 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1121 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1122 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1123
1124 echo "$as_me:1124: checking host system type" >&5
1125 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1126 if test "${ac_cv_host+set}" = set; then
1127   echo $ECHO_N "(cached) $ECHO_C" >&6
1128 else
1129   ac_cv_host_alias=$host_alias
1130 test -z "$ac_cv_host_alias" &&
1131   ac_cv_host_alias=$ac_cv_build_alias
1132 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1133   { { echo "$as_me:1133: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1134 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1135    { (exit 1); exit 1; }; }
1136
1137 fi
1138 echo "$as_me:1138: result: $ac_cv_host" >&5
1139 echo "${ECHO_T}$ac_cv_host" >&6
1140 host=$ac_cv_host
1141 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1142 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1143 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1144
1145 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1146         echo "$as_me:1146: checking target system type" >&5
1147 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1148 if test "${ac_cv_target+set}" = set; then
1149   echo $ECHO_N "(cached) $ECHO_C" >&6
1150 else
1151   ac_cv_target_alias=$target_alias
1152 test "x$ac_cv_target_alias" = "x" &&
1153   ac_cv_target_alias=$ac_cv_host_alias
1154 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1155   { { echo "$as_me:1155: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1156 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1157    { (exit 1); exit 1; }; }
1158
1159 fi
1160 echo "$as_me:1160: result: $ac_cv_target" >&5
1161 echo "${ECHO_T}$ac_cv_target" >&6
1162 target=$ac_cv_target
1163 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1164 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1165 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1166
1167 # The aliases save the names the user supplied, while $host etc.
1168 # will get canonicalized.
1169 test -n "$target_alias" &&
1170   test "$program_prefix$program_suffix$program_transform_name" = \
1171     NONENONEs,x,x, &&
1172   program_prefix=${target_alias}-
1173         system_name="$host_os"
1174 else
1175         system_name="`(uname -s -r) 2>/dev/null`"
1176         if test -z "$system_name" ; then
1177                 system_name="`(hostname) 2>/dev/null`"
1178         fi
1179 fi
1180 test -n "$system_name" &&
1181 cat >>confdefs.h <<EOF
1182 #define SYSTEM_NAME "$system_name"
1183 EOF
1184
1185 if test "${cf_cv_system_name+set}" = set; then
1186   echo $ECHO_N "(cached) $ECHO_C" >&6
1187 else
1188   cf_cv_system_name="$system_name"
1189 fi
1190
1191 test -z "$system_name" && system_name="$cf_cv_system_name"
1192 test -n "$cf_cv_system_name" && echo "$as_me:1192: result: Configuring for $cf_cv_system_name" >&5
1193 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1194
1195 if test ".$system_name" != ".$cf_cv_system_name" ; then
1196         echo "$as_me:1196: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1197 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1198         { { echo "$as_me:1198: error: \"Please remove config.cache and try again.\"" >&5
1199 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1200    { (exit 1); exit 1; }; }
1201 fi
1202
1203 # Check whether --with-system-type or --without-system-type was given.
1204 if test "${with_system_type+set}" = set; then
1205   withval="$with_system_type"
1206   { echo "$as_me:1206: WARNING: overriding system type to $withval" >&5
1207 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1208         cf_cv_system_name=$withval
1209         host_os=$withval
1210
1211 fi;
1212
1213 ###     Save the given $CFLAGS to allow user-override.
1214 cf_user_CFLAGS="$CFLAGS"
1215
1216 ###     Default install-location
1217 for ac_prog in ggrep grep
1218 do
1219   # Extract the first word of "$ac_prog", so it can be a program name with args.
1220 set dummy $ac_prog; ac_word=$2
1221 echo "$as_me:1221: checking for $ac_word" >&5
1222 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1223 if test "${ac_cv_prog_GREP+set}" = set; then
1224   echo $ECHO_N "(cached) $ECHO_C" >&6
1225 else
1226   if test -n "$GREP"; then
1227   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1228 else
1229   ac_save_IFS=$IFS; IFS=$ac_path_separator
1230 ac_dummy="$PATH"
1231 for ac_dir in $ac_dummy; do
1232   IFS=$ac_save_IFS
1233   test -z "$ac_dir" && ac_dir=.
1234   $as_executable_p "$ac_dir/$ac_word" || continue
1235 ac_cv_prog_GREP="$ac_prog"
1236 echo "$as_me:1236: found $ac_dir/$ac_word" >&5
1237 break
1238 done
1239
1240 fi
1241 fi
1242 GREP=$ac_cv_prog_GREP
1243 if test -n "$GREP"; then
1244   echo "$as_me:1244: result: $GREP" >&5
1245 echo "${ECHO_T}$GREP" >&6
1246 else
1247   echo "$as_me:1247: result: no" >&5
1248 echo "${ECHO_T}no" >&6
1249 fi
1250
1251   test -n "$GREP" && break
1252 done
1253 test -n "$GREP" || GREP=": "
1254
1255 echo "$as_me:1255: checking for fgrep" >&5
1256 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1257 if test "${ac_cv_path_FGREP+set}" = set; then
1258   echo $ECHO_N "(cached) $ECHO_C" >&6
1259 else
1260   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1261    then ac_cv_path_FGREP="$GREP -F"
1262    else
1263      for ac_prog in gfgrep fgrep
1264 do
1265   # Extract the first word of "$ac_prog", so it can be a program name with args.
1266 set dummy $ac_prog; ac_word=$2
1267 echo "$as_me:1267: checking for $ac_word" >&5
1268 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1269 if test "${ac_cv_path_FGREP+set}" = set; then
1270   echo $ECHO_N "(cached) $ECHO_C" >&6
1271 else
1272   case $FGREP in
1273   [\\/]* | ?:[\\/]*)
1274   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1275   ;;
1276   *)
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   if $as_executable_p "$ac_dir/$ac_word"; then
1283    ac_cv_path_FGREP="$ac_dir/$ac_word"
1284    echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285    break
1286 fi
1287 done
1288
1289   ;;
1290 esac
1291 fi
1292 FGREP=$ac_cv_path_FGREP
1293
1294 if test -n "$FGREP"; then
1295   echo "$as_me:1295: result: $FGREP" >&5
1296 echo "${ECHO_T}$FGREP" >&6
1297 else
1298   echo "$as_me:1298: result: no" >&5
1299 echo "${ECHO_T}no" >&6
1300 fi
1301
1302   test -n "$FGREP" && break
1303 done
1304 test -n "$FGREP" || FGREP=": "
1305
1306      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1306: error: cannot find workable fgrep" >&5
1307 echo "$as_me: error: cannot find workable fgrep" >&2;}
1308    { (exit 1); exit 1; }; }
1309    fi
1310 fi
1311 echo "$as_me:1311: result: $ac_cv_path_FGREP" >&5
1312 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1313  FGREP="$ac_cv_path_FGREP"
1314
1315 echo "$as_me:1315: checking for prefix" >&5
1316 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1317 if test "x$prefix" = "xNONE" ; then
1318         case "$cf_cv_system_name" in
1319                 # non-vendor systems don't have a conflict
1320         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1321                 prefix=/usr
1322                 ;;
1323         (*)     prefix=$ac_default_prefix
1324                 ;;
1325         esac
1326 fi
1327 echo "$as_me:1327: result: $prefix" >&5
1328 echo "${ECHO_T}$prefix" >&6
1329
1330 if test "x$prefix" = "xNONE" ; then
1331 echo "$as_me:1331: checking for default include-directory" >&5
1332 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1333 test -n "$verbose" && echo 1>&6
1334 for cf_symbol in \
1335         "$includedir" \
1336         "$includedir/ncurses" \
1337         "$prefix/include" \
1338         "$prefix/include/ncurses" \
1339         /usr/local/include \
1340         /usr/local/include/ncurses \
1341         /usr/include \
1342         /usr/include/ncurses
1343 do
1344         cf_dir=`eval echo "$cf_symbol"`
1345         if test -f "$cf_dir/curses.h" ; then
1346         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1347                 includedir="$cf_symbol"
1348                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1349                 break
1350         fi
1351         fi
1352         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1353 done
1354 echo "$as_me:1354: result: $includedir" >&5
1355 echo "${ECHO_T}$includedir" >&6
1356 fi
1357
1358 ###     Checks for programs.
1359
1360 # Check whether --with-ada or --without-ada was given.
1361 if test "${with_ada+set}" = set; then
1362   withval="$with_ada"
1363   cf_with_ada=$withval
1364 else
1365   cf_with_ada=yes
1366 fi;
1367
1368 cf_prog_cc="gcc cc"
1369 if test "x$cf_with_ada" = xyes
1370 then
1371
1372 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
1373 do
1374
1375 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1376
1377         unset ac_cv_path_cf_TEMP_gnat
1378         unset cf_TEMP_gnat
1379         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
1380 set dummy $cf_prog_gnat; ac_word=$2
1381 echo "$as_me:1381: checking for $ac_word" >&5
1382 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1383 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
1384   echo $ECHO_N "(cached) $ECHO_C" >&6
1385 else
1386   case $cf_TEMP_gnat in
1387   [\\/]* | ?:[\\/]*)
1388   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
1389   ;;
1390   *)
1391   ac_save_IFS=$IFS; IFS=$ac_path_separator
1392 ac_dummy="$PATH"
1393 for ac_dir in $ac_dummy; do
1394   IFS=$ac_save_IFS
1395   test -z "$ac_dir" && ac_dir=.
1396   if $as_executable_p "$ac_dir/$ac_word"; then
1397    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
1398    echo "$as_me:1398: found $ac_dir/$ac_word" >&5
1399    break
1400 fi
1401 done
1402
1403   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
1404   ;;
1405 esac
1406 fi
1407 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
1408
1409 if test -n "$cf_TEMP_gnat"; then
1410   echo "$as_me:1410: result: $cf_TEMP_gnat" >&5
1411 echo "${ECHO_T}$cf_TEMP_gnat" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
1418
1419         if test "x$cf_TEMP_gnat" != xno; then
1420                 unset cf_cv_gnat_version
1421                 unset cf_TEMP_gnat
1422
1423 echo "$as_me:1423: checking for $cf_prog_gnat version" >&5
1424 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
1425 if test "${cf_cv_gnat_version+set}" = set; then
1426   echo $ECHO_N "(cached) $ECHO_C" >&6
1427 else
1428
1429 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
1430         grep '[0-9].[0-9][0-9]*' |\
1431         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
1432
1433 fi
1434 echo "$as_me:1434: result: $cf_cv_gnat_version" >&5
1435 echo "${ECHO_T}$cf_cv_gnat_version" >&6
1436 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
1437 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
1438
1439         fi
1440         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
1441
1442         unset cf_TEMP_gnat
1443         unset cf_cv_gnat_version
1444         unset ac_cv_path_cf_TEMP_gnat
1445 done
1446
1447 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
1448         cf_ada_make=
1449         cf_cv_prog_gnat_correct=no
1450 else
1451         cf_ada_make=gnatmake
1452         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
1453                 # gprconfig is newer than gnatmake; we can continue...
1454                 cf_ada_config="##"
1455         else
1456                 rm -rf ./conftest* ./*~conftest*
1457                 if mkdir conftest.src
1458                 then
1459                         cf_ada_config=""
1460                         cd conftest.src
1461                         for cf_gprconfig in Ada C
1462                         do
1463                                 echo "$as_me:1463: checking for gprconfig name for $cf_gprconfig" >&5
1464 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
1465                                 if test "$cf_gprconfig" = C
1466                                 then
1467                                         for cf_gprconfig_param in \
1468                                                 "$cf_gprconfig,,,,GNATGCC" \
1469                                                 "$cf_gprconfig,,,,GCC" \
1470                                                 "$cf_gprconfig"
1471                                         do
1472                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
1473                                                 test -n "$cf_gprconfig_value" && break
1474                                         done
1475                                 else
1476                                         cf_gprconfig_param=$cf_gprconfig
1477                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
1478                                 fi
1479                                 if test -n "$cf_gprconfig_value"
1480                                 then
1481                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
1482                                         echo "$as_me:1482: result: $cf_gprconfig_value" >&5
1483 echo "${ECHO_T}$cf_gprconfig_value" >&6
1484                                 else
1485                                         echo "$as_me:1485: result: missing" >&5
1486 echo "${ECHO_T}missing" >&6
1487                                         cf_ada_config="#"
1488                                         break
1489                                 fi
1490                         done
1491                         cd ..
1492                         rm -rf ./conftest* ./*~conftest*
1493                 fi
1494         fi
1495         if test "x$cf_ada_config" != "x#"
1496         then
1497
1498 echo "$as_me:1498: checking for gnat version" >&5
1499 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
1500 if test "${cf_cv_gnat_version+set}" = set; then
1501   echo $ECHO_N "(cached) $ECHO_C" >&6
1502 else
1503
1504 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
1505         grep '[0-9].[0-9][0-9]*' |\
1506         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
1507
1508 fi
1509 echo "$as_me:1509: result: $cf_cv_gnat_version" >&5
1510 echo "${ECHO_T}$cf_cv_gnat_version" >&6
1511 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
1512
1513 case "$cf_cv_gnat_version" in
1514 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
1515         cf_cv_prog_gnat_correct=yes
1516         ;;
1517 (*)
1518         { echo "$as_me:1518: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
1519 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
1520         cf_cv_prog_gnat_correct=no
1521         ;;
1522 esac
1523
1524                 # Extract the first word of "m4", so it can be a program name with args.
1525 set dummy m4; ac_word=$2
1526 echo "$as_me:1526: checking for $ac_word" >&5
1527 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1528 if test "${ac_cv_prog_M4_exists+set}" = set; then
1529   echo $ECHO_N "(cached) $ECHO_C" >&6
1530 else
1531   if test -n "$M4_exists"; then
1532   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
1533 else
1534   ac_save_IFS=$IFS; IFS=$ac_path_separator
1535 ac_dummy="$PATH"
1536 for ac_dir in $ac_dummy; do
1537   IFS=$ac_save_IFS
1538   test -z "$ac_dir" && ac_dir=.
1539   $as_executable_p "$ac_dir/$ac_word" || continue
1540 ac_cv_prog_M4_exists="yes"
1541 echo "$as_me:1541: found $ac_dir/$ac_word" >&5
1542 break
1543 done
1544
1545   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
1546 fi
1547 fi
1548 M4_exists=$ac_cv_prog_M4_exists
1549 if test -n "$M4_exists"; then
1550   echo "$as_me:1550: result: $M4_exists" >&5
1551 echo "${ECHO_T}$M4_exists" >&6
1552 else
1553   echo "$as_me:1553: result: no" >&5
1554 echo "${ECHO_T}no" >&6
1555 fi
1556
1557                 if test "$ac_cv_prog_M4_exists" = no; then
1558                         cf_cv_prog_gnat_correct=no
1559                         { echo "$as_me:1559: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
1560 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
1561                 fi
1562                 if test "$cf_cv_prog_gnat_correct" = yes; then
1563                         echo "$as_me:1563: checking if GNAT works" >&5
1564 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
1565
1566 rm -rf ./conftest* ./*~conftest*
1567 cat >>conftest.ads <<CF_EOF
1568 procedure conftest;
1569 CF_EOF
1570 cat >>conftest.adb <<CF_EOF
1571 with Text_IO;
1572 with GNAT.OS_Lib;
1573 procedure conftest is
1574 begin
1575    Text_IO.Put ("Hello World");
1576    Text_IO.New_Line;
1577    GNAT.OS_Lib.OS_Exit (0);
1578 end conftest;
1579 CF_EOF
1580 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
1581    if ( ./conftest 1>&5 2>&1 ) ; then
1582       cf_cv_prog_gnat_correct=yes
1583    else
1584       cf_cv_prog_gnat_correct=no
1585    fi
1586 else
1587    cf_cv_prog_gnat_correct=no
1588 fi
1589 rm -rf ./conftest* ./*~conftest*
1590
1591                         echo "$as_me:1591: result: $cf_cv_prog_gnat_correct" >&5
1592 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
1593                 fi
1594         else
1595                 cf_cv_prog_gnat_correct=no
1596         fi
1597 fi
1598
1599         if test "x$cf_cv_prog_gnat_correct" = xyes; then
1600                 # gcc's developers chose to deprecate gnatgcc before making gprconfig
1601                 # work.  They replaced gnatgcc in gcc 13 with a script which spits out
1602                 # a warning offering advice which could never work.
1603                 #
1604                 # Here is a workaround.
1605                 # Extract the first word of "gnatgcc", so it can be a program name with args.
1606 set dummy gnatgcc; ac_word=$2
1607 echo "$as_me:1607: checking for $ac_word" >&5
1608 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1609 if test "${ac_cv_path_cf_cv_path_gnatgcc+set}" = set; then
1610   echo $ECHO_N "(cached) $ECHO_C" >&6
1611 else
1612   case $cf_cv_path_gnatgcc in
1613   [\\/]* | ?:[\\/]*)
1614   ac_cv_path_cf_cv_path_gnatgcc="$cf_cv_path_gnatgcc" # Let the user override the test with a path.
1615   ;;
1616   *)
1617   ac_save_IFS=$IFS; IFS=$ac_path_separator
1618 ac_dummy="$PATH"
1619 for ac_dir in $ac_dummy; do
1620   IFS=$ac_save_IFS
1621   test -z "$ac_dir" && ac_dir=.
1622   if $as_executable_p "$ac_dir/$ac_word"; then
1623    ac_cv_path_cf_cv_path_gnatgcc="$ac_dir/$ac_word"
1624    echo "$as_me:1624: found $ac_dir/$ac_word" >&5
1625    break
1626 fi
1627 done
1628
1629   test -z "$ac_cv_path_cf_cv_path_gnatgcc" && ac_cv_path_cf_cv_path_gnatgcc="no"
1630   ;;
1631 esac
1632 fi
1633 cf_cv_path_gnatgcc=$ac_cv_path_cf_cv_path_gnatgcc
1634
1635 if test -n "$cf_cv_path_gnatgcc"; then
1636   echo "$as_me:1636: result: $cf_cv_path_gnatgcc" >&5
1637 echo "${ECHO_T}$cf_cv_path_gnatgcc" >&6
1638 else
1639   echo "$as_me:1639: result: no" >&5
1640 echo "${ECHO_T}no" >&6
1641 fi
1642
1643                 if test "$cf_cv_path_gnatgcc" != no
1644                 then
1645                         echo "$as_me:1645: checking for improvement" >&5
1646 echo $ECHO_N "checking for improvement... $ECHO_C" >&6
1647                         cf_file_gnatgcc=`file -L "$cf_cv_path_gnatgcc" 2>/dev/null`
1648                         case "x$cf_file_gnatgcc" in
1649                         (*script*)
1650                                 cf_cv_path_gnatgcc=`sh -x "$cf_cv_path_gnatgcc" --version 2>&1 | grep -w exec | sed -e 's/^[    ]*+[    ]*//' -e 's/exec[       ]//' -e 's/ .*//'`
1651                                 ;;
1652                         (*)
1653                                 cf_cv_path_gnatgcc=no
1654                                 ;;
1655                         esac
1656                         echo "$as_me:1656: result: $cf_cv_path_gnatgcc" >&5
1657 echo "${ECHO_T}$cf_cv_path_gnatgcc" >&6
1658                         test "$cf_cv_path_gnatgcc" = no && cf_cv_path_gnatgcc=gnatgcc
1659                         cf_prog_cc="$cf_cv_path_gnatgcc $cf_prog_cc"
1660                 fi
1661         fi
1662 fi
1663 case "$cf_prog_cc" in
1664 (*/*)
1665         CC="$cf_prog_cc"
1666
1667         ;;
1668 (*)
1669
1670 ac_ext=c
1671 ac_cpp='$CPP $CPPFLAGS'
1672 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1673 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1674 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1675 ac_main_return="return"
1676 if test -n "$ac_tool_prefix"; then
1677   for ac_prog in $cf_prog_cc
1678   do
1679     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1680 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1681 echo "$as_me:1681: checking for $ac_word" >&5
1682 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1683 if test "${ac_cv_prog_CC+set}" = set; then
1684   echo $ECHO_N "(cached) $ECHO_C" >&6
1685 else
1686   if test -n "$CC"; then
1687   ac_cv_prog_CC="$CC" # Let the user override the test.
1688 else
1689   ac_save_IFS=$IFS; IFS=$ac_path_separator
1690 ac_dummy="$PATH"
1691 for ac_dir in $ac_dummy; do
1692   IFS=$ac_save_IFS
1693   test -z "$ac_dir" && ac_dir=.
1694   $as_executable_p "$ac_dir/$ac_word" || continue
1695 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1696 echo "$as_me:1696: found $ac_dir/$ac_word" >&5
1697 break
1698 done
1699
1700 fi
1701 fi
1702 CC=$ac_cv_prog_CC
1703 if test -n "$CC"; then
1704   echo "$as_me:1704: result: $CC" >&5
1705 echo "${ECHO_T}$CC" >&6
1706 else
1707   echo "$as_me:1707: result: no" >&5
1708 echo "${ECHO_T}no" >&6
1709 fi
1710
1711     test -n "$CC" && break
1712   done
1713 fi
1714 if test -z "$CC"; then
1715   ac_ct_CC=$CC
1716   for ac_prog in $cf_prog_cc
1717 do
1718   # Extract the first word of "$ac_prog", so it can be a program name with args.
1719 set dummy $ac_prog; ac_word=$2
1720 echo "$as_me:1720: checking for $ac_word" >&5
1721 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1722 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1723   echo $ECHO_N "(cached) $ECHO_C" >&6
1724 else
1725   if test -n "$ac_ct_CC"; then
1726   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1727 else
1728   ac_save_IFS=$IFS; IFS=$ac_path_separator
1729 ac_dummy="$PATH"
1730 for ac_dir in $ac_dummy; do
1731   IFS=$ac_save_IFS
1732   test -z "$ac_dir" && ac_dir=.
1733   $as_executable_p "$ac_dir/$ac_word" || continue
1734 ac_cv_prog_ac_ct_CC="$ac_prog"
1735 echo "$as_me:1735: found $ac_dir/$ac_word" >&5
1736 break
1737 done
1738
1739 fi
1740 fi
1741 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1742 if test -n "$ac_ct_CC"; then
1743   echo "$as_me:1743: result: $ac_ct_CC" >&5
1744 echo "${ECHO_T}$ac_ct_CC" >&6
1745 else
1746   echo "$as_me:1746: result: no" >&5
1747 echo "${ECHO_T}no" >&6
1748 fi
1749
1750   test -n "$ac_ct_CC" && break
1751 done
1752
1753   CC=$ac_ct_CC
1754 fi
1755
1756 test -z "$CC" && { { echo "$as_me:1756: error: no acceptable cc found in \$PATH" >&5
1757 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1758    { (exit 1); exit 1; }; }
1759
1760 # Provide some information about the compiler.
1761 echo "$as_me:1761:" \
1762      "checking for C compiler version" >&5
1763 ac_compiler=`set X $ac_compile; echo "$2"`
1764 { (eval echo "$as_me:1764: \"$ac_compiler --version </dev/null >&5\"") >&5
1765   (eval $ac_compiler --version </dev/null >&5) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit "$ac_status"); }
1769 { (eval echo "$as_me:1769: \"$ac_compiler -v </dev/null >&5\"") >&5
1770   (eval $ac_compiler -v </dev/null >&5) 2>&5
1771   ac_status=$?
1772   echo "$as_me:1772: \$? = $ac_status" >&5
1773   (exit "$ac_status"); }
1774 { (eval echo "$as_me:1774: \"$ac_compiler -V </dev/null >&5\"") >&5
1775   (eval $ac_compiler -V </dev/null >&5) 2>&5
1776   ac_status=$?
1777   echo "$as_me:1777: \$? = $ac_status" >&5
1778   (exit "$ac_status"); }
1779
1780 cat >"conftest.$ac_ext" <<_ACEOF
1781 #line 1781 "configure"
1782 #include "confdefs.h"
1783
1784 int
1785 main (void)
1786 {
1787
1788   ;
1789   return 0;
1790 }
1791 _ACEOF
1792 ac_clean_files_save=$ac_clean_files
1793 ac_clean_files="$ac_clean_files a.out a.exe"
1794 # Try to create an executable without -o first, disregard a.out.
1795 # It will help us diagnose broken compilers, and finding out an intuition
1796 # of exeext.
1797 echo "$as_me:1797: checking for C compiler default output" >&5
1798 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1799 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1800 if { (eval echo "$as_me:1800: \"$ac_link_default\"") >&5
1801   (eval $ac_link_default) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit "$ac_status"); }; then
1805   # Find the output, starting from the most likely.  This scheme is
1806 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1807 # resort.
1808 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1809                 ls a.out conftest 2>/dev/null;
1810                 ls a.* conftest.* 2>/dev/null`; do
1811   case $ac_file in
1812     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1813     a.out ) # We found the default executable, but exeext='' is most
1814             # certainly right.
1815             break;;
1816     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1817           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1818           export ac_cv_exeext
1819           break;;
1820     * ) break;;
1821   esac
1822 done
1823 else
1824   echo "$as_me: failed program was:" >&5
1825 cat "conftest.$ac_ext" >&5
1826 { { echo "$as_me:1826: error: C compiler cannot create executables" >&5
1827 echo "$as_me: error: C compiler cannot create executables" >&2;}
1828    { (exit 77); exit 77; }; }
1829 fi
1830
1831 ac_exeext=$ac_cv_exeext
1832 echo "$as_me:1832: result: $ac_file" >&5
1833 echo "${ECHO_T}$ac_file" >&6
1834
1835 # Check the compiler produces executables we can run.  If not, either
1836 # the compiler is broken, or we cross compile.
1837 echo "$as_me:1837: checking whether the C compiler works" >&5
1838 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1839 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1840 # If not cross compiling, check that we can run a simple program.
1841 if test "$cross_compiling" != yes; then
1842   if { ac_try='./$ac_file'
1843   { (eval echo "$as_me:1843: \"$ac_try\"") >&5
1844   (eval $ac_try) 2>&5
1845   ac_status=$?
1846   echo "$as_me:1846: \$? = $ac_status" >&5
1847   (exit "$ac_status"); }; }; then
1848     cross_compiling=no
1849   else
1850     if test "$cross_compiling" = maybe; then
1851         cross_compiling=yes
1852     else
1853         { { echo "$as_me:1853: error: cannot run C compiled programs.
1854 If you meant to cross compile, use \`--host'." >&5
1855 echo "$as_me: error: cannot run C compiled programs.
1856 If you meant to cross compile, use \`--host'." >&2;}
1857    { (exit 1); exit 1; }; }
1858     fi
1859   fi
1860 fi
1861 echo "$as_me:1861: result: yes" >&5
1862 echo "${ECHO_T}yes" >&6
1863
1864 rm -f a.out a.exe "conftest$ac_cv_exeext"
1865 ac_clean_files=$ac_clean_files_save
1866 # Check the compiler produces executables we can run.  If not, either
1867 # the compiler is broken, or we cross compile.
1868 echo "$as_me:1868: checking whether we are cross compiling" >&5
1869 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1870 echo "$as_me:1870: result: $cross_compiling" >&5
1871 echo "${ECHO_T}$cross_compiling" >&6
1872
1873 echo "$as_me:1873: checking for executable suffix" >&5
1874 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1875 if { (eval echo "$as_me:1875: \"$ac_link\"") >&5
1876   (eval $ac_link) 2>&5
1877   ac_status=$?
1878   echo "$as_me:1878: \$? = $ac_status" >&5
1879   (exit "$ac_status"); }; then
1880   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1881 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1882 # work properly (i.e., refer to `conftest.exe'), while it won't with
1883 # `rm'.
1884 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1885   case $ac_file in
1886     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1887     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1888           export ac_cv_exeext
1889           break;;
1890     * ) break;;
1891   esac
1892 done
1893 else
1894   { { echo "$as_me:1894: error: cannot compute EXEEXT: cannot compile and link" >&5
1895 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1896    { (exit 1); exit 1; }; }
1897 fi
1898
1899 rm -f "conftest$ac_cv_exeext"
1900 echo "$as_me:1900: result: $ac_cv_exeext" >&5
1901 echo "${ECHO_T}$ac_cv_exeext" >&6
1902
1903 rm -f "conftest.$ac_ext"
1904 EXEEXT=$ac_cv_exeext
1905 ac_exeext=$EXEEXT
1906 echo "$as_me:1906: checking for object suffix" >&5
1907 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1908 if test "${ac_cv_objext+set}" = set; then
1909   echo $ECHO_N "(cached) $ECHO_C" >&6
1910 else
1911   cat >"conftest.$ac_ext" <<_ACEOF
1912 #line 1912 "configure"
1913 #include "confdefs.h"
1914
1915 int
1916 main (void)
1917 {
1918
1919   ;
1920   return 0;
1921 }
1922 _ACEOF
1923 rm -f conftest.o conftest.obj
1924 if { (eval echo "$as_me:1924: \"$ac_compile\"") >&5
1925   (eval $ac_compile) 2>&5
1926   ac_status=$?
1927   echo "$as_me:1927: \$? = $ac_status" >&5
1928   (exit "$ac_status"); }; then
1929   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1930   case $ac_file in
1931     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1932     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1933        break;;
1934   esac
1935 done
1936 else
1937   echo "$as_me: failed program was:" >&5
1938 cat "conftest.$ac_ext" >&5
1939 { { echo "$as_me:1939: error: cannot compute OBJEXT: cannot compile" >&5
1940 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1941    { (exit 1); exit 1; }; }
1942 fi
1943
1944 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1945 fi
1946 echo "$as_me:1946: result: $ac_cv_objext" >&5
1947 echo "${ECHO_T}$ac_cv_objext" >&6
1948 OBJEXT=$ac_cv_objext
1949 ac_objext=$OBJEXT
1950 echo "$as_me:1950: checking whether we are using the GNU C compiler" >&5
1951 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1952 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1953   echo $ECHO_N "(cached) $ECHO_C" >&6
1954 else
1955   cat >"conftest.$ac_ext" <<_ACEOF
1956 #line 1956 "configure"
1957 #include "confdefs.h"
1958
1959 int
1960 main (void)
1961 {
1962 #ifndef __GNUC__
1963        choke me
1964 #endif
1965
1966   ;
1967   return 0;
1968 }
1969 _ACEOF
1970 rm -f "conftest.$ac_objext"
1971 if { (eval echo "$as_me:1971: \"$ac_compile\"") >&5
1972   (eval $ac_compile) 2>&5
1973   ac_status=$?
1974   echo "$as_me:1974: \$? = $ac_status" >&5
1975   (exit "$ac_status"); } &&
1976          { ac_try='test -s "conftest.$ac_objext"'
1977   { (eval echo "$as_me:1977: \"$ac_try\"") >&5
1978   (eval $ac_try) 2>&5
1979   ac_status=$?
1980   echo "$as_me:1980: \$? = $ac_status" >&5
1981   (exit "$ac_status"); }; }; then
1982   ac_compiler_gnu=yes
1983 else
1984   echo "$as_me: failed program was:" >&5
1985 cat "conftest.$ac_ext" >&5
1986 ac_compiler_gnu=no
1987 fi
1988 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1989 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1990
1991 fi
1992 echo "$as_me:1992: result: $ac_cv_c_compiler_gnu" >&5
1993 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1994 GCC=`test $ac_compiler_gnu = yes && echo yes`
1995 ac_test_CFLAGS=${CFLAGS+set}
1996 ac_save_CFLAGS=$CFLAGS
1997 CFLAGS="-g"
1998 echo "$as_me:1998: checking whether $CC accepts -g" >&5
1999 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
2000 if test "${ac_cv_prog_cc_g+set}" = set; then
2001   echo $ECHO_N "(cached) $ECHO_C" >&6
2002 else
2003   cat >"conftest.$ac_ext" <<_ACEOF
2004 #line 2004 "configure"
2005 #include "confdefs.h"
2006
2007 int
2008 main (void)
2009 {
2010
2011   ;
2012   return 0;
2013 }
2014 _ACEOF
2015 rm -f "conftest.$ac_objext"
2016 if { (eval echo "$as_me:2016: \"$ac_compile\"") >&5
2017   (eval $ac_compile) 2>&5
2018   ac_status=$?
2019   echo "$as_me:2019: \$? = $ac_status" >&5
2020   (exit "$ac_status"); } &&
2021          { ac_try='test -s "conftest.$ac_objext"'
2022   { (eval echo "$as_me:2022: \"$ac_try\"") >&5
2023   (eval $ac_try) 2>&5
2024   ac_status=$?
2025   echo "$as_me:2025: \$? = $ac_status" >&5
2026   (exit "$ac_status"); }; }; then
2027   ac_cv_prog_cc_g=yes
2028 else
2029   echo "$as_me: failed program was:" >&5
2030 cat "conftest.$ac_ext" >&5
2031 ac_cv_prog_cc_g=no
2032 fi
2033 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2034 fi
2035 echo "$as_me:2035: result: $ac_cv_prog_cc_g" >&5
2036 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
2037 if test "$ac_test_CFLAGS" = set; then
2038   CFLAGS=$ac_save_CFLAGS
2039 elif test $ac_cv_prog_cc_g = yes; then
2040   if test "$GCC" = yes; then
2041     CFLAGS="-g -O2"
2042   else
2043     CFLAGS="-g"
2044   fi
2045 else
2046   if test "$GCC" = yes; then
2047     CFLAGS="-O2"
2048   else
2049     CFLAGS=
2050   fi
2051 fi
2052 # Some people use a C++ compiler to compile C.  Since we use `exit',
2053 # in C++ we need to declare it.  In case someone uses the same compiler
2054 # for both compiling C and C++ we need to have the C++ compiler decide
2055 # the declaration of exit, since it's the most demanding environment.
2056 cat >"conftest.$ac_ext" <<_ACEOF
2057 #ifndef __cplusplus
2058   choke me
2059 #endif
2060 _ACEOF
2061 rm -f "conftest.$ac_objext"
2062 if { (eval echo "$as_me:2062: \"$ac_compile\"") >&5
2063   (eval $ac_compile) 2>&5
2064   ac_status=$?
2065   echo "$as_me:2065: \$? = $ac_status" >&5
2066   (exit "$ac_status"); } &&
2067          { ac_try='test -s "conftest.$ac_objext"'
2068   { (eval echo "$as_me:2068: \"$ac_try\"") >&5
2069   (eval $ac_try) 2>&5
2070   ac_status=$?
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit "$ac_status"); }; }; then
2073   for ac_declaration in \
2074    ''\
2075    '#include <stdlib.h>' \
2076    'extern "C" void std::exit (int) throw (); using std::exit;' \
2077    'extern "C" void std::exit (int); using std::exit;' \
2078    'extern "C" void exit (int) throw ();' \
2079    'extern "C" void exit (int);' \
2080    'void exit (int);'
2081 do
2082   cat >"conftest.$ac_ext" <<_ACEOF
2083 #line 2083 "configure"
2084 #include "confdefs.h"
2085 #include <stdlib.h>
2086 $ac_declaration
2087 int
2088 main (void)
2089 {
2090 exit (42);
2091   ;
2092   return 0;
2093 }
2094 _ACEOF
2095 rm -f "conftest.$ac_objext"
2096 if { (eval echo "$as_me:2096: \"$ac_compile\"") >&5
2097   (eval $ac_compile) 2>&5
2098   ac_status=$?
2099   echo "$as_me:2099: \$? = $ac_status" >&5
2100   (exit "$ac_status"); } &&
2101          { ac_try='test -s "conftest.$ac_objext"'
2102   { (eval echo "$as_me:2102: \"$ac_try\"") >&5
2103   (eval $ac_try) 2>&5
2104   ac_status=$?
2105   echo "$as_me:2105: \$? = $ac_status" >&5
2106   (exit "$ac_status"); }; }; then
2107   :
2108 else
2109   echo "$as_me: failed program was:" >&5
2110 cat "conftest.$ac_ext" >&5
2111 continue
2112 fi
2113 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2114   cat >"conftest.$ac_ext" <<_ACEOF
2115 #line 2115 "configure"
2116 #include "confdefs.h"
2117 $ac_declaration
2118 int
2119 main (void)
2120 {
2121 exit (42);
2122   ;
2123   return 0;
2124 }
2125 _ACEOF
2126 rm -f "conftest.$ac_objext"
2127 if { (eval echo "$as_me:2127: \"$ac_compile\"") >&5
2128   (eval $ac_compile) 2>&5
2129   ac_status=$?
2130   echo "$as_me:2130: \$? = $ac_status" >&5
2131   (exit "$ac_status"); } &&
2132          { ac_try='test -s "conftest.$ac_objext"'
2133   { (eval echo "$as_me:2133: \"$ac_try\"") >&5
2134   (eval $ac_try) 2>&5
2135   ac_status=$?
2136   echo "$as_me:2136: \$? = $ac_status" >&5
2137   (exit "$ac_status"); }; }; then
2138   break
2139 else
2140   echo "$as_me: failed program was:" >&5
2141 cat "conftest.$ac_ext" >&5
2142 fi
2143 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2144 done
2145 rm -rf conftest*
2146 if test -n "$ac_declaration"; then
2147   echo '#ifdef __cplusplus' >>confdefs.h
2148   echo "$ac_declaration"    >>confdefs.h
2149   echo '#endif'             >>confdefs.h
2150 fi
2151
2152 else
2153   echo "$as_me: failed program was:" >&5
2154 cat "conftest.$ac_ext" >&5
2155 fi
2156 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2157 ac_ext=c
2158 ac_cpp='$CPP $CPPFLAGS'
2159 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2160 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2161 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2162 ac_main_return="return"
2163
2164 GCC_VERSION=none
2165 if test "$GCC" = yes ; then
2166         echo "$as_me:2166: checking version of $CC" >&5
2167 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2168         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[^(]*([^)][^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
2169         test -z "$GCC_VERSION" && GCC_VERSION=unknown
2170         echo "$as_me:2170: result: $GCC_VERSION" >&5
2171 echo "${ECHO_T}$GCC_VERSION" >&6
2172 fi
2173
2174 INTEL_COMPILER=no
2175
2176 if test "$GCC" = yes ; then
2177         case "$host_os" in
2178         (linux*|gnu*)
2179                 echo "$as_me:2179: checking if this is really Intel C compiler" >&5
2180 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
2181                 cf_save_CFLAGS="$CFLAGS"
2182                 CFLAGS="$CFLAGS -no-gcc"
2183                 cat >"conftest.$ac_ext" <<_ACEOF
2184 #line 2184 "configure"
2185 #include "confdefs.h"
2186
2187 int
2188 main (void)
2189 {
2190
2191 #ifdef __INTEL_COMPILER
2192 #else
2193 #error __INTEL_COMPILER is not defined
2194 #endif
2195
2196   ;
2197   return 0;
2198 }
2199 _ACEOF
2200 rm -f "conftest.$ac_objext"
2201 if { (eval echo "$as_me:2201: \"$ac_compile\"") >&5
2202   (eval $ac_compile) 2>&5
2203   ac_status=$?
2204   echo "$as_me:2204: \$? = $ac_status" >&5
2205   (exit "$ac_status"); } &&
2206          { ac_try='test -s "conftest.$ac_objext"'
2207   { (eval echo "$as_me:2207: \"$ac_try\"") >&5
2208   (eval $ac_try) 2>&5
2209   ac_status=$?
2210   echo "$as_me:2210: \$? = $ac_status" >&5
2211   (exit "$ac_status"); }; }; then
2212   INTEL_COMPILER=yes
2213 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
2214
2215 else
2216   echo "$as_me: failed program was:" >&5
2217 cat "conftest.$ac_ext" >&5
2218 fi
2219 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2220                 CFLAGS="$cf_save_CFLAGS"
2221                 echo "$as_me:2221: result: $INTEL_COMPILER" >&5
2222 echo "${ECHO_T}$INTEL_COMPILER" >&6
2223                 ;;
2224         esac
2225 fi
2226
2227 CLANG_COMPILER=no
2228
2229 if test "$GCC" = yes ; then
2230         echo "$as_me:2230: checking if this is really Clang C compiler" >&5
2231 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
2232         cf_save_CFLAGS="$CFLAGS"
2233         cat >"conftest.$ac_ext" <<_ACEOF
2234 #line 2234 "configure"
2235 #include "confdefs.h"
2236
2237 int
2238 main (void)
2239 {
2240
2241 #ifdef __clang__
2242 #else
2243 #error __clang__ is not defined
2244 #endif
2245
2246   ;
2247   return 0;
2248 }
2249 _ACEOF
2250 rm -f "conftest.$ac_objext"
2251 if { (eval echo "$as_me:2251: \"$ac_compile\"") >&5
2252   (eval $ac_compile) 2>&5
2253   ac_status=$?
2254   echo "$as_me:2254: \$? = $ac_status" >&5
2255   (exit "$ac_status"); } &&
2256          { ac_try='test -s "conftest.$ac_objext"'
2257   { (eval echo "$as_me:2257: \"$ac_try\"") >&5
2258   (eval $ac_try) 2>&5
2259   ac_status=$?
2260   echo "$as_me:2260: \$? = $ac_status" >&5
2261   (exit "$ac_status"); }; }; then
2262   CLANG_COMPILER=yes
2263
2264 else
2265   echo "$as_me: failed program was:" >&5
2266 cat "conftest.$ac_ext" >&5
2267 fi
2268 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
2269         CFLAGS="$cf_save_CFLAGS"
2270         echo "$as_me:2270: result: $CLANG_COMPILER" >&5
2271 echo "${ECHO_T}$CLANG_COMPILER" >&6
2272 fi
2273
2274 CLANG_VERSION=none
2275
2276 if test "x$CLANG_COMPILER" = "xyes" ; then
2277         case "$CC" in
2278         (c[1-9][0-9]|*/c[1-9][0-9])
2279                 { echo "$as_me:2279: WARNING: replacing broken compiler alias $CC" >&5
2280 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
2281                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
2282                 CC=clang
2283                 ;;
2284         esac
2285
2286         echo "$as_me:2286: checking version of $CC" >&5
2287 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
2288         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.].*//'`"
2289         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
2290         echo "$as_me:2290: result: $CLANG_VERSION" >&5
2291 echo "${ECHO_T}$CLANG_VERSION" >&6
2292
2293         for cf_clang_opt in \
2294                 -Qunused-arguments \
2295                 -Wno-error=implicit-function-declaration
2296         do
2297                 echo "$as_me:2297: checking if option $cf_clang_opt works" >&5
2298 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
2299                 cf_save_CFLAGS="$CFLAGS"
2300                 CFLAGS="$CFLAGS $cf_clang_opt"
2301                 cat >"conftest.$ac_ext" <<_ACEOF
2302 #line 2302 "configure"
2303 #include "confdefs.h"
2304
2305                         #include <stdio.h>
2306 int
2307 main (void)
2308 {
2309
2310                         printf("hello!\\n");
2311   ;
2312   return 0;
2313 }
2314 _ACEOF
2315 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2316 if { (eval echo "$as_me:2316: \"$ac_link\"") >&5
2317   (eval $ac_link) 2>&5
2318   ac_status=$?
2319   echo "$as_me:2319: \$? = $ac_status" >&5
2320   (exit "$ac_status"); } &&
2321          { ac_try='test -s "conftest$ac_exeext"'
2322   { (eval echo "$as_me:2322: \"$ac_try\"") >&5
2323   (eval $ac_try) 2>&5
2324   ac_status=$?
2325   echo "$as_me:2325: \$? = $ac_status" >&5
2326   (exit "$ac_status"); }; }; then
2327
2328                         cf_clang_optok=yes
2329 else
2330   echo "$as_me: failed program was:" >&5
2331 cat "conftest.$ac_ext" >&5
2332
2333                         cf_clang_optok=no
2334 fi
2335 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2336                 echo "$as_me:2336: result: $cf_clang_optok" >&5
2337 echo "${ECHO_T}$cf_clang_optok" >&6
2338                 CFLAGS="$cf_save_CFLAGS"
2339                 if test "$cf_clang_optok" = yes; then
2340                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2341
2342 echo "${as_me:-configure}:2342: testing adding option $cf_clang_opt ..." 1>&5
2343
2344         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2345         CFLAGS="${CFLAGS}$cf_clang_opt"
2346
2347                 fi
2348         done
2349 fi
2350
2351 echo "$as_me:2351: checking for $CC option to accept ANSI C" >&5
2352 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2353 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2354   echo $ECHO_N "(cached) $ECHO_C" >&6
2355 else
2356   ac_cv_prog_cc_stdc=no
2357 ac_save_CC=$CC
2358 cat >"conftest.$ac_ext" <<_ACEOF
2359 #line 2359 "configure"
2360 #include "confdefs.h"
2361 #include <stdarg.h>
2362 #include <stdio.h>
2363 #include <sys/types.h>
2364 #include <sys/stat.h>
2365 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2366 struct buf { int x; };
2367 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2368 static char *e (char **p, int i)
2369 {
2370   return p[i];
2371 }
2372 static char *f (char * (*g) (char **, int), char **p, ...)
2373 {
2374   char *s;
2375   va_list v;
2376   va_start (v,p);
2377   s = g (p, va_arg (v,int));
2378   va_end (v);
2379   return s;
2380 }
2381 int test (int i, double x);
2382 struct s1 {int (*f) (int a);};
2383 struct s2 {int (*f) (double a);};
2384 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2385 int argc;
2386 char **argv;
2387 int
2388 main (void)
2389 {
2390 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2391   ;
2392   return 0;
2393 }
2394 _ACEOF
2395 # Don't try gcc -ansi; that turns off useful extensions and
2396 # breaks some systems' header files.
2397 # AIX                   -qlanglvl=ansi
2398 # Ultrix and OSF/1      -std1
2399 # HP-UX 10.20 and later -Ae
2400 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2401 # SVR4                  -Xc -D__EXTENSIONS__
2402 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2403 do
2404   CC="$ac_save_CC $ac_arg"
2405   rm -f "conftest.$ac_objext"
2406 if { (eval echo "$as_me:2406: \"$ac_compile\"") >&5
2407   (eval $ac_compile) 2>&5
2408   ac_status=$?
2409   echo "$as_me:2409: \$? = $ac_status" >&5
2410   (exit "$ac_status"); } &&
2411          { ac_try='test -s "conftest.$ac_objext"'
2412   { (eval echo "$as_me:2412: \"$ac_try\"") >&5
2413   (eval $ac_try) 2>&5
2414   ac_status=$?
2415   echo "$as_me:2415: \$? = $ac_status" >&5
2416   (exit "$ac_status"); }; }; then
2417   ac_cv_prog_cc_stdc=$ac_arg
2418 break
2419 else
2420   echo "$as_me: failed program was:" >&5
2421 cat "conftest.$ac_ext" >&5
2422 fi
2423 rm -f "conftest.$ac_objext"
2424 done
2425 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2426 CC=$ac_save_CC
2427
2428 fi
2429
2430 case "x$ac_cv_prog_cc_stdc" in
2431   x|xno)
2432     echo "$as_me:2432: result: none needed" >&5
2433 echo "${ECHO_T}none needed" >&6 ;;
2434   *)
2435     echo "$as_me:2435: result: $ac_cv_prog_cc_stdc" >&5
2436 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2437     CC="$CC $ac_cv_prog_cc_stdc" ;;
2438 esac
2439
2440 # This should have been defined by AC_PROG_CC
2441 : "${CC:=cc}"
2442
2443 echo "$as_me:2443: checking \$CFLAGS variable" >&5
2444 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2445 case "x$CFLAGS" in
2446 (*-[IUD]*)
2447         echo "$as_me:2447: result: broken" >&5
2448 echo "${ECHO_T}broken" >&6
2449         { echo "$as_me:2449: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2450 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2451         cf_flags="$CFLAGS"
2452         CFLAGS=
2453         for cf_arg in $cf_flags
2454         do
2455
2456 cf_fix_cppflags=no
2457 cf_new_cflags=
2458 cf_new_cppflags=
2459 cf_new_extra_cppflags=
2460
2461 for cf_add_cflags in $cf_arg
2462 do
2463 case "$cf_fix_cppflags" in
2464 (no)
2465         case "$cf_add_cflags" in
2466         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2467                 case "$cf_add_cflags" in
2468                 (-D*)
2469                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2470
2471                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2472                                 && test -z "${cf_tst_cflags}" \
2473                                 && cf_fix_cppflags=yes
2474
2475                         if test "$cf_fix_cppflags" = yes ; then
2476
2477         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2478         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2479
2480                                 continue
2481                         elif test "${cf_tst_cflags}" = "\"'" ; then
2482
2483         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2484         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2485
2486                                 continue
2487                         fi
2488                         ;;
2489                 esac
2490                 case "$CPPFLAGS" in
2491                 (*$cf_add_cflags)
2492                         ;;
2493                 (*)
2494                         case "$cf_add_cflags" in
2495                         (-D*)
2496                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2497
2498 CPPFLAGS=`echo "$CPPFLAGS" | \
2499         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2500                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2501
2502                                 ;;
2503                         esac
2504
2505         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2506         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2507
2508                         ;;
2509                 esac
2510                 ;;
2511         (*)
2512
2513         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2514         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2515
2516                 ;;
2517         esac
2518         ;;
2519 (yes)
2520
2521         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2522         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2523
2524         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2525
2526         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2527                 && test -z "${cf_tst_cflags}" \
2528                 && cf_fix_cppflags=no
2529         ;;
2530 esac
2531 done
2532
2533 if test -n "$cf_new_cflags" ; then
2534
2535         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2536         CFLAGS="${CFLAGS}$cf_new_cflags"
2537
2538 fi
2539
2540 if test -n "$cf_new_cppflags" ; then
2541
2542         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2543         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2544
2545 fi
2546
2547 if test -n "$cf_new_extra_cppflags" ; then
2548
2549         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2550         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2551
2552 fi
2553
2554         done
2555         ;;
2556 (*)
2557         echo "$as_me:2557: result: ok" >&5
2558 echo "${ECHO_T}ok" >&6
2559         ;;
2560 esac
2561
2562 echo "$as_me:2562: checking \$CC variable" >&5
2563 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2564 case "$CC" in
2565 (*[\ \  ]-*)
2566         echo "$as_me:2566: result: broken" >&5
2567 echo "${ECHO_T}broken" >&6
2568         { echo "$as_me:2568: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2569 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2570         # humor him...
2571         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2572         cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"`
2573         CC="$cf_prog"
2574         for cf_arg in $cf_flags
2575         do
2576                 case "x$cf_arg" in
2577                 (x-[IUDfgOW]*)
2578
2579 cf_fix_cppflags=no
2580 cf_new_cflags=
2581 cf_new_cppflags=
2582 cf_new_extra_cppflags=
2583
2584 for cf_add_cflags in $cf_arg
2585 do
2586 case "$cf_fix_cppflags" in
2587 (no)
2588         case "$cf_add_cflags" in
2589         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2590                 case "$cf_add_cflags" in
2591                 (-D*)
2592                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2593
2594                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2595                                 && test -z "${cf_tst_cflags}" \
2596                                 && cf_fix_cppflags=yes
2597
2598                         if test "$cf_fix_cppflags" = yes ; then
2599
2600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2602
2603                                 continue
2604                         elif test "${cf_tst_cflags}" = "\"'" ; then
2605
2606         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2607         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2608
2609                                 continue
2610                         fi
2611                         ;;
2612                 esac
2613                 case "$CPPFLAGS" in
2614                 (*$cf_add_cflags)
2615                         ;;
2616                 (*)
2617                         case "$cf_add_cflags" in
2618                         (-D*)
2619                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2620
2621 CPPFLAGS=`echo "$CPPFLAGS" | \
2622         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2623                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2624
2625                                 ;;
2626                         esac
2627
2628         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2629         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2630
2631                         ;;
2632                 esac
2633                 ;;
2634         (*)
2635
2636         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2637         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2638
2639                 ;;
2640         esac
2641         ;;
2642 (yes)
2643
2644         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2645         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2646
2647         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2648
2649         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2650                 && test -z "${cf_tst_cflags}" \
2651                 && cf_fix_cppflags=no
2652         ;;
2653 esac
2654 done
2655
2656 if test -n "$cf_new_cflags" ; then
2657
2658         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2659         CFLAGS="${CFLAGS}$cf_new_cflags"
2660
2661 fi
2662
2663 if test -n "$cf_new_cppflags" ; then
2664
2665         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2666         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2667
2668 fi
2669
2670 if test -n "$cf_new_extra_cppflags" ; then
2671
2672         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2673         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2674
2675 fi
2676
2677                         ;;
2678                 (*)
2679                         CC="$CC $cf_arg"
2680                         ;;
2681                 esac
2682         done
2683         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2684
2685 echo "${as_me:-configure}:2685: testing resulting CC: '$CC' ..." 1>&5
2686
2687         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2688
2689 echo "${as_me:-configure}:2689: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2690
2691         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2692
2693 echo "${as_me:-configure}:2693: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2694
2695         ;;
2696 (*)
2697         echo "$as_me:2697: result: ok" >&5
2698 echo "${ECHO_T}ok" >&6
2699         ;;
2700 esac
2701
2702         ;;
2703 esac
2704
2705 echo "$as_me:2705: checking for egrep" >&5
2706 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2707 if test "${ac_cv_path_EGREP+set}" = set; then
2708   echo $ECHO_N "(cached) $ECHO_C" >&6
2709 else
2710   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2711    then ac_cv_path_EGREP="$GREP -E"
2712    else
2713      for ac_prog in gegrep egrep
2714 do
2715   # Extract the first word of "$ac_prog", so it can be a program name with args.
2716 set dummy $ac_prog; ac_word=$2
2717 echo "$as_me:2717: checking for $ac_word" >&5
2718 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2719 if test "${ac_cv_path_EGREP+set}" = set; then
2720   echo $ECHO_N "(cached) $ECHO_C" >&6
2721 else
2722   case $EGREP in
2723   [\\/]* | ?:[\\/]*)
2724   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2725   ;;
2726   *)
2727   ac_save_IFS=$IFS; IFS=$ac_path_separator
2728 ac_dummy="$PATH"
2729 for ac_dir in $ac_dummy; do
2730   IFS=$ac_save_IFS
2731   test -z "$ac_dir" && ac_dir=.
2732   if $as_executable_p "$ac_dir/$ac_word"; then
2733    ac_cv_path_EGREP="$ac_dir/$ac_word"
2734    echo "$as_me:2734: found $ac_dir/$ac_word" >&5
2735    break
2736 fi
2737 done
2738
2739   ;;
2740 esac
2741 fi
2742 EGREP=$ac_cv_path_EGREP
2743
2744 if test -n "$EGREP"; then
2745   echo "$as_me:2745: result: $EGREP" >&5
2746 echo "${ECHO_T}$EGREP" >&6
2747 else
2748   echo "$as_me:2748: result: no" >&5
2749 echo "${ECHO_T}no" >&6
2750 fi
2751
2752   test -n "$EGREP" && break
2753 done
2754 test -n "$EGREP" || EGREP=": "
2755
2756      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2756: error: cannot find workable egrep" >&5
2757 echo "$as_me: error: cannot find workable egrep" >&2;}
2758    { (exit 1); exit 1; }; }
2759    fi
2760 fi
2761 echo "$as_me:2761: result: $ac_cv_path_EGREP" >&5
2762 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2763  EGREP="$ac_cv_path_EGREP"
2764
2765 ac_ext=c
2766 ac_cpp='$CPP $CPPFLAGS'
2767 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2768 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2769 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2770 ac_main_return="return"
2771 echo "$as_me:2771: checking how to run the C preprocessor" >&5
2772 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2773 # On Suns, sometimes $CPP names a directory.
2774 if test -n "$CPP" && test -d "$CPP"; then
2775   CPP=
2776 fi
2777 if test -z "$CPP"; then
2778   if test "${ac_cv_prog_CPP+set}" = set; then
2779   echo $ECHO_N "(cached) $ECHO_C" >&6
2780 else
2781       # Double quotes because CPP needs to be expanded
2782     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2783     do
2784       ac_preproc_ok=false
2785 for ac_c_preproc_warn_flag in '' yes
2786 do
2787   # Use a header file that comes with gcc, so configuring glibc
2788   # with a fresh cross-compiler works.
2789   # On the NeXT, cc -E runs the code through the compiler's parser,
2790   # not just through cpp. "Syntax error" is here to catch this case.
2791   cat >"conftest.$ac_ext" <<_ACEOF
2792 #line 2792 "configure"
2793 #include "confdefs.h"
2794 #include <assert.h>
2795                      Syntax error
2796 _ACEOF
2797 if { (eval echo "$as_me:2797: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2798   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2799   ac_status=$?
2800   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2801   rm -f conftest.er1
2802   cat conftest.err >&5
2803   echo "$as_me:2803: \$? = $ac_status" >&5
2804   (exit "$ac_status"); } >/dev/null; then
2805   if test -s conftest.err; then
2806     ac_cpp_err=$ac_c_preproc_warn_flag
2807   else
2808     ac_cpp_err=
2809   fi
2810 else
2811   ac_cpp_err=yes
2812 fi
2813 if test -z "$ac_cpp_err"; then
2814   :
2815 else
2816   echo "$as_me: failed program was:" >&5
2817   cat "conftest.$ac_ext" >&5
2818   # Broken: fails on valid input.
2819 continue
2820 fi
2821 rm -f conftest.err "conftest.$ac_ext"
2822
2823   # OK, works on sane cases.  Now check whether non-existent headers
2824   # can be detected and how.
2825   cat >"conftest.$ac_ext" <<_ACEOF
2826 #line 2826 "configure"
2827 #include "confdefs.h"
2828 #include <ac_nonexistent.h>
2829 _ACEOF
2830 if { (eval echo "$as_me:2830: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2831   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2832   ac_status=$?
2833   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2834   rm -f conftest.er1
2835   cat conftest.err >&5
2836   echo "$as_me:2836: \$? = $ac_status" >&5
2837   (exit "$ac_status"); } >/dev/null; then
2838   if test -s conftest.err; then
2839     ac_cpp_err=$ac_c_preproc_warn_flag
2840   else
2841     ac_cpp_err=
2842   fi
2843 else
2844   ac_cpp_err=yes
2845 fi
2846 if test -z "$ac_cpp_err"; then
2847   # Broken: success on invalid input.
2848 continue
2849 else
2850   echo "$as_me: failed program was:" >&5
2851   cat "conftest.$ac_ext" >&5
2852   # Passes both tests.
2853 ac_preproc_ok=:
2854 break
2855 fi
2856 rm -f conftest.err "conftest.$ac_ext"
2857
2858 done
2859 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2860 rm -f conftest.err "conftest.$ac_ext"
2861 if $ac_preproc_ok; then
2862   break
2863 fi
2864
2865     done
2866     ac_cv_prog_CPP=$CPP
2867
2868 fi
2869   CPP=$ac_cv_prog_CPP
2870 else
2871   ac_cv_prog_CPP=$CPP
2872 fi
2873 echo "$as_me:2873: result: $CPP" >&5
2874 echo "${ECHO_T}$CPP" >&6
2875 ac_preproc_ok=false
2876 for ac_c_preproc_warn_flag in '' yes
2877 do
2878   # Use a header file that comes with gcc, so configuring glibc
2879   # with a fresh cross-compiler works.
2880   # On the NeXT, cc -E runs the code through the compiler's parser,
2881   # not just through cpp. "Syntax error" is here to catch this case.
2882   cat >"conftest.$ac_ext" <<_ACEOF
2883 #line 2883 "configure"
2884 #include "confdefs.h"
2885 #include <assert.h>
2886                      Syntax error
2887 _ACEOF
2888 if { (eval echo "$as_me:2888: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2889   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2890   ac_status=$?
2891   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2892   rm -f conftest.er1
2893   cat conftest.err >&5
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit "$ac_status"); } >/dev/null; then
2896   if test -s conftest.err; then
2897     ac_cpp_err=$ac_c_preproc_warn_flag
2898   else
2899     ac_cpp_err=
2900   fi
2901 else
2902   ac_cpp_err=yes
2903 fi
2904 if test -z "$ac_cpp_err"; then
2905   :
2906 else
2907   echo "$as_me: failed program was:" >&5
2908   cat "conftest.$ac_ext" >&5
2909   # Broken: fails on valid input.
2910 continue
2911 fi
2912 rm -f conftest.err "conftest.$ac_ext"
2913
2914   # OK, works on sane cases.  Now check whether non-existent headers
2915   # can be detected and how.
2916   cat >"conftest.$ac_ext" <<_ACEOF
2917 #line 2917 "configure"
2918 #include "confdefs.h"
2919 #include <ac_nonexistent.h>
2920 _ACEOF
2921 if { (eval echo "$as_me:2921: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2922   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2923   ac_status=$?
2924   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2925   rm -f conftest.er1
2926   cat conftest.err >&5
2927   echo "$as_me:2927: \$? = $ac_status" >&5
2928   (exit "$ac_status"); } >/dev/null; then
2929   if test -s conftest.err; then
2930     ac_cpp_err=$ac_c_preproc_warn_flag
2931   else
2932     ac_cpp_err=
2933   fi
2934 else
2935   ac_cpp_err=yes
2936 fi
2937 if test -z "$ac_cpp_err"; then
2938   # Broken: success on invalid input.
2939 continue
2940 else
2941   echo "$as_me: failed program was:" >&5
2942   cat "conftest.$ac_ext" >&5
2943   # Passes both tests.
2944 ac_preproc_ok=:
2945 break
2946 fi
2947 rm -f conftest.err "conftest.$ac_ext"
2948
2949 done
2950 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2951 rm -f conftest.err "conftest.$ac_ext"
2952 if $ac_preproc_ok; then
2953   :
2954 else
2955   { { echo "$as_me:2955: error: C preprocessor \"$CPP\" fails sanity check" >&5
2956 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2957    { (exit 1); exit 1; }; }
2958 fi
2959
2960 ac_ext=c
2961 ac_cpp='$CPP $CPPFLAGS'
2962 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2963 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2964 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2965 ac_main_return="return"
2966
2967 if test $ac_cv_c_compiler_gnu = yes; then
2968     echo "$as_me:2968: checking whether $CC needs -traditional" >&5
2969 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2970 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2971   echo $ECHO_N "(cached) $ECHO_C" >&6
2972 else
2973     ac_pattern="Autoconf.*'x'"
2974   cat >"conftest.$ac_ext" <<_ACEOF
2975 #line 2975 "configure"
2976 #include "confdefs.h"
2977 #include <sgtty.h>
2978 int Autoconf = TIOCGETP;
2979 _ACEOF
2980 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2981   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2982   ac_cv_prog_gcc_traditional=yes
2983 else
2984   ac_cv_prog_gcc_traditional=no
2985 fi
2986 rm -rf conftest*
2987
2988   if test $ac_cv_prog_gcc_traditional = no; then
2989     cat >"conftest.$ac_ext" <<_ACEOF
2990 #line 2990 "configure"
2991 #include "confdefs.h"
2992 #include <termio.h>
2993 int Autoconf = TCGETA;
2994 _ACEOF
2995 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2996   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2997   ac_cv_prog_gcc_traditional=yes
2998 fi
2999 rm -rf conftest*
3000
3001   fi
3002 fi
3003 echo "$as_me:3003: result: $ac_cv_prog_gcc_traditional" >&5
3004 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
3005   if test $ac_cv_prog_gcc_traditional = yes; then
3006     CC="$CC -traditional"
3007   fi
3008 fi
3009
3010 echo "$as_me:3010: checking whether $CC understands -c and -o together" >&5
3011 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
3012 if test "${cf_cv_prog_CC_c_o+set}" = set; then
3013   echo $ECHO_N "(cached) $ECHO_C" >&6
3014 else
3015
3016 cat > conftest.$ac_ext <<CF_EOF
3017 int main(void)
3018 {
3019         ${cf_cv_main_return:-return}(0);
3020 }
3021 CF_EOF
3022 # We do the test twice because some compilers refuse to overwrite an
3023 # existing .o file with -o, though they will create one.
3024 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
3025 if { (eval echo "$as_me:3025: \"$ac_try\"") >&5
3026   (eval $ac_try) 2>&5
3027   ac_status=$?
3028   echo "$as_me:3028: \$? = $ac_status" >&5
3029   (exit "$ac_status"); } &&
3030   test -f conftest2.$ac_objext && { (eval echo "$as_me:3030: \"$ac_try\"") >&5
3031   (eval $ac_try) 2>&5
3032   ac_status=$?
3033   echo "$as_me:3033: \$? = $ac_status" >&5
3034   (exit "$ac_status"); };
3035 then
3036   eval cf_cv_prog_CC_c_o=yes
3037 else
3038   eval cf_cv_prog_CC_c_o=no
3039 fi
3040 rm -rf ./conftest*
3041
3042 fi
3043 if test "$cf_cv_prog_CC_c_o" = yes; then
3044   echo "$as_me:3044: result: yes" >&5
3045 echo "${ECHO_T}yes" >&6
3046 else
3047   echo "$as_me:3047: result: no" >&5
3048 echo "${ECHO_T}no" >&6
3049 fi
3050
3051 test "$program_prefix" != NONE &&
3052   program_transform_name="s,^,$program_prefix,;$program_transform_name"
3053 # Use a double $ so make ignores it.
3054 test "$program_suffix" != NONE &&
3055   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
3056 # Double any \ or $.  echo might interpret backslashes.
3057 # By default was `s,x,x', remove it if useless.
3058 cat <<\_ACEOF >conftest.sed
3059 s/[\\$]/&&/g;s/;s,x,x,$//
3060 _ACEOF
3061 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
3062 rm conftest.sed
3063
3064 for ac_prog in mawk gawk nawk awk
3065 do
3066   # Extract the first word of "$ac_prog", so it can be a program name with args.
3067 set dummy $ac_prog; ac_word=$2
3068 echo "$as_me:3068: checking for $ac_word" >&5
3069 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3070 if test "${ac_cv_prog_AWK+set}" = set; then
3071   echo $ECHO_N "(cached) $ECHO_C" >&6
3072 else
3073   if test -n "$AWK"; then
3074   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3075 else
3076   ac_save_IFS=$IFS; IFS=$ac_path_separator
3077 ac_dummy="$PATH"
3078 for ac_dir in $ac_dummy; do
3079   IFS=$ac_save_IFS
3080   test -z "$ac_dir" && ac_dir=.
3081   $as_executable_p "$ac_dir/$ac_word" || continue
3082 ac_cv_prog_AWK="$ac_prog"
3083 echo "$as_me:3083: found $ac_dir/$ac_word" >&5
3084 break
3085 done
3086
3087 fi
3088 fi
3089 AWK=$ac_cv_prog_AWK
3090 if test -n "$AWK"; then
3091   echo "$as_me:3091: result: $AWK" >&5
3092 echo "${ECHO_T}$AWK" >&6
3093 else
3094   echo "$as_me:3094: result: no" >&5
3095 echo "${ECHO_T}no" >&6
3096 fi
3097
3098   test -n "$AWK" && break
3099 done
3100
3101 test -z "$AWK" && { { echo "$as_me:3101: error: No awk program found" >&5
3102 echo "$as_me: error: No awk program found" >&2;}
3103    { (exit 1); exit 1; }; }
3104
3105 echo "$as_me:3105: checking for egrep" >&5
3106 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
3107 if test "${ac_cv_prog_egrep+set}" = set; then
3108   echo $ECHO_N "(cached) $ECHO_C" >&6
3109 else
3110   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3111                 then ac_cv_prog_egrep='grep -E'
3112                 else ac_cv_prog_egrep='egrep'
3113         fi
3114 fi
3115 echo "$as_me:3115: result: $ac_cv_prog_egrep" >&5
3116 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
3117         EGREP=$ac_cv_prog_egrep
3118
3119         test -z "$EGREP" && { { echo "$as_me:3119: error: No egrep program found" >&5
3120 echo "$as_me: error: No egrep program found" >&2;}
3121    { (exit 1); exit 1; }; }
3122
3123 # Find a good install program.  We prefer a C program (faster),
3124 # so one script is as good as another.  But avoid the broken or
3125 # incompatible versions:
3126 # SysV /etc/install, /usr/sbin/install
3127 # SunOS /usr/etc/install
3128 # IRIX /sbin/install
3129 # AIX /bin/install
3130 # AmigaOS /C/install, which installs bootblocks on floppy discs
3131 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3132 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3133 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3134 # ./install, which can be erroneously created by make from ./install.sh.
3135 echo "$as_me:3135: checking for a BSD compatible install" >&5
3136 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
3137 if test -z "$INSTALL"; then
3138 if test "${ac_cv_path_install+set}" = set; then
3139   echo $ECHO_N "(cached) $ECHO_C" >&6
3140 else
3141     ac_save_IFS=$IFS; IFS=$ac_path_separator
3142   for ac_dir in $PATH; do
3143     IFS=$ac_save_IFS
3144     # Account for people who put trailing slashes in PATH elements.
3145     case $ac_dir/ in
3146     / | ./ | .// | /cC/* \
3147     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
3148     | /usr/ucb/* ) ;;
3149     *)
3150       # OSF1 and SCO ODT 3.0 have their own names for install.
3151       # Don't use installbsd from OSF since it installs stuff as root
3152       # by default.
3153       for ac_prog in ginstall scoinst install; do
3154         if $as_executable_p "$ac_dir/$ac_prog"; then
3155           if test $ac_prog = install &&
3156             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3157             # AIX install.  It has an incompatible calling convention.
3158             :
3159           elif test $ac_prog = install &&
3160             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3161             # program-specific install script used by HP pwplus--don't use.
3162             :
3163           else
3164             ac_cv_path_install="$ac_dir/$ac_prog -c"
3165             break 2
3166           fi
3167         fi
3168       done
3169       ;;
3170     esac
3171   done
3172
3173 fi
3174   if test "${ac_cv_path_install+set}" = set; then
3175     INSTALL=$ac_cv_path_install
3176   else
3177     # As a last resort, use the slow shell script.  We don't cache a
3178     # path for INSTALL within a source directory, because that will
3179     # break other packages using the cache if that directory is
3180     # removed, or if the path is relative.
3181     INSTALL=$ac_install_sh
3182   fi
3183 fi
3184 echo "$as_me:3184: result: $INSTALL" >&5
3185 echo "${ECHO_T}$INSTALL" >&6
3186
3187 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3188 # It thinks the first close brace ends the variable substitution.
3189 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3190
3191 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3192
3193 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3194
3195 echo "$as_me:3195: checking whether ln -s works" >&5
3196 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
3197 LN_S=$as_ln_s
3198 if test "$LN_S" = "ln -s"; then
3199   echo "$as_me:3199: result: yes" >&5
3200 echo "${ECHO_T}yes" >&6
3201 else
3202   echo "$as_me:3202: result: no, using $LN_S" >&5
3203 echo "${ECHO_T}no, using $LN_S" >&6
3204 fi
3205
3206 echo "$as_me:3206: checking if $LN_S -f options work" >&5
3207 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
3208
3209 rm -f conf$$.src conf$$dst
3210 echo >conf$$.dst
3211 echo first >conf$$.src
3212 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
3213         cf_prog_ln_sf=yes
3214 else
3215         cf_prog_ln_sf=no
3216 fi
3217 rm -f conf$$.dst conf$$src
3218 echo "$as_me:3218: result: $cf_prog_ln_sf" >&5
3219 echo "${ECHO_T}$cf_prog_ln_sf" >&6
3220
3221 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
3222
3223 # Find a good install program.  We prefer a C program (faster),
3224 # so one script is as good as another.  But avoid the broken or
3225 # incompatible versions:
3226 # SysV /etc/install, /usr/sbin/install
3227 # SunOS /usr/etc/install
3228 # IRIX /sbin/install
3229 # AIX /bin/install
3230 # AmigaOS /C/install, which installs bootblocks on floppy discs
3231 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
3232 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
3233 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3234 # ./install, which can be erroneously created by make from ./install.sh.
3235 echo "$as_me:3235: checking for a BSD compatible install" >&5
3236 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
3237 if test -z "$INSTALL"; then
3238 if test "${ac_cv_path_install+set}" = set; then
3239   echo $ECHO_N "(cached) $ECHO_C" >&6
3240 else
3241     ac_save_IFS=$IFS; IFS=$ac_path_separator
3242   for ac_dir in $PATH; do
3243     IFS=$ac_save_IFS
3244     # Account for people who put trailing slashes in PATH elements.
3245     case $ac_dir/ in
3246     / | ./ | .// | /cC/* \
3247     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
3248     | /usr/ucb/* ) ;;
3249     *)
3250       # OSF1 and SCO ODT 3.0 have their own names for install.
3251       # Don't use installbsd from OSF since it installs stuff as root
3252       # by default.
3253       for ac_prog in ginstall scoinst install; do
3254         if $as_executable_p "$ac_dir/$ac_prog"; then
3255           if test $ac_prog = install &&
3256             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3257             # AIX install.  It has an incompatible calling convention.
3258             :
3259           elif test $ac_prog = install &&
3260             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
3261             # program-specific install script used by HP pwplus--don't use.
3262             :
3263           else
3264             ac_cv_path_install="$ac_dir/$ac_prog -c"
3265             break 2
3266           fi
3267         fi
3268       done
3269       ;;
3270     esac
3271   done
3272
3273 fi
3274   if test "${ac_cv_path_install+set}" = set; then
3275     INSTALL=$ac_cv_path_install
3276   else
3277     # As a last resort, use the slow shell script.  We don't cache a
3278     # path for INSTALL within a source directory, because that will
3279     # break other packages using the cache if that directory is
3280     # removed, or if the path is relative.
3281     INSTALL=$ac_install_sh
3282   fi
3283 fi
3284 echo "$as_me:3284: result: $INSTALL" >&5
3285 echo "${ECHO_T}$INSTALL" >&6
3286
3287 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
3288 # It thinks the first close brace ends the variable substitution.
3289 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
3290
3291 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
3292
3293 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3294
3295 case $INSTALL in
3296 (/*)
3297         ;;
3298 (*)
3299         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
3300         test -z "$cf_dir" && cf_dir=.
3301         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
3302         ;;
3303 esac
3304
3305 echo "$as_me:3305: checking if you want to install stripped executables" >&5
3306 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
3307
3308 # Check whether --enable-stripping or --disable-stripping was given.
3309 if test "${enable_stripping+set}" = set; then
3310   enableval="$enable_stripping"
3311   test "$enableval" != no && enableval=yes
3312         if test "$enableval" != "yes" ; then
3313     enable_stripping=no
3314         else
3315                 enable_stripping=yes
3316         fi
3317 else
3318   enableval=yes
3319         enable_stripping=yes
3320
3321 fi;
3322 echo "$as_me:3322: result: $enable_stripping" >&5
3323 echo "${ECHO_T}$enable_stripping" >&6
3324
3325 if test "$enable_stripping" = yes
3326 then
3327         INSTALL_OPT_S="-s"
3328 else
3329         INSTALL_OPT_S=
3330 fi
3331
3332 : "${INSTALL:=install}"
3333 echo "$as_me:3333: checking if install accepts -p option" >&5
3334 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3335 if test "${cf_cv_install_p+set}" = set; then
3336   echo $ECHO_N "(cached) $ECHO_C" >&6
3337 else
3338
3339         rm -rf ./conftest*
3340         date >conftest.in
3341         mkdir conftest.out
3342         sleep 3
3343         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3344         then
3345                 if test -f conftest.out/conftest.in
3346                 then
3347                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3348                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3349                         if test -s conftest.err
3350                         then
3351                                 cf_cv_install_p=no
3352                         else
3353                                 cf_cv_install_p=yes
3354                         fi
3355                 else
3356                         cf_cv_install_p=no
3357                 fi
3358         else
3359                 cf_cv_install_p=no
3360         fi
3361         rm -rf ./conftest*
3362
3363 fi
3364 echo "$as_me:3364: result: $cf_cv_install_p" >&5
3365 echo "${ECHO_T}$cf_cv_install_p" >&6
3366
3367 echo "$as_me:3367: checking if install needs to be told about ownership" >&5
3368 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3369 case `$ac_config_guess` in
3370 (*minix)
3371         with_install_o=yes
3372         ;;
3373 (*)
3374         with_install_o=no
3375         ;;
3376 esac
3377
3378 echo "$as_me:3378: result: $with_install_o" >&5
3379 echo "${ECHO_T}$with_install_o" >&6
3380 if test "x$with_install_o" = xyes
3381 then
3382         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'`"
3383 else
3384         INSTALL_OPT_O=
3385 fi
3386
3387 if test -n "$INSTALL_OPT_S"
3388 then
3389         echo "$as_me:3389: checking if you want to specify strip-program" >&5
3390 echo $ECHO_N "checking if you want to specify strip-program... $ECHO_C" >&6
3391
3392 # Check whether --with-strip-program or --without-strip-program was given.
3393 if test "${with_strip_program+set}" = set; then
3394   withval="$with_strip_program"
3395   with_strip_program=$withval
3396 else
3397   with_strip_program=no
3398 fi;
3399         echo "$as_me:3399: result: $with_strip_program" >&5
3400 echo "${ECHO_T}$with_strip_program" >&6
3401         if test "$with_strip_program" != no
3402         then
3403                 echo "$as_me:3403: checking if strip-program is supported with this installer" >&5
3404 echo $ECHO_N "checking if strip-program is supported with this installer... $ECHO_C" >&6
3405                 cf_install_program=`echo "$INSTALL" | sed -e 's%[ ]*[ ]-.%%'`
3406                 check_install_strip=no
3407                 if test -f "$cf_install_program"
3408                 then
3409                         check_install_version=`"$cf_install_program" --version 2>/dev/null | head -n 1 | grep coreutils`
3410                         if test -n "$check_install_version"
3411                         then
3412                                 check_install_strip="option"
3413                         else
3414                                 for check_strip_variable in STRIPBIN STRIP
3415                                 do
3416                                         if strings "$cf_install_program" | grep "^$check_strip_variable$" >/dev/null
3417                                         then
3418                                                 check_install_strip="environ"
3419                                                 break
3420                                         fi
3421                                 done
3422                         fi
3423                 fi
3424                 echo "$as_me:3424: result: $check_install_strip" >&5
3425 echo "${ECHO_T}$check_install_strip" >&6
3426                 case "$check_install_strip" in
3427                 (no)
3428                         { echo "$as_me:3428: WARNING: $cf_install_program does not support strip program option" >&5
3429 echo "$as_me: WARNING: $cf_install_program does not support strip program option" >&2;}
3430                         with_strip_program=no
3431                         ;;
3432                 (environ)
3433                         cat >install.tmp <<-CF_EOF
3434                         #! $SHELL
3435                         STRIPBIN="$with_strip_program" \\
3436                         STRIP="$with_strip_program" \\
3437                         $INSTALL "$@"
3438                         CF_EOF
3439                         INSTALL="`pwd`/install.tmp"
3440                         chmod +x "$INSTALL"
3441                         test -n "$verbose" && echo "    created $INSTALL" 1>&6
3442
3443 echo "${as_me:-configure}:3443: testing created $INSTALL ..." 1>&5
3444
3445                         ;;
3446                 (option)
3447                         INSTALL_OPT_S="$INSTALL_OPT_S --strip-program=\"$with_strip_program\""
3448                         ;;
3449                 esac
3450         fi
3451 fi
3452
3453 echo "$as_me:3453: checking for long file names" >&5
3454 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3455 if test "${ac_cv_sys_long_file_names+set}" = set; then
3456   echo $ECHO_N "(cached) $ECHO_C" >&6
3457 else
3458   ac_cv_sys_long_file_names=yes
3459 # Test for long file names in all the places we know might matter:
3460 #      .                the current directory, where building will happen
3461 #      $prefix/lib      where we will be installing things
3462 #      $exec_prefix/lib likewise
3463 # eval it to expand exec_prefix.
3464 #      $TMPDIR          if set, where it might want to write temporary files
3465 # if $TMPDIR is not set:
3466 #      /tmp             where it might want to write temporary files
3467 #      /var/tmp         likewise
3468 #      /usr/tmp         likewise
3469 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3470   ac_tmpdirs=$TMPDIR
3471 else
3472   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3473 fi
3474 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3475   test -d "$ac_dir" || continue
3476   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3477   ac_xdir=$ac_dir/cf$$
3478   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3479   ac_tf1=$ac_xdir/conftest9012345
3480   ac_tf2=$ac_xdir/conftest9012346
3481   (echo 1 >"$ac_tf1") 2>/dev/null
3482   (echo 2 >"$ac_tf2") 2>/dev/null
3483   ac_val=`cat "$ac_tf1" 2>/dev/null`
3484   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3485     ac_cv_sys_long_file_names=no
3486     rm -rf "$ac_xdir" 2>/dev/null
3487     break
3488   fi
3489   rm -rf "$ac_xdir" 2>/dev/null
3490 done
3491 fi
3492 echo "$as_me:3492: result: $ac_cv_sys_long_file_names" >&5
3493 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3494 if test "$ac_cv_sys_long_file_names" = yes; then
3495
3496 cat >>confdefs.h <<\EOF
3497 #define HAVE_LONG_FILE_NAMES 1
3498 EOF
3499
3500 fi
3501
3502 # if we find pkg-config, check if we should install the ".pc" files.
3503
3504 echo "$as_me:3504: checking if you want to use pkg-config" >&5
3505 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3506
3507 # Check whether --with-pkg-config or --without-pkg-config was given.
3508 if test "${with_pkg_config+set}" = set; then
3509   withval="$with_pkg_config"
3510   cf_pkg_config=$withval
3511 else
3512   cf_pkg_config=yes
3513 fi;
3514 echo "$as_me:3514: result: $cf_pkg_config" >&5
3515 echo "${ECHO_T}$cf_pkg_config" >&6
3516
3517 case "$cf_pkg_config" in
3518 (no)
3519         PKG_CONFIG=none
3520         ;;
3521 (yes)
3522
3523 if test -n "$ac_tool_prefix"; then
3524   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3525 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3526 echo "$as_me:3526: checking for $ac_word" >&5
3527 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3528 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3529   echo $ECHO_N "(cached) $ECHO_C" >&6
3530 else
3531   case $PKG_CONFIG in
3532   [\\/]* | ?:[\\/]*)
3533   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3534   ;;
3535   *)
3536   ac_save_IFS=$IFS; IFS=$ac_path_separator
3537 ac_dummy="$PATH"
3538 for ac_dir in $ac_dummy; do
3539   IFS=$ac_save_IFS
3540   test -z "$ac_dir" && ac_dir=.
3541   if $as_executable_p "$ac_dir/$ac_word"; then
3542    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3543    echo "$as_me:3543: found $ac_dir/$ac_word" >&5
3544    break
3545 fi
3546 done
3547
3548   ;;
3549 esac
3550 fi
3551 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3552
3553 if test -n "$PKG_CONFIG"; then
3554   echo "$as_me:3554: result: $PKG_CONFIG" >&5
3555 echo "${ECHO_T}$PKG_CONFIG" >&6
3556 else
3557   echo "$as_me:3557: result: no" >&5
3558 echo "${ECHO_T}no" >&6
3559 fi
3560
3561 fi
3562 if test -z "$ac_cv_path_PKG_CONFIG"; then
3563   ac_pt_PKG_CONFIG=$PKG_CONFIG
3564   # Extract the first word of "pkg-config", so it can be a program name with args.
3565 set dummy pkg-config; 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_path_ac_pt_PKG_CONFIG+set}" = set; then
3569   echo $ECHO_N "(cached) $ECHO_C" >&6
3570 else
3571   case $ac_pt_PKG_CONFIG in
3572   [\\/]* | ?:[\\/]*)
3573   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3574   ;;
3575   *)
3576   ac_save_IFS=$IFS; IFS=$ac_path_separator
3577 ac_dummy="$PATH"
3578 for ac_dir in $ac_dummy; do
3579   IFS=$ac_save_IFS
3580   test -z "$ac_dir" && ac_dir=.
3581   if $as_executable_p "$ac_dir/$ac_word"; then
3582    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3583    echo "$as_me:3583: found $ac_dir/$ac_word" >&5
3584    break
3585 fi
3586 done
3587
3588   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3589   ;;
3590 esac
3591 fi
3592 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3593
3594 if test -n "$ac_pt_PKG_CONFIG"; then
3595   echo "$as_me:3595: result: $ac_pt_PKG_CONFIG" >&5
3596 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3597 else
3598   echo "$as_me:3598: result: no" >&5
3599 echo "${ECHO_T}no" >&6
3600 fi
3601
3602   PKG_CONFIG=$ac_pt_PKG_CONFIG
3603 else
3604   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3605 fi
3606
3607         ;;
3608 (*)
3609         PKG_CONFIG=$withval
3610         ;;
3611 esac
3612
3613 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3614 if test "$PKG_CONFIG" != none ; then
3615
3616 if test "x$prefix" != xNONE; then
3617         cf_path_syntax="$prefix"
3618 else
3619         cf_path_syntax="$ac_default_prefix"
3620 fi
3621
3622 case ".$PKG_CONFIG" in
3623 (.\$\(*\)*|.\'*\'*)
3624         ;;
3625 (..|./*|.\\*)
3626         ;;
3627 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3628         ;;
3629 (.\$\{*prefix\}*|.\$\{*dir\}*)
3630         eval PKG_CONFIG="$PKG_CONFIG"
3631         case ".$PKG_CONFIG" in
3632         (.NONE/*)
3633                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3634                 ;;
3635         esac
3636         ;;
3637 (.no|.NONE/*)
3638         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3639         ;;
3640 (*)
3641         { { echo "$as_me:3641: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3642 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3643    { (exit 1); exit 1; }; }
3644         ;;
3645 esac
3646
3647 elif test "x$cf_pkg_config" != xno ; then
3648         { echo "$as_me:3648: WARNING: pkg-config is not installed" >&5
3649 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3650 fi
3651
3652 case "$PKG_CONFIG" in
3653 (no|none|yes)
3654         echo "$as_me:3654: checking for pkg-config library directory" >&5
3655 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3656         ;;
3657 (*)
3658         echo "$as_me:3658: checking for $PKG_CONFIG library directory" >&5
3659 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3660         ;;
3661 esac
3662
3663 # if $PKG_CONFIG_LIBDIR is set, try to use that
3664 if test -n "$PKG_CONFIG_PATH"; then
3665         cf_search_path=`echo "$PKG_CONFIG_PATH" | sed -e 's/:/ /g' -e 's,^[     ]*,,' -e 's,[   ]*$,,'`
3666 elif test -n "$PKG_CONFIG_LIBDIR"; then
3667         cf_search_path=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/:/ /g' -e 's,^[   ]*,,' -e 's,[   ]*$,,'`
3668 else
3669         cf_search_path=auto
3670 fi
3671
3672 # if the option is used, let that override.  otherwise default to "libdir"
3673
3674 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3675 if test "${with_pkg_config_libdir+set}" = set; then
3676   withval="$with_pkg_config_libdir"
3677   cf_search_path=$withval
3678 else
3679   test "x$PKG_CONFIG" != xnone && test -z "$cf_search_path" && cf_search_path=libdir
3680 fi;
3681
3682 case "x$cf_search_path" in
3683 (xlibdir)
3684         PKG_CONFIG_LIBDIR='${libdir}/pkgconfig'
3685         echo "$as_me:3685: result: $PKG_CONFIG_LIBDIR" >&5
3686 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3687         cf_search_path=
3688         ;;
3689 (x)
3690         ;;
3691 (x/*\ *)
3692         PKG_CONFIG_LIBDIR=
3693         ;;
3694 (x/*)
3695         PKG_CONFIG_LIBDIR="$cf_search_path"
3696         echo "$as_me:3696: result: $PKG_CONFIG_LIBDIR" >&5
3697 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3698         cf_search_path=
3699         ;;
3700 (xyes|xauto)
3701         echo "$as_me:3701: result: auto" >&5
3702 echo "${ECHO_T}auto" >&6
3703         cf_search_path=
3704         # Look for the library directory using the same prefix as the executable
3705         echo "$as_me:3705: checking for search-list" >&5
3706 echo $ECHO_N "checking for search-list... $ECHO_C" >&6
3707         if test "x$PKG_CONFIG" != xnone
3708         then
3709                 # works for pkg-config since version 0.24 (2009)
3710                 # works for pkgconf since version 0.8.3 (2012)
3711                 for cf_pkg_program in \
3712                         `echo "$PKG_CONFIG" | sed -e 's,^.*/,,'` \
3713                         pkg-config \
3714                         pkgconf
3715                 do
3716                         cf_search_path=`"$PKG_CONFIG" --variable=pc_path "$cf_pkg_program" 2>/dev/null | tr : ' '`
3717                         test -n "$cf_search_path" && break
3718                 done
3719
3720                 # works for pkg-config since import in 2005 of original 2001 HP code.
3721                 test -z "$cf_search_path" && \
3722                 cf_search_path=`
3723                 "$PKG_CONFIG" --debug --exists no-such-package 2>&1 | $AWK "\
3724 /^Scanning directory (#[1-9][0-9]* )?'.*'$/{ \
3725         sub(\"^[^']*'\",\"\"); \
3726         sub(\"'.*\",\"\"); \
3727         printf \" %s\", \\$0; } \
3728 { next; } \
3729 "`
3730         fi
3731
3732         echo "$as_me:3732: result: $cf_search_path" >&5
3733 echo "${ECHO_T}$cf_search_path" >&6
3734         ;;
3735 (*)
3736         { { echo "$as_me:3736: error: Unexpected option value: $cf_search_path" >&5
3737 echo "$as_me: error: Unexpected option value: $cf_search_path" >&2;}
3738    { (exit 1); exit 1; }; }
3739         ;;
3740 esac
3741
3742 if test -n "$cf_search_path"
3743 then
3744         echo "$as_me:3744: checking for first directory" >&5
3745 echo $ECHO_N "checking for first directory... $ECHO_C" >&6
3746         cf_pkg_config_path=none
3747         for cf_config in $cf_search_path
3748         do
3749                 if test -d "$cf_config"
3750                 then
3751                         cf_pkg_config_path=$cf_config
3752                         break
3753                 fi
3754         done
3755         echo "$as_me:3755: result: $cf_pkg_config_path" >&5
3756 echo "${ECHO_T}$cf_pkg_config_path" >&6
3757
3758         if test "x$cf_pkg_config_path" != xnone ; then
3759                 # limit this to the first directory found
3760                 PKG_CONFIG_LIBDIR="$cf_pkg_config_path"
3761         fi
3762
3763         if test -z "$PKG_CONFIG_LIBDIR" && test -n "$cf_search_path"
3764         then
3765                 echo "$as_me:3765: checking for workaround" >&5
3766 echo $ECHO_N "checking for workaround... $ECHO_C" >&6
3767                 if test "$prefix" = "NONE" ; then
3768                         cf_prefix="$ac_default_prefix"
3769                 else
3770                         cf_prefix="$prefix"
3771                 fi
3772                 eval cf_libdir=$libdir
3773                 cf_libdir=`echo "$cf_libdir" | sed -e "s,^NONE,$cf_prefix,"`
3774                 cf_backup=
3775                 for cf_config in $cf_search_path
3776                 do
3777                         case $cf_config in
3778                         $cf_libdir/pkgconfig)
3779                                 PKG_CONFIG_LIBDIR=$cf_libdir/pkgconfig
3780                                 break
3781                                 ;;
3782                         *)
3783                                 test -z "$cf_backup" && cf_backup=$cf_config
3784                                 ;;
3785                         esac
3786                 done
3787                 test -z "$PKG_CONFIG_LIBDIR" && PKG_CONFIG_LIBDIR=$cf_backup
3788                 echo "$as_me:3788: result: $PKG_CONFIG_LIBDIR" >&5
3789 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3790         fi
3791 fi
3792
3793 echo "$as_me:3793: checking if you want to build test-programs" >&5
3794 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3795
3796 # Check whether --with-tests or --without-tests was given.
3797 if test "${with_tests+set}" = set; then
3798   withval="$with_tests"
3799   cf_with_tests=$withval
3800 else
3801   cf_with_tests=yes
3802 fi;
3803 echo "$as_me:3803: result: $cf_with_tests" >&5
3804 echo "${ECHO_T}$cf_with_tests" >&6
3805
3806 echo "$as_me:3806: checking if we should assume mixed-case filenames" >&5
3807 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3808
3809 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3810 if test "${enable_mixed_case+set}" = set; then
3811   enableval="$enable_mixed_case"
3812   enable_mixedcase=$enableval
3813 else
3814   enable_mixedcase=auto
3815 fi;
3816 echo "$as_me:3816: result: $enable_mixedcase" >&5
3817 echo "${ECHO_T}$enable_mixedcase" >&6
3818 if test "$enable_mixedcase" = "auto" ; then
3819
3820 echo "$as_me:3820: checking if filesystem supports mixed-case filenames" >&5
3821 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3822 if test "${cf_cv_mixedcase+set}" = set; then
3823   echo $ECHO_N "(cached) $ECHO_C" >&6
3824 else
3825
3826 if test "$cross_compiling" = yes ; then
3827         case "$target_alias" in
3828         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3829                 cf_cv_mixedcase=no
3830                 ;;
3831         (*)
3832                 cf_cv_mixedcase=yes
3833                 ;;
3834         esac
3835 else
3836         rm -f conftest CONFTEST
3837         echo test >conftest
3838         if test -f CONFTEST ; then
3839                 cf_cv_mixedcase=no
3840         else
3841                 cf_cv_mixedcase=yes
3842         fi
3843         rm -f conftest CONFTEST
3844 fi
3845
3846 fi
3847 echo "$as_me:3847: result: $cf_cv_mixedcase" >&5
3848 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3849 test "$cf_cv_mixedcase" = yes &&
3850 cat >>confdefs.h <<\EOF
3851 #define MIXEDCASE_FILENAMES 1
3852 EOF
3853
3854 else
3855         cf_cv_mixedcase=$enable_mixedcase
3856         if test "$enable_mixedcase" = "yes" ; then
3857                 cat >>confdefs.h <<\EOF
3858 #define MIXEDCASE_FILENAMES 1
3859 EOF
3860
3861         fi
3862 fi
3863
3864 # do this after mixed-case option (tags/TAGS is not as important as tic).
3865 echo "$as_me:3865: checking whether ${MAKE-make} sets \${MAKE}" >&5
3866 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3867 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3868 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3869   echo $ECHO_N "(cached) $ECHO_C" >&6
3870 else
3871   cat >conftest.make <<\EOF
3872 all:
3873         @echo 'ac_maketemp="${MAKE}"'
3874 EOF
3875 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3876 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3877 if test -n "$ac_maketemp"; then
3878   eval ac_cv_prog_make_${ac_make}_set=yes
3879 else
3880   eval ac_cv_prog_make_${ac_make}_set=no
3881 fi
3882 rm -f conftest.make
3883 fi
3884 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3885   echo "$as_me:3885: result: yes" >&5
3886 echo "${ECHO_T}yes" >&6
3887   SET_MAKE=
3888 else
3889   echo "$as_me:3889: result: no" >&5
3890 echo "${ECHO_T}no" >&6
3891   SET_MAKE="MAKE=${MAKE-make}"
3892 fi
3893
3894 echo "$as_me:3894: checking for \".PHONY\" make-support" >&5
3895 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3896 if test "${cf_cv_make_PHONY+set}" = set; then
3897   echo $ECHO_N "(cached) $ECHO_C" >&6
3898 else
3899
3900         rm -rf conftest*
3901         (
3902                 mkdir conftest || exit 1
3903                 cd conftest
3904                 cat >makefile <<'CF_EOF'
3905 .PHONY: always
3906 DATA=0
3907 always: always.out
3908         @echo "** making $@ $(DATA)"
3909 once: once.out
3910         @echo "** making $@ $(DATA)"
3911 always.out:
3912         @echo "** making $@ $(DATA)"
3913         echo $(DATA) > $@
3914 once.out:
3915         @echo "** making $@ $(DATA)"
3916         echo $(DATA) > $@
3917 CF_EOF
3918                 for cf_data in 1 2 3
3919                 do
3920                         ${MAKE:-make} always DATA=$cf_data
3921                         ${MAKE:-make} once   DATA=$cf_data
3922                         ${MAKE:-make} -t always once
3923                         if test -f always ; then
3924                                 echo "no (case 1)" > ../conftest.tmp
3925                         elif test ! -f always.out ; then
3926                                 echo "no (case 2)" > ../conftest.tmp
3927                         elif test ! -f once.out ; then
3928                                 echo "no (case 3)" > ../conftest.tmp
3929                         elif ! cmp -s always.out once.out ; then
3930                                 echo "no (case 4)" > ../conftest.tmp
3931                                 diff always.out once.out
3932                         else
3933                                 cf_check="`cat always.out`"
3934                                 if test "x$cf_check" != "x$cf_data" ; then
3935                                         echo "no (case 5)" > ../conftest.tmp
3936                                 else
3937                                         echo yes > ../conftest.tmp
3938                                         rm -f ./*.out
3939                                         continue
3940                                 fi
3941                         fi
3942                         break
3943                 done
3944         ) >&5 2>&1
3945         cf_cv_make_PHONY="`cat conftest.tmp`"
3946         rm -rf conftest*
3947
3948 fi
3949 echo "$as_me:3949: result: $cf_cv_make_PHONY" >&5
3950 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3951 MAKE_NO_PHONY="#"
3952 MAKE_PHONY="#"
3953 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3954 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3955
3956 for ac_prog in exctags ctags
3957 do
3958   # Extract the first word of "$ac_prog", so it can be a program name with args.
3959 set dummy $ac_prog; ac_word=$2
3960 echo "$as_me:3960: checking for $ac_word" >&5
3961 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3962 if test "${ac_cv_prog_CTAGS+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965   if test -n "$CTAGS"; then
3966   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3967 else
3968   ac_save_IFS=$IFS; IFS=$ac_path_separator
3969 ac_dummy="$PATH"
3970 for ac_dir in $ac_dummy; do
3971   IFS=$ac_save_IFS
3972   test -z "$ac_dir" && ac_dir=.
3973   $as_executable_p "$ac_dir/$ac_word" || continue
3974 ac_cv_prog_CTAGS="$ac_prog"
3975 echo "$as_me:3975: found $ac_dir/$ac_word" >&5
3976 break
3977 done
3978
3979 fi
3980 fi
3981 CTAGS=$ac_cv_prog_CTAGS
3982 if test -n "$CTAGS"; then
3983   echo "$as_me:3983: result: $CTAGS" >&5
3984 echo "${ECHO_T}$CTAGS" >&6
3985 else
3986   echo "$as_me:3986: result: no" >&5
3987 echo "${ECHO_T}no" >&6
3988 fi
3989
3990   test -n "$CTAGS" && break
3991 done
3992
3993 for ac_prog in exetags etags
3994 do
3995   # Extract the first word of "$ac_prog", so it can be a program name with args.
3996 set dummy $ac_prog; ac_word=$2
3997 echo "$as_me:3997: checking for $ac_word" >&5
3998 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3999 if test "${ac_cv_prog_ETAGS+set}" = set; then
4000   echo $ECHO_N "(cached) $ECHO_C" >&6
4001 else
4002   if test -n "$ETAGS"; then
4003   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
4004 else
4005   ac_save_IFS=$IFS; IFS=$ac_path_separator
4006 ac_dummy="$PATH"
4007 for ac_dir in $ac_dummy; do
4008   IFS=$ac_save_IFS
4009   test -z "$ac_dir" && ac_dir=.
4010   $as_executable_p "$ac_dir/$ac_word" || continue
4011 ac_cv_prog_ETAGS="$ac_prog"
4012 echo "$as_me:4012: found $ac_dir/$ac_word" >&5
4013 break
4014 done
4015
4016 fi
4017 fi
4018 ETAGS=$ac_cv_prog_ETAGS
4019 if test -n "$ETAGS"; then
4020   echo "$as_me:4020: result: $ETAGS" >&5
4021 echo "${ECHO_T}$ETAGS" >&6
4022 else
4023   echo "$as_me:4023: result: no" >&5
4024 echo "${ECHO_T}no" >&6
4025 fi
4026
4027   test -n "$ETAGS" && break
4028 done
4029
4030 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
4031 set dummy ${CTAGS:-ctags}; ac_word=$2
4032 echo "$as_me:4032: checking for $ac_word" >&5
4033 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4034 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
4035   echo $ECHO_N "(cached) $ECHO_C" >&6
4036 else
4037   if test -n "$MAKE_LOWER_TAGS"; then
4038   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
4039 else
4040   ac_save_IFS=$IFS; IFS=$ac_path_separator
4041 ac_dummy="$PATH"
4042 for ac_dir in $ac_dummy; do
4043   IFS=$ac_save_IFS
4044   test -z "$ac_dir" && ac_dir=.
4045   $as_executable_p "$ac_dir/$ac_word" || continue
4046 ac_cv_prog_MAKE_LOWER_TAGS="yes"
4047 echo "$as_me:4047: found $ac_dir/$ac_word" >&5
4048 break
4049 done
4050
4051   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
4052 fi
4053 fi
4054 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
4055 if test -n "$MAKE_LOWER_TAGS"; then
4056   echo "$as_me:4056: result: $MAKE_LOWER_TAGS" >&5
4057 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
4058 else
4059   echo "$as_me:4059: result: no" >&5
4060 echo "${ECHO_T}no" >&6
4061 fi
4062
4063 if test "$cf_cv_mixedcase" = yes ; then
4064         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
4065 set dummy ${ETAGS:-etags}; ac_word=$2
4066 echo "$as_me:4066: checking for $ac_word" >&5
4067 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4068 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
4069   echo $ECHO_N "(cached) $ECHO_C" >&6
4070 else
4071   if test -n "$MAKE_UPPER_TAGS"; then
4072   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
4073 else
4074   ac_save_IFS=$IFS; IFS=$ac_path_separator
4075 ac_dummy="$PATH"
4076 for ac_dir in $ac_dummy; do
4077   IFS=$ac_save_IFS
4078   test -z "$ac_dir" && ac_dir=.
4079   $as_executable_p "$ac_dir/$ac_word" || continue
4080 ac_cv_prog_MAKE_UPPER_TAGS="yes"
4081 echo "$as_me:4081: found $ac_dir/$ac_word" >&5
4082 break
4083 done
4084
4085   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
4086 fi
4087 fi
4088 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
4089 if test -n "$MAKE_UPPER_TAGS"; then
4090   echo "$as_me:4090: result: $MAKE_UPPER_TAGS" >&5
4091 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
4092 else
4093   echo "$as_me:4093: result: no" >&5
4094 echo "${ECHO_T}no" >&6
4095 fi
4096
4097 else
4098         MAKE_UPPER_TAGS=no
4099 fi
4100
4101 if test "$MAKE_UPPER_TAGS" = yes ; then
4102         MAKE_UPPER_TAGS=
4103 else
4104         MAKE_UPPER_TAGS="#"
4105 fi
4106
4107 if test "$MAKE_LOWER_TAGS" = yes ; then
4108         MAKE_LOWER_TAGS=
4109 else
4110         MAKE_LOWER_TAGS="#"
4111 fi
4112
4113 echo "$as_me:4113: checking for makeflags variable" >&5
4114 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
4115 if test "${cf_cv_makeflags+set}" = set; then
4116   echo $ECHO_N "(cached) $ECHO_C" >&6
4117 else
4118
4119         cf_cv_makeflags=''
4120         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
4121         do
4122                 cat >cf_makeflags.tmp <<CF_EOF
4123 SHELL = $SHELL
4124 all :
4125         @ echo '.$cf_option'
4126 CF_EOF
4127                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
4128                 case "$cf_result" in
4129                 (.*k|.*kw)
4130                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
4131                         case "$cf_result" in
4132                         (.*CC=*)        cf_cv_makeflags=
4133                                 ;;
4134                         (*)     cf_cv_makeflags=$cf_option
4135                                 ;;
4136                         esac
4137                         break
4138                         ;;
4139                 (.-)
4140                         ;;
4141                 (*)
4142
4143 echo "${as_me:-configure}:4143: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
4144
4145                         ;;
4146                 esac
4147         done
4148         rm -f cf_makeflags.tmp
4149
4150 fi
4151 echo "$as_me:4151: result: $cf_cv_makeflags" >&5
4152 echo "${ECHO_T}$cf_cv_makeflags" >&6
4153
4154 if test -n "$ac_tool_prefix"; then
4155   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
4156 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
4157 echo "$as_me:4157: checking for $ac_word" >&5
4158 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4159 if test "${ac_cv_prog_RANLIB+set}" = set; then
4160   echo $ECHO_N "(cached) $ECHO_C" >&6
4161 else
4162   if test -n "$RANLIB"; then
4163   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
4164 else
4165   ac_save_IFS=$IFS; IFS=$ac_path_separator
4166 ac_dummy="$PATH"
4167 for ac_dir in $ac_dummy; do
4168   IFS=$ac_save_IFS
4169   test -z "$ac_dir" && ac_dir=.
4170   $as_executable_p "$ac_dir/$ac_word" || continue
4171 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
4172 echo "$as_me:4172: found $ac_dir/$ac_word" >&5
4173 break
4174 done
4175
4176 fi
4177 fi
4178 RANLIB=$ac_cv_prog_RANLIB
4179 if test -n "$RANLIB"; then
4180   echo "$as_me:4180: result: $RANLIB" >&5
4181 echo "${ECHO_T}$RANLIB" >&6
4182 else
4183   echo "$as_me:4183: result: no" >&5
4184 echo "${ECHO_T}no" >&6
4185 fi
4186
4187 fi
4188 if test -z "$ac_cv_prog_RANLIB"; then
4189   ac_ct_RANLIB=$RANLIB
4190   # Extract the first word of "ranlib", so it can be a program name with args.
4191 set dummy ranlib; ac_word=$2
4192 echo "$as_me:4192: checking for $ac_word" >&5
4193 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4194 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
4195   echo $ECHO_N "(cached) $ECHO_C" >&6
4196 else
4197   if test -n "$ac_ct_RANLIB"; then
4198   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
4199 else
4200   ac_save_IFS=$IFS; IFS=$ac_path_separator
4201 ac_dummy="$PATH"
4202 for ac_dir in $ac_dummy; do
4203   IFS=$ac_save_IFS
4204   test -z "$ac_dir" && ac_dir=.
4205   $as_executable_p "$ac_dir/$ac_word" || continue
4206 ac_cv_prog_ac_ct_RANLIB="ranlib"
4207 echo "$as_me:4207: found $ac_dir/$ac_word" >&5
4208 break
4209 done
4210
4211   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
4212 fi
4213 fi
4214 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
4215 if test -n "$ac_ct_RANLIB"; then
4216   echo "$as_me:4216: result: $ac_ct_RANLIB" >&5
4217 echo "${ECHO_T}$ac_ct_RANLIB" >&6
4218 else
4219   echo "$as_me:4219: result: no" >&5
4220 echo "${ECHO_T}no" >&6
4221 fi
4222
4223   RANLIB=$ac_ct_RANLIB
4224 else
4225   RANLIB="$ac_cv_prog_RANLIB"
4226 fi
4227
4228 if test -n "$ac_tool_prefix"; then
4229   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
4230 set dummy ${ac_tool_prefix}ld; ac_word=$2
4231 echo "$as_me:4231: checking for $ac_word" >&5
4232 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4233 if test "${ac_cv_prog_LD+set}" = set; then
4234   echo $ECHO_N "(cached) $ECHO_C" >&6
4235 else
4236   if test -n "$LD"; then
4237   ac_cv_prog_LD="$LD" # Let the user override the test.
4238 else
4239   ac_save_IFS=$IFS; IFS=$ac_path_separator
4240 ac_dummy="$PATH"
4241 for ac_dir in $ac_dummy; do
4242   IFS=$ac_save_IFS
4243   test -z "$ac_dir" && ac_dir=.
4244   $as_executable_p "$ac_dir/$ac_word" || continue
4245 ac_cv_prog_LD="${ac_tool_prefix}ld"
4246 echo "$as_me:4246: found $ac_dir/$ac_word" >&5
4247 break
4248 done
4249
4250 fi
4251 fi
4252 LD=$ac_cv_prog_LD
4253 if test -n "$LD"; then
4254   echo "$as_me:4254: result: $LD" >&5
4255 echo "${ECHO_T}$LD" >&6
4256 else
4257   echo "$as_me:4257: result: no" >&5
4258 echo "${ECHO_T}no" >&6
4259 fi
4260
4261 fi
4262 if test -z "$ac_cv_prog_LD"; then
4263   ac_ct_LD=$LD
4264   # Extract the first word of "ld", so it can be a program name with args.
4265 set dummy ld; ac_word=$2
4266 echo "$as_me:4266: checking for $ac_word" >&5
4267 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4268 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
4269   echo $ECHO_N "(cached) $ECHO_C" >&6
4270 else
4271   if test -n "$ac_ct_LD"; then
4272   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
4273 else
4274   ac_save_IFS=$IFS; IFS=$ac_path_separator
4275 ac_dummy="$PATH"
4276 for ac_dir in $ac_dummy; do
4277   IFS=$ac_save_IFS
4278   test -z "$ac_dir" && ac_dir=.
4279   $as_executable_p "$ac_dir/$ac_word" || continue
4280 ac_cv_prog_ac_ct_LD="ld"
4281 echo "$as_me:4281: found $ac_dir/$ac_word" >&5
4282 break
4283 done
4284
4285   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
4286 fi
4287 fi
4288 ac_ct_LD=$ac_cv_prog_ac_ct_LD
4289 if test -n "$ac_ct_LD"; then
4290   echo "$as_me:4290: result: $ac_ct_LD" >&5
4291 echo "${ECHO_T}$ac_ct_LD" >&6
4292 else
4293   echo "$as_me:4293: result: no" >&5
4294 echo "${ECHO_T}no" >&6
4295 fi
4296
4297   LD=$ac_ct_LD
4298 else
4299   LD="$ac_cv_prog_LD"
4300 fi
4301
4302 if test -n "$ac_tool_prefix"; then
4303   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
4304 set dummy ${ac_tool_prefix}ar; ac_word=$2
4305 echo "$as_me:4305: checking for $ac_word" >&5
4306 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4307 if test "${ac_cv_prog_AR+set}" = set; then
4308   echo $ECHO_N "(cached) $ECHO_C" >&6
4309 else
4310   if test -n "$AR"; then
4311   ac_cv_prog_AR="$AR" # Let the user override the test.
4312 else
4313   ac_save_IFS=$IFS; IFS=$ac_path_separator
4314 ac_dummy="$PATH"
4315 for ac_dir in $ac_dummy; do
4316   IFS=$ac_save_IFS
4317   test -z "$ac_dir" && ac_dir=.
4318   $as_executable_p "$ac_dir/$ac_word" || continue
4319 ac_cv_prog_AR="${ac_tool_prefix}ar"
4320 echo "$as_me:4320: found $ac_dir/$ac_word" >&5
4321 break
4322 done
4323
4324 fi
4325 fi
4326 AR=$ac_cv_prog_AR
4327 if test -n "$AR"; then
4328   echo "$as_me:4328: result: $AR" >&5
4329 echo "${ECHO_T}$AR" >&6
4330 else
4331   echo "$as_me:4331: result: no" >&5
4332 echo "${ECHO_T}no" >&6
4333 fi
4334
4335 fi
4336 if test -z "$ac_cv_prog_AR"; then
4337   ac_ct_AR=$AR
4338   # Extract the first word of "ar", so it can be a program name with args.
4339 set dummy ar; ac_word=$2
4340 echo "$as_me:4340: checking for $ac_word" >&5
4341 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4342 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4343   echo $ECHO_N "(cached) $ECHO_C" >&6
4344 else
4345   if test -n "$ac_ct_AR"; then
4346   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4347 else
4348   ac_save_IFS=$IFS; IFS=$ac_path_separator
4349 ac_dummy="$PATH"
4350 for ac_dir in $ac_dummy; do
4351   IFS=$ac_save_IFS
4352   test -z "$ac_dir" && ac_dir=.
4353   $as_executable_p "$ac_dir/$ac_word" || continue
4354 ac_cv_prog_ac_ct_AR="ar"
4355 echo "$as_me:4355: found $ac_dir/$ac_word" >&5
4356 break
4357 done
4358
4359   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4360 fi
4361 fi
4362 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4363 if test -n "$ac_ct_AR"; then
4364   echo "$as_me:4364: result: $ac_ct_AR" >&5
4365 echo "${ECHO_T}$ac_ct_AR" >&6
4366 else
4367   echo "$as_me:4367: result: no" >&5
4368 echo "${ECHO_T}no" >&6
4369 fi
4370
4371   AR=$ac_ct_AR
4372 else
4373   AR="$ac_cv_prog_AR"
4374 fi
4375
4376 if test -n "$ac_tool_prefix"; then
4377   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
4378 set dummy ${ac_tool_prefix}ar; ac_word=$2
4379 echo "$as_me:4379: checking for $ac_word" >&5
4380 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4381 if test "${ac_cv_prog_AR+set}" = set; then
4382   echo $ECHO_N "(cached) $ECHO_C" >&6
4383 else
4384   if test -n "$AR"; then
4385   ac_cv_prog_AR="$AR" # Let the user override the test.
4386 else
4387   ac_save_IFS=$IFS; IFS=$ac_path_separator
4388 ac_dummy="$PATH"
4389 for ac_dir in $ac_dummy; do
4390   IFS=$ac_save_IFS
4391   test -z "$ac_dir" && ac_dir=.
4392   $as_executable_p "$ac_dir/$ac_word" || continue
4393 ac_cv_prog_AR="${ac_tool_prefix}ar"
4394 echo "$as_me:4394: found $ac_dir/$ac_word" >&5
4395 break
4396 done
4397
4398 fi
4399 fi
4400 AR=$ac_cv_prog_AR
4401 if test -n "$AR"; then
4402   echo "$as_me:4402: result: $AR" >&5
4403 echo "${ECHO_T}$AR" >&6
4404 else
4405   echo "$as_me:4405: result: no" >&5
4406 echo "${ECHO_T}no" >&6
4407 fi
4408
4409 fi
4410 if test -z "$ac_cv_prog_AR"; then
4411   ac_ct_AR=$AR
4412   # Extract the first word of "ar", so it can be a program name with args.
4413 set dummy ar; ac_word=$2
4414 echo "$as_me:4414: checking for $ac_word" >&5
4415 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4416 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
4417   echo $ECHO_N "(cached) $ECHO_C" >&6
4418 else
4419   if test -n "$ac_ct_AR"; then
4420   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
4421 else
4422   ac_save_IFS=$IFS; IFS=$ac_path_separator
4423 ac_dummy="$PATH"
4424 for ac_dir in $ac_dummy; do
4425   IFS=$ac_save_IFS
4426   test -z "$ac_dir" && ac_dir=.
4427   $as_executable_p "$ac_dir/$ac_word" || continue
4428 ac_cv_prog_ac_ct_AR="ar"
4429 echo "$as_me:4429: found $ac_dir/$ac_word" >&5
4430 break
4431 done
4432
4433   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
4434 fi
4435 fi
4436 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4437 if test -n "$ac_ct_AR"; then
4438   echo "$as_me:4438: result: $ac_ct_AR" >&5
4439 echo "${ECHO_T}$ac_ct_AR" >&6
4440 else
4441   echo "$as_me:4441: result: no" >&5
4442 echo "${ECHO_T}no" >&6
4443 fi
4444
4445   AR=$ac_ct_AR
4446 else
4447   AR="$ac_cv_prog_AR"
4448 fi
4449
4450 echo "$as_me:4450: checking for options to update archives" >&5
4451 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4452 if test "${cf_cv_ar_flags+set}" = set; then
4453   echo $ECHO_N "(cached) $ECHO_C" >&6
4454 else
4455
4456         case "$cf_cv_system_name" in
4457         (*-msvc*)
4458                 cf_cv_ar_flags=''
4459                 cat >mk_static_lib.sh <<-EOF
4460                 #!$SHELL
4461                 MSVC_BIN="$AR"
4462                 out="\$1"
4463                 shift
4464                 exec \$MSVC_BIN -out:"\$out" \$@
4465                 EOF
4466                 chmod +x mk_static_lib.sh
4467                 AR=`pwd`/mk_static_lib.sh
4468                 ;;
4469         (*)
4470                 cf_cv_ar_flags=unknown
4471                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4472                 do
4473
4474                         # check if $ARFLAGS already contains this choice
4475                         if test "x$ARFLAGS" != "x" ; then
4476                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4477                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4478                                         cf_cv_ar_flags=
4479                                         break
4480                                 fi
4481                         fi
4482
4483                         rm -f "conftest.$ac_cv_objext"
4484                         rm -f conftest.a
4485
4486                         cat >"conftest.$ac_ext" <<EOF
4487 #line 4487 "configure"
4488 int     testdata[3] = { 123, 456, 789 };
4489 EOF
4490                         if { (eval echo "$as_me:4490: \"$ac_compile\"") >&5
4491   (eval $ac_compile) 2>&5
4492   ac_status=$?
4493   echo "$as_me:4493: \$? = $ac_status" >&5
4494   (exit "$ac_status"); } ; then
4495                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4496                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4497                                 if test -f conftest.a ; then
4498                                         cf_cv_ar_flags="$cf_ar_flags"
4499                                         break
4500                                 fi
4501                         else
4502                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4503
4504 echo "${as_me:-configure}:4504: testing cannot compile test-program ..." 1>&5
4505
4506                                 break
4507                         fi
4508                 done
4509                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4510                 ;;
4511         esac
4512
4513 fi
4514 echo "$as_me:4514: result: $cf_cv_ar_flags" >&5
4515 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4516
4517 if test -n "$ARFLAGS" ; then
4518         if test -n "$cf_cv_ar_flags" ; then
4519                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4520         fi
4521 else
4522         ARFLAGS=$cf_cv_ar_flags
4523 fi
4524
4525         echo "$as_me:4525: checking for PATH separator" >&5
4526 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4527         case "$cf_cv_system_name" in
4528         (os2*)  PATH_SEPARATOR=';'  ;;
4529         (*)     ${PATH_SEPARATOR:=':'}  ;;
4530         esac
4531
4532         echo "$as_me:4532: result: $PATH_SEPARATOR" >&5
4533 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4534
4535 echo "$as_me:4535: checking if you have specified an install-prefix" >&5
4536 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4537
4538 # Check whether --with-install-prefix or --without-install-prefix was given.
4539 if test "${with_install_prefix+set}" = set; then
4540   withval="$with_install_prefix"
4541   case "$withval" in
4542         (yes|no)
4543                 ;;
4544         (*)     DESTDIR="$withval"
4545                 ;;
4546         esac
4547 fi;
4548 echo "$as_me:4548: result: $DESTDIR" >&5
4549 echo "${ECHO_T}$DESTDIR" >&6
4550
4551 ###############################################################################
4552
4553 # If we're cross-compiling, allow the user to override the tools and their
4554 # options.  The configure script is oriented toward identifying the host
4555 # compiler, etc., but we need a build compiler to generate parts of the source.
4556
4557 if test "$cross_compiling" = yes ; then
4558
4559         # defaults that we might want to override
4560         : ${BUILD_CFLAGS:=''}
4561         : ${BUILD_CPPFLAGS:=''}
4562         : ${BUILD_LDFLAGS:=''}
4563         : ${BUILD_LIBS:=''}
4564         : ${BUILD_EXEEXT:='$x'}
4565         : ${BUILD_OBJEXT:='o'}
4566
4567 # Check whether --with-build-cc or --without-build-cc was given.
4568 if test "${with_build_cc+set}" = set; then
4569   withval="$with_build_cc"
4570   BUILD_CC="$withval"
4571 else
4572   for ac_prog in gcc clang c99 c89 cc cl
4573 do
4574   # Extract the first word of "$ac_prog", so it can be a program name with args.
4575 set dummy $ac_prog; ac_word=$2
4576 echo "$as_me:4576: checking for $ac_word" >&5
4577 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4578 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4579   echo $ECHO_N "(cached) $ECHO_C" >&6
4580 else
4581   if test -n "$BUILD_CC"; then
4582   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4583 else
4584   ac_save_IFS=$IFS; IFS=$ac_path_separator
4585 ac_dummy="$PATH"
4586 for ac_dir in $ac_dummy; do
4587   IFS=$ac_save_IFS
4588   test -z "$ac_dir" && ac_dir=.
4589   $as_executable_p "$ac_dir/$ac_word" || continue
4590 ac_cv_prog_BUILD_CC="$ac_prog"
4591 echo "$as_me:4591: found $ac_dir/$ac_word" >&5
4592 break
4593 done
4594
4595 fi
4596 fi
4597 BUILD_CC=$ac_cv_prog_BUILD_CC
4598 if test -n "$BUILD_CC"; then
4599   echo "$as_me:4599: result: $BUILD_CC" >&5
4600 echo "${ECHO_T}$BUILD_CC" >&6
4601 else
4602   echo "$as_me:4602: result: no" >&5
4603 echo "${ECHO_T}no" >&6
4604 fi
4605
4606   test -n "$BUILD_CC" && break
4607 done
4608 test -n "$BUILD_CC" || BUILD_CC="none"
4609
4610 fi;
4611         echo "$as_me:4611: checking for native build C compiler" >&5
4612 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4613         echo "$as_me:4613: result: $BUILD_CC" >&5
4614 echo "${ECHO_T}$BUILD_CC" >&6
4615
4616         echo "$as_me:4616: checking for native build C preprocessor" >&5
4617 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4618
4619 # Check whether --with-build-cpp or --without-build-cpp was given.
4620 if test "${with_build_cpp+set}" = set; then
4621   withval="$with_build_cpp"
4622   BUILD_CPP="$withval"
4623 else
4624   BUILD_CPP='${BUILD_CC} -E'
4625 fi;
4626         echo "$as_me:4626: result: $BUILD_CPP" >&5
4627 echo "${ECHO_T}$BUILD_CPP" >&6
4628
4629         echo "$as_me:4629: checking for native build C flags" >&5
4630 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4631
4632 # Check whether --with-build-cflags or --without-build-cflags was given.
4633 if test "${with_build_cflags+set}" = set; then
4634   withval="$with_build_cflags"
4635   BUILD_CFLAGS="$withval"
4636 fi;
4637         echo "$as_me:4637: result: $BUILD_CFLAGS" >&5
4638 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4639
4640         echo "$as_me:4640: checking for native build C preprocessor-flags" >&5
4641 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4642
4643 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4644 if test "${with_build_cppflags+set}" = set; then
4645   withval="$with_build_cppflags"
4646   BUILD_CPPFLAGS="$withval"
4647 fi;
4648         echo "$as_me:4648: result: $BUILD_CPPFLAGS" >&5
4649 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4650
4651         echo "$as_me:4651: checking for native build linker-flags" >&5
4652 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4653
4654 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4655 if test "${with_build_ldflags+set}" = set; then
4656   withval="$with_build_ldflags"
4657   BUILD_LDFLAGS="$withval"
4658 fi;
4659         echo "$as_me:4659: result: $BUILD_LDFLAGS" >&5
4660 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4661
4662         echo "$as_me:4662: checking for native build linker-libraries" >&5
4663 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4664
4665 # Check whether --with-build-libs or --without-build-libs was given.
4666 if test "${with_build_libs+set}" = set; then
4667   withval="$with_build_libs"
4668   BUILD_LIBS="$withval"
4669 fi;
4670         echo "$as_me:4670: result: $BUILD_LIBS" >&5
4671 echo "${ECHO_T}$BUILD_LIBS" >&6
4672
4673         # this assumes we're on Unix.
4674         BUILD_EXEEXT=
4675         BUILD_OBJEXT=o
4676
4677         : ${BUILD_CC:='${CC}'}
4678
4679         echo "$as_me:4679: checking if the build-compiler \"$BUILD_CC\" works" >&5
4680 echo $ECHO_N "checking if the build-compiler \"$BUILD_CC\" works... $ECHO_C" >&6
4681
4682         cf_save_crossed=$cross_compiling
4683         cf_save_ac_link=$ac_link
4684         cross_compiling=no
4685         cf_build_cppflags=$BUILD_CPPFLAGS
4686         test "$cf_build_cppflags" = "#" && cf_build_cppflags=
4687         ac_link='$BUILD_CC -o "conftest$ac_exeext" $BUILD_CFLAGS $cf_build_cppflags $BUILD_LDFLAGS "conftest.$ac_ext" $BUILD_LIBS >&5'
4688
4689         if test "$cross_compiling" = yes; then
4690   cf_ok_build_cc=unknown
4691 else
4692   cat >"conftest.$ac_ext" <<_ACEOF
4693 #line 4693 "configure"
4694 #include "confdefs.h"
4695 #include <stdio.h>
4696                 int main(int argc, char *argv[])
4697                 {
4698                         ${cf_cv_main_return:-return}(argc < 0 || argv == 0 || argv[0] == 0);
4699                 }
4700
4701 _ACEOF
4702 rm -f "conftest$ac_exeext"
4703 if { (eval echo "$as_me:4703: \"$ac_link\"") >&5
4704   (eval $ac_link) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4708   { (eval echo "$as_me:4708: \"$ac_try\"") >&5
4709   (eval $ac_try) 2>&5
4710   ac_status=$?
4711   echo "$as_me:4711: \$? = $ac_status" >&5
4712   (exit "$ac_status"); }; }; then
4713   cf_ok_build_cc=yes
4714 else
4715   echo "$as_me: program exited with status $ac_status" >&5
4716 echo "$as_me: failed program was:" >&5
4717 cat "conftest.$ac_ext" >&5
4718 cf_ok_build_cc=no
4719 fi
4720 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4721 fi
4722
4723         cross_compiling=$cf_save_crossed
4724         ac_link=$cf_save_ac_link
4725
4726         echo "$as_me:4726: result: $cf_ok_build_cc" >&5
4727 echo "${ECHO_T}$cf_ok_build_cc" >&6
4728
4729         if test "$cf_ok_build_cc" != yes
4730         then
4731                 { { echo "$as_me:4731: error: Cross-build requires two compilers.
4732 Use --with-build-cc to specify the native compiler." >&5
4733 echo "$as_me: error: Cross-build requires two compilers.
4734 Use --with-build-cc to specify the native compiler." >&2;}
4735    { (exit 1); exit 1; }; }
4736         fi
4737
4738 else
4739         : ${BUILD_CC:='${CC}'}
4740         : ${BUILD_CPP:='${CPP}'}
4741         : ${BUILD_CFLAGS:='${CFLAGS}'}
4742         : ${BUILD_CPPFLAGS:=''${CPPFLAGS}''}
4743         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4744         : ${BUILD_LIBS:=''${LIBS}''}
4745         : ${BUILD_EXEEXT:='$x'}
4746         : ${BUILD_OBJEXT:='o'}
4747 fi
4748
4749 ###############################################################################
4750
4751 ### Options to allow the user to specify the set of libraries which are used.
4752 ### Use "--without-normal --with-shared" to allow the default model to be
4753 ### shared, for example.
4754 cf_list_models=""
4755
4756 echo "$as_me:4756: checking if you want to build shared C-objects" >&5
4757 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4758
4759 # Check whether --with-shared or --without-shared was given.
4760 if test "${with_shared+set}" = set; then
4761   withval="$with_shared"
4762   with_shared=$withval
4763 else
4764   with_shared=no
4765 fi;
4766 echo "$as_me:4766: result: $with_shared" >&5
4767 echo "${ECHO_T}$with_shared" >&6
4768 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4769
4770 echo "$as_me:4770: checking for specified models" >&5
4771 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4772 test -z "$cf_list_models" && cf_list_models=normal
4773 echo "$as_me:4773: result: $cf_list_models" >&5
4774 echo "${ECHO_T}$cf_list_models" >&6
4775
4776 ### Use the first model as the default, and save its suffix for use in building
4777 ### up test-applications.
4778 echo "$as_me:4778: checking for default model" >&5
4779 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4780 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4781 echo "$as_me:4781: result: $DFT_LWR_MODEL" >&5
4782 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4783
4784 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4785
4786 echo "$as_me:4786: checking for specific curses-directory" >&5
4787 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4788
4789 # Check whether --with-curses-dir or --without-curses-dir was given.
4790 if test "${with_curses_dir+set}" = set; then
4791   withval="$with_curses_dir"
4792   cf_cv_curses_dir=$withval
4793 else
4794   cf_cv_curses_dir=no
4795 fi;
4796 echo "$as_me:4796: result: $cf_cv_curses_dir" >&5
4797 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4798
4799 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4800 then
4801
4802 if test "x$prefix" != xNONE; then
4803         cf_path_syntax="$prefix"
4804 else
4805         cf_path_syntax="$ac_default_prefix"
4806 fi
4807
4808 case ".$withval" in
4809 (.\$\(*\)*|.\'*\'*)
4810         ;;
4811 (..|./*|.\\*)
4812         ;;
4813 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4814         ;;
4815 (.\$\{*prefix\}*|.\$\{*dir\}*)
4816         eval withval="$withval"
4817         case ".$withval" in
4818         (.NONE/*)
4819                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4820                 ;;
4821         esac
4822         ;;
4823 (.no|.NONE/*)
4824         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4825         ;;
4826 (*)
4827         { { echo "$as_me:4827: error: expected a pathname, not \"$withval\"" >&5
4828 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4829    { (exit 1); exit 1; }; }
4830         ;;
4831 esac
4832
4833         if test -d "$cf_cv_curses_dir"
4834         then
4835
4836 if test -n "$cf_cv_curses_dir/include" ; then
4837   for cf_add_incdir in $cf_cv_curses_dir/include
4838   do
4839         while test "$cf_add_incdir" != /usr/include
4840         do
4841           if test -d "$cf_add_incdir"
4842           then
4843                 cf_have_incdir=no
4844                 if test -n "$CFLAGS$CPPFLAGS" ; then
4845                   # a loop is needed to ensure we can add subdirs of existing dirs
4846                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4847                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4848                           cf_have_incdir=yes; break
4849                         fi
4850                   done
4851                 fi
4852
4853                 if test "$cf_have_incdir" = no ; then
4854                   if test "$cf_add_incdir" = /usr/local/include ; then
4855                         if test "$GCC" = yes
4856                         then
4857                           cf_save_CPPFLAGS=$CPPFLAGS
4858
4859         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4860         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4861
4862                           cat >"conftest.$ac_ext" <<_ACEOF
4863 #line 4863 "configure"
4864 #include "confdefs.h"
4865 #include <stdio.h>
4866 int
4867 main (void)
4868 {
4869 printf("Hello")
4870   ;
4871   return 0;
4872 }
4873 _ACEOF
4874 rm -f "conftest.$ac_objext"
4875 if { (eval echo "$as_me:4875: \"$ac_compile\"") >&5
4876   (eval $ac_compile) 2>&5
4877   ac_status=$?
4878   echo "$as_me:4878: \$? = $ac_status" >&5
4879   (exit "$ac_status"); } &&
4880          { ac_try='test -s "conftest.$ac_objext"'
4881   { (eval echo "$as_me:4881: \"$ac_try\"") >&5
4882   (eval $ac_try) 2>&5
4883   ac_status=$?
4884   echo "$as_me:4884: \$? = $ac_status" >&5
4885   (exit "$ac_status"); }; }; then
4886   :
4887 else
4888   echo "$as_me: failed program was:" >&5
4889 cat "conftest.$ac_ext" >&5
4890 cf_have_incdir=yes
4891 fi
4892 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4893                           CPPFLAGS=$cf_save_CPPFLAGS
4894                         fi
4895                   fi
4896                 fi
4897
4898                 if test "$cf_have_incdir" = no ; then
4899                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4900
4901 echo "${as_me:-configure}:4901: testing adding $cf_add_incdir to include-path ..." 1>&5
4902
4903                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4904
4905                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4906                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4907                   cf_add_incdir="$cf_top_incdir"
4908                 else
4909                   break
4910                 fi
4911           else
4912                 break
4913           fi
4914         done
4915   done
4916 fi
4917
4918 if test -n "$cf_cv_curses_dir/lib" ; then
4919         for cf_add_libdir in $cf_cv_curses_dir/lib
4920         do
4921                 if test "$cf_add_libdir" = /usr/lib ; then
4922                         :
4923                 elif test -d "$cf_add_libdir"
4924                 then
4925                         cf_have_libdir=no
4926                         if test -n "$LDFLAGS$LIBS" ; then
4927                                 # a loop is needed to ensure we can add subdirs of existing dirs
4928                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4929                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4930                                                 cf_have_libdir=yes; break
4931                                         fi
4932                                 done
4933                         fi
4934                         if test "$cf_have_libdir" = no ; then
4935                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4936
4937 echo "${as_me:-configure}:4937: testing adding $cf_add_libdir to library-path ..." 1>&5
4938
4939                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4940                         fi
4941                 fi
4942         done
4943 fi
4944
4945         fi
4946 fi
4947
4948 cf_ncuconfig_root=ncurses
4949 cf_have_ncuconfig=no
4950
4951 if test "x${PKG_CONFIG:=none}" != xnone; then
4952         echo "$as_me:4952: checking pkg-config for $cf_ncuconfig_root" >&5
4953 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4954         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4955                 echo "$as_me:4955: result: yes" >&5
4956 echo "${ECHO_T}yes" >&6
4957
4958                 echo "$as_me:4958: checking if the $cf_ncuconfig_root package files work" >&5
4959 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4960                 cf_have_ncuconfig=unknown
4961
4962                 cf_save_CFLAGS="$CFLAGS"
4963                 cf_save_CPPFLAGS="$CPPFLAGS"
4964                 cf_save_LIBS="$LIBS"
4965
4966                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4967                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4968
4969                 # while -W for passing linker flags is prevalent, it is not "standard".
4970                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4971                 # incompatible _and_ non-standard -W option which gives an error.  Work
4972                 # around that pitfall.
4973                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4974                 (x*c[89]9@@*-W*)
4975
4976 cf_fix_cppflags=no
4977 cf_new_cflags=
4978 cf_new_cppflags=
4979 cf_new_extra_cppflags=
4980
4981 for cf_add_cflags in $cf_pkg_cflags
4982 do
4983 case "$cf_fix_cppflags" in
4984 (no)
4985         case "$cf_add_cflags" in
4986         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4987                 case "$cf_add_cflags" in
4988                 (-D*)
4989                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4990
4991                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4992                                 && test -z "${cf_tst_cflags}" \
4993                                 && cf_fix_cppflags=yes
4994
4995                         if test "$cf_fix_cppflags" = yes ; then
4996
4997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4999
5000                                 continue
5001                         elif test "${cf_tst_cflags}" = "\"'" ; then
5002
5003         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5004         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5005
5006                                 continue
5007                         fi
5008                         ;;
5009                 esac
5010                 case "$CPPFLAGS" in
5011                 (*$cf_add_cflags)
5012                         ;;
5013                 (*)
5014                         case "$cf_add_cflags" in
5015                         (-D*)
5016                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5017
5018 CPPFLAGS=`echo "$CPPFLAGS" | \
5019         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5020                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5021
5022                                 ;;
5023                         esac
5024
5025         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5026         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5027
5028                         ;;
5029                 esac
5030                 ;;
5031         (*)
5032
5033         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5034         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5035
5036                 ;;
5037         esac
5038         ;;
5039 (yes)
5040
5041         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5042         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5043
5044         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5045
5046         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5047                 && test -z "${cf_tst_cflags}" \
5048                 && cf_fix_cppflags=no
5049         ;;
5050 esac
5051 done
5052
5053 if test -n "$cf_new_cflags" ; then
5054
5055         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5056         CFLAGS="${CFLAGS}$cf_new_cflags"
5057
5058 fi
5059
5060 if test -n "$cf_new_cppflags" ; then
5061
5062         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5063         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5064
5065 fi
5066
5067 if test -n "$cf_new_extra_cppflags" ; then
5068
5069         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5070         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5071
5072 fi
5073
5074 cf_add_libs="$LIBS"
5075 # reverse order
5076 cf_add_0lib=
5077 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5078 # filter duplicates
5079 for cf_add_1lib in $cf_add_0lib; do
5080         for cf_add_2lib in $cf_add_libs; do
5081                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5082                         cf_add_1lib=
5083                         break
5084                 fi
5085         done
5086         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5087 done
5088 LIBS="$cf_add_libs"
5089
5090                         cat >"conftest.$ac_ext" <<_ACEOF
5091 #line 5091 "configure"
5092 #include "confdefs.h"
5093 #include <${cf_cv_ncurses_header:-curses.h}>
5094 int
5095 main (void)
5096 {
5097 initscr(); mousemask(0,0); tigetstr((char *)0);
5098   ;
5099   return 0;
5100 }
5101 _ACEOF
5102 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5103 if { (eval echo "$as_me:5103: \"$ac_link\"") >&5
5104   (eval $ac_link) 2>&5
5105   ac_status=$?
5106   echo "$as_me:5106: \$? = $ac_status" >&5
5107   (exit "$ac_status"); } &&
5108          { ac_try='test -s "conftest$ac_exeext"'
5109   { (eval echo "$as_me:5109: \"$ac_try\"") >&5
5110   (eval $ac_try) 2>&5
5111   ac_status=$?
5112   echo "$as_me:5112: \$? = $ac_status" >&5
5113   (exit "$ac_status"); }; }; then
5114   if test "$cross_compiling" = yes; then
5115   cf_test_ncuconfig=maybe
5116 else
5117   cat >"conftest.$ac_ext" <<_ACEOF
5118 #line 5118 "configure"
5119 #include "confdefs.h"
5120 #include <${cf_cv_ncurses_header:-curses.h}>
5121                                         int main(void)
5122                                         { const char *xx = curses_version(); return (xx == 0); }
5123 _ACEOF
5124 rm -f "conftest$ac_exeext"
5125 if { (eval echo "$as_me:5125: \"$ac_link\"") >&5
5126   (eval $ac_link) 2>&5
5127   ac_status=$?
5128   echo "$as_me:5128: \$? = $ac_status" >&5
5129   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5130   { (eval echo "$as_me:5130: \"$ac_try\"") >&5
5131   (eval $ac_try) 2>&5
5132   ac_status=$?
5133   echo "$as_me:5133: \$? = $ac_status" >&5
5134   (exit "$ac_status"); }; }; then
5135   cf_test_ncuconfig=yes
5136 else
5137   echo "$as_me: program exited with status $ac_status" >&5
5138 echo "$as_me: failed program was:" >&5
5139 cat "conftest.$ac_ext" >&5
5140 cf_test_ncuconfig=no
5141 fi
5142 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5143 fi
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat "conftest.$ac_ext" >&5
5147 cf_test_ncuconfig=no
5148 fi
5149 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5150
5151                         CFLAGS="$cf_save_CFLAGS"
5152                         CPPFLAGS="$cf_save_CPPFLAGS"
5153                         LIBS="$cf_save_LIBS"
5154
5155                         if test "x$cf_test_ncuconfig" != xyes; then
5156                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
5157                                 cf_pkg_cflags="$cf_temp"
5158                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
5159                                 cf_pkg_libs="$cf_temp"
5160                         fi
5161                         ;;
5162                 esac
5163
5164 for cf_add_cflags in $cf_pkg_cflags
5165 do
5166         case "x$cf_add_cflags" in
5167         (x-[DU]*)
5168
5169 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5170 while true
5171 do
5172         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5173         test "$CFLAGS" != "$cf_old_cflag" || break
5174
5175         CFLAGS="$cf_old_cflag"
5176 done
5177
5178 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5179 while true
5180 do
5181         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5182         test "$CPPFLAGS" != "$cf_old_cflag" || break
5183
5184         CPPFLAGS="$cf_old_cflag"
5185 done
5186
5187                 ;;
5188         esac
5189
5190 cf_fix_cppflags=no
5191 cf_new_cflags=
5192 cf_new_cppflags=
5193 cf_new_extra_cppflags=
5194
5195 for cf_add_cflags in $cf_add_cflags
5196 do
5197 case "$cf_fix_cppflags" in
5198 (no)
5199         case "$cf_add_cflags" in
5200         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5201                 case "$cf_add_cflags" in
5202                 (-D*)
5203                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5204
5205                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5206                                 && test -z "${cf_tst_cflags}" \
5207                                 && cf_fix_cppflags=yes
5208
5209                         if test "$cf_fix_cppflags" = yes ; then
5210
5211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5213
5214                                 continue
5215                         elif test "${cf_tst_cflags}" = "\"'" ; then
5216
5217         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5218         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5219
5220                                 continue
5221                         fi
5222                         ;;
5223                 esac
5224                 case "$CPPFLAGS" in
5225                 (*$cf_add_cflags)
5226                         ;;
5227                 (*)
5228                         case "$cf_add_cflags" in
5229                         (-D*)
5230                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5231
5232 CPPFLAGS=`echo "$CPPFLAGS" | \
5233         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5234                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5235
5236                                 ;;
5237                         esac
5238
5239         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5240         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5241
5242                         ;;
5243                 esac
5244                 ;;
5245         (*)
5246
5247         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5248         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5249
5250                 ;;
5251         esac
5252         ;;
5253 (yes)
5254
5255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5257
5258         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5259
5260         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5261                 && test -z "${cf_tst_cflags}" \
5262                 && cf_fix_cppflags=no
5263         ;;
5264 esac
5265 done
5266
5267 if test -n "$cf_new_cflags" ; then
5268
5269         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5270         CFLAGS="${CFLAGS}$cf_new_cflags"
5271
5272 fi
5273
5274 if test -n "$cf_new_cppflags" ; then
5275
5276         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5277         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5278
5279 fi
5280
5281 if test -n "$cf_new_extra_cppflags" ; then
5282
5283         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5284         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5285
5286 fi
5287
5288 done
5289
5290 cf_add_libs="$LIBS"
5291 # reverse order
5292 cf_add_0lib=
5293 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5294 # filter duplicates
5295 for cf_add_1lib in $cf_add_0lib; do
5296         for cf_add_2lib in $cf_add_libs; do
5297                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5298                         cf_add_1lib=
5299                         break
5300                 fi
5301         done
5302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5303 done
5304 LIBS="$cf_add_libs"
5305
5306                 cat >"conftest.$ac_ext" <<_ACEOF
5307 #line 5307 "configure"
5308 #include "confdefs.h"
5309 #include <${cf_cv_ncurses_header:-curses.h}>
5310 int
5311 main (void)
5312 {
5313 initscr(); mousemask(0,0); tigetstr((char *)0);
5314   ;
5315   return 0;
5316 }
5317 _ACEOF
5318 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5319 if { (eval echo "$as_me:5319: \"$ac_link\"") >&5
5320   (eval $ac_link) 2>&5
5321   ac_status=$?
5322   echo "$as_me:5322: \$? = $ac_status" >&5
5323   (exit "$ac_status"); } &&
5324          { ac_try='test -s "conftest$ac_exeext"'
5325   { (eval echo "$as_me:5325: \"$ac_try\"") >&5
5326   (eval $ac_try) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit "$ac_status"); }; }; then
5330   if test "$cross_compiling" = yes; then
5331   cf_have_ncuconfig=maybe
5332 else
5333   cat >"conftest.$ac_ext" <<_ACEOF
5334 #line 5334 "configure"
5335 #include "confdefs.h"
5336 #include <${cf_cv_ncurses_header:-curses.h}>
5337                                 int main(void)
5338                                 { const char *xx = curses_version(); return (xx == 0); }
5339 _ACEOF
5340 rm -f "conftest$ac_exeext"
5341 if { (eval echo "$as_me:5341: \"$ac_link\"") >&5
5342   (eval $ac_link) 2>&5
5343   ac_status=$?
5344   echo "$as_me:5344: \$? = $ac_status" >&5
5345   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5346   { (eval echo "$as_me:5346: \"$ac_try\"") >&5
5347   (eval $ac_try) 2>&5
5348   ac_status=$?
5349   echo "$as_me:5349: \$? = $ac_status" >&5
5350   (exit "$ac_status"); }; }; then
5351   cf_have_ncuconfig=yes
5352 else
5353   echo "$as_me: program exited with status $ac_status" >&5
5354 echo "$as_me: failed program was:" >&5
5355 cat "conftest.$ac_ext" >&5
5356 cf_have_ncuconfig=no
5357 fi
5358 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5359 fi
5360 else
5361   echo "$as_me: failed program was:" >&5
5362 cat "conftest.$ac_ext" >&5
5363 cf_have_ncuconfig=no
5364 fi
5365 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5366                 echo "$as_me:5366: result: $cf_have_ncuconfig" >&5
5367 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5368                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5369                 if test "$cf_have_ncuconfig" != "yes"
5370                 then
5371                         CPPFLAGS="$cf_save_CPPFLAGS"
5372                         LIBS="$cf_save_LIBS"
5373                         NCURSES_CONFIG_PKG=none
5374                 else
5375
5376 cat >>confdefs.h <<\EOF
5377 #define NCURSES 1
5378 EOF
5379
5380                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5381
5382 echo "$as_me:5382: checking for terminfo header" >&5
5383 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5384 if test "${cf_cv_term_header+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388 case "${cf_cv_ncurses_header}" in
5389 (*/ncurses.h|*/ncursesw.h)
5390         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5391         ;;
5392 (*)
5393         cf_term_header=term.h
5394         ;;
5395 esac
5396
5397 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5398 do
5399 cat >"conftest.$ac_ext" <<_ACEOF
5400 #line 5400 "configure"
5401 #include "confdefs.h"
5402 #include <stdio.h>
5403 #include <${cf_cv_ncurses_header:-curses.h}>
5404 #include <$cf_test>
5405
5406 int
5407 main (void)
5408 {
5409 int x = auto_left_margin; (void)x
5410   ;
5411   return 0;
5412 }
5413 _ACEOF
5414 rm -f "conftest.$ac_objext"
5415 if { (eval echo "$as_me:5415: \"$ac_compile\"") >&5
5416   (eval $ac_compile) 2>&5
5417   ac_status=$?
5418   echo "$as_me:5418: \$? = $ac_status" >&5
5419   (exit "$ac_status"); } &&
5420          { ac_try='test -s "conftest.$ac_objext"'
5421   { (eval echo "$as_me:5421: \"$ac_try\"") >&5
5422   (eval $ac_try) 2>&5
5423   ac_status=$?
5424   echo "$as_me:5424: \$? = $ac_status" >&5
5425   (exit "$ac_status"); }; }; then
5426
5427         cf_cv_term_header="$cf_test"
5428 else
5429   echo "$as_me: failed program was:" >&5
5430 cat "conftest.$ac_ext" >&5
5431
5432         cf_cv_term_header=unknown
5433
5434 fi
5435 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5436         test "$cf_cv_term_header" != unknown && break
5437 done
5438
5439 fi
5440 echo "$as_me:5440: result: $cf_cv_term_header" >&5
5441 echo "${ECHO_T}$cf_cv_term_header" >&6
5442
5443 # Set definitions to allow ifdef'ing to accommodate subdirectories
5444
5445 case "$cf_cv_term_header" in
5446 (*term.h)
5447
5448 cat >>confdefs.h <<\EOF
5449 #define HAVE_TERM_H 1
5450 EOF
5451
5452         ;;
5453 esac
5454
5455 case "$cf_cv_term_header" in
5456 (ncurses/term.h)
5457
5458 cat >>confdefs.h <<\EOF
5459 #define HAVE_NCURSES_TERM_H 1
5460 EOF
5461
5462         ;;
5463 (ncursesw/term.h)
5464
5465 cat >>confdefs.h <<\EOF
5466 #define HAVE_NCURSESW_TERM_H 1
5467 EOF
5468
5469         ;;
5470 esac
5471
5472                 fi
5473
5474         else
5475                 echo "$as_me:5475: result: no" >&5
5476 echo "${ECHO_T}no" >&6
5477                 NCURSES_CONFIG_PKG=none
5478         fi
5479 else
5480         NCURSES_CONFIG_PKG=none
5481 fi
5482
5483 if test "x$cf_have_ncuconfig" = "xno"; then
5484         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
5485
5486 if test -n "$ac_tool_prefix"; then
5487   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5488   do
5489     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5490 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5491 echo "$as_me:5491: checking for $ac_word" >&5
5492 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5493 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5494   echo $ECHO_N "(cached) $ECHO_C" >&6
5495 else
5496   if test -n "$NCURSES_CONFIG"; then
5497   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5498 else
5499   ac_save_IFS=$IFS; IFS=$ac_path_separator
5500 ac_dummy="$PATH"
5501 for ac_dir in $ac_dummy; do
5502   IFS=$ac_save_IFS
5503   test -z "$ac_dir" && ac_dir=.
5504   $as_executable_p "$ac_dir/$ac_word" || continue
5505 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5506 echo "$as_me:5506: found $ac_dir/$ac_word" >&5
5507 break
5508 done
5509
5510 fi
5511 fi
5512 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5513 if test -n "$NCURSES_CONFIG"; then
5514   echo "$as_me:5514: result: $NCURSES_CONFIG" >&5
5515 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5516 else
5517   echo "$as_me:5517: result: no" >&5
5518 echo "${ECHO_T}no" >&6
5519 fi
5520
5521     test -n "$NCURSES_CONFIG" && break
5522   done
5523 fi
5524 if test -z "$NCURSES_CONFIG"; then
5525   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5526   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5527 do
5528   # Extract the first word of "$ac_prog", so it can be a program name with args.
5529 set dummy $ac_prog; ac_word=$2
5530 echo "$as_me:5530: checking for $ac_word" >&5
5531 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5532 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5533   echo $ECHO_N "(cached) $ECHO_C" >&6
5534 else
5535   if test -n "$ac_ct_NCURSES_CONFIG"; then
5536   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5537 else
5538   ac_save_IFS=$IFS; IFS=$ac_path_separator
5539 ac_dummy="$PATH"
5540 for ac_dir in $ac_dummy; do
5541   IFS=$ac_save_IFS
5542   test -z "$ac_dir" && ac_dir=.
5543   $as_executable_p "$ac_dir/$ac_word" || continue
5544 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5545 echo "$as_me:5545: found $ac_dir/$ac_word" >&5
5546 break
5547 done
5548
5549 fi
5550 fi
5551 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5552 if test -n "$ac_ct_NCURSES_CONFIG"; then
5553   echo "$as_me:5553: result: $ac_ct_NCURSES_CONFIG" >&5
5554 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5555 else
5556   echo "$as_me:5556: result: no" >&5
5557 echo "${ECHO_T}no" >&6
5558 fi
5559
5560   test -n "$ac_ct_NCURSES_CONFIG" && break
5561 done
5562 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5563
5564   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5565 fi
5566
5567         if test "$NCURSES_CONFIG" != none ; then
5568
5569 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5570 do
5571         case "x$cf_add_cflags" in
5572         (x-[DU]*)
5573
5574 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5575 while true
5576 do
5577         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5578         test "$CFLAGS" != "$cf_old_cflag" || break
5579
5580         CFLAGS="$cf_old_cflag"
5581 done
5582
5583 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5584 while true
5585 do
5586         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
5587         test "$CPPFLAGS" != "$cf_old_cflag" || break
5588
5589         CPPFLAGS="$cf_old_cflag"
5590 done
5591
5592                 ;;
5593         esac
5594
5595 cf_fix_cppflags=no
5596 cf_new_cflags=
5597 cf_new_cppflags=
5598 cf_new_extra_cppflags=
5599
5600 for cf_add_cflags in $cf_add_cflags
5601 do
5602 case "$cf_fix_cppflags" in
5603 (no)
5604         case "$cf_add_cflags" in
5605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5606                 case "$cf_add_cflags" in
5607                 (-D*)
5608                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5609
5610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5611                                 && test -z "${cf_tst_cflags}" \
5612                                 && cf_fix_cppflags=yes
5613
5614                         if test "$cf_fix_cppflags" = yes ; then
5615
5616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5618
5619                                 continue
5620                         elif test "${cf_tst_cflags}" = "\"'" ; then
5621
5622         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5623         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5624
5625                                 continue
5626                         fi
5627                         ;;
5628                 esac
5629                 case "$CPPFLAGS" in
5630                 (*$cf_add_cflags)
5631                         ;;
5632                 (*)
5633                         case "$cf_add_cflags" in
5634                         (-D*)
5635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5636
5637 CPPFLAGS=`echo "$CPPFLAGS" | \
5638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5640
5641                                 ;;
5642                         esac
5643
5644         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5645         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5646
5647                         ;;
5648                 esac
5649                 ;;
5650         (*)
5651
5652         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5653         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5654
5655                 ;;
5656         esac
5657         ;;
5658 (yes)
5659
5660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5662
5663         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5664
5665         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5666                 && test -z "${cf_tst_cflags}" \
5667                 && cf_fix_cppflags=no
5668         ;;
5669 esac
5670 done
5671
5672 if test -n "$cf_new_cflags" ; then
5673
5674         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5675         CFLAGS="${CFLAGS}$cf_new_cflags"
5676
5677 fi
5678
5679 if test -n "$cf_new_cppflags" ; then
5680
5681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5682         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5683
5684 fi
5685
5686 if test -n "$cf_new_extra_cppflags" ; then
5687
5688         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5689         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5690
5691 fi
5692
5693 done
5694
5695 cf_add_libs="$LIBS"
5696 # reverse order
5697 cf_add_0lib=
5698 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5699 # filter duplicates
5700 for cf_add_1lib in $cf_add_0lib; do
5701         for cf_add_2lib in $cf_add_libs; do
5702                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5703                         cf_add_1lib=
5704                         break
5705                 fi
5706         done
5707         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5708 done
5709 LIBS="$cf_add_libs"
5710
5711                 # even with config script, some packages use no-override for curses.h
5712
5713 echo "$as_me:5713: checking if we have identified curses headers" >&5
5714 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5715 if test "${cf_cv_ncurses_header+set}" = set; then
5716   echo $ECHO_N "(cached) $ECHO_C" >&6
5717 else
5718
5719 cf_cv_ncurses_header=none
5720 for cf_header in \
5721         ncurses.h ncurses/ncurses.h \
5722         curses.h ncurses/curses.h
5723 do
5724 cat >"conftest.$ac_ext" <<_ACEOF
5725 #line 5725 "configure"
5726 #include "confdefs.h"
5727 #include <${cf_header}>
5728 int
5729 main (void)
5730 {
5731 initscr(); endwin()
5732   ;
5733   return 0;
5734 }
5735 _ACEOF
5736 rm -f "conftest.$ac_objext"
5737 if { (eval echo "$as_me:5737: \"$ac_compile\"") >&5
5738   (eval $ac_compile) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit "$ac_status"); } &&
5742          { ac_try='test -s "conftest.$ac_objext"'
5743   { (eval echo "$as_me:5743: \"$ac_try\"") >&5
5744   (eval $ac_try) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit "$ac_status"); }; }; then
5748   cf_cv_ncurses_header=$cf_header; break
5749 else
5750   echo "$as_me: failed program was:" >&5
5751 cat "conftest.$ac_ext" >&5
5752 fi
5753 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5754 done
5755
5756 fi
5757 echo "$as_me:5757: result: $cf_cv_ncurses_header" >&5
5758 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5759
5760 if test "$cf_cv_ncurses_header" = none ; then
5761         { { echo "$as_me:5761: error: No curses header-files found" >&5
5762 echo "$as_me: error: No curses header-files found" >&2;}
5763    { (exit 1); exit 1; }; }
5764 fi
5765
5766 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5767
5768 for ac_header in $cf_cv_ncurses_header
5769 do
5770 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5771 echo "$as_me:5771: checking for $ac_header" >&5
5772 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5773 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5774   echo $ECHO_N "(cached) $ECHO_C" >&6
5775 else
5776   cat >"conftest.$ac_ext" <<_ACEOF
5777 #line 5777 "configure"
5778 #include "confdefs.h"
5779 #include <$ac_header>
5780 _ACEOF
5781 if { (eval echo "$as_me:5781: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5782   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5783   ac_status=$?
5784   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5785   rm -f conftest.er1
5786   cat conftest.err >&5
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit "$ac_status"); } >/dev/null; then
5789   if test -s conftest.err; then
5790     ac_cpp_err=$ac_c_preproc_warn_flag
5791   else
5792     ac_cpp_err=
5793   fi
5794 else
5795   ac_cpp_err=yes
5796 fi
5797 if test -z "$ac_cpp_err"; then
5798   eval "$as_ac_Header=yes"
5799 else
5800   echo "$as_me: failed program was:" >&5
5801   cat "conftest.$ac_ext" >&5
5802   eval "$as_ac_Header=no"
5803 fi
5804 rm -f conftest.err "conftest.$ac_ext"
5805 fi
5806 echo "$as_me:5806: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5807 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5808 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5809   cat >>confdefs.h <<EOF
5810 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5811 EOF
5812
5813 fi
5814 done
5815
5816 cat >>confdefs.h <<\EOF
5817 #define NCURSES 1
5818 EOF
5819
5820 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5821
5822                 cat >>confdefs.h <<EOF
5823 #define $cf_nculib_ROOT 1
5824 EOF
5825
5826                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5827
5828         else
5829
5830 cf_ncuhdr_root=ncurses
5831
5832 test -n "$cf_cv_curses_dir" && \
5833 test "$cf_cv_curses_dir" != "no" && { \
5834
5835 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5836   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5837   do
5838         while test "$cf_add_incdir" != /usr/include
5839         do
5840           if test -d "$cf_add_incdir"
5841           then
5842                 cf_have_incdir=no
5843                 if test -n "$CFLAGS$CPPFLAGS" ; then
5844                   # a loop is needed to ensure we can add subdirs of existing dirs
5845                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5846                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5847                           cf_have_incdir=yes; break
5848                         fi
5849                   done
5850                 fi
5851
5852                 if test "$cf_have_incdir" = no ; then
5853                   if test "$cf_add_incdir" = /usr/local/include ; then
5854                         if test "$GCC" = yes
5855                         then
5856                           cf_save_CPPFLAGS=$CPPFLAGS
5857
5858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5859         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5860
5861                           cat >"conftest.$ac_ext" <<_ACEOF
5862 #line 5862 "configure"
5863 #include "confdefs.h"
5864 #include <stdio.h>
5865 int
5866 main (void)
5867 {
5868 printf("Hello")
5869   ;
5870   return 0;
5871 }
5872 _ACEOF
5873 rm -f "conftest.$ac_objext"
5874 if { (eval echo "$as_me:5874: \"$ac_compile\"") >&5
5875   (eval $ac_compile) 2>&5
5876   ac_status=$?
5877   echo "$as_me:5877: \$? = $ac_status" >&5
5878   (exit "$ac_status"); } &&
5879          { ac_try='test -s "conftest.$ac_objext"'
5880   { (eval echo "$as_me:5880: \"$ac_try\"") >&5
5881   (eval $ac_try) 2>&5
5882   ac_status=$?
5883   echo "$as_me:5883: \$? = $ac_status" >&5
5884   (exit "$ac_status"); }; }; then
5885   :
5886 else
5887   echo "$as_me: failed program was:" >&5
5888 cat "conftest.$ac_ext" >&5
5889 cf_have_incdir=yes
5890 fi
5891 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5892                           CPPFLAGS=$cf_save_CPPFLAGS
5893                         fi
5894                   fi
5895                 fi
5896
5897                 if test "$cf_have_incdir" = no ; then
5898                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5899
5900 echo "${as_me:-configure}:5900: testing adding $cf_add_incdir to include-path ..." 1>&5
5901
5902                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5903
5904                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5905                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5906                   cf_add_incdir="$cf_top_incdir"
5907                 else
5908                   break
5909                 fi
5910           else
5911                 break
5912           fi
5913         done
5914   done
5915 fi
5916
5917 }
5918
5919 echo "$as_me:5919: checking for $cf_ncuhdr_root header in include-path" >&5
5920 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5921 if test "${cf_cv_ncurses_h+set}" = set; then
5922   echo $ECHO_N "(cached) $ECHO_C" >&6
5923 else
5924
5925         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5926         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5927         for cf_header in $cf_header_list
5928         do
5929
5930         cat >"conftest.$ac_ext" <<_ACEOF
5931 #line 5931 "configure"
5932 #include "confdefs.h"
5933
5934 #include <$cf_header>
5935 int
5936 main (void)
5937 {
5938
5939 #ifdef NCURSES_VERSION
5940
5941 printf("%s\\n", NCURSES_VERSION);
5942 #else
5943 #ifdef __NCURSES_H
5944 printf("old\\n");
5945 #else
5946         #error __NCURSES_H is not defined
5947 #endif
5948 #endif
5949
5950   ;
5951   return 0;
5952 }
5953 _ACEOF
5954 rm -f "conftest.$ac_objext"
5955 if { (eval echo "$as_me:5955: \"$ac_compile\"") >&5
5956   (eval $ac_compile) 2>&5
5957   ac_status=$?
5958   echo "$as_me:5958: \$? = $ac_status" >&5
5959   (exit "$ac_status"); } &&
5960          { ac_try='test -s "conftest.$ac_objext"'
5961   { (eval echo "$as_me:5961: \"$ac_try\"") >&5
5962   (eval $ac_try) 2>&5
5963   ac_status=$?
5964   echo "$as_me:5964: \$? = $ac_status" >&5
5965   (exit "$ac_status"); }; }; then
5966   cf_cv_ncurses_h=$cf_header
5967
5968 else
5969   echo "$as_me: failed program was:" >&5
5970 cat "conftest.$ac_ext" >&5
5971 cf_cv_ncurses_h=no
5972 fi
5973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5974
5975                 test "$cf_cv_ncurses_h" != no && break
5976         done
5977
5978 fi
5979 echo "$as_me:5979: result: $cf_cv_ncurses_h" >&5
5980 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5981
5982 if test "$cf_cv_ncurses_h" != no ; then
5983         cf_cv_ncurses_header=$cf_cv_ncurses_h
5984 else
5985
5986 echo "$as_me:5986: checking for $cf_ncuhdr_root include-path" >&5
5987 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5988 if test "${cf_cv_ncurses_h2+set}" = set; then
5989   echo $ECHO_N "(cached) $ECHO_C" >&6
5990 else
5991
5992         test -n "$verbose" && echo
5993
5994 cf_search=
5995
5996 # collect the current set of include-directories from compiler flags
5997 cf_header_path_list=""
5998 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5999         for cf_header_path in $CPPFLAGS $CFLAGS
6000         do
6001                 case "$cf_header_path" in
6002                 (-I*)
6003                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6004
6005 test "x$cf_header_path" != "xNONE" && \
6006 test -d "$cf_header_path" && \
6007  {
6008         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6009         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6010         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6011         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6012         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6013         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"
6014 }
6015
6016                         cf_header_path_list="$cf_header_path_list $cf_search"
6017                         ;;
6018                 esac
6019         done
6020 fi
6021
6022 # add the variations for the package we are looking for
6023
6024 cf_search=
6025
6026 test "x$prefix" != "xNONE" && \
6027 test -d "$prefix" && \
6028  {
6029         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6030         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6031         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6032         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6033         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6034         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6035 }
6036
6037 for cf_subdir_prefix in \
6038         /usr \
6039         /usr/local \
6040         /usr/pkg \
6041         /opt \
6042         /opt/local \
6043         $HOME
6044 do
6045
6046 test "x$cf_subdir_prefix" != "x$prefix" && \
6047 test -d "$cf_subdir_prefix" && \
6048 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6049         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6050         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6051         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6052         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6053         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6054         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"
6055 }
6056
6057 done
6058
6059 test "$includedir" != NONE && \
6060 test "$includedir" != "/usr/include" && \
6061 test -d "$includedir" && {
6062         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6063         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6064 }
6065
6066 test "$oldincludedir" != NONE && \
6067 test "$oldincludedir" != "/usr/include" && \
6068 test -d "$oldincludedir" && {
6069         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6070         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6071 }
6072
6073 cf_search="$cf_search $cf_header_path_list"
6074
6075         test -n "$verbose" && echo "search path $cf_search"
6076         cf_save2_CPPFLAGS="$CPPFLAGS"
6077         for cf_incdir in $cf_search
6078         do
6079
6080 if test -n "$cf_incdir" ; then
6081   for cf_add_incdir in $cf_incdir
6082   do
6083         while test "$cf_add_incdir" != /usr/include
6084         do
6085           if test -d "$cf_add_incdir"
6086           then
6087                 cf_have_incdir=no
6088                 if test -n "$CFLAGS$CPPFLAGS" ; then
6089                   # a loop is needed to ensure we can add subdirs of existing dirs
6090                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6091                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6092                           cf_have_incdir=yes; break
6093                         fi
6094                   done
6095                 fi
6096
6097                 if test "$cf_have_incdir" = no ; then
6098                   if test "$cf_add_incdir" = /usr/local/include ; then
6099                         if test "$GCC" = yes
6100                         then
6101                           cf_save_CPPFLAGS=$CPPFLAGS
6102
6103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6104         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6105
6106                           cat >"conftest.$ac_ext" <<_ACEOF
6107 #line 6107 "configure"
6108 #include "confdefs.h"
6109 #include <stdio.h>
6110 int
6111 main (void)
6112 {
6113 printf("Hello")
6114   ;
6115   return 0;
6116 }
6117 _ACEOF
6118 rm -f "conftest.$ac_objext"
6119 if { (eval echo "$as_me:6119: \"$ac_compile\"") >&5
6120   (eval $ac_compile) 2>&5
6121   ac_status=$?
6122   echo "$as_me:6122: \$? = $ac_status" >&5
6123   (exit "$ac_status"); } &&
6124          { ac_try='test -s "conftest.$ac_objext"'
6125   { (eval echo "$as_me:6125: \"$ac_try\"") >&5
6126   (eval $ac_try) 2>&5
6127   ac_status=$?
6128   echo "$as_me:6128: \$? = $ac_status" >&5
6129   (exit "$ac_status"); }; }; then
6130   :
6131 else
6132   echo "$as_me: failed program was:" >&5
6133 cat "conftest.$ac_ext" >&5
6134 cf_have_incdir=yes
6135 fi
6136 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6137                           CPPFLAGS=$cf_save_CPPFLAGS
6138                         fi
6139                   fi
6140                 fi
6141
6142                 if test "$cf_have_incdir" = no ; then
6143                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6144
6145 echo "${as_me:-configure}:6145: testing adding $cf_add_incdir to include-path ..." 1>&5
6146
6147                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6148
6149                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6150                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6151                   cf_add_incdir="$cf_top_incdir"
6152                 else
6153                   break
6154                 fi
6155           else
6156                 break
6157           fi
6158         done
6159   done
6160 fi
6161
6162                 for cf_header in \
6163                         ncurses.h \
6164                         curses.h
6165                 do
6166
6167         cat >"conftest.$ac_ext" <<_ACEOF
6168 #line 6168 "configure"
6169 #include "confdefs.h"
6170
6171 #include <$cf_header>
6172 int
6173 main (void)
6174 {
6175
6176 #ifdef NCURSES_VERSION
6177
6178 printf("%s\\n", NCURSES_VERSION);
6179 #else
6180 #ifdef __NCURSES_H
6181 printf("old\\n");
6182 #else
6183         #error __NCURSES_H is not defined
6184 #endif
6185 #endif
6186
6187   ;
6188   return 0;
6189 }
6190 _ACEOF
6191 rm -f "conftest.$ac_objext"
6192 if { (eval echo "$as_me:6192: \"$ac_compile\"") >&5
6193   (eval $ac_compile) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit "$ac_status"); } &&
6197          { ac_try='test -s "conftest.$ac_objext"'
6198   { (eval echo "$as_me:6198: \"$ac_try\"") >&5
6199   (eval $ac_try) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit "$ac_status"); }; }; then
6203   cf_cv_ncurses_h2=$cf_header
6204
6205 else
6206   echo "$as_me: failed program was:" >&5
6207 cat "conftest.$ac_ext" >&5
6208 cf_cv_ncurses_h2=no
6209 fi
6210 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6211
6212                         if test "$cf_cv_ncurses_h2" != no ; then
6213                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6214                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
6215                                 break
6216                         fi
6217                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6218                 done
6219                 CPPFLAGS="$cf_save2_CPPFLAGS"
6220                 test "$cf_cv_ncurses_h2" != no && break
6221         done
6222         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6222: error: not found" >&5
6223 echo "$as_me: error: not found" >&2;}
6224    { (exit 1); exit 1; }; }
6225
6226 fi
6227 echo "$as_me:6227: result: $cf_cv_ncurses_h2" >&5
6228 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6229
6230         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
6231         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
6232         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
6233                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
6234         fi
6235
6236 if test -n "$cf_1st_incdir" ; then
6237   for cf_add_incdir in $cf_1st_incdir
6238   do
6239         while test "$cf_add_incdir" != /usr/include
6240         do
6241           if test -d "$cf_add_incdir"
6242           then
6243                 cf_have_incdir=no
6244                 if test -n "$CFLAGS$CPPFLAGS" ; then
6245                   # a loop is needed to ensure we can add subdirs of existing dirs
6246                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6247                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6248                           cf_have_incdir=yes; break
6249                         fi
6250                   done
6251                 fi
6252
6253                 if test "$cf_have_incdir" = no ; then
6254                   if test "$cf_add_incdir" = /usr/local/include ; then
6255                         if test "$GCC" = yes
6256                         then
6257                           cf_save_CPPFLAGS=$CPPFLAGS
6258
6259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6260         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6261
6262                           cat >"conftest.$ac_ext" <<_ACEOF
6263 #line 6263 "configure"
6264 #include "confdefs.h"
6265 #include <stdio.h>
6266 int
6267 main (void)
6268 {
6269 printf("Hello")
6270   ;
6271   return 0;
6272 }
6273 _ACEOF
6274 rm -f "conftest.$ac_objext"
6275 if { (eval echo "$as_me:6275: \"$ac_compile\"") >&5
6276   (eval $ac_compile) 2>&5
6277   ac_status=$?
6278   echo "$as_me:6278: \$? = $ac_status" >&5
6279   (exit "$ac_status"); } &&
6280          { ac_try='test -s "conftest.$ac_objext"'
6281   { (eval echo "$as_me:6281: \"$ac_try\"") >&5
6282   (eval $ac_try) 2>&5
6283   ac_status=$?
6284   echo "$as_me:6284: \$? = $ac_status" >&5
6285   (exit "$ac_status"); }; }; then
6286   :
6287 else
6288   echo "$as_me: failed program was:" >&5
6289 cat "conftest.$ac_ext" >&5
6290 cf_have_incdir=yes
6291 fi
6292 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6293                           CPPFLAGS=$cf_save_CPPFLAGS
6294                         fi
6295                   fi
6296                 fi
6297
6298                 if test "$cf_have_incdir" = no ; then
6299                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6300
6301 echo "${as_me:-configure}:6301: testing adding $cf_add_incdir to include-path ..." 1>&5
6302
6303                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6304
6305                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6306                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6307                   cf_add_incdir="$cf_top_incdir"
6308                 else
6309                   break
6310                 fi
6311           else
6312                 break
6313           fi
6314         done
6315   done
6316 fi
6317
6318 fi
6319
6320 # Set definitions to allow ifdef'ing for ncurses.h
6321
6322 case "$cf_cv_ncurses_header" in
6323 (*ncurses.h)
6324
6325 cat >>confdefs.h <<\EOF
6326 #define HAVE_NCURSES_H 1
6327 EOF
6328
6329         ;;
6330 esac
6331
6332 case "$cf_cv_ncurses_header" in
6333 (ncurses/curses.h|ncurses/ncurses.h)
6334
6335 cat >>confdefs.h <<\EOF
6336 #define HAVE_NCURSES_NCURSES_H 1
6337 EOF
6338
6339         ;;
6340 (ncursesw/curses.h|ncursesw/ncurses.h)
6341
6342 cat >>confdefs.h <<\EOF
6343 #define HAVE_NCURSESW_NCURSES_H 1
6344 EOF
6345
6346         ;;
6347 esac
6348
6349 echo "$as_me:6349: checking for terminfo header" >&5
6350 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6351 if test "${cf_cv_term_header+set}" = set; then
6352   echo $ECHO_N "(cached) $ECHO_C" >&6
6353 else
6354
6355 case "${cf_cv_ncurses_header}" in
6356 (*/ncurses.h|*/ncursesw.h)
6357         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6358         ;;
6359 (*)
6360         cf_term_header=term.h
6361         ;;
6362 esac
6363
6364 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6365 do
6366 cat >"conftest.$ac_ext" <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <stdio.h>
6370 #include <${cf_cv_ncurses_header:-curses.h}>
6371 #include <$cf_test>
6372
6373 int
6374 main (void)
6375 {
6376 int x = auto_left_margin; (void)x
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f "conftest.$ac_objext"
6382 if { (eval echo "$as_me:6382: \"$ac_compile\"") >&5
6383   (eval $ac_compile) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit "$ac_status"); } &&
6387          { ac_try='test -s "conftest.$ac_objext"'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit "$ac_status"); }; }; then
6393
6394         cf_cv_term_header="$cf_test"
6395 else
6396   echo "$as_me: failed program was:" >&5
6397 cat "conftest.$ac_ext" >&5
6398
6399         cf_cv_term_header=unknown
6400
6401 fi
6402 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6403         test "$cf_cv_term_header" != unknown && break
6404 done
6405
6406 fi
6407 echo "$as_me:6407: result: $cf_cv_term_header" >&5
6408 echo "${ECHO_T}$cf_cv_term_header" >&6
6409
6410 # Set definitions to allow ifdef'ing to accommodate subdirectories
6411
6412 case "$cf_cv_term_header" in
6413 (*term.h)
6414
6415 cat >>confdefs.h <<\EOF
6416 #define HAVE_TERM_H 1
6417 EOF
6418
6419         ;;
6420 esac
6421
6422 case "$cf_cv_term_header" in
6423 (ncurses/term.h)
6424
6425 cat >>confdefs.h <<\EOF
6426 #define HAVE_NCURSES_TERM_H 1
6427 EOF
6428
6429         ;;
6430 (ncursesw/term.h)
6431
6432 cat >>confdefs.h <<\EOF
6433 #define HAVE_NCURSESW_TERM_H 1
6434 EOF
6435
6436         ;;
6437 esac
6438
6439 # some applications need this, but should check for NCURSES_VERSION
6440
6441 cat >>confdefs.h <<\EOF
6442 #define NCURSES 1
6443 EOF
6444
6445 echo "$as_me:6445: checking for ncurses version" >&5
6446 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6447 if test "${cf_cv_ncurses_version+set}" = set; then
6448   echo $ECHO_N "(cached) $ECHO_C" >&6
6449 else
6450
6451         cf_cv_ncurses_version=no
6452         cf_tempfile=out$$
6453         rm -f "$cf_tempfile"
6454         if test "$cross_compiling" = yes; then
6455
6456         # This will not work if the preprocessor splits the line after the
6457         # Autoconf token.  The 'unproto' program does that.
6458         cat > "conftest.$ac_ext" <<EOF
6459 #include <${cf_cv_ncurses_header:-curses.h}>
6460 #undef Autoconf
6461 #ifdef NCURSES_VERSION
6462 Autoconf NCURSES_VERSION
6463 #else
6464 #ifdef __NCURSES_H
6465 Autoconf "old"
6466 #endif
6467 ;
6468 #endif
6469 EOF
6470         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6471         { (eval echo "$as_me:6471: \"$cf_try\"") >&5
6472   (eval $cf_try) 2>&5
6473   ac_status=$?
6474   echo "$as_me:6474: \$? = $ac_status" >&5
6475   (exit "$ac_status"); }
6476         if test -f conftest.out ; then
6477                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
6478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6479                 rm -f conftest.out
6480         fi
6481
6482 else
6483   cat >"conftest.$ac_ext" <<_ACEOF
6484 #line 6484 "configure"
6485 #include "confdefs.h"
6486
6487 $ac_includes_default
6488
6489 #include <${cf_cv_ncurses_header:-curses.h}>
6490
6491 int main(void)
6492 {
6493         FILE *fp = fopen("$cf_tempfile", "w");
6494 #ifdef NCURSES_VERSION
6495 # ifdef NCURSES_VERSION_PATCH
6496         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6497 # else
6498         fprintf(fp, "%s\\n", NCURSES_VERSION);
6499 # endif
6500 #else
6501 # ifdef __NCURSES_H
6502         fprintf(fp, "old\\n");
6503 # else
6504         #error expected ncurses header to define __NCURSES_H
6505 # endif
6506 #endif
6507         ${cf_cv_main_return:-return}(0);
6508 }
6509 _ACEOF
6510 rm -f "conftest$ac_exeext"
6511 if { (eval echo "$as_me:6511: \"$ac_link\"") >&5
6512   (eval $ac_link) 2>&5
6513   ac_status=$?
6514   echo "$as_me:6514: \$? = $ac_status" >&5
6515   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6516   { (eval echo "$as_me:6516: \"$ac_try\"") >&5
6517   (eval $ac_try) 2>&5
6518   ac_status=$?
6519   echo "$as_me:6519: \$? = $ac_status" >&5
6520   (exit "$ac_status"); }; }; then
6521
6522         cf_cv_ncurses_version=`cat $cf_tempfile`
6523 else
6524   echo "$as_me: program exited with status $ac_status" >&5
6525 echo "$as_me: failed program was:" >&5
6526 cat "conftest.$ac_ext" >&5
6527 fi
6528 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6529 fi
6530         rm -f "$cf_tempfile"
6531
6532 fi
6533 echo "$as_me:6533: result: $cf_cv_ncurses_version" >&5
6534 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6535 test "$cf_cv_ncurses_version" = no ||
6536 cat >>confdefs.h <<\EOF
6537 #define NCURSES 1
6538 EOF
6539
6540 cf_nculib_root=ncurses
6541         # This works, except for the special case where we find gpm, but
6542         # ncurses is in a nonstandard location via $LIBS, and we really want
6543         # to link gpm.
6544 cf_ncurses_LIBS=""
6545 cf_ncurses_SAVE="$LIBS"
6546 echo "$as_me:6546: checking for Gpm_Open in -lgpm" >&5
6547 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6548 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6549   echo $ECHO_N "(cached) $ECHO_C" >&6
6550 else
6551   ac_check_lib_save_LIBS=$LIBS
6552 LIBS="-lgpm  $LIBS"
6553 cat >"conftest.$ac_ext" <<_ACEOF
6554 #line 6554 "configure"
6555 #include "confdefs.h"
6556
6557 /* Override any gcc2 internal prototype to avoid an error.  */
6558 #ifdef __cplusplus
6559 extern "C"
6560 #endif
6561 /* We use char because int might match the return type of a gcc2
6562    builtin and then its argument prototype would still apply.  */
6563 char Gpm_Open (void);
6564 int
6565 main (void)
6566 {
6567 Gpm_Open ();
6568   ;
6569   return 0;
6570 }
6571 _ACEOF
6572 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6573 if { (eval echo "$as_me:6573: \"$ac_link\"") >&5
6574   (eval $ac_link) 2>&5
6575   ac_status=$?
6576   echo "$as_me:6576: \$? = $ac_status" >&5
6577   (exit "$ac_status"); } &&
6578          { ac_try='test -s "conftest$ac_exeext"'
6579   { (eval echo "$as_me:6579: \"$ac_try\"") >&5
6580   (eval $ac_try) 2>&5
6581   ac_status=$?
6582   echo "$as_me:6582: \$? = $ac_status" >&5
6583   (exit "$ac_status"); }; }; then
6584   ac_cv_lib_gpm_Gpm_Open=yes
6585 else
6586   echo "$as_me: failed program was:" >&5
6587 cat "conftest.$ac_ext" >&5
6588 ac_cv_lib_gpm_Gpm_Open=no
6589 fi
6590 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6591 LIBS=$ac_check_lib_save_LIBS
6592 fi
6593 echo "$as_me:6593: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6594 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6595 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6596   echo "$as_me:6596: checking for initscr in -lgpm" >&5
6597 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6598 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6599   echo $ECHO_N "(cached) $ECHO_C" >&6
6600 else
6601   ac_check_lib_save_LIBS=$LIBS
6602 LIBS="-lgpm  $LIBS"
6603 cat >"conftest.$ac_ext" <<_ACEOF
6604 #line 6604 "configure"
6605 #include "confdefs.h"
6606
6607 /* Override any gcc2 internal prototype to avoid an error.  */
6608 #ifdef __cplusplus
6609 extern "C"
6610 #endif
6611 /* We use char because int might match the return type of a gcc2
6612    builtin and then its argument prototype would still apply.  */
6613 char initscr (void);
6614 int
6615 main (void)
6616 {
6617 initscr ();
6618   ;
6619   return 0;
6620 }
6621 _ACEOF
6622 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6623 if { (eval echo "$as_me:6623: \"$ac_link\"") >&5
6624   (eval $ac_link) 2>&5
6625   ac_status=$?
6626   echo "$as_me:6626: \$? = $ac_status" >&5
6627   (exit "$ac_status"); } &&
6628          { ac_try='test -s "conftest$ac_exeext"'
6629   { (eval echo "$as_me:6629: \"$ac_try\"") >&5
6630   (eval $ac_try) 2>&5
6631   ac_status=$?
6632   echo "$as_me:6632: \$? = $ac_status" >&5
6633   (exit "$ac_status"); }; }; then
6634   ac_cv_lib_gpm_initscr=yes
6635 else
6636   echo "$as_me: failed program was:" >&5
6637 cat "conftest.$ac_ext" >&5
6638 ac_cv_lib_gpm_initscr=no
6639 fi
6640 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6641 LIBS=$ac_check_lib_save_LIBS
6642 fi
6643 echo "$as_me:6643: result: $ac_cv_lib_gpm_initscr" >&5
6644 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6645 if test "$ac_cv_lib_gpm_initscr" = yes; then
6646   LIBS="$cf_ncurses_SAVE"
6647 else
6648   cf_ncurses_LIBS="-lgpm"
6649 fi
6650
6651 fi
6652
6653 case "$host_os" in
6654 (freebsd*)
6655         # This is only necessary if you are linking against an obsolete
6656         # version of ncurses (but it should do no harm, since it is static).
6657         if test "$cf_nculib_root" = ncurses ; then
6658                 echo "$as_me:6658: checking for tgoto in -lmytinfo" >&5
6659 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6660 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6661   echo $ECHO_N "(cached) $ECHO_C" >&6
6662 else
6663   ac_check_lib_save_LIBS=$LIBS
6664 LIBS="-lmytinfo  $LIBS"
6665 cat >"conftest.$ac_ext" <<_ACEOF
6666 #line 6666 "configure"
6667 #include "confdefs.h"
6668
6669 /* Override any gcc2 internal prototype to avoid an error.  */
6670 #ifdef __cplusplus
6671 extern "C"
6672 #endif
6673 /* We use char because int might match the return type of a gcc2
6674    builtin and then its argument prototype would still apply.  */
6675 char tgoto (void);
6676 int
6677 main (void)
6678 {
6679 tgoto ();
6680   ;
6681   return 0;
6682 }
6683 _ACEOF
6684 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6685 if { (eval echo "$as_me:6685: \"$ac_link\"") >&5
6686   (eval $ac_link) 2>&5
6687   ac_status=$?
6688   echo "$as_me:6688: \$? = $ac_status" >&5
6689   (exit "$ac_status"); } &&
6690          { ac_try='test -s "conftest$ac_exeext"'
6691   { (eval echo "$as_me:6691: \"$ac_try\"") >&5
6692   (eval $ac_try) 2>&5
6693   ac_status=$?
6694   echo "$as_me:6694: \$? = $ac_status" >&5
6695   (exit "$ac_status"); }; }; then
6696   ac_cv_lib_mytinfo_tgoto=yes
6697 else
6698   echo "$as_me: failed program was:" >&5
6699 cat "conftest.$ac_ext" >&5
6700 ac_cv_lib_mytinfo_tgoto=no
6701 fi
6702 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6703 LIBS=$ac_check_lib_save_LIBS
6704 fi
6705 echo "$as_me:6705: result: $ac_cv_lib_mytinfo_tgoto" >&5
6706 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6707 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6708   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6709 fi
6710
6711         fi
6712         ;;
6713 esac
6714
6715 cf_add_libs="$LIBS"
6716 # reverse order
6717 cf_add_0lib=
6718 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6719 # filter duplicates
6720 for cf_add_1lib in $cf_add_0lib; do
6721         for cf_add_2lib in $cf_add_libs; do
6722                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6723                         cf_add_1lib=
6724                         break
6725                 fi
6726         done
6727         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6728 done
6729 LIBS="$cf_add_libs"
6730
6731 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6732 then
6733
6734 cf_add_libs="$LIBS"
6735 # reverse order
6736 cf_add_0lib=
6737 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6738 # filter duplicates
6739 for cf_add_1lib in $cf_add_0lib; do
6740         for cf_add_2lib in $cf_add_libs; do
6741                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6742                         cf_add_1lib=
6743                         break
6744                 fi
6745         done
6746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6747 done
6748 LIBS="$cf_add_libs"
6749
6750 else
6751
6752         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6753         cf_libdir=""
6754         echo "$as_me:6754: checking for initscr" >&5
6755 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6756 if test "${ac_cv_func_initscr+set}" = set; then
6757   echo $ECHO_N "(cached) $ECHO_C" >&6
6758 else
6759   cat >"conftest.$ac_ext" <<_ACEOF
6760 #line 6760 "configure"
6761 #include "confdefs.h"
6762 #define initscr autoconf_temporary
6763 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6764 #undef initscr
6765
6766 #ifdef __cplusplus
6767 extern "C"
6768 #endif
6769
6770 /* We use char because int might match the return type of a gcc2
6771    builtin and then its argument prototype would still apply.  */
6772 char initscr (void);
6773
6774 int
6775 main (void)
6776 {
6777
6778 /* The GNU C library defines stubs for functions which it implements
6779     to always fail with ENOSYS.  Some functions are actually named
6780     something starting with __ and the normal name is an alias.  */
6781 #if defined (__stub_initscr) || defined (__stub___initscr)
6782 #error found stub for initscr
6783 #endif
6784
6785         return initscr ();
6786   ;
6787   return 0;
6788 }
6789 _ACEOF
6790 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6791 if { (eval echo "$as_me:6791: \"$ac_link\"") >&5
6792   (eval $ac_link) 2>&5
6793   ac_status=$?
6794   echo "$as_me:6794: \$? = $ac_status" >&5
6795   (exit "$ac_status"); } &&
6796          { ac_try='test -s "conftest$ac_exeext"'
6797   { (eval echo "$as_me:6797: \"$ac_try\"") >&5
6798   (eval $ac_try) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit "$ac_status"); }; }; then
6802   ac_cv_func_initscr=yes
6803 else
6804   echo "$as_me: failed program was:" >&5
6805 cat "conftest.$ac_ext" >&5
6806 ac_cv_func_initscr=no
6807 fi
6808 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6809 fi
6810 echo "$as_me:6810: result: $ac_cv_func_initscr" >&5
6811 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6812 if test "$ac_cv_func_initscr" = yes; then
6813   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6814 else
6815
6816                 cf_save_LIBS="$LIBS"
6817                 echo "$as_me:6817: checking for initscr in -l$cf_nculib_root" >&5
6818 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6819                 LIBS="-l$cf_nculib_root $LIBS"
6820                 cat >"conftest.$ac_ext" <<_ACEOF
6821 #line 6821 "configure"
6822 #include "confdefs.h"
6823 #include <${cf_cv_ncurses_header:-curses.h}>
6824 int
6825 main (void)
6826 {
6827 initscr()
6828   ;
6829   return 0;
6830 }
6831 _ACEOF
6832 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6833 if { (eval echo "$as_me:6833: \"$ac_link\"") >&5
6834   (eval $ac_link) 2>&5
6835   ac_status=$?
6836   echo "$as_me:6836: \$? = $ac_status" >&5
6837   (exit "$ac_status"); } &&
6838          { ac_try='test -s "conftest$ac_exeext"'
6839   { (eval echo "$as_me:6839: \"$ac_try\"") >&5
6840   (eval $ac_try) 2>&5
6841   ac_status=$?
6842   echo "$as_me:6842: \$? = $ac_status" >&5
6843   (exit "$ac_status"); }; }; then
6844   echo "$as_me:6844: result: yes" >&5
6845 echo "${ECHO_T}yes" >&6
6846                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6847
6848 else
6849   echo "$as_me: failed program was:" >&5
6850 cat "conftest.$ac_ext" >&5
6851 echo "$as_me:6851: result: no" >&5
6852 echo "${ECHO_T}no" >&6
6853
6854 cf_search=
6855 cf_library_path_list=""
6856 if test -n "${LDFLAGS}${LIBS}" ; then
6857         for cf_library_path in $LDFLAGS $LIBS
6858         do
6859                 case "$cf_library_path" in
6860                 (-L*)
6861                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6862
6863 test "x$cf_library_path" != "xNONE" && \
6864 test -d "$cf_library_path" && \
6865  {
6866         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6867         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6868         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6869         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6870         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6871         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"
6872 }
6873
6874                         cf_library_path_list="$cf_library_path_list $cf_search"
6875                         ;;
6876                 esac
6877         done
6878 fi
6879
6880 cf_search=
6881
6882 test "x$prefix" != "xNONE" && \
6883 test -d "$prefix" && \
6884  {
6885         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6886         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6887         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6888         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6889         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6890         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6891 }
6892
6893 for cf_subdir_prefix in \
6894         /usr \
6895         /usr/local \
6896         /usr/pkg \
6897         /opt \
6898         /opt/local \
6899         $HOME
6900 do
6901
6902 test "x$cf_subdir_prefix" != "x$prefix" && \
6903 test -d "$cf_subdir_prefix" && \
6904 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6905         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6906         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6907         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6908         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6909         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6910         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"
6911 }
6912
6913 done
6914
6915 cf_search="$cf_library_path_list $cf_search"
6916
6917                         for cf_libdir in $cf_search
6918                         do
6919                                 echo "$as_me:6919: checking for -l$cf_nculib_root in $cf_libdir" >&5
6920 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6921                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6922                                 cat >"conftest.$ac_ext" <<_ACEOF
6923 #line 6923 "configure"
6924 #include "confdefs.h"
6925 #include <${cf_cv_ncurses_header:-curses.h}>
6926 int
6927 main (void)
6928 {
6929 initscr()
6930   ;
6931   return 0;
6932 }
6933 _ACEOF
6934 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6935 if { (eval echo "$as_me:6935: \"$ac_link\"") >&5
6936   (eval $ac_link) 2>&5
6937   ac_status=$?
6938   echo "$as_me:6938: \$? = $ac_status" >&5
6939   (exit "$ac_status"); } &&
6940          { ac_try='test -s "conftest$ac_exeext"'
6941   { (eval echo "$as_me:6941: \"$ac_try\"") >&5
6942   (eval $ac_try) 2>&5
6943   ac_status=$?
6944   echo "$as_me:6944: \$? = $ac_status" >&5
6945   (exit "$ac_status"); }; }; then
6946   echo "$as_me:6946: result: yes" >&5
6947 echo "${ECHO_T}yes" >&6
6948                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6949                                          break
6950 else
6951   echo "$as_me: failed program was:" >&5
6952 cat "conftest.$ac_ext" >&5
6953 echo "$as_me:6953: result: no" >&5
6954 echo "${ECHO_T}no" >&6
6955                                          LIBS="$cf_save_LIBS"
6956 fi
6957 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6958                         done
6959
6960 fi
6961 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6962
6963 fi
6964
6965 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6966
6967 if test "$cf_found_library" = no ; then
6968         { { echo "$as_me:6968: error: Cannot link $cf_nculib_root library" >&5
6969 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6970    { (exit 1); exit 1; }; }
6971 fi
6972
6973 fi
6974
6975 if test -n "$cf_ncurses_LIBS" ; then
6976         echo "$as_me:6976: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6977 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6978         cf_ncurses_SAVE="$LIBS"
6979         for p in $cf_ncurses_LIBS ; do
6980                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6981                 if test "$q" != "$LIBS" ; then
6982                         LIBS="$q"
6983                 fi
6984         done
6985         cat >"conftest.$ac_ext" <<_ACEOF
6986 #line 6986 "configure"
6987 #include "confdefs.h"
6988 #include <${cf_cv_ncurses_header:-curses.h}>
6989 int
6990 main (void)
6991 {
6992 initscr(); mousemask(0,0); tigetstr((char *)0);
6993   ;
6994   return 0;
6995 }
6996 _ACEOF
6997 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6998 if { (eval echo "$as_me:6998: \"$ac_link\"") >&5
6999   (eval $ac_link) 2>&5
7000   ac_status=$?
7001   echo "$as_me:7001: \$? = $ac_status" >&5
7002   (exit "$ac_status"); } &&
7003          { ac_try='test -s "conftest$ac_exeext"'
7004   { (eval echo "$as_me:7004: \"$ac_try\"") >&5
7005   (eval $ac_try) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit "$ac_status"); }; }; then
7009   echo "$as_me:7009: result: yes" >&5
7010 echo "${ECHO_T}yes" >&6
7011 else
7012   echo "$as_me: failed program was:" >&5
7013 cat "conftest.$ac_ext" >&5
7014 echo "$as_me:7014: result: no" >&5
7015 echo "${ECHO_T}no" >&6
7016                  LIBS="$cf_ncurses_SAVE"
7017 fi
7018 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7019 fi
7020
7021 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7022
7023 cat >>confdefs.h <<EOF
7024 #define $cf_nculib_ROOT 1
7025 EOF
7026
7027         fi
7028 else
7029         NCURSES_CONFIG=none
7030 fi
7031
7032 echo "$as_me:7032: checking for specified curses library type" >&5
7033 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
7034
7035 # Check whether --with-screen or --without-screen was given.
7036 if test "${with_screen+set}" = set; then
7037   withval="$with_screen"
7038   cf_cv_screen=$withval
7039 else
7040   cf_cv_screen=ncurses
7041 fi;
7042
7043 case $cf_cv_screen in
7044 (curses|curses_*)
7045         CF_CURSES_CONFIG
7046         ;;
7047 (ncursesw*)
7048
7049 for ac_header in wchar.h
7050 do
7051 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7052 echo "$as_me:7052: checking for $ac_header" >&5
7053 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7054 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7055   echo $ECHO_N "(cached) $ECHO_C" >&6
7056 else
7057   cat >"conftest.$ac_ext" <<_ACEOF
7058 #line 7058 "configure"
7059 #include "confdefs.h"
7060 #include <$ac_header>
7061 _ACEOF
7062 if { (eval echo "$as_me:7062: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7063   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7064   ac_status=$?
7065   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7066   rm -f conftest.er1
7067   cat conftest.err >&5
7068   echo "$as_me:7068: \$? = $ac_status" >&5
7069   (exit "$ac_status"); } >/dev/null; then
7070   if test -s conftest.err; then
7071     ac_cpp_err=$ac_c_preproc_warn_flag
7072   else
7073     ac_cpp_err=
7074   fi
7075 else
7076   ac_cpp_err=yes
7077 fi
7078 if test -z "$ac_cpp_err"; then
7079   eval "$as_ac_Header=yes"
7080 else
7081   echo "$as_me: failed program was:" >&5
7082   cat "conftest.$ac_ext" >&5
7083   eval "$as_ac_Header=no"
7084 fi
7085 rm -f conftest.err "conftest.$ac_ext"
7086 fi
7087 echo "$as_me:7087: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7088 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7089 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7090   cat >>confdefs.h <<EOF
7091 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7092 EOF
7093
7094 fi
7095 done
7096
7097 echo "$as_me:7097: checking for multibyte character support" >&5
7098 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7099 if test "${cf_cv_utf8_lib+set}" = set; then
7100   echo $ECHO_N "(cached) $ECHO_C" >&6
7101 else
7102
7103         cf_save_LIBS="$LIBS"
7104         cat >"conftest.$ac_ext" <<_ACEOF
7105 #line 7105 "configure"
7106 #include "confdefs.h"
7107
7108 $ac_includes_default
7109 #ifdef HAVE_WCHAR_H
7110 #include <wchar.h>
7111 #endif
7112
7113 int
7114 main (void)
7115 {
7116 putwc(0,0);
7117   ;
7118   return 0;
7119 }
7120 _ACEOF
7121 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7122 if { (eval echo "$as_me:7122: \"$ac_link\"") >&5
7123   (eval $ac_link) 2>&5
7124   ac_status=$?
7125   echo "$as_me:7125: \$? = $ac_status" >&5
7126   (exit "$ac_status"); } &&
7127          { ac_try='test -s "conftest$ac_exeext"'
7128   { (eval echo "$as_me:7128: \"$ac_try\"") >&5
7129   (eval $ac_try) 2>&5
7130   ac_status=$?
7131   echo "$as_me:7131: \$? = $ac_status" >&5
7132   (exit "$ac_status"); }; }; then
7133   cf_cv_utf8_lib=yes
7134 else
7135   echo "$as_me: failed program was:" >&5
7136 cat "conftest.$ac_ext" >&5
7137
7138 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7139 # will be set on completion of the AC_TRY_LINK below.
7140 cf_cv_header_path_utf8=
7141 cf_cv_library_path_utf8=
7142
7143 echo "${as_me:-configure}:7143: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7144
7145 cf_save_LIBS="$LIBS"
7146
7147 cat >"conftest.$ac_ext" <<_ACEOF
7148 #line 7148 "configure"
7149 #include "confdefs.h"
7150
7151 #include <libutf8.h>
7152 int
7153 main (void)
7154 {
7155 putwc(0,0);
7156   ;
7157   return 0;
7158 }
7159 _ACEOF
7160 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7161 if { (eval echo "$as_me:7161: \"$ac_link\"") >&5
7162   (eval $ac_link) 2>&5
7163   ac_status=$?
7164   echo "$as_me:7164: \$? = $ac_status" >&5
7165   (exit "$ac_status"); } &&
7166          { ac_try='test -s "conftest$ac_exeext"'
7167   { (eval echo "$as_me:7167: \"$ac_try\"") >&5
7168   (eval $ac_try) 2>&5
7169   ac_status=$?
7170   echo "$as_me:7170: \$? = $ac_status" >&5
7171   (exit "$ac_status"); }; }; then
7172
7173         cf_cv_find_linkage_utf8=yes
7174         cf_cv_header_path_utf8=/usr/include
7175         cf_cv_library_path_utf8=/usr/lib
7176
7177 else
7178   echo "$as_me: failed program was:" >&5
7179 cat "conftest.$ac_ext" >&5
7180
7181 LIBS="-lutf8  $cf_save_LIBS"
7182
7183 cat >"conftest.$ac_ext" <<_ACEOF
7184 #line 7184 "configure"
7185 #include "confdefs.h"
7186
7187 #include <libutf8.h>
7188 int
7189 main (void)
7190 {
7191 putwc(0,0);
7192   ;
7193   return 0;
7194 }
7195 _ACEOF
7196 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7197 if { (eval echo "$as_me:7197: \"$ac_link\"") >&5
7198   (eval $ac_link) 2>&5
7199   ac_status=$?
7200   echo "$as_me:7200: \$? = $ac_status" >&5
7201   (exit "$ac_status"); } &&
7202          { ac_try='test -s "conftest$ac_exeext"'
7203   { (eval echo "$as_me:7203: \"$ac_try\"") >&5
7204   (eval $ac_try) 2>&5
7205   ac_status=$?
7206   echo "$as_me:7206: \$? = $ac_status" >&5
7207   (exit "$ac_status"); }; }; then
7208
7209         cf_cv_find_linkage_utf8=yes
7210         cf_cv_header_path_utf8=/usr/include
7211         cf_cv_library_path_utf8=/usr/lib
7212         cf_cv_library_file_utf8="-lutf8"
7213
7214 else
7215   echo "$as_me: failed program was:" >&5
7216 cat "conftest.$ac_ext" >&5
7217
7218         cf_cv_find_linkage_utf8=no
7219         LIBS="$cf_save_LIBS"
7220
7221         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7222
7223 echo "${as_me:-configure}:7223: testing find linkage for utf8 library ..." 1>&5
7224
7225 echo "${as_me:-configure}:7225: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7226
7227         cf_save_CPPFLAGS="$CPPFLAGS"
7228         cf_test_CPPFLAGS="$CPPFLAGS"
7229
7230 cf_search=
7231
7232 # collect the current set of include-directories from compiler flags
7233 cf_header_path_list=""
7234 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7235         for cf_header_path in $CPPFLAGS $CFLAGS
7236         do
7237                 case "$cf_header_path" in
7238                 (-I*)
7239                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7240
7241 test "x$cf_header_path" != "xNONE" && \
7242 test -d "$cf_header_path" && \
7243  {
7244         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7245         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
7246         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
7247         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7248         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
7249         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7250 }
7251
7252                         cf_header_path_list="$cf_header_path_list $cf_search"
7253                         ;;
7254                 esac
7255         done
7256 fi
7257
7258 # add the variations for the package we are looking for
7259
7260 cf_search=
7261
7262 test "x$prefix" != "xNONE" && \
7263 test -d "$prefix" && \
7264  {
7265         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7266         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
7267         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
7268         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
7269         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
7270         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7271 }
7272
7273 for cf_subdir_prefix in \
7274         /usr \
7275         /usr/local \
7276         /usr/pkg \
7277         /opt \
7278         /opt/local \
7279         $HOME
7280 do
7281
7282 test "x$cf_subdir_prefix" != "x$prefix" && \
7283 test -d "$cf_subdir_prefix" && \
7284 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7285         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7286         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
7287         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7288         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7289         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7290         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7291 }
7292
7293 done
7294
7295 test "$includedir" != NONE && \
7296 test "$includedir" != "/usr/include" && \
7297 test -d "$includedir" && {
7298         test -d "$includedir" &&    cf_search="$cf_search $includedir"
7299         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
7300 }
7301
7302 test "$oldincludedir" != NONE && \
7303 test "$oldincludedir" != "/usr/include" && \
7304 test -d "$oldincludedir" && {
7305         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
7306         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
7307 }
7308
7309 cf_search="$cf_search $cf_header_path_list"
7310
7311         for cf_cv_header_path_utf8 in $cf_search
7312         do
7313                 if test -d "$cf_cv_header_path_utf8" ; then
7314                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7315
7316 echo "${as_me:-configure}:7316: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7317
7318                         CPPFLAGS="$cf_save_CPPFLAGS"
7319
7320         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7321         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7322
7323                         cat >"conftest.$ac_ext" <<_ACEOF
7324 #line 7324 "configure"
7325 #include "confdefs.h"
7326
7327 #include <libutf8.h>
7328 int
7329 main (void)
7330 {
7331 putwc(0,0);
7332   ;
7333   return 0;
7334 }
7335 _ACEOF
7336 rm -f "conftest.$ac_objext"
7337 if { (eval echo "$as_me:7337: \"$ac_compile\"") >&5
7338   (eval $ac_compile) 2>&5
7339   ac_status=$?
7340   echo "$as_me:7340: \$? = $ac_status" >&5
7341   (exit "$ac_status"); } &&
7342          { ac_try='test -s "conftest.$ac_objext"'
7343   { (eval echo "$as_me:7343: \"$ac_try\"") >&5
7344   (eval $ac_try) 2>&5
7345   ac_status=$?
7346   echo "$as_me:7346: \$? = $ac_status" >&5
7347   (exit "$ac_status"); }; }; then
7348
7349                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7350
7351 echo "${as_me:-configure}:7351: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7352
7353                                 cf_cv_find_linkage_utf8=maybe
7354                                 cf_test_CPPFLAGS="$CPPFLAGS"
7355                                 break
7356 else
7357   echo "$as_me: failed program was:" >&5
7358 cat "conftest.$ac_ext" >&5
7359
7360                                 CPPFLAGS="$cf_save_CPPFLAGS"
7361
7362 fi
7363 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7364                 fi
7365         done
7366
7367         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7368
7369 echo "${as_me:-configure}:7369: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7370
7371                 cf_save_LIBS="$LIBS"
7372                 cf_save_LDFLAGS="$LDFLAGS"
7373
7374                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7375
7376 cf_search=
7377 cf_library_path_list=""
7378 if test -n "${LDFLAGS}${LIBS}" ; then
7379         for cf_library_path in $LDFLAGS $LIBS
7380         do
7381                 case "$cf_library_path" in
7382                 (-L*)
7383                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7384
7385 test "x$cf_library_path" != "xNONE" && \
7386 test -d "$cf_library_path" && \
7387  {
7388         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7389         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
7390         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7391         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7392         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7393         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7394 }
7395
7396                         cf_library_path_list="$cf_library_path_list $cf_search"
7397                         ;;
7398                 esac
7399         done
7400 fi
7401
7402 cf_search=
7403
7404 test "x$prefix" != "xNONE" && \
7405 test -d "$prefix" && \
7406  {
7407         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7408         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
7409         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
7410         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7411         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
7412         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7413 }
7414
7415 for cf_subdir_prefix in \
7416         /usr \
7417         /usr/local \
7418         /usr/pkg \
7419         /opt \
7420         /opt/local \
7421         $HOME
7422 do
7423
7424 test "x$cf_subdir_prefix" != "x$prefix" && \
7425 test -d "$cf_subdir_prefix" && \
7426 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
7427         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7428         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7429         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7430         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7431         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7432         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7433 }
7434
7435 done
7436
7437 cf_search="$cf_library_path_list $cf_search"
7438
7439                         for cf_cv_library_path_utf8 in $cf_search
7440                         do
7441                                 if test -d "$cf_cv_library_path_utf8" ; then
7442                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7443
7444 echo "${as_me:-configure}:7444: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7445
7446                                         CPPFLAGS="$cf_test_CPPFLAGS"
7447                                         LIBS="-lutf8  $cf_save_LIBS"
7448                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7449                                         cat >"conftest.$ac_ext" <<_ACEOF
7450 #line 7450 "configure"
7451 #include "confdefs.h"
7452
7453 #include <libutf8.h>
7454 int
7455 main (void)
7456 {
7457 putwc(0,0);
7458   ;
7459   return 0;
7460 }
7461 _ACEOF
7462 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7463 if { (eval echo "$as_me:7463: \"$ac_link\"") >&5
7464   (eval $ac_link) 2>&5
7465   ac_status=$?
7466   echo "$as_me:7466: \$? = $ac_status" >&5
7467   (exit "$ac_status"); } &&
7468          { ac_try='test -s "conftest$ac_exeext"'
7469   { (eval echo "$as_me:7469: \"$ac_try\"") >&5
7470   (eval $ac_try) 2>&5
7471   ac_status=$?
7472   echo "$as_me:7472: \$? = $ac_status" >&5
7473   (exit "$ac_status"); }; }; then
7474
7475                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7476
7477 echo "${as_me:-configure}:7477: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7478
7479                                         cf_cv_find_linkage_utf8=yes
7480                                         cf_cv_library_file_utf8="-lutf8"
7481                                         break
7482 else
7483   echo "$as_me: failed program was:" >&5
7484 cat "conftest.$ac_ext" >&5
7485
7486                                         CPPFLAGS="$cf_save_CPPFLAGS"
7487                                         LIBS="$cf_save_LIBS"
7488                                         LDFLAGS="$cf_save_LDFLAGS"
7489
7490 fi
7491 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7492                                 fi
7493                         done
7494                         CPPFLAGS="$cf_save_CPPFLAGS"
7495                         LDFLAGS="$cf_save_LDFLAGS"
7496                 fi
7497
7498         else
7499                 cf_cv_find_linkage_utf8=no
7500         fi
7501
7502 fi
7503 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7504
7505 fi
7506 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7507
7508 LIBS="$cf_save_LIBS"
7509
7510 if test "$cf_cv_find_linkage_utf8" = yes ; then
7511 cf_cv_utf8_lib=add-on
7512 else
7513 cf_cv_utf8_lib=no
7514 fi
7515
7516 fi
7517 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7518 fi
7519 echo "$as_me:7519: result: $cf_cv_utf8_lib" >&5
7520 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7521
7522 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7523 # ncurses/ncursesw:
7524 if test "$cf_cv_utf8_lib" = "add-on" ; then
7525
7526 cat >>confdefs.h <<\EOF
7527 #define HAVE_LIBUTF8_H 1
7528 EOF
7529
7530 if test -n "$cf_cv_header_path_utf8" ; then
7531   for cf_add_incdir in $cf_cv_header_path_utf8
7532   do
7533         while test "$cf_add_incdir" != /usr/include
7534         do
7535           if test -d "$cf_add_incdir"
7536           then
7537                 cf_have_incdir=no
7538                 if test -n "$CFLAGS$CPPFLAGS" ; then
7539                   # a loop is needed to ensure we can add subdirs of existing dirs
7540                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7541                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7542                           cf_have_incdir=yes; break
7543                         fi
7544                   done
7545                 fi
7546
7547                 if test "$cf_have_incdir" = no ; then
7548                   if test "$cf_add_incdir" = /usr/local/include ; then
7549                         if test "$GCC" = yes
7550                         then
7551                           cf_save_CPPFLAGS=$CPPFLAGS
7552
7553         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7554         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7555
7556                           cat >"conftest.$ac_ext" <<_ACEOF
7557 #line 7557 "configure"
7558 #include "confdefs.h"
7559 #include <stdio.h>
7560 int
7561 main (void)
7562 {
7563 printf("Hello")
7564   ;
7565   return 0;
7566 }
7567 _ACEOF
7568 rm -f "conftest.$ac_objext"
7569 if { (eval echo "$as_me:7569: \"$ac_compile\"") >&5
7570   (eval $ac_compile) 2>&5
7571   ac_status=$?
7572   echo "$as_me:7572: \$? = $ac_status" >&5
7573   (exit "$ac_status"); } &&
7574          { ac_try='test -s "conftest.$ac_objext"'
7575   { (eval echo "$as_me:7575: \"$ac_try\"") >&5
7576   (eval $ac_try) 2>&5
7577   ac_status=$?
7578   echo "$as_me:7578: \$? = $ac_status" >&5
7579   (exit "$ac_status"); }; }; then
7580   :
7581 else
7582   echo "$as_me: failed program was:" >&5
7583 cat "conftest.$ac_ext" >&5
7584 cf_have_incdir=yes
7585 fi
7586 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7587                           CPPFLAGS=$cf_save_CPPFLAGS
7588                         fi
7589                   fi
7590                 fi
7591
7592                 if test "$cf_have_incdir" = no ; then
7593                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7594
7595 echo "${as_me:-configure}:7595: testing adding $cf_add_incdir to include-path ..." 1>&5
7596
7597                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7598
7599                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7600                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7601                   cf_add_incdir="$cf_top_incdir"
7602                 else
7603                   break
7604                 fi
7605           else
7606                 break
7607           fi
7608         done
7609   done
7610 fi
7611
7612 if test -n "$cf_cv_library_path_utf8" ; then
7613         for cf_add_libdir in $cf_cv_library_path_utf8
7614         do
7615                 if test "$cf_add_libdir" = /usr/lib ; then
7616                         :
7617                 elif test -d "$cf_add_libdir"
7618                 then
7619                         cf_have_libdir=no
7620                         if test -n "$LDFLAGS$LIBS" ; then
7621                                 # a loop is needed to ensure we can add subdirs of existing dirs
7622                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7623                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7624                                                 cf_have_libdir=yes; break
7625                                         fi
7626                                 done
7627                         fi
7628                         if test "$cf_have_libdir" = no ; then
7629                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7630
7631 echo "${as_me:-configure}:7631: testing adding $cf_add_libdir to library-path ..." 1>&5
7632
7633                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7634                         fi
7635                 fi
7636         done
7637 fi
7638
7639 cf_add_libs="$LIBS"
7640 # reverse order
7641 cf_add_0lib=
7642 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7643 # filter duplicates
7644 for cf_add_1lib in $cf_add_0lib; do
7645         for cf_add_2lib in $cf_add_libs; do
7646                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7647                         cf_add_1lib=
7648                         break
7649                 fi
7650         done
7651         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7652 done
7653 LIBS="$cf_add_libs"
7654
7655 fi
7656
7657 cf_ncuconfig_root=$cf_cv_screen
7658 cf_have_ncuconfig=no
7659
7660 if test "x${PKG_CONFIG:=none}" != xnone; then
7661         echo "$as_me:7661: checking pkg-config for $cf_ncuconfig_root" >&5
7662 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7663         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7664                 echo "$as_me:7664: result: yes" >&5
7665 echo "${ECHO_T}yes" >&6
7666
7667                 echo "$as_me:7667: checking if the $cf_ncuconfig_root package files work" >&5
7668 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7669                 cf_have_ncuconfig=unknown
7670
7671                 cf_save_CFLAGS="$CFLAGS"
7672                 cf_save_CPPFLAGS="$CPPFLAGS"
7673                 cf_save_LIBS="$LIBS"
7674
7675                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7676                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7677
7678                 # while -W for passing linker flags is prevalent, it is not "standard".
7679                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7680                 # incompatible _and_ non-standard -W option which gives an error.  Work
7681                 # around that pitfall.
7682                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7683                 (x*c[89]9@@*-W*)
7684
7685 cf_fix_cppflags=no
7686 cf_new_cflags=
7687 cf_new_cppflags=
7688 cf_new_extra_cppflags=
7689
7690 for cf_add_cflags in $cf_pkg_cflags
7691 do
7692 case "$cf_fix_cppflags" in
7693 (no)
7694         case "$cf_add_cflags" in
7695         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7696                 case "$cf_add_cflags" in
7697                 (-D*)
7698                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7699
7700                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7701                                 && test -z "${cf_tst_cflags}" \
7702                                 && cf_fix_cppflags=yes
7703
7704                         if test "$cf_fix_cppflags" = yes ; then
7705
7706         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7707         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7708
7709                                 continue
7710                         elif test "${cf_tst_cflags}" = "\"'" ; then
7711
7712         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7713         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7714
7715                                 continue
7716                         fi
7717                         ;;
7718                 esac
7719                 case "$CPPFLAGS" in
7720                 (*$cf_add_cflags)
7721                         ;;
7722                 (*)
7723                         case "$cf_add_cflags" in
7724                         (-D*)
7725                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7726
7727 CPPFLAGS=`echo "$CPPFLAGS" | \
7728         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7729                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7730
7731                                 ;;
7732                         esac
7733
7734         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7735         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7736
7737                         ;;
7738                 esac
7739                 ;;
7740         (*)
7741
7742         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7743         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7744
7745                 ;;
7746         esac
7747         ;;
7748 (yes)
7749
7750         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7751         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7752
7753         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7754
7755         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7756                 && test -z "${cf_tst_cflags}" \
7757                 && cf_fix_cppflags=no
7758         ;;
7759 esac
7760 done
7761
7762 if test -n "$cf_new_cflags" ; then
7763
7764         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7765         CFLAGS="${CFLAGS}$cf_new_cflags"
7766
7767 fi
7768
7769 if test -n "$cf_new_cppflags" ; then
7770
7771         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7772         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7773
7774 fi
7775
7776 if test -n "$cf_new_extra_cppflags" ; then
7777
7778         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7779         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7780
7781 fi
7782
7783 cf_add_libs="$LIBS"
7784 # reverse order
7785 cf_add_0lib=
7786 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7787 # filter duplicates
7788 for cf_add_1lib in $cf_add_0lib; do
7789         for cf_add_2lib in $cf_add_libs; do
7790                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7791                         cf_add_1lib=
7792                         break
7793                 fi
7794         done
7795         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7796 done
7797 LIBS="$cf_add_libs"
7798
7799                         cat >"conftest.$ac_ext" <<_ACEOF
7800 #line 7800 "configure"
7801 #include "confdefs.h"
7802 #include <${cf_cv_ncurses_header:-curses.h}>
7803 int
7804 main (void)
7805 {
7806 initscr(); mousemask(0,0); tigetstr((char *)0);
7807   ;
7808   return 0;
7809 }
7810 _ACEOF
7811 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7812 if { (eval echo "$as_me:7812: \"$ac_link\"") >&5
7813   (eval $ac_link) 2>&5
7814   ac_status=$?
7815   echo "$as_me:7815: \$? = $ac_status" >&5
7816   (exit "$ac_status"); } &&
7817          { ac_try='test -s "conftest$ac_exeext"'
7818   { (eval echo "$as_me:7818: \"$ac_try\"") >&5
7819   (eval $ac_try) 2>&5
7820   ac_status=$?
7821   echo "$as_me:7821: \$? = $ac_status" >&5
7822   (exit "$ac_status"); }; }; then
7823   if test "$cross_compiling" = yes; then
7824   cf_test_ncuconfig=maybe
7825 else
7826   cat >"conftest.$ac_ext" <<_ACEOF
7827 #line 7827 "configure"
7828 #include "confdefs.h"
7829 #include <${cf_cv_ncurses_header:-curses.h}>
7830                                         int main(void)
7831                                         { const char *xx = curses_version(); return (xx == 0); }
7832 _ACEOF
7833 rm -f "conftest$ac_exeext"
7834 if { (eval echo "$as_me:7834: \"$ac_link\"") >&5
7835   (eval $ac_link) 2>&5
7836   ac_status=$?
7837   echo "$as_me:7837: \$? = $ac_status" >&5
7838   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7839   { (eval echo "$as_me:7839: \"$ac_try\"") >&5
7840   (eval $ac_try) 2>&5
7841   ac_status=$?
7842   echo "$as_me:7842: \$? = $ac_status" >&5
7843   (exit "$ac_status"); }; }; then
7844   cf_test_ncuconfig=yes
7845 else
7846   echo "$as_me: program exited with status $ac_status" >&5
7847 echo "$as_me: failed program was:" >&5
7848 cat "conftest.$ac_ext" >&5
7849 cf_test_ncuconfig=no
7850 fi
7851 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7852 fi
7853 else
7854   echo "$as_me: failed program was:" >&5
7855 cat "conftest.$ac_ext" >&5
7856 cf_test_ncuconfig=no
7857 fi
7858 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7859
7860                         CFLAGS="$cf_save_CFLAGS"
7861                         CPPFLAGS="$cf_save_CPPFLAGS"
7862                         LIBS="$cf_save_LIBS"
7863
7864                         if test "x$cf_test_ncuconfig" != xyes; then
7865                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7866                                 cf_pkg_cflags="$cf_temp"
7867                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7868                                 cf_pkg_libs="$cf_temp"
7869                         fi
7870                         ;;
7871                 esac
7872
7873 for cf_add_cflags in $cf_pkg_cflags
7874 do
7875         case "x$cf_add_cflags" in
7876         (x-[DU]*)
7877
7878 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7879 while true
7880 do
7881         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7882         test "$CFLAGS" != "$cf_old_cflag" || break
7883
7884         CFLAGS="$cf_old_cflag"
7885 done
7886
7887 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7888 while true
7889 do
7890         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
7891         test "$CPPFLAGS" != "$cf_old_cflag" || break
7892
7893         CPPFLAGS="$cf_old_cflag"
7894 done
7895
7896                 ;;
7897         esac
7898
7899 cf_fix_cppflags=no
7900 cf_new_cflags=
7901 cf_new_cppflags=
7902 cf_new_extra_cppflags=
7903
7904 for cf_add_cflags in $cf_add_cflags
7905 do
7906 case "$cf_fix_cppflags" in
7907 (no)
7908         case "$cf_add_cflags" in
7909         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7910                 case "$cf_add_cflags" in
7911                 (-D*)
7912                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7913
7914                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7915                                 && test -z "${cf_tst_cflags}" \
7916                                 && cf_fix_cppflags=yes
7917
7918                         if test "$cf_fix_cppflags" = yes ; then
7919
7920         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7921         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7922
7923                                 continue
7924                         elif test "${cf_tst_cflags}" = "\"'" ; then
7925
7926         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7927         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7928
7929                                 continue
7930                         fi
7931                         ;;
7932                 esac
7933                 case "$CPPFLAGS" in
7934                 (*$cf_add_cflags)
7935                         ;;
7936                 (*)
7937                         case "$cf_add_cflags" in
7938                         (-D*)
7939                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7940
7941 CPPFLAGS=`echo "$CPPFLAGS" | \
7942         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7943                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7944
7945                                 ;;
7946                         esac
7947
7948         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7949         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7950
7951                         ;;
7952                 esac
7953                 ;;
7954         (*)
7955
7956         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7957         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7958
7959                 ;;
7960         esac
7961         ;;
7962 (yes)
7963
7964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7966
7967         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7968
7969         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7970                 && test -z "${cf_tst_cflags}" \
7971                 && cf_fix_cppflags=no
7972         ;;
7973 esac
7974 done
7975
7976 if test -n "$cf_new_cflags" ; then
7977
7978         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7979         CFLAGS="${CFLAGS}$cf_new_cflags"
7980
7981 fi
7982
7983 if test -n "$cf_new_cppflags" ; then
7984
7985         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7986         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7987
7988 fi
7989
7990 if test -n "$cf_new_extra_cppflags" ; then
7991
7992         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7993         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7994
7995 fi
7996
7997 done
7998
7999 cf_add_libs="$LIBS"
8000 # reverse order
8001 cf_add_0lib=
8002 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8003 # filter duplicates
8004 for cf_add_1lib in $cf_add_0lib; do
8005         for cf_add_2lib in $cf_add_libs; do
8006                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8007                         cf_add_1lib=
8008                         break
8009                 fi
8010         done
8011         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8012 done
8013 LIBS="$cf_add_libs"
8014
8015                 cat >"conftest.$ac_ext" <<_ACEOF
8016 #line 8016 "configure"
8017 #include "confdefs.h"
8018 #include <${cf_cv_ncurses_header:-curses.h}>
8019 int
8020 main (void)
8021 {
8022 initscr(); mousemask(0,0); tigetstr((char *)0);
8023   ;
8024   return 0;
8025 }
8026 _ACEOF
8027 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8028 if { (eval echo "$as_me:8028: \"$ac_link\"") >&5
8029   (eval $ac_link) 2>&5
8030   ac_status=$?
8031   echo "$as_me:8031: \$? = $ac_status" >&5
8032   (exit "$ac_status"); } &&
8033          { ac_try='test -s "conftest$ac_exeext"'
8034   { (eval echo "$as_me:8034: \"$ac_try\"") >&5
8035   (eval $ac_try) 2>&5
8036   ac_status=$?
8037   echo "$as_me:8037: \$? = $ac_status" >&5
8038   (exit "$ac_status"); }; }; then
8039   if test "$cross_compiling" = yes; then
8040   cf_have_ncuconfig=maybe
8041 else
8042   cat >"conftest.$ac_ext" <<_ACEOF
8043 #line 8043 "configure"
8044 #include "confdefs.h"
8045 #include <${cf_cv_ncurses_header:-curses.h}>
8046                                 int main(void)
8047                                 { const char *xx = curses_version(); return (xx == 0); }
8048 _ACEOF
8049 rm -f "conftest$ac_exeext"
8050 if { (eval echo "$as_me:8050: \"$ac_link\"") >&5
8051   (eval $ac_link) 2>&5
8052   ac_status=$?
8053   echo "$as_me:8053: \$? = $ac_status" >&5
8054   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8055   { (eval echo "$as_me:8055: \"$ac_try\"") >&5
8056   (eval $ac_try) 2>&5
8057   ac_status=$?
8058   echo "$as_me:8058: \$? = $ac_status" >&5
8059   (exit "$ac_status"); }; }; then
8060   cf_have_ncuconfig=yes
8061 else
8062   echo "$as_me: program exited with status $ac_status" >&5
8063 echo "$as_me: failed program was:" >&5
8064 cat "conftest.$ac_ext" >&5
8065 cf_have_ncuconfig=no
8066 fi
8067 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8068 fi
8069 else
8070   echo "$as_me: failed program was:" >&5
8071 cat "conftest.$ac_ext" >&5
8072 cf_have_ncuconfig=no
8073 fi
8074 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8075                 echo "$as_me:8075: result: $cf_have_ncuconfig" >&5
8076 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8077                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8078                 if test "$cf_have_ncuconfig" != "yes"
8079                 then
8080                         CPPFLAGS="$cf_save_CPPFLAGS"
8081                         LIBS="$cf_save_LIBS"
8082                         NCURSES_CONFIG_PKG=none
8083                 else
8084
8085 cat >>confdefs.h <<\EOF
8086 #define NCURSES 1
8087 EOF
8088
8089                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8090
8091 echo "$as_me:8091: checking for terminfo header" >&5
8092 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8093 if test "${cf_cv_term_header+set}" = set; then
8094   echo $ECHO_N "(cached) $ECHO_C" >&6
8095 else
8096
8097 case "${cf_cv_ncurses_header}" in
8098 (*/ncurses.h|*/ncursesw.h)
8099         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8100         ;;
8101 (*)
8102         cf_term_header=term.h
8103         ;;
8104 esac
8105
8106 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8107 do
8108 cat >"conftest.$ac_ext" <<_ACEOF
8109 #line 8109 "configure"
8110 #include "confdefs.h"
8111 #include <stdio.h>
8112 #include <${cf_cv_ncurses_header:-curses.h}>
8113 #include <$cf_test>
8114
8115 int
8116 main (void)
8117 {
8118 int x = auto_left_margin; (void)x
8119   ;
8120   return 0;
8121 }
8122 _ACEOF
8123 rm -f "conftest.$ac_objext"
8124 if { (eval echo "$as_me:8124: \"$ac_compile\"") >&5
8125   (eval $ac_compile) 2>&5
8126   ac_status=$?
8127   echo "$as_me:8127: \$? = $ac_status" >&5
8128   (exit "$ac_status"); } &&
8129          { ac_try='test -s "conftest.$ac_objext"'
8130   { (eval echo "$as_me:8130: \"$ac_try\"") >&5
8131   (eval $ac_try) 2>&5
8132   ac_status=$?
8133   echo "$as_me:8133: \$? = $ac_status" >&5
8134   (exit "$ac_status"); }; }; then
8135
8136         cf_cv_term_header="$cf_test"
8137 else
8138   echo "$as_me: failed program was:" >&5
8139 cat "conftest.$ac_ext" >&5
8140
8141         cf_cv_term_header=unknown
8142
8143 fi
8144 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8145         test "$cf_cv_term_header" != unknown && break
8146 done
8147
8148 fi
8149 echo "$as_me:8149: result: $cf_cv_term_header" >&5
8150 echo "${ECHO_T}$cf_cv_term_header" >&6
8151
8152 # Set definitions to allow ifdef'ing to accommodate subdirectories
8153
8154 case "$cf_cv_term_header" in
8155 (*term.h)
8156
8157 cat >>confdefs.h <<\EOF
8158 #define HAVE_TERM_H 1
8159 EOF
8160
8161         ;;
8162 esac
8163
8164 case "$cf_cv_term_header" in
8165 (ncurses/term.h)
8166
8167 cat >>confdefs.h <<\EOF
8168 #define HAVE_NCURSES_TERM_H 1
8169 EOF
8170
8171         ;;
8172 (ncursesw/term.h)
8173
8174 cat >>confdefs.h <<\EOF
8175 #define HAVE_NCURSESW_TERM_H 1
8176 EOF
8177
8178         ;;
8179 esac
8180
8181                 fi
8182
8183         else
8184                 echo "$as_me:8184: result: no" >&5
8185 echo "${ECHO_T}no" >&6
8186                 NCURSES_CONFIG_PKG=none
8187         fi
8188 else
8189         NCURSES_CONFIG_PKG=none
8190 fi
8191
8192 if test "x$cf_have_ncuconfig" = "xno"; then
8193         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8194
8195 if test -n "$ac_tool_prefix"; then
8196   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8197   do
8198     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8199 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8200 echo "$as_me:8200: checking for $ac_word" >&5
8201 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8202 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8203   echo $ECHO_N "(cached) $ECHO_C" >&6
8204 else
8205   if test -n "$NCURSES_CONFIG"; then
8206   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8207 else
8208   ac_save_IFS=$IFS; IFS=$ac_path_separator
8209 ac_dummy="$PATH"
8210 for ac_dir in $ac_dummy; do
8211   IFS=$ac_save_IFS
8212   test -z "$ac_dir" && ac_dir=.
8213   $as_executable_p "$ac_dir/$ac_word" || continue
8214 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8215 echo "$as_me:8215: found $ac_dir/$ac_word" >&5
8216 break
8217 done
8218
8219 fi
8220 fi
8221 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8222 if test -n "$NCURSES_CONFIG"; then
8223   echo "$as_me:8223: result: $NCURSES_CONFIG" >&5
8224 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8225 else
8226   echo "$as_me:8226: result: no" >&5
8227 echo "${ECHO_T}no" >&6
8228 fi
8229
8230     test -n "$NCURSES_CONFIG" && break
8231   done
8232 fi
8233 if test -z "$NCURSES_CONFIG"; then
8234   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8235   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8236 do
8237   # Extract the first word of "$ac_prog", so it can be a program name with args.
8238 set dummy $ac_prog; ac_word=$2
8239 echo "$as_me:8239: checking for $ac_word" >&5
8240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8241 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8242   echo $ECHO_N "(cached) $ECHO_C" >&6
8243 else
8244   if test -n "$ac_ct_NCURSES_CONFIG"; then
8245   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8246 else
8247   ac_save_IFS=$IFS; IFS=$ac_path_separator
8248 ac_dummy="$PATH"
8249 for ac_dir in $ac_dummy; do
8250   IFS=$ac_save_IFS
8251   test -z "$ac_dir" && ac_dir=.
8252   $as_executable_p "$ac_dir/$ac_word" || continue
8253 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8254 echo "$as_me:8254: found $ac_dir/$ac_word" >&5
8255 break
8256 done
8257
8258 fi
8259 fi
8260 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8261 if test -n "$ac_ct_NCURSES_CONFIG"; then
8262   echo "$as_me:8262: result: $ac_ct_NCURSES_CONFIG" >&5
8263 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8264 else
8265   echo "$as_me:8265: result: no" >&5
8266 echo "${ECHO_T}no" >&6
8267 fi
8268
8269   test -n "$ac_ct_NCURSES_CONFIG" && break
8270 done
8271 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8272
8273   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8274 fi
8275
8276         if test "$NCURSES_CONFIG" != none ; then
8277
8278 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8279 do
8280         case "x$cf_add_cflags" in
8281         (x-[DU]*)
8282
8283 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8284 while true
8285 do
8286         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8287         test "$CFLAGS" != "$cf_old_cflag" || break
8288
8289         CFLAGS="$cf_old_cflag"
8290 done
8291
8292 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
8293 while true
8294 do
8295         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
8296         test "$CPPFLAGS" != "$cf_old_cflag" || break
8297
8298         CPPFLAGS="$cf_old_cflag"
8299 done
8300
8301                 ;;
8302         esac
8303
8304 cf_fix_cppflags=no
8305 cf_new_cflags=
8306 cf_new_cppflags=
8307 cf_new_extra_cppflags=
8308
8309 for cf_add_cflags in $cf_add_cflags
8310 do
8311 case "$cf_fix_cppflags" in
8312 (no)
8313         case "$cf_add_cflags" in
8314         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8315                 case "$cf_add_cflags" in
8316                 (-D*)
8317                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8318
8319                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8320                                 && test -z "${cf_tst_cflags}" \
8321                                 && cf_fix_cppflags=yes
8322
8323                         if test "$cf_fix_cppflags" = yes ; then
8324
8325         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8326         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8327
8328                                 continue
8329                         elif test "${cf_tst_cflags}" = "\"'" ; then
8330
8331         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8332         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8333
8334                                 continue
8335                         fi
8336                         ;;
8337                 esac
8338                 case "$CPPFLAGS" in
8339                 (*$cf_add_cflags)
8340                         ;;
8341                 (*)
8342                         case "$cf_add_cflags" in
8343                         (-D*)
8344                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8345
8346 CPPFLAGS=`echo "$CPPFLAGS" | \
8347         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8348                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8349
8350                                 ;;
8351                         esac
8352
8353         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8354         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8355
8356                         ;;
8357                 esac
8358                 ;;
8359         (*)
8360
8361         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8362         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8363
8364                 ;;
8365         esac
8366         ;;
8367 (yes)
8368
8369         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8370         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8371
8372         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
8373
8374         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8375                 && test -z "${cf_tst_cflags}" \
8376                 && cf_fix_cppflags=no
8377         ;;
8378 esac
8379 done
8380
8381 if test -n "$cf_new_cflags" ; then
8382
8383         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8384         CFLAGS="${CFLAGS}$cf_new_cflags"
8385
8386 fi
8387
8388 if test -n "$cf_new_cppflags" ; then
8389
8390         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8391         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8392
8393 fi
8394
8395 if test -n "$cf_new_extra_cppflags" ; then
8396
8397         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8398         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8399
8400 fi
8401
8402 done
8403
8404 cf_add_libs="$LIBS"
8405 # reverse order
8406 cf_add_0lib=
8407 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8408 # filter duplicates
8409 for cf_add_1lib in $cf_add_0lib; do
8410         for cf_add_2lib in $cf_add_libs; do
8411                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8412                         cf_add_1lib=
8413                         break
8414                 fi
8415         done
8416         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8417 done
8418 LIBS="$cf_add_libs"
8419
8420                 # even with config script, some packages use no-override for curses.h
8421
8422 echo "$as_me:8422: checking if we have identified curses headers" >&5
8423 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8424 if test "${cf_cv_ncurses_header+set}" = set; then
8425   echo $ECHO_N "(cached) $ECHO_C" >&6
8426 else
8427
8428 cf_cv_ncurses_header=none
8429 for cf_header in \
8430         ncurses.h $cf_cv_screen/ncurses.h \
8431         curses.h $cf_cv_screen/curses.h
8432 do
8433 cat >"conftest.$ac_ext" <<_ACEOF
8434 #line 8434 "configure"
8435 #include "confdefs.h"
8436 #include <${cf_header}>
8437 int
8438 main (void)
8439 {
8440 initscr(); endwin()
8441   ;
8442   return 0;
8443 }
8444 _ACEOF
8445 rm -f "conftest.$ac_objext"
8446 if { (eval echo "$as_me:8446: \"$ac_compile\"") >&5
8447   (eval $ac_compile) 2>&5
8448   ac_status=$?
8449   echo "$as_me:8449: \$? = $ac_status" >&5
8450   (exit "$ac_status"); } &&
8451          { ac_try='test -s "conftest.$ac_objext"'
8452   { (eval echo "$as_me:8452: \"$ac_try\"") >&5
8453   (eval $ac_try) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit "$ac_status"); }; }; then
8457   cf_cv_ncurses_header=$cf_header; break
8458 else
8459   echo "$as_me: failed program was:" >&5
8460 cat "conftest.$ac_ext" >&5
8461 fi
8462 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8463 done
8464
8465 fi
8466 echo "$as_me:8466: result: $cf_cv_ncurses_header" >&5
8467 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8468
8469 if test "$cf_cv_ncurses_header" = none ; then
8470         { { echo "$as_me:8470: error: No curses header-files found" >&5
8471 echo "$as_me: error: No curses header-files found" >&2;}
8472    { (exit 1); exit 1; }; }
8473 fi
8474
8475 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8476
8477 for ac_header in $cf_cv_ncurses_header
8478 do
8479 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8480 echo "$as_me:8480: checking for $ac_header" >&5
8481 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8482 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8483   echo $ECHO_N "(cached) $ECHO_C" >&6
8484 else
8485   cat >"conftest.$ac_ext" <<_ACEOF
8486 #line 8486 "configure"
8487 #include "confdefs.h"
8488 #include <$ac_header>
8489 _ACEOF
8490 if { (eval echo "$as_me:8490: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8491   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8492   ac_status=$?
8493   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8494   rm -f conftest.er1
8495   cat conftest.err >&5
8496   echo "$as_me:8496: \$? = $ac_status" >&5
8497   (exit "$ac_status"); } >/dev/null; then
8498   if test -s conftest.err; then
8499     ac_cpp_err=$ac_c_preproc_warn_flag
8500   else
8501     ac_cpp_err=
8502   fi
8503 else
8504   ac_cpp_err=yes
8505 fi
8506 if test -z "$ac_cpp_err"; then
8507   eval "$as_ac_Header=yes"
8508 else
8509   echo "$as_me: failed program was:" >&5
8510   cat "conftest.$ac_ext" >&5
8511   eval "$as_ac_Header=no"
8512 fi
8513 rm -f conftest.err "conftest.$ac_ext"
8514 fi
8515 echo "$as_me:8515: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8516 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8517 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8518   cat >>confdefs.h <<EOF
8519 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8520 EOF
8521
8522 fi
8523 done
8524
8525 cat >>confdefs.h <<\EOF
8526 #define NCURSES 1
8527 EOF
8528
8529 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8530
8531                 cat >>confdefs.h <<EOF
8532 #define $cf_nculib_ROOT 1
8533 EOF
8534
8535                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8536
8537         else
8538
8539 cf_ncuhdr_root=$cf_cv_screen
8540
8541 test -n "$cf_cv_curses_dir" && \
8542 test "$cf_cv_curses_dir" != "no" && { \
8543
8544 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8545   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8546   do
8547         while test "$cf_add_incdir" != /usr/include
8548         do
8549           if test -d "$cf_add_incdir"
8550           then
8551                 cf_have_incdir=no
8552                 if test -n "$CFLAGS$CPPFLAGS" ; then
8553                   # a loop is needed to ensure we can add subdirs of existing dirs
8554                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8555                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8556                           cf_have_incdir=yes; break
8557                         fi
8558                   done
8559                 fi
8560
8561                 if test "$cf_have_incdir" = no ; then
8562                   if test "$cf_add_incdir" = /usr/local/include ; then
8563                         if test "$GCC" = yes
8564                         then
8565                           cf_save_CPPFLAGS=$CPPFLAGS
8566
8567         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8568         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8569
8570                           cat >"conftest.$ac_ext" <<_ACEOF
8571 #line 8571 "configure"
8572 #include "confdefs.h"
8573 #include <stdio.h>
8574 int
8575 main (void)
8576 {
8577 printf("Hello")
8578   ;
8579   return 0;
8580 }
8581 _ACEOF
8582 rm -f "conftest.$ac_objext"
8583 if { (eval echo "$as_me:8583: \"$ac_compile\"") >&5
8584   (eval $ac_compile) 2>&5
8585   ac_status=$?
8586   echo "$as_me:8586: \$? = $ac_status" >&5
8587   (exit "$ac_status"); } &&
8588          { ac_try='test -s "conftest.$ac_objext"'
8589   { (eval echo "$as_me:8589: \"$ac_try\"") >&5
8590   (eval $ac_try) 2>&5
8591   ac_status=$?
8592   echo "$as_me:8592: \$? = $ac_status" >&5
8593   (exit "$ac_status"); }; }; then
8594   :
8595 else
8596   echo "$as_me: failed program was:" >&5
8597 cat "conftest.$ac_ext" >&5
8598 cf_have_incdir=yes
8599 fi
8600 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8601                           CPPFLAGS=$cf_save_CPPFLAGS
8602                         fi
8603                   fi
8604                 fi
8605
8606                 if test "$cf_have_incdir" = no ; then
8607                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8608
8609 echo "${as_me:-configure}:8609: testing adding $cf_add_incdir to include-path ..." 1>&5
8610
8611                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8612
8613                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8614                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8615                   cf_add_incdir="$cf_top_incdir"
8616                 else
8617                   break
8618                 fi
8619           else
8620                 break
8621           fi
8622         done
8623   done
8624 fi
8625
8626 }
8627
8628 echo "$as_me:8628: checking for $cf_ncuhdr_root header in include-path" >&5
8629 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8630 if test "${cf_cv_ncurses_h+set}" = set; then
8631   echo $ECHO_N "(cached) $ECHO_C" >&6
8632 else
8633
8634         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8635         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8636         for cf_header in $cf_header_list
8637         do
8638
8639         cat >"conftest.$ac_ext" <<_ACEOF
8640 #line 8640 "configure"
8641 #include "confdefs.h"
8642
8643 #include <$cf_header>
8644 int
8645 main (void)
8646 {
8647
8648 #ifdef NCURSES_VERSION
8649
8650 printf("%s\\n", NCURSES_VERSION);
8651 #else
8652 #ifdef __NCURSES_H
8653 printf("old\\n");
8654 #else
8655         #error __NCURSES_H is not defined
8656 #endif
8657 #endif
8658
8659   ;
8660   return 0;
8661 }
8662 _ACEOF
8663 rm -f "conftest.$ac_objext"
8664 if { (eval echo "$as_me:8664: \"$ac_compile\"") >&5
8665   (eval $ac_compile) 2>&5
8666   ac_status=$?
8667   echo "$as_me:8667: \$? = $ac_status" >&5
8668   (exit "$ac_status"); } &&
8669          { ac_try='test -s "conftest.$ac_objext"'
8670   { (eval echo "$as_me:8670: \"$ac_try\"") >&5
8671   (eval $ac_try) 2>&5
8672   ac_status=$?
8673   echo "$as_me:8673: \$? = $ac_status" >&5
8674   (exit "$ac_status"); }; }; then
8675   cf_cv_ncurses_h=$cf_header
8676
8677 else
8678   echo "$as_me: failed program was:" >&5
8679 cat "conftest.$ac_ext" >&5
8680 cf_cv_ncurses_h=no
8681 fi
8682 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8683
8684                 test "$cf_cv_ncurses_h" != no && break
8685         done
8686
8687 fi
8688 echo "$as_me:8688: result: $cf_cv_ncurses_h" >&5
8689 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8690
8691 if test "$cf_cv_ncurses_h" != no ; then
8692         cf_cv_ncurses_header=$cf_cv_ncurses_h
8693 else
8694
8695 echo "$as_me:8695: checking for $cf_ncuhdr_root include-path" >&5
8696 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8697 if test "${cf_cv_ncurses_h2+set}" = set; then
8698   echo $ECHO_N "(cached) $ECHO_C" >&6
8699 else
8700
8701         test -n "$verbose" && echo
8702
8703 cf_search=
8704
8705 # collect the current set of include-directories from compiler flags
8706 cf_header_path_list=""
8707 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8708         for cf_header_path in $CPPFLAGS $CFLAGS
8709         do
8710                 case "$cf_header_path" in
8711                 (-I*)
8712                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8713
8714 test "x$cf_header_path" != "xNONE" && \
8715 test -d "$cf_header_path" && \
8716  {
8717         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8718         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8719         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8720         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8721         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8722         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"
8723 }
8724
8725                         cf_header_path_list="$cf_header_path_list $cf_search"
8726                         ;;
8727                 esac
8728         done
8729 fi
8730
8731 # add the variations for the package we are looking for
8732
8733 cf_search=
8734
8735 test "x$prefix" != "xNONE" && \
8736 test -d "$prefix" && \
8737  {
8738         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8739         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8740         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8741         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8742         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8743         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8744 }
8745
8746 for cf_subdir_prefix in \
8747         /usr \
8748         /usr/local \
8749         /usr/pkg \
8750         /opt \
8751         /opt/local \
8752         $HOME
8753 do
8754
8755 test "x$cf_subdir_prefix" != "x$prefix" && \
8756 test -d "$cf_subdir_prefix" && \
8757 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8758         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8759         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8760         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8761         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8762         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8763         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"
8764 }
8765
8766 done
8767
8768 test "$includedir" != NONE && \
8769 test "$includedir" != "/usr/include" && \
8770 test -d "$includedir" && {
8771         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8772         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8773 }
8774
8775 test "$oldincludedir" != NONE && \
8776 test "$oldincludedir" != "/usr/include" && \
8777 test -d "$oldincludedir" && {
8778         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8779         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8780 }
8781
8782 cf_search="$cf_search $cf_header_path_list"
8783
8784         test -n "$verbose" && echo "search path $cf_search"
8785         cf_save2_CPPFLAGS="$CPPFLAGS"
8786         for cf_incdir in $cf_search
8787         do
8788
8789 if test -n "$cf_incdir" ; then
8790   for cf_add_incdir in $cf_incdir
8791   do
8792         while test "$cf_add_incdir" != /usr/include
8793         do
8794           if test -d "$cf_add_incdir"
8795           then
8796                 cf_have_incdir=no
8797                 if test -n "$CFLAGS$CPPFLAGS" ; then
8798                   # a loop is needed to ensure we can add subdirs of existing dirs
8799                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8800                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8801                           cf_have_incdir=yes; break
8802                         fi
8803                   done
8804                 fi
8805
8806                 if test "$cf_have_incdir" = no ; then
8807                   if test "$cf_add_incdir" = /usr/local/include ; then
8808                         if test "$GCC" = yes
8809                         then
8810                           cf_save_CPPFLAGS=$CPPFLAGS
8811
8812         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8813         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8814
8815                           cat >"conftest.$ac_ext" <<_ACEOF
8816 #line 8816 "configure"
8817 #include "confdefs.h"
8818 #include <stdio.h>
8819 int
8820 main (void)
8821 {
8822 printf("Hello")
8823   ;
8824   return 0;
8825 }
8826 _ACEOF
8827 rm -f "conftest.$ac_objext"
8828 if { (eval echo "$as_me:8828: \"$ac_compile\"") >&5
8829   (eval $ac_compile) 2>&5
8830   ac_status=$?
8831   echo "$as_me:8831: \$? = $ac_status" >&5
8832   (exit "$ac_status"); } &&
8833          { ac_try='test -s "conftest.$ac_objext"'
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   :
8840 else
8841   echo "$as_me: failed program was:" >&5
8842 cat "conftest.$ac_ext" >&5
8843 cf_have_incdir=yes
8844 fi
8845 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8846                           CPPFLAGS=$cf_save_CPPFLAGS
8847                         fi
8848                   fi
8849                 fi
8850
8851                 if test "$cf_have_incdir" = no ; then
8852                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8853
8854 echo "${as_me:-configure}:8854: testing adding $cf_add_incdir to include-path ..." 1>&5
8855
8856                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8857
8858                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8859                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8860                   cf_add_incdir="$cf_top_incdir"
8861                 else
8862                   break
8863                 fi
8864           else
8865                 break
8866           fi
8867         done
8868   done
8869 fi
8870
8871                 for cf_header in \
8872                         ncurses.h \
8873                         curses.h
8874                 do
8875
8876         cat >"conftest.$ac_ext" <<_ACEOF
8877 #line 8877 "configure"
8878 #include "confdefs.h"
8879
8880 #include <$cf_header>
8881 int
8882 main (void)
8883 {
8884
8885 #ifdef NCURSES_VERSION
8886
8887 printf("%s\\n", NCURSES_VERSION);
8888 #else
8889 #ifdef __NCURSES_H
8890 printf("old\\n");
8891 #else
8892         #error __NCURSES_H is not defined
8893 #endif
8894 #endif
8895
8896   ;
8897   return 0;
8898 }
8899 _ACEOF
8900 rm -f "conftest.$ac_objext"
8901 if { (eval echo "$as_me:8901: \"$ac_compile\"") >&5
8902   (eval $ac_compile) 2>&5
8903   ac_status=$?
8904   echo "$as_me:8904: \$? = $ac_status" >&5
8905   (exit "$ac_status"); } &&
8906          { ac_try='test -s "conftest.$ac_objext"'
8907   { (eval echo "$as_me:8907: \"$ac_try\"") >&5
8908   (eval $ac_try) 2>&5
8909   ac_status=$?
8910   echo "$as_me:8910: \$? = $ac_status" >&5
8911   (exit "$ac_status"); }; }; then
8912   cf_cv_ncurses_h2=$cf_header
8913
8914 else
8915   echo "$as_me: failed program was:" >&5
8916 cat "conftest.$ac_ext" >&5
8917 cf_cv_ncurses_h2=no
8918 fi
8919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8920
8921                         if test "$cf_cv_ncurses_h2" != no ; then
8922                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8923                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8924                                 break
8925                         fi
8926                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8927                 done
8928                 CPPFLAGS="$cf_save2_CPPFLAGS"
8929                 test "$cf_cv_ncurses_h2" != no && break
8930         done
8931         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8931: error: not found" >&5
8932 echo "$as_me: error: not found" >&2;}
8933    { (exit 1); exit 1; }; }
8934
8935 fi
8936 echo "$as_me:8936: result: $cf_cv_ncurses_h2" >&5
8937 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8938
8939         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8940         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8941         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8942                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8943         fi
8944
8945 if test -n "$cf_1st_incdir" ; then
8946   for cf_add_incdir in $cf_1st_incdir
8947   do
8948         while test "$cf_add_incdir" != /usr/include
8949         do
8950           if test -d "$cf_add_incdir"
8951           then
8952                 cf_have_incdir=no
8953                 if test -n "$CFLAGS$CPPFLAGS" ; then
8954                   # a loop is needed to ensure we can add subdirs of existing dirs
8955                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8956                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8957                           cf_have_incdir=yes; break
8958                         fi
8959                   done
8960                 fi
8961
8962                 if test "$cf_have_incdir" = no ; then
8963                   if test "$cf_add_incdir" = /usr/local/include ; then
8964                         if test "$GCC" = yes
8965                         then
8966                           cf_save_CPPFLAGS=$CPPFLAGS
8967
8968         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8969         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8970
8971                           cat >"conftest.$ac_ext" <<_ACEOF
8972 #line 8972 "configure"
8973 #include "confdefs.h"
8974 #include <stdio.h>
8975 int
8976 main (void)
8977 {
8978 printf("Hello")
8979   ;
8980   return 0;
8981 }
8982 _ACEOF
8983 rm -f "conftest.$ac_objext"
8984 if { (eval echo "$as_me:8984: \"$ac_compile\"") >&5
8985   (eval $ac_compile) 2>&5
8986   ac_status=$?
8987   echo "$as_me:8987: \$? = $ac_status" >&5
8988   (exit "$ac_status"); } &&
8989          { ac_try='test -s "conftest.$ac_objext"'
8990   { (eval echo "$as_me:8990: \"$ac_try\"") >&5
8991   (eval $ac_try) 2>&5
8992   ac_status=$?
8993   echo "$as_me:8993: \$? = $ac_status" >&5
8994   (exit "$ac_status"); }; }; then
8995   :
8996 else
8997   echo "$as_me: failed program was:" >&5
8998 cat "conftest.$ac_ext" >&5
8999 cf_have_incdir=yes
9000 fi
9001 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9002                           CPPFLAGS=$cf_save_CPPFLAGS
9003                         fi
9004                   fi
9005                 fi
9006
9007                 if test "$cf_have_incdir" = no ; then
9008                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9009
9010 echo "${as_me:-configure}:9010: testing adding $cf_add_incdir to include-path ..." 1>&5
9011
9012                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9013
9014                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9015                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9016                   cf_add_incdir="$cf_top_incdir"
9017                 else
9018                   break
9019                 fi
9020           else
9021                 break
9022           fi
9023         done
9024   done
9025 fi
9026
9027 fi
9028
9029 # Set definitions to allow ifdef'ing for ncurses.h
9030
9031 case "$cf_cv_ncurses_header" in
9032 (*ncurses.h)
9033
9034 cat >>confdefs.h <<\EOF
9035 #define HAVE_NCURSES_H 1
9036 EOF
9037
9038         ;;
9039 esac
9040
9041 case "$cf_cv_ncurses_header" in
9042 (ncurses/curses.h|ncurses/ncurses.h)
9043
9044 cat >>confdefs.h <<\EOF
9045 #define HAVE_NCURSES_NCURSES_H 1
9046 EOF
9047
9048         ;;
9049 (ncursesw/curses.h|ncursesw/ncurses.h)
9050
9051 cat >>confdefs.h <<\EOF
9052 #define HAVE_NCURSESW_NCURSES_H 1
9053 EOF
9054
9055         ;;
9056 esac
9057
9058 echo "$as_me:9058: checking for terminfo header" >&5
9059 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9060 if test "${cf_cv_term_header+set}" = set; then
9061   echo $ECHO_N "(cached) $ECHO_C" >&6
9062 else
9063
9064 case "${cf_cv_ncurses_header}" in
9065 (*/ncurses.h|*/ncursesw.h)
9066         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9067         ;;
9068 (*)
9069         cf_term_header=term.h
9070         ;;
9071 esac
9072
9073 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9074 do
9075 cat >"conftest.$ac_ext" <<_ACEOF
9076 #line 9076 "configure"
9077 #include "confdefs.h"
9078 #include <stdio.h>
9079 #include <${cf_cv_ncurses_header:-curses.h}>
9080 #include <$cf_test>
9081
9082 int
9083 main (void)
9084 {
9085 int x = auto_left_margin; (void)x
9086   ;
9087   return 0;
9088 }
9089 _ACEOF
9090 rm -f "conftest.$ac_objext"
9091 if { (eval echo "$as_me:9091: \"$ac_compile\"") >&5
9092   (eval $ac_compile) 2>&5
9093   ac_status=$?
9094   echo "$as_me:9094: \$? = $ac_status" >&5
9095   (exit "$ac_status"); } &&
9096          { ac_try='test -s "conftest.$ac_objext"'
9097   { (eval echo "$as_me:9097: \"$ac_try\"") >&5
9098   (eval $ac_try) 2>&5
9099   ac_status=$?
9100   echo "$as_me:9100: \$? = $ac_status" >&5
9101   (exit "$ac_status"); }; }; then
9102
9103         cf_cv_term_header="$cf_test"
9104 else
9105   echo "$as_me: failed program was:" >&5
9106 cat "conftest.$ac_ext" >&5
9107
9108         cf_cv_term_header=unknown
9109
9110 fi
9111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9112         test "$cf_cv_term_header" != unknown && break
9113 done
9114
9115 fi
9116 echo "$as_me:9116: result: $cf_cv_term_header" >&5
9117 echo "${ECHO_T}$cf_cv_term_header" >&6
9118
9119 # Set definitions to allow ifdef'ing to accommodate subdirectories
9120
9121 case "$cf_cv_term_header" in
9122 (*term.h)
9123
9124 cat >>confdefs.h <<\EOF
9125 #define HAVE_TERM_H 1
9126 EOF
9127
9128         ;;
9129 esac
9130
9131 case "$cf_cv_term_header" in
9132 (ncurses/term.h)
9133
9134 cat >>confdefs.h <<\EOF
9135 #define HAVE_NCURSES_TERM_H 1
9136 EOF
9137
9138         ;;
9139 (ncursesw/term.h)
9140
9141 cat >>confdefs.h <<\EOF
9142 #define HAVE_NCURSESW_TERM_H 1
9143 EOF
9144
9145         ;;
9146 esac
9147
9148 # some applications need this, but should check for NCURSES_VERSION
9149
9150 cat >>confdefs.h <<\EOF
9151 #define NCURSES 1
9152 EOF
9153
9154 echo "$as_me:9154: checking for ncurses version" >&5
9155 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9156 if test "${cf_cv_ncurses_version+set}" = set; then
9157   echo $ECHO_N "(cached) $ECHO_C" >&6
9158 else
9159
9160         cf_cv_ncurses_version=no
9161         cf_tempfile=out$$
9162         rm -f "$cf_tempfile"
9163         if test "$cross_compiling" = yes; then
9164
9165         # This will not work if the preprocessor splits the line after the
9166         # Autoconf token.  The 'unproto' program does that.
9167         cat > "conftest.$ac_ext" <<EOF
9168 #include <${cf_cv_ncurses_header:-curses.h}>
9169 #undef Autoconf
9170 #ifdef NCURSES_VERSION
9171 Autoconf NCURSES_VERSION
9172 #else
9173 #ifdef __NCURSES_H
9174 Autoconf "old"
9175 #endif
9176 ;
9177 #endif
9178 EOF
9179         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9180         { (eval echo "$as_me:9180: \"$cf_try\"") >&5
9181   (eval $cf_try) 2>&5
9182   ac_status=$?
9183   echo "$as_me:9183: \$? = $ac_status" >&5
9184   (exit "$ac_status"); }
9185         if test -f conftest.out ; then
9186                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
9187                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9188                 rm -f conftest.out
9189         fi
9190
9191 else
9192   cat >"conftest.$ac_ext" <<_ACEOF
9193 #line 9193 "configure"
9194 #include "confdefs.h"
9195
9196 $ac_includes_default
9197
9198 #include <${cf_cv_ncurses_header:-curses.h}>
9199
9200 int main(void)
9201 {
9202         FILE *fp = fopen("$cf_tempfile", "w");
9203 #ifdef NCURSES_VERSION
9204 # ifdef NCURSES_VERSION_PATCH
9205         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9206 # else
9207         fprintf(fp, "%s\\n", NCURSES_VERSION);
9208 # endif
9209 #else
9210 # ifdef __NCURSES_H
9211         fprintf(fp, "old\\n");
9212 # else
9213         #error expected ncurses header to define __NCURSES_H
9214 # endif
9215 #endif
9216         ${cf_cv_main_return:-return}(0);
9217 }
9218 _ACEOF
9219 rm -f "conftest$ac_exeext"
9220 if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
9221   (eval $ac_link) 2>&5
9222   ac_status=$?
9223   echo "$as_me:9223: \$? = $ac_status" >&5
9224   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9225   { (eval echo "$as_me:9225: \"$ac_try\"") >&5
9226   (eval $ac_try) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit "$ac_status"); }; }; then
9230
9231         cf_cv_ncurses_version=`cat $cf_tempfile`
9232 else
9233   echo "$as_me: program exited with status $ac_status" >&5
9234 echo "$as_me: failed program was:" >&5
9235 cat "conftest.$ac_ext" >&5
9236 fi
9237 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9238 fi
9239         rm -f "$cf_tempfile"
9240
9241 fi
9242 echo "$as_me:9242: result: $cf_cv_ncurses_version" >&5
9243 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9244 test "$cf_cv_ncurses_version" = no ||
9245 cat >>confdefs.h <<\EOF
9246 #define NCURSES 1
9247 EOF
9248
9249 cf_nculib_root=$cf_cv_screen
9250         # This works, except for the special case where we find gpm, but
9251         # ncurses is in a nonstandard location via $LIBS, and we really want
9252         # to link gpm.
9253 cf_ncurses_LIBS=""
9254 cf_ncurses_SAVE="$LIBS"
9255 echo "$as_me:9255: checking for Gpm_Open in -lgpm" >&5
9256 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9257 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9258   echo $ECHO_N "(cached) $ECHO_C" >&6
9259 else
9260   ac_check_lib_save_LIBS=$LIBS
9261 LIBS="-lgpm  $LIBS"
9262 cat >"conftest.$ac_ext" <<_ACEOF
9263 #line 9263 "configure"
9264 #include "confdefs.h"
9265
9266 /* Override any gcc2 internal prototype to avoid an error.  */
9267 #ifdef __cplusplus
9268 extern "C"
9269 #endif
9270 /* We use char because int might match the return type of a gcc2
9271    builtin and then its argument prototype would still apply.  */
9272 char Gpm_Open (void);
9273 int
9274 main (void)
9275 {
9276 Gpm_Open ();
9277   ;
9278   return 0;
9279 }
9280 _ACEOF
9281 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9282 if { (eval echo "$as_me:9282: \"$ac_link\"") >&5
9283   (eval $ac_link) 2>&5
9284   ac_status=$?
9285   echo "$as_me:9285: \$? = $ac_status" >&5
9286   (exit "$ac_status"); } &&
9287          { ac_try='test -s "conftest$ac_exeext"'
9288   { (eval echo "$as_me:9288: \"$ac_try\"") >&5
9289   (eval $ac_try) 2>&5
9290   ac_status=$?
9291   echo "$as_me:9291: \$? = $ac_status" >&5
9292   (exit "$ac_status"); }; }; then
9293   ac_cv_lib_gpm_Gpm_Open=yes
9294 else
9295   echo "$as_me: failed program was:" >&5
9296 cat "conftest.$ac_ext" >&5
9297 ac_cv_lib_gpm_Gpm_Open=no
9298 fi
9299 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9300 LIBS=$ac_check_lib_save_LIBS
9301 fi
9302 echo "$as_me:9302: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9303 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9304 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
9305   echo "$as_me:9305: checking for initscr in -lgpm" >&5
9306 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9307 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9308   echo $ECHO_N "(cached) $ECHO_C" >&6
9309 else
9310   ac_check_lib_save_LIBS=$LIBS
9311 LIBS="-lgpm  $LIBS"
9312 cat >"conftest.$ac_ext" <<_ACEOF
9313 #line 9313 "configure"
9314 #include "confdefs.h"
9315
9316 /* Override any gcc2 internal prototype to avoid an error.  */
9317 #ifdef __cplusplus
9318 extern "C"
9319 #endif
9320 /* We use char because int might match the return type of a gcc2
9321    builtin and then its argument prototype would still apply.  */
9322 char initscr (void);
9323 int
9324 main (void)
9325 {
9326 initscr ();
9327   ;
9328   return 0;
9329 }
9330 _ACEOF
9331 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9332 if { (eval echo "$as_me:9332: \"$ac_link\"") >&5
9333   (eval $ac_link) 2>&5
9334   ac_status=$?
9335   echo "$as_me:9335: \$? = $ac_status" >&5
9336   (exit "$ac_status"); } &&
9337          { ac_try='test -s "conftest$ac_exeext"'
9338   { (eval echo "$as_me:9338: \"$ac_try\"") >&5
9339   (eval $ac_try) 2>&5
9340   ac_status=$?
9341   echo "$as_me:9341: \$? = $ac_status" >&5
9342   (exit "$ac_status"); }; }; then
9343   ac_cv_lib_gpm_initscr=yes
9344 else
9345   echo "$as_me: failed program was:" >&5
9346 cat "conftest.$ac_ext" >&5
9347 ac_cv_lib_gpm_initscr=no
9348 fi
9349 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9350 LIBS=$ac_check_lib_save_LIBS
9351 fi
9352 echo "$as_me:9352: result: $ac_cv_lib_gpm_initscr" >&5
9353 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9354 if test "$ac_cv_lib_gpm_initscr" = yes; then
9355   LIBS="$cf_ncurses_SAVE"
9356 else
9357   cf_ncurses_LIBS="-lgpm"
9358 fi
9359
9360 fi
9361
9362 case "$host_os" in
9363 (freebsd*)
9364         # This is only necessary if you are linking against an obsolete
9365         # version of ncurses (but it should do no harm, since it is static).
9366         if test "$cf_nculib_root" = ncurses ; then
9367                 echo "$as_me:9367: checking for tgoto in -lmytinfo" >&5
9368 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9369 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9370   echo $ECHO_N "(cached) $ECHO_C" >&6
9371 else
9372   ac_check_lib_save_LIBS=$LIBS
9373 LIBS="-lmytinfo  $LIBS"
9374 cat >"conftest.$ac_ext" <<_ACEOF
9375 #line 9375 "configure"
9376 #include "confdefs.h"
9377
9378 /* Override any gcc2 internal prototype to avoid an error.  */
9379 #ifdef __cplusplus
9380 extern "C"
9381 #endif
9382 /* We use char because int might match the return type of a gcc2
9383    builtin and then its argument prototype would still apply.  */
9384 char tgoto (void);
9385 int
9386 main (void)
9387 {
9388 tgoto ();
9389   ;
9390   return 0;
9391 }
9392 _ACEOF
9393 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9394 if { (eval echo "$as_me:9394: \"$ac_link\"") >&5
9395   (eval $ac_link) 2>&5
9396   ac_status=$?
9397   echo "$as_me:9397: \$? = $ac_status" >&5
9398   (exit "$ac_status"); } &&
9399          { ac_try='test -s "conftest$ac_exeext"'
9400   { (eval echo "$as_me:9400: \"$ac_try\"") >&5
9401   (eval $ac_try) 2>&5
9402   ac_status=$?
9403   echo "$as_me:9403: \$? = $ac_status" >&5
9404   (exit "$ac_status"); }; }; then
9405   ac_cv_lib_mytinfo_tgoto=yes
9406 else
9407   echo "$as_me: failed program was:" >&5
9408 cat "conftest.$ac_ext" >&5
9409 ac_cv_lib_mytinfo_tgoto=no
9410 fi
9411 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9412 LIBS=$ac_check_lib_save_LIBS
9413 fi
9414 echo "$as_me:9414: result: $ac_cv_lib_mytinfo_tgoto" >&5
9415 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9416 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
9417   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9418 fi
9419
9420         fi
9421         ;;
9422 esac
9423
9424 cf_add_libs="$LIBS"
9425 # reverse order
9426 cf_add_0lib=
9427 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9428 # filter duplicates
9429 for cf_add_1lib in $cf_add_0lib; do
9430         for cf_add_2lib in $cf_add_libs; do
9431                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9432                         cf_add_1lib=
9433                         break
9434                 fi
9435         done
9436         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9437 done
9438 LIBS="$cf_add_libs"
9439
9440 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
9441 then
9442
9443 cf_add_libs="$LIBS"
9444 # reverse order
9445 cf_add_0lib=
9446 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9447 # filter duplicates
9448 for cf_add_1lib in $cf_add_0lib; do
9449         for cf_add_2lib in $cf_add_libs; do
9450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9451                         cf_add_1lib=
9452                         break
9453                 fi
9454         done
9455         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9456 done
9457 LIBS="$cf_add_libs"
9458
9459 else
9460
9461         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
9462         cf_libdir=""
9463         echo "$as_me:9463: checking for initscr" >&5
9464 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9465 if test "${ac_cv_func_initscr+set}" = set; then
9466   echo $ECHO_N "(cached) $ECHO_C" >&6
9467 else
9468   cat >"conftest.$ac_ext" <<_ACEOF
9469 #line 9469 "configure"
9470 #include "confdefs.h"
9471 #define initscr autoconf_temporary
9472 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9473 #undef initscr
9474
9475 #ifdef __cplusplus
9476 extern "C"
9477 #endif
9478
9479 /* We use char because int might match the return type of a gcc2
9480    builtin and then its argument prototype would still apply.  */
9481 char initscr (void);
9482
9483 int
9484 main (void)
9485 {
9486
9487 /* The GNU C library defines stubs for functions which it implements
9488     to always fail with ENOSYS.  Some functions are actually named
9489     something starting with __ and the normal name is an alias.  */
9490 #if defined (__stub_initscr) || defined (__stub___initscr)
9491 #error found stub for initscr
9492 #endif
9493
9494         return initscr ();
9495   ;
9496   return 0;
9497 }
9498 _ACEOF
9499 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9500 if { (eval echo "$as_me:9500: \"$ac_link\"") >&5
9501   (eval $ac_link) 2>&5
9502   ac_status=$?
9503   echo "$as_me:9503: \$? = $ac_status" >&5
9504   (exit "$ac_status"); } &&
9505          { ac_try='test -s "conftest$ac_exeext"'
9506   { (eval echo "$as_me:9506: \"$ac_try\"") >&5
9507   (eval $ac_try) 2>&5
9508   ac_status=$?
9509   echo "$as_me:9509: \$? = $ac_status" >&5
9510   (exit "$ac_status"); }; }; then
9511   ac_cv_func_initscr=yes
9512 else
9513   echo "$as_me: failed program was:" >&5
9514 cat "conftest.$ac_ext" >&5
9515 ac_cv_func_initscr=no
9516 fi
9517 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9518 fi
9519 echo "$as_me:9519: result: $ac_cv_func_initscr" >&5
9520 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9521 if test "$ac_cv_func_initscr" = yes; then
9522   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9523 else
9524
9525                 cf_save_LIBS="$LIBS"
9526                 echo "$as_me:9526: checking for initscr in -l$cf_nculib_root" >&5
9527 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9528                 LIBS="-l$cf_nculib_root $LIBS"
9529                 cat >"conftest.$ac_ext" <<_ACEOF
9530 #line 9530 "configure"
9531 #include "confdefs.h"
9532 #include <${cf_cv_ncurses_header:-curses.h}>
9533 int
9534 main (void)
9535 {
9536 initscr()
9537   ;
9538   return 0;
9539 }
9540 _ACEOF
9541 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9542 if { (eval echo "$as_me:9542: \"$ac_link\"") >&5
9543   (eval $ac_link) 2>&5
9544   ac_status=$?
9545   echo "$as_me:9545: \$? = $ac_status" >&5
9546   (exit "$ac_status"); } &&
9547          { ac_try='test -s "conftest$ac_exeext"'
9548   { (eval echo "$as_me:9548: \"$ac_try\"") >&5
9549   (eval $ac_try) 2>&5
9550   ac_status=$?
9551   echo "$as_me:9551: \$? = $ac_status" >&5
9552   (exit "$ac_status"); }; }; then
9553   echo "$as_me:9553: result: yes" >&5
9554 echo "${ECHO_T}yes" >&6
9555                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9556
9557 else
9558   echo "$as_me: failed program was:" >&5
9559 cat "conftest.$ac_ext" >&5
9560 echo "$as_me:9560: result: no" >&5
9561 echo "${ECHO_T}no" >&6
9562
9563 cf_search=
9564 cf_library_path_list=""
9565 if test -n "${LDFLAGS}${LIBS}" ; then
9566         for cf_library_path in $LDFLAGS $LIBS
9567         do
9568                 case "$cf_library_path" in
9569                 (-L*)
9570                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9571
9572 test "x$cf_library_path" != "xNONE" && \
9573 test -d "$cf_library_path" && \
9574  {
9575         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9576         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9577         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9578         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9579         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9580         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"
9581 }
9582
9583                         cf_library_path_list="$cf_library_path_list $cf_search"
9584                         ;;
9585                 esac
9586         done
9587 fi
9588
9589 cf_search=
9590
9591 test "x$prefix" != "xNONE" && \
9592 test -d "$prefix" && \
9593  {
9594         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9595         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9596         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9597         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9598         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9599         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9600 }
9601
9602 for cf_subdir_prefix in \
9603         /usr \
9604         /usr/local \
9605         /usr/pkg \
9606         /opt \
9607         /opt/local \
9608         $HOME
9609 do
9610
9611 test "x$cf_subdir_prefix" != "x$prefix" && \
9612 test -d "$cf_subdir_prefix" && \
9613 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9614         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9615         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9616         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9617         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9618         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9619         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"
9620 }
9621
9622 done
9623
9624 cf_search="$cf_library_path_list $cf_search"
9625
9626                         for cf_libdir in $cf_search
9627                         do
9628                                 echo "$as_me:9628: checking for -l$cf_nculib_root in $cf_libdir" >&5
9629 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9630                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9631                                 cat >"conftest.$ac_ext" <<_ACEOF
9632 #line 9632 "configure"
9633 #include "confdefs.h"
9634 #include <${cf_cv_ncurses_header:-curses.h}>
9635 int
9636 main (void)
9637 {
9638 initscr()
9639   ;
9640   return 0;
9641 }
9642 _ACEOF
9643 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9644 if { (eval echo "$as_me:9644: \"$ac_link\"") >&5
9645   (eval $ac_link) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit "$ac_status"); } &&
9649          { ac_try='test -s "conftest$ac_exeext"'
9650   { (eval echo "$as_me:9650: \"$ac_try\"") >&5
9651   (eval $ac_try) 2>&5
9652   ac_status=$?
9653   echo "$as_me:9653: \$? = $ac_status" >&5
9654   (exit "$ac_status"); }; }; then
9655   echo "$as_me:9655: result: yes" >&5
9656 echo "${ECHO_T}yes" >&6
9657                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9658                                          break
9659 else
9660   echo "$as_me: failed program was:" >&5
9661 cat "conftest.$ac_ext" >&5
9662 echo "$as_me:9662: result: no" >&5
9663 echo "${ECHO_T}no" >&6
9664                                          LIBS="$cf_save_LIBS"
9665 fi
9666 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9667                         done
9668
9669 fi
9670 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9671
9672 fi
9673
9674 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9675
9676 if test "$cf_found_library" = no ; then
9677         { { echo "$as_me:9677: error: Cannot link $cf_nculib_root library" >&5
9678 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9679    { (exit 1); exit 1; }; }
9680 fi
9681
9682 fi
9683
9684 if test -n "$cf_ncurses_LIBS" ; then
9685         echo "$as_me:9685: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9686 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9687         cf_ncurses_SAVE="$LIBS"
9688         for p in $cf_ncurses_LIBS ; do
9689                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9690                 if test "$q" != "$LIBS" ; then
9691                         LIBS="$q"
9692                 fi
9693         done
9694         cat >"conftest.$ac_ext" <<_ACEOF
9695 #line 9695 "configure"
9696 #include "confdefs.h"
9697 #include <${cf_cv_ncurses_header:-curses.h}>
9698 int
9699 main (void)
9700 {
9701 initscr(); mousemask(0,0); tigetstr((char *)0);
9702   ;
9703   return 0;
9704 }
9705 _ACEOF
9706 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9707 if { (eval echo "$as_me:9707: \"$ac_link\"") >&5
9708   (eval $ac_link) 2>&5
9709   ac_status=$?
9710   echo "$as_me:9710: \$? = $ac_status" >&5
9711   (exit "$ac_status"); } &&
9712          { ac_try='test -s "conftest$ac_exeext"'
9713   { (eval echo "$as_me:9713: \"$ac_try\"") >&5
9714   (eval $ac_try) 2>&5
9715   ac_status=$?
9716   echo "$as_me:9716: \$? = $ac_status" >&5
9717   (exit "$ac_status"); }; }; then
9718   echo "$as_me:9718: result: yes" >&5
9719 echo "${ECHO_T}yes" >&6
9720 else
9721   echo "$as_me: failed program was:" >&5
9722 cat "conftest.$ac_ext" >&5
9723 echo "$as_me:9723: result: no" >&5
9724 echo "${ECHO_T}no" >&6
9725                  LIBS="$cf_ncurses_SAVE"
9726 fi
9727 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9728 fi
9729
9730 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9731
9732 cat >>confdefs.h <<EOF
9733 #define $cf_nculib_ROOT 1
9734 EOF
9735
9736         fi
9737 else
9738         NCURSES_CONFIG=none
9739 fi
9740
9741         ;;
9742 (ncurses*)
9743
9744 cf_ncuconfig_root=$cf_cv_screen
9745 cf_have_ncuconfig=no
9746
9747 if test "x${PKG_CONFIG:=none}" != xnone; then
9748         echo "$as_me:9748: checking pkg-config for $cf_ncuconfig_root" >&5
9749 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9750         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9751                 echo "$as_me:9751: result: yes" >&5
9752 echo "${ECHO_T}yes" >&6
9753
9754                 echo "$as_me:9754: checking if the $cf_ncuconfig_root package files work" >&5
9755 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9756                 cf_have_ncuconfig=unknown
9757
9758                 cf_save_CFLAGS="$CFLAGS"
9759                 cf_save_CPPFLAGS="$CPPFLAGS"
9760                 cf_save_LIBS="$LIBS"
9761
9762                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9763                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9764
9765                 # while -W for passing linker flags is prevalent, it is not "standard".
9766                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9767                 # incompatible _and_ non-standard -W option which gives an error.  Work
9768                 # around that pitfall.
9769                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9770                 (x*c[89]9@@*-W*)
9771
9772 cf_fix_cppflags=no
9773 cf_new_cflags=
9774 cf_new_cppflags=
9775 cf_new_extra_cppflags=
9776
9777 for cf_add_cflags in $cf_pkg_cflags
9778 do
9779 case "$cf_fix_cppflags" in
9780 (no)
9781         case "$cf_add_cflags" in
9782         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9783                 case "$cf_add_cflags" in
9784                 (-D*)
9785                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9786
9787                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9788                                 && test -z "${cf_tst_cflags}" \
9789                                 && cf_fix_cppflags=yes
9790
9791                         if test "$cf_fix_cppflags" = yes ; then
9792
9793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9795
9796                                 continue
9797                         elif test "${cf_tst_cflags}" = "\"'" ; then
9798
9799         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9800         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9801
9802                                 continue
9803                         fi
9804                         ;;
9805                 esac
9806                 case "$CPPFLAGS" in
9807                 (*$cf_add_cflags)
9808                         ;;
9809                 (*)
9810                         case "$cf_add_cflags" in
9811                         (-D*)
9812                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9813
9814 CPPFLAGS=`echo "$CPPFLAGS" | \
9815         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9816                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9817
9818                                 ;;
9819                         esac
9820
9821         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9822         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9823
9824                         ;;
9825                 esac
9826                 ;;
9827         (*)
9828
9829         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9830         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9831
9832                 ;;
9833         esac
9834         ;;
9835 (yes)
9836
9837         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9838         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9839
9840         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9841
9842         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9843                 && test -z "${cf_tst_cflags}" \
9844                 && cf_fix_cppflags=no
9845         ;;
9846 esac
9847 done
9848
9849 if test -n "$cf_new_cflags" ; then
9850
9851         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9852         CFLAGS="${CFLAGS}$cf_new_cflags"
9853
9854 fi
9855
9856 if test -n "$cf_new_cppflags" ; then
9857
9858         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9859         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9860
9861 fi
9862
9863 if test -n "$cf_new_extra_cppflags" ; then
9864
9865         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9866         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9867
9868 fi
9869
9870 cf_add_libs="$LIBS"
9871 # reverse order
9872 cf_add_0lib=
9873 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9874 # filter duplicates
9875 for cf_add_1lib in $cf_add_0lib; do
9876         for cf_add_2lib in $cf_add_libs; do
9877                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9878                         cf_add_1lib=
9879                         break
9880                 fi
9881         done
9882         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9883 done
9884 LIBS="$cf_add_libs"
9885
9886                         cat >"conftest.$ac_ext" <<_ACEOF
9887 #line 9887 "configure"
9888 #include "confdefs.h"
9889 #include <${cf_cv_ncurses_header:-curses.h}>
9890 int
9891 main (void)
9892 {
9893 initscr(); mousemask(0,0); tigetstr((char *)0);
9894   ;
9895   return 0;
9896 }
9897 _ACEOF
9898 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9899 if { (eval echo "$as_me:9899: \"$ac_link\"") >&5
9900   (eval $ac_link) 2>&5
9901   ac_status=$?
9902   echo "$as_me:9902: \$? = $ac_status" >&5
9903   (exit "$ac_status"); } &&
9904          { ac_try='test -s "conftest$ac_exeext"'
9905   { (eval echo "$as_me:9905: \"$ac_try\"") >&5
9906   (eval $ac_try) 2>&5
9907   ac_status=$?
9908   echo "$as_me:9908: \$? = $ac_status" >&5
9909   (exit "$ac_status"); }; }; then
9910   if test "$cross_compiling" = yes; then
9911   cf_test_ncuconfig=maybe
9912 else
9913   cat >"conftest.$ac_ext" <<_ACEOF
9914 #line 9914 "configure"
9915 #include "confdefs.h"
9916 #include <${cf_cv_ncurses_header:-curses.h}>
9917                                         int main(void)
9918                                         { const char *xx = curses_version(); return (xx == 0); }
9919 _ACEOF
9920 rm -f "conftest$ac_exeext"
9921 if { (eval echo "$as_me:9921: \"$ac_link\"") >&5
9922   (eval $ac_link) 2>&5
9923   ac_status=$?
9924   echo "$as_me:9924: \$? = $ac_status" >&5
9925   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9926   { (eval echo "$as_me:9926: \"$ac_try\"") >&5
9927   (eval $ac_try) 2>&5
9928   ac_status=$?
9929   echo "$as_me:9929: \$? = $ac_status" >&5
9930   (exit "$ac_status"); }; }; then
9931   cf_test_ncuconfig=yes
9932 else
9933   echo "$as_me: program exited with status $ac_status" >&5
9934 echo "$as_me: failed program was:" >&5
9935 cat "conftest.$ac_ext" >&5
9936 cf_test_ncuconfig=no
9937 fi
9938 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9939 fi
9940 else
9941   echo "$as_me: failed program was:" >&5
9942 cat "conftest.$ac_ext" >&5
9943 cf_test_ncuconfig=no
9944 fi
9945 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9946
9947                         CFLAGS="$cf_save_CFLAGS"
9948                         CPPFLAGS="$cf_save_CPPFLAGS"
9949                         LIBS="$cf_save_LIBS"
9950
9951                         if test "x$cf_test_ncuconfig" != xyes; then
9952                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9953                                 cf_pkg_cflags="$cf_temp"
9954                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9955                                 cf_pkg_libs="$cf_temp"
9956                         fi
9957                         ;;
9958                 esac
9959
9960 for cf_add_cflags in $cf_pkg_cflags
9961 do
9962         case "x$cf_add_cflags" in
9963         (x-[DU]*)
9964
9965 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9966 while true
9967 do
9968         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9969         test "$CFLAGS" != "$cf_old_cflag" || break
9970
9971         CFLAGS="$cf_old_cflag"
9972 done
9973
9974 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9975 while true
9976 do
9977         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
9978         test "$CPPFLAGS" != "$cf_old_cflag" || break
9979
9980         CPPFLAGS="$cf_old_cflag"
9981 done
9982
9983                 ;;
9984         esac
9985
9986 cf_fix_cppflags=no
9987 cf_new_cflags=
9988 cf_new_cppflags=
9989 cf_new_extra_cppflags=
9990
9991 for cf_add_cflags in $cf_add_cflags
9992 do
9993 case "$cf_fix_cppflags" in
9994 (no)
9995         case "$cf_add_cflags" in
9996         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9997                 case "$cf_add_cflags" in
9998                 (-D*)
9999                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10000
10001                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10002                                 && test -z "${cf_tst_cflags}" \
10003                                 && cf_fix_cppflags=yes
10004
10005                         if test "$cf_fix_cppflags" = yes ; then
10006
10007         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10008         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10009
10010                                 continue
10011                         elif test "${cf_tst_cflags}" = "\"'" ; then
10012
10013         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10014         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10015
10016                                 continue
10017                         fi
10018                         ;;
10019                 esac
10020                 case "$CPPFLAGS" in
10021                 (*$cf_add_cflags)
10022                         ;;
10023                 (*)
10024                         case "$cf_add_cflags" in
10025                         (-D*)
10026                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10027
10028 CPPFLAGS=`echo "$CPPFLAGS" | \
10029         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10030                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10031
10032                                 ;;
10033                         esac
10034
10035         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10036         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10037
10038                         ;;
10039                 esac
10040                 ;;
10041         (*)
10042
10043         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10044         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10045
10046                 ;;
10047         esac
10048         ;;
10049 (yes)
10050
10051         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10052         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10053
10054         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10055
10056         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10057                 && test -z "${cf_tst_cflags}" \
10058                 && cf_fix_cppflags=no
10059         ;;
10060 esac
10061 done
10062
10063 if test -n "$cf_new_cflags" ; then
10064
10065         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10066         CFLAGS="${CFLAGS}$cf_new_cflags"
10067
10068 fi
10069
10070 if test -n "$cf_new_cppflags" ; then
10071
10072         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10073         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10074
10075 fi
10076
10077 if test -n "$cf_new_extra_cppflags" ; then
10078
10079         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10080         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10081
10082 fi
10083
10084 done
10085
10086 cf_add_libs="$LIBS"
10087 # reverse order
10088 cf_add_0lib=
10089 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10090 # filter duplicates
10091 for cf_add_1lib in $cf_add_0lib; do
10092         for cf_add_2lib in $cf_add_libs; do
10093                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10094                         cf_add_1lib=
10095                         break
10096                 fi
10097         done
10098         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10099 done
10100 LIBS="$cf_add_libs"
10101
10102                 cat >"conftest.$ac_ext" <<_ACEOF
10103 #line 10103 "configure"
10104 #include "confdefs.h"
10105 #include <${cf_cv_ncurses_header:-curses.h}>
10106 int
10107 main (void)
10108 {
10109 initscr(); mousemask(0,0); tigetstr((char *)0);
10110   ;
10111   return 0;
10112 }
10113 _ACEOF
10114 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10115 if { (eval echo "$as_me:10115: \"$ac_link\"") >&5
10116   (eval $ac_link) 2>&5
10117   ac_status=$?
10118   echo "$as_me:10118: \$? = $ac_status" >&5
10119   (exit "$ac_status"); } &&
10120          { ac_try='test -s "conftest$ac_exeext"'
10121   { (eval echo "$as_me:10121: \"$ac_try\"") >&5
10122   (eval $ac_try) 2>&5
10123   ac_status=$?
10124   echo "$as_me:10124: \$? = $ac_status" >&5
10125   (exit "$ac_status"); }; }; then
10126   if test "$cross_compiling" = yes; then
10127   cf_have_ncuconfig=maybe
10128 else
10129   cat >"conftest.$ac_ext" <<_ACEOF
10130 #line 10130 "configure"
10131 #include "confdefs.h"
10132 #include <${cf_cv_ncurses_header:-curses.h}>
10133                                 int main(void)
10134                                 { const char *xx = curses_version(); return (xx == 0); }
10135 _ACEOF
10136 rm -f "conftest$ac_exeext"
10137 if { (eval echo "$as_me:10137: \"$ac_link\"") >&5
10138   (eval $ac_link) 2>&5
10139   ac_status=$?
10140   echo "$as_me:10140: \$? = $ac_status" >&5
10141   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10142   { (eval echo "$as_me:10142: \"$ac_try\"") >&5
10143   (eval $ac_try) 2>&5
10144   ac_status=$?
10145   echo "$as_me:10145: \$? = $ac_status" >&5
10146   (exit "$ac_status"); }; }; then
10147   cf_have_ncuconfig=yes
10148 else
10149   echo "$as_me: program exited with status $ac_status" >&5
10150 echo "$as_me: failed program was:" >&5
10151 cat "conftest.$ac_ext" >&5
10152 cf_have_ncuconfig=no
10153 fi
10154 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10155 fi
10156 else
10157   echo "$as_me: failed program was:" >&5
10158 cat "conftest.$ac_ext" >&5
10159 cf_have_ncuconfig=no
10160 fi
10161 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10162                 echo "$as_me:10162: result: $cf_have_ncuconfig" >&5
10163 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10164                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10165                 if test "$cf_have_ncuconfig" != "yes"
10166                 then
10167                         CPPFLAGS="$cf_save_CPPFLAGS"
10168                         LIBS="$cf_save_LIBS"
10169                         NCURSES_CONFIG_PKG=none
10170                 else
10171
10172 cat >>confdefs.h <<\EOF
10173 #define NCURSES 1
10174 EOF
10175
10176                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10177
10178 echo "$as_me:10178: checking for terminfo header" >&5
10179 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10180 if test "${cf_cv_term_header+set}" = set; then
10181   echo $ECHO_N "(cached) $ECHO_C" >&6
10182 else
10183
10184 case "${cf_cv_ncurses_header}" in
10185 (*/ncurses.h|*/ncursesw.h)
10186         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10187         ;;
10188 (*)
10189         cf_term_header=term.h
10190         ;;
10191 esac
10192
10193 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10194 do
10195 cat >"conftest.$ac_ext" <<_ACEOF
10196 #line 10196 "configure"
10197 #include "confdefs.h"
10198 #include <stdio.h>
10199 #include <${cf_cv_ncurses_header:-curses.h}>
10200 #include <$cf_test>
10201
10202 int
10203 main (void)
10204 {
10205 int x = auto_left_margin; (void)x
10206   ;
10207   return 0;
10208 }
10209 _ACEOF
10210 rm -f "conftest.$ac_objext"
10211 if { (eval echo "$as_me:10211: \"$ac_compile\"") >&5
10212   (eval $ac_compile) 2>&5
10213   ac_status=$?
10214   echo "$as_me:10214: \$? = $ac_status" >&5
10215   (exit "$ac_status"); } &&
10216          { ac_try='test -s "conftest.$ac_objext"'
10217   { (eval echo "$as_me:10217: \"$ac_try\"") >&5
10218   (eval $ac_try) 2>&5
10219   ac_status=$?
10220   echo "$as_me:10220: \$? = $ac_status" >&5
10221   (exit "$ac_status"); }; }; then
10222
10223         cf_cv_term_header="$cf_test"
10224 else
10225   echo "$as_me: failed program was:" >&5
10226 cat "conftest.$ac_ext" >&5
10227
10228         cf_cv_term_header=unknown
10229
10230 fi
10231 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10232         test "$cf_cv_term_header" != unknown && break
10233 done
10234
10235 fi
10236 echo "$as_me:10236: result: $cf_cv_term_header" >&5
10237 echo "${ECHO_T}$cf_cv_term_header" >&6
10238
10239 # Set definitions to allow ifdef'ing to accommodate subdirectories
10240
10241 case "$cf_cv_term_header" in
10242 (*term.h)
10243
10244 cat >>confdefs.h <<\EOF
10245 #define HAVE_TERM_H 1
10246 EOF
10247
10248         ;;
10249 esac
10250
10251 case "$cf_cv_term_header" in
10252 (ncurses/term.h)
10253
10254 cat >>confdefs.h <<\EOF
10255 #define HAVE_NCURSES_TERM_H 1
10256 EOF
10257
10258         ;;
10259 (ncursesw/term.h)
10260
10261 cat >>confdefs.h <<\EOF
10262 #define HAVE_NCURSESW_TERM_H 1
10263 EOF
10264
10265         ;;
10266 esac
10267
10268                 fi
10269
10270         else
10271                 echo "$as_me:10271: result: no" >&5
10272 echo "${ECHO_T}no" >&6
10273                 NCURSES_CONFIG_PKG=none
10274         fi
10275 else
10276         NCURSES_CONFIG_PKG=none
10277 fi
10278
10279 if test "x$cf_have_ncuconfig" = "xno"; then
10280         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10281
10282 if test -n "$ac_tool_prefix"; then
10283   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10284   do
10285     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10286 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10287 echo "$as_me:10287: checking for $ac_word" >&5
10288 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10289 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10290   echo $ECHO_N "(cached) $ECHO_C" >&6
10291 else
10292   if test -n "$NCURSES_CONFIG"; then
10293   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10294 else
10295   ac_save_IFS=$IFS; IFS=$ac_path_separator
10296 ac_dummy="$PATH"
10297 for ac_dir in $ac_dummy; do
10298   IFS=$ac_save_IFS
10299   test -z "$ac_dir" && ac_dir=.
10300   $as_executable_p "$ac_dir/$ac_word" || continue
10301 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10302 echo "$as_me:10302: found $ac_dir/$ac_word" >&5
10303 break
10304 done
10305
10306 fi
10307 fi
10308 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10309 if test -n "$NCURSES_CONFIG"; then
10310   echo "$as_me:10310: result: $NCURSES_CONFIG" >&5
10311 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10312 else
10313   echo "$as_me:10313: result: no" >&5
10314 echo "${ECHO_T}no" >&6
10315 fi
10316
10317     test -n "$NCURSES_CONFIG" && break
10318   done
10319 fi
10320 if test -z "$NCURSES_CONFIG"; then
10321   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10322   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10323 do
10324   # Extract the first word of "$ac_prog", so it can be a program name with args.
10325 set dummy $ac_prog; ac_word=$2
10326 echo "$as_me:10326: checking for $ac_word" >&5
10327 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10328 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10329   echo $ECHO_N "(cached) $ECHO_C" >&6
10330 else
10331   if test -n "$ac_ct_NCURSES_CONFIG"; then
10332   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10333 else
10334   ac_save_IFS=$IFS; IFS=$ac_path_separator
10335 ac_dummy="$PATH"
10336 for ac_dir in $ac_dummy; do
10337   IFS=$ac_save_IFS
10338   test -z "$ac_dir" && ac_dir=.
10339   $as_executable_p "$ac_dir/$ac_word" || continue
10340 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10341 echo "$as_me:10341: found $ac_dir/$ac_word" >&5
10342 break
10343 done
10344
10345 fi
10346 fi
10347 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10348 if test -n "$ac_ct_NCURSES_CONFIG"; then
10349   echo "$as_me:10349: result: $ac_ct_NCURSES_CONFIG" >&5
10350 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10351 else
10352   echo "$as_me:10352: result: no" >&5
10353 echo "${ECHO_T}no" >&6
10354 fi
10355
10356   test -n "$ac_ct_NCURSES_CONFIG" && break
10357 done
10358 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10359
10360   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10361 fi
10362
10363         if test "$NCURSES_CONFIG" != none ; then
10364
10365 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10366 do
10367         case "x$cf_add_cflags" in
10368         (x-[DU]*)
10369
10370 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10371 while true
10372 do
10373         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10374         test "$CFLAGS" != "$cf_old_cflag" || break
10375
10376         CFLAGS="$cf_old_cflag"
10377 done
10378
10379 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
10380 while true
10381 do
10382         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
10383         test "$CPPFLAGS" != "$cf_old_cflag" || break
10384
10385         CPPFLAGS="$cf_old_cflag"
10386 done
10387
10388                 ;;
10389         esac
10390
10391 cf_fix_cppflags=no
10392 cf_new_cflags=
10393 cf_new_cppflags=
10394 cf_new_extra_cppflags=
10395
10396 for cf_add_cflags in $cf_add_cflags
10397 do
10398 case "$cf_fix_cppflags" in
10399 (no)
10400         case "$cf_add_cflags" in
10401         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10402                 case "$cf_add_cflags" in
10403                 (-D*)
10404                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10405
10406                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10407                                 && test -z "${cf_tst_cflags}" \
10408                                 && cf_fix_cppflags=yes
10409
10410                         if test "$cf_fix_cppflags" = yes ; then
10411
10412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10414
10415                                 continue
10416                         elif test "${cf_tst_cflags}" = "\"'" ; then
10417
10418         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10419         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10420
10421                                 continue
10422                         fi
10423                         ;;
10424                 esac
10425                 case "$CPPFLAGS" in
10426                 (*$cf_add_cflags)
10427                         ;;
10428                 (*)
10429                         case "$cf_add_cflags" in
10430                         (-D*)
10431                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10432
10433 CPPFLAGS=`echo "$CPPFLAGS" | \
10434         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10435                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10436
10437                                 ;;
10438                         esac
10439
10440         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10441         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10442
10443                         ;;
10444                 esac
10445                 ;;
10446         (*)
10447
10448         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10449         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10450
10451                 ;;
10452         esac
10453         ;;
10454 (yes)
10455
10456         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10457         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10458
10459         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
10460
10461         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10462                 && test -z "${cf_tst_cflags}" \
10463                 && cf_fix_cppflags=no
10464         ;;
10465 esac
10466 done
10467
10468 if test -n "$cf_new_cflags" ; then
10469
10470         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10471         CFLAGS="${CFLAGS}$cf_new_cflags"
10472
10473 fi
10474
10475 if test -n "$cf_new_cppflags" ; then
10476
10477         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10478         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10479
10480 fi
10481
10482 if test -n "$cf_new_extra_cppflags" ; then
10483
10484         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10485         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10486
10487 fi
10488
10489 done
10490
10491 cf_add_libs="$LIBS"
10492 # reverse order
10493 cf_add_0lib=
10494 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10495 # filter duplicates
10496 for cf_add_1lib in $cf_add_0lib; do
10497         for cf_add_2lib in $cf_add_libs; do
10498                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10499                         cf_add_1lib=
10500                         break
10501                 fi
10502         done
10503         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10504 done
10505 LIBS="$cf_add_libs"
10506
10507                 # even with config script, some packages use no-override for curses.h
10508
10509 echo "$as_me:10509: checking if we have identified curses headers" >&5
10510 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10511 if test "${cf_cv_ncurses_header+set}" = set; then
10512   echo $ECHO_N "(cached) $ECHO_C" >&6
10513 else
10514
10515 cf_cv_ncurses_header=none
10516 for cf_header in \
10517         ncurses.h $cf_cv_screen/ncurses.h \
10518         curses.h $cf_cv_screen/curses.h
10519 do
10520 cat >"conftest.$ac_ext" <<_ACEOF
10521 #line 10521 "configure"
10522 #include "confdefs.h"
10523 #include <${cf_header}>
10524 int
10525 main (void)
10526 {
10527 initscr(); endwin()
10528   ;
10529   return 0;
10530 }
10531 _ACEOF
10532 rm -f "conftest.$ac_objext"
10533 if { (eval echo "$as_me:10533: \"$ac_compile\"") >&5
10534   (eval $ac_compile) 2>&5
10535   ac_status=$?
10536   echo "$as_me:10536: \$? = $ac_status" >&5
10537   (exit "$ac_status"); } &&
10538          { ac_try='test -s "conftest.$ac_objext"'
10539   { (eval echo "$as_me:10539: \"$ac_try\"") >&5
10540   (eval $ac_try) 2>&5
10541   ac_status=$?
10542   echo "$as_me:10542: \$? = $ac_status" >&5
10543   (exit "$ac_status"); }; }; then
10544   cf_cv_ncurses_header=$cf_header; break
10545 else
10546   echo "$as_me: failed program was:" >&5
10547 cat "conftest.$ac_ext" >&5
10548 fi
10549 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10550 done
10551
10552 fi
10553 echo "$as_me:10553: result: $cf_cv_ncurses_header" >&5
10554 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10555
10556 if test "$cf_cv_ncurses_header" = none ; then
10557         { { echo "$as_me:10557: error: No curses header-files found" >&5
10558 echo "$as_me: error: No curses header-files found" >&2;}
10559    { (exit 1); exit 1; }; }
10560 fi
10561
10562 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10563
10564 for ac_header in $cf_cv_ncurses_header
10565 do
10566 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10567 echo "$as_me:10567: checking for $ac_header" >&5
10568 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10569 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10570   echo $ECHO_N "(cached) $ECHO_C" >&6
10571 else
10572   cat >"conftest.$ac_ext" <<_ACEOF
10573 #line 10573 "configure"
10574 #include "confdefs.h"
10575 #include <$ac_header>
10576 _ACEOF
10577 if { (eval echo "$as_me:10577: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10578   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10579   ac_status=$?
10580   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10581   rm -f conftest.er1
10582   cat conftest.err >&5
10583   echo "$as_me:10583: \$? = $ac_status" >&5
10584   (exit "$ac_status"); } >/dev/null; then
10585   if test -s conftest.err; then
10586     ac_cpp_err=$ac_c_preproc_warn_flag
10587   else
10588     ac_cpp_err=
10589   fi
10590 else
10591   ac_cpp_err=yes
10592 fi
10593 if test -z "$ac_cpp_err"; then
10594   eval "$as_ac_Header=yes"
10595 else
10596   echo "$as_me: failed program was:" >&5
10597   cat "conftest.$ac_ext" >&5
10598   eval "$as_ac_Header=no"
10599 fi
10600 rm -f conftest.err "conftest.$ac_ext"
10601 fi
10602 echo "$as_me:10602: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10603 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10604 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10605   cat >>confdefs.h <<EOF
10606 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10607 EOF
10608
10609 fi
10610 done
10611
10612 cat >>confdefs.h <<\EOF
10613 #define NCURSES 1
10614 EOF
10615
10616 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10617
10618                 cat >>confdefs.h <<EOF
10619 #define $cf_nculib_ROOT 1
10620 EOF
10621
10622                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10623
10624         else
10625
10626 cf_ncuhdr_root=$cf_cv_screen
10627
10628 test -n "$cf_cv_curses_dir" && \
10629 test "$cf_cv_curses_dir" != "no" && { \
10630
10631 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10632   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10633   do
10634         while test "$cf_add_incdir" != /usr/include
10635         do
10636           if test -d "$cf_add_incdir"
10637           then
10638                 cf_have_incdir=no
10639                 if test -n "$CFLAGS$CPPFLAGS" ; then
10640                   # a loop is needed to ensure we can add subdirs of existing dirs
10641                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10642                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10643                           cf_have_incdir=yes; break
10644                         fi
10645                   done
10646                 fi
10647
10648                 if test "$cf_have_incdir" = no ; then
10649                   if test "$cf_add_incdir" = /usr/local/include ; then
10650                         if test "$GCC" = yes
10651                         then
10652                           cf_save_CPPFLAGS=$CPPFLAGS
10653
10654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10655         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10656
10657                           cat >"conftest.$ac_ext" <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660 #include <stdio.h>
10661 int
10662 main (void)
10663 {
10664 printf("Hello")
10665   ;
10666   return 0;
10667 }
10668 _ACEOF
10669 rm -f "conftest.$ac_objext"
10670 if { (eval echo "$as_me:10670: \"$ac_compile\"") >&5
10671   (eval $ac_compile) 2>&5
10672   ac_status=$?
10673   echo "$as_me:10673: \$? = $ac_status" >&5
10674   (exit "$ac_status"); } &&
10675          { ac_try='test -s "conftest.$ac_objext"'
10676   { (eval echo "$as_me:10676: \"$ac_try\"") >&5
10677   (eval $ac_try) 2>&5
10678   ac_status=$?
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit "$ac_status"); }; }; then
10681   :
10682 else
10683   echo "$as_me: failed program was:" >&5
10684 cat "conftest.$ac_ext" >&5
10685 cf_have_incdir=yes
10686 fi
10687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10688                           CPPFLAGS=$cf_save_CPPFLAGS
10689                         fi
10690                   fi
10691                 fi
10692
10693                 if test "$cf_have_incdir" = no ; then
10694                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10695
10696 echo "${as_me:-configure}:10696: testing adding $cf_add_incdir to include-path ..." 1>&5
10697
10698                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10699
10700                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10701                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10702                   cf_add_incdir="$cf_top_incdir"
10703                 else
10704                   break
10705                 fi
10706           else
10707                 break
10708           fi
10709         done
10710   done
10711 fi
10712
10713 }
10714
10715 echo "$as_me:10715: checking for $cf_ncuhdr_root header in include-path" >&5
10716 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10717 if test "${cf_cv_ncurses_h+set}" = set; then
10718   echo $ECHO_N "(cached) $ECHO_C" >&6
10719 else
10720
10721         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10722         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10723         for cf_header in $cf_header_list
10724         do
10725
10726         cat >"conftest.$ac_ext" <<_ACEOF
10727 #line 10727 "configure"
10728 #include "confdefs.h"
10729
10730 #include <$cf_header>
10731 int
10732 main (void)
10733 {
10734
10735 #ifdef NCURSES_VERSION
10736
10737 printf("%s\\n", NCURSES_VERSION);
10738 #else
10739 #ifdef __NCURSES_H
10740 printf("old\\n");
10741 #else
10742         #error __NCURSES_H is not defined
10743 #endif
10744 #endif
10745
10746   ;
10747   return 0;
10748 }
10749 _ACEOF
10750 rm -f "conftest.$ac_objext"
10751 if { (eval echo "$as_me:10751: \"$ac_compile\"") >&5
10752   (eval $ac_compile) 2>&5
10753   ac_status=$?
10754   echo "$as_me:10754: \$? = $ac_status" >&5
10755   (exit "$ac_status"); } &&
10756          { ac_try='test -s "conftest.$ac_objext"'
10757   { (eval echo "$as_me:10757: \"$ac_try\"") >&5
10758   (eval $ac_try) 2>&5
10759   ac_status=$?
10760   echo "$as_me:10760: \$? = $ac_status" >&5
10761   (exit "$ac_status"); }; }; then
10762   cf_cv_ncurses_h=$cf_header
10763
10764 else
10765   echo "$as_me: failed program was:" >&5
10766 cat "conftest.$ac_ext" >&5
10767 cf_cv_ncurses_h=no
10768 fi
10769 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10770
10771                 test "$cf_cv_ncurses_h" != no && break
10772         done
10773
10774 fi
10775 echo "$as_me:10775: result: $cf_cv_ncurses_h" >&5
10776 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10777
10778 if test "$cf_cv_ncurses_h" != no ; then
10779         cf_cv_ncurses_header=$cf_cv_ncurses_h
10780 else
10781
10782 echo "$as_me:10782: checking for $cf_ncuhdr_root include-path" >&5
10783 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10784 if test "${cf_cv_ncurses_h2+set}" = set; then
10785   echo $ECHO_N "(cached) $ECHO_C" >&6
10786 else
10787
10788         test -n "$verbose" && echo
10789
10790 cf_search=
10791
10792 # collect the current set of include-directories from compiler flags
10793 cf_header_path_list=""
10794 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10795         for cf_header_path in $CPPFLAGS $CFLAGS
10796         do
10797                 case "$cf_header_path" in
10798                 (-I*)
10799                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10800
10801 test "x$cf_header_path" != "xNONE" && \
10802 test -d "$cf_header_path" && \
10803  {
10804         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10805         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10806         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10807         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10808         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10809         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"
10810 }
10811
10812                         cf_header_path_list="$cf_header_path_list $cf_search"
10813                         ;;
10814                 esac
10815         done
10816 fi
10817
10818 # add the variations for the package we are looking for
10819
10820 cf_search=
10821
10822 test "x$prefix" != "xNONE" && \
10823 test -d "$prefix" && \
10824  {
10825         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10826         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10827         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10828         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10829         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10830         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10831 }
10832
10833 for cf_subdir_prefix in \
10834         /usr \
10835         /usr/local \
10836         /usr/pkg \
10837         /opt \
10838         /opt/local \
10839         $HOME
10840 do
10841
10842 test "x$cf_subdir_prefix" != "x$prefix" && \
10843 test -d "$cf_subdir_prefix" && \
10844 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10845         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10846         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10847         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10848         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10849         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10850         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"
10851 }
10852
10853 done
10854
10855 test "$includedir" != NONE && \
10856 test "$includedir" != "/usr/include" && \
10857 test -d "$includedir" && {
10858         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10859         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10860 }
10861
10862 test "$oldincludedir" != NONE && \
10863 test "$oldincludedir" != "/usr/include" && \
10864 test -d "$oldincludedir" && {
10865         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10866         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10867 }
10868
10869 cf_search="$cf_search $cf_header_path_list"
10870
10871         test -n "$verbose" && echo "search path $cf_search"
10872         cf_save2_CPPFLAGS="$CPPFLAGS"
10873         for cf_incdir in $cf_search
10874         do
10875
10876 if test -n "$cf_incdir" ; then
10877   for cf_add_incdir in $cf_incdir
10878   do
10879         while test "$cf_add_incdir" != /usr/include
10880         do
10881           if test -d "$cf_add_incdir"
10882           then
10883                 cf_have_incdir=no
10884                 if test -n "$CFLAGS$CPPFLAGS" ; then
10885                   # a loop is needed to ensure we can add subdirs of existing dirs
10886                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10887                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10888                           cf_have_incdir=yes; break
10889                         fi
10890                   done
10891                 fi
10892
10893                 if test "$cf_have_incdir" = no ; then
10894                   if test "$cf_add_incdir" = /usr/local/include ; then
10895                         if test "$GCC" = yes
10896                         then
10897                           cf_save_CPPFLAGS=$CPPFLAGS
10898
10899         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10900         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10901
10902                           cat >"conftest.$ac_ext" <<_ACEOF
10903 #line 10903 "configure"
10904 #include "confdefs.h"
10905 #include <stdio.h>
10906 int
10907 main (void)
10908 {
10909 printf("Hello")
10910   ;
10911   return 0;
10912 }
10913 _ACEOF
10914 rm -f "conftest.$ac_objext"
10915 if { (eval echo "$as_me:10915: \"$ac_compile\"") >&5
10916   (eval $ac_compile) 2>&5
10917   ac_status=$?
10918   echo "$as_me:10918: \$? = $ac_status" >&5
10919   (exit "$ac_status"); } &&
10920          { ac_try='test -s "conftest.$ac_objext"'
10921   { (eval echo "$as_me:10921: \"$ac_try\"") >&5
10922   (eval $ac_try) 2>&5
10923   ac_status=$?
10924   echo "$as_me:10924: \$? = $ac_status" >&5
10925   (exit "$ac_status"); }; }; then
10926   :
10927 else
10928   echo "$as_me: failed program was:" >&5
10929 cat "conftest.$ac_ext" >&5
10930 cf_have_incdir=yes
10931 fi
10932 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10933                           CPPFLAGS=$cf_save_CPPFLAGS
10934                         fi
10935                   fi
10936                 fi
10937
10938                 if test "$cf_have_incdir" = no ; then
10939                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10940
10941 echo "${as_me:-configure}:10941: testing adding $cf_add_incdir to include-path ..." 1>&5
10942
10943                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10944
10945                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10946                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10947                   cf_add_incdir="$cf_top_incdir"
10948                 else
10949                   break
10950                 fi
10951           else
10952                 break
10953           fi
10954         done
10955   done
10956 fi
10957
10958                 for cf_header in \
10959                         ncurses.h \
10960                         curses.h
10961                 do
10962
10963         cat >"conftest.$ac_ext" <<_ACEOF
10964 #line 10964 "configure"
10965 #include "confdefs.h"
10966
10967 #include <$cf_header>
10968 int
10969 main (void)
10970 {
10971
10972 #ifdef NCURSES_VERSION
10973
10974 printf("%s\\n", NCURSES_VERSION);
10975 #else
10976 #ifdef __NCURSES_H
10977 printf("old\\n");
10978 #else
10979         #error __NCURSES_H is not defined
10980 #endif
10981 #endif
10982
10983   ;
10984   return 0;
10985 }
10986 _ACEOF
10987 rm -f "conftest.$ac_objext"
10988 if { (eval echo "$as_me:10988: \"$ac_compile\"") >&5
10989   (eval $ac_compile) 2>&5
10990   ac_status=$?
10991   echo "$as_me:10991: \$? = $ac_status" >&5
10992   (exit "$ac_status"); } &&
10993          { ac_try='test -s "conftest.$ac_objext"'
10994   { (eval echo "$as_me:10994: \"$ac_try\"") >&5
10995   (eval $ac_try) 2>&5
10996   ac_status=$?
10997   echo "$as_me:10997: \$? = $ac_status" >&5
10998   (exit "$ac_status"); }; }; then
10999   cf_cv_ncurses_h2=$cf_header
11000
11001 else
11002   echo "$as_me: failed program was:" >&5
11003 cat "conftest.$ac_ext" >&5
11004 cf_cv_ncurses_h2=no
11005 fi
11006 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11007
11008                         if test "$cf_cv_ncurses_h2" != no ; then
11009                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
11010                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
11011                                 break
11012                         fi
11013                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
11014                 done
11015                 CPPFLAGS="$cf_save2_CPPFLAGS"
11016                 test "$cf_cv_ncurses_h2" != no && break
11017         done
11018         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:11018: error: not found" >&5
11019 echo "$as_me: error: not found" >&2;}
11020    { (exit 1); exit 1; }; }
11021
11022 fi
11023 echo "$as_me:11023: result: $cf_cv_ncurses_h2" >&5
11024 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
11025
11026         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
11027         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
11028         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
11029                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
11030         fi
11031
11032 if test -n "$cf_1st_incdir" ; then
11033   for cf_add_incdir in $cf_1st_incdir
11034   do
11035         while test "$cf_add_incdir" != /usr/include
11036         do
11037           if test -d "$cf_add_incdir"
11038           then
11039                 cf_have_incdir=no
11040                 if test -n "$CFLAGS$CPPFLAGS" ; then
11041                   # a loop is needed to ensure we can add subdirs of existing dirs
11042                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
11043                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
11044                           cf_have_incdir=yes; break
11045                         fi
11046                   done
11047                 fi
11048
11049                 if test "$cf_have_incdir" = no ; then
11050                   if test "$cf_add_incdir" = /usr/local/include ; then
11051                         if test "$GCC" = yes
11052                         then
11053                           cf_save_CPPFLAGS=$CPPFLAGS
11054
11055         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11056         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
11057
11058                           cat >"conftest.$ac_ext" <<_ACEOF
11059 #line 11059 "configure"
11060 #include "confdefs.h"
11061 #include <stdio.h>
11062 int
11063 main (void)
11064 {
11065 printf("Hello")
11066   ;
11067   return 0;
11068 }
11069 _ACEOF
11070 rm -f "conftest.$ac_objext"
11071 if { (eval echo "$as_me:11071: \"$ac_compile\"") >&5
11072   (eval $ac_compile) 2>&5
11073   ac_status=$?
11074   echo "$as_me:11074: \$? = $ac_status" >&5
11075   (exit "$ac_status"); } &&
11076          { ac_try='test -s "conftest.$ac_objext"'
11077   { (eval echo "$as_me:11077: \"$ac_try\"") >&5
11078   (eval $ac_try) 2>&5
11079   ac_status=$?
11080   echo "$as_me:11080: \$? = $ac_status" >&5
11081   (exit "$ac_status"); }; }; then
11082   :
11083 else
11084   echo "$as_me: failed program was:" >&5
11085 cat "conftest.$ac_ext" >&5
11086 cf_have_incdir=yes
11087 fi
11088 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11089                           CPPFLAGS=$cf_save_CPPFLAGS
11090                         fi
11091                   fi
11092                 fi
11093
11094                 if test "$cf_have_incdir" = no ; then
11095                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
11096
11097 echo "${as_me:-configure}:11097: testing adding $cf_add_incdir to include-path ..." 1>&5
11098
11099                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
11100
11101                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
11102                   test "$cf_top_incdir" = "$cf_add_incdir" && break
11103                   cf_add_incdir="$cf_top_incdir"
11104                 else
11105                   break
11106                 fi
11107           else
11108                 break
11109           fi
11110         done
11111   done
11112 fi
11113
11114 fi
11115
11116 # Set definitions to allow ifdef'ing for ncurses.h
11117
11118 case "$cf_cv_ncurses_header" in
11119 (*ncurses.h)
11120
11121 cat >>confdefs.h <<\EOF
11122 #define HAVE_NCURSES_H 1
11123 EOF
11124
11125         ;;
11126 esac
11127
11128 case "$cf_cv_ncurses_header" in
11129 (ncurses/curses.h|ncurses/ncurses.h)
11130
11131 cat >>confdefs.h <<\EOF
11132 #define HAVE_NCURSES_NCURSES_H 1
11133 EOF
11134
11135         ;;
11136 (ncursesw/curses.h|ncursesw/ncurses.h)
11137
11138 cat >>confdefs.h <<\EOF
11139 #define HAVE_NCURSESW_NCURSES_H 1
11140 EOF
11141
11142         ;;
11143 esac
11144
11145 echo "$as_me:11145: checking for terminfo header" >&5
11146 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
11147 if test "${cf_cv_term_header+set}" = set; then
11148   echo $ECHO_N "(cached) $ECHO_C" >&6
11149 else
11150
11151 case "${cf_cv_ncurses_header}" in
11152 (*/ncurses.h|*/ncursesw.h)
11153         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
11154         ;;
11155 (*)
11156         cf_term_header=term.h
11157         ;;
11158 esac
11159
11160 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
11161 do
11162 cat >"conftest.$ac_ext" <<_ACEOF
11163 #line 11163 "configure"
11164 #include "confdefs.h"
11165 #include <stdio.h>
11166 #include <${cf_cv_ncurses_header:-curses.h}>
11167 #include <$cf_test>
11168
11169 int
11170 main (void)
11171 {
11172 int x = auto_left_margin; (void)x
11173   ;
11174   return 0;
11175 }
11176 _ACEOF
11177 rm -f "conftest.$ac_objext"
11178 if { (eval echo "$as_me:11178: \"$ac_compile\"") >&5
11179   (eval $ac_compile) 2>&5
11180   ac_status=$?
11181   echo "$as_me:11181: \$? = $ac_status" >&5
11182   (exit "$ac_status"); } &&
11183          { ac_try='test -s "conftest.$ac_objext"'
11184   { (eval echo "$as_me:11184: \"$ac_try\"") >&5
11185   (eval $ac_try) 2>&5
11186   ac_status=$?
11187   echo "$as_me:11187: \$? = $ac_status" >&5
11188   (exit "$ac_status"); }; }; then
11189
11190         cf_cv_term_header="$cf_test"
11191 else
11192   echo "$as_me: failed program was:" >&5
11193 cat "conftest.$ac_ext" >&5
11194
11195         cf_cv_term_header=unknown
11196
11197 fi
11198 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11199         test "$cf_cv_term_header" != unknown && break
11200 done
11201
11202 fi
11203 echo "$as_me:11203: result: $cf_cv_term_header" >&5
11204 echo "${ECHO_T}$cf_cv_term_header" >&6
11205
11206 # Set definitions to allow ifdef'ing to accommodate subdirectories
11207
11208 case "$cf_cv_term_header" in
11209 (*term.h)
11210
11211 cat >>confdefs.h <<\EOF
11212 #define HAVE_TERM_H 1
11213 EOF
11214
11215         ;;
11216 esac
11217
11218 case "$cf_cv_term_header" in
11219 (ncurses/term.h)
11220
11221 cat >>confdefs.h <<\EOF
11222 #define HAVE_NCURSES_TERM_H 1
11223 EOF
11224
11225         ;;
11226 (ncursesw/term.h)
11227
11228 cat >>confdefs.h <<\EOF
11229 #define HAVE_NCURSESW_TERM_H 1
11230 EOF
11231
11232         ;;
11233 esac
11234
11235 # some applications need this, but should check for NCURSES_VERSION
11236
11237 cat >>confdefs.h <<\EOF
11238 #define NCURSES 1
11239 EOF
11240
11241 echo "$as_me:11241: checking for ncurses version" >&5
11242 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11243 if test "${cf_cv_ncurses_version+set}" = set; then
11244   echo $ECHO_N "(cached) $ECHO_C" >&6
11245 else
11246
11247         cf_cv_ncurses_version=no
11248         cf_tempfile=out$$
11249         rm -f "$cf_tempfile"
11250         if test "$cross_compiling" = yes; then
11251
11252         # This will not work if the preprocessor splits the line after the
11253         # Autoconf token.  The 'unproto' program does that.
11254         cat > "conftest.$ac_ext" <<EOF
11255 #include <${cf_cv_ncurses_header:-curses.h}>
11256 #undef Autoconf
11257 #ifdef NCURSES_VERSION
11258 Autoconf NCURSES_VERSION
11259 #else
11260 #ifdef __NCURSES_H
11261 Autoconf "old"
11262 #endif
11263 ;
11264 #endif
11265 EOF
11266         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11267         { (eval echo "$as_me:11267: \"$cf_try\"") >&5
11268   (eval $cf_try) 2>&5
11269   ac_status=$?
11270   echo "$as_me:11270: \$? = $ac_status" >&5
11271   (exit "$ac_status"); }
11272         if test -f conftest.out ; then
11273                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
11274                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11275                 rm -f conftest.out
11276         fi
11277
11278 else
11279   cat >"conftest.$ac_ext" <<_ACEOF
11280 #line 11280 "configure"
11281 #include "confdefs.h"
11282
11283 $ac_includes_default
11284
11285 #include <${cf_cv_ncurses_header:-curses.h}>
11286
11287 int main(void)
11288 {
11289         FILE *fp = fopen("$cf_tempfile", "w");
11290 #ifdef NCURSES_VERSION
11291 # ifdef NCURSES_VERSION_PATCH
11292         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11293 # else
11294         fprintf(fp, "%s\\n", NCURSES_VERSION);
11295 # endif
11296 #else
11297 # ifdef __NCURSES_H
11298         fprintf(fp, "old\\n");
11299 # else
11300         #error expected ncurses header to define __NCURSES_H
11301 # endif
11302 #endif
11303         ${cf_cv_main_return:-return}(0);
11304 }
11305 _ACEOF
11306 rm -f "conftest$ac_exeext"
11307 if { (eval echo "$as_me:11307: \"$ac_link\"") >&5
11308   (eval $ac_link) 2>&5
11309   ac_status=$?
11310   echo "$as_me:11310: \$? = $ac_status" >&5
11311   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
11312   { (eval echo "$as_me:11312: \"$ac_try\"") >&5
11313   (eval $ac_try) 2>&5
11314   ac_status=$?
11315   echo "$as_me:11315: \$? = $ac_status" >&5
11316   (exit "$ac_status"); }; }; then
11317
11318         cf_cv_ncurses_version=`cat $cf_tempfile`
11319 else
11320   echo "$as_me: program exited with status $ac_status" >&5
11321 echo "$as_me: failed program was:" >&5
11322 cat "conftest.$ac_ext" >&5
11323 fi
11324 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
11325 fi
11326         rm -f "$cf_tempfile"
11327
11328 fi
11329 echo "$as_me:11329: result: $cf_cv_ncurses_version" >&5
11330 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11331 test "$cf_cv_ncurses_version" = no ||
11332 cat >>confdefs.h <<\EOF
11333 #define NCURSES 1
11334 EOF
11335
11336 cf_nculib_root=$cf_cv_screen
11337         # This works, except for the special case where we find gpm, but
11338         # ncurses is in a nonstandard location via $LIBS, and we really want
11339         # to link gpm.
11340 cf_ncurses_LIBS=""
11341 cf_ncurses_SAVE="$LIBS"
11342 echo "$as_me:11342: checking for Gpm_Open in -lgpm" >&5
11343 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11344 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11345   echo $ECHO_N "(cached) $ECHO_C" >&6
11346 else
11347   ac_check_lib_save_LIBS=$LIBS
11348 LIBS="-lgpm  $LIBS"
11349 cat >"conftest.$ac_ext" <<_ACEOF
11350 #line 11350 "configure"
11351 #include "confdefs.h"
11352
11353 /* Override any gcc2 internal prototype to avoid an error.  */
11354 #ifdef __cplusplus
11355 extern "C"
11356 #endif
11357 /* We use char because int might match the return type of a gcc2
11358    builtin and then its argument prototype would still apply.  */
11359 char Gpm_Open (void);
11360 int
11361 main (void)
11362 {
11363 Gpm_Open ();
11364   ;
11365   return 0;
11366 }
11367 _ACEOF
11368 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11369 if { (eval echo "$as_me:11369: \"$ac_link\"") >&5
11370   (eval $ac_link) 2>&5
11371   ac_status=$?
11372   echo "$as_me:11372: \$? = $ac_status" >&5
11373   (exit "$ac_status"); } &&
11374          { ac_try='test -s "conftest$ac_exeext"'
11375   { (eval echo "$as_me:11375: \"$ac_try\"") >&5
11376   (eval $ac_try) 2>&5
11377   ac_status=$?
11378   echo "$as_me:11378: \$? = $ac_status" >&5
11379   (exit "$ac_status"); }; }; then
11380   ac_cv_lib_gpm_Gpm_Open=yes
11381 else
11382   echo "$as_me: failed program was:" >&5
11383 cat "conftest.$ac_ext" >&5
11384 ac_cv_lib_gpm_Gpm_Open=no
11385 fi
11386 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11387 LIBS=$ac_check_lib_save_LIBS
11388 fi
11389 echo "$as_me:11389: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11390 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11391 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
11392   echo "$as_me:11392: checking for initscr in -lgpm" >&5
11393 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11394 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11395   echo $ECHO_N "(cached) $ECHO_C" >&6
11396 else
11397   ac_check_lib_save_LIBS=$LIBS
11398 LIBS="-lgpm  $LIBS"
11399 cat >"conftest.$ac_ext" <<_ACEOF
11400 #line 11400 "configure"
11401 #include "confdefs.h"
11402
11403 /* Override any gcc2 internal prototype to avoid an error.  */
11404 #ifdef __cplusplus
11405 extern "C"
11406 #endif
11407 /* We use char because int might match the return type of a gcc2
11408    builtin and then its argument prototype would still apply.  */
11409 char initscr (void);
11410 int
11411 main (void)
11412 {
11413 initscr ();
11414   ;
11415   return 0;
11416 }
11417 _ACEOF
11418 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11419 if { (eval echo "$as_me:11419: \"$ac_link\"") >&5
11420   (eval $ac_link) 2>&5
11421   ac_status=$?
11422   echo "$as_me:11422: \$? = $ac_status" >&5
11423   (exit "$ac_status"); } &&
11424          { ac_try='test -s "conftest$ac_exeext"'
11425   { (eval echo "$as_me:11425: \"$ac_try\"") >&5
11426   (eval $ac_try) 2>&5
11427   ac_status=$?
11428   echo "$as_me:11428: \$? = $ac_status" >&5
11429   (exit "$ac_status"); }; }; then
11430   ac_cv_lib_gpm_initscr=yes
11431 else
11432   echo "$as_me: failed program was:" >&5
11433 cat "conftest.$ac_ext" >&5
11434 ac_cv_lib_gpm_initscr=no
11435 fi
11436 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11437 LIBS=$ac_check_lib_save_LIBS
11438 fi
11439 echo "$as_me:11439: result: $ac_cv_lib_gpm_initscr" >&5
11440 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11441 if test "$ac_cv_lib_gpm_initscr" = yes; then
11442   LIBS="$cf_ncurses_SAVE"
11443 else
11444   cf_ncurses_LIBS="-lgpm"
11445 fi
11446
11447 fi
11448
11449 case "$host_os" in
11450 (freebsd*)
11451         # This is only necessary if you are linking against an obsolete
11452         # version of ncurses (but it should do no harm, since it is static).
11453         if test "$cf_nculib_root" = ncurses ; then
11454                 echo "$as_me:11454: checking for tgoto in -lmytinfo" >&5
11455 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11456 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11457   echo $ECHO_N "(cached) $ECHO_C" >&6
11458 else
11459   ac_check_lib_save_LIBS=$LIBS
11460 LIBS="-lmytinfo  $LIBS"
11461 cat >"conftest.$ac_ext" <<_ACEOF
11462 #line 11462 "configure"
11463 #include "confdefs.h"
11464
11465 /* Override any gcc2 internal prototype to avoid an error.  */
11466 #ifdef __cplusplus
11467 extern "C"
11468 #endif
11469 /* We use char because int might match the return type of a gcc2
11470    builtin and then its argument prototype would still apply.  */
11471 char tgoto (void);
11472 int
11473 main (void)
11474 {
11475 tgoto ();
11476   ;
11477   return 0;
11478 }
11479 _ACEOF
11480 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11481 if { (eval echo "$as_me:11481: \"$ac_link\"") >&5
11482   (eval $ac_link) 2>&5
11483   ac_status=$?
11484   echo "$as_me:11484: \$? = $ac_status" >&5
11485   (exit "$ac_status"); } &&
11486          { ac_try='test -s "conftest$ac_exeext"'
11487   { (eval echo "$as_me:11487: \"$ac_try\"") >&5
11488   (eval $ac_try) 2>&5
11489   ac_status=$?
11490   echo "$as_me:11490: \$? = $ac_status" >&5
11491   (exit "$ac_status"); }; }; then
11492   ac_cv_lib_mytinfo_tgoto=yes
11493 else
11494   echo "$as_me: failed program was:" >&5
11495 cat "conftest.$ac_ext" >&5
11496 ac_cv_lib_mytinfo_tgoto=no
11497 fi
11498 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11499 LIBS=$ac_check_lib_save_LIBS
11500 fi
11501 echo "$as_me:11501: result: $ac_cv_lib_mytinfo_tgoto" >&5
11502 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11503 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11504   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11505 fi
11506
11507         fi
11508         ;;
11509 esac
11510
11511 cf_add_libs="$LIBS"
11512 # reverse order
11513 cf_add_0lib=
11514 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11515 # filter duplicates
11516 for cf_add_1lib in $cf_add_0lib; do
11517         for cf_add_2lib in $cf_add_libs; do
11518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11519                         cf_add_1lib=
11520                         break
11521                 fi
11522         done
11523         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11524 done
11525 LIBS="$cf_add_libs"
11526
11527 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11528 then
11529
11530 cf_add_libs="$LIBS"
11531 # reverse order
11532 cf_add_0lib=
11533 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11534 # filter duplicates
11535 for cf_add_1lib in $cf_add_0lib; do
11536         for cf_add_2lib in $cf_add_libs; do
11537                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11538                         cf_add_1lib=
11539                         break
11540                 fi
11541         done
11542         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11543 done
11544 LIBS="$cf_add_libs"
11545
11546 else
11547
11548         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11549         cf_libdir=""
11550         echo "$as_me:11550: checking for initscr" >&5
11551 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11552 if test "${ac_cv_func_initscr+set}" = set; then
11553   echo $ECHO_N "(cached) $ECHO_C" >&6
11554 else
11555   cat >"conftest.$ac_ext" <<_ACEOF
11556 #line 11556 "configure"
11557 #include "confdefs.h"
11558 #define initscr autoconf_temporary
11559 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11560 #undef initscr
11561
11562 #ifdef __cplusplus
11563 extern "C"
11564 #endif
11565
11566 /* We use char because int might match the return type of a gcc2
11567    builtin and then its argument prototype would still apply.  */
11568 char initscr (void);
11569
11570 int
11571 main (void)
11572 {
11573
11574 /* The GNU C library defines stubs for functions which it implements
11575     to always fail with ENOSYS.  Some functions are actually named
11576     something starting with __ and the normal name is an alias.  */
11577 #if defined (__stub_initscr) || defined (__stub___initscr)
11578 #error found stub for initscr
11579 #endif
11580
11581         return initscr ();
11582   ;
11583   return 0;
11584 }
11585 _ACEOF
11586 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11587 if { (eval echo "$as_me:11587: \"$ac_link\"") >&5
11588   (eval $ac_link) 2>&5
11589   ac_status=$?
11590   echo "$as_me:11590: \$? = $ac_status" >&5
11591   (exit "$ac_status"); } &&
11592          { ac_try='test -s "conftest$ac_exeext"'
11593   { (eval echo "$as_me:11593: \"$ac_try\"") >&5
11594   (eval $ac_try) 2>&5
11595   ac_status=$?
11596   echo "$as_me:11596: \$? = $ac_status" >&5
11597   (exit "$ac_status"); }; }; then
11598   ac_cv_func_initscr=yes
11599 else
11600   echo "$as_me: failed program was:" >&5
11601 cat "conftest.$ac_ext" >&5
11602 ac_cv_func_initscr=no
11603 fi
11604 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11605 fi
11606 echo "$as_me:11606: result: $ac_cv_func_initscr" >&5
11607 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11608 if test "$ac_cv_func_initscr" = yes; then
11609   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11610 else
11611
11612                 cf_save_LIBS="$LIBS"
11613                 echo "$as_me:11613: checking for initscr in -l$cf_nculib_root" >&5
11614 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11615                 LIBS="-l$cf_nculib_root $LIBS"
11616                 cat >"conftest.$ac_ext" <<_ACEOF
11617 #line 11617 "configure"
11618 #include "confdefs.h"
11619 #include <${cf_cv_ncurses_header:-curses.h}>
11620 int
11621 main (void)
11622 {
11623 initscr()
11624   ;
11625   return 0;
11626 }
11627 _ACEOF
11628 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11629 if { (eval echo "$as_me:11629: \"$ac_link\"") >&5
11630   (eval $ac_link) 2>&5
11631   ac_status=$?
11632   echo "$as_me:11632: \$? = $ac_status" >&5
11633   (exit "$ac_status"); } &&
11634          { ac_try='test -s "conftest$ac_exeext"'
11635   { (eval echo "$as_me:11635: \"$ac_try\"") >&5
11636   (eval $ac_try) 2>&5
11637   ac_status=$?
11638   echo "$as_me:11638: \$? = $ac_status" >&5
11639   (exit "$ac_status"); }; }; then
11640   echo "$as_me:11640: result: yes" >&5
11641 echo "${ECHO_T}yes" >&6
11642                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11643
11644 else
11645   echo "$as_me: failed program was:" >&5
11646 cat "conftest.$ac_ext" >&5
11647 echo "$as_me:11647: result: no" >&5
11648 echo "${ECHO_T}no" >&6
11649
11650 cf_search=
11651 cf_library_path_list=""
11652 if test -n "${LDFLAGS}${LIBS}" ; then
11653         for cf_library_path in $LDFLAGS $LIBS
11654         do
11655                 case "$cf_library_path" in
11656                 (-L*)
11657                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11658
11659 test "x$cf_library_path" != "xNONE" && \
11660 test -d "$cf_library_path" && \
11661  {
11662         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11663         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11664         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11665         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11666         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11667         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"
11668 }
11669
11670                         cf_library_path_list="$cf_library_path_list $cf_search"
11671                         ;;
11672                 esac
11673         done
11674 fi
11675
11676 cf_search=
11677
11678 test "x$prefix" != "xNONE" && \
11679 test -d "$prefix" && \
11680  {
11681         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11682         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11683         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11684         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11685         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11686         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11687 }
11688
11689 for cf_subdir_prefix in \
11690         /usr \
11691         /usr/local \
11692         /usr/pkg \
11693         /opt \
11694         /opt/local \
11695         $HOME
11696 do
11697
11698 test "x$cf_subdir_prefix" != "x$prefix" && \
11699 test -d "$cf_subdir_prefix" && \
11700 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11701         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11702         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11703         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11704         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11705         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11706         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"
11707 }
11708
11709 done
11710
11711 cf_search="$cf_library_path_list $cf_search"
11712
11713                         for cf_libdir in $cf_search
11714                         do
11715                                 echo "$as_me:11715: checking for -l$cf_nculib_root in $cf_libdir" >&5
11716 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11717                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11718                                 cat >"conftest.$ac_ext" <<_ACEOF
11719 #line 11719 "configure"
11720 #include "confdefs.h"
11721 #include <${cf_cv_ncurses_header:-curses.h}>
11722 int
11723 main (void)
11724 {
11725 initscr()
11726   ;
11727   return 0;
11728 }
11729 _ACEOF
11730 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11731 if { (eval echo "$as_me:11731: \"$ac_link\"") >&5
11732   (eval $ac_link) 2>&5
11733   ac_status=$?
11734   echo "$as_me:11734: \$? = $ac_status" >&5
11735   (exit "$ac_status"); } &&
11736          { ac_try='test -s "conftest$ac_exeext"'
11737   { (eval echo "$as_me:11737: \"$ac_try\"") >&5
11738   (eval $ac_try) 2>&5
11739   ac_status=$?
11740   echo "$as_me:11740: \$? = $ac_status" >&5
11741   (exit "$ac_status"); }; }; then
11742   echo "$as_me:11742: result: yes" >&5
11743 echo "${ECHO_T}yes" >&6
11744                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11745                                          break
11746 else
11747   echo "$as_me: failed program was:" >&5
11748 cat "conftest.$ac_ext" >&5
11749 echo "$as_me:11749: result: no" >&5
11750 echo "${ECHO_T}no" >&6
11751                                          LIBS="$cf_save_LIBS"
11752 fi
11753 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11754                         done
11755
11756 fi
11757 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11758
11759 fi
11760
11761 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11762
11763 if test "$cf_found_library" = no ; then
11764         { { echo "$as_me:11764: error: Cannot link $cf_nculib_root library" >&5
11765 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11766    { (exit 1); exit 1; }; }
11767 fi
11768
11769 fi
11770
11771 if test -n "$cf_ncurses_LIBS" ; then
11772         echo "$as_me:11772: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11773 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11774         cf_ncurses_SAVE="$LIBS"
11775         for p in $cf_ncurses_LIBS ; do
11776                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11777                 if test "$q" != "$LIBS" ; then
11778                         LIBS="$q"
11779                 fi
11780         done
11781         cat >"conftest.$ac_ext" <<_ACEOF
11782 #line 11782 "configure"
11783 #include "confdefs.h"
11784 #include <${cf_cv_ncurses_header:-curses.h}>
11785 int
11786 main (void)
11787 {
11788 initscr(); mousemask(0,0); tigetstr((char *)0);
11789   ;
11790   return 0;
11791 }
11792 _ACEOF
11793 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11794 if { (eval echo "$as_me:11794: \"$ac_link\"") >&5
11795   (eval $ac_link) 2>&5
11796   ac_status=$?
11797   echo "$as_me:11797: \$? = $ac_status" >&5
11798   (exit "$ac_status"); } &&
11799          { ac_try='test -s "conftest$ac_exeext"'
11800   { (eval echo "$as_me:11800: \"$ac_try\"") >&5
11801   (eval $ac_try) 2>&5
11802   ac_status=$?
11803   echo "$as_me:11803: \$? = $ac_status" >&5
11804   (exit "$ac_status"); }; }; then
11805   echo "$as_me:11805: result: yes" >&5
11806 echo "${ECHO_T}yes" >&6
11807 else
11808   echo "$as_me: failed program was:" >&5
11809 cat "conftest.$ac_ext" >&5
11810 echo "$as_me:11810: result: no" >&5
11811 echo "${ECHO_T}no" >&6
11812                  LIBS="$cf_ncurses_SAVE"
11813 fi
11814 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11815 fi
11816
11817 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11818
11819 cat >>confdefs.h <<EOF
11820 #define $cf_nculib_ROOT 1
11821 EOF
11822
11823         fi
11824 else
11825         NCURSES_CONFIG=none
11826 fi
11827
11828         ;;
11829 (*)
11830         { { echo "$as_me:11830: error: unexpected screen-value: $cf_cv_screen" >&5
11831 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
11832    { (exit 1); exit 1; }; }
11833         ;;
11834 esac
11835
11836 if test "$NCURSES_CONFIG_PKG" != none ; then
11837         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11838
11839         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11840         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11841         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11842
11843         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11844         if test -z "$cf_cv_abi_version"
11845         then
11846                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11847         fi
11848
11849 elif test "$NCURSES_CONFIG" != none ; then
11850
11851         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11852
11853         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11854         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11855         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11856
11857         # ABI version is not available from headers
11858         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11859
11860 else
11861
11862         for cf_name in MAJOR MINOR PATCH
11863         do
11864         cat >conftest.$ac_ext <<CF_EOF
11865         #include <${cf_cv_ncurses_header:-curses.h}>
11866         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11867 CF_EOF
11868                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11869                 { (eval echo "$as_me:11869: \"$cf_try\"") >&5
11870   (eval $cf_try) 2>&5
11871   ac_status=$?
11872   echo "$as_me:11872: \$? = $ac_status" >&5
11873   (exit "$ac_status"); }
11874                 if test -f conftest.out ; then
11875                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11876                         eval NCURSES_$cf_name=\"$cf_result\"
11877                         # cat conftest.$ac_ext
11878                         # cat conftest.out
11879                 fi
11880         done
11881
11882         cf_cv_abi_version=${NCURSES_MAJOR}
11883
11884 fi
11885
11886 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11887
11888 cf_cv_timestamp=`date`
11889
11890 echo "$as_me:11890: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11891 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11892
11893 echo "$as_me:11893: checking if KEY_RESIZE is supported" >&5
11894 echo $ECHO_N "checking if KEY_RESIZE is supported... $ECHO_C" >&6
11895 if test "${cf_cv_curses_resizes+set}" = set; then
11896   echo $ECHO_N "(cached) $ECHO_C" >&6
11897 else
11898
11899         cat >"conftest.$ac_ext" <<_ACEOF
11900 #line 11900 "configure"
11901 #include "confdefs.h"
11902 #include <${cf_cv_ncurses_header:-curses.h}>
11903 int
11904 main (void)
11905 {
11906 int key = KEY_RESIZE; (void)key
11907   ;
11908   return 0;
11909 }
11910 _ACEOF
11911 rm -f "conftest.$ac_objext"
11912 if { (eval echo "$as_me:11912: \"$ac_compile\"") >&5
11913   (eval $ac_compile) 2>&5
11914   ac_status=$?
11915   echo "$as_me:11915: \$? = $ac_status" >&5
11916   (exit "$ac_status"); } &&
11917          { ac_try='test -s "conftest.$ac_objext"'
11918   { (eval echo "$as_me:11918: \"$ac_try\"") >&5
11919   (eval $ac_try) 2>&5
11920   ac_status=$?
11921   echo "$as_me:11921: \$? = $ac_status" >&5
11922   (exit "$ac_status"); }; }; then
11923   cf_cv_curses_resizes=yes
11924 else
11925   echo "$as_me: failed program was:" >&5
11926 cat "conftest.$ac_ext" >&5
11927 cf_cv_curses_resizes=no
11928 fi
11929 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11930 fi
11931 echo "$as_me:11931: result: $cf_cv_curses_resizes" >&5
11932 echo "${ECHO_T}$cf_cv_curses_resizes" >&6
11933 cf_cv_enable_sigwinch=0
11934 test "$cf_cv_curses_resizes" = yes && cf_cv_enable_sigwinch=1
11935
11936 echo "$as_me:11936: checking if you want to have a library-prefix" >&5
11937 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11938
11939 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11940 if test "${with_lib_prefix+set}" = set; then
11941   withval="$with_lib_prefix"
11942   with_lib_prefix=$withval
11943 else
11944   with_lib_prefix=auto
11945 fi;
11946 echo "$as_me:11946: result: $with_lib_prefix" >&5
11947 echo "${ECHO_T}$with_lib_prefix" >&6
11948
11949 if test "$with_lib_prefix" = auto
11950 then
11951
11952         case "$cf_cv_system_name" in
11953         (OS/2*|os2*)
11954                 if test "$DFT_LWR_MODEL" = libtool; then
11955                         LIB_PREFIX='lib'
11956                 else
11957                         LIB_PREFIX=''
11958                 fi
11959                 ;;
11960         (*-msvc*)
11961                 LIB_PREFIX=''
11962                 ;;
11963         (*)     LIB_PREFIX='lib'
11964                 ;;
11965         esac
11966 cf_prefix=$LIB_PREFIX
11967
11968 elif test "$with_lib_prefix" = no
11969 then
11970         LIB_PREFIX=
11971 else
11972         LIB_PREFIX=$with_lib_prefix
11973 fi
11974
11975 LIB_SUFFIX=
11976
11977 ###############################################################################
11978
11979 if test X"$CC_G_OPT" = X"" ; then
11980         CC_G_OPT='-g'
11981         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11982 fi
11983
11984 echo "$as_me:11984: checking for default loader flags" >&5
11985 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11986 case $DFT_LWR_MODEL in
11987 (normal)  LD_MODEL=''   ;;
11988 (debug)   LD_MODEL=$CC_G_OPT ;;
11989 (profile) LD_MODEL='-pg';;
11990 (shared)  LD_MODEL=''   ;;
11991 esac
11992 echo "$as_me:11992: result: $LD_MODEL" >&5
11993 echo "${ECHO_T}$LD_MODEL" >&6
11994
11995 LD_RPATH_OPT=
11996 if test "x$cf_cv_enable_rpath" != xno
11997 then
11998         echo "$as_me:11998: checking for an rpath option" >&5
11999 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
12000         case "$cf_cv_system_name" in
12001         (irix*)
12002                 if test "$GCC" = yes; then
12003                         LD_RPATH_OPT="-Wl,-rpath,"
12004                 else
12005                         LD_RPATH_OPT="-rpath "
12006                 fi
12007                 ;;
12008         (linux*|gnu*|k*bsd*-gnu|freebsd*)
12009                 LD_RPATH_OPT="-Wl,-rpath,"
12010                 ;;
12011         (openbsd[2-9].*|mirbsd*)
12012                 LD_RPATH_OPT="-Wl,-rpath,"
12013                 ;;
12014         (dragonfly*)
12015                 LD_RPATH_OPT="-rpath "
12016                 ;;
12017         (netbsd*)
12018                 LD_RPATH_OPT="-Wl,-rpath,"
12019                 ;;
12020         (osf*|mls+*)
12021                 LD_RPATH_OPT="-rpath "
12022                 ;;
12023         (solaris2*)
12024                 LD_RPATH_OPT="-R"
12025                 ;;
12026         (*)
12027                 ;;
12028         esac
12029         echo "$as_me:12029: result: $LD_RPATH_OPT" >&5
12030 echo "${ECHO_T}$LD_RPATH_OPT" >&6
12031
12032         case "x$LD_RPATH_OPT" in
12033         (x-R*)
12034                 echo "$as_me:12034: checking if we need a space after rpath option" >&5
12035 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
12036                 cf_save_LIBS="$LIBS"
12037
12038 cf_add_libs="$LIBS"
12039 # reverse order
12040 cf_add_0lib=
12041 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12042 # filter duplicates
12043 for cf_add_1lib in $cf_add_0lib; do
12044         for cf_add_2lib in $cf_add_libs; do
12045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12046                         cf_add_1lib=
12047                         break
12048                 fi
12049         done
12050         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12051 done
12052 LIBS="$cf_add_libs"
12053
12054                 cat >"conftest.$ac_ext" <<_ACEOF
12055 #line 12055 "configure"
12056 #include "confdefs.h"
12057
12058 int
12059 main (void)
12060 {
12061
12062   ;
12063   return 0;
12064 }
12065 _ACEOF
12066 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12067 if { (eval echo "$as_me:12067: \"$ac_link\"") >&5
12068   (eval $ac_link) 2>&5
12069   ac_status=$?
12070   echo "$as_me:12070: \$? = $ac_status" >&5
12071   (exit "$ac_status"); } &&
12072          { ac_try='test -s "conftest$ac_exeext"'
12073   { (eval echo "$as_me:12073: \"$ac_try\"") >&5
12074   (eval $ac_try) 2>&5
12075   ac_status=$?
12076   echo "$as_me:12076: \$? = $ac_status" >&5
12077   (exit "$ac_status"); }; }; then
12078   cf_rpath_space=no
12079 else
12080   echo "$as_me: failed program was:" >&5
12081 cat "conftest.$ac_ext" >&5
12082 cf_rpath_space=yes
12083 fi
12084 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12085                 LIBS="$cf_save_LIBS"
12086                 echo "$as_me:12086: result: $cf_rpath_space" >&5
12087 echo "${ECHO_T}$cf_rpath_space" >&6
12088                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
12089                 ;;
12090         esac
12091 fi
12092
12093         RM_SHARED_OPTS=
12094         LOCAL_LDFLAGS=
12095         LOCAL_LDFLAGS2=
12096         LD_SHARED_OPTS=
12097         INSTALL_LIB="-m 644"
12098         : ${rel_builddir:=.}
12099
12100         shlibdir=$libdir
12101
12102         MAKE_DLLS="#"
12103
12104         cf_cv_do_symlinks=no
12105         cf_ld_rpath_opt=
12106         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
12107
12108         echo "$as_me:12108: checking whether to use release or ABI version in shared library file names" >&5
12109 echo $ECHO_N "checking whether to use release or ABI version in shared library file names... $ECHO_C" >&6
12110
12111 # Check whether --with-shlib-version or --without-shlib-version was given.
12112 if test "${with_shlib_version+set}" = set; then
12113   withval="$with_shlib_version"
12114   test -z "$withval" && withval=auto
12115         case "$withval" in
12116         (yes)
12117                 cf_cv_shlib_version=auto
12118                 ;;
12119         (rel|abi|auto)
12120                 cf_cv_shlib_version=$withval
12121                 ;;
12122         (*)
12123                 echo "$as_me:12123: result: $withval" >&5
12124 echo "${ECHO_T}$withval" >&6
12125                 { { echo "$as_me:12125: error: option value must be one of: rel, abi, or auto" >&5
12126 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
12127    { (exit 1); exit 1; }; }
12128                 ;;
12129         esac
12130
12131 else
12132   cf_cv_shlib_version=auto
12133 fi;
12134         echo "$as_me:12134: result: $cf_cv_shlib_version" >&5
12135 echo "${ECHO_T}$cf_cv_shlib_version" >&6
12136
12137         cf_cv_rm_so_locs=no
12138         cf_try_cflags=
12139
12140         # Some less-capable ports of gcc support only -fpic
12141         CC_SHARED_OPTS=
12142
12143         cf_try_fPIC=no
12144         if test "$GCC" = yes
12145         then
12146                 cf_try_fPIC=yes
12147         else
12148                 case "$cf_cv_system_name" in
12149                 (*linux*)       # e.g., PGI compiler
12150                         cf_try_fPIC=yes
12151                         ;;
12152                 esac
12153         fi
12154
12155         if test "$cf_try_fPIC" = yes
12156         then
12157                 echo "$as_me:12157: checking which $CC option to use" >&5
12158 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
12159                 cf_save_CFLAGS="$CFLAGS"
12160                 for CC_SHARED_OPTS in -fPIC -fpic ''
12161                 do
12162                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
12163                         cat >"conftest.$ac_ext" <<_ACEOF
12164 #line 12164 "configure"
12165 #include "confdefs.h"
12166 #include <stdio.h>
12167 int
12168 main (void)
12169 {
12170 int x = 1; (void)x
12171   ;
12172   return 0;
12173 }
12174 _ACEOF
12175 rm -f "conftest.$ac_objext"
12176 if { (eval echo "$as_me:12176: \"$ac_compile\"") >&5
12177   (eval $ac_compile) 2>&5
12178   ac_status=$?
12179   echo "$as_me:12179: \$? = $ac_status" >&5
12180   (exit "$ac_status"); } &&
12181          { ac_try='test -s "conftest.$ac_objext"'
12182   { (eval echo "$as_me:12182: \"$ac_try\"") >&5
12183   (eval $ac_try) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit "$ac_status"); }; }; then
12187   break
12188 else
12189   echo "$as_me: failed program was:" >&5
12190 cat "conftest.$ac_ext" >&5
12191 fi
12192 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12193                 done
12194                 echo "$as_me:12194: result: $CC_SHARED_OPTS" >&5
12195 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
12196                 CFLAGS="$cf_save_CFLAGS"
12197         fi
12198
12199         cf_cv_shlib_version_infix=no
12200
12201         case "$cf_cv_system_name" in
12202         (aix4.3-9*|aix[5-7]*)
12203                 if test "$GCC" = yes; then
12204                         CC_SHARED_OPTS='-Wl,-brtl'
12205                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
12206                 else
12207                         CC_SHARED_OPTS='-brtl'
12208                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
12209                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
12210                 fi
12211                 ;;
12212         (beos*)
12213                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
12214                 ;;
12215         (cygwin*)
12216                 CC_SHARED_OPTS=
12217                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12218                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12219                 cf_cv_shlib_version=cygdll
12220                 cf_cv_shlib_version_infix=cygdll
12221                 shlibdir=$bindir
12222                 MAKE_DLLS=
12223                 cat >mk_shared_lib.sh <<-CF_EOF
12224                 #!$SHELL
12225                 SHARED_LIB=\$1
12226                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
12227                 shift
12228                 cat <<-EOF
12229                 Linking shared library
12230                 ** SHARED_LIB \$SHARED_LIB
12231                 ** IMPORT_LIB \$IMPORT_LIB
12232 EOF
12233                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12234 CF_EOF
12235                 chmod +x mk_shared_lib.sh
12236                 ;;
12237         (msys*)
12238                 CC_SHARED_OPTS=
12239                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12240                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12241                 cf_cv_shlib_version=msysdll
12242                 cf_cv_shlib_version_infix=msysdll
12243                 shlibdir=$bindir
12244                 MAKE_DLLS=
12245                 cat >mk_shared_lib.sh <<-CF_EOF
12246                 #!$SHELL
12247                 SHARED_LIB=\$1
12248                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
12249                 shift
12250                 cat <<-EOF
12251                 Linking shared library
12252                 ** SHARED_LIB \$SHARED_LIB
12253                 ** IMPORT_LIB \$IMPORT_LIB
12254 EOF
12255                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12256 CF_EOF
12257                 chmod +x mk_shared_lib.sh
12258                 ;;
12259         (darwin*)
12260                 cf_try_cflags="no-cpp-precomp"
12261                 CC_SHARED_OPTS="-dynamic"
12262                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
12263                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
12264                 cf_cv_shlib_version_infix=yes
12265                 echo "$as_me:12265: checking if ld -search_paths_first works" >&5
12266 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
12267 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
12268   echo $ECHO_N "(cached) $ECHO_C" >&6
12269 else
12270
12271                         cf_save_LDFLAGS=$LDFLAGS
12272                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
12273                         cat >"conftest.$ac_ext" <<_ACEOF
12274 #line 12274 "configure"
12275 #include "confdefs.h"
12276
12277 int
12278 main (void)
12279 {
12280 int i;
12281   ;
12282   return 0;
12283 }
12284 _ACEOF
12285 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
12286 if { (eval echo "$as_me:12286: \"$ac_link\"") >&5
12287   (eval $ac_link) 2>&5
12288   ac_status=$?
12289   echo "$as_me:12289: \$? = $ac_status" >&5
12290   (exit "$ac_status"); } &&
12291          { ac_try='test -s "conftest$ac_exeext"'
12292   { (eval echo "$as_me:12292: \"$ac_try\"") >&5
12293   (eval $ac_try) 2>&5
12294   ac_status=$?
12295   echo "$as_me:12295: \$? = $ac_status" >&5
12296   (exit "$ac_status"); }; }; then
12297   cf_cv_ldflags_search_paths_first=yes
12298 else
12299   echo "$as_me: failed program was:" >&5
12300 cat "conftest.$ac_ext" >&5
12301 cf_cv_ldflags_search_paths_first=no
12302 fi
12303 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
12304                                 LDFLAGS=$cf_save_LDFLAGS
12305 fi
12306 echo "$as_me:12306: result: $cf_cv_ldflags_search_paths_first" >&5
12307 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
12308                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
12309                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
12310                 fi
12311                 ;;
12312         (haiku*)
12313
12314         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12315         if test "$cf_cv_shlib_version" = rel; then
12316                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12317         else
12318                 cf_cv_shared_soname='`basename $@`'
12319         fi
12320
12321                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12322                 ;;
12323         (hpux[7-8]*)
12324                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
12325                 if test "$GCC" != yes; then
12326                         CC_SHARED_OPTS='+Z'
12327                 fi
12328                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
12329                 INSTALL_LIB="-m 555"
12330                 ;;
12331         (hpux*)
12332                 # (tested with gcc 2.7.2 -- I don't have c89)
12333                 if test "$GCC" = yes; then
12334                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
12335                 else
12336                         CC_SHARED_OPTS='+Z'
12337                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
12338                 fi
12339                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
12340                 # HP-UX shared libraries must be executable, and should be
12341                 # readonly to exploit a quirk in the memory manager.
12342                 INSTALL_LIB="-m 555"
12343                 ;;
12344         (interix*)
12345                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12346                 if test "$cf_cv_shlib_version" = rel; then
12347                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12348                 else
12349                         cf_shared_soname='`basename $@`'
12350                 fi
12351                 CC_SHARED_OPTS=
12352                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
12353                 ;;
12354         (irix*)
12355                 if test "$cf_cv_enable_rpath" = yes ; then
12356                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12357                 fi
12358                 # tested with IRIX 5.2 and 'cc'.
12359                 if test "$GCC" != yes; then
12360                         CC_SHARED_OPTS='-KPIC'
12361                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
12362                 else
12363                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
12364                 fi
12365                 cf_cv_rm_so_locs=yes
12366                 ;;
12367         (linux*|gnu*|k*bsd*-gnu)
12368                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12369                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12370                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12371                 fi
12372                 if test "$cf_cv_enable_rpath" = yes ; then
12373                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12374                 fi
12375
12376         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12377         if test "$cf_cv_shlib_version" = rel; then
12378                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12379         else
12380                 cf_cv_shared_soname='`basename $@`'
12381         fi
12382
12383                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12384                 ;;
12385         (mingw*msvc*)
12386                 cf_cv_shlib_version=msvcdll
12387                 cf_cv_shlib_version_infix=msvcdll
12388                 shlibdir=$bindir
12389                 MAKE_DLLS=
12390                 if test "$DFT_LWR_MODEL" = "shared" ; then
12391                         LOCAL_LDFLAGS="-link -dll"
12392                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12393                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
12394                 fi
12395                 CC_SHARED_OPTS=
12396                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
12397                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
12398                 cat >mk_shared_lib.sh <<-CF_EOF
12399                 #!$SHELL
12400                 SHARED_LIB=\$1
12401                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
12402                 shift
12403                 my_ld=\$1
12404                 shift
12405                 cat <<-EOF
12406                 Linking shared library
12407                 ** SHARED LIB \$SHARED_LIB
12408                 ** IMPORT_LIB \$IMPORT_LIB
12409 EOF
12410                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
12411                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
12412                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
12413 CF_EOF
12414                 chmod +x mk_shared_lib.sh
12415                 cat >mk_prog.sh <<-CF_EOF
12416                 #!$SHELL
12417                 shift
12418                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
12419                 LD="$LD"
12420                 clopts=()
12421                 ldopts=("/subsystem:console")
12422                 libs=()
12423                 isdll=0
12424                 while test \$# -gt 0; do
12425                         case "\$1" in
12426                                 -link)
12427                                         # ignore -link argument
12428                                         ;;
12429                                 -M[TD] | -M[TD]d)
12430                                         # ignore runtime-library option
12431                                         ;;
12432                                 -dll)
12433                                         isdll=1
12434                                         ;;
12435                                 -W* | -w*)
12436                                         # ignore warnings
12437                                         ;;
12438                                 -D*)
12439                                         clopts+=("\$1")
12440                                         ;;
12441                                 -I*)
12442                                         clopts+=("\$1")
12443                                         ;;
12444                                 -l*)
12445                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
12446                                         ;;
12447                                 -L*)
12448                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
12449                                         ;;
12450                                 *.obj | *.o)
12451                                         ldopts+=("\$1")
12452                                         ;;
12453                                 -Wl,*)
12454                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
12455                                                 ldopts+=("\${linkarg}")
12456                                         done
12457                                         ;;
12458                                 *.lib)
12459                                         ldopts+=("\$1")
12460                                         ;;
12461                                 -o)
12462                                         shift
12463                                         ldopts+=("-out:\$1")
12464                                         ;;
12465                                 *)
12466                                         clopts+=("\$1")
12467                                         ldopts+=("\$1")
12468                                         ;;
12469                         esac
12470                         shift
12471                 done
12472                 if [ "\$isdll" -ne 0 ]; then
12473                         for lib in \${libs[*]}; do
12474                                 ldopts+=("\$lib.dll.lib")
12475                         done
12476                 else
12477                         for lib in \${libs[*]}; do
12478                                 ldopts+=("\$lib.lib")
12479                         done
12480                 fi
12481                 cat <<-EOF
12482                 Creating program
12483                 ** ld options:   "\${ldopts[@]}"
12484 EOF
12485                 exec \$LD \${ldopts[@]}
12486 CF_EOF
12487                 chmod +x mk_prog.sh
12488                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
12489                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
12490                 ;;
12491         (mingw*)
12492                 cf_cv_shlib_version=mingw
12493                 cf_cv_shlib_version_infix=mingw
12494                 shlibdir=$bindir
12495                 MAKE_DLLS=
12496                 if test "$DFT_LWR_MODEL" = "shared" ; then
12497                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
12498                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12499                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
12500                 fi
12501                 CC_SHARED_OPTS=
12502                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
12503                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
12504                 cat >mk_shared_lib.sh <<-CF_EOF
12505                 #!$SHELL
12506                 SHARED_LIB=\$1
12507                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
12508                 shift
12509                 cat <<-EOF
12510                 Linking shared library
12511                 ** SHARED_LIB \$SHARED_LIB
12512                 ** IMPORT_LIB \$IMPORT_LIB
12513 EOF
12514                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
12515 CF_EOF
12516                 chmod +x mk_shared_lib.sh
12517                 ;;
12518         (openbsd[2-9].*|mirbsd*)
12519                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12520                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12521                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12522                 fi
12523                 if test "$cf_cv_enable_rpath" = yes ; then
12524                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12525                 fi
12526                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12527
12528         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12529         if test "$cf_cv_shlib_version" = rel; then
12530                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12531         else
12532                 cf_cv_shared_soname='`basename $@`'
12533         fi
12534
12535                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12536                 ;;
12537         (nskJ*)
12538                 CC_SHARED_OPTS=
12539                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12540                 ;;
12541         (nskL*)
12542                 CC_SHARED_OPTS=
12543                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12544                 ;;
12545         (nto-qnx*|openbsd*|freebsd[12].*)
12546                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12547                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12548                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12549                 ;;
12550         (dragonfly*|freebsd*)
12551                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12552                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12553                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12554                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12555                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12556                 fi
12557
12558         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12559         if test "$cf_cv_shlib_version" = rel; then
12560                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12561         else
12562                 cf_cv_shared_soname='`basename $@`'
12563         fi
12564
12565                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12566                 ;;
12567         (netbsd*)
12568                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12569                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12570                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12571                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12572                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12573                         if test "$cf_cv_shlib_version" = auto; then
12574                         if test -f /usr/libexec/ld.elf_so; then
12575                                 cf_cv_shlib_version=abi
12576                         else
12577                                 cf_cv_shlib_version=rel
12578                         fi
12579                         fi
12580
12581         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12582         if test "$cf_cv_shlib_version" = rel; then
12583                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12584         else
12585                 cf_cv_shared_soname='`basename $@`'
12586         fi
12587
12588                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12589                 else
12590                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12591                 fi
12592                 ;;
12593         (osf*|mls+*)
12594                 # tested with OSF/1 V3.2 and 'cc'
12595                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12596                 # link with shared libs).
12597                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12598                 case "$host_os" in
12599                 (osf4*)
12600                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12601                         ;;
12602                 esac
12603                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12604                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12605                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12606                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12607                 fi
12608                 cf_cv_rm_so_locs=yes
12609                 ;;
12610         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12611                 # tested with osr5.0.5
12612                 if test "$GCC" != yes; then
12613                         CC_SHARED_OPTS='-belf -KPIC'
12614                 fi
12615                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12616                 if test "$cf_cv_enable_rpath" = yes ; then
12617                         # only way is to set LD_RUN_PATH but no switch for it
12618                         RUN_PATH=$libdir
12619                 fi
12620                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12621                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12622                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12623                 ;;
12624         (sunos4*)
12625                 # tested with SunOS 4.1.1 and gcc 2.7.0
12626                 if test "$GCC" != yes; then
12627                         CC_SHARED_OPTS='-KPIC'
12628                 fi
12629                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12630                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12631                 ;;
12632         (solaris2*)
12633                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12634                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12635                 if test "$DFT_LWR_MODEL" = "shared" ; then
12636                         LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}"
12637                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12638                 fi
12639                 if test "$cf_cv_enable_rpath" = yes ; then
12640                         EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS"
12641                 fi
12642
12643         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12644         if test "$cf_cv_shlib_version" = rel; then
12645                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12646         else
12647                 cf_cv_shared_soname='`basename $@`'
12648         fi
12649
12650                 if test "$GCC" != yes; then
12651                         cf_save_CFLAGS="$CFLAGS"
12652                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12653                         do
12654                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12655                                 cat >"conftest.$ac_ext" <<_ACEOF
12656 #line 12656 "configure"
12657 #include "confdefs.h"
12658 #include <stdio.h>
12659 int
12660 main (void)
12661 {
12662 printf("Hello\\n");
12663   ;
12664   return 0;
12665 }
12666 _ACEOF
12667 rm -f "conftest.$ac_objext"
12668 if { (eval echo "$as_me:12668: \"$ac_compile\"") >&5
12669   (eval $ac_compile) 2>&5
12670   ac_status=$?
12671   echo "$as_me:12671: \$? = $ac_status" >&5
12672   (exit "$ac_status"); } &&
12673          { ac_try='test -s "conftest.$ac_objext"'
12674   { (eval echo "$as_me:12674: \"$ac_try\"") >&5
12675   (eval $ac_try) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit "$ac_status"); }; }; then
12679   break
12680 else
12681   echo "$as_me: failed program was:" >&5
12682 cat "conftest.$ac_ext" >&5
12683 fi
12684 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12685                         done
12686                         CFLAGS="$cf_save_CFLAGS"
12687                         CC_SHARED_OPTS=$cf_shared_opts
12688                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
12689                 else
12690                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $@'
12691                 fi
12692                 ;;
12693         (sysv5uw7*|unix_sv*)
12694                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12695                 if test "$GCC" != yes; then
12696                         CC_SHARED_OPTS='-KPIC'
12697                 fi
12698                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12699                 ;;
12700         (*)
12701                 CC_SHARED_OPTS='unknown'
12702                 MK_SHARED_LIB='echo unknown'
12703                 ;;
12704         esac
12705
12706         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12707         case "$cf_cv_shlib_version" in
12708         (rel|abi)
12709                 case "$MK_SHARED_LIB" in
12710                 (*'-o $@')
12711                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12712                         ;;
12713                 (*)
12714                         { echo "$as_me:12714: WARNING: ignored --with-shlib-version" >&5
12715 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12716                         ;;
12717                 esac
12718                 ;;
12719         esac
12720
12721         if test -n "$cf_try_cflags"
12722         then
12723 cat > conftest.$ac_ext <<EOF
12724 #line 12724 "${as_me:-configure}"
12725 #include <stdio.h>
12726 int main(int argc, char *argv[])
12727 {
12728         printf("hello\\n");
12729         return (argv[argc-1] == 0) ;
12730 }
12731 EOF
12732                 cf_save_CFLAGS="$CFLAGS"
12733                 for cf_opt in $cf_try_cflags
12734                 do
12735                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12736                         echo "$as_me:12736: checking if CFLAGS option -$cf_opt works" >&5
12737 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12738                         if { (eval echo "$as_me:12738: \"$ac_compile\"") >&5
12739   (eval $ac_compile) 2>&5
12740   ac_status=$?
12741   echo "$as_me:12741: \$? = $ac_status" >&5
12742   (exit "$ac_status"); }; then
12743                                 echo "$as_me:12743: result: yes" >&5
12744 echo "${ECHO_T}yes" >&6
12745                                 cf_save_CFLAGS="$CFLAGS"
12746                         else
12747                                 echo "$as_me:12747: result: no" >&5
12748 echo "${ECHO_T}no" >&6
12749                         fi
12750                 done
12751                 CFLAGS="$cf_save_CFLAGS"
12752         fi
12753
12754         # RPATH_LIST is a colon-separated list of directories
12755         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12756         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12757
12758         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12759
12760         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12761
12762 echo "${as_me:-configure}:12762: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12763
12764         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12765
12766 echo "${as_me:-configure}:12766: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12767
12768 # The test/sample programs in the original tree link using rpath option.
12769 # Make it optional for packagers.
12770 if test -n "$LOCAL_LDFLAGS"
12771 then
12772         echo "$as_me:12772: checking if you want to link sample programs with rpath option" >&5
12773 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12774
12775 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12776 if test "${enable_rpath_link+set}" = set; then
12777   enableval="$enable_rpath_link"
12778   with_rpath_link=$enableval
12779 else
12780   with_rpath_link=yes
12781 fi;
12782         echo "$as_me:12782: result: $with_rpath_link" >&5
12783 echo "${ECHO_T}$with_rpath_link" >&6
12784         if test "$with_rpath_link" = no
12785         then
12786                 LOCAL_LDFLAGS=
12787                 LOCAL_LDFLAGS2=
12788         fi
12789 fi
12790
12791 ###############################################################################
12792
12793 ###   use option --enable-broken-linker to force on use of broken-linker support
12794
12795 echo "$as_me:12795: checking if you want broken-linker support code" >&5
12796 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12797
12798 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12799 if test "${enable_broken_linker+set}" = set; then
12800   enableval="$enable_broken_linker"
12801   with_broken_linker=$enableval
12802 else
12803   with_broken_linker=no
12804 fi;
12805 echo "$as_me:12805: result: $with_broken_linker" >&5
12806 echo "${ECHO_T}$with_broken_linker" >&6
12807
12808 : "${BROKEN_LINKER:=0}"
12809 if test "x$with_broken_linker" = xyes ; then
12810
12811 cat >>confdefs.h <<\EOF
12812 #define BROKEN_LINKER 1
12813 EOF
12814
12815         BROKEN_LINKER=1
12816 fi
12817
12818 # Check to define _XOPEN_SOURCE "automatically"
12819
12820 echo "$as_me:12820: checking if the POSIX test-macros are already defined" >&5
12821 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12822 if test "${cf_cv_posix_visible+set}" = set; then
12823   echo $ECHO_N "(cached) $ECHO_C" >&6
12824 else
12825
12826 cat >"conftest.$ac_ext" <<_ACEOF
12827 #line 12827 "configure"
12828 #include "confdefs.h"
12829 #include <stdio.h>
12830 int
12831 main (void)
12832 {
12833
12834 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12835         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12836         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12837         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12838 #error conflicting symbols found
12839 #endif
12840
12841   ;
12842   return 0;
12843 }
12844 _ACEOF
12845 rm -f "conftest.$ac_objext"
12846 if { (eval echo "$as_me:12846: \"$ac_compile\"") >&5
12847   (eval $ac_compile) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit "$ac_status"); } &&
12851          { ac_try='test -s "conftest.$ac_objext"'
12852   { (eval echo "$as_me:12852: \"$ac_try\"") >&5
12853   (eval $ac_try) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit "$ac_status"); }; }; then
12857   cf_cv_posix_visible=no
12858 else
12859   echo "$as_me: failed program was:" >&5
12860 cat "conftest.$ac_ext" >&5
12861 cf_cv_posix_visible=yes
12862 fi
12863 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12864
12865 fi
12866 echo "$as_me:12866: result: $cf_cv_posix_visible" >&5
12867 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12868
12869 if test "$cf_cv_posix_visible" = no; then
12870
12871 cf_XOPEN_SOURCE=600
12872 cf_POSIX_C_SOURCE=199506L
12873 cf_xopen_source=
12874
12875 case "$host_os" in
12876 (aix[4-7]*)
12877         cf_xopen_source="-D_ALL_SOURCE"
12878         ;;
12879 (darwin[0-8].*)
12880         cf_xopen_source="-D_APPLE_C_SOURCE"
12881         ;;
12882 (darwin*)
12883         cf_xopen_source="-D_DARWIN_C_SOURCE"
12884         cf_XOPEN_SOURCE=
12885         ;;
12886 (freebsd*|dragonfly*|midnightbsd*)
12887         # 5.x headers associate
12888         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12889         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12890         cf_POSIX_C_SOURCE=200112L
12891         cf_XOPEN_SOURCE=600
12892         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12893         ;;
12894 (hpux11*)
12895         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12896         ;;
12897 (hpux*)
12898         cf_xopen_source="-D_HPUX_SOURCE"
12899         ;;
12900 (irix[56].*)
12901         cf_xopen_source="-D_SGI_SOURCE"
12902         cf_XOPEN_SOURCE=
12903         ;;
12904 (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc)
12905
12906 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12907
12908 echo "$as_me:12908: checking if this is the GNU C library" >&5
12909 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12910 if test "${cf_cv_gnu_library+set}" = set; then
12911   echo $ECHO_N "(cached) $ECHO_C" >&6
12912 else
12913
12914 cat >"conftest.$ac_ext" <<_ACEOF
12915 #line 12915 "configure"
12916 #include "confdefs.h"
12917 #include <sys/types.h>
12918 int
12919 main (void)
12920 {
12921
12922         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12923                 return 0;
12924         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12925                 return 0;
12926         #else
12927         #       error not GNU C library
12928         #endif
12929   ;
12930   return 0;
12931 }
12932 _ACEOF
12933 rm -f "conftest.$ac_objext"
12934 if { (eval echo "$as_me:12934: \"$ac_compile\"") >&5
12935   (eval $ac_compile) 2>&5
12936   ac_status=$?
12937   echo "$as_me:12937: \$? = $ac_status" >&5
12938   (exit "$ac_status"); } &&
12939          { ac_try='test -s "conftest.$ac_objext"'
12940   { (eval echo "$as_me:12940: \"$ac_try\"") >&5
12941   (eval $ac_try) 2>&5
12942   ac_status=$?
12943   echo "$as_me:12943: \$? = $ac_status" >&5
12944   (exit "$ac_status"); }; }; then
12945   cf_cv_gnu_library=yes
12946 else
12947   echo "$as_me: failed program was:" >&5
12948 cat "conftest.$ac_ext" >&5
12949 cf_cv_gnu_library=no
12950 fi
12951 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12952
12953 fi
12954 echo "$as_me:12954: result: $cf_cv_gnu_library" >&5
12955 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12956
12957 if test x$cf_cv_gnu_library = xyes; then
12958
12959         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12960         # was changed to help a little.  newlib incorporated the change about 4
12961         # years later.
12962         echo "$as_me:12962: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12963 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12964 if test "${cf_cv_gnu_library_219+set}" = set; then
12965   echo $ECHO_N "(cached) $ECHO_C" >&6
12966 else
12967
12968                 cf_save="$CPPFLAGS"
12969
12970         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12971         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12972
12973                 cat >"conftest.$ac_ext" <<_ACEOF
12974 #line 12974 "configure"
12975 #include "confdefs.h"
12976 #include <sys/types.h>
12977 int
12978 main (void)
12979 {
12980
12981                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12982                                 return 0;
12983                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12984                                 return 0;
12985                         #else
12986                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12987                         #endif
12988   ;
12989   return 0;
12990 }
12991 _ACEOF
12992 rm -f "conftest.$ac_objext"
12993 if { (eval echo "$as_me:12993: \"$ac_compile\"") >&5
12994   (eval $ac_compile) 2>&5
12995   ac_status=$?
12996   echo "$as_me:12996: \$? = $ac_status" >&5
12997   (exit "$ac_status"); } &&
12998          { ac_try='test -s "conftest.$ac_objext"'
12999   { (eval echo "$as_me:12999: \"$ac_try\"") >&5
13000   (eval $ac_try) 2>&5
13001   ac_status=$?
13002   echo "$as_me:13002: \$? = $ac_status" >&5
13003   (exit "$ac_status"); }; }; then
13004   cf_cv_gnu_library_219=yes
13005 else
13006   echo "$as_me: failed program was:" >&5
13007 cat "conftest.$ac_ext" >&5
13008 cf_cv_gnu_library_219=no
13009 fi
13010 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13011                 CPPFLAGS="$cf_save"
13012
13013 fi
13014 echo "$as_me:13014: result: $cf_cv_gnu_library_219" >&5
13015 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
13016
13017         if test "x$cf_cv_gnu_library_219" = xyes; then
13018                 cf_save="$CPPFLAGS"
13019                 echo "$as_me:13019: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
13020 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
13021 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
13022   echo $ECHO_N "(cached) $ECHO_C" >&6
13023 else
13024
13025 cf_fix_cppflags=no
13026 cf_new_cflags=
13027 cf_new_cppflags=
13028 cf_new_extra_cppflags=
13029
13030 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
13031 do
13032 case "$cf_fix_cppflags" in
13033 (no)
13034         case "$cf_add_cflags" in
13035         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13036                 case "$cf_add_cflags" in
13037                 (-D*)
13038                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13039
13040                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13041                                 && test -z "${cf_tst_cflags}" \
13042                                 && cf_fix_cppflags=yes
13043
13044                         if test "$cf_fix_cppflags" = yes ; then
13045
13046         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13047         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13048
13049                                 continue
13050                         elif test "${cf_tst_cflags}" = "\"'" ; then
13051
13052         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13053         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13054
13055                                 continue
13056                         fi
13057                         ;;
13058                 esac
13059                 case "$CPPFLAGS" in
13060                 (*$cf_add_cflags)
13061                         ;;
13062                 (*)
13063                         case "$cf_add_cflags" in
13064                         (-D*)
13065                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13066
13067 CPPFLAGS=`echo "$CPPFLAGS" | \
13068         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13069                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13070
13071                                 ;;
13072                         esac
13073
13074         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13075         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13076
13077                         ;;
13078                 esac
13079                 ;;
13080         (*)
13081
13082         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13083         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13084
13085                 ;;
13086         esac
13087         ;;
13088 (yes)
13089
13090         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13091         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13092
13093         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13094
13095         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13096                 && test -z "${cf_tst_cflags}" \
13097                 && cf_fix_cppflags=no
13098         ;;
13099 esac
13100 done
13101
13102 if test -n "$cf_new_cflags" ; then
13103
13104         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13105         CFLAGS="${CFLAGS}$cf_new_cflags"
13106
13107 fi
13108
13109 if test -n "$cf_new_cppflags" ; then
13110
13111         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13112         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13113
13114 fi
13115
13116 if test -n "$cf_new_extra_cppflags" ; then
13117
13118         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13119         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13120
13121 fi
13122
13123                         cat >"conftest.$ac_ext" <<_ACEOF
13124 #line 13124 "configure"
13125 #include "confdefs.h"
13126
13127                                 #include <limits.h>
13128                                 #include <sys/types.h>
13129
13130 int
13131 main (void)
13132 {
13133
13134                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
13135                                         return 0;
13136                                 #else
13137                                 #       error GNU C library is too old
13138                                 #endif
13139   ;
13140   return 0;
13141 }
13142 _ACEOF
13143 rm -f "conftest.$ac_objext"
13144 if { (eval echo "$as_me:13144: \"$ac_compile\"") >&5
13145   (eval $ac_compile) 2>&5
13146   ac_status=$?
13147   echo "$as_me:13147: \$? = $ac_status" >&5
13148   (exit "$ac_status"); } &&
13149          { ac_try='test -s "conftest.$ac_objext"'
13150   { (eval echo "$as_me:13150: \"$ac_try\"") >&5
13151   (eval $ac_try) 2>&5
13152   ac_status=$?
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit "$ac_status"); }; }; then
13155   cf_cv_gnu_dftsrc_219=yes
13156 else
13157   echo "$as_me: failed program was:" >&5
13158 cat "conftest.$ac_ext" >&5
13159 cf_cv_gnu_dftsrc_219=no
13160 fi
13161 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13162
13163 fi
13164 echo "$as_me:13164: result: $cf_cv_gnu_dftsrc_219" >&5
13165 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
13166                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
13167         else
13168                 cf_cv_gnu_dftsrc_219=maybe
13169         fi
13170
13171         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
13172
13173                 echo "$as_me:13173: checking if we must define _GNU_SOURCE" >&5
13174 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
13175 if test "${cf_cv_gnu_source+set}" = set; then
13176   echo $ECHO_N "(cached) $ECHO_C" >&6
13177 else
13178
13179                 cat >"conftest.$ac_ext" <<_ACEOF
13180 #line 13180 "configure"
13181 #include "confdefs.h"
13182 #include <sys/types.h>
13183 int
13184 main (void)
13185 {
13186
13187                         #ifndef _XOPEN_SOURCE
13188                         #error  expected _XOPEN_SOURCE to be defined
13189                         #endif
13190   ;
13191   return 0;
13192 }
13193 _ACEOF
13194 rm -f "conftest.$ac_objext"
13195 if { (eval echo "$as_me:13195: \"$ac_compile\"") >&5
13196   (eval $ac_compile) 2>&5
13197   ac_status=$?
13198   echo "$as_me:13198: \$? = $ac_status" >&5
13199   (exit "$ac_status"); } &&
13200          { ac_try='test -s "conftest.$ac_objext"'
13201   { (eval echo "$as_me:13201: \"$ac_try\"") >&5
13202   (eval $ac_try) 2>&5
13203   ac_status=$?
13204   echo "$as_me:13204: \$? = $ac_status" >&5
13205   (exit "$ac_status"); }; }; then
13206   cf_cv_gnu_source=no
13207 else
13208   echo "$as_me: failed program was:" >&5
13209 cat "conftest.$ac_ext" >&5
13210 cf_save="$CPPFLAGS"
13211
13212 cf_fix_cppflags=no
13213 cf_new_cflags=
13214 cf_new_cppflags=
13215 cf_new_extra_cppflags=
13216
13217 for cf_add_cflags in -D_GNU_SOURCE
13218 do
13219 case "$cf_fix_cppflags" in
13220 (no)
13221         case "$cf_add_cflags" in
13222         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13223                 case "$cf_add_cflags" in
13224                 (-D*)
13225                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13226
13227                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13228                                 && test -z "${cf_tst_cflags}" \
13229                                 && cf_fix_cppflags=yes
13230
13231                         if test "$cf_fix_cppflags" = yes ; then
13232
13233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13235
13236                                 continue
13237                         elif test "${cf_tst_cflags}" = "\"'" ; then
13238
13239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13241
13242                                 continue
13243                         fi
13244                         ;;
13245                 esac
13246                 case "$CPPFLAGS" in
13247                 (*$cf_add_cflags)
13248                         ;;
13249                 (*)
13250                         case "$cf_add_cflags" in
13251                         (-D*)
13252                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13253
13254 CPPFLAGS=`echo "$CPPFLAGS" | \
13255         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13256                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13257
13258                                 ;;
13259                         esac
13260
13261         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13262         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13263
13264                         ;;
13265                 esac
13266                 ;;
13267         (*)
13268
13269         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13270         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13271
13272                 ;;
13273         esac
13274         ;;
13275 (yes)
13276
13277         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13278         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13279
13280         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13281
13282         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13283                 && test -z "${cf_tst_cflags}" \
13284                 && cf_fix_cppflags=no
13285         ;;
13286 esac
13287 done
13288
13289 if test -n "$cf_new_cflags" ; then
13290
13291         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13292         CFLAGS="${CFLAGS}$cf_new_cflags"
13293
13294 fi
13295
13296 if test -n "$cf_new_cppflags" ; then
13297
13298         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13299         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13300
13301 fi
13302
13303 if test -n "$cf_new_extra_cppflags" ; then
13304
13305         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13306         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13307
13308 fi
13309
13310                          cat >"conftest.$ac_ext" <<_ACEOF
13311 #line 13311 "configure"
13312 #include "confdefs.h"
13313 #include <sys/types.h>
13314 int
13315 main (void)
13316 {
13317
13318                                 #ifdef _XOPEN_SOURCE
13319                                 #error  expected _XOPEN_SOURCE to be undefined
13320                                 #endif
13321   ;
13322   return 0;
13323 }
13324 _ACEOF
13325 rm -f "conftest.$ac_objext"
13326 if { (eval echo "$as_me:13326: \"$ac_compile\"") >&5
13327   (eval $ac_compile) 2>&5
13328   ac_status=$?
13329   echo "$as_me:13329: \$? = $ac_status" >&5
13330   (exit "$ac_status"); } &&
13331          { ac_try='test -s "conftest.$ac_objext"'
13332   { (eval echo "$as_me:13332: \"$ac_try\"") >&5
13333   (eval $ac_try) 2>&5
13334   ac_status=$?
13335   echo "$as_me:13335: \$? = $ac_status" >&5
13336   (exit "$ac_status"); }; }; then
13337   cf_cv_gnu_source=no
13338 else
13339   echo "$as_me: failed program was:" >&5
13340 cat "conftest.$ac_ext" >&5
13341 cf_cv_gnu_source=yes
13342 fi
13343 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13344                         CPPFLAGS="$cf_save"
13345
13346 fi
13347 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13348
13349 fi
13350 echo "$as_me:13350: result: $cf_cv_gnu_source" >&5
13351 echo "${ECHO_T}$cf_cv_gnu_source" >&6
13352
13353                 if test "$cf_cv_gnu_source" = yes
13354                 then
13355                 echo "$as_me:13355: checking if we should also define _DEFAULT_SOURCE" >&5
13356 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
13357 if test "${cf_cv_default_source+set}" = set; then
13358   echo $ECHO_N "(cached) $ECHO_C" >&6
13359 else
13360
13361         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13362         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
13363
13364                         cat >"conftest.$ac_ext" <<_ACEOF
13365 #line 13365 "configure"
13366 #include "confdefs.h"
13367 #include <sys/types.h>
13368 int
13369 main (void)
13370 {
13371
13372                                 #ifdef _DEFAULT_SOURCE
13373                                 #error  expected _DEFAULT_SOURCE to be undefined
13374                                 #endif
13375   ;
13376   return 0;
13377 }
13378 _ACEOF
13379 rm -f "conftest.$ac_objext"
13380 if { (eval echo "$as_me:13380: \"$ac_compile\"") >&5
13381   (eval $ac_compile) 2>&5
13382   ac_status=$?
13383   echo "$as_me:13383: \$? = $ac_status" >&5
13384   (exit "$ac_status"); } &&
13385          { ac_try='test -s "conftest.$ac_objext"'
13386   { (eval echo "$as_me:13386: \"$ac_try\"") >&5
13387   (eval $ac_try) 2>&5
13388   ac_status=$?
13389   echo "$as_me:13389: \$? = $ac_status" >&5
13390   (exit "$ac_status"); }; }; then
13391   cf_cv_default_source=no
13392 else
13393   echo "$as_me: failed program was:" >&5
13394 cat "conftest.$ac_ext" >&5
13395 cf_cv_default_source=yes
13396 fi
13397 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13398
13399 fi
13400 echo "$as_me:13400: result: $cf_cv_default_source" >&5
13401 echo "${ECHO_T}$cf_cv_default_source" >&6
13402                         if test "$cf_cv_default_source" = yes
13403                         then
13404
13405         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13406         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
13407
13408                         fi
13409                 fi
13410         fi
13411
13412 fi
13413
13414         ;;
13415 (minix*)
13416         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
13417         ;;
13418 (mirbsd*)
13419         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
13420         cf_XOPEN_SOURCE=
13421
13422 if test "$cf_cv_posix_visible" = no; then
13423
13424 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13425
13426 cf_save_CFLAGS="$CFLAGS"
13427 cf_save_CPPFLAGS="$CPPFLAGS"
13428
13429 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13430         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13431                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13432
13433 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13434         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13435                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13436
13437 echo "$as_me:13437: checking if we should define _POSIX_C_SOURCE" >&5
13438 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13439 if test "${cf_cv_posix_c_source+set}" = set; then
13440   echo $ECHO_N "(cached) $ECHO_C" >&6
13441 else
13442
13443 echo "${as_me:-configure}:13443: testing if the symbol is already defined go no further ..." 1>&5
13444
13445         cat >"conftest.$ac_ext" <<_ACEOF
13446 #line 13446 "configure"
13447 #include "confdefs.h"
13448 #include <sys/types.h>
13449 int
13450 main (void)
13451 {
13452
13453 #ifndef _POSIX_C_SOURCE
13454 #error _POSIX_C_SOURCE is not defined
13455 #endif
13456   ;
13457   return 0;
13458 }
13459 _ACEOF
13460 rm -f "conftest.$ac_objext"
13461 if { (eval echo "$as_me:13461: \"$ac_compile\"") >&5
13462   (eval $ac_compile) 2>&5
13463   ac_status=$?
13464   echo "$as_me:13464: \$? = $ac_status" >&5
13465   (exit "$ac_status"); } &&
13466          { ac_try='test -s "conftest.$ac_objext"'
13467   { (eval echo "$as_me:13467: \"$ac_try\"") >&5
13468   (eval $ac_try) 2>&5
13469   ac_status=$?
13470   echo "$as_me:13470: \$? = $ac_status" >&5
13471   (exit "$ac_status"); }; }; then
13472   cf_cv_posix_c_source=no
13473 else
13474   echo "$as_me: failed program was:" >&5
13475 cat "conftest.$ac_ext" >&5
13476 cf_want_posix_source=no
13477          case .$cf_POSIX_C_SOURCE in
13478          (.[12]??*)
13479                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13480                 ;;
13481          (.2)
13482                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13483                 cf_want_posix_source=yes
13484                 ;;
13485          (.*)
13486                 cf_want_posix_source=yes
13487                 ;;
13488          esac
13489          if test "$cf_want_posix_source" = yes ; then
13490                 cat >"conftest.$ac_ext" <<_ACEOF
13491 #line 13491 "configure"
13492 #include "confdefs.h"
13493 #include <sys/types.h>
13494 int
13495 main (void)
13496 {
13497
13498 #ifdef _POSIX_SOURCE
13499 #error _POSIX_SOURCE is defined
13500 #endif
13501   ;
13502   return 0;
13503 }
13504 _ACEOF
13505 rm -f "conftest.$ac_objext"
13506 if { (eval echo "$as_me:13506: \"$ac_compile\"") >&5
13507   (eval $ac_compile) 2>&5
13508   ac_status=$?
13509   echo "$as_me:13509: \$? = $ac_status" >&5
13510   (exit "$ac_status"); } &&
13511          { ac_try='test -s "conftest.$ac_objext"'
13512   { (eval echo "$as_me:13512: \"$ac_try\"") >&5
13513   (eval $ac_try) 2>&5
13514   ac_status=$?
13515   echo "$as_me:13515: \$? = $ac_status" >&5
13516   (exit "$ac_status"); }; }; then
13517   :
13518 else
13519   echo "$as_me: failed program was:" >&5
13520 cat "conftest.$ac_ext" >&5
13521 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13522 fi
13523 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13524          fi
13525
13526 echo "${as_me:-configure}:13526: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13527
13528          CFLAGS="$cf_trim_CFLAGS"
13529          CPPFLAGS="$cf_trim_CPPFLAGS"
13530
13531         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13532         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13533
13534 echo "${as_me:-configure}:13534: testing if the second compile does not leave our definition intact error ..." 1>&5
13535
13536          cat >"conftest.$ac_ext" <<_ACEOF
13537 #line 13537 "configure"
13538 #include "confdefs.h"
13539 #include <sys/types.h>
13540 int
13541 main (void)
13542 {
13543
13544 #ifndef _POSIX_C_SOURCE
13545 #error _POSIX_C_SOURCE is not defined
13546 #endif
13547   ;
13548   return 0;
13549 }
13550 _ACEOF
13551 rm -f "conftest.$ac_objext"
13552 if { (eval echo "$as_me:13552: \"$ac_compile\"") >&5
13553   (eval $ac_compile) 2>&5
13554   ac_status=$?
13555   echo "$as_me:13555: \$? = $ac_status" >&5
13556   (exit "$ac_status"); } &&
13557          { ac_try='test -s "conftest.$ac_objext"'
13558   { (eval echo "$as_me:13558: \"$ac_try\"") >&5
13559   (eval $ac_try) 2>&5
13560   ac_status=$?
13561   echo "$as_me:13561: \$? = $ac_status" >&5
13562   (exit "$ac_status"); }; }; then
13563   :
13564 else
13565   echo "$as_me: failed program was:" >&5
13566 cat "conftest.$ac_ext" >&5
13567 cf_cv_posix_c_source=no
13568 fi
13569 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13570          CFLAGS="$cf_save_CFLAGS"
13571          CPPFLAGS="$cf_save_CPPFLAGS"
13572
13573 fi
13574 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13575
13576 fi
13577 echo "$as_me:13577: result: $cf_cv_posix_c_source" >&5
13578 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13579
13580 if test "$cf_cv_posix_c_source" != no ; then
13581         CFLAGS="$cf_trim_CFLAGS"
13582         CPPFLAGS="$cf_trim_CPPFLAGS"
13583
13584 cf_fix_cppflags=no
13585 cf_new_cflags=
13586 cf_new_cppflags=
13587 cf_new_extra_cppflags=
13588
13589 for cf_add_cflags in $cf_cv_posix_c_source
13590 do
13591 case "$cf_fix_cppflags" in
13592 (no)
13593         case "$cf_add_cflags" in
13594         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13595                 case "$cf_add_cflags" in
13596                 (-D*)
13597                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13598
13599                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13600                                 && test -z "${cf_tst_cflags}" \
13601                                 && cf_fix_cppflags=yes
13602
13603                         if test "$cf_fix_cppflags" = yes ; then
13604
13605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13607
13608                                 continue
13609                         elif test "${cf_tst_cflags}" = "\"'" ; then
13610
13611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13613
13614                                 continue
13615                         fi
13616                         ;;
13617                 esac
13618                 case "$CPPFLAGS" in
13619                 (*$cf_add_cflags)
13620                         ;;
13621                 (*)
13622                         case "$cf_add_cflags" in
13623                         (-D*)
13624                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13625
13626 CPPFLAGS=`echo "$CPPFLAGS" | \
13627         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13628                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13629
13630                                 ;;
13631                         esac
13632
13633         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13634         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13635
13636                         ;;
13637                 esac
13638                 ;;
13639         (*)
13640
13641         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13642         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13643
13644                 ;;
13645         esac
13646         ;;
13647 (yes)
13648
13649         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13650         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13651
13652         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13653
13654         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13655                 && test -z "${cf_tst_cflags}" \
13656                 && cf_fix_cppflags=no
13657         ;;
13658 esac
13659 done
13660
13661 if test -n "$cf_new_cflags" ; then
13662
13663         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13664         CFLAGS="${CFLAGS}$cf_new_cflags"
13665
13666 fi
13667
13668 if test -n "$cf_new_cppflags" ; then
13669
13670         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13671         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13672
13673 fi
13674
13675 if test -n "$cf_new_extra_cppflags" ; then
13676
13677         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13678         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13679
13680 fi
13681
13682 fi
13683
13684 fi # cf_cv_posix_visible
13685
13686         ;;
13687 (netbsd*)
13688         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13689         ;;
13690 (openbsd[6-9]*)
13691         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13692         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13693         # Abusing the conformance level is a workaround.
13694         { echo "$as_me:13694: WARNING: this system does not provide usable locale support" >&5
13695 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13696         cf_xopen_source="-D_BSD_SOURCE"
13697         cf_XOPEN_SOURCE=700
13698         ;;
13699 (openbsd[4-5]*)
13700         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13701         cf_xopen_source="-D_BSD_SOURCE"
13702         cf_XOPEN_SOURCE=600
13703         ;;
13704 (openbsd*)
13705         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13706         ;;
13707 (osf[45]*)
13708         cf_xopen_source="-D_OSF_SOURCE"
13709         ;;
13710 (nto-qnx*)
13711         cf_xopen_source="-D_QNX_SOURCE"
13712         ;;
13713 (sco*)
13714         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13715         ;;
13716 (solaris2.*)
13717         cf_xopen_source="-D__EXTENSIONS__"
13718         cf_cv_xopen_source=broken
13719         ;;
13720 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13721         cf_XOPEN_SOURCE=
13722         cf_POSIX_C_SOURCE=
13723         ;;
13724 (*)
13725
13726 echo "$as_me:13726: checking if we should define _XOPEN_SOURCE" >&5
13727 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13728 if test "${cf_cv_xopen_source+set}" = set; then
13729   echo $ECHO_N "(cached) $ECHO_C" >&6
13730 else
13731
13732         cat >"conftest.$ac_ext" <<_ACEOF
13733 #line 13733 "configure"
13734 #include "confdefs.h"
13735
13736 $ac_includes_default
13737
13738 int
13739 main (void)
13740 {
13741
13742 #ifndef _XOPEN_SOURCE
13743 #error _XOPEN_SOURCE is not defined
13744 #endif
13745
13746   ;
13747   return 0;
13748 }
13749 _ACEOF
13750 rm -f "conftest.$ac_objext"
13751 if { (eval echo "$as_me:13751: \"$ac_compile\"") >&5
13752   (eval $ac_compile) 2>&5
13753   ac_status=$?
13754   echo "$as_me:13754: \$? = $ac_status" >&5
13755   (exit "$ac_status"); } &&
13756          { ac_try='test -s "conftest.$ac_objext"'
13757   { (eval echo "$as_me:13757: \"$ac_try\"") >&5
13758   (eval $ac_try) 2>&5
13759   ac_status=$?
13760   echo "$as_me:13760: \$? = $ac_status" >&5
13761   (exit "$ac_status"); }; }; then
13762   cf_cv_xopen_source=no
13763 else
13764   echo "$as_me: failed program was:" >&5
13765 cat "conftest.$ac_ext" >&5
13766 cf_save="$CPPFLAGS"
13767
13768         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13769         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13770
13771          cat >"conftest.$ac_ext" <<_ACEOF
13772 #line 13772 "configure"
13773 #include "confdefs.h"
13774
13775 $ac_includes_default
13776
13777 int
13778 main (void)
13779 {
13780
13781 #ifndef _XOPEN_SOURCE
13782 #error _XOPEN_SOURCE is not defined
13783 #endif
13784
13785   ;
13786   return 0;
13787 }
13788 _ACEOF
13789 rm -f "conftest.$ac_objext"
13790 if { (eval echo "$as_me:13790: \"$ac_compile\"") >&5
13791   (eval $ac_compile) 2>&5
13792   ac_status=$?
13793   echo "$as_me:13793: \$? = $ac_status" >&5
13794   (exit "$ac_status"); } &&
13795          { ac_try='test -s "conftest.$ac_objext"'
13796   { (eval echo "$as_me:13796: \"$ac_try\"") >&5
13797   (eval $ac_try) 2>&5
13798   ac_status=$?
13799   echo "$as_me:13799: \$? = $ac_status" >&5
13800   (exit "$ac_status"); }; }; then
13801   cf_cv_xopen_source=no
13802 else
13803   echo "$as_me: failed program was:" >&5
13804 cat "conftest.$ac_ext" >&5
13805 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13806 fi
13807 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13808                 CPPFLAGS="$cf_save"
13809
13810 fi
13811 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13812
13813 fi
13814 echo "$as_me:13814: result: $cf_cv_xopen_source" >&5
13815 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13816
13817 if test "$cf_cv_xopen_source" != no ; then
13818
13819 CFLAGS=`echo "$CFLAGS" | \
13820         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13821                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13822
13823 CPPFLAGS=`echo "$CPPFLAGS" | \
13824         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13825                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13826
13827         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13828
13829 for cf_add_cflags in $cf_temp_xopen_source
13830 do
13831         case "x$cf_add_cflags" in
13832         (x-[DU]*)
13833
13834 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13835 while true
13836 do
13837         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13838         test "$CFLAGS" != "$cf_old_cflag" || break
13839
13840         CFLAGS="$cf_old_cflag"
13841 done
13842
13843 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13844 while true
13845 do
13846         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
13847         test "$CPPFLAGS" != "$cf_old_cflag" || break
13848
13849         CPPFLAGS="$cf_old_cflag"
13850 done
13851
13852                 ;;
13853         esac
13854
13855 cf_fix_cppflags=no
13856 cf_new_cflags=
13857 cf_new_cppflags=
13858 cf_new_extra_cppflags=
13859
13860 for cf_add_cflags in $cf_add_cflags
13861 do
13862 case "$cf_fix_cppflags" in
13863 (no)
13864         case "$cf_add_cflags" in
13865         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13866                 case "$cf_add_cflags" in
13867                 (-D*)
13868                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13869
13870                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13871                                 && test -z "${cf_tst_cflags}" \
13872                                 && cf_fix_cppflags=yes
13873
13874                         if test "$cf_fix_cppflags" = yes ; then
13875
13876         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13877         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13878
13879                                 continue
13880                         elif test "${cf_tst_cflags}" = "\"'" ; then
13881
13882         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13883         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13884
13885                                 continue
13886                         fi
13887                         ;;
13888                 esac
13889                 case "$CPPFLAGS" in
13890                 (*$cf_add_cflags)
13891                         ;;
13892                 (*)
13893                         case "$cf_add_cflags" in
13894                         (-D*)
13895                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13896
13897 CPPFLAGS=`echo "$CPPFLAGS" | \
13898         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13899                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13900
13901                                 ;;
13902                         esac
13903
13904         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13905         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13906
13907                         ;;
13908                 esac
13909                 ;;
13910         (*)
13911
13912         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13913         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13914
13915                 ;;
13916         esac
13917         ;;
13918 (yes)
13919
13920         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13921         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13922
13923         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13924
13925         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13926                 && test -z "${cf_tst_cflags}" \
13927                 && cf_fix_cppflags=no
13928         ;;
13929 esac
13930 done
13931
13932 if test -n "$cf_new_cflags" ; then
13933
13934         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13935         CFLAGS="${CFLAGS}$cf_new_cflags"
13936
13937 fi
13938
13939 if test -n "$cf_new_cppflags" ; then
13940
13941         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13942         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13943
13944 fi
13945
13946 if test -n "$cf_new_extra_cppflags" ; then
13947
13948         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13949         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13950
13951 fi
13952
13953 done
13954
13955 fi
13956
13957         cf_save_xopen_cppflags="$CPPFLAGS"
13958
13959 if test "$cf_cv_posix_visible" = no; then
13960
13961 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13962
13963 cf_save_CFLAGS="$CFLAGS"
13964 cf_save_CPPFLAGS="$CPPFLAGS"
13965
13966 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13967         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13968                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13969
13970 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13971         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13972                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13973
13974 echo "$as_me:13974: checking if we should define _POSIX_C_SOURCE" >&5
13975 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13976 if test "${cf_cv_posix_c_source+set}" = set; then
13977   echo $ECHO_N "(cached) $ECHO_C" >&6
13978 else
13979
13980 echo "${as_me:-configure}:13980: testing if the symbol is already defined go no further ..." 1>&5
13981
13982         cat >"conftest.$ac_ext" <<_ACEOF
13983 #line 13983 "configure"
13984 #include "confdefs.h"
13985 #include <sys/types.h>
13986 int
13987 main (void)
13988 {
13989
13990 #ifndef _POSIX_C_SOURCE
13991 #error _POSIX_C_SOURCE is not defined
13992 #endif
13993   ;
13994   return 0;
13995 }
13996 _ACEOF
13997 rm -f "conftest.$ac_objext"
13998 if { (eval echo "$as_me:13998: \"$ac_compile\"") >&5
13999   (eval $ac_compile) 2>&5
14000   ac_status=$?
14001   echo "$as_me:14001: \$? = $ac_status" >&5
14002   (exit "$ac_status"); } &&
14003          { ac_try='test -s "conftest.$ac_objext"'
14004   { (eval echo "$as_me:14004: \"$ac_try\"") >&5
14005   (eval $ac_try) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit "$ac_status"); }; }; then
14009   cf_cv_posix_c_source=no
14010 else
14011   echo "$as_me: failed program was:" >&5
14012 cat "conftest.$ac_ext" >&5
14013 cf_want_posix_source=no
14014          case .$cf_POSIX_C_SOURCE in
14015          (.[12]??*)
14016                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
14017                 ;;
14018          (.2)
14019                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
14020                 cf_want_posix_source=yes
14021                 ;;
14022          (.*)
14023                 cf_want_posix_source=yes
14024                 ;;
14025          esac
14026          if test "$cf_want_posix_source" = yes ; then
14027                 cat >"conftest.$ac_ext" <<_ACEOF
14028 #line 14028 "configure"
14029 #include "confdefs.h"
14030 #include <sys/types.h>
14031 int
14032 main (void)
14033 {
14034
14035 #ifdef _POSIX_SOURCE
14036 #error _POSIX_SOURCE is defined
14037 #endif
14038   ;
14039   return 0;
14040 }
14041 _ACEOF
14042 rm -f "conftest.$ac_objext"
14043 if { (eval echo "$as_me:14043: \"$ac_compile\"") >&5
14044   (eval $ac_compile) 2>&5
14045   ac_status=$?
14046   echo "$as_me:14046: \$? = $ac_status" >&5
14047   (exit "$ac_status"); } &&
14048          { ac_try='test -s "conftest.$ac_objext"'
14049   { (eval echo "$as_me:14049: \"$ac_try\"") >&5
14050   (eval $ac_try) 2>&5
14051   ac_status=$?
14052   echo "$as_me:14052: \$? = $ac_status" >&5
14053   (exit "$ac_status"); }; }; then
14054   :
14055 else
14056   echo "$as_me: failed program was:" >&5
14057 cat "conftest.$ac_ext" >&5
14058 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
14059 fi
14060 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14061          fi
14062
14063 echo "${as_me:-configure}:14063: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
14064
14065          CFLAGS="$cf_trim_CFLAGS"
14066          CPPFLAGS="$cf_trim_CPPFLAGS"
14067
14068         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14069         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
14070
14071 echo "${as_me:-configure}:14071: testing if the second compile does not leave our definition intact error ..." 1>&5
14072
14073          cat >"conftest.$ac_ext" <<_ACEOF
14074 #line 14074 "configure"
14075 #include "confdefs.h"
14076 #include <sys/types.h>
14077 int
14078 main (void)
14079 {
14080
14081 #ifndef _POSIX_C_SOURCE
14082 #error _POSIX_C_SOURCE is not defined
14083 #endif
14084   ;
14085   return 0;
14086 }
14087 _ACEOF
14088 rm -f "conftest.$ac_objext"
14089 if { (eval echo "$as_me:14089: \"$ac_compile\"") >&5
14090   (eval $ac_compile) 2>&5
14091   ac_status=$?
14092   echo "$as_me:14092: \$? = $ac_status" >&5
14093   (exit "$ac_status"); } &&
14094          { ac_try='test -s "conftest.$ac_objext"'
14095   { (eval echo "$as_me:14095: \"$ac_try\"") >&5
14096   (eval $ac_try) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit "$ac_status"); }; }; then
14100   :
14101 else
14102   echo "$as_me: failed program was:" >&5
14103 cat "conftest.$ac_ext" >&5
14104 cf_cv_posix_c_source=no
14105 fi
14106 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14107          CFLAGS="$cf_save_CFLAGS"
14108          CPPFLAGS="$cf_save_CPPFLAGS"
14109
14110 fi
14111 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14112
14113 fi
14114 echo "$as_me:14114: result: $cf_cv_posix_c_source" >&5
14115 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
14116
14117 if test "$cf_cv_posix_c_source" != no ; then
14118         CFLAGS="$cf_trim_CFLAGS"
14119         CPPFLAGS="$cf_trim_CPPFLAGS"
14120
14121 cf_fix_cppflags=no
14122 cf_new_cflags=
14123 cf_new_cppflags=
14124 cf_new_extra_cppflags=
14125
14126 for cf_add_cflags in $cf_cv_posix_c_source
14127 do
14128 case "$cf_fix_cppflags" in
14129 (no)
14130         case "$cf_add_cflags" in
14131         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14132                 case "$cf_add_cflags" in
14133                 (-D*)
14134                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14135
14136                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14137                                 && test -z "${cf_tst_cflags}" \
14138                                 && cf_fix_cppflags=yes
14139
14140                         if test "$cf_fix_cppflags" = yes ; then
14141
14142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14144
14145                                 continue
14146                         elif test "${cf_tst_cflags}" = "\"'" ; then
14147
14148         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14149         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14150
14151                                 continue
14152                         fi
14153                         ;;
14154                 esac
14155                 case "$CPPFLAGS" in
14156                 (*$cf_add_cflags)
14157                         ;;
14158                 (*)
14159                         case "$cf_add_cflags" in
14160                         (-D*)
14161                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14162
14163 CPPFLAGS=`echo "$CPPFLAGS" | \
14164         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14165                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14166
14167                                 ;;
14168                         esac
14169
14170         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14171         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14172
14173                         ;;
14174                 esac
14175                 ;;
14176         (*)
14177
14178         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14179         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14180
14181                 ;;
14182         esac
14183         ;;
14184 (yes)
14185
14186         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14187         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14188
14189         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14190
14191         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14192                 && test -z "${cf_tst_cflags}" \
14193                 && cf_fix_cppflags=no
14194         ;;
14195 esac
14196 done
14197
14198 if test -n "$cf_new_cflags" ; then
14199
14200         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14201         CFLAGS="${CFLAGS}$cf_new_cflags"
14202
14203 fi
14204
14205 if test -n "$cf_new_cppflags" ; then
14206
14207         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14208         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14209
14210 fi
14211
14212 if test -n "$cf_new_extra_cppflags" ; then
14213
14214         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14215         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14216
14217 fi
14218
14219 fi
14220
14221 fi # cf_cv_posix_visible
14222
14223         # Some of these niche implementations use copy/paste, double-check...
14224         if test "$cf_cv_xopen_source" = no ; then
14225                 test -n "$verbose" && echo "    checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE" 1>&6
14226
14227 echo "${as_me:-configure}:14227: testing checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE ..." 1>&5
14228
14229                 cat >"conftest.$ac_ext" <<_ACEOF
14230 #line 14230 "configure"
14231 #include "confdefs.h"
14232
14233 $ac_includes_default
14234
14235 int
14236 main (void)
14237 {
14238
14239 #ifndef _XOPEN_SOURCE
14240 #error _XOPEN_SOURCE is not defined
14241 #endif
14242
14243   ;
14244   return 0;
14245 }
14246 _ACEOF
14247 rm -f "conftest.$ac_objext"
14248 if { (eval echo "$as_me:14248: \"$ac_compile\"") >&5
14249   (eval $ac_compile) 2>&5
14250   ac_status=$?
14251   echo "$as_me:14251: \$? = $ac_status" >&5
14252   (exit "$ac_status"); } &&
14253          { ac_try='test -s "conftest.$ac_objext"'
14254   { (eval echo "$as_me:14254: \"$ac_try\"") >&5
14255   (eval $ac_try) 2>&5
14256   ac_status=$?
14257   echo "$as_me:14257: \$? = $ac_status" >&5
14258   (exit "$ac_status"); }; }; then
14259   :
14260 else
14261   echo "$as_me: failed program was:" >&5
14262 cat "conftest.$ac_ext" >&5
14263
14264                         { echo "$as_me:14264: WARNING: _POSIX_C_SOURCE definition is not usable" >&5
14265 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;}
14266                         CPPFLAGS="$cf_save_xopen_cppflags"
14267 fi
14268 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14269         fi
14270         ;;
14271 esac
14272
14273 if test -n "$cf_xopen_source" ; then
14274
14275 for cf_add_cflags in $cf_xopen_source
14276 do
14277         case "x$cf_add_cflags" in
14278         (x-[DU]*)
14279
14280 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14281 while true
14282 do
14283         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14284         test "$CFLAGS" != "$cf_old_cflag" || break
14285         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
14286
14287 echo "${as_me:-configure}:14287: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
14288
14289         CFLAGS="$cf_old_cflag"
14290 done
14291
14292 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14293 while true
14294 do
14295         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14296         test "$CPPFLAGS" != "$cf_old_cflag" || break
14297         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
14298
14299 echo "${as_me:-configure}:14299: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
14300
14301         CPPFLAGS="$cf_old_cflag"
14302 done
14303
14304                 ;;
14305         esac
14306
14307 cf_fix_cppflags=no
14308 cf_new_cflags=
14309 cf_new_cppflags=
14310 cf_new_extra_cppflags=
14311
14312 for cf_add_cflags in $cf_add_cflags
14313 do
14314 case "$cf_fix_cppflags" in
14315 (no)
14316         case "$cf_add_cflags" in
14317         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14318                 case "$cf_add_cflags" in
14319                 (-D*)
14320                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14321
14322                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14323                                 && test -z "${cf_tst_cflags}" \
14324                                 && cf_fix_cppflags=yes
14325
14326                         if test "$cf_fix_cppflags" = yes ; then
14327
14328         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14329         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14330
14331                                 continue
14332                         elif test "${cf_tst_cflags}" = "\"'" ; then
14333
14334         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14335         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14336
14337                                 continue
14338                         fi
14339                         ;;
14340                 esac
14341                 case "$CPPFLAGS" in
14342                 (*$cf_add_cflags)
14343                         ;;
14344                 (*)
14345                         case "$cf_add_cflags" in
14346                         (-D*)
14347                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14348
14349 CPPFLAGS=`echo "$CPPFLAGS" | \
14350         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14351                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14352
14353                                 ;;
14354                         esac
14355
14356         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14357         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14358
14359                         ;;
14360                 esac
14361                 ;;
14362         (*)
14363
14364         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14365         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14366
14367                 ;;
14368         esac
14369         ;;
14370 (yes)
14371
14372         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14373         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14374
14375         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14376
14377         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14378                 && test -z "${cf_tst_cflags}" \
14379                 && cf_fix_cppflags=no
14380         ;;
14381 esac
14382 done
14383
14384 if test -n "$cf_new_cflags" ; then
14385         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14386
14387 echo "${as_me:-configure}:14387: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14388
14389         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14390         CFLAGS="${CFLAGS}$cf_new_cflags"
14391
14392 fi
14393
14394 if test -n "$cf_new_cppflags" ; then
14395         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14396
14397 echo "${as_me:-configure}:14397: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14398
14399         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14400         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14401
14402 fi
14403
14404 if test -n "$cf_new_extra_cppflags" ; then
14405         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14406
14407 echo "${as_me:-configure}:14407: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14408
14409         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14410         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14411
14412 fi
14413
14414 done
14415
14416 fi
14417
14418 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
14419         echo "$as_me:14419: checking if _XOPEN_SOURCE really is set" >&5
14420 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
14421         cat >"conftest.$ac_ext" <<_ACEOF
14422 #line 14422 "configure"
14423 #include "confdefs.h"
14424 #include <stdlib.h>
14425 int
14426 main (void)
14427 {
14428
14429 #ifndef _XOPEN_SOURCE
14430 #error _XOPEN_SOURCE is not defined
14431 #endif
14432   ;
14433   return 0;
14434 }
14435 _ACEOF
14436 rm -f "conftest.$ac_objext"
14437 if { (eval echo "$as_me:14437: \"$ac_compile\"") >&5
14438   (eval $ac_compile) 2>&5
14439   ac_status=$?
14440   echo "$as_me:14440: \$? = $ac_status" >&5
14441   (exit "$ac_status"); } &&
14442          { ac_try='test -s "conftest.$ac_objext"'
14443   { (eval echo "$as_me:14443: \"$ac_try\"") >&5
14444   (eval $ac_try) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit "$ac_status"); }; }; then
14448   cf_XOPEN_SOURCE_set=yes
14449 else
14450   echo "$as_me: failed program was:" >&5
14451 cat "conftest.$ac_ext" >&5
14452 cf_XOPEN_SOURCE_set=no
14453 fi
14454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14455         echo "$as_me:14455: result: $cf_XOPEN_SOURCE_set" >&5
14456 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
14457         if test "$cf_XOPEN_SOURCE_set" = yes
14458         then
14459                 cat >"conftest.$ac_ext" <<_ACEOF
14460 #line 14460 "configure"
14461 #include "confdefs.h"
14462 #include <stdlib.h>
14463 int
14464 main (void)
14465 {
14466
14467 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14468 #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
14469 #endif
14470   ;
14471   return 0;
14472 }
14473 _ACEOF
14474 rm -f "conftest.$ac_objext"
14475 if { (eval echo "$as_me:14475: \"$ac_compile\"") >&5
14476   (eval $ac_compile) 2>&5
14477   ac_status=$?
14478   echo "$as_me:14478: \$? = $ac_status" >&5
14479   (exit "$ac_status"); } &&
14480          { ac_try='test -s "conftest.$ac_objext"'
14481   { (eval echo "$as_me:14481: \"$ac_try\"") >&5
14482   (eval $ac_try) 2>&5
14483   ac_status=$?
14484   echo "$as_me:14484: \$? = $ac_status" >&5
14485   (exit "$ac_status"); }; }; then
14486   cf_XOPEN_SOURCE_set_ok=yes
14487 else
14488   echo "$as_me: failed program was:" >&5
14489 cat "conftest.$ac_ext" >&5
14490 cf_XOPEN_SOURCE_set_ok=no
14491 fi
14492 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14493                 if test "$cf_XOPEN_SOURCE_set_ok" = no
14494                 then
14495                         { echo "$as_me:14495: WARNING: _XOPEN_SOURCE is lower than requested" >&5
14496 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
14497                 fi
14498         else
14499
14500 echo "$as_me:14500: checking if we should define _XOPEN_SOURCE" >&5
14501 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
14502 if test "${cf_cv_xopen_source+set}" = set; then
14503   echo $ECHO_N "(cached) $ECHO_C" >&6
14504 else
14505
14506         cat >"conftest.$ac_ext" <<_ACEOF
14507 #line 14507 "configure"
14508 #include "confdefs.h"
14509
14510 $ac_includes_default
14511
14512 int
14513 main (void)
14514 {
14515
14516 #ifndef _XOPEN_SOURCE
14517 #error _XOPEN_SOURCE is not defined
14518 #endif
14519
14520   ;
14521   return 0;
14522 }
14523 _ACEOF
14524 rm -f "conftest.$ac_objext"
14525 if { (eval echo "$as_me:14525: \"$ac_compile\"") >&5
14526   (eval $ac_compile) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit "$ac_status"); } &&
14530          { ac_try='test -s "conftest.$ac_objext"'
14531   { (eval echo "$as_me:14531: \"$ac_try\"") >&5
14532   (eval $ac_try) 2>&5
14533   ac_status=$?
14534   echo "$as_me:14534: \$? = $ac_status" >&5
14535   (exit "$ac_status"); }; }; then
14536   cf_cv_xopen_source=no
14537 else
14538   echo "$as_me: failed program was:" >&5
14539 cat "conftest.$ac_ext" >&5
14540 cf_save="$CPPFLAGS"
14541
14542         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14543         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
14544
14545          cat >"conftest.$ac_ext" <<_ACEOF
14546 #line 14546 "configure"
14547 #include "confdefs.h"
14548
14549 $ac_includes_default
14550
14551 int
14552 main (void)
14553 {
14554
14555 #ifndef _XOPEN_SOURCE
14556 #error _XOPEN_SOURCE is not defined
14557 #endif
14558
14559   ;
14560   return 0;
14561 }
14562 _ACEOF
14563 rm -f "conftest.$ac_objext"
14564 if { (eval echo "$as_me:14564: \"$ac_compile\"") >&5
14565   (eval $ac_compile) 2>&5
14566   ac_status=$?
14567   echo "$as_me:14567: \$? = $ac_status" >&5
14568   (exit "$ac_status"); } &&
14569          { ac_try='test -s "conftest.$ac_objext"'
14570   { (eval echo "$as_me:14570: \"$ac_try\"") >&5
14571   (eval $ac_try) 2>&5
14572   ac_status=$?
14573   echo "$as_me:14573: \$? = $ac_status" >&5
14574   (exit "$ac_status"); }; }; then
14575   cf_cv_xopen_source=no
14576 else
14577   echo "$as_me: failed program was:" >&5
14578 cat "conftest.$ac_ext" >&5
14579 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14580 fi
14581 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14582                 CPPFLAGS="$cf_save"
14583
14584 fi
14585 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14586
14587 fi
14588 echo "$as_me:14588: result: $cf_cv_xopen_source" >&5
14589 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14590
14591 if test "$cf_cv_xopen_source" != no ; then
14592
14593 CFLAGS=`echo "$CFLAGS" | \
14594         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14595                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14596
14597 CPPFLAGS=`echo "$CPPFLAGS" | \
14598         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14599                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14600
14601         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14602
14603 for cf_add_cflags in $cf_temp_xopen_source
14604 do
14605         case "x$cf_add_cflags" in
14606         (x-[DU]*)
14607
14608 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14609 while true
14610 do
14611         cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[         ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14612         test "$CFLAGS" != "$cf_old_cflag" || break
14613
14614         CFLAGS="$cf_old_cflag"
14615 done
14616
14617 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14618 while true
14619 do
14620         cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[       ][      ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^     ][^     ]*\\)\?%%" -e 's/^[     ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'`
14621         test "$CPPFLAGS" != "$cf_old_cflag" || break
14622
14623         CPPFLAGS="$cf_old_cflag"
14624 done
14625
14626                 ;;
14627         esac
14628
14629 cf_fix_cppflags=no
14630 cf_new_cflags=
14631 cf_new_cppflags=
14632 cf_new_extra_cppflags=
14633
14634 for cf_add_cflags in $cf_add_cflags
14635 do
14636 case "$cf_fix_cppflags" in
14637 (no)
14638         case "$cf_add_cflags" in
14639         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14640                 case "$cf_add_cflags" in
14641                 (-D*)
14642                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14643
14644                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14645                                 && test -z "${cf_tst_cflags}" \
14646                                 && cf_fix_cppflags=yes
14647
14648                         if test "$cf_fix_cppflags" = yes ; then
14649
14650         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14651         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14652
14653                                 continue
14654                         elif test "${cf_tst_cflags}" = "\"'" ; then
14655
14656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14658
14659                                 continue
14660                         fi
14661                         ;;
14662                 esac
14663                 case "$CPPFLAGS" in
14664                 (*$cf_add_cflags)
14665                         ;;
14666                 (*)
14667                         case "$cf_add_cflags" in
14668                         (-D*)
14669                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14670
14671 CPPFLAGS=`echo "$CPPFLAGS" | \
14672         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14673                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14674
14675                                 ;;
14676                         esac
14677
14678         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14679         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14680
14681                         ;;
14682                 esac
14683                 ;;
14684         (*)
14685
14686         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14687         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14688
14689                 ;;
14690         esac
14691         ;;
14692 (yes)
14693
14694         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14695         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14696
14697         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14698
14699         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14700                 && test -z "${cf_tst_cflags}" \
14701                 && cf_fix_cppflags=no
14702         ;;
14703 esac
14704 done
14705
14706 if test -n "$cf_new_cflags" ; then
14707
14708         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14709         CFLAGS="${CFLAGS}$cf_new_cflags"
14710
14711 fi
14712
14713 if test -n "$cf_new_cppflags" ; then
14714
14715         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14716         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14717
14718 fi
14719
14720 if test -n "$cf_new_extra_cppflags" ; then
14721
14722         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14723         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14724
14725 fi
14726
14727 done
14728
14729 fi
14730
14731         fi
14732 fi
14733 fi # cf_cv_posix_visible
14734
14735 echo "$as_me:14735: checking for ANSI C header files" >&5
14736 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14737 if test "${ac_cv_header_stdc+set}" = set; then
14738   echo $ECHO_N "(cached) $ECHO_C" >&6
14739 else
14740   cat >"conftest.$ac_ext" <<_ACEOF
14741 #line 14741 "configure"
14742 #include "confdefs.h"
14743 #include <stdlib.h>
14744 #include <stdarg.h>
14745 #include <string.h>
14746 #include <float.h>
14747
14748 _ACEOF
14749 if { (eval echo "$as_me:14749: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14750   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14751   ac_status=$?
14752   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14753   rm -f conftest.er1
14754   cat conftest.err >&5
14755   echo "$as_me:14755: \$? = $ac_status" >&5
14756   (exit "$ac_status"); } >/dev/null; then
14757   if test -s conftest.err; then
14758     ac_cpp_err=$ac_c_preproc_warn_flag
14759   else
14760     ac_cpp_err=
14761   fi
14762 else
14763   ac_cpp_err=yes
14764 fi
14765 if test -z "$ac_cpp_err"; then
14766   ac_cv_header_stdc=yes
14767 else
14768   echo "$as_me: failed program was:" >&5
14769   cat "conftest.$ac_ext" >&5
14770   ac_cv_header_stdc=no
14771 fi
14772 rm -f conftest.err "conftest.$ac_ext"
14773
14774 if test $ac_cv_header_stdc = yes; then
14775   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14776   cat >"conftest.$ac_ext" <<_ACEOF
14777 #line 14777 "configure"
14778 #include "confdefs.h"
14779 #include <string.h>
14780
14781 _ACEOF
14782 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14783   $EGREP "memchr" >/dev/null 2>&1; then
14784   :
14785 else
14786   ac_cv_header_stdc=no
14787 fi
14788 rm -rf conftest*
14789
14790 fi
14791
14792 if test $ac_cv_header_stdc = yes; then
14793   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14794   cat >"conftest.$ac_ext" <<_ACEOF
14795 #line 14795 "configure"
14796 #include "confdefs.h"
14797 #include <stdlib.h>
14798
14799 _ACEOF
14800 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14801   $EGREP "free" >/dev/null 2>&1; then
14802   :
14803 else
14804   ac_cv_header_stdc=no
14805 fi
14806 rm -rf conftest*
14807
14808 fi
14809
14810 if test $ac_cv_header_stdc = yes; then
14811   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14812   if test "$cross_compiling" = yes; then
14813   :
14814 else
14815   cat >"conftest.$ac_ext" <<_ACEOF
14816 #line 14816 "configure"
14817 #include "confdefs.h"
14818 #include <ctype.h>
14819 #if ((' ' & 0x0FF) == 0x020)
14820 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14821 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14822 #else
14823 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14824                      || ('j' <= (c) && (c) <= 'r') \
14825                      || ('s' <= (c) && (c) <= 'z'))
14826 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14827 #endif
14828
14829 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14830 int
14831 main (void)
14832 {
14833   int i;
14834   for (i = 0; i < 256; i++)
14835     if (XOR (islower (i), ISLOWER (i))
14836         || toupper (i) != TOUPPER (i))
14837       $ac_main_return(2);
14838   $ac_main_return (0);
14839 }
14840 _ACEOF
14841 rm -f "conftest$ac_exeext"
14842 if { (eval echo "$as_me:14842: \"$ac_link\"") >&5
14843   (eval $ac_link) 2>&5
14844   ac_status=$?
14845   echo "$as_me:14845: \$? = $ac_status" >&5
14846   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
14847   { (eval echo "$as_me:14847: \"$ac_try\"") >&5
14848   (eval $ac_try) 2>&5
14849   ac_status=$?
14850   echo "$as_me:14850: \$? = $ac_status" >&5
14851   (exit "$ac_status"); }; }; then
14852   :
14853 else
14854   echo "$as_me: program exited with status $ac_status" >&5
14855 echo "$as_me: failed program was:" >&5
14856 cat "conftest.$ac_ext" >&5
14857 ac_cv_header_stdc=no
14858 fi
14859 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
14860 fi
14861 fi
14862 fi
14863 echo "$as_me:14863: result: $ac_cv_header_stdc" >&5
14864 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14865 if test $ac_cv_header_stdc = yes; then
14866
14867 cat >>confdefs.h <<\EOF
14868 #define STDC_HEADERS 1
14869 EOF
14870
14871 fi
14872
14873 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14874
14875 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14876                   inttypes.h stdint.h unistd.h
14877 do
14878 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14879 echo "$as_me:14879: checking for $ac_header" >&5
14880 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14881 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14882   echo $ECHO_N "(cached) $ECHO_C" >&6
14883 else
14884   cat >"conftest.$ac_ext" <<_ACEOF
14885 #line 14885 "configure"
14886 #include "confdefs.h"
14887 $ac_includes_default
14888 #include <$ac_header>
14889 _ACEOF
14890 rm -f "conftest.$ac_objext"
14891 if { (eval echo "$as_me:14891: \"$ac_compile\"") >&5
14892   (eval $ac_compile) 2>&5
14893   ac_status=$?
14894   echo "$as_me:14894: \$? = $ac_status" >&5
14895   (exit "$ac_status"); } &&
14896          { ac_try='test -s "conftest.$ac_objext"'
14897   { (eval echo "$as_me:14897: \"$ac_try\"") >&5
14898   (eval $ac_try) 2>&5
14899   ac_status=$?
14900   echo "$as_me:14900: \$? = $ac_status" >&5
14901   (exit "$ac_status"); }; }; then
14902   eval "$as_ac_Header=yes"
14903 else
14904   echo "$as_me: failed program was:" >&5
14905 cat "conftest.$ac_ext" >&5
14906 eval "$as_ac_Header=no"
14907 fi
14908 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14909 fi
14910 echo "$as_me:14910: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
14911 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
14912 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
14913   cat >>confdefs.h <<EOF
14914 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14915 EOF
14916
14917 fi
14918 done
14919
14920 echo "$as_me:14920: checking whether exit is declared" >&5
14921 echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6
14922 if test "${ac_cv_have_decl_exit+set}" = set; then
14923   echo $ECHO_N "(cached) $ECHO_C" >&6
14924 else
14925   cat >"conftest.$ac_ext" <<_ACEOF
14926 #line 14926 "configure"
14927 #include "confdefs.h"
14928 $ac_includes_default
14929 int
14930 main (void)
14931 {
14932 #ifndef exit
14933   (void) exit;
14934 #endif
14935
14936   ;
14937   return 0;
14938 }
14939 _ACEOF
14940 rm -f "conftest.$ac_objext"
14941 if { (eval echo "$as_me:14941: \"$ac_compile\"") >&5
14942   (eval $ac_compile) 2>&5
14943   ac_status=$?
14944   echo "$as_me:14944: \$? = $ac_status" >&5
14945   (exit "$ac_status"); } &&
14946          { ac_try='test -s "conftest.$ac_objext"'
14947   { (eval echo "$as_me:14947: \"$ac_try\"") >&5
14948   (eval $ac_try) 2>&5
14949   ac_status=$?
14950   echo "$as_me:14950: \$? = $ac_status" >&5
14951   (exit "$ac_status"); }; }; then
14952   ac_cv_have_decl_exit=yes
14953 else
14954   echo "$as_me: failed program was:" >&5
14955 cat "conftest.$ac_ext" >&5
14956 ac_cv_have_decl_exit=no
14957 fi
14958 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14959 fi
14960 echo "$as_me:14960: result: $ac_cv_have_decl_exit" >&5
14961 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6
14962
14963 # Check whether --enable-largefile or --disable-largefile was given.
14964 if test "${enable_largefile+set}" = set; then
14965   enableval="$enable_largefile"
14966
14967 fi;
14968 if test "$enable_largefile" != no; then
14969
14970   echo "$as_me:14970: checking for special C compiler options needed for large files" >&5
14971 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14972 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14973   echo $ECHO_N "(cached) $ECHO_C" >&6
14974 else
14975   ac_cv_sys_largefile_CC=no
14976      if test "$GCC" != yes; then
14977        ac_save_CC=$CC
14978        while :; do
14979          # IRIX 6.2 and later do not support large files by default,
14980          # so use the C compiler's -n32 option if that helps.
14981          cat >"conftest.$ac_ext" <<_ACEOF
14982 #line 14982 "configure"
14983 #include "confdefs.h"
14984 #include <sys/types.h>
14985  /* Check that off_t can represent 2**63 - 1 correctly.
14986     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14987     since some C++ compilers masquerading as C compilers
14988     incorrectly reject 9223372036854775807.  */
14989 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14990   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14991                        && LARGE_OFF_T % 2147483647 == 1)
14992                       ? 1 : -1];
14993 int
14994 main (void)
14995 {
14996
14997   ;
14998   return 0;
14999 }
15000 _ACEOF
15001          rm -f "conftest.$ac_objext"
15002 if { (eval echo "$as_me:15002: \"$ac_compile\"") >&5
15003   (eval $ac_compile) 2>&5
15004   ac_status=$?
15005   echo "$as_me:15005: \$? = $ac_status" >&5
15006   (exit "$ac_status"); } &&
15007          { ac_try='test -s "conftest.$ac_objext"'
15008   { (eval echo "$as_me:15008: \"$ac_try\"") >&5
15009   (eval $ac_try) 2>&5
15010   ac_status=$?
15011   echo "$as_me:15011: \$? = $ac_status" >&5
15012   (exit "$ac_status"); }; }; then
15013   break
15014 else
15015   echo "$as_me: failed program was:" >&5
15016 cat "conftest.$ac_ext" >&5
15017 fi
15018 rm -f "conftest.$ac_objext"
15019          CC="$CC -n32"
15020          rm -f "conftest.$ac_objext"
15021 if { (eval echo "$as_me:15021: \"$ac_compile\"") >&5
15022   (eval $ac_compile) 2>&5
15023   ac_status=$?
15024   echo "$as_me:15024: \$? = $ac_status" >&5
15025   (exit "$ac_status"); } &&
15026          { ac_try='test -s "conftest.$ac_objext"'
15027   { (eval echo "$as_me:15027: \"$ac_try\"") >&5
15028   (eval $ac_try) 2>&5
15029   ac_status=$?
15030   echo "$as_me:15030: \$? = $ac_status" >&5
15031   (exit "$ac_status"); }; }; then
15032   ac_cv_sys_largefile_CC=' -n32'; break
15033 else
15034   echo "$as_me: failed program was:" >&5
15035 cat "conftest.$ac_ext" >&5
15036 fi
15037 rm -f "conftest.$ac_objext"
15038          break
15039        done
15040        CC=$ac_save_CC
15041        rm -f "conftest.$ac_ext"
15042     fi
15043 fi
15044 echo "$as_me:15044: result: $ac_cv_sys_largefile_CC" >&5
15045 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
15046   if test "$ac_cv_sys_largefile_CC" != no; then
15047     CC=$CC$ac_cv_sys_largefile_CC
15048   fi
15049
15050   echo "$as_me:15050: checking for _FILE_OFFSET_BITS value needed for large files" >&5
15051 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
15052 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
15053   echo $ECHO_N "(cached) $ECHO_C" >&6
15054 else
15055   while :; do
15056   ac_cv_sys_file_offset_bits=no
15057   cat >"conftest.$ac_ext" <<_ACEOF
15058 #line 15058 "configure"
15059 #include "confdefs.h"
15060 #include <sys/types.h>
15061  /* Check that off_t can represent 2**63 - 1 correctly.
15062     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15063     since some C++ compilers masquerading as C compilers
15064     incorrectly reject 9223372036854775807.  */
15065 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15066   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15067                        && LARGE_OFF_T % 2147483647 == 1)
15068                       ? 1 : -1];
15069 int
15070 main (void)
15071 {
15072
15073   ;
15074   return 0;
15075 }
15076 _ACEOF
15077 rm -f "conftest.$ac_objext"
15078 if { (eval echo "$as_me:15078: \"$ac_compile\"") >&5
15079   (eval $ac_compile) 2>&5
15080   ac_status=$?
15081   echo "$as_me:15081: \$? = $ac_status" >&5
15082   (exit "$ac_status"); } &&
15083          { ac_try='test -s "conftest.$ac_objext"'
15084   { (eval echo "$as_me:15084: \"$ac_try\"") >&5
15085   (eval $ac_try) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit "$ac_status"); }; }; then
15089   break
15090 else
15091   echo "$as_me: failed program was:" >&5
15092 cat "conftest.$ac_ext" >&5
15093 fi
15094 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15095   cat >"conftest.$ac_ext" <<_ACEOF
15096 #line 15096 "configure"
15097 #include "confdefs.h"
15098 #define _FILE_OFFSET_BITS 64
15099 #include <sys/types.h>
15100  /* Check that off_t can represent 2**63 - 1 correctly.
15101     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15102     since some C++ compilers masquerading as C compilers
15103     incorrectly reject 9223372036854775807.  */
15104 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15105   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15106                        && LARGE_OFF_T % 2147483647 == 1)
15107                       ? 1 : -1];
15108 int
15109 main (void)
15110 {
15111
15112   ;
15113   return 0;
15114 }
15115 _ACEOF
15116 rm -f "conftest.$ac_objext"
15117 if { (eval echo "$as_me:15117: \"$ac_compile\"") >&5
15118   (eval $ac_compile) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit "$ac_status"); } &&
15122          { ac_try='test -s "conftest.$ac_objext"'
15123   { (eval echo "$as_me:15123: \"$ac_try\"") >&5
15124   (eval $ac_try) 2>&5
15125   ac_status=$?
15126   echo "$as_me:15126: \$? = $ac_status" >&5
15127   (exit "$ac_status"); }; }; then
15128   ac_cv_sys_file_offset_bits=64; break
15129 else
15130   echo "$as_me: failed program was:" >&5
15131 cat "conftest.$ac_ext" >&5
15132 fi
15133 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15134   break
15135 done
15136 fi
15137 echo "$as_me:15137: result: $ac_cv_sys_file_offset_bits" >&5
15138 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
15139 if test "$ac_cv_sys_file_offset_bits" != no; then
15140
15141 cat >>confdefs.h <<EOF
15142 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
15143 EOF
15144
15145 fi
15146 rm -rf conftest*
15147   echo "$as_me:15147: checking for _LARGE_FILES value needed for large files" >&5
15148 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
15149 if test "${ac_cv_sys_large_files+set}" = set; then
15150   echo $ECHO_N "(cached) $ECHO_C" >&6
15151 else
15152   while :; do
15153   ac_cv_sys_large_files=no
15154   cat >"conftest.$ac_ext" <<_ACEOF
15155 #line 15155 "configure"
15156 #include "confdefs.h"
15157 #include <sys/types.h>
15158  /* Check that off_t can represent 2**63 - 1 correctly.
15159     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15160     since some C++ compilers masquerading as C compilers
15161     incorrectly reject 9223372036854775807.  */
15162 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15163   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15164                        && LARGE_OFF_T % 2147483647 == 1)
15165                       ? 1 : -1];
15166 int
15167 main (void)
15168 {
15169
15170   ;
15171   return 0;
15172 }
15173 _ACEOF
15174 rm -f "conftest.$ac_objext"
15175 if { (eval echo "$as_me:15175: \"$ac_compile\"") >&5
15176   (eval $ac_compile) 2>&5
15177   ac_status=$?
15178   echo "$as_me:15178: \$? = $ac_status" >&5
15179   (exit "$ac_status"); } &&
15180          { ac_try='test -s "conftest.$ac_objext"'
15181   { (eval echo "$as_me:15181: \"$ac_try\"") >&5
15182   (eval $ac_try) 2>&5
15183   ac_status=$?
15184   echo "$as_me:15184: \$? = $ac_status" >&5
15185   (exit "$ac_status"); }; }; then
15186   break
15187 else
15188   echo "$as_me: failed program was:" >&5
15189 cat "conftest.$ac_ext" >&5
15190 fi
15191 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15192   cat >"conftest.$ac_ext" <<_ACEOF
15193 #line 15193 "configure"
15194 #include "confdefs.h"
15195 #define _LARGE_FILES 1
15196 #include <sys/types.h>
15197  /* Check that off_t can represent 2**63 - 1 correctly.
15198     We can't simply define LARGE_OFF_T to be 9223372036854775807,
15199     since some C++ compilers masquerading as C compilers
15200     incorrectly reject 9223372036854775807.  */
15201 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15202   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15203                        && LARGE_OFF_T % 2147483647 == 1)
15204                       ? 1 : -1];
15205 int
15206 main (void)
15207 {
15208
15209   ;
15210   return 0;
15211 }
15212 _ACEOF
15213 rm -f "conftest.$ac_objext"
15214 if { (eval echo "$as_me:15214: \"$ac_compile\"") >&5
15215   (eval $ac_compile) 2>&5
15216   ac_status=$?
15217   echo "$as_me:15217: \$? = $ac_status" >&5
15218   (exit "$ac_status"); } &&
15219          { ac_try='test -s "conftest.$ac_objext"'
15220   { (eval echo "$as_me:15220: \"$ac_try\"") >&5
15221   (eval $ac_try) 2>&5
15222   ac_status=$?
15223   echo "$as_me:15223: \$? = $ac_status" >&5
15224   (exit "$ac_status"); }; }; then
15225   ac_cv_sys_large_files=1; break
15226 else
15227   echo "$as_me: failed program was:" >&5
15228 cat "conftest.$ac_ext" >&5
15229 fi
15230 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15231   break
15232 done
15233 fi
15234 echo "$as_me:15234: result: $ac_cv_sys_large_files" >&5
15235 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
15236 if test "$ac_cv_sys_large_files" != no; then
15237
15238 cat >>confdefs.h <<EOF
15239 #define _LARGE_FILES $ac_cv_sys_large_files
15240 EOF
15241
15242 fi
15243 rm -rf conftest*
15244 fi
15245
15246         if test "$enable_largefile" != no ; then
15247         echo "$as_me:15247: checking for _LARGEFILE_SOURCE value needed for large files" >&5
15248 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
15249 if test "${ac_cv_sys_largefile_source+set}" = set; then
15250   echo $ECHO_N "(cached) $ECHO_C" >&6
15251 else
15252   while :; do
15253   ac_cv_sys_largefile_source=no
15254   cat >"conftest.$ac_ext" <<_ACEOF
15255 #line 15255 "configure"
15256 #include "confdefs.h"
15257 #include <stdio.h>
15258     #include <sys/types.h>
15259 int
15260 main (void)
15261 {
15262
15263     int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15264     return my_fseeko(stdin, 0, 0);
15265   ;
15266   return 0;
15267 }
15268 _ACEOF
15269 rm -f "conftest.$ac_objext"
15270 if { (eval echo "$as_me:15270: \"$ac_compile\"") >&5
15271   (eval $ac_compile) 2>&5
15272   ac_status=$?
15273   echo "$as_me:15273: \$? = $ac_status" >&5
15274   (exit "$ac_status"); } &&
15275          { ac_try='test -s "conftest.$ac_objext"'
15276   { (eval echo "$as_me:15276: \"$ac_try\"") >&5
15277   (eval $ac_try) 2>&5
15278   ac_status=$?
15279   echo "$as_me:15279: \$? = $ac_status" >&5
15280   (exit "$ac_status"); }; }; then
15281   break
15282 else
15283   echo "$as_me: failed program was:" >&5
15284 cat "conftest.$ac_ext" >&5
15285 fi
15286 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15287   cat >"conftest.$ac_ext" <<_ACEOF
15288 #line 15288 "configure"
15289 #include "confdefs.h"
15290 #define _LARGEFILE_SOURCE 1
15291 #include <stdio.h>
15292     #include <sys/types.h>
15293 int
15294 main (void)
15295 {
15296
15297     int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15298     return my_fseeko(stdin, 0, 0);
15299   ;
15300   return 0;
15301 }
15302 _ACEOF
15303 rm -f "conftest.$ac_objext"
15304 if { (eval echo "$as_me:15304: \"$ac_compile\"") >&5
15305   (eval $ac_compile) 2>&5
15306   ac_status=$?
15307   echo "$as_me:15307: \$? = $ac_status" >&5
15308   (exit "$ac_status"); } &&
15309          { ac_try='test -s "conftest.$ac_objext"'
15310   { (eval echo "$as_me:15310: \"$ac_try\"") >&5
15311   (eval $ac_try) 2>&5
15312   ac_status=$?
15313   echo "$as_me:15313: \$? = $ac_status" >&5
15314   (exit "$ac_status"); }; }; then
15315   ac_cv_sys_largefile_source=1; break
15316 else
15317   echo "$as_me: failed program was:" >&5
15318 cat "conftest.$ac_ext" >&5
15319 fi
15320 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15321   break
15322 done
15323 fi
15324 echo "$as_me:15324: result: $ac_cv_sys_largefile_source" >&5
15325 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
15326 if test "$ac_cv_sys_largefile_source" != no; then
15327
15328 cat >>confdefs.h <<EOF
15329 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
15330 EOF
15331
15332 fi
15333 rm -rf conftest*
15334
15335 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
15336 # in glibc 2.1.3, but that breaks too many other things.
15337 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
15338 echo "$as_me:15338: checking for fseeko" >&5
15339 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
15340 if test "${ac_cv_func_fseeko+set}" = set; then
15341   echo $ECHO_N "(cached) $ECHO_C" >&6
15342 else
15343   cat >"conftest.$ac_ext" <<_ACEOF
15344 #line 15344 "configure"
15345 #include "confdefs.h"
15346 #include <stdio.h>
15347                              #include <sys/types.h>
15348 int
15349 main (void)
15350 {
15351 int (*my_fseeko)(FILE *, off_t, int) = fseeko;
15352                             return my_fseeko && my_fseeko (stdin, 0, 0);
15353   ;
15354   return 0;
15355 }
15356 _ACEOF
15357 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15358 if { (eval echo "$as_me:15358: \"$ac_link\"") >&5
15359   (eval $ac_link) 2>&5
15360   ac_status=$?
15361   echo "$as_me:15361: \$? = $ac_status" >&5
15362   (exit "$ac_status"); } &&
15363          { ac_try='test -s "conftest$ac_exeext"'
15364   { (eval echo "$as_me:15364: \"$ac_try\"") >&5
15365   (eval $ac_try) 2>&5
15366   ac_status=$?
15367   echo "$as_me:15367: \$? = $ac_status" >&5
15368   (exit "$ac_status"); }; }; then
15369   ac_cv_func_fseeko=yes
15370 else
15371   echo "$as_me: failed program was:" >&5
15372 cat "conftest.$ac_ext" >&5
15373 ac_cv_func_fseeko=no
15374 fi
15375 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15376 fi
15377 echo "$as_me:15377: result: $ac_cv_func_fseeko" >&5
15378 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
15379 if test $ac_cv_func_fseeko = yes; then
15380
15381 cat >>confdefs.h <<\EOF
15382 #define HAVE_FSEEKO 1
15383 EOF
15384
15385 fi
15386
15387         # Normally we would collect these definitions in the config.h,
15388         # but (like _XOPEN_SOURCE), some environments rely on having these
15389         # defined before any of the system headers are included.  Another
15390         # case comes up with C++, e.g., on AIX the compiler compiles the
15391         # header files by themselves before looking at the body files it is
15392         # told to compile.  For ncurses, those header files do not include
15393         # the config.h
15394         if test "$ac_cv_sys_large_files" != no
15395         then
15396
15397         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15398         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
15399
15400         fi
15401         if test "$ac_cv_sys_largefile_source" != no
15402         then
15403
15404         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15405         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
15406
15407         fi
15408         if test "$ac_cv_sys_file_offset_bits" != no
15409         then
15410
15411         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15412         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
15413
15414         fi
15415
15416         echo "$as_me:15416: checking whether to use struct dirent64" >&5
15417 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
15418 if test "${cf_cv_struct_dirent64+set}" = set; then
15419   echo $ECHO_N "(cached) $ECHO_C" >&6
15420 else
15421
15422                 cat >"conftest.$ac_ext" <<_ACEOF
15423 #line 15423 "configure"
15424 #include "confdefs.h"
15425
15426 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
15427 #include <sys/types.h>
15428 #include <dirent.h>
15429
15430 #ifndef __REDIRECT
15431 /* if transitional largefile support is setup, this is true */
15432 extern struct dirent64 * readdir(DIR *);
15433 #endif
15434
15435 int
15436 main (void)
15437 {
15438
15439                 DIR *dp = opendir(".");
15440                 struct dirent64 *x = readdir(dp);
15441                 struct dirent *y = readdir(dp);
15442                 int z = x - y;
15443                 (void)z;
15444
15445   ;
15446   return 0;
15447 }
15448 _ACEOF
15449 rm -f "conftest.$ac_objext"
15450 if { (eval echo "$as_me:15450: \"$ac_compile\"") >&5
15451   (eval $ac_compile) 2>&5
15452   ac_status=$?
15453   echo "$as_me:15453: \$? = $ac_status" >&5
15454   (exit "$ac_status"); } &&
15455          { ac_try='test -s "conftest.$ac_objext"'
15456   { (eval echo "$as_me:15456: \"$ac_try\"") >&5
15457   (eval $ac_try) 2>&5
15458   ac_status=$?
15459   echo "$as_me:15459: \$? = $ac_status" >&5
15460   (exit "$ac_status"); }; }; then
15461   cf_cv_struct_dirent64=yes
15462 else
15463   echo "$as_me: failed program was:" >&5
15464 cat "conftest.$ac_ext" >&5
15465 cf_cv_struct_dirent64=no
15466 fi
15467 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15468
15469 fi
15470 echo "$as_me:15470: result: $cf_cv_struct_dirent64" >&5
15471 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
15472         test "$cf_cv_struct_dirent64" = yes &&
15473 cat >>confdefs.h <<\EOF
15474 #define HAVE_STRUCT_DIRENT64 1
15475 EOF
15476
15477         fi
15478
15479 ### Enable compiling-in rcs id's
15480 echo "$as_me:15480: checking if RCS identifiers should be compiled-in" >&5
15481 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
15482
15483 # Check whether --with-rcs-ids or --without-rcs-ids was given.
15484 if test "${with_rcs_ids+set}" = set; then
15485   withval="$with_rcs_ids"
15486   with_rcs_ids=$withval
15487 else
15488   with_rcs_ids=no
15489 fi;
15490 echo "$as_me:15490: result: $with_rcs_ids" >&5
15491 echo "${ECHO_T}$with_rcs_ids" >&6
15492 test "$with_rcs_ids" = yes &&
15493 cat >>confdefs.h <<\EOF
15494 #define USE_RCS_IDS 1
15495 EOF
15496
15497 ###############################################################################
15498
15499 ### Note that some functions (such as const) are normally disabled anyway.
15500 echo "$as_me:15500: checking if you want to build with function extensions" >&5
15501 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
15502
15503 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
15504 if test "${enable_ext_funcs+set}" = set; then
15505   enableval="$enable_ext_funcs"
15506   with_ext_funcs=$enableval
15507 else
15508   with_ext_funcs=yes
15509 fi;
15510 echo "$as_me:15510: result: $with_ext_funcs" >&5
15511 echo "${ECHO_T}$with_ext_funcs" >&6
15512 if test "$with_ext_funcs" = yes ; then
15513         NCURSES_EXT_FUNCS=1
15514
15515 cat >>confdefs.h <<\EOF
15516 #define HAVE_USE_DEFAULT_COLORS 1
15517 EOF
15518
15519 cat >>confdefs.h <<\EOF
15520 #define NCURSES_EXT_FUNCS 1
15521 EOF
15522
15523 else
15524         NCURSES_EXT_FUNCS=0
15525 fi
15526
15527 ###   use option --enable-const to turn on use of const beyond that in XSI.
15528 echo "$as_me:15528: checking for extended use of const keyword" >&5
15529 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
15530
15531 # Check whether --enable-const or --disable-const was given.
15532 if test "${enable_const+set}" = set; then
15533   enableval="$enable_const"
15534   with_ext_const=$enableval
15535 else
15536   with_ext_const=no
15537 fi;
15538 echo "$as_me:15538: result: $with_ext_const" >&5
15539 echo "${ECHO_T}$with_ext_const" >&6
15540 NCURSES_CONST='/*nothing*/'
15541 if test "$with_ext_const" = yes ; then
15542         NCURSES_CONST=const
15543 fi
15544
15545 ###############################################################################
15546 # These options are relatively safe to experiment with.
15547
15548 echo "$as_me:15548: checking if you want all development code" >&5
15549 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
15550
15551 # Check whether --with-develop or --without-develop was given.
15552 if test "${with_develop+set}" = set; then
15553   withval="$with_develop"
15554   with_develop=$withval
15555 else
15556   with_develop=no
15557 fi;
15558 echo "$as_me:15558: result: $with_develop" >&5
15559 echo "${ECHO_T}$with_develop" >&6
15560
15561 ###############################################################################
15562 # These are just experimental, probably should not be in a package:
15563
15564 # This is still experimental (20080329), but should ultimately be moved to
15565 # the script-block --with-normal, etc.
15566
15567 echo "$as_me:15567: checking if you want to link with the pthread library" >&5
15568 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
15569
15570 # Check whether --with-pthread or --without-pthread was given.
15571 if test "${with_pthread+set}" = set; then
15572   withval="$with_pthread"
15573   with_pthread=$withval
15574 else
15575   with_pthread=no
15576 fi;
15577 echo "$as_me:15577: result: $with_pthread" >&5
15578 echo "${ECHO_T}$with_pthread" >&6
15579
15580 if test "$with_pthread" != no ; then
15581         echo "$as_me:15581: checking for pthread.h" >&5
15582 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
15583 if test "${ac_cv_header_pthread_h+set}" = set; then
15584   echo $ECHO_N "(cached) $ECHO_C" >&6
15585 else
15586   cat >"conftest.$ac_ext" <<_ACEOF
15587 #line 15587 "configure"
15588 #include "confdefs.h"
15589 #include <pthread.h>
15590 _ACEOF
15591 if { (eval echo "$as_me:15591: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15592   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15593   ac_status=$?
15594   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15595   rm -f conftest.er1
15596   cat conftest.err >&5
15597   echo "$as_me:15597: \$? = $ac_status" >&5
15598   (exit "$ac_status"); } >/dev/null; then
15599   if test -s conftest.err; then
15600     ac_cpp_err=$ac_c_preproc_warn_flag
15601   else
15602     ac_cpp_err=
15603   fi
15604 else
15605   ac_cpp_err=yes
15606 fi
15607 if test -z "$ac_cpp_err"; then
15608   ac_cv_header_pthread_h=yes
15609 else
15610   echo "$as_me: failed program was:" >&5
15611   cat "conftest.$ac_ext" >&5
15612   ac_cv_header_pthread_h=no
15613 fi
15614 rm -f conftest.err "conftest.$ac_ext"
15615 fi
15616 echo "$as_me:15616: result: $ac_cv_header_pthread_h" >&5
15617 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
15618 if test "$ac_cv_header_pthread_h" = yes; then
15619
15620 cat >>confdefs.h <<\EOF
15621 #define HAVE_PTHREADS_H 1
15622 EOF
15623
15624         for cf_lib_pthread in pthread c_r
15625         do
15626             echo "$as_me:15626: checking if we can link with the $cf_lib_pthread library" >&5
15627 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
15628             cf_save_LIBS="$LIBS"
15629
15630 cf_add_libs="$LIBS"
15631 # reverse order
15632 cf_add_0lib=
15633 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15634 # filter duplicates
15635 for cf_add_1lib in $cf_add_0lib; do
15636         for cf_add_2lib in $cf_add_libs; do
15637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15638                         cf_add_1lib=
15639                         break
15640                 fi
15641         done
15642         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15643 done
15644 LIBS="$cf_add_libs"
15645
15646             cat >"conftest.$ac_ext" <<_ACEOF
15647 #line 15647 "configure"
15648 #include "confdefs.h"
15649
15650 #include <pthread.h>
15651
15652 int
15653 main (void)
15654 {
15655
15656                 int rc = pthread_create(0,0,0,0);
15657                 int r2 = pthread_mutexattr_settype(0, 0);
15658
15659   ;
15660   return 0;
15661 }
15662 _ACEOF
15663 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15664 if { (eval echo "$as_me:15664: \"$ac_link\"") >&5
15665   (eval $ac_link) 2>&5
15666   ac_status=$?
15667   echo "$as_me:15667: \$? = $ac_status" >&5
15668   (exit "$ac_status"); } &&
15669          { ac_try='test -s "conftest$ac_exeext"'
15670   { (eval echo "$as_me:15670: \"$ac_try\"") >&5
15671   (eval $ac_try) 2>&5
15672   ac_status=$?
15673   echo "$as_me:15673: \$? = $ac_status" >&5
15674   (exit "$ac_status"); }; }; then
15675   with_pthread=yes
15676 else
15677   echo "$as_me: failed program was:" >&5
15678 cat "conftest.$ac_ext" >&5
15679 with_pthread=no
15680 fi
15681 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15682             LIBS="$cf_save_LIBS"
15683             echo "$as_me:15683: result: $with_pthread" >&5
15684 echo "${ECHO_T}$with_pthread" >&6
15685             test "$with_pthread" = yes && break
15686         done
15687
15688         if test "$with_pthread" = yes ; then
15689
15690 cf_add_libs="$LIBS"
15691 # reverse order
15692 cf_add_0lib=
15693 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15694 # filter duplicates
15695 for cf_add_1lib in $cf_add_0lib; do
15696         for cf_add_2lib in $cf_add_libs; do
15697                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15698                         cf_add_1lib=
15699                         break
15700                 fi
15701         done
15702         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15703 done
15704 LIBS="$cf_add_libs"
15705
15706 cat >>confdefs.h <<\EOF
15707 #define HAVE_LIBPTHREADS 1
15708 EOF
15709
15710         else
15711             { { echo "$as_me:15711: error: Cannot link with pthread library" >&5
15712 echo "$as_me: error: Cannot link with pthread library" >&2;}
15713    { (exit 1); exit 1; }; }
15714         fi
15715
15716 fi
15717
15718 fi
15719
15720 echo "$as_me:15720: checking if you want to use weak-symbols for pthreads" >&5
15721 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
15722
15723 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
15724 if test "${enable_weak_symbols+set}" = set; then
15725   enableval="$enable_weak_symbols"
15726   use_weak_symbols=$withval
15727 else
15728   use_weak_symbols=no
15729 fi;
15730 echo "$as_me:15730: result: $use_weak_symbols" >&5
15731 echo "${ECHO_T}$use_weak_symbols" >&6
15732 if test "$use_weak_symbols" = yes ; then
15733
15734 echo "$as_me:15734: checking if $CC supports weak symbols" >&5
15735 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
15736 if test "${cf_cv_weak_symbols+set}" = set; then
15737   echo $ECHO_N "(cached) $ECHO_C" >&6
15738 else
15739
15740 cat >"conftest.$ac_ext" <<_ACEOF
15741 #line 15741 "configure"
15742 #include "confdefs.h"
15743
15744 #include <stdio.h>
15745 int
15746 main (void)
15747 {
15748
15749 #if defined(__GNUC__)
15750 #  if defined __USE_ISOC99
15751 #    define _cat_pragma(exp)    _Pragma(#exp)
15752 #    define _weak_pragma(exp)   _cat_pragma(weak name)
15753 #  else
15754 #    define _weak_pragma(exp)
15755 #  endif
15756 #  define _declare(name)        __extension__ extern __typeof__(name) name
15757 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
15758 #endif
15759
15760 weak_symbol(fopen);
15761
15762   ;
15763   return 0;
15764 }
15765 _ACEOF
15766 rm -f "conftest.$ac_objext"
15767 if { (eval echo "$as_me:15767: \"$ac_compile\"") >&5
15768   (eval $ac_compile) 2>&5
15769   ac_status=$?
15770   echo "$as_me:15770: \$? = $ac_status" >&5
15771   (exit "$ac_status"); } &&
15772          { ac_try='test -s "conftest.$ac_objext"'
15773   { (eval echo "$as_me:15773: \"$ac_try\"") >&5
15774   (eval $ac_try) 2>&5
15775   ac_status=$?
15776   echo "$as_me:15776: \$? = $ac_status" >&5
15777   (exit "$ac_status"); }; }; then
15778   cf_cv_weak_symbols=yes
15779 else
15780   echo "$as_me: failed program was:" >&5
15781 cat "conftest.$ac_ext" >&5
15782 cf_cv_weak_symbols=no
15783 fi
15784 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15785
15786 fi
15787 echo "$as_me:15787: result: $cf_cv_weak_symbols" >&5
15788 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
15789
15790 else
15791         cf_cv_weak_symbols=no
15792 fi
15793
15794 if test $cf_cv_weak_symbols = yes ; then
15795
15796 cat >>confdefs.h <<\EOF
15797 #define USE_WEAK_SYMBOLS 1
15798 EOF
15799
15800 fi
15801
15802 PTHREAD=
15803 if test "$with_pthread" = "yes" ; then
15804
15805 cat >>confdefs.h <<\EOF
15806 #define USE_PTHREADS 1
15807 EOF
15808
15809         enable_reentrant=yes
15810         if test $cf_cv_weak_symbols = yes ; then
15811                 PTHREAD=-lpthread
15812         fi
15813 fi
15814
15815 # OpenSUSE is installing ncurses6, using reentrant option.
15816 echo "$as_me:15816: checking for _nc_TABSIZE" >&5
15817 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15818 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15819   echo $ECHO_N "(cached) $ECHO_C" >&6
15820 else
15821   cat >"conftest.$ac_ext" <<_ACEOF
15822 #line 15822 "configure"
15823 #include "confdefs.h"
15824 #define _nc_TABSIZE autoconf_temporary
15825 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15826 #undef _nc_TABSIZE
15827
15828 #ifdef __cplusplus
15829 extern "C"
15830 #endif
15831
15832 /* We use char because int might match the return type of a gcc2
15833    builtin and then its argument prototype would still apply.  */
15834 char _nc_TABSIZE (void);
15835
15836 int
15837 main (void)
15838 {
15839
15840 /* The GNU C library defines stubs for functions which it implements
15841     to always fail with ENOSYS.  Some functions are actually named
15842     something starting with __ and the normal name is an alias.  */
15843 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15844 #error found stub for _nc_TABSIZE
15845 #endif
15846
15847         return _nc_TABSIZE ();
15848   ;
15849   return 0;
15850 }
15851 _ACEOF
15852 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15853 if { (eval echo "$as_me:15853: \"$ac_link\"") >&5
15854   (eval $ac_link) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit "$ac_status"); } &&
15858          { ac_try='test -s "conftest$ac_exeext"'
15859   { (eval echo "$as_me:15859: \"$ac_try\"") >&5
15860   (eval $ac_try) 2>&5
15861   ac_status=$?
15862   echo "$as_me:15862: \$? = $ac_status" >&5
15863   (exit "$ac_status"); }; }; then
15864   ac_cv_func__nc_TABSIZE=yes
15865 else
15866   echo "$as_me: failed program was:" >&5
15867 cat "conftest.$ac_ext" >&5
15868 ac_cv_func__nc_TABSIZE=no
15869 fi
15870 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15871 fi
15872 echo "$as_me:15872: result: $ac_cv_func__nc_TABSIZE" >&5
15873 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15874 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15875   assume_reentrant=yes
15876 else
15877   assume_reentrant=no
15878 fi
15879
15880 # Reentrant code has to be opaque; there's little advantage to making ncurses
15881 # opaque outside of that, so there is no --enable-opaque option.  We can use
15882 # this option without --with-pthreads, but this will be always set for
15883 # pthreads.
15884 echo "$as_me:15884: checking if you want experimental reentrant code" >&5
15885 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15886
15887 # Check whether --enable-reentrant or --disable-reentrant was given.
15888 if test "${enable_reentrant+set}" = set; then
15889   enableval="$enable_reentrant"
15890   with_reentrant=$enableval
15891 else
15892   with_reentrant=$assume_reentrant
15893 fi;
15894 echo "$as_me:15894: result: $with_reentrant" >&5
15895 echo "${ECHO_T}$with_reentrant" >&6
15896 if test "$with_reentrant" = yes ; then
15897         cf_cv_enable_reentrant=1
15898         if test $cf_cv_weak_symbols = yes ; then
15899
15900 # remove pthread library from $LIBS
15901 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15902
15903         elif test "$assume_reentrant" = no ; then
15904                 LIB_SUFFIX="t${LIB_SUFFIX}"
15905         fi
15906
15907 cat >>confdefs.h <<\EOF
15908 #define USE_REENTRANT 1
15909 EOF
15910
15911 else
15912         cf_cv_enable_reentrant=0
15913 fi
15914
15915 ### Allow using a different wrap-prefix
15916 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15917         echo "$as_me:15917: checking for prefix used to wrap public variables" >&5
15918 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15919
15920 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15921 if test "${with_wrap_prefix+set}" = set; then
15922   withval="$with_wrap_prefix"
15923   NCURSES_WRAP_PREFIX=$withval
15924 else
15925   NCURSES_WRAP_PREFIX=_nc_
15926 fi;
15927         echo "$as_me:15927: result: $NCURSES_WRAP_PREFIX" >&5
15928 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15929 else
15930         NCURSES_WRAP_PREFIX=_nc_
15931 fi
15932
15933 cat >>confdefs.h <<EOF
15934 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15935 EOF
15936
15937 ###############################################################################
15938
15939 ###     use option --disable-echo to suppress full display compiling commands
15940
15941 echo "$as_me:15941: checking if you want to see long compiling messages" >&5
15942 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15943
15944 # Check whether --enable-echo or --disable-echo was given.
15945 if test "${enable_echo+set}" = set; then
15946   enableval="$enable_echo"
15947   test "$enableval" != no && enableval=yes
15948         if test "$enableval" != "yes" ; then
15949
15950         ECHO_LT='--silent'
15951         ECHO_LD='@echo linking $@;'
15952         RULE_CC='@echo compiling $<'
15953         SHOW_CC='@echo compiling $@'
15954         ECHO_CC='@'
15955
15956         else
15957
15958         ECHO_LT=''
15959         ECHO_LD=''
15960         RULE_CC=''
15961         SHOW_CC=''
15962         ECHO_CC=''
15963
15964         fi
15965 else
15966   enableval=yes
15967
15968         ECHO_LT=''
15969         ECHO_LD=''
15970         RULE_CC=''
15971         SHOW_CC=''
15972         ECHO_CC=''
15973
15974 fi;
15975 echo "$as_me:15975: result: $enableval" >&5
15976 echo "${ECHO_T}$enableval" >&6
15977
15978 echo "$as_me:15978: checking if you want to use C11 _Noreturn feature" >&5
15979 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15980
15981 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15982 if test "${enable_stdnoreturn+set}" = set; then
15983   enableval="$enable_stdnoreturn"
15984   test "$enableval" != yes && enableval=no
15985         if test "$enableval" != "no" ; then
15986     enable_stdnoreturn=yes
15987         else
15988                 enable_stdnoreturn=no
15989         fi
15990 else
15991   enableval=no
15992         enable_stdnoreturn=no
15993
15994 fi;
15995 echo "$as_me:15995: result: $enable_stdnoreturn" >&5
15996 echo "${ECHO_T}$enable_stdnoreturn" >&6
15997
15998 if test $enable_stdnoreturn = yes; then
15999 echo "$as_me:15999: checking for C11 _Noreturn feature" >&5
16000 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
16001 if test "${cf_cv_c11_noreturn+set}" = set; then
16002   echo $ECHO_N "(cached) $ECHO_C" >&6
16003 else
16004   cat >"conftest.$ac_ext" <<_ACEOF
16005 #line 16005 "configure"
16006 #include "confdefs.h"
16007
16008 $ac_includes_default
16009 #include <stdnoreturn.h>
16010 static _Noreturn void giveup(void) { exit(0); }
16011
16012 int
16013 main (void)
16014 {
16015 if (feof(stdin)) giveup()
16016   ;
16017   return 0;
16018 }
16019 _ACEOF
16020 rm -f "conftest.$ac_objext"
16021 if { (eval echo "$as_me:16021: \"$ac_compile\"") >&5
16022   (eval $ac_compile) 2>&5
16023   ac_status=$?
16024   echo "$as_me:16024: \$? = $ac_status" >&5
16025   (exit "$ac_status"); } &&
16026          { ac_try='test -s "conftest.$ac_objext"'
16027   { (eval echo "$as_me:16027: \"$ac_try\"") >&5
16028   (eval $ac_try) 2>&5
16029   ac_status=$?
16030   echo "$as_me:16030: \$? = $ac_status" >&5
16031   (exit "$ac_status"); }; }; then
16032   cf_cv_c11_noreturn=yes
16033 else
16034   echo "$as_me: failed program was:" >&5
16035 cat "conftest.$ac_ext" >&5
16036 cf_cv_c11_noreturn=no
16037 fi
16038 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16039
16040 fi
16041 echo "$as_me:16041: result: $cf_cv_c11_noreturn" >&5
16042 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
16043 else
16044         cf_cv_c11_noreturn=no,
16045 fi
16046
16047 if test "$cf_cv_c11_noreturn" = yes; then
16048
16049 cat >>confdefs.h <<\EOF
16050 #define HAVE_STDNORETURN_H 1
16051 EOF
16052
16053 cat >>confdefs.h <<EOF
16054 #define STDC_NORETURN _Noreturn
16055 EOF
16056
16057         HAVE_STDNORETURN_H=1
16058 else
16059         HAVE_STDNORETURN_H=0
16060 fi
16061
16062 if test "$GCC" = yes || test "$GXX" = yes
16063 then
16064
16065 if test "$GCC" = yes || test "$GXX" = yes
16066 then
16067         case $CFLAGS in
16068         (*-Werror=*)
16069                 cf_temp_flags=
16070                 for cf_temp_scan in $CFLAGS
16071                 do
16072                         case "x$cf_temp_scan" in
16073                         (x-Werror=format*)
16074
16075         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16076         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16077
16078                                 ;;
16079                         (x-Werror=*)
16080
16081         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16082         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16083
16084                                 ;;
16085                         (*)
16086
16087         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16088         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16089
16090                                 ;;
16091                         esac
16092                 done
16093                 if test "x$CFLAGS" != "x$cf_temp_flags"
16094                 then
16095                         test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
16096
16097 echo "${as_me:-configure}:16097: testing repairing CFLAGS: $CFLAGS ..." 1>&5
16098
16099                         CFLAGS="$cf_temp_flags"
16100                         test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
16101
16102 echo "${as_me:-configure}:16102: testing ... fixed $CFLAGS ..." 1>&5
16103
16104                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16105
16106 echo "${as_me:-configure}:16106: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16107
16108                 fi
16109                 ;;
16110         esac
16111 fi
16112
16113 if test "$GCC" = yes || test "$GXX" = yes
16114 then
16115         case $CPPFLAGS in
16116         (*-Werror=*)
16117                 cf_temp_flags=
16118                 for cf_temp_scan in $CPPFLAGS
16119                 do
16120                         case "x$cf_temp_scan" in
16121                         (x-Werror=format*)
16122
16123         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16124         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16125
16126                                 ;;
16127                         (x-Werror=*)
16128
16129         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16130         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16131
16132                                 ;;
16133                         (*)
16134
16135         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16136         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16137
16138                                 ;;
16139                         esac
16140                 done
16141                 if test "x$CPPFLAGS" != "x$cf_temp_flags"
16142                 then
16143                         test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
16144
16145 echo "${as_me:-configure}:16145: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
16146
16147                         CPPFLAGS="$cf_temp_flags"
16148                         test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
16149
16150 echo "${as_me:-configure}:16150: testing ... fixed $CPPFLAGS ..." 1>&5
16151
16152                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16153
16154 echo "${as_me:-configure}:16154: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16155
16156                 fi
16157                 ;;
16158         esac
16159 fi
16160
16161 if test "$GCC" = yes || test "$GXX" = yes
16162 then
16163         case $LDFLAGS in
16164         (*-Werror=*)
16165                 cf_temp_flags=
16166                 for cf_temp_scan in $LDFLAGS
16167                 do
16168                         case "x$cf_temp_scan" in
16169                         (x-Werror=format*)
16170
16171         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16172         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16173
16174                                 ;;
16175                         (x-Werror=*)
16176
16177         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
16178         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
16179
16180                                 ;;
16181                         (*)
16182
16183         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
16184         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
16185
16186                                 ;;
16187                         esac
16188                 done
16189                 if test "x$LDFLAGS" != "x$cf_temp_flags"
16190                 then
16191                         test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
16192
16193 echo "${as_me:-configure}:16193: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
16194
16195                         LDFLAGS="$cf_temp_flags"
16196                         test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
16197
16198 echo "${as_me:-configure}:16198: testing ... fixed $LDFLAGS ..." 1>&5
16199
16200                         test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
16201
16202 echo "${as_me:-configure}:16202: testing ... extra $EXTRA_CFLAGS ..." 1>&5
16203
16204                 fi
16205                 ;;
16206         esac
16207 fi
16208
16209 echo "$as_me:16209: checking if you want to turn on gcc warnings" >&5
16210 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16211
16212 # Check whether --enable-warnings or --disable-warnings was given.
16213 if test "${enable_warnings+set}" = set; then
16214   enableval="$enable_warnings"
16215   test "$enableval" != yes && enableval=no
16216         if test "$enableval" != "no" ; then
16217     enable_warnings=yes
16218         else
16219                 enable_warnings=no
16220         fi
16221 else
16222   enableval=no
16223         enable_warnings=no
16224
16225 fi;
16226 echo "$as_me:16226: result: $enable_warnings" >&5
16227 echo "${ECHO_T}$enable_warnings" >&6
16228 if test "$enable_warnings" = "yes"
16229 then
16230
16231 if test "x$have_x" = xyes; then
16232
16233 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
16234 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
16235 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
16236 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
16237 for cf_X_CFLAGS in $X_CFLAGS
16238 do
16239         case "x$cf_X_CFLAGS" in
16240         x-[IUD]*)
16241                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
16242                 ;;
16243         *)
16244                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
16245                 ;;
16246         esac
16247 done
16248
16249 cat >"conftest.$ac_ext" <<_ACEOF
16250 #line 16250 "configure"
16251 #include "confdefs.h"
16252
16253 #include <stdlib.h>
16254 #include <X11/Intrinsic.h>
16255
16256 int
16257 main (void)
16258 {
16259 String foo = malloc(1); free((void*)foo)
16260   ;
16261   return 0;
16262 }
16263 _ACEOF
16264 rm -f "conftest.$ac_objext"
16265 if { (eval echo "$as_me:16265: \"$ac_compile\"") >&5
16266   (eval $ac_compile) 2>&5
16267   ac_status=$?
16268   echo "$as_me:16268: \$? = $ac_status" >&5
16269   (exit "$ac_status"); } &&
16270          { ac_try='test -s "conftest.$ac_objext"'
16271   { (eval echo "$as_me:16271: \"$ac_try\"") >&5
16272   (eval $ac_try) 2>&5
16273   ac_status=$?
16274   echo "$as_me:16274: \$? = $ac_status" >&5
16275   (exit "$ac_status"); }; }; then
16276
16277 echo "$as_me:16277: checking for X11/Xt const-feature" >&5
16278 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
16279 if test "${cf_cv_const_x_string+set}" = set; then
16280   echo $ECHO_N "(cached) $ECHO_C" >&6
16281 else
16282
16283         cat >"conftest.$ac_ext" <<_ACEOF
16284 #line 16284 "configure"
16285 #include "confdefs.h"
16286
16287 #undef  _CONST_X_STRING
16288 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
16289 #undef  XTSTRINGDEFINES /* X11R5 and later */
16290 #include <stdlib.h>
16291 #include <X11/Intrinsic.h>
16292
16293 int
16294 main (void)
16295 {
16296 String foo = malloc(1); *foo = 0
16297   ;
16298   return 0;
16299 }
16300 _ACEOF
16301 rm -f "conftest.$ac_objext"
16302 if { (eval echo "$as_me:16302: \"$ac_compile\"") >&5
16303   (eval $ac_compile) 2>&5
16304   ac_status=$?
16305   echo "$as_me:16305: \$? = $ac_status" >&5
16306   (exit "$ac_status"); } &&
16307          { ac_try='test -s "conftest.$ac_objext"'
16308   { (eval echo "$as_me:16308: \"$ac_try\"") >&5
16309   (eval $ac_try) 2>&5
16310   ac_status=$?
16311   echo "$as_me:16311: \$? = $ac_status" >&5
16312   (exit "$ac_status"); }; }; then
16313
16314                         cf_cv_const_x_string=no
16315
16316 else
16317   echo "$as_me: failed program was:" >&5
16318 cat "conftest.$ac_ext" >&5
16319
16320                         cf_cv_const_x_string=yes
16321
16322 fi
16323 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16324
16325 fi
16326 echo "$as_me:16326: result: $cf_cv_const_x_string" >&5
16327 echo "${ECHO_T}$cf_cv_const_x_string" >&6
16328
16329 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
16330 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
16331 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
16332
16333 case "$cf_cv_const_x_string" in
16334 (no)
16335
16336         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16337         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
16338
16339         ;;
16340 (*)
16341
16342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16343         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
16344
16345         ;;
16346 esac
16347
16348 else
16349   echo "$as_me: failed program was:" >&5
16350 cat "conftest.$ac_ext" >&5
16351 fi
16352 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16353  fi
16354 cat > "conftest.$ac_ext" <<EOF
16355 #line 16355 "${as_me:-configure}"
16356 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16357 EOF
16358 if test "$INTEL_COMPILER" = yes
16359 then
16360 # The "-wdXXX" options suppress warnings:
16361 # remark #1419: external declaration in primary source file
16362 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16363 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16364 # remark #193: zero used for undefined preprocessing identifier
16365 # remark #593: variable "curs_sb_left_arrow" was set but never used
16366 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16367 # remark #869: parameter "tw" was never referenced
16368 # remark #981: operands are evaluated in unspecified order
16369 # warning #279: controlling expression is constant
16370
16371         { echo "$as_me:16371: checking for $CC warning options..." >&5
16372 echo "$as_me: checking for $CC warning options..." >&6;}
16373         cf_save_CFLAGS="$CFLAGS"
16374         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
16375         for cf_opt in \
16376                 wd1419 \
16377                 wd1683 \
16378                 wd1684 \
16379                 wd193 \
16380                 wd593 \
16381                 wd279 \
16382                 wd810 \
16383                 wd869 \
16384                 wd981
16385         do
16386                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16387                 if { (eval echo "$as_me:16387: \"$ac_compile\"") >&5
16388   (eval $ac_compile) 2>&5
16389   ac_status=$?
16390   echo "$as_me:16390: \$? = $ac_status" >&5
16391   (exit "$ac_status"); }; then
16392                         test -n "$verbose" && echo "$as_me:16392: result: ... -$cf_opt" >&5
16393 echo "${ECHO_T}... -$cf_opt" >&6
16394                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16395                 fi
16396         done
16397         CFLAGS="$cf_save_CFLAGS"
16398 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
16399 then
16400         { echo "$as_me:16400: checking for $CC warning options..." >&5
16401 echo "$as_me: checking for $CC warning options..." >&6;}
16402         cf_save_CFLAGS="$CFLAGS"
16403         cf_warn_CONST=""
16404         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16405         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16406         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16407         for cf_opt in W Wall \
16408                 Wbad-function-cast \
16409                 Wcast-align \
16410                 Wcast-qual \
16411                 Wdeclaration-after-statement \
16412                 Wextra \
16413                 Winline \
16414                 Wmissing-declarations \
16415                 Wmissing-prototypes \
16416                 Wnested-externs \
16417                 Wpointer-arith \
16418                 Wshadow \
16419                 Wstrict-prototypes \
16420                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
16421         do
16422                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16423                 if { (eval echo "$as_me:16423: \"$ac_compile\"") >&5
16424   (eval $ac_compile) 2>&5
16425   ac_status=$?
16426   echo "$as_me:16426: \$? = $ac_status" >&5
16427   (exit "$ac_status"); }; then
16428                         test -n "$verbose" && echo "$as_me:16428: result: ... -$cf_opt" >&5
16429 echo "${ECHO_T}... -$cf_opt" >&6
16430                         case "$cf_opt" in
16431                         (Winline)
16432                                 case "$GCC_VERSION" in
16433                                 ([34].*)
16434                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16435
16436 echo "${as_me:-configure}:16436: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16437
16438                                         continue;;
16439                                 esac
16440                                 ;;
16441                         (Wpointer-arith)
16442                                 case "$GCC_VERSION" in
16443                                 ([12].*)
16444                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16445
16446 echo "${as_me:-configure}:16446: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16447
16448                                         continue;;
16449                                 esac
16450                                 ;;
16451                         esac
16452                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16453                 fi
16454         done
16455         CFLAGS="$cf_save_CFLAGS"
16456 fi
16457 rm -rf ./conftest*
16458
16459 fi
16460
16461 if test "$GCC" = yes || test "$GXX" = yes
16462 then
16463 cat > conftest.i <<EOF
16464 #ifndef GCC_PRINTF
16465 #define GCC_PRINTF 0
16466 #endif
16467 #ifndef GCC_SCANF
16468 #define GCC_SCANF 0
16469 #endif
16470 #ifndef GCC_NORETURN
16471 #define GCC_NORETURN /* nothing */
16472 #endif
16473 #ifndef GCC_UNUSED
16474 #define GCC_UNUSED /* nothing */
16475 #endif
16476 EOF
16477 if test "$GCC" = yes
16478 then
16479         { echo "$as_me:16479: checking for $CC __attribute__ directives..." >&5
16480 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16481 cat > "conftest.$ac_ext" <<EOF
16482 #line 16482 "${as_me:-configure}"
16483 #include <stdio.h>
16484 #include "confdefs.h"
16485 #include "conftest.h"
16486 #include "conftest.i"
16487 #if     GCC_PRINTF
16488 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16489 #else
16490 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16491 #endif
16492 #if     GCC_SCANF
16493 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16494 #else
16495 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16496 #endif
16497 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16498 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
16499 extern GCC_NORETURN void foo(void);
16500 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
16501 EOF
16502         cf_printf_attribute=no
16503         cf_scanf_attribute=no
16504         for cf_attribute in scanf printf unused noreturn
16505         do
16506
16507 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16508
16509                 cf_directive="__attribute__(($cf_attribute))"
16510                 echo "checking for $CC $cf_directive" 1>&5
16511
16512                 case "$cf_attribute" in
16513                 (printf)
16514                         cf_printf_attribute=yes
16515                         cat >conftest.h <<EOF
16516 #define GCC_$cf_ATTRIBUTE 1
16517 EOF
16518                         ;;
16519                 (scanf)
16520                         cf_scanf_attribute=yes
16521                         cat >conftest.h <<EOF
16522 #define GCC_$cf_ATTRIBUTE 1
16523 EOF
16524                         ;;
16525                 (*)
16526                         cat >conftest.h <<EOF
16527 #define GCC_$cf_ATTRIBUTE $cf_directive
16528 EOF
16529                         ;;
16530                 esac
16531
16532                 if { (eval echo "$as_me:16532: \"$ac_compile\"") >&5
16533   (eval $ac_compile) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit "$ac_status"); }; then
16537                         test -n "$verbose" && echo "$as_me:16537: result: ... $cf_attribute" >&5
16538 echo "${ECHO_T}... $cf_attribute" >&6
16539                         cat conftest.h >>confdefs.h
16540                         case "$cf_attribute" in
16541                         (noreturn)
16542
16543 cat >>confdefs.h <<EOF
16544 #define GCC_NORETURN $cf_directive
16545 EOF
16546
16547                                 ;;
16548                         (printf)
16549                                 cf_value='/* nothing */'
16550                                 if test "$cf_printf_attribute" != no ; then
16551                                         cf_value='__attribute__((format(printf,fmt,var)))'
16552
16553 cat >>confdefs.h <<\EOF
16554 #define GCC_PRINTF 1
16555 EOF
16556
16557                                 fi
16558
16559 cat >>confdefs.h <<EOF
16560 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16561 EOF
16562
16563                                 ;;
16564                         (scanf)
16565                                 cf_value='/* nothing */'
16566                                 if test "$cf_scanf_attribute" != no ; then
16567                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16568
16569 cat >>confdefs.h <<\EOF
16570 #define GCC_SCANF 1
16571 EOF
16572
16573                                 fi
16574
16575 cat >>confdefs.h <<EOF
16576 #define GCC_SCANFLIKE(fmt,var) $cf_value
16577 EOF
16578
16579                                 ;;
16580                         (unused)
16581
16582 cat >>confdefs.h <<EOF
16583 #define GCC_UNUSED $cf_directive
16584 EOF
16585
16586                                 ;;
16587                         esac
16588                 fi
16589         done
16590 else
16591         ${FGREP-fgrep} define conftest.i >>confdefs.h
16592 fi
16593 rm -rf ./conftest*
16594 fi
16595
16596 fi
16597
16598 if test "x$enable_warnings" = "xyes"; then
16599
16600         ADAFLAGS="$ADAFLAGS -gnatwa -gnatyg"
16601
16602 fi
16603
16604 ###     use option --enable-assertions to turn on generation of assertion code
16605 echo "$as_me:16605: checking if you want to enable runtime assertions" >&5
16606 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
16607
16608 # Check whether --enable-assertions or --disable-assertions was given.
16609 if test "${enable_assertions+set}" = set; then
16610   enableval="$enable_assertions"
16611   with_assertions=$enableval
16612 else
16613   with_assertions=no
16614 fi;
16615 echo "$as_me:16615: result: $with_assertions" >&5
16616 echo "${ECHO_T}$with_assertions" >&6
16617 if test -n "$GCC"
16618 then
16619         if test "$with_assertions" = no
16620         then
16621                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
16622         else
16623
16624         ADAFLAGS="$ADAFLAGS -gnata"
16625
16626         fi
16627 fi
16628
16629 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
16630
16631 cat >>confdefs.h <<\EOF
16632 #define HAVE_NC_ALLOC_H 1
16633 EOF
16634
16635 ###     use option --enable-expanded to generate certain macros as functions
16636
16637 # Check whether --enable-expanded or --disable-expanded was given.
16638 if test "${enable_expanded+set}" = set; then
16639   enableval="$enable_expanded"
16640   test "$enableval" = yes &&
16641 cat >>confdefs.h <<\EOF
16642 #define NCURSES_EXPANDED 1
16643 EOF
16644
16645 fi;
16646
16647 ###     use option --disable-macros to suppress macros in favor of functions
16648
16649 # Check whether --enable-macros or --disable-macros was given.
16650 if test "${enable_macros+set}" = set; then
16651   enableval="$enable_macros"
16652   test "$enableval" = no &&
16653 cat >>confdefs.h <<\EOF
16654 #define NCURSES_NOMACROS 1
16655 EOF
16656
16657 fi;
16658
16659 # Normally we only add trace() to the debug-library.  Allow this to be
16660 # extended to all models of the ncurses library:
16661 cf_all_traces=no
16662 case "$CFLAGS $CPPFLAGS" in
16663 (*-DTRACE*)
16664         cf_all_traces=yes
16665         ;;
16666 esac
16667
16668 echo "$as_me:16668: checking whether to add trace feature to all models" >&5
16669 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
16670
16671 # Check whether --with-trace or --without-trace was given.
16672 if test "${with_trace+set}" = set; then
16673   withval="$with_trace"
16674   cf_with_trace=$withval
16675 else
16676   cf_with_trace=$cf_all_traces
16677 fi;
16678 echo "$as_me:16678: result: $cf_with_trace" >&5
16679 echo "${ECHO_T}$cf_with_trace" >&6
16680
16681 if test "$cf_with_trace" = yes ; then
16682         ADA_TRACE=TRUE
16683
16684 cat >>confdefs.h <<\EOF
16685 #define TRACE 1
16686 EOF
16687
16688 else
16689         ADA_TRACE=FALSE
16690 fi
16691
16692 echo "$as_me:16692: checking if we want to use GNAT projects" >&5
16693 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
16694
16695 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
16696 if test "${enable_gnat_projects+set}" = set; then
16697   enableval="$enable_gnat_projects"
16698   test "$enableval" != no && enableval=yes
16699         if test "$enableval" != "yes" ; then
16700     enable_gnat_projects=no
16701         else
16702                 enable_gnat_projects=yes
16703         fi
16704 else
16705   enableval=yes
16706         enable_gnat_projects=yes
16707
16708 fi;
16709 echo "$as_me:16709: result: $enable_gnat_projects" >&5
16710 echo "${ECHO_T}$enable_gnat_projects" >&6
16711
16712 ###     Checks for libraries.
16713 case $cf_cv_system_name in
16714 (*mingw32*)
16715
16716 echo "$as_me:16716: checking if ssp library is needed" >&5
16717 echo $ECHO_N "checking if ssp library is needed... $ECHO_C" >&6
16718 if test "${cf_cv_need_libssp+set}" = set; then
16719   echo $ECHO_N "(cached) $ECHO_C" >&6
16720 else
16721
16722 cat >"conftest.$ac_ext" <<_ACEOF
16723 #line 16723 "configure"
16724 #include "confdefs.h"
16725
16726 #include <sys/types.h>
16727 #include <dirent.h>
16728
16729 int
16730 main (void)
16731 {
16732
16733        DIR *dp = opendir(".");
16734
16735   ;
16736   return 0;
16737 }
16738 _ACEOF
16739 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16740 if { (eval echo "$as_me:16740: \"$ac_link\"") >&5
16741   (eval $ac_link) 2>&5
16742   ac_status=$?
16743   echo "$as_me:16743: \$? = $ac_status" >&5
16744   (exit "$ac_status"); } &&
16745          { ac_try='test -s "conftest$ac_exeext"'
16746   { (eval echo "$as_me:16746: \"$ac_try\"") >&5
16747   (eval $ac_try) 2>&5
16748   ac_status=$?
16749   echo "$as_me:16749: \$? = $ac_status" >&5
16750   (exit "$ac_status"); }; }; then
16751   cf_cv_need_libssp=no
16752 else
16753   echo "$as_me: failed program was:" >&5
16754 cat "conftest.$ac_ext" >&5
16755
16756         cf_save_LIBS="$LIBS"
16757         LIBS="$LIBS -lssp"
16758         cat >"conftest.$ac_ext" <<_ACEOF
16759 #line 16759 "configure"
16760 #include "confdefs.h"
16761
16762 #include <sys/types.h>
16763 #include <dirent.h>
16764
16765 int
16766 main (void)
16767 {
16768
16769                    DIR *dp = opendir(".");
16770
16771   ;
16772   return 0;
16773 }
16774 _ACEOF
16775 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16776 if { (eval echo "$as_me:16776: \"$ac_link\"") >&5
16777   (eval $ac_link) 2>&5
16778   ac_status=$?
16779   echo "$as_me:16779: \$? = $ac_status" >&5
16780   (exit "$ac_status"); } &&
16781          { ac_try='test -s "conftest$ac_exeext"'
16782   { (eval echo "$as_me:16782: \"$ac_try\"") >&5
16783   (eval $ac_try) 2>&5
16784   ac_status=$?
16785   echo "$as_me:16785: \$? = $ac_status" >&5
16786   (exit "$ac_status"); }; }; then
16787   cf_cv_need_libssp=yes
16788 else
16789   echo "$as_me: failed program was:" >&5
16790 cat "conftest.$ac_ext" >&5
16791 cf_cv_need_libssp=maybe
16792 fi
16793 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16794         LIBS="$cf_save_LIBS"
16795
16796 fi
16797 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16798 fi
16799 echo "$as_me:16799: result: $cf_cv_need_libssp" >&5
16800 echo "${ECHO_T}$cf_cv_need_libssp" >&6
16801
16802 if test "x$cf_cv_need_libssp" = xyes
16803 then
16804
16805 cf_add_libs="$LIBS"
16806 # reverse order
16807 cf_add_0lib=
16808 for cf_add_1lib in -lssp; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16809 # filter duplicates
16810 for cf_add_1lib in $cf_add_0lib; do
16811         for cf_add_2lib in $cf_add_libs; do
16812                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16813                         cf_add_1lib=
16814                         break
16815                 fi
16816         done
16817         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16818 done
16819 LIBS="$cf_add_libs"
16820
16821 fi
16822
16823         ;;
16824 (*)
16825
16826 cf_save_libs="$LIBS"
16827 echo "$as_me:16827: checking for clock_gettime" >&5
16828 echo $ECHO_N "checking for clock_gettime... $ECHO_C" >&6
16829 if test "${ac_cv_func_clock_gettime+set}" = set; then
16830   echo $ECHO_N "(cached) $ECHO_C" >&6
16831 else
16832   cat >"conftest.$ac_ext" <<_ACEOF
16833 #line 16833 "configure"
16834 #include "confdefs.h"
16835 #define clock_gettime autoconf_temporary
16836 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16837 #undef clock_gettime
16838
16839 #ifdef __cplusplus
16840 extern "C"
16841 #endif
16842
16843 /* We use char because int might match the return type of a gcc2
16844    builtin and then its argument prototype would still apply.  */
16845 char clock_gettime (void);
16846
16847 int
16848 main (void)
16849 {
16850
16851 /* The GNU C library defines stubs for functions which it implements
16852     to always fail with ENOSYS.  Some functions are actually named
16853     something starting with __ and the normal name is an alias.  */
16854 #if defined (__stub_clock_gettime) || defined (__stub___clock_gettime)
16855 #error found stub for clock_gettime
16856 #endif
16857
16858         return clock_gettime ();
16859   ;
16860   return 0;
16861 }
16862 _ACEOF
16863 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16864 if { (eval echo "$as_me:16864: \"$ac_link\"") >&5
16865   (eval $ac_link) 2>&5
16866   ac_status=$?
16867   echo "$as_me:16867: \$? = $ac_status" >&5
16868   (exit "$ac_status"); } &&
16869          { ac_try='test -s "conftest$ac_exeext"'
16870   { (eval echo "$as_me:16870: \"$ac_try\"") >&5
16871   (eval $ac_try) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit "$ac_status"); }; }; then
16875   ac_cv_func_clock_gettime=yes
16876 else
16877   echo "$as_me: failed program was:" >&5
16878 cat "conftest.$ac_ext" >&5
16879 ac_cv_func_clock_gettime=no
16880 fi
16881 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16882 fi
16883 echo "$as_me:16883: result: $ac_cv_func_clock_gettime" >&5
16884 echo "${ECHO_T}$ac_cv_func_clock_gettime" >&6
16885 if test "$ac_cv_func_clock_gettime" = yes; then
16886   cf_cv_test_clock_gettime=yes
16887 else
16888   echo "$as_me:16888: checking for clock_gettime in -lrt" >&5
16889 echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
16890 if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
16891   echo $ECHO_N "(cached) $ECHO_C" >&6
16892 else
16893   ac_check_lib_save_LIBS=$LIBS
16894 LIBS="-lrt  $LIBS"
16895 cat >"conftest.$ac_ext" <<_ACEOF
16896 #line 16896 "configure"
16897 #include "confdefs.h"
16898
16899 /* Override any gcc2 internal prototype to avoid an error.  */
16900 #ifdef __cplusplus
16901 extern "C"
16902 #endif
16903 /* We use char because int might match the return type of a gcc2
16904    builtin and then its argument prototype would still apply.  */
16905 char clock_gettime (void);
16906 int
16907 main (void)
16908 {
16909 clock_gettime ();
16910   ;
16911   return 0;
16912 }
16913 _ACEOF
16914 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16915 if { (eval echo "$as_me:16915: \"$ac_link\"") >&5
16916   (eval $ac_link) 2>&5
16917   ac_status=$?
16918   echo "$as_me:16918: \$? = $ac_status" >&5
16919   (exit "$ac_status"); } &&
16920          { ac_try='test -s "conftest$ac_exeext"'
16921   { (eval echo "$as_me:16921: \"$ac_try\"") >&5
16922   (eval $ac_try) 2>&5
16923   ac_status=$?
16924   echo "$as_me:16924: \$? = $ac_status" >&5
16925   (exit "$ac_status"); }; }; then
16926   ac_cv_lib_rt_clock_gettime=yes
16927 else
16928   echo "$as_me: failed program was:" >&5
16929 cat "conftest.$ac_ext" >&5
16930 ac_cv_lib_rt_clock_gettime=no
16931 fi
16932 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16933 LIBS=$ac_check_lib_save_LIBS
16934 fi
16935 echo "$as_me:16935: result: $ac_cv_lib_rt_clock_gettime" >&5
16936 echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
16937 if test "$ac_cv_lib_rt_clock_gettime" = yes; then
16938   LIBS="-lrt $LIBS"
16939                  cf_cv_test_clock_gettime=yes
16940 else
16941   cf_cv_test_clock_gettime=no
16942 fi
16943
16944 fi
16945
16946 if test "$cf_cv_test_clock_gettime" = yes ; then
16947 echo "$as_me:16947: checking if clock_gettime links" >&5
16948 echo $ECHO_N "checking if clock_gettime links... $ECHO_C" >&6
16949 if test "${cf_cv_func_clock_gettime+set}" = set; then
16950   echo $ECHO_N "(cached) $ECHO_C" >&6
16951 else
16952
16953                 cat >"conftest.$ac_ext" <<_ACEOF
16954 #line 16954 "configure"
16955 #include "confdefs.h"
16956
16957 $ac_includes_default
16958 #include <time.h>
16959
16960 int
16961 main (void)
16962 {
16963 struct timespec ts;
16964                 int rc = clock_gettime(CLOCK_REALTIME, &ts)
16965                            + clock_gettime(CLOCK_MONOTONIC, &ts);
16966                  (void) rc; (void)ts
16967   ;
16968   return 0;
16969 }
16970 _ACEOF
16971 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16972 if { (eval echo "$as_me:16972: \"$ac_link\"") >&5
16973   (eval $ac_link) 2>&5
16974   ac_status=$?
16975   echo "$as_me:16975: \$? = $ac_status" >&5
16976   (exit "$ac_status"); } &&
16977          { ac_try='test -s "conftest$ac_exeext"'
16978   { (eval echo "$as_me:16978: \"$ac_try\"") >&5
16979   (eval $ac_try) 2>&5
16980   ac_status=$?
16981   echo "$as_me:16981: \$? = $ac_status" >&5
16982   (exit "$ac_status"); }; }; then
16983   cf_cv_func_clock_gettime=yes
16984 else
16985   echo "$as_me: failed program was:" >&5
16986 cat "conftest.$ac_ext" >&5
16987 cf_cv_func_clock_gettime=no
16988 fi
16989 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16990
16991 fi
16992 echo "$as_me:16992: result: $cf_cv_func_clock_gettime" >&5
16993 echo "${ECHO_T}$cf_cv_func_clock_gettime" >&6
16994 else
16995         cf_cv_func_clock_gettime=no
16996 fi
16997
16998 if test "$cf_cv_func_clock_gettime" = yes
16999 then
17000
17001 cat >>confdefs.h <<\EOF
17002 #define HAVE_CLOCK_GETTIME 1
17003 EOF
17004
17005 else
17006 echo "$as_me:17006: checking for gettimeofday" >&5
17007 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
17008 if test "${ac_cv_func_gettimeofday+set}" = set; then
17009   echo $ECHO_N "(cached) $ECHO_C" >&6
17010 else
17011   cat >"conftest.$ac_ext" <<_ACEOF
17012 #line 17012 "configure"
17013 #include "confdefs.h"
17014 #define gettimeofday autoconf_temporary
17015 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17016 #undef gettimeofday
17017
17018 #ifdef __cplusplus
17019 extern "C"
17020 #endif
17021
17022 /* We use char because int might match the return type of a gcc2
17023    builtin and then its argument prototype would still apply.  */
17024 char gettimeofday (void);
17025
17026 int
17027 main (void)
17028 {
17029
17030 /* The GNU C library defines stubs for functions which it implements
17031     to always fail with ENOSYS.  Some functions are actually named
17032     something starting with __ and the normal name is an alias.  */
17033 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
17034 #error found stub for gettimeofday
17035 #endif
17036
17037         return gettimeofday ();
17038   ;
17039   return 0;
17040 }
17041 _ACEOF
17042 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17043 if { (eval echo "$as_me:17043: \"$ac_link\"") >&5
17044   (eval $ac_link) 2>&5
17045   ac_status=$?
17046   echo "$as_me:17046: \$? = $ac_status" >&5
17047   (exit "$ac_status"); } &&
17048          { ac_try='test -s "conftest$ac_exeext"'
17049   { (eval echo "$as_me:17049: \"$ac_try\"") >&5
17050   (eval $ac_try) 2>&5
17051   ac_status=$?
17052   echo "$as_me:17052: \$? = $ac_status" >&5
17053   (exit "$ac_status"); }; }; then
17054   ac_cv_func_gettimeofday=yes
17055 else
17056   echo "$as_me: failed program was:" >&5
17057 cat "conftest.$ac_ext" >&5
17058 ac_cv_func_gettimeofday=no
17059 fi
17060 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17061 fi
17062 echo "$as_me:17062: result: $ac_cv_func_gettimeofday" >&5
17063 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
17064 if test "$ac_cv_func_gettimeofday" = yes; then
17065
17066 cat >>confdefs.h <<\EOF
17067 #define HAVE_GETTIMEOFDAY 1
17068 EOF
17069
17070 else
17071
17072 echo "$as_me:17072: checking for gettimeofday in -lbsd" >&5
17073 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
17074 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
17075   echo $ECHO_N "(cached) $ECHO_C" >&6
17076 else
17077   ac_check_lib_save_LIBS=$LIBS
17078 LIBS="-lbsd  $LIBS"
17079 cat >"conftest.$ac_ext" <<_ACEOF
17080 #line 17080 "configure"
17081 #include "confdefs.h"
17082
17083 /* Override any gcc2 internal prototype to avoid an error.  */
17084 #ifdef __cplusplus
17085 extern "C"
17086 #endif
17087 /* We use char because int might match the return type of a gcc2
17088    builtin and then its argument prototype would still apply.  */
17089 char gettimeofday (void);
17090 int
17091 main (void)
17092 {
17093 gettimeofday ();
17094   ;
17095   return 0;
17096 }
17097 _ACEOF
17098 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17099 if { (eval echo "$as_me:17099: \"$ac_link\"") >&5
17100   (eval $ac_link) 2>&5
17101   ac_status=$?
17102   echo "$as_me:17102: \$? = $ac_status" >&5
17103   (exit "$ac_status"); } &&
17104          { ac_try='test -s "conftest$ac_exeext"'
17105   { (eval echo "$as_me:17105: \"$ac_try\"") >&5
17106   (eval $ac_try) 2>&5
17107   ac_status=$?
17108   echo "$as_me:17108: \$? = $ac_status" >&5
17109   (exit "$ac_status"); }; }; then
17110   ac_cv_lib_bsd_gettimeofday=yes
17111 else
17112   echo "$as_me: failed program was:" >&5
17113 cat "conftest.$ac_ext" >&5
17114 ac_cv_lib_bsd_gettimeofday=no
17115 fi
17116 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17117 LIBS=$ac_check_lib_save_LIBS
17118 fi
17119 echo "$as_me:17119: result: $ac_cv_lib_bsd_gettimeofday" >&5
17120 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
17121 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
17122
17123 cat >>confdefs.h <<\EOF
17124 #define HAVE_GETTIMEOFDAY 1
17125 EOF
17126
17127 cf_add_libs="$LIBS"
17128 # reverse order
17129 cf_add_0lib=
17130 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17131 # filter duplicates
17132 for cf_add_1lib in $cf_add_0lib; do
17133         for cf_add_2lib in $cf_add_libs; do
17134                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17135                         cf_add_1lib=
17136                         break
17137                 fi
17138         done
17139         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17140 done
17141 LIBS="$cf_add_libs"
17142
17143 fi
17144
17145 fi
17146 fi
17147
17148         ;;
17149 esac
17150
17151 ###     Checks for header files.
17152 echo "$as_me:17152: checking for signed char" >&5
17153 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
17154 if test "${ac_cv_type_signed_char+set}" = set; then
17155   echo $ECHO_N "(cached) $ECHO_C" >&6
17156 else
17157   cat >"conftest.$ac_ext" <<_ACEOF
17158 #line 17158 "configure"
17159 #include "confdefs.h"
17160 $ac_includes_default
17161 int
17162 main (void)
17163 {
17164 if ((signed char *) 0)
17165   return 0;
17166 if (sizeof (signed char))
17167   return 0;
17168   ;
17169   return 0;
17170 }
17171 _ACEOF
17172 rm -f "conftest.$ac_objext"
17173 if { (eval echo "$as_me:17173: \"$ac_compile\"") >&5
17174   (eval $ac_compile) 2>&5
17175   ac_status=$?
17176   echo "$as_me:17176: \$? = $ac_status" >&5
17177   (exit "$ac_status"); } &&
17178          { ac_try='test -s "conftest.$ac_objext"'
17179   { (eval echo "$as_me:17179: \"$ac_try\"") >&5
17180   (eval $ac_try) 2>&5
17181   ac_status=$?
17182   echo "$as_me:17182: \$? = $ac_status" >&5
17183   (exit "$ac_status"); }; }; then
17184   ac_cv_type_signed_char=yes
17185 else
17186   echo "$as_me: failed program was:" >&5
17187 cat "conftest.$ac_ext" >&5
17188 ac_cv_type_signed_char=no
17189 fi
17190 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17191 fi
17192 echo "$as_me:17192: result: $ac_cv_type_signed_char" >&5
17193 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
17194
17195 echo "$as_me:17195: checking size of signed char" >&5
17196 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
17197 if test "${ac_cv_sizeof_signed_char+set}" = set; then
17198   echo $ECHO_N "(cached) $ECHO_C" >&6
17199 else
17200   if test "$ac_cv_type_signed_char" = yes; then
17201   if test "$cross_compiling" = yes; then
17202   # Depending upon the size, compute the lo and hi bounds.
17203 cat >"conftest.$ac_ext" <<_ACEOF
17204 #line 17204 "configure"
17205 #include "confdefs.h"
17206 $ac_includes_default
17207 int
17208 main (void)
17209 {
17210 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
17211   ;
17212   return 0;
17213 }
17214 _ACEOF
17215 rm -f "conftest.$ac_objext"
17216 if { (eval echo "$as_me:17216: \"$ac_compile\"") >&5
17217   (eval $ac_compile) 2>&5
17218   ac_status=$?
17219   echo "$as_me:17219: \$? = $ac_status" >&5
17220   (exit "$ac_status"); } &&
17221          { ac_try='test -s "conftest.$ac_objext"'
17222   { (eval echo "$as_me:17222: \"$ac_try\"") >&5
17223   (eval $ac_try) 2>&5
17224   ac_status=$?
17225   echo "$as_me:17225: \$? = $ac_status" >&5
17226   (exit "$ac_status"); }; }; then
17227   ac_lo=0 ac_mid=0
17228   while :; do
17229     cat >"conftest.$ac_ext" <<_ACEOF
17230 #line 17230 "configure"
17231 #include "confdefs.h"
17232 $ac_includes_default
17233 int
17234 main (void)
17235 {
17236 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
17237   ;
17238   return 0;
17239 }
17240 _ACEOF
17241 rm -f "conftest.$ac_objext"
17242 if { (eval echo "$as_me:17242: \"$ac_compile\"") >&5
17243   (eval $ac_compile) 2>&5
17244   ac_status=$?
17245   echo "$as_me:17245: \$? = $ac_status" >&5
17246   (exit "$ac_status"); } &&
17247          { ac_try='test -s "conftest.$ac_objext"'
17248   { (eval echo "$as_me:17248: \"$ac_try\"") >&5
17249   (eval $ac_try) 2>&5
17250   ac_status=$?
17251   echo "$as_me:17251: \$? = $ac_status" >&5
17252   (exit "$ac_status"); }; }; then
17253   ac_hi=$ac_mid; break
17254 else
17255   echo "$as_me: failed program was:" >&5
17256 cat "conftest.$ac_ext" >&5
17257 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
17258 fi
17259 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17260   done
17261 else
17262   echo "$as_me: failed program was:" >&5
17263 cat "conftest.$ac_ext" >&5
17264 ac_hi=-1 ac_mid=-1
17265   while :; do
17266     cat >"conftest.$ac_ext" <<_ACEOF
17267 #line 17267 "configure"
17268 #include "confdefs.h"
17269 $ac_includes_default
17270 int
17271 main (void)
17272 {
17273 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
17274   ;
17275   return 0;
17276 }
17277 _ACEOF
17278 rm -f "conftest.$ac_objext"
17279 if { (eval echo "$as_me:17279: \"$ac_compile\"") >&5
17280   (eval $ac_compile) 2>&5
17281   ac_status=$?
17282   echo "$as_me:17282: \$? = $ac_status" >&5
17283   (exit "$ac_status"); } &&
17284          { ac_try='test -s "conftest.$ac_objext"'
17285   { (eval echo "$as_me:17285: \"$ac_try\"") >&5
17286   (eval $ac_try) 2>&5
17287   ac_status=$?
17288   echo "$as_me:17288: \$? = $ac_status" >&5
17289   (exit "$ac_status"); }; }; then
17290   ac_lo=$ac_mid; break
17291 else
17292   echo "$as_me: failed program was:" >&5
17293 cat "conftest.$ac_ext" >&5
17294 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
17295 fi
17296 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17297   done
17298 fi
17299 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17300 # Binary search between lo and hi bounds.
17301 while test "x$ac_lo" != "x$ac_hi"; do
17302   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
17303   cat >"conftest.$ac_ext" <<_ACEOF
17304 #line 17304 "configure"
17305 #include "confdefs.h"
17306 $ac_includes_default
17307 int
17308 main (void)
17309 {
17310 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
17311   ;
17312   return 0;
17313 }
17314 _ACEOF
17315 rm -f "conftest.$ac_objext"
17316 if { (eval echo "$as_me:17316: \"$ac_compile\"") >&5
17317   (eval $ac_compile) 2>&5
17318   ac_status=$?
17319   echo "$as_me:17319: \$? = $ac_status" >&5
17320   (exit "$ac_status"); } &&
17321          { ac_try='test -s "conftest.$ac_objext"'
17322   { (eval echo "$as_me:17322: \"$ac_try\"") >&5
17323   (eval $ac_try) 2>&5
17324   ac_status=$?
17325   echo "$as_me:17325: \$? = $ac_status" >&5
17326   (exit "$ac_status"); }; }; then
17327   ac_hi=$ac_mid
17328 else
17329   echo "$as_me: failed program was:" >&5
17330 cat "conftest.$ac_ext" >&5
17331 ac_lo=`expr "$ac_mid" + 1`
17332 fi
17333 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17334 done
17335 ac_cv_sizeof_signed_char=$ac_lo
17336 else
17337   if test "$cross_compiling" = yes; then
17338   { { echo "$as_me:17338: error: cannot run test program while cross compiling" >&5
17339 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
17340    { (exit 1); exit 1; }; }
17341 else
17342   cat >"conftest.$ac_ext" <<_ACEOF
17343 #line 17343 "configure"
17344 #include "confdefs.h"
17345 $ac_includes_default
17346 int
17347 main (void)
17348 {
17349 FILE *f = fopen ("conftest.val", "w");
17350 if (!f)
17351   $ac_main_return (1);
17352 fprintf (f, "%ld", (long)(sizeof (signed char)));
17353 fclose (f);
17354   ;
17355   return 0;
17356 }
17357 _ACEOF
17358 rm -f "conftest$ac_exeext"
17359 if { (eval echo "$as_me:17359: \"$ac_link\"") >&5
17360   (eval $ac_link) 2>&5
17361   ac_status=$?
17362   echo "$as_me:17362: \$? = $ac_status" >&5
17363   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17364   { (eval echo "$as_me:17364: \"$ac_try\"") >&5
17365   (eval $ac_try) 2>&5
17366   ac_status=$?
17367   echo "$as_me:17367: \$? = $ac_status" >&5
17368   (exit "$ac_status"); }; }; then
17369   ac_cv_sizeof_signed_char=`cat conftest.val`
17370 else
17371   echo "$as_me: program exited with status $ac_status" >&5
17372 echo "$as_me: failed program was:" >&5
17373 cat "conftest.$ac_ext" >&5
17374 fi
17375 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17376 fi
17377 fi
17378 rm -f conftest.val
17379 else
17380   ac_cv_sizeof_signed_char=0
17381 fi
17382 fi
17383 echo "$as_me:17383: result: $ac_cv_sizeof_signed_char" >&5
17384 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
17385 cat >>confdefs.h <<EOF
17386 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
17387 EOF
17388
17389 ac_header_dirent=no
17390 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
17391   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
17392 echo "$as_me:17392: checking for $ac_hdr that defines DIR" >&5
17393 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
17394 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17395   echo $ECHO_N "(cached) $ECHO_C" >&6
17396 else
17397   cat >"conftest.$ac_ext" <<_ACEOF
17398 #line 17398 "configure"
17399 #include "confdefs.h"
17400 #include <sys/types.h>
17401 #include <$ac_hdr>
17402
17403 int
17404 main (void)
17405 {
17406 if ((DIR *) 0)
17407 return 0;
17408   ;
17409   return 0;
17410 }
17411 _ACEOF
17412 rm -f "conftest.$ac_objext"
17413 if { (eval echo "$as_me:17413: \"$ac_compile\"") >&5
17414   (eval $ac_compile) 2>&5
17415   ac_status=$?
17416   echo "$as_me:17416: \$? = $ac_status" >&5
17417   (exit "$ac_status"); } &&
17418          { ac_try='test -s "conftest.$ac_objext"'
17419   { (eval echo "$as_me:17419: \"$ac_try\"") >&5
17420   (eval $ac_try) 2>&5
17421   ac_status=$?
17422   echo "$as_me:17422: \$? = $ac_status" >&5
17423   (exit "$ac_status"); }; }; then
17424   eval "$as_ac_Header=yes"
17425 else
17426   echo "$as_me: failed program was:" >&5
17427 cat "conftest.$ac_ext" >&5
17428 eval "$as_ac_Header=no"
17429 fi
17430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17431 fi
17432 echo "$as_me:17432: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17433 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17434 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17435   cat >>confdefs.h <<EOF
17436 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
17437 EOF
17438
17439 ac_header_dirent=$ac_hdr; break
17440 fi
17441
17442 done
17443 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
17444 if test $ac_header_dirent = dirent.h; then
17445   echo "$as_me:17445: checking for opendir in -ldir" >&5
17446 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
17447 if test "${ac_cv_lib_dir_opendir+set}" = set; then
17448   echo $ECHO_N "(cached) $ECHO_C" >&6
17449 else
17450   ac_check_lib_save_LIBS=$LIBS
17451 LIBS="-ldir  $LIBS"
17452 cat >"conftest.$ac_ext" <<_ACEOF
17453 #line 17453 "configure"
17454 #include "confdefs.h"
17455
17456 /* Override any gcc2 internal prototype to avoid an error.  */
17457 #ifdef __cplusplus
17458 extern "C"
17459 #endif
17460 /* We use char because int might match the return type of a gcc2
17461    builtin and then its argument prototype would still apply.  */
17462 char opendir (void);
17463 int
17464 main (void)
17465 {
17466 opendir ();
17467   ;
17468   return 0;
17469 }
17470 _ACEOF
17471 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17472 if { (eval echo "$as_me:17472: \"$ac_link\"") >&5
17473   (eval $ac_link) 2>&5
17474   ac_status=$?
17475   echo "$as_me:17475: \$? = $ac_status" >&5
17476   (exit "$ac_status"); } &&
17477          { ac_try='test -s "conftest$ac_exeext"'
17478   { (eval echo "$as_me:17478: \"$ac_try\"") >&5
17479   (eval $ac_try) 2>&5
17480   ac_status=$?
17481   echo "$as_me:17481: \$? = $ac_status" >&5
17482   (exit "$ac_status"); }; }; then
17483   ac_cv_lib_dir_opendir=yes
17484 else
17485   echo "$as_me: failed program was:" >&5
17486 cat "conftest.$ac_ext" >&5
17487 ac_cv_lib_dir_opendir=no
17488 fi
17489 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17490 LIBS=$ac_check_lib_save_LIBS
17491 fi
17492 echo "$as_me:17492: result: $ac_cv_lib_dir_opendir" >&5
17493 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
17494 if test "$ac_cv_lib_dir_opendir" = yes; then
17495   LIBS="$LIBS -ldir"
17496 fi
17497
17498 else
17499   echo "$as_me:17499: checking for opendir in -lx" >&5
17500 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
17501 if test "${ac_cv_lib_x_opendir+set}" = set; then
17502   echo $ECHO_N "(cached) $ECHO_C" >&6
17503 else
17504   ac_check_lib_save_LIBS=$LIBS
17505 LIBS="-lx  $LIBS"
17506 cat >"conftest.$ac_ext" <<_ACEOF
17507 #line 17507 "configure"
17508 #include "confdefs.h"
17509
17510 /* Override any gcc2 internal prototype to avoid an error.  */
17511 #ifdef __cplusplus
17512 extern "C"
17513 #endif
17514 /* We use char because int might match the return type of a gcc2
17515    builtin and then its argument prototype would still apply.  */
17516 char opendir (void);
17517 int
17518 main (void)
17519 {
17520 opendir ();
17521   ;
17522   return 0;
17523 }
17524 _ACEOF
17525 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17526 if { (eval echo "$as_me:17526: \"$ac_link\"") >&5
17527   (eval $ac_link) 2>&5
17528   ac_status=$?
17529   echo "$as_me:17529: \$? = $ac_status" >&5
17530   (exit "$ac_status"); } &&
17531          { ac_try='test -s "conftest$ac_exeext"'
17532   { (eval echo "$as_me:17532: \"$ac_try\"") >&5
17533   (eval $ac_try) 2>&5
17534   ac_status=$?
17535   echo "$as_me:17535: \$? = $ac_status" >&5
17536   (exit "$ac_status"); }; }; then
17537   ac_cv_lib_x_opendir=yes
17538 else
17539   echo "$as_me: failed program was:" >&5
17540 cat "conftest.$ac_ext" >&5
17541 ac_cv_lib_x_opendir=no
17542 fi
17543 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17544 LIBS=$ac_check_lib_save_LIBS
17545 fi
17546 echo "$as_me:17546: result: $ac_cv_lib_x_opendir" >&5
17547 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
17548 if test "$ac_cv_lib_x_opendir" = yes; then
17549   LIBS="$LIBS -lx"
17550 fi
17551
17552 fi
17553
17554 echo "$as_me:17554: checking whether time.h and sys/time.h may both be included" >&5
17555 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17556 if test "${ac_cv_header_time+set}" = set; then
17557   echo $ECHO_N "(cached) $ECHO_C" >&6
17558 else
17559   cat >"conftest.$ac_ext" <<_ACEOF
17560 #line 17560 "configure"
17561 #include "confdefs.h"
17562 #include <sys/types.h>
17563 #include <sys/time.h>
17564 #include <time.h>
17565
17566 int
17567 main (void)
17568 {
17569 if ((struct tm *) 0)
17570 return 0;
17571   ;
17572   return 0;
17573 }
17574 _ACEOF
17575 rm -f "conftest.$ac_objext"
17576 if { (eval echo "$as_me:17576: \"$ac_compile\"") >&5
17577   (eval $ac_compile) 2>&5
17578   ac_status=$?
17579   echo "$as_me:17579: \$? = $ac_status" >&5
17580   (exit "$ac_status"); } &&
17581          { ac_try='test -s "conftest.$ac_objext"'
17582   { (eval echo "$as_me:17582: \"$ac_try\"") >&5
17583   (eval $ac_try) 2>&5
17584   ac_status=$?
17585   echo "$as_me:17585: \$? = $ac_status" >&5
17586   (exit "$ac_status"); }; }; then
17587   ac_cv_header_time=yes
17588 else
17589   echo "$as_me: failed program was:" >&5
17590 cat "conftest.$ac_ext" >&5
17591 ac_cv_header_time=no
17592 fi
17593 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17594 fi
17595 echo "$as_me:17595: result: $ac_cv_header_time" >&5
17596 echo "${ECHO_T}$ac_cv_header_time" >&6
17597 if test $ac_cv_header_time = yes; then
17598
17599 cat >>confdefs.h <<\EOF
17600 #define TIME_WITH_SYS_TIME 1
17601 EOF
17602
17603 fi
17604
17605 ###     checks for compiler characteristics
17606 ac_ext=c
17607 ac_cpp='$CPP $CPPFLAGS'
17608 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
17609 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
17610 ac_compiler_gnu=$ac_cv_c_compiler_gnu
17611 ac_main_return="return"
17612
17613 echo "$as_me:17613: checking for an ANSI C-conforming const" >&5
17614 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
17615 if test "${ac_cv_c_const+set}" = set; then
17616   echo $ECHO_N "(cached) $ECHO_C" >&6
17617 else
17618   cat >"conftest.$ac_ext" <<_ACEOF
17619 #line 17619 "configure"
17620 #include "confdefs.h"
17621
17622 int
17623 main (void)
17624 {
17625 /* FIXME: Include the comments suggested by Paul. */
17626 #ifndef __cplusplus
17627   /* Ultrix mips cc rejects this.  */
17628   typedef int charset[2];
17629   const charset x; (void)x;
17630   /* SunOS 4.1.1 cc rejects this.  */
17631   char const *const *ccp;
17632   char **p;
17633   /* NEC SVR4.0.2 mips cc rejects this.  */
17634   struct point {int x, y;};
17635   static struct point const zero = {0,0}; (void)zero;
17636   /* AIX XL C 1.02.0.0 rejects this.
17637      It does not let you subtract one const X* pointer from another in
17638      an arm of an if-expression whose if-part is not a constant
17639      expression */
17640   const char *g = "string";
17641   ccp = &g + (g ? g-g : 0);
17642   /* HPUX 7.0 cc rejects these. */
17643   ++ccp;
17644   p = (char**) ccp;
17645   ccp = (char const *const *) p;
17646   { /* SCO 3.2v4 cc rejects this.  */
17647     char *t;
17648     char const *s = 0 ? (char *) 0 : (char const *) 0;
17649
17650     *t++ = 0;
17651         (void)s;
17652   }
17653   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
17654     int x[] = {25, 17};
17655     const int *foo = &x[0];
17656     ++foo;
17657         (void)foo;
17658   }
17659   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17660     typedef const int *iptr;
17661     iptr p = 0;
17662     ++p;
17663         (void)p;
17664   }
17665   { /* AIX XL C 1.02.0.0 rejects this saying
17666        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17667     struct s { int j; const int *ap[3]; };
17668     struct s *b; b->j = 5;
17669   }
17670   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17671     const int foo = 10;
17672         (void)foo;
17673   }
17674 #endif
17675
17676   ;
17677   return 0;
17678 }
17679 _ACEOF
17680 rm -f "conftest.$ac_objext"
17681 if { (eval echo "$as_me:17681: \"$ac_compile\"") >&5
17682   (eval $ac_compile) 2>&5
17683   ac_status=$?
17684   echo "$as_me:17684: \$? = $ac_status" >&5
17685   (exit "$ac_status"); } &&
17686          { ac_try='test -s "conftest.$ac_objext"'
17687   { (eval echo "$as_me:17687: \"$ac_try\"") >&5
17688   (eval $ac_try) 2>&5
17689   ac_status=$?
17690   echo "$as_me:17690: \$? = $ac_status" >&5
17691   (exit "$ac_status"); }; }; then
17692   ac_cv_c_const=yes
17693 else
17694   echo "$as_me: failed program was:" >&5
17695 cat "conftest.$ac_ext" >&5
17696 ac_cv_c_const=no
17697 fi
17698 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
17699 fi
17700 echo "$as_me:17700: result: $ac_cv_c_const" >&5
17701 echo "${ECHO_T}$ac_cv_c_const" >&6
17702 if test $ac_cv_c_const = no; then
17703
17704 cat >>confdefs.h <<\EOF
17705 #define const
17706 EOF
17707
17708 fi
17709
17710 ###     Checks for external-data
17711
17712 echo "$as_me:17712: checking if data-only library module links" >&5
17713 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
17714 if test "${cf_cv_link_dataonly+set}" = set; then
17715   echo $ECHO_N "(cached) $ECHO_C" >&6
17716 else
17717
17718         rm -f conftest.a
17719         cat >conftest.$ac_ext <<EOF
17720 #line 17720 "configure"
17721 int     testdata[3] = { 123, 456, 789 };
17722 EOF
17723         if { (eval echo "$as_me:17723: \"$ac_compile\"") >&5
17724   (eval $ac_compile) 2>&5
17725   ac_status=$?
17726   echo "$as_me:17726: \$? = $ac_status" >&5
17727   (exit "$ac_status"); } ; then
17728                 mv conftest.o data.o && \
17729                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
17730         fi
17731         rm -f conftest.$ac_ext data.o
17732         cat >conftest.$ac_ext <<EOF
17733 #line 17733 "configure"
17734 extern int testfunc(void);
17735 #if defined(NeXT)
17736 int     testfunc(void)
17737 {
17738         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
17739 }
17740 #else
17741 extern int testdata[3];
17742 int     testfunc(void)
17743 {
17744         return testdata[0] == 123
17745            &&  testdata[1] == 456
17746            &&  testdata[2] == 789;
17747 }
17748 #endif
17749 EOF
17750         if { (eval echo "$as_me:17750: \"$ac_compile\"") >&5
17751   (eval $ac_compile) 2>&5
17752   ac_status=$?
17753   echo "$as_me:17753: \$? = $ac_status" >&5
17754   (exit "$ac_status"); }; then
17755                 mv conftest.o func.o && \
17756                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17757         fi
17758         rm -f conftest.$ac_ext func.o
17759         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17760         cf_saveLIBS="$LIBS"
17761         LIBS="conftest.a $LIBS"
17762         if test "$cross_compiling" = yes; then
17763   cf_cv_link_dataonly=unknown
17764 else
17765   cat >"conftest.$ac_ext" <<_ACEOF
17766 #line 17766 "configure"
17767 #include "confdefs.h"
17768
17769         extern int testfunc(void);
17770         int main(void)
17771         {
17772                 ${cf_cv_main_return:-return} (!testfunc());
17773         }
17774
17775 _ACEOF
17776 rm -f "conftest$ac_exeext"
17777 if { (eval echo "$as_me:17777: \"$ac_link\"") >&5
17778   (eval $ac_link) 2>&5
17779   ac_status=$?
17780   echo "$as_me:17780: \$? = $ac_status" >&5
17781   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17782   { (eval echo "$as_me:17782: \"$ac_try\"") >&5
17783   (eval $ac_try) 2>&5
17784   ac_status=$?
17785   echo "$as_me:17785: \$? = $ac_status" >&5
17786   (exit "$ac_status"); }; }; then
17787   cf_cv_link_dataonly=yes
17788 else
17789   echo "$as_me: program exited with status $ac_status" >&5
17790 echo "$as_me: failed program was:" >&5
17791 cat "conftest.$ac_ext" >&5
17792 cf_cv_link_dataonly=no
17793 fi
17794 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17795 fi
17796         LIBS="$cf_saveLIBS"
17797
17798 fi
17799
17800 echo "$as_me:17800: result: $cf_cv_link_dataonly" >&5
17801 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17802
17803 if test "$cf_cv_link_dataonly" = no ; then
17804
17805 cat >>confdefs.h <<\EOF
17806 #define BROKEN_LINKER 1
17807 EOF
17808
17809         BROKEN_LINKER=1
17810 fi
17811
17812 ###     Checks for library functions.
17813
17814 for ac_header in \
17815 unistd.h \
17816
17817 do
17818 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17819 echo "$as_me:17819: checking for $ac_header" >&5
17820 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17821 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17822   echo $ECHO_N "(cached) $ECHO_C" >&6
17823 else
17824   cat >"conftest.$ac_ext" <<_ACEOF
17825 #line 17825 "configure"
17826 #include "confdefs.h"
17827 #include <$ac_header>
17828 _ACEOF
17829 if { (eval echo "$as_me:17829: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17830   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17831   ac_status=$?
17832   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17833   rm -f conftest.er1
17834   cat conftest.err >&5
17835   echo "$as_me:17835: \$? = $ac_status" >&5
17836   (exit "$ac_status"); } >/dev/null; then
17837   if test -s conftest.err; then
17838     ac_cpp_err=$ac_c_preproc_warn_flag
17839   else
17840     ac_cpp_err=
17841   fi
17842 else
17843   ac_cpp_err=yes
17844 fi
17845 if test -z "$ac_cpp_err"; then
17846   eval "$as_ac_Header=yes"
17847 else
17848   echo "$as_me: failed program was:" >&5
17849   cat "conftest.$ac_ext" >&5
17850   eval "$as_ac_Header=no"
17851 fi
17852 rm -f conftest.err "conftest.$ac_ext"
17853 fi
17854 echo "$as_me:17854: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17855 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17856 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17857   cat >>confdefs.h <<EOF
17858 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17859 EOF
17860
17861 fi
17862 done
17863
17864 echo "$as_me:17864: checking for working mkstemp" >&5
17865 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17866 if test "${cf_cv_func_mkstemp+set}" = set; then
17867   echo $ECHO_N "(cached) $ECHO_C" >&6
17868 else
17869
17870 rm -rf ./conftest*
17871 if test "$cross_compiling" = yes; then
17872   cf_cv_func_mkstemp=maybe
17873 else
17874   cat >"conftest.$ac_ext" <<_ACEOF
17875 #line 17875 "configure"
17876 #include "confdefs.h"
17877
17878 $ac_includes_default
17879
17880 int main(void)
17881 {
17882         static char tmpl[] = "conftestXXXXXX";
17883         char name[2][80];
17884         int n;
17885         int result = 0;
17886         int fd;
17887         struct stat sb;
17888
17889         umask(077);
17890         for (n = 0; n < 2; ++n) {
17891                 strcpy(name[n], tmpl);
17892                 if ((fd = mkstemp(name[n])) >= 0) {
17893                         if (!strcmp(name[n], tmpl)
17894                          || stat(name[n], &sb) != 0
17895                          || (sb.st_mode & S_IFMT) != S_IFREG
17896                          || (sb.st_mode & 077) != 0) {
17897                                 result = 1;
17898                         }
17899                         close(fd);
17900                 }
17901         }
17902         if (result == 0
17903          && !strcmp(name[0], name[1]))
17904                 result = 1;
17905         ${cf_cv_main_return:-return}(result);
17906 }
17907
17908 _ACEOF
17909 rm -f "conftest$ac_exeext"
17910 if { (eval echo "$as_me:17910: \"$ac_link\"") >&5
17911   (eval $ac_link) 2>&5
17912   ac_status=$?
17913   echo "$as_me:17913: \$? = $ac_status" >&5
17914   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17915   { (eval echo "$as_me:17915: \"$ac_try\"") >&5
17916   (eval $ac_try) 2>&5
17917   ac_status=$?
17918   echo "$as_me:17918: \$? = $ac_status" >&5
17919   (exit "$ac_status"); }; }; then
17920   cf_cv_func_mkstemp=yes
17921
17922 else
17923   echo "$as_me: program exited with status $ac_status" >&5
17924 echo "$as_me: failed program was:" >&5
17925 cat "conftest.$ac_ext" >&5
17926 cf_cv_func_mkstemp=no
17927
17928 fi
17929 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17930 fi
17931
17932 fi
17933 echo "$as_me:17933: result: $cf_cv_func_mkstemp" >&5
17934 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17935 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17936         echo "$as_me:17936: checking for mkstemp" >&5
17937 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17938 if test "${ac_cv_func_mkstemp+set}" = set; then
17939   echo $ECHO_N "(cached) $ECHO_C" >&6
17940 else
17941   cat >"conftest.$ac_ext" <<_ACEOF
17942 #line 17942 "configure"
17943 #include "confdefs.h"
17944 #define mkstemp autoconf_temporary
17945 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17946 #undef mkstemp
17947
17948 #ifdef __cplusplus
17949 extern "C"
17950 #endif
17951
17952 /* We use char because int might match the return type of a gcc2
17953    builtin and then its argument prototype would still apply.  */
17954 char mkstemp (void);
17955
17956 int
17957 main (void)
17958 {
17959
17960 /* The GNU C library defines stubs for functions which it implements
17961     to always fail with ENOSYS.  Some functions are actually named
17962     something starting with __ and the normal name is an alias.  */
17963 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17964 #error found stub for mkstemp
17965 #endif
17966
17967         return mkstemp ();
17968   ;
17969   return 0;
17970 }
17971 _ACEOF
17972 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17973 if { (eval echo "$as_me:17973: \"$ac_link\"") >&5
17974   (eval $ac_link) 2>&5
17975   ac_status=$?
17976   echo "$as_me:17976: \$? = $ac_status" >&5
17977   (exit "$ac_status"); } &&
17978          { ac_try='test -s "conftest$ac_exeext"'
17979   { (eval echo "$as_me:17979: \"$ac_try\"") >&5
17980   (eval $ac_try) 2>&5
17981   ac_status=$?
17982   echo "$as_me:17982: \$? = $ac_status" >&5
17983   (exit "$ac_status"); }; }; then
17984   ac_cv_func_mkstemp=yes
17985 else
17986   echo "$as_me: failed program was:" >&5
17987 cat "conftest.$ac_ext" >&5
17988 ac_cv_func_mkstemp=no
17989 fi
17990 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17991 fi
17992 echo "$as_me:17992: result: $ac_cv_func_mkstemp" >&5
17993 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17994
17995 fi
17996 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17997
17998 cat >>confdefs.h <<\EOF
17999 #define HAVE_MKSTEMP 1
18000 EOF
18001
18002 fi
18003
18004 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
18005         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
18006         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
18007 fi
18008
18009 cf_with_ada=yes
18010 if test "$cf_with_ada" != "no" ; then
18011         if test "$cf_cv_prog_gnat_correct" = yes; then
18012
18013         echo "$as_me:18013: checking optimization options for ADAFLAGS" >&5
18014 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
18015         case "$CFLAGS" in
18016         (*-g*)
18017
18018         ADAFLAGS="$ADAFLAGS -g"
18019
18020                 ;;
18021         esac
18022         case "$CFLAGS" in
18023         (*-O*)
18024                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
18025
18026         ADAFLAGS="$ADAFLAGS $cf_O_flag"
18027
18028                 ;;
18029         esac
18030         echo "$as_me:18030: result: $ADAFLAGS" >&5
18031 echo "${ECHO_T}$ADAFLAGS" >&6
18032
18033 echo "$as_me:18033: checking if GNATPREP supports -T option" >&5
18034 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
18035 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
18036   echo $ECHO_N "(cached) $ECHO_C" >&6
18037 else
18038
18039 cf_cv_gnatprep_opt_t=no
18040 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
18041
18042 fi
18043 echo "$as_me:18043: result: $cf_cv_gnatprep_opt_t" >&5
18044 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
18045 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
18046
18047 echo "$as_me:18047: checking if GNAT supports generics" >&5
18048 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
18049 case "$cf_cv_gnat_version" in
18050 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
18051         cf_gnat_generics=yes
18052         ;;
18053 (*)
18054         cf_gnat_generics=no
18055         ;;
18056 esac
18057 echo "$as_me:18057: result: $cf_gnat_generics" >&5
18058 echo "${ECHO_T}$cf_gnat_generics" >&6
18059
18060 if test "$cf_gnat_generics" = yes
18061 then
18062         cf_compile_generics=generics
18063         cf_generic_objects="\${GENOBJS}"
18064 else
18065         cf_compile_generics=
18066         cf_generic_objects=
18067 fi
18068
18069 echo "$as_me:18069: checking if GNAT supports SIGINT" >&5
18070 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
18071 if test "${cf_cv_gnat_sigint+set}" = set; then
18072   echo $ECHO_N "(cached) $ECHO_C" >&6
18073 else
18074
18075 rm -rf ./conftest* ./*~conftest*
18076 cat >>conftest.ads <<CF_EOF
18077 with Ada.Interrupts.Names;
18078
18079 package ConfTest is
18080
18081    pragma Warnings (Off);  --  the next pragma exists since 3.11p
18082    pragma Unreserve_All_Interrupts;
18083    pragma Warnings (On);
18084
18085    protected Process is
18086       procedure Stop;
18087       function Continue return Boolean;
18088       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
18089    private
18090       Done : Boolean := False;
18091    end Process;
18092
18093 end ConfTest;
18094 CF_EOF
18095 cat >>conftest.adb <<CF_EOF
18096 package body ConfTest is
18097    protected body Process is
18098       procedure Stop is
18099       begin
18100          Done := True;
18101       end Stop;
18102       function Continue return Boolean is
18103       begin
18104          return not Done;
18105       end Continue;
18106    end Process;
18107 end ConfTest;
18108 CF_EOF
18109 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
18110       cf_cv_gnat_sigint=yes
18111 else
18112    cf_cv_gnat_sigint=no
18113 fi
18114 rm -rf ./conftest* ./*~conftest*
18115
18116 fi
18117 echo "$as_me:18117: result: $cf_cv_gnat_sigint" >&5
18118 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
18119
18120 if test "$cf_cv_gnat_sigint" = yes ; then
18121         USE_GNAT_SIGINT=""
18122 else
18123         USE_GNAT_SIGINT="#"
18124 fi
18125
18126 cf_gnat_libraries=no
18127 cf_gnat_projects=no
18128
18129 if test "$enable_gnat_projects" != no ; then
18130 echo "$as_me:18130: checking if GNAT supports project files" >&5
18131 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
18132 case "$cf_cv_gnat_version" in
18133 (3.[0-9]*)
18134         ;;
18135 (*)
18136         case "$cf_cv_system_name" in
18137         (cygwin*|msys*)
18138                 ;;
18139         (*)
18140                 rm -rf ./conftest* ./*~conftest*
18141                 if mkdir conftest.src conftest.bin conftest.lib
18142                 then
18143                         cd conftest.src
18144                         rm -rf ./conftest* ./*~conftest*
18145                         cat >>library.gpr <<CF_EOF
18146 project Library is
18147   Kind := External ("LIB_KIND");
18148   for Library_Name use "ConfTest";
18149   for Object_Dir use ".";
18150   for Library_ALI_Dir use External("LIBRARY_DIR");
18151   for Library_Version use External ("SONAME");
18152   for Library_Kind use Kind;
18153   for Library_Dir use External("BUILD_DIR");
18154   Source_Dir := External ("SOURCE_DIR");
18155   for Source_Dirs use (Source_Dir);
18156 end Library;
18157 CF_EOF
18158                         cat >>confpackage.ads <<CF_EOF
18159 package ConfPackage is
18160    procedure conftest;
18161 end ConfPackage;
18162 CF_EOF
18163                         cat >>confpackage.adb <<CF_EOF
18164 with Text_IO;
18165 package body ConfPackage is
18166    procedure conftest is
18167    begin
18168       Text_IO.Put ("Hello World");
18169       Text_IO.New_Line;
18170    end conftest;
18171 end ConfPackage;
18172 CF_EOF
18173                         if ( "$cf_ada_make" $ADAFLAGS \
18174                                         -Plibrary.gpr \
18175                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
18176                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
18177                                         -XSOURCE_DIR="`pwd`" \
18178                                         -XSONAME=libConfTest.so.1 \
18179                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
18180                                 cf_gnat_projects=yes
18181                         fi
18182                         cd ..
18183                 fi
18184                 if test -f conftest.lib/confpackage.ali
18185                 then
18186                         cf_gnat_libraries=yes
18187                 fi
18188                 rm -rf ./conftest* ./*~conftest*
18189                 ;;
18190         esac
18191         ;;
18192 esac
18193 echo "$as_me:18193: result: $cf_gnat_projects" >&5
18194 echo "${ECHO_T}$cf_gnat_projects" >&6
18195 fi # enable_gnat_projects
18196
18197 if test "$cf_gnat_projects" = yes
18198 then
18199         echo "$as_me:18199: checking if GNAT supports libraries" >&5
18200 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
18201         echo "$as_me:18201: result: $cf_gnat_libraries" >&5
18202 echo "${ECHO_T}$cf_gnat_libraries" >&6
18203 fi
18204
18205 USE_OLD_MAKERULES=""
18206 USE_GNAT_PROJECTS="#"
18207 USE_GNAT_MAKE_GPR="#"
18208 USE_GNAT_GPRBUILD="#"
18209
18210 if test "$cf_gnat_projects" = yes
18211 then
18212         USE_OLD_MAKERULES="#"
18213         USE_GNAT_PROJECTS=""
18214         if test "$cf_cv_VERSION_GPRBUILD" != no
18215         then
18216                 USE_GNAT_GPRBUILD=""
18217         elif test "$cf_cv_VERSION_GNATMAKE" != no
18218         then
18219                 USE_GNAT_MAKE_GPR=""
18220         else
18221                 { echo "$as_me:18221: WARNING: use old makefile rules since tools are missing" >&5
18222 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
18223         fi
18224 fi
18225
18226 if test "$cf_gnat_libraries" = yes
18227 then
18228         USE_GNAT_LIBRARIES=""
18229 else
18230         USE_GNAT_LIBRARIES="#"
18231 fi
18232
18233 echo "$as_me:18233: checking for Ada95 compiler" >&5
18234 echo $ECHO_N "checking for Ada95 compiler... $ECHO_C" >&6
18235
18236 # Check whether --with-ada-compiler or --without-ada-compiler was given.
18237 if test "${with_ada_compiler+set}" = set; then
18238   withval="$with_ada_compiler"
18239   cf_ada_compiler=$withval
18240 else
18241   cf_ada_compiler=gnatmake
18242 fi;
18243
18244 echo "$as_me:18244: result: $cf_ada_compiler" >&5
18245 echo "${ECHO_T}$cf_ada_compiler" >&6
18246
18247                 cf_ada_package=terminal_interface
18248
18249 echo "$as_me:18249: checking for Ada95 include directory" >&5
18250 echo $ECHO_N "checking for Ada95 include directory... $ECHO_C" >&6
18251
18252 # Check whether --with-ada-include or --without-ada-include was given.
18253 if test "${with_ada_include+set}" = set; then
18254   withval="$with_ada_include"
18255
18256 else
18257   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
18258 fi; if test -n "$prefix/share/ada/adainclude" ; then
18259
18260 if test "x$prefix" != xNONE; then
18261         cf_path_syntax="$prefix"
18262 else
18263         cf_path_syntax="$ac_default_prefix"
18264 fi
18265
18266 case ".$withval" in
18267 (.\$\(*\)*|.\'*\'*)
18268         ;;
18269 (..|./*|.\\*)
18270         ;;
18271 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18272         ;;
18273 (.\$\{*prefix\}*|.\$\{*dir\}*)
18274         eval withval="$withval"
18275         case ".$withval" in
18276         (.NONE/*)
18277                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18278                 ;;
18279         esac
18280         ;;
18281 (.no|.NONE/*)
18282         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18283         ;;
18284 (*)
18285         { { echo "$as_me:18285: error: expected a pathname, not \"$withval\"" >&5
18286 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18287    { (exit 1); exit 1; }; }
18288         ;;
18289 esac
18290
18291 fi
18292 eval ADA_INCLUDE="$withval"
18293
18294 echo "$as_me:18294: result: $ADA_INCLUDE" >&5
18295 echo "${ECHO_T}$ADA_INCLUDE" >&6
18296
18297 echo "$as_me:18297: checking for Ada95 object directory" >&5
18298 echo $ECHO_N "checking for Ada95 object directory... $ECHO_C" >&6
18299
18300 # Check whether --with-ada-objects or --without-ada-objects was given.
18301 if test "${with_ada_objects+set}" = set; then
18302   withval="$with_ada_objects"
18303
18304 else
18305   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
18306 fi; if test -n "$prefix/lib/ada/adalib" ; then
18307
18308 if test "x$prefix" != xNONE; then
18309         cf_path_syntax="$prefix"
18310 else
18311         cf_path_syntax="$ac_default_prefix"
18312 fi
18313
18314 case ".$withval" in
18315 (.\$\(*\)*|.\'*\'*)
18316         ;;
18317 (..|./*|.\\*)
18318         ;;
18319 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
18320         ;;
18321 (.\$\{*prefix\}*|.\$\{*dir\}*)
18322         eval withval="$withval"
18323         case ".$withval" in
18324         (.NONE/*)
18325                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18326                 ;;
18327         esac
18328         ;;
18329 (.no|.NONE/*)
18330         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
18331         ;;
18332 (*)
18333         { { echo "$as_me:18333: error: expected a pathname, not \"$withval\"" >&5
18334 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
18335    { (exit 1); exit 1; }; }
18336         ;;
18337 esac
18338
18339 fi
18340 eval ADA_OBJECTS="$withval"
18341
18342 echo "$as_me:18342: result: $ADA_OBJECTS" >&5
18343 echo "${ECHO_T}$ADA_OBJECTS" >&6
18344
18345 echo "$as_me:18345: checking whether to build an Ada95 shared library" >&5
18346 echo $ECHO_N "checking whether to build an Ada95 shared library... $ECHO_C" >&6
18347
18348 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
18349 if test "${with_ada_sharedlib+set}" = set; then
18350   withval="$with_ada_sharedlib"
18351   with_ada_sharedlib=$withval
18352 else
18353   with_ada_sharedlib=no
18354 fi;
18355 cf_ada_sharedlib_warn=no
18356
18357 if test "x$with_ada_sharedlib" != xno
18358 then
18359         if test "x$cf_gnat_projects" != xyes
18360         then
18361                 with_ada_sharedlib=no
18362                 cf_ada_sharedlib_warn=yes
18363         fi
18364 fi
18365
18366 echo "$as_me:18366: result: $with_ada_sharedlib" >&5
18367 echo "${ECHO_T}$with_ada_sharedlib" >&6
18368 if test "x$cf_ada_sharedlib_warn" != xno
18369 then
18370         { echo "$as_me:18370: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&5
18371 echo "$as_me: WARNING: disabling Ada95 shared library since GNAT projects are not supported" >&2;}
18372 fi
18373
18374 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
18375 MAKE_ADA_SHAREDLIB="#"
18376
18377 if test "x$with_ada_sharedlib" != xno
18378 then
18379         MAKE_ADA_SHAREDLIB=
18380         if test "x$with_ada_sharedlib" != xyes
18381         then
18382                 ADA_SHAREDLIB="$with_ada_sharedlib"
18383         fi
18384 fi
18385
18386                 # allow the Ada binding to be renamed
18387
18388 echo "$as_me:18388: checking for Ada95 curses library name" >&5
18389 echo $ECHO_N "checking for Ada95 curses library name... $ECHO_C" >&6
18390
18391 # Check whether --with-ada-libname or --without-ada-libname was given.
18392 if test "${with_ada_libname+set}" = set; then
18393   withval="$with_ada_libname"
18394   ADA_LIBNAME=$withval
18395 else
18396   ADA_LIBNAME=AdaCurses
18397 fi;
18398 case "x$ADA_LIBNAME" in
18399 (x|xyes|xno)
18400         ADA_LIBNAME=AdaCurses
18401         ;;
18402 esac
18403
18404 echo "$as_me:18404: result: $ADA_LIBNAME" >&5
18405 echo "${ECHO_T}$ADA_LIBNAME" >&6
18406
18407         else
18408                 { { echo "$as_me:18408: error: No usable Ada compiler found" >&5
18409 echo "$as_me: error: No usable Ada compiler found" >&2;}
18410    { (exit 1); exit 1; }; }
18411         fi
18412 else
18413         { { echo "$as_me:18413: error: The Ada compiler is needed for this package" >&5
18414 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
18415    { (exit 1); exit 1; }; }
18416 fi
18417
18418 ################################################################################
18419
18420 # not needed
18421 TINFO_LDFLAGS2=
18422
18423 TINFO_LIBS=
18424
18425 ### Construct the list of include-directories to be generated
18426
18427 if test "$srcdir" != "."; then
18428         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
18429 fi
18430 CPPFLAGS="-I../include $CPPFLAGS"
18431 if test "$srcdir" != "."; then
18432         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
18433 fi
18434 CPPFLAGS="-I. $CPPFLAGS"
18435
18436 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
18437 if test "$srcdir" != "."; then
18438         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
18439 fi
18440 if test "$GCC" != yes; then
18441         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18442 elif test "$includedir" != "/usr/include"; then
18443         if test "$includedir" = '${prefix}/include' ; then
18444                 if test x$prefix != x/usr ; then
18445                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18446                 fi
18447         else
18448                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
18449         fi
18450 fi
18451
18452 ### Build up pieces for makefile rules
18453 echo "$as_me:18453: checking default library suffix" >&5
18454 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
18455
18456         case $DFT_LWR_MODEL in
18457         (libtool) DFT_ARG_SUFFIX=''   ;;
18458         (normal)  DFT_ARG_SUFFIX=''   ;;
18459         (debug)   DFT_ARG_SUFFIX='_g' ;;
18460         (profile) DFT_ARG_SUFFIX='_p' ;;
18461         (shared)  DFT_ARG_SUFFIX=''   ;;
18462         esac
18463         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
18464 echo "$as_me:18464: result: $DFT_ARG_SUFFIX" >&5
18465 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
18466
18467 echo "$as_me:18467: checking default library-dependency suffix" >&5
18468 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
18469
18470         case X$DFT_LWR_MODEL in
18471         (Xlibtool)
18472                 DFT_LIB_SUFFIX='.la'
18473                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18474                 ;;
18475         (Xdebug)
18476                 case "$cf_cv_system_name" in
18477                 (*-msvc*)
18478                         DFT_LIB_SUFFIX='_g.lib'
18479                         ;;
18480                 (*)
18481                         DFT_LIB_SUFFIX='_g.a'
18482                         ;;
18483                 esac
18484                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18485                 ;;
18486         (Xprofile)
18487                 case "$cf_cv_system_name" in
18488                 (*-msvc*)
18489                         DFT_LIB_SUFFIX='_p.lib'
18490                         ;;
18491                 (*)
18492                         DFT_LIB_SUFFIX='_p.a'
18493                         ;;
18494                 esac
18495                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18496                 ;;
18497         (Xshared)
18498                 case "$cf_cv_system_name" in
18499                 (aix[5-7]*)
18500                         DFT_LIB_SUFFIX='.so'
18501                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18502                         ;;
18503                 (*-msvc*)
18504                         DFT_LIB_SUFFIX='.dll'
18505                         DFT_DEP_SUFFIX='.dll.lib'
18506                         ;;
18507                 (cygwin*|msys*|mingw*)
18508                         DFT_LIB_SUFFIX='.dll'
18509                         DFT_DEP_SUFFIX='.dll.a'
18510                         ;;
18511                 (darwin*)
18512                         DFT_LIB_SUFFIX='.dylib'
18513                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18514                         ;;
18515                 (hpux*)
18516                         case "$target" in
18517                         (ia64*)
18518                                 DFT_LIB_SUFFIX='.so'
18519                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18520                                 ;;
18521                         (*)
18522                                 DFT_LIB_SUFFIX='.sl'
18523                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18524                                 ;;
18525                         esac
18526                         ;;
18527                 (*)
18528                         DFT_LIB_SUFFIX='.so'
18529                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18530                         ;;
18531                 esac
18532                 ;;
18533         (*)
18534                 case "$target" in
18535                 (*-msvc*)
18536                         DFT_LIB_SUFFIX='.lib'
18537                         ;;
18538                 (*)
18539                         DFT_LIB_SUFFIX='.a'
18540                         ;;
18541                 esac
18542                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18543                 ;;
18544         esac
18545         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18546         then
18547                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18548                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18549         fi
18550 echo "$as_me:18550: result: $DFT_DEP_SUFFIX" >&5
18551 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18552
18553 echo "$as_me:18553: checking default object directory" >&5
18554 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18555
18556         case $DFT_LWR_MODEL in
18557         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18558         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18559         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18560         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18561         (shared)
18562                 case "$cf_cv_system_name" in
18563                 (cygwin|msys)
18564                         DFT_OBJ_SUBDIR='objects' ;;
18565                 (*)
18566                         DFT_OBJ_SUBDIR='obj_s' ;;
18567                 esac
18568         esac
18569 echo "$as_me:18569: result: $DFT_OBJ_SUBDIR" >&5
18570 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18571
18572 ### Set up low-level terminfo dependencies for makefiles.
18573
18574 if test "$DFT_LWR_MODEL" = shared ; then
18575         case $cf_cv_system_name in
18576         (cygwin*)
18577                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18578                 ;;
18579         (msys*)
18580                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18581                 ;;
18582         esac
18583 fi
18584
18585 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18586
18587 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18588
18589 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18590
18591 ### Construct the list of subdirectories for which we'll customize makefiles
18592 ### with the appropriate compile-rules.
18593
18594 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18595
18596 cat >>confdefs.h <<EOF
18597 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18598 EOF
18599
18600 ################################################################################
18601
18602 TEST_ARG2=
18603
18604 TEST_LIBS2=
18605
18606 NCURSES_SHLIB2="sh -c"
18607
18608 ADA_SUBDIRS="include gen src doc"
18609 if test "x$cf_with_tests" != "xno" ; then
18610         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18611 fi
18612 for cf_dir in $ADA_SUBDIRS
18613 do
18614         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18615 done
18616
18617 NCURSES_TREE="#"
18618
18619 EXTERNAL_TREE=
18620
18621 # match layout used by make-tar.sh
18622 ADAHTML_DIR=../doc/ada
18623
18624 if test "x$cross_compiling" = xyes ; then
18625         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18626 else
18627         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18628 fi
18629
18630 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"
18631 ac_config_commands="$ac_config_commands default"
18632 cat >confcache <<\_ACEOF
18633 # This file is a shell script that caches the results of configure
18634 # tests run on this system so they can be shared between configure
18635 # scripts and configure runs, see configure's option --config-cache.
18636 # It is not useful on other systems.  If it contains results you don't
18637 # want to keep, you may remove or edit it.
18638 #
18639 # config.status only pays attention to the cache file if you give it
18640 # the --recheck option to rerun configure.
18641 #
18642 # `ac_cv_env_foo' variables (set or unset) will be overridden when
18643 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18644 # following values.
18645
18646 _ACEOF
18647
18648 # The following way of writing the cache mishandles newlines in values,
18649 # but we know of no workaround that is simple, portable, and efficient.
18650 # So, don't put newlines in cache variables' values.
18651 # Ultrix sh set writes to stderr and can't be redirected directly,
18652 # and sets the high bit in the cache file unless we assign to the vars.
18653 {
18654   (set) 2>&1 |
18655     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18656     *ac_space=\ *)
18657       # `set' does not quote correctly, so add quotes (double-quote
18658       # substitution turns \\\\ into \\, and sed turns \\ into \).
18659       sed -n \
18660         "s/'/'\\\\''/g;
18661           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18662       ;;
18663     *)
18664       # `set' quotes correctly as required by POSIX, so do not add quotes.
18665       sed -n \
18666         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18667       ;;
18668     esac;
18669 } |
18670   sed '
18671      t clear
18672      : clear
18673      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18674      t end
18675      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18676      : end' >>confcache
18677 if cmp -s $cache_file confcache; then :; else
18678   if test -w $cache_file; then
18679     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18680     cat confcache >$cache_file
18681   else
18682     echo "not updating unwritable cache $cache_file"
18683   fi
18684 fi
18685 rm -f confcache
18686
18687 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18688 # Let make expand exec_prefix.
18689 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18690
18691 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18692 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18693 # trailing colons and then remove the whole line if VPATH becomes empty
18694 # (actually we leave an empty line to preserve line numbers).
18695 if test "x$srcdir" = x.; then
18696   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18697 s/:*\$(srcdir):*/:/;
18698 s/:*\${srcdir}:*/:/;
18699 s/:*@srcdir@:*/:/;
18700 s/^\([^=]*=[    ]*\):*/\1/;
18701 s/:*$//;
18702 s/^[^=]*=[      ]*$//;
18703 }'
18704 fi
18705
18706 DEFS=-DHAVE_CONFIG_H
18707
18708 : "${CONFIG_STATUS=./config.status}"
18709 ac_clean_files_save=$ac_clean_files
18710 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18711 { echo "$as_me:18711: creating $CONFIG_STATUS" >&5
18712 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18713 cat >"$CONFIG_STATUS" <<_ACEOF
18714 #! $SHELL
18715 # Generated automatically by configure.
18716 # Run this file to recreate the current configuration.
18717 # Compiler output produced by configure, useful for debugging
18718 # configure, is in config.log if it exists.
18719
18720 me=\`echo "\$0" | sed -e 's,.*\\/,,'\`
18721
18722 debug=false
18723 SHELL=\${CONFIG_SHELL-$SHELL}
18724 ac_cs_invocation="\$0 \$@"
18725
18726 CLICOLOR_FORCE= GREP_OPTIONS=
18727 unset CLICOLOR_FORCE GREP_OPTIONS
18728 _ACEOF
18729
18730 cat >>"$CONFIG_STATUS" <<\_ACEOF
18731 # Be Bourne compatible
18732 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18733   emulate sh
18734   NULLCMD=:
18735 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18736   set -o posix
18737 fi
18738
18739 # Name of the executable.
18740 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18741
18742 if expr a : '\(a\)' >/dev/null 2>&1; then
18743   as_expr="expr"
18744 else
18745   as_expr="false"
18746 fi
18747
18748 rm -f conf$$ conf$$.exe conf$$.file
18749 echo >conf$$.file
18750 if ln -s conf$$.file conf$$ 2>/dev/null; then
18751   # We could just check for DJGPP; but this test a) works b) is more generic
18752   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18753   if test -f conf$$.exe; then
18754     # Don't use ln at all; we don't have any links
18755     as_ln_s='cp -p'
18756   else
18757     as_ln_s='ln -s'
18758   fi
18759 elif ln conf$$.file conf$$ 2>/dev/null; then
18760   as_ln_s='ln'
18761 else
18762   as_ln_s='cp -p'
18763 fi
18764 rm -f conf$$ conf$$.exe conf$$.file
18765
18766 as_executable_p="test -f"
18767
18768 # Support unset when possible.
18769 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18770   as_unset="unset"
18771 else
18772   as_unset="false"
18773 fi
18774
18775 # NLS nuisances.
18776 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18777 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18778 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18779 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18780 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18781 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18782 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18783 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18784
18785 # IFS
18786 # We need space, tab and new line, in precisely that order.
18787 as_nl='
18788 '
18789 IFS="   $as_nl"
18790
18791 # CDPATH.
18792 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18793
18794 exec 6>&1
18795
18796 _ACEOF
18797
18798 # Files that config.status was made for.
18799 if test -n "$ac_config_files"; then
18800   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18801 fi
18802
18803 if test -n "$ac_config_headers"; then
18804   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18805 fi
18806
18807 if test -n "$ac_config_links"; then
18808   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18809 fi
18810
18811 if test -n "$ac_config_commands"; then
18812   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18813 fi
18814
18815 cat >>"$CONFIG_STATUS" <<\EOF
18816
18817 ac_cs_usage="\
18818 \`$as_me' instantiates files from templates according to the
18819 current configuration.
18820
18821 Usage: $0 [OPTIONS] [FILE]...
18822
18823   -h, --help       print this help, then exit
18824   -V, --version    print version number, then exit
18825   -d, --debug      don't remove temporary files
18826       --recheck    update $as_me by reconfiguring in the same conditions
18827   --file=FILE[:TEMPLATE]
18828                    instantiate the configuration file FILE
18829   --header=FILE[:TEMPLATE]
18830                    instantiate the configuration header FILE
18831
18832 Configuration files:
18833 $config_files
18834
18835 Configuration headers:
18836 $config_headers
18837
18838 Configuration commands:
18839 $config_commands
18840
18841 Report bugs to <dickey@invisible-island.net>."
18842 EOF
18843
18844 cat >>"$CONFIG_STATUS" <<EOF
18845 ac_cs_version="\\
18846 config.status
18847 configured by $0, generated by GNU Autoconf 2.52.20231210,
18848   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18849
18850 Copyright 2003-2022,2023        Thomas E. Dickey
18851 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18852 Free Software Foundation, Inc.
18853 This config.status script is free software; the Free Software Foundation
18854 gives unlimited permission to copy, distribute and modify it."
18855 srcdir="$srcdir"
18856 INSTALL="$INSTALL"
18857 EOF
18858
18859 cat >>"$CONFIG_STATUS" <<\EOF
18860 # If no file are specified by the user, then we need to provide default
18861 # value.  By we need to know if files were specified by the user.
18862 ac_need_defaults=:
18863 while test $# != 0
18864 do
18865   case $1 in
18866   --*=*)
18867     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18868     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18869     shift
18870     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18871     shift
18872     ;;
18873   -*);;
18874   *) # This is not an option, so the user has probably given explicit
18875      # arguments.
18876      ac_need_defaults=false;;
18877   esac
18878
18879   case $1 in
18880   # Handling of the options.
18881 EOF
18882 cat >>"$CONFIG_STATUS" <<EOF
18883   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18884     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18885     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18886 EOF
18887 cat >>"$CONFIG_STATUS" <<\EOF
18888   --version | --vers* | -V )
18889     echo "$ac_cs_version"; exit 0 ;;
18890   --he | --h)
18891     # Conflict between --help and --header
18892     { { echo "$as_me:18892: error: ambiguous option: $1
18893 Try \`$0 --help' for more information." >&5
18894 echo "$as_me: error: ambiguous option: $1
18895 Try \`$0 --help' for more information." >&2;}
18896    { (exit 1); exit 1; }; };;
18897   --help | --hel | -h )
18898     echo "$ac_cs_usage"; exit 0 ;;
18899   --debug | --d* | -d )
18900     debug=: ;;
18901   --file | --fil | --fi | --f )
18902     shift
18903     CONFIG_FILES="$CONFIG_FILES $1"
18904     ac_need_defaults=false;;
18905   --header | --heade | --head | --hea )
18906     shift
18907     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18908     ac_need_defaults=false;;
18909
18910   # This is an error.
18911   -*) { { echo "$as_me:18911: error: unrecognized option: $1
18912 Try \`$0 --help' for more information." >&5
18913 echo "$as_me: error: unrecognized option: $1
18914 Try \`$0 --help' for more information." >&2;}
18915    { (exit 1); exit 1; }; } ;;
18916
18917   *) ac_config_targets="$ac_config_targets $1" ;;
18918
18919   esac
18920   shift
18921 done
18922
18923 exec 5>>config.log
18924 cat >&5 << _ACEOF
18925
18926 ## ----------------------- ##
18927 ## Running config.status.  ##
18928 ## ----------------------- ##
18929
18930 This file was extended by $as_me 2.52.20231210, executed with
18931   CONFIG_FILES    = $CONFIG_FILES
18932   CONFIG_HEADERS  = $CONFIG_HEADERS
18933   CONFIG_LINKS    = $CONFIG_LINKS
18934   CONFIG_COMMANDS = $CONFIG_COMMANDS
18935   > "$ac_cs_invocation"
18936 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18937
18938 _ACEOF
18939 EOF
18940
18941 cat >>"$CONFIG_STATUS" <<EOF
18942 #
18943 # INIT-COMMANDS section.
18944 #
18945
18946 ### Special initialization commands, used to pass information from the
18947 ### configuration-run into config.status
18948
18949 AWK="$AWK"
18950 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18951 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18952 LIB_NAME="$LIB_NAME"
18953 LIB_PREFIX="$LIB_PREFIX"
18954 LIB_SUFFIX="$LIB_SUFFIX"
18955 LN_S="$LN_S"
18956 NCURSES_MAJOR="$NCURSES_MAJOR"
18957 NCURSES_MINOR="$NCURSES_MINOR"
18958 NCURSES_PATCH="$NCURSES_PATCH"
18959 PACKAGE="$PACKAGE"
18960 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18961 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18962 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18963 cf_cv_abi_version="$cf_cv_abi_version"
18964 cf_cv_rel_version="$cf_cv_rel_version"
18965 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18966 cf_cv_shared_soname='$cf_cv_shared_soname'
18967 cf_cv_shlib_version="$cf_cv_shlib_version"
18968 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18969 cf_cv_system_name="$cf_cv_system_name"
18970 host="$host"
18971 target="$target"
18972
18973 EOF
18974
18975 cat >>"$CONFIG_STATUS" <<\EOF
18976 for ac_config_target in $ac_config_targets
18977 do
18978   case "$ac_config_target" in
18979   # Handling of arguments.
18980   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18981   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18982   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18983   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18984   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18985   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18986   *) { { echo "$as_me:18986: error: invalid argument: $ac_config_target" >&5
18987 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18988    { (exit 1); exit 1; }; };;
18989   esac
18990 done
18991
18992 # If the user did not use the arguments to specify the items to instantiate,
18993 # then the envvar interface is used.  Set only those that are not.
18994 # We use the long form for the default assignment because of an extremely
18995 # bizarre bug on SunOS 4.1.3.
18996 if "$ac_need_defaults"; then
18997   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18998   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18999   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19000 fi
19001
19002 # Create a temporary directory, and hook for its removal unless debugging.
19003 $debug ||
19004 {
19005   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19006   trap '{ (exit 1); exit 1; }' 1 2 13 15
19007 }
19008
19009 # Create a (secure) tmp directory for tmp files.
19010 : "${TMPDIR=/tmp}"
19011 {
19012   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19013   test -n "$tmp" && test -d "$tmp"
19014 }  ||
19015 {
19016   tmp=$TMPDIR/cs$$-$RANDOM
19017   (umask 077 && mkdir "$tmp")
19018 } ||
19019 {
19020    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19021    { (exit 1); exit 1; }
19022 }
19023
19024 EOF
19025
19026 cat >>"$CONFIG_STATUS" <<EOF
19027
19028 #
19029 # CONFIG_FILES section.
19030 #
19031
19032 # No need to generate the scripts if there are no CONFIG_FILES.
19033 # This happens for instance when ./config.status config.h
19034 if test -n "\$CONFIG_FILES"; then
19035   # Protect against being on the right side of a sed subst in config.status.
19036   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19037    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >"\$tmp"/subs.sed <<\\CEOF
19038 s,@SHELL@,$SHELL,;t t
19039 s,@exec_prefix@,$exec_prefix,;t t
19040 s,@prefix@,$prefix,;t t
19041 s,@program_transform_name@,$program_transform_name,;t t
19042 s,@bindir@,$bindir,;t t
19043 s,@sbindir@,$sbindir,;t t
19044 s,@libexecdir@,$libexecdir,;t t
19045 s,@datarootdir@,$datarootdir,;t t
19046 s,@datadir@,$datadir,;t t
19047 s,@sysconfdir@,$sysconfdir,;t t
19048 s,@sharedstatedir@,$sharedstatedir,;t t
19049 s,@localstatedir@,$localstatedir,;t t
19050 s,@runstatedir@,$runstatedir,;t t
19051 s,@libdir@,$libdir,;t t
19052 s,@includedir@,$includedir,;t t
19053 s,@oldincludedir@,$oldincludedir,;t t
19054 s,@infodir@,$infodir,;t t
19055 s,@mandir@,$mandir,;t t
19056 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19057 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19058 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19059 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19060 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19061 s,@build_alias@,$build_alias,;t t
19062 s,@host_alias@,$host_alias,;t t
19063 s,@target_alias@,$target_alias,;t t
19064 s,@ECHO_C@,$ECHO_C,;t t
19065 s,@ECHO_N@,$ECHO_N,;t t
19066 s,@ECHO_T@,$ECHO_T,;t t
19067 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19068 s,@DEFS@,$DEFS,;t t
19069 s,@LIBS@,$LIBS,;t t
19070 s,@PACKAGE@,$PACKAGE,;t t
19071 s,@top_builddir@,$top_builddir,;t t
19072 s,@build@,$build,;t t
19073 s,@build_cpu@,$build_cpu,;t t
19074 s,@build_vendor@,$build_vendor,;t t
19075 s,@build_os@,$build_os,;t t
19076 s,@host@,$host,;t t
19077 s,@host_cpu@,$host_cpu,;t t
19078 s,@host_vendor@,$host_vendor,;t t
19079 s,@host_os@,$host_os,;t t
19080 s,@target@,$target,;t t
19081 s,@target_cpu@,$target_cpu,;t t
19082 s,@target_vendor@,$target_vendor,;t t
19083 s,@target_os@,$target_os,;t t
19084 s,@GREP@,$GREP,;t t
19085 s,@FGREP@,$FGREP,;t t
19086 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
19087 s,@M4_exists@,$M4_exists,;t t
19088 s,@cf_ada_make@,$cf_ada_make,;t t
19089 s,@cf_ada_config@,$cf_ada_config,;t t
19090 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
19091 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
19092 s,@cf_cv_path_gnatgcc@,$cf_cv_path_gnatgcc,;t t
19093 s,@CC@,$CC,;t t
19094 s,@CFLAGS@,$CFLAGS,;t t
19095 s,@LDFLAGS@,$LDFLAGS,;t t
19096 s,@CPPFLAGS@,$CPPFLAGS,;t t
19097 s,@ac_ct_CC@,$ac_ct_CC,;t t
19098 s,@EXEEXT@,$EXEEXT,;t t
19099 s,@OBJEXT@,$OBJEXT,;t t
19100 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19101 s,@CPP@,$CPP,;t t
19102 s,@EGREP@,$EGREP,;t t
19103 s,@AWK@,$AWK,;t t
19104 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19105 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19106 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19107 s,@LN_S@,$LN_S,;t t
19108 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
19109 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
19110 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19111 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19112 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
19113 s,@SET_MAKE@,$SET_MAKE,;t t
19114 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
19115 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
19116 s,@CTAGS@,$CTAGS,;t t
19117 s,@ETAGS@,$ETAGS,;t t
19118 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19119 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19120 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
19121 s,@RANLIB@,$RANLIB,;t t
19122 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
19123 s,@LD@,$LD,;t t
19124 s,@ac_ct_LD@,$ac_ct_LD,;t t
19125 s,@AR@,$AR,;t t
19126 s,@ac_ct_AR@,$ac_ct_AR,;t t
19127 s,@ARFLAGS@,$ARFLAGS,;t t
19128 s,@DESTDIR@,$DESTDIR,;t t
19129 s,@BUILD_CC@,$BUILD_CC,;t t
19130 s,@BUILD_CPP@,$BUILD_CPP,;t t
19131 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
19132 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
19133 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
19134 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
19135 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
19136 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
19137 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
19138 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19139 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19140 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19141 s,@cf_cv_screen@,$cf_cv_screen,;t t
19142 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
19143 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
19144 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
19145 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19146 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19147 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
19148 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
19149 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
19150 s,@cf_cv_enable_sigwinch@,$cf_cv_enable_sigwinch,;t t
19151 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
19152 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
19153 s,@CC_G_OPT@,$CC_G_OPT,;t t
19154 s,@LD_MODEL@,$LD_MODEL,;t t
19155 s,@shlibdir@,$shlibdir,;t t
19156 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
19157 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19158 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
19159 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19160 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
19161 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
19162 s,@LINK_PROGS@,$LINK_PROGS,;t t
19163 s,@LINK_TESTS@,$LINK_TESTS,;t t
19164 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19165 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19166 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
19167 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
19168 s,@RPATH_LIST@,$RPATH_LIST,;t t
19169 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
19170 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
19171 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
19172 s,@PTHREAD@,$PTHREAD,;t t
19173 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
19174 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19175 s,@ECHO_LT@,$ECHO_LT,;t t
19176 s,@ECHO_LD@,$ECHO_LD,;t t
19177 s,@RULE_CC@,$RULE_CC,;t t
19178 s,@SHOW_CC@,$SHOW_CC,;t t
19179 s,@ECHO_CC@,$ECHO_CC,;t t
19180 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19181 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
19182 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
19183 s,@ADAFLAGS@,$ADAFLAGS,;t t
19184 s,@ADA_TRACE@,$ADA_TRACE,;t t
19185 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
19186 s,@cf_compile_generics@,$cf_compile_generics,;t t
19187 s,@cf_generic_objects@,$cf_generic_objects,;t t
19188 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
19189 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
19190 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
19191 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
19192 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
19193 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
19194 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
19195 s,@cf_ada_package@,$cf_ada_package,;t t
19196 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
19197 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
19198 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
19199 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
19200 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
19201 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
19202 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19203 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
19204 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
19205 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19206 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19207 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
19208 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
19209 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
19210 s,@TEST_ARG2@,$TEST_ARG2,;t t
19211 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
19212 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
19213 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
19214 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
19215 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
19216 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
19217 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
19218 CEOF
19219
19220 EOF
19221
19222   cat >>"$CONFIG_STATUS" <<\EOF
19223   # Split the substitutions into bite-sized pieces for seds with
19224   # small command number limits, like on Digital OSF/1 and HP-UX.
19225   ac_max_sed_lines=48
19226   ac_sed_frag=1 # Number of current file.
19227   ac_beg=1 # First line for current file.
19228   ac_end=$ac_max_sed_lines # Line after last line for current file.
19229   ac_more_lines=:
19230   ac_sed_cmds=
19231   while "$ac_more_lines"; do
19232     if test "$ac_beg" -gt 1; then
19233       sed "1,${ac_beg}d; ${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19234     else
19235       sed "${ac_end}q" "$tmp"/subs.sed >"$tmp"/subs.frag
19236     fi
19237     if test ! -s "$tmp"/subs.frag; then
19238       ac_more_lines=false
19239     else
19240       # The purpose of the label and of the branching condition is to
19241       # speed up the sed processing (if there are no `@' at all, there
19242       # is no need to browse any of the substitutions).
19243       # These are the two extra sed commands mentioned above.
19244       (echo ':t
19245   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed
19246       # It is possible to make a multiline substitution using escaped newlines.
19247       # Ensure that we do not split the substitution between script fragments.
19248       ac_BEG=$ac_end
19249       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
19250       sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next
19251       if test -s "$tmp"/subs.next; then
19252         grep '^s,@[^@,][^@,]*@,.*\\$' "$tmp"/subs.next >"$tmp"/subs.edit
19253         if test ! -s "$tmp"/subs.edit; then
19254           grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit
19255           if test ! -s "$tmp"/subs.edit; then
19256             if test "$ac_beg" -gt 1; then
19257               ac_end=`expr "$ac_end" - 1`
19258               continue
19259             fi
19260           fi
19261         fi
19262       fi
19263
19264       if test -z "$ac_sed_cmds"; then
19265         ac_sed_cmds="sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19266       else
19267         ac_sed_cmds="$ac_sed_cmds | sed -f \"$tmp\"/subs-$ac_sed_frag.sed"
19268       fi
19269       ac_sed_frag=`expr "$ac_sed_frag" + 1`
19270       ac_beg=$ac_end
19271       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
19272     fi
19273   done
19274   if test -z "$ac_sed_cmds"; then
19275     ac_sed_cmds="cat"
19276   fi
19277 fi # test -n "$CONFIG_FILES"
19278
19279 EOF
19280 cat >>"$CONFIG_STATUS" <<\EOF
19281 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19282   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19283   case "$ac_file" in
19284   - | *:- | *:-:* ) # input from stdin
19285         cat >"$tmp"/stdin
19286         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19287         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19288   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19289         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19290   * )   ac_file_in=$ac_file.in ;;
19291   esac
19292
19293   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19294   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19295          X"$ac_file" : 'X\(//\)[^/]' \| \
19296          X"$ac_file" : 'X\(//\)$' \| \
19297          X"$ac_file" : 'X\(/\)' \| \
19298          .     : '\(.\)' 2>/dev/null ||
19299 echo X"$ac_file" |
19300     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19301           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19302           /^X\(\/\/\)$/{ s//\1/; q; }
19303           /^X\(\/\).*/{ s//\1/; q; }
19304           s/.*/./; q'`
19305   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19306     { case "$ac_dir" in
19307   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19308   *)                      as_incr_dir=.;;
19309 esac
19310 as_dummy="$ac_dir"
19311 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19312   case $as_mkdir_dir in
19313     # Skip DOS drivespec
19314     ?:) as_incr_dir=$as_mkdir_dir ;;
19315     *)
19316       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19317       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19318     ;;
19319   esac
19320 done; }
19321
19322     ac_dir_suffix="/`echo "$ac_dir"|sed 's,^\./,,'`"
19323     # A "../" for each directory in $ac_dir_suffix.
19324     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19325   else
19326     ac_dir_suffix= ac_dots=
19327   fi
19328
19329   case "$srcdir" in
19330   .)  ac_srcdir=.
19331       if test -z "$ac_dots"; then
19332          ac_top_srcdir=.
19333       else
19334          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
19335       fi ;;
19336   [\\/]* | ?:[\\/]* )
19337       ac_srcdir="$srcdir$ac_dir_suffix";
19338       ac_top_srcdir="$srcdir" ;;
19339   *) # Relative path.
19340     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
19341     ac_top_srcdir="$ac_dots$srcdir" ;;
19342   esac
19343
19344   case $INSTALL in
19345   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19346   *) ac_INSTALL=$ac_dots$INSTALL ;;
19347   esac
19348
19349   if test x"$ac_file" != x-; then
19350     { echo "$as_me:19350: creating $ac_file" >&5
19351 echo "$as_me: creating $ac_file" >&6;}
19352     rm -f "$ac_file"
19353   fi
19354   # Let's still pretend it is `configure' which instantiates (i.e., don't
19355   # use $as_me), people would be surprised to read:
19356   #    /* config.h.  Generated automatically by config.status.  */
19357   configure_input="Generated automatically from `echo $ac_file_in |
19358                                                  sed 's,.*/,,'` by configure."
19359
19360   # First look for the input files in the build tree, otherwise in the
19361   # src tree.
19362   ac_file_inputs=`IFS=:
19363     for f in $ac_file_in; do
19364       case $f in
19365       -) echo "$tmp"/stdin ;;
19366       [\\/$]*)
19367          # Absolute (can't be DOS-style, as IFS=:)
19368          test -f "$f" || { { echo "$as_me:19368: error: cannot find input file: $f" >&5
19369 echo "$as_me: error: cannot find input file: $f" >&2;}
19370    { (exit 1); exit 1; }; }
19371          echo "$f";;
19372       *) # Relative
19373          if test -f "$f"; then
19374            # Build tree
19375            echo "$f"
19376          elif test -f "$srcdir/$f"; then
19377            # Source tree
19378            echo "$srcdir/$f"
19379          else
19380            # /dev/null tree
19381            { { echo "$as_me:19381: error: cannot find input file: $f" >&5
19382 echo "$as_me: error: cannot find input file: $f" >&2;}
19383    { (exit 1); exit 1; }; }
19384          fi;;
19385       esac
19386     done` || { (exit 1); exit 1; }
19387 EOF
19388 cat >>"$CONFIG_STATUS" <<\EOF
19389   ac_warn_datarootdir=no
19390   if test x"$ac_file" != x-; then
19391     for ac_item in $ac_file_inputs
19392     do
19393       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
19394       if test -n "$ac_seen"; then
19395         ac_used=`grep '@datarootdir@' "$ac_item"`
19396         if test -z "$ac_used"; then
19397           { echo "$as_me:19397: WARNING: datarootdir was used implicitly but not set:
19398 $ac_seen" >&5
19399 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19400 $ac_seen" >&2;}
19401           ac_warn_datarootdir=yes
19402         fi
19403       fi
19404       ac_seen=`grep '${datarootdir}' "$ac_item"`
19405       if test -n "$ac_seen"; then
19406         { echo "$as_me:19406: WARNING: datarootdir was used explicitly but not set:
19407 $ac_seen" >&5
19408 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19409 $ac_seen" >&2;}
19410         ac_warn_datarootdir=yes
19411       fi
19412     done
19413   fi
19414
19415 if test "x$ac_warn_datarootdir" = xyes; then
19416   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19417 fi
19418
19419 EOF
19420 cat >>"$CONFIG_STATUS" <<EOF
19421   sed "$ac_vpsub
19422 $extrasub
19423 EOF
19424 cat >>"$CONFIG_STATUS" <<\EOF
19425 :t
19426 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19427 s,@configure_input@,$configure_input,;t t
19428 s,@srcdir@,$ac_srcdir,;t t
19429 s,@top_srcdir@,$ac_top_srcdir,;t t
19430 s,@INSTALL@,$ac_INSTALL,;t t
19431 " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out
19432   rm -f "$tmp"/stdin
19433 EOF
19434 test -n "${FGREP}" || FGREP="grep -F"
19435 test -n "${EGREP}" || EGREP="grep -E"
19436 cat >>"$CONFIG_STATUS" <<EOF
19437   test -n "\${FGREP}" || FGREP="$FGREP"
19438   test -n "\${EGREP}" || EGREP="$EGREP"
19439 EOF
19440 cat >>"$CONFIG_STATUS" <<\EOF
19441   if test x"$ac_file" != x-; then
19442     cp "$tmp/out" "$ac_file"
19443
19444     for ac_name in prefix exec_prefix datarootdir
19445     do
19446         ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"`
19447         if test -n "$ac_seen"; then
19448             ac_init=`$EGREP '[  ]*'$ac_name'[   ]*=' "$ac_file"`
19449             if test -z "$ac_init"; then
19450               ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'`
19451               { echo "$as_me:19451: WARNING: Variable $ac_name is used but was not set:
19452 $ac_seen" >&5
19453 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19454 $ac_seen" >&2;}
19455             fi
19456         fi
19457     done
19458     $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out
19459     $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out
19460     if test -s "$tmp"/out; then
19461       ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out`
19462       { echo "$as_me:19462: WARNING: Some variables may not be substituted:
19463 $ac_seen" >&5
19464 echo "$as_me: WARNING: Some variables may not be substituted:
19465 $ac_seen" >&2;}
19466     fi
19467   else
19468     cat "$tmp"/out
19469   fi
19470   rm -f "$tmp"/out
19471
19472 done
19473 EOF
19474 cat >>"$CONFIG_STATUS" <<\EOF
19475
19476 #
19477 # CONFIG_HEADER section.
19478 #
19479
19480 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19481 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19482 #
19483 # ac_d sets the value in "#define NAME VALUE" lines.
19484 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19485 ac_dB='[        ].*$,\1#\2'
19486 ac_dC=' '
19487 ac_dD=',;t'
19488 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19489 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19490 ac_iB='\([      ]\),\1#\2define\3'
19491 ac_iC=' '
19492 ac_iD='\4,;t'
19493 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19494 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19495 ac_uB='$,\1#\2define\3'
19496 ac_uC=' '
19497 ac_uD=',;t'
19498
19499 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19500   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19501   case "$ac_file" in
19502   - | *:- | *:-:* ) # input from stdin
19503         cat >"$tmp"/stdin
19504         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19505         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19506   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19507         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19508   * )   ac_file_in=$ac_file.in ;;
19509   esac
19510
19511   test x"$ac_file" != x- && { echo "$as_me:19511: creating $ac_file" >&5
19512 echo "$as_me: creating $ac_file" >&6;}
19513
19514   # First look for the input files in the build tree, otherwise in the
19515   # src tree.
19516   ac_file_inputs=`IFS=:
19517     for f in $ac_file_in; do
19518       case $f in
19519       -) echo "$tmp"/stdin ;;
19520       [\\/$]*)
19521          # Absolute (can't be DOS-style, as IFS=:)
19522          test -f "$f" || { { echo "$as_me:19522: error: cannot find input file: $f" >&5
19523 echo "$as_me: error: cannot find input file: $f" >&2;}
19524    { (exit 1); exit 1; }; }
19525          echo $f;;
19526       *) # Relative
19527          if test -f "$f"; then
19528            # Build tree
19529            echo $f
19530          elif test -f "$srcdir/$f"; then
19531            # Source tree
19532            echo "$srcdir/$f"
19533          else
19534            # /dev/null tree
19535            { { echo "$as_me:19535: error: cannot find input file: $f" >&5
19536 echo "$as_me: error: cannot find input file: $f" >&2;}
19537    { (exit 1); exit 1; }; }
19538          fi;;
19539       esac
19540     done` || { (exit 1); exit 1; }
19541   # Remove the trailing spaces.
19542   sed 's/[      ]*$//' $ac_file_inputs >"$tmp"/in
19543
19544 EOF
19545
19546 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19547 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19548 # be either 'cat' or 'sort'.
19549 cat confdefs.h | uniq >conftest.vals
19550
19551 # Break up conftest.vals because some shells have a limit on
19552 # the size of here documents, and old seds have small limits too.
19553
19554 rm -f conftest.tail
19555 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19556 while grep . conftest.vals >/dev/null
19557 do
19558   # Write chunks of a limited-size here document to conftest.frag.
19559   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19560   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19561   echo 'CEOF' >> "$CONFIG_STATUS"
19562   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19563   rm -f conftest.vals
19564   mv conftest.tail conftest.vals
19565 done
19566 rm -f conftest.vals
19567
19568 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19569 # marker @DEFS@.
19570 echo '  cat >> conftest.edit <<CEOF
19571 /@DEFS@/r conftest.frag
19572 /@DEFS@/d
19573 CEOF
19574 sed -f conftest.edit "$tmp"/in > "$tmp"/out
19575 rm -f "$tmp"/in
19576 mv "$tmp"/out "$tmp"/in
19577 rm -f conftest.edit conftest.frag
19578 ' >> "$CONFIG_STATUS"
19579
19580 cat >>"$CONFIG_STATUS" <<\EOF
19581   # Let's still pretend it is `configure' which instantiates (i.e., don't
19582   # use $as_me), people would be surprised to read:
19583   #    /* config.h.  Generated automatically by config.status.  */
19584   if test x"$ac_file" = x-; then
19585     echo "/* Generated automatically by configure.  */" >"$tmp"/config.h
19586   else
19587     echo "/* $ac_file.  Generated automatically by configure.  */" >"$tmp"/config.h
19588   fi
19589   cat "$tmp"/in >>"$tmp"/config.h
19590   rm -f "$tmp"/in
19591   if test x"$ac_file" != x-; then
19592     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19593       { echo "$as_me:19593: $ac_file is unchanged" >&5
19594 echo "$as_me: $ac_file is unchanged" >&6;}
19595     else
19596       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19597          X"$ac_file" : 'X\(//\)[^/]' \| \
19598          X"$ac_file" : 'X\(//\)$' \| \
19599          X"$ac_file" : 'X\(/\)' \| \
19600          .     : '\(.\)' 2>/dev/null ||
19601 echo X"$ac_file" |
19602     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19603           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19604           /^X\(\/\/\)$/{ s//\1/; q; }
19605           /^X\(\/\).*/{ s//\1/; q; }
19606           s/.*/./; q'`
19607       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19608         { case "$ac_dir" in
19609   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19610   *)                      as_incr_dir=.;;
19611 esac
19612 as_dummy="$ac_dir"
19613 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19614   case $as_mkdir_dir in
19615     # Skip DOS drivespec
19616     ?:) as_incr_dir=$as_mkdir_dir ;;
19617     *)
19618       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19619       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19620     ;;
19621   esac
19622 done; }
19623
19624       fi
19625       rm -f "$ac_file"
19626       mv "$tmp/config.h" "$ac_file"
19627     fi
19628   else
19629     cat "$tmp"/config.h
19630     rm -f "$tmp"/config.h
19631   fi
19632 done
19633 EOF
19634 cat >>"$CONFIG_STATUS" <<\EOF
19635 #
19636 # CONFIG_COMMANDS section.
19637 #
19638 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19639   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19640   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19641
19642   case "$ac_dest" in
19643     default )
19644 $AWK -v PACKAGE=$PACKAGE -f $srcdir/mk-pkg.awk </dev/null >> Makefile
19645 if test -z "$USE_OLD_MAKERULES" ; then
19646         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19647 fi
19648  ;;
19649   esac
19650 done
19651 EOF
19652
19653 cat >>"$CONFIG_STATUS" <<\EOF
19654
19655 { (exit 0); exit 0; }
19656 EOF
19657 chmod +x "$CONFIG_STATUS"
19658 ac_clean_files=$ac_clean_files_save
19659
19660 # configure is writing to config.log, and then calls config.status.
19661 # config.status does its own redirection, appending to config.log.
19662 # Unfortunately, on DOS this fails, as config.log is still kept open
19663 # by configure, so config.status won't be able to write to it; its
19664 # output is simply discarded.  So we exec the FD to /dev/null,
19665 # effectively closing config.log, so it can be properly (re)opened and
19666 # appended to by config.status.  When coming back to configure, we
19667 # need to make the FD available again.
19668 if test "$no_create" != yes; then
19669   ac_cs_success=:
19670   exec 5>/dev/null
19671   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19672   exec 5>>config.log
19673   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19674   # would make configure fail if this is the last instruction.
19675   "$ac_cs_success" || { (exit 1); exit 1; }
19676 fi
19677 ${MAKE:-make} preinstall