]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.4 - patch 20240414
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.83 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210509.
5 #
6 # Copyright 2003-2020,2021      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   --disable-stripping     do not strip (debug info) installed executables
707   --with-pkg-config{=path} enable/disable use of pkg-config
708   --with-pkg-config-libdir=XXX use given directory for installing pc-files
709   --without-tests         suppress build with test-programs
710   --enable-mixed-case     tic should assume mixed-case filenames
711   --with-install-prefix   prefixes actual install-location ($DESTDIR)
712 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
713   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
714   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
715   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
716   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
717   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
718   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
719 Options to Specify the Libraries Built/Used:
720   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
721   --with-curses-dir=DIR   directory in which (n)curses is installed
722   --enable-widec          compile with wide-char/UTF-8 code
723   --with-lib-prefix       override library-prefix
724   --with-shlib-version=X  Specify rel or abi version for shared libs
725   --enable-rpath-link     link sample programs with rpath option
726 Fine-Tuning Your Configuration:
727   --enable-broken_linker  compile with broken-linker support code
728   --disable-largefile     omit support for large files
729   --with-rcs-ids          compile-in RCS identifiers
730 Extensions:
731   --disable-ext-funcs     disable function-extensions
732   --enable-const          compile with extra/non-standard const
733 Development Code:
734   --without-develop       disable development options
735 Experimental Code:
736   --with-pthread          use POSIX thread library
737   --enable-weak-symbols   enable weak-symbols for pthreads
738   --enable-reentrant      compile with experimental reentrant code
739   --with-wrap-prefix=XXX  override prefix used for public variables
740 Testing/development Options:
741   --disable-echo          do not display "compiling" commands
742   --enable-warnings       test: turn on gcc compiler warnings
743   --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210509.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif 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/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         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.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         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'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 PKG_CONFIG_LIBDIR=no
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   PKG_CONFIG_LIBDIR=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3290 fi;
3291
3292 case x$PKG_CONFIG_LIBDIR in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         # Look for the library directory using the same prefix as the executable
3297         if test "x$PKG_CONFIG" = xnone
3298         then
3299                 cf_path=$prefix
3300         else
3301                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3302         fi
3303
3304         # If you don't like using the default architecture, you have to specify the
3305         # intended library directory and corresponding compiler/linker options.
3306         #
3307         # This case allows for Debian's 2014-flavor of multiarch, along with the
3308         # most common variations before that point.  Some other variants spell the
3309         # directory differently, e.g., "pkg-config", and put it in unusual places.
3310         # pkg-config has always been poorly standardized, which is ironic...
3311         case x`(arch) 2>/dev/null` in
3312         (*64)
3313                 cf_search_path="\
3314                         $cf_path/lib/*64-linux-gnu \
3315                         $cf_path/share \
3316                         $cf_path/lib64 \
3317                         $cf_path/lib32 \
3318                         $cf_path/lib"
3319                 ;;
3320         (*)
3321                 cf_search_path="\
3322                         $cf_path/lib/*-linux-gnu \
3323                         $cf_path/share \
3324                         $cf_path/lib32 \
3325                         $cf_path/lib \
3326                         $cf_path/libdata"
3327                 ;;
3328         esac
3329
3330         test -n "$verbose" && echo "    list..." 1>&6
3331
3332 echo "${as_me:-configure}:3332: testing list... ..." 1>&5
3333
3334         for cf_config in $cf_search_path
3335         do
3336                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3337
3338 echo "${as_me:-configure}:3338: testing checking $cf_config/pkgconfig ..." 1>&5
3339
3340                 if test -d "$cf_config/pkgconfig"
3341                 then
3342                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3343                         echo "$as_me:3343: checking done" >&5
3344 echo $ECHO_N "checking done... $ECHO_C" >&6
3345                         break
3346                 fi
3347         done
3348         ;;
3349 (*)
3350         ;;
3351 esac
3352
3353 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3354         echo "$as_me:3354: result: $PKG_CONFIG_LIBDIR" >&5
3355 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3356 fi
3357
3358 echo "$as_me:3358: checking if you want to build test-programs" >&5
3359 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3360
3361 # Check whether --with-tests or --without-tests was given.
3362 if test "${with_tests+set}" = set; then
3363   withval="$with_tests"
3364   cf_with_tests=$withval
3365 else
3366   cf_with_tests=yes
3367 fi;
3368 echo "$as_me:3368: result: $cf_with_tests" >&5
3369 echo "${ECHO_T}$cf_with_tests" >&6
3370
3371 echo "$as_me:3371: checking if we should assume mixed-case filenames" >&5
3372 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3373
3374 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3375 if test "${enable_mixed_case+set}" = set; then
3376   enableval="$enable_mixed_case"
3377   enable_mixedcase=$enableval
3378 else
3379   enable_mixedcase=auto
3380 fi;
3381 echo "$as_me:3381: result: $enable_mixedcase" >&5
3382 echo "${ECHO_T}$enable_mixedcase" >&6
3383 if test "$enable_mixedcase" = "auto" ; then
3384
3385 echo "$as_me:3385: checking if filesystem supports mixed-case filenames" >&5
3386 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3387 if test "${cf_cv_mixedcase+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390
3391 if test "$cross_compiling" = yes ; then
3392         case "$target_alias" in
3393         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3394                 cf_cv_mixedcase=no
3395                 ;;
3396         (*)
3397                 cf_cv_mixedcase=yes
3398                 ;;
3399         esac
3400 else
3401         rm -f conftest CONFTEST
3402         echo test >conftest
3403         if test -f CONFTEST ; then
3404                 cf_cv_mixedcase=no
3405         else
3406                 cf_cv_mixedcase=yes
3407         fi
3408         rm -f conftest CONFTEST
3409 fi
3410
3411 fi
3412 echo "$as_me:3412: result: $cf_cv_mixedcase" >&5
3413 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3414 test "$cf_cv_mixedcase" = yes &&
3415 cat >>confdefs.h <<\EOF
3416 #define MIXEDCASE_FILENAMES 1
3417 EOF
3418
3419 else
3420         cf_cv_mixedcase=$enable_mixedcase
3421         if test "$enable_mixedcase" = "yes" ; then
3422                 cat >>confdefs.h <<\EOF
3423 #define MIXEDCASE_FILENAMES 1
3424 EOF
3425
3426         fi
3427 fi
3428
3429 # do this after mixed-case option (tags/TAGS is not as important as tic).
3430 echo "$as_me:3430: checking whether ${MAKE-make} sets \${MAKE}" >&5
3431 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3432 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3433 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3434   echo $ECHO_N "(cached) $ECHO_C" >&6
3435 else
3436   cat >conftest.make <<\EOF
3437 all:
3438         @echo 'ac_maketemp="${MAKE}"'
3439 EOF
3440 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3441 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3442 if test -n "$ac_maketemp"; then
3443   eval ac_cv_prog_make_${ac_make}_set=yes
3444 else
3445   eval ac_cv_prog_make_${ac_make}_set=no
3446 fi
3447 rm -f conftest.make
3448 fi
3449 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3450   echo "$as_me:3450: result: yes" >&5
3451 echo "${ECHO_T}yes" >&6
3452   SET_MAKE=
3453 else
3454   echo "$as_me:3454: result: no" >&5
3455 echo "${ECHO_T}no" >&6
3456   SET_MAKE="MAKE=${MAKE-make}"
3457 fi
3458
3459 echo "$as_me:3459: checking for \".PHONY\" make-support" >&5
3460 echo $ECHO_N "checking for \".PHONY\" make-support... $ECHO_C" >&6
3461 if test "${cf_cv_make_PHONY+set}" = set; then
3462   echo $ECHO_N "(cached) $ECHO_C" >&6
3463 else
3464
3465         rm -rf conftest*
3466         (
3467                 mkdir conftest || exit 1
3468                 cd conftest
3469                 cat >makefile <<'CF_EOF'
3470 .PHONY: always
3471 DATA=0
3472 always: always.out
3473         @echo "** making $@ $(DATA)"
3474 once: once.out
3475         @echo "** making $@ $(DATA)"
3476 always.out:
3477         @echo "** making $@ $(DATA)"
3478         echo $(DATA) > $@
3479 once.out:
3480         @echo "** making $@ $(DATA)"
3481         echo $(DATA) > $@
3482 CF_EOF
3483                 for cf_data in 1 2 3
3484                 do
3485                         ${MAKE:-make} always DATA=$cf_data
3486                         ${MAKE:-make} once   DATA=$cf_data
3487                         ${MAKE:-make} -t always once
3488                         if test -f always ; then
3489                                 echo "no (case 1)" > ../conftest.tmp
3490                         elif test ! -f always.out ; then
3491                                 echo "no (case 2)" > ../conftest.tmp
3492                         elif test ! -f once.out ; then
3493                                 echo "no (case 3)" > ../conftest.tmp
3494                         elif ! cmp -s always.out once.out ; then
3495                                 echo "no (case 4)" > ../conftest.tmp
3496                                 diff always.out once.out
3497                         else
3498                                 cf_check="`cat always.out`"
3499                                 if test "x$cf_check" != "x$cf_data" ; then
3500                                         echo "no (case 5)" > ../conftest.tmp
3501                                 else
3502                                         echo yes > ../conftest.tmp
3503                                         rm -f ./*.out
3504                                         continue
3505                                 fi
3506                         fi
3507                         break
3508                 done
3509         ) >&5 2>&1
3510         cf_cv_make_PHONY="`cat conftest.tmp`"
3511         rm -rf conftest*
3512
3513 fi
3514 echo "$as_me:3514: result: $cf_cv_make_PHONY" >&5
3515 echo "${ECHO_T}$cf_cv_make_PHONY" >&6
3516 MAKE_NO_PHONY="#"
3517 MAKE_PHONY="#"
3518 test "x$cf_cv_make_PHONY" = xyes && MAKE_PHONY=
3519 test "x$cf_cv_make_PHONY" != xyes && MAKE_NO_PHONY=
3520
3521 for ac_prog in exctags ctags
3522 do
3523   # Extract the first word of "$ac_prog", so it can be a program name with args.
3524 set dummy $ac_prog; ac_word=$2
3525 echo "$as_me:3525: checking for $ac_word" >&5
3526 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3527 if test "${ac_cv_prog_CTAGS+set}" = set; then
3528   echo $ECHO_N "(cached) $ECHO_C" >&6
3529 else
3530   if test -n "$CTAGS"; then
3531   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3532 else
3533   ac_save_IFS=$IFS; IFS=$ac_path_separator
3534 ac_dummy="$PATH"
3535 for ac_dir in $ac_dummy; do
3536   IFS=$ac_save_IFS
3537   test -z "$ac_dir" && ac_dir=.
3538   $as_executable_p "$ac_dir/$ac_word" || continue
3539 ac_cv_prog_CTAGS="$ac_prog"
3540 echo "$as_me:3540: found $ac_dir/$ac_word" >&5
3541 break
3542 done
3543
3544 fi
3545 fi
3546 CTAGS=$ac_cv_prog_CTAGS
3547 if test -n "$CTAGS"; then
3548   echo "$as_me:3548: result: $CTAGS" >&5
3549 echo "${ECHO_T}$CTAGS" >&6
3550 else
3551   echo "$as_me:3551: result: no" >&5
3552 echo "${ECHO_T}no" >&6
3553 fi
3554
3555   test -n "$CTAGS" && break
3556 done
3557
3558 for ac_prog in exetags etags
3559 do
3560   # Extract the first word of "$ac_prog", so it can be a program name with args.
3561 set dummy $ac_prog; ac_word=$2
3562 echo "$as_me:3562: checking for $ac_word" >&5
3563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3564 if test "${ac_cv_prog_ETAGS+set}" = set; then
3565   echo $ECHO_N "(cached) $ECHO_C" >&6
3566 else
3567   if test -n "$ETAGS"; then
3568   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3569 else
3570   ac_save_IFS=$IFS; IFS=$ac_path_separator
3571 ac_dummy="$PATH"
3572 for ac_dir in $ac_dummy; do
3573   IFS=$ac_save_IFS
3574   test -z "$ac_dir" && ac_dir=.
3575   $as_executable_p "$ac_dir/$ac_word" || continue
3576 ac_cv_prog_ETAGS="$ac_prog"
3577 echo "$as_me:3577: found $ac_dir/$ac_word" >&5
3578 break
3579 done
3580
3581 fi
3582 fi
3583 ETAGS=$ac_cv_prog_ETAGS
3584 if test -n "$ETAGS"; then
3585   echo "$as_me:3585: result: $ETAGS" >&5
3586 echo "${ECHO_T}$ETAGS" >&6
3587 else
3588   echo "$as_me:3588: result: no" >&5
3589 echo "${ECHO_T}no" >&6
3590 fi
3591
3592   test -n "$ETAGS" && break
3593 done
3594
3595 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3596 set dummy ${CTAGS:-ctags}; ac_word=$2
3597 echo "$as_me:3597: checking for $ac_word" >&5
3598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3599 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3600   echo $ECHO_N "(cached) $ECHO_C" >&6
3601 else
3602   if test -n "$MAKE_LOWER_TAGS"; then
3603   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3604 else
3605   ac_save_IFS=$IFS; IFS=$ac_path_separator
3606 ac_dummy="$PATH"
3607 for ac_dir in $ac_dummy; do
3608   IFS=$ac_save_IFS
3609   test -z "$ac_dir" && ac_dir=.
3610   $as_executable_p "$ac_dir/$ac_word" || continue
3611 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3612 echo "$as_me:3612: found $ac_dir/$ac_word" >&5
3613 break
3614 done
3615
3616   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3617 fi
3618 fi
3619 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3620 if test -n "$MAKE_LOWER_TAGS"; then
3621   echo "$as_me:3621: result: $MAKE_LOWER_TAGS" >&5
3622 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3623 else
3624   echo "$as_me:3624: result: no" >&5
3625 echo "${ECHO_T}no" >&6
3626 fi
3627
3628 if test "$cf_cv_mixedcase" = yes ; then
3629         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3630 set dummy ${ETAGS:-etags}; ac_word=$2
3631 echo "$as_me:3631: checking for $ac_word" >&5
3632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3633 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3634   echo $ECHO_N "(cached) $ECHO_C" >&6
3635 else
3636   if test -n "$MAKE_UPPER_TAGS"; then
3637   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3638 else
3639   ac_save_IFS=$IFS; IFS=$ac_path_separator
3640 ac_dummy="$PATH"
3641 for ac_dir in $ac_dummy; do
3642   IFS=$ac_save_IFS
3643   test -z "$ac_dir" && ac_dir=.
3644   $as_executable_p "$ac_dir/$ac_word" || continue
3645 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3646 echo "$as_me:3646: found $ac_dir/$ac_word" >&5
3647 break
3648 done
3649
3650   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3651 fi
3652 fi
3653 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3654 if test -n "$MAKE_UPPER_TAGS"; then
3655   echo "$as_me:3655: result: $MAKE_UPPER_TAGS" >&5
3656 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3657 else
3658   echo "$as_me:3658: result: no" >&5
3659 echo "${ECHO_T}no" >&6
3660 fi
3661
3662 else
3663         MAKE_UPPER_TAGS=no
3664 fi
3665
3666 if test "$MAKE_UPPER_TAGS" = yes ; then
3667         MAKE_UPPER_TAGS=
3668 else
3669         MAKE_UPPER_TAGS="#"
3670 fi
3671
3672 if test "$MAKE_LOWER_TAGS" = yes ; then
3673         MAKE_LOWER_TAGS=
3674 else
3675         MAKE_LOWER_TAGS="#"
3676 fi
3677
3678 echo "$as_me:3678: checking for makeflags variable" >&5
3679 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3680 if test "${cf_cv_makeflags+set}" = set; then
3681   echo $ECHO_N "(cached) $ECHO_C" >&6
3682 else
3683
3684         cf_cv_makeflags=''
3685         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3686         do
3687                 cat >cf_makeflags.tmp <<CF_EOF
3688 SHELL = $SHELL
3689 all :
3690         @ echo '.$cf_option'
3691 CF_EOF
3692                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3693                 case "$cf_result" in
3694                 (.*k|.*kw)
3695                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3696                         case "$cf_result" in
3697                         (.*CC=*)        cf_cv_makeflags=
3698                                 ;;
3699                         (*)     cf_cv_makeflags=$cf_option
3700                                 ;;
3701                         esac
3702                         break
3703                         ;;
3704                 (.-)
3705                         ;;
3706                 (*)
3707
3708 echo "${as_me:-configure}:3708: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3709
3710                         ;;
3711                 esac
3712         done
3713         rm -f cf_makeflags.tmp
3714
3715 fi
3716 echo "$as_me:3716: result: $cf_cv_makeflags" >&5
3717 echo "${ECHO_T}$cf_cv_makeflags" >&6
3718
3719 if test -n "$ac_tool_prefix"; then
3720   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3721 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3722 echo "$as_me:3722: checking for $ac_word" >&5
3723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3724 if test "${ac_cv_prog_RANLIB+set}" = set; then
3725   echo $ECHO_N "(cached) $ECHO_C" >&6
3726 else
3727   if test -n "$RANLIB"; then
3728   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3729 else
3730   ac_save_IFS=$IFS; IFS=$ac_path_separator
3731 ac_dummy="$PATH"
3732 for ac_dir in $ac_dummy; do
3733   IFS=$ac_save_IFS
3734   test -z "$ac_dir" && ac_dir=.
3735   $as_executable_p "$ac_dir/$ac_word" || continue
3736 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3737 echo "$as_me:3737: found $ac_dir/$ac_word" >&5
3738 break
3739 done
3740
3741 fi
3742 fi
3743 RANLIB=$ac_cv_prog_RANLIB
3744 if test -n "$RANLIB"; then
3745   echo "$as_me:3745: result: $RANLIB" >&5
3746 echo "${ECHO_T}$RANLIB" >&6
3747 else
3748   echo "$as_me:3748: result: no" >&5
3749 echo "${ECHO_T}no" >&6
3750 fi
3751
3752 fi
3753 if test -z "$ac_cv_prog_RANLIB"; then
3754   ac_ct_RANLIB=$RANLIB
3755   # Extract the first word of "ranlib", so it can be a program name with args.
3756 set dummy ranlib; ac_word=$2
3757 echo "$as_me:3757: checking for $ac_word" >&5
3758 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3759 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3760   echo $ECHO_N "(cached) $ECHO_C" >&6
3761 else
3762   if test -n "$ac_ct_RANLIB"; then
3763   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3764 else
3765   ac_save_IFS=$IFS; IFS=$ac_path_separator
3766 ac_dummy="$PATH"
3767 for ac_dir in $ac_dummy; do
3768   IFS=$ac_save_IFS
3769   test -z "$ac_dir" && ac_dir=.
3770   $as_executable_p "$ac_dir/$ac_word" || continue
3771 ac_cv_prog_ac_ct_RANLIB="ranlib"
3772 echo "$as_me:3772: found $ac_dir/$ac_word" >&5
3773 break
3774 done
3775
3776   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3777 fi
3778 fi
3779 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3780 if test -n "$ac_ct_RANLIB"; then
3781   echo "$as_me:3781: result: $ac_ct_RANLIB" >&5
3782 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3783 else
3784   echo "$as_me:3784: result: no" >&5
3785 echo "${ECHO_T}no" >&6
3786 fi
3787
3788   RANLIB=$ac_ct_RANLIB
3789 else
3790   RANLIB="$ac_cv_prog_RANLIB"
3791 fi
3792
3793 if test -n "$ac_tool_prefix"; then
3794   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3795 set dummy ${ac_tool_prefix}ld; ac_word=$2
3796 echo "$as_me:3796: checking for $ac_word" >&5
3797 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3798 if test "${ac_cv_prog_LD+set}" = set; then
3799   echo $ECHO_N "(cached) $ECHO_C" >&6
3800 else
3801   if test -n "$LD"; then
3802   ac_cv_prog_LD="$LD" # Let the user override the test.
3803 else
3804   ac_save_IFS=$IFS; IFS=$ac_path_separator
3805 ac_dummy="$PATH"
3806 for ac_dir in $ac_dummy; do
3807   IFS=$ac_save_IFS
3808   test -z "$ac_dir" && ac_dir=.
3809   $as_executable_p "$ac_dir/$ac_word" || continue
3810 ac_cv_prog_LD="${ac_tool_prefix}ld"
3811 echo "$as_me:3811: found $ac_dir/$ac_word" >&5
3812 break
3813 done
3814
3815 fi
3816 fi
3817 LD=$ac_cv_prog_LD
3818 if test -n "$LD"; then
3819   echo "$as_me:3819: result: $LD" >&5
3820 echo "${ECHO_T}$LD" >&6
3821 else
3822   echo "$as_me:3822: result: no" >&5
3823 echo "${ECHO_T}no" >&6
3824 fi
3825
3826 fi
3827 if test -z "$ac_cv_prog_LD"; then
3828   ac_ct_LD=$LD
3829   # Extract the first word of "ld", so it can be a program name with args.
3830 set dummy ld; ac_word=$2
3831 echo "$as_me:3831: checking for $ac_word" >&5
3832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3833 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3834   echo $ECHO_N "(cached) $ECHO_C" >&6
3835 else
3836   if test -n "$ac_ct_LD"; then
3837   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3838 else
3839   ac_save_IFS=$IFS; IFS=$ac_path_separator
3840 ac_dummy="$PATH"
3841 for ac_dir in $ac_dummy; do
3842   IFS=$ac_save_IFS
3843   test -z "$ac_dir" && ac_dir=.
3844   $as_executable_p "$ac_dir/$ac_word" || continue
3845 ac_cv_prog_ac_ct_LD="ld"
3846 echo "$as_me:3846: found $ac_dir/$ac_word" >&5
3847 break
3848 done
3849
3850   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3851 fi
3852 fi
3853 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3854 if test -n "$ac_ct_LD"; then
3855   echo "$as_me:3855: result: $ac_ct_LD" >&5
3856 echo "${ECHO_T}$ac_ct_LD" >&6
3857 else
3858   echo "$as_me:3858: result: no" >&5
3859 echo "${ECHO_T}no" >&6
3860 fi
3861
3862   LD=$ac_ct_LD
3863 else
3864   LD="$ac_cv_prog_LD"
3865 fi
3866
3867 if test -n "$ac_tool_prefix"; then
3868   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3869 set dummy ${ac_tool_prefix}ar; ac_word=$2
3870 echo "$as_me:3870: checking for $ac_word" >&5
3871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3872 if test "${ac_cv_prog_AR+set}" = set; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   if test -n "$AR"; then
3876   ac_cv_prog_AR="$AR" # Let the user override the test.
3877 else
3878   ac_save_IFS=$IFS; IFS=$ac_path_separator
3879 ac_dummy="$PATH"
3880 for ac_dir in $ac_dummy; do
3881   IFS=$ac_save_IFS
3882   test -z "$ac_dir" && ac_dir=.
3883   $as_executable_p "$ac_dir/$ac_word" || continue
3884 ac_cv_prog_AR="${ac_tool_prefix}ar"
3885 echo "$as_me:3885: found $ac_dir/$ac_word" >&5
3886 break
3887 done
3888
3889 fi
3890 fi
3891 AR=$ac_cv_prog_AR
3892 if test -n "$AR"; then
3893   echo "$as_me:3893: result: $AR" >&5
3894 echo "${ECHO_T}$AR" >&6
3895 else
3896   echo "$as_me:3896: result: no" >&5
3897 echo "${ECHO_T}no" >&6
3898 fi
3899
3900 fi
3901 if test -z "$ac_cv_prog_AR"; then
3902   ac_ct_AR=$AR
3903   # Extract the first word of "ar", so it can be a program name with args.
3904 set dummy ar; ac_word=$2
3905 echo "$as_me:3905: checking for $ac_word" >&5
3906 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3907 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3908   echo $ECHO_N "(cached) $ECHO_C" >&6
3909 else
3910   if test -n "$ac_ct_AR"; then
3911   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3912 else
3913   ac_save_IFS=$IFS; IFS=$ac_path_separator
3914 ac_dummy="$PATH"
3915 for ac_dir in $ac_dummy; do
3916   IFS=$ac_save_IFS
3917   test -z "$ac_dir" && ac_dir=.
3918   $as_executable_p "$ac_dir/$ac_word" || continue
3919 ac_cv_prog_ac_ct_AR="ar"
3920 echo "$as_me:3920: found $ac_dir/$ac_word" >&5
3921 break
3922 done
3923
3924   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3925 fi
3926 fi
3927 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3928 if test -n "$ac_ct_AR"; then
3929   echo "$as_me:3929: result: $ac_ct_AR" >&5
3930 echo "${ECHO_T}$ac_ct_AR" >&6
3931 else
3932   echo "$as_me:3932: result: no" >&5
3933 echo "${ECHO_T}no" >&6
3934 fi
3935
3936   AR=$ac_ct_AR
3937 else
3938   AR="$ac_cv_prog_AR"
3939 fi
3940
3941 if test -n "$ac_tool_prefix"; then
3942   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3943 set dummy ${ac_tool_prefix}ar; ac_word=$2
3944 echo "$as_me:3944: checking for $ac_word" >&5
3945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3946 if test "${ac_cv_prog_AR+set}" = set; then
3947   echo $ECHO_N "(cached) $ECHO_C" >&6
3948 else
3949   if test -n "$AR"; then
3950   ac_cv_prog_AR="$AR" # Let the user override the test.
3951 else
3952   ac_save_IFS=$IFS; IFS=$ac_path_separator
3953 ac_dummy="$PATH"
3954 for ac_dir in $ac_dummy; do
3955   IFS=$ac_save_IFS
3956   test -z "$ac_dir" && ac_dir=.
3957   $as_executable_p "$ac_dir/$ac_word" || continue
3958 ac_cv_prog_AR="${ac_tool_prefix}ar"
3959 echo "$as_me:3959: found $ac_dir/$ac_word" >&5
3960 break
3961 done
3962
3963 fi
3964 fi
3965 AR=$ac_cv_prog_AR
3966 if test -n "$AR"; then
3967   echo "$as_me:3967: result: $AR" >&5
3968 echo "${ECHO_T}$AR" >&6
3969 else
3970   echo "$as_me:3970: result: no" >&5
3971 echo "${ECHO_T}no" >&6
3972 fi
3973
3974 fi
3975 if test -z "$ac_cv_prog_AR"; then
3976   ac_ct_AR=$AR
3977   # Extract the first word of "ar", so it can be a program name with args.
3978 set dummy ar; ac_word=$2
3979 echo "$as_me:3979: checking for $ac_word" >&5
3980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3981 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3982   echo $ECHO_N "(cached) $ECHO_C" >&6
3983 else
3984   if test -n "$ac_ct_AR"; then
3985   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3986 else
3987   ac_save_IFS=$IFS; IFS=$ac_path_separator
3988 ac_dummy="$PATH"
3989 for ac_dir in $ac_dummy; do
3990   IFS=$ac_save_IFS
3991   test -z "$ac_dir" && ac_dir=.
3992   $as_executable_p "$ac_dir/$ac_word" || continue
3993 ac_cv_prog_ac_ct_AR="ar"
3994 echo "$as_me:3994: found $ac_dir/$ac_word" >&5
3995 break
3996 done
3997
3998   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3999 fi
4000 fi
4001 ac_ct_AR=$ac_cv_prog_ac_ct_AR
4002 if test -n "$ac_ct_AR"; then
4003   echo "$as_me:4003: result: $ac_ct_AR" >&5
4004 echo "${ECHO_T}$ac_ct_AR" >&6
4005 else
4006   echo "$as_me:4006: result: no" >&5
4007 echo "${ECHO_T}no" >&6
4008 fi
4009
4010   AR=$ac_ct_AR
4011 else
4012   AR="$ac_cv_prog_AR"
4013 fi
4014
4015 echo "$as_me:4015: checking for options to update archives" >&5
4016 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
4017 if test "${cf_cv_ar_flags+set}" = set; then
4018   echo $ECHO_N "(cached) $ECHO_C" >&6
4019 else
4020
4021         case "$cf_cv_system_name" in
4022         (*-msvc*)
4023                 cf_cv_ar_flags=''
4024                 cat >mk_static_lib.sh <<-EOF
4025                 #!$SHELL
4026                 MSVC_BIN="$AR"
4027                 out="\$1"
4028                 shift
4029                 exec \$MSVC_BIN -out:"\$out" \$@
4030                 EOF
4031                 chmod +x mk_static_lib.sh
4032                 AR=`pwd`/mk_static_lib.sh
4033                 ;;
4034         (*)
4035                 cf_cv_ar_flags=unknown
4036                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
4037                 do
4038
4039                         # check if $ARFLAGS already contains this choice
4040                         if test "x$ARFLAGS" != "x" ; then
4041                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
4042                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
4043                                         cf_cv_ar_flags=
4044                                         break
4045                                 fi
4046                         fi
4047
4048                         rm -f "conftest.$ac_cv_objext"
4049                         rm -f conftest.a
4050
4051                         cat >"conftest.$ac_ext" <<EOF
4052 #line 4052 "configure"
4053 int     testdata[3] = { 123, 456, 789 };
4054 EOF
4055                         if { (eval echo "$as_me:4055: \"$ac_compile\"") >&5
4056   (eval $ac_compile) 2>&5
4057   ac_status=$?
4058   echo "$as_me:4058: \$? = $ac_status" >&5
4059   (exit "$ac_status"); } ; then
4060                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
4061                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4062                                 if test -f conftest.a ; then
4063                                         cf_cv_ar_flags="$cf_ar_flags"
4064                                         break
4065                                 fi
4066                         else
4067                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4068
4069 echo "${as_me:-configure}:4069: testing cannot compile test-program ..." 1>&5
4070
4071                                 break
4072                         fi
4073                 done
4074                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4075                 ;;
4076         esac
4077
4078 fi
4079 echo "$as_me:4079: result: $cf_cv_ar_flags" >&5
4080 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4081
4082 if test -n "$ARFLAGS" ; then
4083         if test -n "$cf_cv_ar_flags" ; then
4084                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4085         fi
4086 else
4087         ARFLAGS=$cf_cv_ar_flags
4088 fi
4089
4090         echo "$as_me:4090: checking for PATH separator" >&5
4091 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4092         case "$cf_cv_system_name" in
4093         (os2*)  PATH_SEPARATOR=';'  ;;
4094         (*)     ${PATH_SEPARATOR:=':'}  ;;
4095         esac
4096
4097         echo "$as_me:4097: result: $PATH_SEPARATOR" >&5
4098 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4099
4100 echo "$as_me:4100: checking if you have specified an install-prefix" >&5
4101 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4102
4103 # Check whether --with-install-prefix or --without-install-prefix was given.
4104 if test "${with_install_prefix+set}" = set; then
4105   withval="$with_install_prefix"
4106   case "$withval" in
4107         (yes|no)
4108                 ;;
4109         (*)     DESTDIR="$withval"
4110                 ;;
4111         esac
4112 fi;
4113 echo "$as_me:4113: result: $DESTDIR" >&5
4114 echo "${ECHO_T}$DESTDIR" >&6
4115
4116 ###############################################################################
4117
4118 # If we're cross-compiling, allow the user to override the tools and their
4119 # options.  The configure script is oriented toward identifying the host
4120 # compiler, etc., but we need a build compiler to generate parts of the source.
4121
4122 if test "$cross_compiling" = yes ; then
4123
4124         # defaults that we might want to override
4125         : ${BUILD_CFLAGS:=''}
4126         : ${BUILD_CPPFLAGS:=''}
4127         : ${BUILD_LDFLAGS:=''}
4128         : ${BUILD_LIBS:=''}
4129         : ${BUILD_EXEEXT:='$x'}
4130         : ${BUILD_OBJEXT:='o'}
4131
4132 # Check whether --with-build-cc or --without-build-cc was given.
4133 if test "${with_build_cc+set}" = set; then
4134   withval="$with_build_cc"
4135   BUILD_CC="$withval"
4136 else
4137   for ac_prog in gcc clang c99 c89 cc cl
4138 do
4139   # Extract the first word of "$ac_prog", so it can be a program name with args.
4140 set dummy $ac_prog; ac_word=$2
4141 echo "$as_me:4141: checking for $ac_word" >&5
4142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4143 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4144   echo $ECHO_N "(cached) $ECHO_C" >&6
4145 else
4146   if test -n "$BUILD_CC"; then
4147   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4148 else
4149   ac_save_IFS=$IFS; IFS=$ac_path_separator
4150 ac_dummy="$PATH"
4151 for ac_dir in $ac_dummy; do
4152   IFS=$ac_save_IFS
4153   test -z "$ac_dir" && ac_dir=.
4154   $as_executable_p "$ac_dir/$ac_word" || continue
4155 ac_cv_prog_BUILD_CC="$ac_prog"
4156 echo "$as_me:4156: found $ac_dir/$ac_word" >&5
4157 break
4158 done
4159
4160 fi
4161 fi
4162 BUILD_CC=$ac_cv_prog_BUILD_CC
4163 if test -n "$BUILD_CC"; then
4164   echo "$as_me:4164: result: $BUILD_CC" >&5
4165 echo "${ECHO_T}$BUILD_CC" >&6
4166 else
4167   echo "$as_me:4167: result: no" >&5
4168 echo "${ECHO_T}no" >&6
4169 fi
4170
4171   test -n "$BUILD_CC" && break
4172 done
4173 test -n "$BUILD_CC" || BUILD_CC="none"
4174
4175 fi;
4176         echo "$as_me:4176: checking for native build C compiler" >&5
4177 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4178         echo "$as_me:4178: result: $BUILD_CC" >&5
4179 echo "${ECHO_T}$BUILD_CC" >&6
4180
4181         echo "$as_me:4181: checking for native build C preprocessor" >&5
4182 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4183
4184 # Check whether --with-build-cpp or --without-build-cpp was given.
4185 if test "${with_build_cpp+set}" = set; then
4186   withval="$with_build_cpp"
4187   BUILD_CPP="$withval"
4188 else
4189   BUILD_CPP='${BUILD_CC} -E'
4190 fi;
4191         echo "$as_me:4191: result: $BUILD_CPP" >&5
4192 echo "${ECHO_T}$BUILD_CPP" >&6
4193
4194         echo "$as_me:4194: checking for native build C flags" >&5
4195 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4196
4197 # Check whether --with-build-cflags or --without-build-cflags was given.
4198 if test "${with_build_cflags+set}" = set; then
4199   withval="$with_build_cflags"
4200   BUILD_CFLAGS="$withval"
4201 fi;
4202         echo "$as_me:4202: result: $BUILD_CFLAGS" >&5
4203 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4204
4205         echo "$as_me:4205: checking for native build C preprocessor-flags" >&5
4206 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4207
4208 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4209 if test "${with_build_cppflags+set}" = set; then
4210   withval="$with_build_cppflags"
4211   BUILD_CPPFLAGS="$withval"
4212 fi;
4213         echo "$as_me:4213: result: $BUILD_CPPFLAGS" >&5
4214 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4215
4216         echo "$as_me:4216: checking for native build linker-flags" >&5
4217 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4218
4219 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4220 if test "${with_build_ldflags+set}" = set; then
4221   withval="$with_build_ldflags"
4222   BUILD_LDFLAGS="$withval"
4223 fi;
4224         echo "$as_me:4224: result: $BUILD_LDFLAGS" >&5
4225 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4226
4227         echo "$as_me:4227: checking for native build linker-libraries" >&5
4228 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4229
4230 # Check whether --with-build-libs or --without-build-libs was given.
4231 if test "${with_build_libs+set}" = set; then
4232   withval="$with_build_libs"
4233   BUILD_LIBS="$withval"
4234 fi;
4235         echo "$as_me:4235: result: $BUILD_LIBS" >&5
4236 echo "${ECHO_T}$BUILD_LIBS" >&6
4237
4238         # this assumes we're on Unix.
4239         BUILD_EXEEXT=
4240         BUILD_OBJEXT=o
4241
4242         : ${BUILD_CC:='${CC}'}
4243
4244         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4245                 { { echo "$as_me:4245: error: Cross-build requires two compilers.
4246 Use --with-build-cc to specify the native compiler." >&5
4247 echo "$as_me: error: Cross-build requires two compilers.
4248 Use --with-build-cc to specify the native compiler." >&2;}
4249    { (exit 1); exit 1; }; }
4250         fi
4251
4252 else
4253         : ${BUILD_CC:='${CC}'}
4254         : ${BUILD_CPP:='${CPP}'}
4255         : ${BUILD_CFLAGS:='${CFLAGS}'}
4256         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4257         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4258         : ${BUILD_LIBS:='${LIBS}'}
4259         : ${BUILD_EXEEXT:='$x'}
4260         : ${BUILD_OBJEXT:='o'}
4261 fi
4262
4263 ###############################################################################
4264
4265 ### Options to allow the user to specify the set of libraries which are used.
4266 ### Use "--without-normal --with-shared" to allow the default model to be
4267 ### shared, for example.
4268 cf_list_models=""
4269
4270 echo "$as_me:4270: checking if you want to build shared C-objects" >&5
4271 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4272
4273 # Check whether --with-shared or --without-shared was given.
4274 if test "${with_shared+set}" = set; then
4275   withval="$with_shared"
4276   with_shared=$withval
4277 else
4278   with_shared=no
4279 fi;
4280 echo "$as_me:4280: result: $with_shared" >&5
4281 echo "${ECHO_T}$with_shared" >&6
4282 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4283
4284 echo "$as_me:4284: checking for specified models" >&5
4285 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4286 test -z "$cf_list_models" && cf_list_models=normal
4287 echo "$as_me:4287: result: $cf_list_models" >&5
4288 echo "${ECHO_T}$cf_list_models" >&6
4289
4290 ### Use the first model as the default, and save its suffix for use in building
4291 ### up test-applications.
4292 echo "$as_me:4292: checking for default model" >&5
4293 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4294 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4295 echo "$as_me:4295: result: $DFT_LWR_MODEL" >&5
4296 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4297
4298 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4299
4300 echo "$as_me:4300: checking for specific curses-directory" >&5
4301 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4302
4303 # Check whether --with-curses-dir or --without-curses-dir was given.
4304 if test "${with_curses_dir+set}" = set; then
4305   withval="$with_curses_dir"
4306   cf_cv_curses_dir=$withval
4307 else
4308   cf_cv_curses_dir=no
4309 fi;
4310 echo "$as_me:4310: result: $cf_cv_curses_dir" >&5
4311 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4312
4313 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4314 then
4315
4316 if test "x$prefix" != xNONE; then
4317         cf_path_syntax="$prefix"
4318 else
4319         cf_path_syntax="$ac_default_prefix"
4320 fi
4321
4322 case ".$withval" in
4323 (.\$\(*\)*|.\'*\'*)
4324         ;;
4325 (..|./*|.\\*)
4326         ;;
4327 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4328         ;;
4329 (.\$\{*prefix\}*|.\$\{*dir\}*)
4330         eval withval="$withval"
4331         case ".$withval" in
4332         (.NONE/*)
4333                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4334                 ;;
4335         esac
4336         ;;
4337 (.no|.NONE/*)
4338         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4339         ;;
4340 (*)
4341         { { echo "$as_me:4341: error: expected a pathname, not \"$withval\"" >&5
4342 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4343    { (exit 1); exit 1; }; }
4344         ;;
4345 esac
4346
4347         if test -d "$cf_cv_curses_dir"
4348         then
4349
4350 if test -n "$cf_cv_curses_dir/include" ; then
4351   for cf_add_incdir in $cf_cv_curses_dir/include
4352   do
4353         while test "$cf_add_incdir" != /usr/include
4354         do
4355           if test -d "$cf_add_incdir"
4356           then
4357                 cf_have_incdir=no
4358                 if test -n "$CFLAGS$CPPFLAGS" ; then
4359                   # a loop is needed to ensure we can add subdirs of existing dirs
4360                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4361                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4362                           cf_have_incdir=yes; break
4363                         fi
4364                   done
4365                 fi
4366
4367                 if test "$cf_have_incdir" = no ; then
4368                   if test "$cf_add_incdir" = /usr/local/include ; then
4369                         if test "$GCC" = yes
4370                         then
4371                           cf_save_CPPFLAGS=$CPPFLAGS
4372
4373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4374         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4375
4376                           cat >"conftest.$ac_ext" <<_ACEOF
4377 #line 4377 "configure"
4378 #include "confdefs.h"
4379 #include <stdio.h>
4380 int
4381 main (void)
4382 {
4383 printf("Hello")
4384   ;
4385   return 0;
4386 }
4387 _ACEOF
4388 rm -f "conftest.$ac_objext"
4389 if { (eval echo "$as_me:4389: \"$ac_compile\"") >&5
4390   (eval $ac_compile) 2>&5
4391   ac_status=$?
4392   echo "$as_me:4392: \$? = $ac_status" >&5
4393   (exit "$ac_status"); } &&
4394          { ac_try='test -s "conftest.$ac_objext"'
4395   { (eval echo "$as_me:4395: \"$ac_try\"") >&5
4396   (eval $ac_try) 2>&5
4397   ac_status=$?
4398   echo "$as_me:4398: \$? = $ac_status" >&5
4399   (exit "$ac_status"); }; }; then
4400   :
4401 else
4402   echo "$as_me: failed program was:" >&5
4403 cat "conftest.$ac_ext" >&5
4404 cf_have_incdir=yes
4405 fi
4406 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4407                           CPPFLAGS=$cf_save_CPPFLAGS
4408                         fi
4409                   fi
4410                 fi
4411
4412                 if test "$cf_have_incdir" = no ; then
4413                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4414
4415 echo "${as_me:-configure}:4415: testing adding $cf_add_incdir to include-path ..." 1>&5
4416
4417                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4418
4419                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4420                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4421                   cf_add_incdir="$cf_top_incdir"
4422                 else
4423                   break
4424                 fi
4425           else
4426                 break
4427           fi
4428         done
4429   done
4430 fi
4431
4432 if test -n "$cf_cv_curses_dir/lib" ; then
4433         for cf_add_libdir in $cf_cv_curses_dir/lib
4434         do
4435                 if test "$cf_add_libdir" = /usr/lib ; then
4436                         :
4437                 elif test -d "$cf_add_libdir"
4438                 then
4439                         cf_have_libdir=no
4440                         if test -n "$LDFLAGS$LIBS" ; then
4441                                 # a loop is needed to ensure we can add subdirs of existing dirs
4442                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4443                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4444                                                 cf_have_libdir=yes; break
4445                                         fi
4446                                 done
4447                         fi
4448                         if test "$cf_have_libdir" = no ; then
4449                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4450
4451 echo "${as_me:-configure}:4451: testing adding $cf_add_libdir to library-path ..." 1>&5
4452
4453                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4454                         fi
4455                 fi
4456         done
4457 fi
4458
4459         fi
4460 fi
4461
4462 cf_ncuconfig_root=ncurses
4463 cf_have_ncuconfig=no
4464
4465 if test "x${PKG_CONFIG:=none}" != xnone; then
4466         echo "$as_me:4466: checking pkg-config for $cf_ncuconfig_root" >&5
4467 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4468         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4469                 echo "$as_me:4469: result: yes" >&5
4470 echo "${ECHO_T}yes" >&6
4471
4472                 echo "$as_me:4472: checking if the $cf_ncuconfig_root package files work" >&5
4473 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4474                 cf_have_ncuconfig=unknown
4475
4476                 cf_save_CFLAGS="$CFLAGS"
4477                 cf_save_CPPFLAGS="$CPPFLAGS"
4478                 cf_save_LIBS="$LIBS"
4479
4480                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4481                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4482
4483                 # while -W for passing linker flags is prevalent, it is not "standard".
4484                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4485                 # incompatible _and_ non-standard -W option which gives an error.  Work
4486                 # around that pitfall.
4487                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4488                 (x*c[89]9@@*-W*)
4489
4490 cf_fix_cppflags=no
4491 cf_new_cflags=
4492 cf_new_cppflags=
4493 cf_new_extra_cppflags=
4494
4495 for cf_add_cflags in $cf_pkg_cflags
4496 do
4497 case "$cf_fix_cppflags" in
4498 (no)
4499         case "$cf_add_cflags" in
4500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4501                 case "$cf_add_cflags" in
4502                 (-D*)
4503                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4504
4505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4506                                 && test -z "${cf_tst_cflags}" \
4507                                 && cf_fix_cppflags=yes
4508
4509                         if test "$cf_fix_cppflags" = yes ; then
4510
4511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4513
4514                                 continue
4515                         elif test "${cf_tst_cflags}" = "\"'" ; then
4516
4517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4519
4520                                 continue
4521                         fi
4522                         ;;
4523                 esac
4524                 case "$CPPFLAGS" in
4525                 (*$cf_add_cflags)
4526                         ;;
4527                 (*)
4528                         case "$cf_add_cflags" in
4529                         (-D*)
4530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4531
4532 CPPFLAGS=`echo "$CPPFLAGS" | \
4533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4535
4536                                 ;;
4537                         esac
4538
4539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4541
4542                         ;;
4543                 esac
4544                 ;;
4545         (*)
4546
4547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4549
4550                 ;;
4551         esac
4552         ;;
4553 (yes)
4554
4555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4557
4558         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4559
4560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4561                 && test -z "${cf_tst_cflags}" \
4562                 && cf_fix_cppflags=no
4563         ;;
4564 esac
4565 done
4566
4567 if test -n "$cf_new_cflags" ; then
4568
4569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4570         CFLAGS="${CFLAGS}$cf_new_cflags"
4571
4572 fi
4573
4574 if test -n "$cf_new_cppflags" ; then
4575
4576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4578
4579 fi
4580
4581 if test -n "$cf_new_extra_cppflags" ; then
4582
4583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4585
4586 fi
4587
4588 cf_add_libs="$LIBS"
4589 # reverse order
4590 cf_add_0lib=
4591 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4592 # filter duplicates
4593 for cf_add_1lib in $cf_add_0lib; do
4594         for cf_add_2lib in $cf_add_libs; do
4595                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4596                         cf_add_1lib=
4597                         break
4598                 fi
4599         done
4600         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4601 done
4602 LIBS="$cf_add_libs"
4603
4604                         cat >"conftest.$ac_ext" <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <${cf_cv_ncurses_header:-curses.h}>
4608 int
4609 main (void)
4610 {
4611 initscr(); mousemask(0,0); tigetstr((char *)0);
4612   ;
4613   return 0;
4614 }
4615 _ACEOF
4616 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4617 if { (eval echo "$as_me:4617: \"$ac_link\"") >&5
4618   (eval $ac_link) 2>&5
4619   ac_status=$?
4620   echo "$as_me:4620: \$? = $ac_status" >&5
4621   (exit "$ac_status"); } &&
4622          { ac_try='test -s "conftest$ac_exeext"'
4623   { (eval echo "$as_me:4623: \"$ac_try\"") >&5
4624   (eval $ac_try) 2>&5
4625   ac_status=$?
4626   echo "$as_me:4626: \$? = $ac_status" >&5
4627   (exit "$ac_status"); }; }; then
4628   if test "$cross_compiling" = yes; then
4629   cf_test_ncuconfig=maybe
4630 else
4631   cat >"conftest.$ac_ext" <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634 #include <${cf_cv_ncurses_header:-curses.h}>
4635                                         int main(void)
4636                                         { const char *xx = curses_version(); return (xx == 0); }
4637 _ACEOF
4638 rm -f "conftest$ac_exeext"
4639 if { (eval echo "$as_me:4639: \"$ac_link\"") >&5
4640   (eval $ac_link) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit "$ac_status"); }; }; then
4649   cf_test_ncuconfig=yes
4650 else
4651   echo "$as_me: program exited with status $ac_status" >&5
4652 echo "$as_me: failed program was:" >&5
4653 cat "conftest.$ac_ext" >&5
4654 cf_test_ncuconfig=no
4655 fi
4656 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4657 fi
4658 else
4659   echo "$as_me: failed program was:" >&5
4660 cat "conftest.$ac_ext" >&5
4661 cf_test_ncuconfig=no
4662 fi
4663 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4664
4665                         CFLAGS="$cf_save_CFLAGS"
4666                         CPPFLAGS="$cf_save_CPPFLAGS"
4667                         LIBS="$cf_save_LIBS"
4668
4669                         if test "x$cf_test_ncuconfig" != xyes; then
4670                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4671                                 cf_pkg_cflags="$cf_temp"
4672                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4673                                 cf_pkg_libs="$cf_temp"
4674                         fi
4675                         ;;
4676                 esac
4677
4678 for cf_add_cflags in $cf_pkg_cflags
4679 do
4680         case "x$cf_add_cflags" in
4681         (x-[DU]*)
4682
4683 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4684 while true
4685 do
4686         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'`
4687         test "$CFLAGS" != "$cf_old_cflag" || break
4688
4689         CFLAGS="$cf_old_cflag"
4690 done
4691
4692 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
4693 while true
4694 do
4695         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'`
4696         test "$CPPFLAGS" != "$cf_old_cflag" || break
4697
4698         CPPFLAGS="$cf_old_cflag"
4699 done
4700
4701                 ;;
4702         esac
4703
4704 cf_fix_cppflags=no
4705 cf_new_cflags=
4706 cf_new_cppflags=
4707 cf_new_extra_cppflags=
4708
4709 for cf_add_cflags in $cf_add_cflags
4710 do
4711 case "$cf_fix_cppflags" in
4712 (no)
4713         case "$cf_add_cflags" in
4714         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4715                 case "$cf_add_cflags" in
4716                 (-D*)
4717                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4718
4719                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4720                                 && test -z "${cf_tst_cflags}" \
4721                                 && cf_fix_cppflags=yes
4722
4723                         if test "$cf_fix_cppflags" = yes ; then
4724
4725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4727
4728                                 continue
4729                         elif test "${cf_tst_cflags}" = "\"'" ; then
4730
4731         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4732         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4733
4734                                 continue
4735                         fi
4736                         ;;
4737                 esac
4738                 case "$CPPFLAGS" in
4739                 (*$cf_add_cflags)
4740                         ;;
4741                 (*)
4742                         case "$cf_add_cflags" in
4743                         (-D*)
4744                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4745
4746 CPPFLAGS=`echo "$CPPFLAGS" | \
4747         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4748                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4749
4750                                 ;;
4751                         esac
4752
4753         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4754         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4755
4756                         ;;
4757                 esac
4758                 ;;
4759         (*)
4760
4761         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4762         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4763
4764                 ;;
4765         esac
4766         ;;
4767 (yes)
4768
4769         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4770         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4771
4772         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4773
4774         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4775                 && test -z "${cf_tst_cflags}" \
4776                 && cf_fix_cppflags=no
4777         ;;
4778 esac
4779 done
4780
4781 if test -n "$cf_new_cflags" ; then
4782
4783         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4784         CFLAGS="${CFLAGS}$cf_new_cflags"
4785
4786 fi
4787
4788 if test -n "$cf_new_cppflags" ; then
4789
4790         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4791         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4792
4793 fi
4794
4795 if test -n "$cf_new_extra_cppflags" ; then
4796
4797         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4798         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4799
4800 fi
4801
4802 done
4803
4804 cf_add_libs="$LIBS"
4805 # reverse order
4806 cf_add_0lib=
4807 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4808 # filter duplicates
4809 for cf_add_1lib in $cf_add_0lib; do
4810         for cf_add_2lib in $cf_add_libs; do
4811                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4812                         cf_add_1lib=
4813                         break
4814                 fi
4815         done
4816         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4817 done
4818 LIBS="$cf_add_libs"
4819
4820                 cat >"conftest.$ac_ext" <<_ACEOF
4821 #line 4821 "configure"
4822 #include "confdefs.h"
4823 #include <${cf_cv_ncurses_header:-curses.h}>
4824 int
4825 main (void)
4826 {
4827 initscr(); mousemask(0,0); tigetstr((char *)0);
4828   ;
4829   return 0;
4830 }
4831 _ACEOF
4832 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4833 if { (eval echo "$as_me:4833: \"$ac_link\"") >&5
4834   (eval $ac_link) 2>&5
4835   ac_status=$?
4836   echo "$as_me:4836: \$? = $ac_status" >&5
4837   (exit "$ac_status"); } &&
4838          { ac_try='test -s "conftest$ac_exeext"'
4839   { (eval echo "$as_me:4839: \"$ac_try\"") >&5
4840   (eval $ac_try) 2>&5
4841   ac_status=$?
4842   echo "$as_me:4842: \$? = $ac_status" >&5
4843   (exit "$ac_status"); }; }; then
4844   if test "$cross_compiling" = yes; then
4845   cf_have_ncuconfig=maybe
4846 else
4847   cat >"conftest.$ac_ext" <<_ACEOF
4848 #line 4848 "configure"
4849 #include "confdefs.h"
4850 #include <${cf_cv_ncurses_header:-curses.h}>
4851                                 int main(void)
4852                                 { const char *xx = curses_version(); return (xx == 0); }
4853 _ACEOF
4854 rm -f "conftest$ac_exeext"
4855 if { (eval echo "$as_me:4855: \"$ac_link\"") >&5
4856   (eval $ac_link) 2>&5
4857   ac_status=$?
4858   echo "$as_me:4858: \$? = $ac_status" >&5
4859   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4860   { (eval echo "$as_me:4860: \"$ac_try\"") >&5
4861   (eval $ac_try) 2>&5
4862   ac_status=$?
4863   echo "$as_me:4863: \$? = $ac_status" >&5
4864   (exit "$ac_status"); }; }; then
4865   cf_have_ncuconfig=yes
4866 else
4867   echo "$as_me: program exited with status $ac_status" >&5
4868 echo "$as_me: failed program was:" >&5
4869 cat "conftest.$ac_ext" >&5
4870 cf_have_ncuconfig=no
4871 fi
4872 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4873 fi
4874 else
4875   echo "$as_me: failed program was:" >&5
4876 cat "conftest.$ac_ext" >&5
4877 cf_have_ncuconfig=no
4878 fi
4879 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4880                 echo "$as_me:4880: result: $cf_have_ncuconfig" >&5
4881 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4882                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4883                 if test "$cf_have_ncuconfig" != "yes"
4884                 then
4885                         CPPFLAGS="$cf_save_CPPFLAGS"
4886                         LIBS="$cf_save_LIBS"
4887                         NCURSES_CONFIG_PKG=none
4888                 else
4889
4890 cat >>confdefs.h <<\EOF
4891 #define NCURSES 1
4892 EOF
4893
4894                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4895
4896 echo "$as_me:4896: checking for terminfo header" >&5
4897 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4898 if test "${cf_cv_term_header+set}" = set; then
4899   echo $ECHO_N "(cached) $ECHO_C" >&6
4900 else
4901
4902 case "${cf_cv_ncurses_header}" in
4903 (*/ncurses.h|*/ncursesw.h)
4904         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4905         ;;
4906 (*)
4907         cf_term_header=term.h
4908         ;;
4909 esac
4910
4911 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4912 do
4913 cat >"conftest.$ac_ext" <<_ACEOF
4914 #line 4914 "configure"
4915 #include "confdefs.h"
4916 #include <stdio.h>
4917 #include <${cf_cv_ncurses_header:-curses.h}>
4918 #include <$cf_test>
4919
4920 int
4921 main (void)
4922 {
4923 int x = auto_left_margin; (void)x
4924   ;
4925   return 0;
4926 }
4927 _ACEOF
4928 rm -f "conftest.$ac_objext"
4929 if { (eval echo "$as_me:4929: \"$ac_compile\"") >&5
4930   (eval $ac_compile) 2>&5
4931   ac_status=$?
4932   echo "$as_me:4932: \$? = $ac_status" >&5
4933   (exit "$ac_status"); } &&
4934          { ac_try='test -s "conftest.$ac_objext"'
4935   { (eval echo "$as_me:4935: \"$ac_try\"") >&5
4936   (eval $ac_try) 2>&5
4937   ac_status=$?
4938   echo "$as_me:4938: \$? = $ac_status" >&5
4939   (exit "$ac_status"); }; }; then
4940
4941         cf_cv_term_header="$cf_test"
4942 else
4943   echo "$as_me: failed program was:" >&5
4944 cat "conftest.$ac_ext" >&5
4945
4946         cf_cv_term_header=unknown
4947
4948 fi
4949 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4950         test "$cf_cv_term_header" != unknown && break
4951 done
4952
4953 fi
4954 echo "$as_me:4954: result: $cf_cv_term_header" >&5
4955 echo "${ECHO_T}$cf_cv_term_header" >&6
4956
4957 # Set definitions to allow ifdef'ing to accommodate subdirectories
4958
4959 case "$cf_cv_term_header" in
4960 (*term.h)
4961
4962 cat >>confdefs.h <<\EOF
4963 #define HAVE_TERM_H 1
4964 EOF
4965
4966         ;;
4967 esac
4968
4969 case "$cf_cv_term_header" in
4970 (ncurses/term.h)
4971
4972 cat >>confdefs.h <<\EOF
4973 #define HAVE_NCURSES_TERM_H 1
4974 EOF
4975
4976         ;;
4977 (ncursesw/term.h)
4978
4979 cat >>confdefs.h <<\EOF
4980 #define HAVE_NCURSESW_TERM_H 1
4981 EOF
4982
4983         ;;
4984 esac
4985
4986                 fi
4987
4988         else
4989                 echo "$as_me:4989: result: no" >&5
4990 echo "${ECHO_T}no" >&6
4991                 NCURSES_CONFIG_PKG=none
4992         fi
4993 else
4994         NCURSES_CONFIG_PKG=none
4995 fi
4996
4997 if test "x$cf_have_ncuconfig" = "xno"; then
4998         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4999
5000 if test -n "$ac_tool_prefix"; then
5001   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5002   do
5003     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5004 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5005 echo "$as_me:5005: checking for $ac_word" >&5
5006 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5007 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5008   echo $ECHO_N "(cached) $ECHO_C" >&6
5009 else
5010   if test -n "$NCURSES_CONFIG"; then
5011   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5012 else
5013   ac_save_IFS=$IFS; IFS=$ac_path_separator
5014 ac_dummy="$PATH"
5015 for ac_dir in $ac_dummy; do
5016   IFS=$ac_save_IFS
5017   test -z "$ac_dir" && ac_dir=.
5018   $as_executable_p "$ac_dir/$ac_word" || continue
5019 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5020 echo "$as_me:5020: found $ac_dir/$ac_word" >&5
5021 break
5022 done
5023
5024 fi
5025 fi
5026 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5027 if test -n "$NCURSES_CONFIG"; then
5028   echo "$as_me:5028: result: $NCURSES_CONFIG" >&5
5029 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5030 else
5031   echo "$as_me:5031: result: no" >&5
5032 echo "${ECHO_T}no" >&6
5033 fi
5034
5035     test -n "$NCURSES_CONFIG" && break
5036   done
5037 fi
5038 if test -z "$NCURSES_CONFIG"; then
5039   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5040   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5041 do
5042   # Extract the first word of "$ac_prog", so it can be a program name with args.
5043 set dummy $ac_prog; ac_word=$2
5044 echo "$as_me:5044: checking for $ac_word" >&5
5045 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5046 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5047   echo $ECHO_N "(cached) $ECHO_C" >&6
5048 else
5049   if test -n "$ac_ct_NCURSES_CONFIG"; then
5050   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5051 else
5052   ac_save_IFS=$IFS; IFS=$ac_path_separator
5053 ac_dummy="$PATH"
5054 for ac_dir in $ac_dummy; do
5055   IFS=$ac_save_IFS
5056   test -z "$ac_dir" && ac_dir=.
5057   $as_executable_p "$ac_dir/$ac_word" || continue
5058 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5059 echo "$as_me:5059: found $ac_dir/$ac_word" >&5
5060 break
5061 done
5062
5063 fi
5064 fi
5065 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5066 if test -n "$ac_ct_NCURSES_CONFIG"; then
5067   echo "$as_me:5067: result: $ac_ct_NCURSES_CONFIG" >&5
5068 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5069 else
5070   echo "$as_me:5070: result: no" >&5
5071 echo "${ECHO_T}no" >&6
5072 fi
5073
5074   test -n "$ac_ct_NCURSES_CONFIG" && break
5075 done
5076 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5077
5078   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5079 fi
5080
5081         if test "$NCURSES_CONFIG" != none ; then
5082
5083 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
5084 do
5085         case "x$cf_add_cflags" in
5086         (x-[DU]*)
5087
5088 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5089 while true
5090 do
5091         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'`
5092         test "$CFLAGS" != "$cf_old_cflag" || break
5093
5094         CFLAGS="$cf_old_cflag"
5095 done
5096
5097 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
5098 while true
5099 do
5100         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'`
5101         test "$CPPFLAGS" != "$cf_old_cflag" || break
5102
5103         CPPFLAGS="$cf_old_cflag"
5104 done
5105
5106                 ;;
5107         esac
5108
5109 cf_fix_cppflags=no
5110 cf_new_cflags=
5111 cf_new_cppflags=
5112 cf_new_extra_cppflags=
5113
5114 for cf_add_cflags in $cf_add_cflags
5115 do
5116 case "$cf_fix_cppflags" in
5117 (no)
5118         case "$cf_add_cflags" in
5119         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5120                 case "$cf_add_cflags" in
5121                 (-D*)
5122                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5123
5124                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5125                                 && test -z "${cf_tst_cflags}" \
5126                                 && cf_fix_cppflags=yes
5127
5128                         if test "$cf_fix_cppflags" = yes ; then
5129
5130         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5131         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5132
5133                                 continue
5134                         elif test "${cf_tst_cflags}" = "\"'" ; then
5135
5136         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5137         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5138
5139                                 continue
5140                         fi
5141                         ;;
5142                 esac
5143                 case "$CPPFLAGS" in
5144                 (*$cf_add_cflags)
5145                         ;;
5146                 (*)
5147                         case "$cf_add_cflags" in
5148                         (-D*)
5149                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5150
5151 CPPFLAGS=`echo "$CPPFLAGS" | \
5152         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5153                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5154
5155                                 ;;
5156                         esac
5157
5158         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5159         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5160
5161                         ;;
5162                 esac
5163                 ;;
5164         (*)
5165
5166         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5167         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5168
5169                 ;;
5170         esac
5171         ;;
5172 (yes)
5173
5174         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5175         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5176
5177         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5178
5179         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5180                 && test -z "${cf_tst_cflags}" \
5181                 && cf_fix_cppflags=no
5182         ;;
5183 esac
5184 done
5185
5186 if test -n "$cf_new_cflags" ; then
5187
5188         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5189         CFLAGS="${CFLAGS}$cf_new_cflags"
5190
5191 fi
5192
5193 if test -n "$cf_new_cppflags" ; then
5194
5195         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5196         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5197
5198 fi
5199
5200 if test -n "$cf_new_extra_cppflags" ; then
5201
5202         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5203         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5204
5205 fi
5206
5207 done
5208
5209 cf_add_libs="$LIBS"
5210 # reverse order
5211 cf_add_0lib=
5212 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5213 # filter duplicates
5214 for cf_add_1lib in $cf_add_0lib; do
5215         for cf_add_2lib in $cf_add_libs; do
5216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5217                         cf_add_1lib=
5218                         break
5219                 fi
5220         done
5221         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5222 done
5223 LIBS="$cf_add_libs"
5224
5225                 # even with config script, some packages use no-override for curses.h
5226
5227 echo "$as_me:5227: checking if we have identified curses headers" >&5
5228 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5229 if test "${cf_cv_ncurses_header+set}" = set; then
5230   echo $ECHO_N "(cached) $ECHO_C" >&6
5231 else
5232
5233 cf_cv_ncurses_header=none
5234 for cf_header in \
5235         ncurses.h ncurses/ncurses.h \
5236         curses.h ncurses/curses.h
5237 do
5238 cat >"conftest.$ac_ext" <<_ACEOF
5239 #line 5239 "configure"
5240 #include "confdefs.h"
5241 #include <${cf_header}>
5242 int
5243 main (void)
5244 {
5245 initscr(); tgoto("?", 0,0)
5246   ;
5247   return 0;
5248 }
5249 _ACEOF
5250 rm -f "conftest.$ac_objext"
5251 if { (eval echo "$as_me:5251: \"$ac_compile\"") >&5
5252   (eval $ac_compile) 2>&5
5253   ac_status=$?
5254   echo "$as_me:5254: \$? = $ac_status" >&5
5255   (exit "$ac_status"); } &&
5256          { ac_try='test -s "conftest.$ac_objext"'
5257   { (eval echo "$as_me:5257: \"$ac_try\"") >&5
5258   (eval $ac_try) 2>&5
5259   ac_status=$?
5260   echo "$as_me:5260: \$? = $ac_status" >&5
5261   (exit "$ac_status"); }; }; then
5262   cf_cv_ncurses_header=$cf_header; break
5263 else
5264   echo "$as_me: failed program was:" >&5
5265 cat "conftest.$ac_ext" >&5
5266 fi
5267 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5268 done
5269
5270 fi
5271 echo "$as_me:5271: result: $cf_cv_ncurses_header" >&5
5272 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5273
5274 if test "$cf_cv_ncurses_header" = none ; then
5275         { { echo "$as_me:5275: error: No curses header-files found" >&5
5276 echo "$as_me: error: No curses header-files found" >&2;}
5277    { (exit 1); exit 1; }; }
5278 fi
5279
5280 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5281
5282 for ac_header in $cf_cv_ncurses_header
5283 do
5284 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5285 echo "$as_me:5285: checking for $ac_header" >&5
5286 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5287 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5288   echo $ECHO_N "(cached) $ECHO_C" >&6
5289 else
5290   cat >"conftest.$ac_ext" <<_ACEOF
5291 #line 5291 "configure"
5292 #include "confdefs.h"
5293 #include <$ac_header>
5294 _ACEOF
5295 if { (eval echo "$as_me:5295: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5296   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5297   ac_status=$?
5298   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5299   rm -f conftest.er1
5300   cat conftest.err >&5
5301   echo "$as_me:5301: \$? = $ac_status" >&5
5302   (exit "$ac_status"); } >/dev/null; then
5303   if test -s conftest.err; then
5304     ac_cpp_err=$ac_c_preproc_warn_flag
5305   else
5306     ac_cpp_err=
5307   fi
5308 else
5309   ac_cpp_err=yes
5310 fi
5311 if test -z "$ac_cpp_err"; then
5312   eval "$as_ac_Header=yes"
5313 else
5314   echo "$as_me: failed program was:" >&5
5315   cat "conftest.$ac_ext" >&5
5316   eval "$as_ac_Header=no"
5317 fi
5318 rm -f conftest.err "conftest.$ac_ext"
5319 fi
5320 echo "$as_me:5320: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5321 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5322 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5323   cat >>confdefs.h <<EOF
5324 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5325 EOF
5326
5327 fi
5328 done
5329
5330 cat >>confdefs.h <<\EOF
5331 #define NCURSES 1
5332 EOF
5333
5334 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5335
5336                 cat >>confdefs.h <<EOF
5337 #define $cf_nculib_ROOT 1
5338 EOF
5339
5340                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5341
5342         else
5343
5344 cf_ncuhdr_root=ncurses
5345
5346 test -n "$cf_cv_curses_dir" && \
5347 test "$cf_cv_curses_dir" != "no" && { \
5348
5349 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5350   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5351   do
5352         while test "$cf_add_incdir" != /usr/include
5353         do
5354           if test -d "$cf_add_incdir"
5355           then
5356                 cf_have_incdir=no
5357                 if test -n "$CFLAGS$CPPFLAGS" ; then
5358                   # a loop is needed to ensure we can add subdirs of existing dirs
5359                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5360                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5361                           cf_have_incdir=yes; break
5362                         fi
5363                   done
5364                 fi
5365
5366                 if test "$cf_have_incdir" = no ; then
5367                   if test "$cf_add_incdir" = /usr/local/include ; then
5368                         if test "$GCC" = yes
5369                         then
5370                           cf_save_CPPFLAGS=$CPPFLAGS
5371
5372         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5373         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5374
5375                           cat >"conftest.$ac_ext" <<_ACEOF
5376 #line 5376 "configure"
5377 #include "confdefs.h"
5378 #include <stdio.h>
5379 int
5380 main (void)
5381 {
5382 printf("Hello")
5383   ;
5384   return 0;
5385 }
5386 _ACEOF
5387 rm -f "conftest.$ac_objext"
5388 if { (eval echo "$as_me:5388: \"$ac_compile\"") >&5
5389   (eval $ac_compile) 2>&5
5390   ac_status=$?
5391   echo "$as_me:5391: \$? = $ac_status" >&5
5392   (exit "$ac_status"); } &&
5393          { ac_try='test -s "conftest.$ac_objext"'
5394   { (eval echo "$as_me:5394: \"$ac_try\"") >&5
5395   (eval $ac_try) 2>&5
5396   ac_status=$?
5397   echo "$as_me:5397: \$? = $ac_status" >&5
5398   (exit "$ac_status"); }; }; then
5399   :
5400 else
5401   echo "$as_me: failed program was:" >&5
5402 cat "conftest.$ac_ext" >&5
5403 cf_have_incdir=yes
5404 fi
5405 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5406                           CPPFLAGS=$cf_save_CPPFLAGS
5407                         fi
5408                   fi
5409                 fi
5410
5411                 if test "$cf_have_incdir" = no ; then
5412                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5413
5414 echo "${as_me:-configure}:5414: testing adding $cf_add_incdir to include-path ..." 1>&5
5415
5416                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5417
5418                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5419                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5420                   cf_add_incdir="$cf_top_incdir"
5421                 else
5422                   break
5423                 fi
5424           else
5425                 break
5426           fi
5427         done
5428   done
5429 fi
5430
5431 }
5432
5433 echo "$as_me:5433: checking for $cf_ncuhdr_root header in include-path" >&5
5434 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5435 if test "${cf_cv_ncurses_h+set}" = set; then
5436   echo $ECHO_N "(cached) $ECHO_C" >&6
5437 else
5438
5439         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5440         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5441         for cf_header in $cf_header_list
5442         do
5443
5444         cat >"conftest.$ac_ext" <<_ACEOF
5445 #line 5445 "configure"
5446 #include "confdefs.h"
5447
5448 #include <$cf_header>
5449 int
5450 main (void)
5451 {
5452
5453 #ifdef NCURSES_VERSION
5454
5455 printf("%s\\n", NCURSES_VERSION);
5456 #else
5457 #ifdef __NCURSES_H
5458 printf("old\\n");
5459 #else
5460         make an error
5461 #endif
5462 #endif
5463
5464   ;
5465   return 0;
5466 }
5467 _ACEOF
5468 rm -f "conftest.$ac_objext"
5469 if { (eval echo "$as_me:5469: \"$ac_compile\"") >&5
5470   (eval $ac_compile) 2>&5
5471   ac_status=$?
5472   echo "$as_me:5472: \$? = $ac_status" >&5
5473   (exit "$ac_status"); } &&
5474          { ac_try='test -s "conftest.$ac_objext"'
5475   { (eval echo "$as_me:5475: \"$ac_try\"") >&5
5476   (eval $ac_try) 2>&5
5477   ac_status=$?
5478   echo "$as_me:5478: \$? = $ac_status" >&5
5479   (exit "$ac_status"); }; }; then
5480   cf_cv_ncurses_h=$cf_header
5481
5482 else
5483   echo "$as_me: failed program was:" >&5
5484 cat "conftest.$ac_ext" >&5
5485 cf_cv_ncurses_h=no
5486 fi
5487 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5488
5489                 test "$cf_cv_ncurses_h" != no && break
5490         done
5491
5492 fi
5493 echo "$as_me:5493: result: $cf_cv_ncurses_h" >&5
5494 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5495
5496 if test "$cf_cv_ncurses_h" != no ; then
5497         cf_cv_ncurses_header=$cf_cv_ncurses_h
5498 else
5499
5500 echo "$as_me:5500: checking for $cf_ncuhdr_root include-path" >&5
5501 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5502 if test "${cf_cv_ncurses_h2+set}" = set; then
5503   echo $ECHO_N "(cached) $ECHO_C" >&6
5504 else
5505
5506         test -n "$verbose" && echo
5507
5508 cf_search=
5509
5510 # collect the current set of include-directories from compiler flags
5511 cf_header_path_list=""
5512 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5513         for cf_header_path in $CPPFLAGS $CFLAGS
5514         do
5515                 case "$cf_header_path" in
5516                 (-I*)
5517                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5518
5519 test "x$cf_header_path" != "xNONE" && \
5520 test -d "$cf_header_path" && \
5521  {
5522         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5523         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5524         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5525         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5526         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5527         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"
5528 }
5529
5530                         cf_header_path_list="$cf_header_path_list $cf_search"
5531                         ;;
5532                 esac
5533         done
5534 fi
5535
5536 # add the variations for the package we are looking for
5537
5538 cf_search=
5539
5540 test "x$prefix" != "xNONE" && \
5541 test -d "$prefix" && \
5542  {
5543         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5544         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5545         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5546         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5547         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5548         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5549 }
5550
5551 for cf_subdir_prefix in \
5552         /usr \
5553         /usr/local \
5554         /usr/pkg \
5555         /opt \
5556         /opt/local \
5557         $HOME
5558 do
5559
5560 test "x$cf_subdir_prefix" != "x$prefix" && \
5561 test -d "$cf_subdir_prefix" && \
5562 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5563         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5564         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5565         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5566         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5567         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5568         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"
5569 }
5570
5571 done
5572
5573 test "$includedir" != NONE && \
5574 test "$includedir" != "/usr/include" && \
5575 test -d "$includedir" && {
5576         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5577         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5578 }
5579
5580 test "$oldincludedir" != NONE && \
5581 test "$oldincludedir" != "/usr/include" && \
5582 test -d "$oldincludedir" && {
5583         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5584         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5585 }
5586
5587 cf_search="$cf_search $cf_header_path_list"
5588
5589         test -n "$verbose" && echo "search path $cf_search"
5590         cf_save2_CPPFLAGS="$CPPFLAGS"
5591         for cf_incdir in $cf_search
5592         do
5593
5594 if test -n "$cf_incdir" ; then
5595   for cf_add_incdir in $cf_incdir
5596   do
5597         while test "$cf_add_incdir" != /usr/include
5598         do
5599           if test -d "$cf_add_incdir"
5600           then
5601                 cf_have_incdir=no
5602                 if test -n "$CFLAGS$CPPFLAGS" ; then
5603                   # a loop is needed to ensure we can add subdirs of existing dirs
5604                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5605                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5606                           cf_have_incdir=yes; break
5607                         fi
5608                   done
5609                 fi
5610
5611                 if test "$cf_have_incdir" = no ; then
5612                   if test "$cf_add_incdir" = /usr/local/include ; then
5613                         if test "$GCC" = yes
5614                         then
5615                           cf_save_CPPFLAGS=$CPPFLAGS
5616
5617         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5618         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5619
5620                           cat >"conftest.$ac_ext" <<_ACEOF
5621 #line 5621 "configure"
5622 #include "confdefs.h"
5623 #include <stdio.h>
5624 int
5625 main (void)
5626 {
5627 printf("Hello")
5628   ;
5629   return 0;
5630 }
5631 _ACEOF
5632 rm -f "conftest.$ac_objext"
5633 if { (eval echo "$as_me:5633: \"$ac_compile\"") >&5
5634   (eval $ac_compile) 2>&5
5635   ac_status=$?
5636   echo "$as_me:5636: \$? = $ac_status" >&5
5637   (exit "$ac_status"); } &&
5638          { ac_try='test -s "conftest.$ac_objext"'
5639   { (eval echo "$as_me:5639: \"$ac_try\"") >&5
5640   (eval $ac_try) 2>&5
5641   ac_status=$?
5642   echo "$as_me:5642: \$? = $ac_status" >&5
5643   (exit "$ac_status"); }; }; then
5644   :
5645 else
5646   echo "$as_me: failed program was:" >&5
5647 cat "conftest.$ac_ext" >&5
5648 cf_have_incdir=yes
5649 fi
5650 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5651                           CPPFLAGS=$cf_save_CPPFLAGS
5652                         fi
5653                   fi
5654                 fi
5655
5656                 if test "$cf_have_incdir" = no ; then
5657                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5658
5659 echo "${as_me:-configure}:5659: testing adding $cf_add_incdir to include-path ..." 1>&5
5660
5661                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5662
5663                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5664                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5665                   cf_add_incdir="$cf_top_incdir"
5666                 else
5667                   break
5668                 fi
5669           else
5670                 break
5671           fi
5672         done
5673   done
5674 fi
5675
5676                 for cf_header in \
5677                         ncurses.h \
5678                         curses.h
5679                 do
5680
5681         cat >"conftest.$ac_ext" <<_ACEOF
5682 #line 5682 "configure"
5683 #include "confdefs.h"
5684
5685 #include <$cf_header>
5686 int
5687 main (void)
5688 {
5689
5690 #ifdef NCURSES_VERSION
5691
5692 printf("%s\\n", NCURSES_VERSION);
5693 #else
5694 #ifdef __NCURSES_H
5695 printf("old\\n");
5696 #else
5697         make an error
5698 #endif
5699 #endif
5700
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f "conftest.$ac_objext"
5706 if { (eval echo "$as_me:5706: \"$ac_compile\"") >&5
5707   (eval $ac_compile) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit "$ac_status"); } &&
5711          { ac_try='test -s "conftest.$ac_objext"'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit "$ac_status"); }; }; then
5717   cf_cv_ncurses_h2=$cf_header
5718
5719 else
5720   echo "$as_me: failed program was:" >&5
5721 cat "conftest.$ac_ext" >&5
5722 cf_cv_ncurses_h2=no
5723 fi
5724 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5725
5726                         if test "$cf_cv_ncurses_h2" != no ; then
5727                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5728                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5729                                 break
5730                         fi
5731                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5732                 done
5733                 CPPFLAGS="$cf_save2_CPPFLAGS"
5734                 test "$cf_cv_ncurses_h2" != no && break
5735         done
5736         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5736: error: not found" >&5
5737 echo "$as_me: error: not found" >&2;}
5738    { (exit 1); exit 1; }; }
5739
5740 fi
5741 echo "$as_me:5741: result: $cf_cv_ncurses_h2" >&5
5742 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5743
5744         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5745         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5746         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5747                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5748         fi
5749
5750 if test -n "$cf_1st_incdir" ; then
5751   for cf_add_incdir in $cf_1st_incdir
5752   do
5753         while test "$cf_add_incdir" != /usr/include
5754         do
5755           if test -d "$cf_add_incdir"
5756           then
5757                 cf_have_incdir=no
5758                 if test -n "$CFLAGS$CPPFLAGS" ; then
5759                   # a loop is needed to ensure we can add subdirs of existing dirs
5760                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5761                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5762                           cf_have_incdir=yes; break
5763                         fi
5764                   done
5765                 fi
5766
5767                 if test "$cf_have_incdir" = no ; then
5768                   if test "$cf_add_incdir" = /usr/local/include ; then
5769                         if test "$GCC" = yes
5770                         then
5771                           cf_save_CPPFLAGS=$CPPFLAGS
5772
5773         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5774         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5775
5776                           cat >"conftest.$ac_ext" <<_ACEOF
5777 #line 5777 "configure"
5778 #include "confdefs.h"
5779 #include <stdio.h>
5780 int
5781 main (void)
5782 {
5783 printf("Hello")
5784   ;
5785   return 0;
5786 }
5787 _ACEOF
5788 rm -f "conftest.$ac_objext"
5789 if { (eval echo "$as_me:5789: \"$ac_compile\"") >&5
5790   (eval $ac_compile) 2>&5
5791   ac_status=$?
5792   echo "$as_me:5792: \$? = $ac_status" >&5
5793   (exit "$ac_status"); } &&
5794          { ac_try='test -s "conftest.$ac_objext"'
5795   { (eval echo "$as_me:5795: \"$ac_try\"") >&5
5796   (eval $ac_try) 2>&5
5797   ac_status=$?
5798   echo "$as_me:5798: \$? = $ac_status" >&5
5799   (exit "$ac_status"); }; }; then
5800   :
5801 else
5802   echo "$as_me: failed program was:" >&5
5803 cat "conftest.$ac_ext" >&5
5804 cf_have_incdir=yes
5805 fi
5806 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5807                           CPPFLAGS=$cf_save_CPPFLAGS
5808                         fi
5809                   fi
5810                 fi
5811
5812                 if test "$cf_have_incdir" = no ; then
5813                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5814
5815 echo "${as_me:-configure}:5815: testing adding $cf_add_incdir to include-path ..." 1>&5
5816
5817                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5818
5819                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5820                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5821                   cf_add_incdir="$cf_top_incdir"
5822                 else
5823                   break
5824                 fi
5825           else
5826                 break
5827           fi
5828         done
5829   done
5830 fi
5831
5832 fi
5833
5834 # Set definitions to allow ifdef'ing for ncurses.h
5835
5836 case "$cf_cv_ncurses_header" in
5837 (*ncurses.h)
5838
5839 cat >>confdefs.h <<\EOF
5840 #define HAVE_NCURSES_H 1
5841 EOF
5842
5843         ;;
5844 esac
5845
5846 case "$cf_cv_ncurses_header" in
5847 (ncurses/curses.h|ncurses/ncurses.h)
5848
5849 cat >>confdefs.h <<\EOF
5850 #define HAVE_NCURSES_NCURSES_H 1
5851 EOF
5852
5853         ;;
5854 (ncursesw/curses.h|ncursesw/ncurses.h)
5855
5856 cat >>confdefs.h <<\EOF
5857 #define HAVE_NCURSESW_NCURSES_H 1
5858 EOF
5859
5860         ;;
5861 esac
5862
5863 echo "$as_me:5863: checking for terminfo header" >&5
5864 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5865 if test "${cf_cv_term_header+set}" = set; then
5866   echo $ECHO_N "(cached) $ECHO_C" >&6
5867 else
5868
5869 case "${cf_cv_ncurses_header}" in
5870 (*/ncurses.h|*/ncursesw.h)
5871         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5872         ;;
5873 (*)
5874         cf_term_header=term.h
5875         ;;
5876 esac
5877
5878 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5879 do
5880 cat >"conftest.$ac_ext" <<_ACEOF
5881 #line 5881 "configure"
5882 #include "confdefs.h"
5883 #include <stdio.h>
5884 #include <${cf_cv_ncurses_header:-curses.h}>
5885 #include <$cf_test>
5886
5887 int
5888 main (void)
5889 {
5890 int x = auto_left_margin; (void)x
5891   ;
5892   return 0;
5893 }
5894 _ACEOF
5895 rm -f "conftest.$ac_objext"
5896 if { (eval echo "$as_me:5896: \"$ac_compile\"") >&5
5897   (eval $ac_compile) 2>&5
5898   ac_status=$?
5899   echo "$as_me:5899: \$? = $ac_status" >&5
5900   (exit "$ac_status"); } &&
5901          { ac_try='test -s "conftest.$ac_objext"'
5902   { (eval echo "$as_me:5902: \"$ac_try\"") >&5
5903   (eval $ac_try) 2>&5
5904   ac_status=$?
5905   echo "$as_me:5905: \$? = $ac_status" >&5
5906   (exit "$ac_status"); }; }; then
5907
5908         cf_cv_term_header="$cf_test"
5909 else
5910   echo "$as_me: failed program was:" >&5
5911 cat "conftest.$ac_ext" >&5
5912
5913         cf_cv_term_header=unknown
5914
5915 fi
5916 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5917         test "$cf_cv_term_header" != unknown && break
5918 done
5919
5920 fi
5921 echo "$as_me:5921: result: $cf_cv_term_header" >&5
5922 echo "${ECHO_T}$cf_cv_term_header" >&6
5923
5924 # Set definitions to allow ifdef'ing to accommodate subdirectories
5925
5926 case "$cf_cv_term_header" in
5927 (*term.h)
5928
5929 cat >>confdefs.h <<\EOF
5930 #define HAVE_TERM_H 1
5931 EOF
5932
5933         ;;
5934 esac
5935
5936 case "$cf_cv_term_header" in
5937 (ncurses/term.h)
5938
5939 cat >>confdefs.h <<\EOF
5940 #define HAVE_NCURSES_TERM_H 1
5941 EOF
5942
5943         ;;
5944 (ncursesw/term.h)
5945
5946 cat >>confdefs.h <<\EOF
5947 #define HAVE_NCURSESW_TERM_H 1
5948 EOF
5949
5950         ;;
5951 esac
5952
5953 # some applications need this, but should check for NCURSES_VERSION
5954
5955 cat >>confdefs.h <<\EOF
5956 #define NCURSES 1
5957 EOF
5958
5959 echo "$as_me:5959: checking for ncurses version" >&5
5960 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5961 if test "${cf_cv_ncurses_version+set}" = set; then
5962   echo $ECHO_N "(cached) $ECHO_C" >&6
5963 else
5964
5965         cf_cv_ncurses_version=no
5966         cf_tempfile=out$$
5967         rm -f "$cf_tempfile"
5968         if test "$cross_compiling" = yes; then
5969
5970         # This will not work if the preprocessor splits the line after the
5971         # Autoconf token.  The 'unproto' program does that.
5972         cat > "conftest.$ac_ext" <<EOF
5973 #include <${cf_cv_ncurses_header:-curses.h}>
5974 #undef Autoconf
5975 #ifdef NCURSES_VERSION
5976 Autoconf NCURSES_VERSION
5977 #else
5978 #ifdef __NCURSES_H
5979 Autoconf "old"
5980 #endif
5981 ;
5982 #endif
5983 EOF
5984         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5985         { (eval echo "$as_me:5985: \"$cf_try\"") >&5
5986   (eval $cf_try) 2>&5
5987   ac_status=$?
5988   echo "$as_me:5988: \$? = $ac_status" >&5
5989   (exit "$ac_status"); }
5990         if test -f conftest.out ; then
5991                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5992                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5993                 rm -f conftest.out
5994         fi
5995
5996 else
5997   cat >"conftest.$ac_ext" <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000
6001 #include <${cf_cv_ncurses_header:-curses.h}>
6002 #include <stdio.h>
6003 int main(void)
6004 {
6005         FILE *fp = fopen("$cf_tempfile", "w");
6006 #ifdef NCURSES_VERSION
6007 # ifdef NCURSES_VERSION_PATCH
6008         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6009 # else
6010         fprintf(fp, "%s\\n", NCURSES_VERSION);
6011 # endif
6012 #else
6013 # ifdef __NCURSES_H
6014         fprintf(fp, "old\\n");
6015 # else
6016         make an error
6017 # endif
6018 #endif
6019         ${cf_cv_main_return:-return}(0);
6020 }
6021 _ACEOF
6022 rm -f "conftest$ac_exeext"
6023 if { (eval echo "$as_me:6023: \"$ac_link\"") >&5
6024   (eval $ac_link) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
6028   { (eval echo "$as_me:6028: \"$ac_try\"") >&5
6029   (eval $ac_try) 2>&5
6030   ac_status=$?
6031   echo "$as_me:6031: \$? = $ac_status" >&5
6032   (exit "$ac_status"); }; }; then
6033
6034         cf_cv_ncurses_version=`cat $cf_tempfile`
6035 else
6036   echo "$as_me: program exited with status $ac_status" >&5
6037 echo "$as_me: failed program was:" >&5
6038 cat "conftest.$ac_ext" >&5
6039 fi
6040 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
6041 fi
6042         rm -f "$cf_tempfile"
6043
6044 fi
6045 echo "$as_me:6045: result: $cf_cv_ncurses_version" >&5
6046 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6047 test "$cf_cv_ncurses_version" = no ||
6048 cat >>confdefs.h <<\EOF
6049 #define NCURSES 1
6050 EOF
6051
6052 cf_nculib_root=ncurses
6053         # This works, except for the special case where we find gpm, but
6054         # ncurses is in a nonstandard location via $LIBS, and we really want
6055         # to link gpm.
6056 cf_ncurses_LIBS=""
6057 cf_ncurses_SAVE="$LIBS"
6058 echo "$as_me:6058: checking for Gpm_Open in -lgpm" >&5
6059 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6060 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6061   echo $ECHO_N "(cached) $ECHO_C" >&6
6062 else
6063   ac_check_lib_save_LIBS=$LIBS
6064 LIBS="-lgpm  $LIBS"
6065 cat >"conftest.$ac_ext" <<_ACEOF
6066 #line 6066 "configure"
6067 #include "confdefs.h"
6068
6069 /* Override any gcc2 internal prototype to avoid an error.  */
6070 #ifdef __cplusplus
6071 extern "C"
6072 #endif
6073 /* We use char because int might match the return type of a gcc2
6074    builtin and then its argument prototype would still apply.  */
6075 char Gpm_Open ();
6076 int
6077 main (void)
6078 {
6079 Gpm_Open ();
6080   ;
6081   return 0;
6082 }
6083 _ACEOF
6084 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6085 if { (eval echo "$as_me:6085: \"$ac_link\"") >&5
6086   (eval $ac_link) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit "$ac_status"); } &&
6090          { ac_try='test -s "conftest$ac_exeext"'
6091   { (eval echo "$as_me:6091: \"$ac_try\"") >&5
6092   (eval $ac_try) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit "$ac_status"); }; }; then
6096   ac_cv_lib_gpm_Gpm_Open=yes
6097 else
6098   echo "$as_me: failed program was:" >&5
6099 cat "conftest.$ac_ext" >&5
6100 ac_cv_lib_gpm_Gpm_Open=no
6101 fi
6102 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6103 LIBS=$ac_check_lib_save_LIBS
6104 fi
6105 echo "$as_me:6105: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6106 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6107 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
6108   echo "$as_me:6108: checking for initscr in -lgpm" >&5
6109 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6110 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6111   echo $ECHO_N "(cached) $ECHO_C" >&6
6112 else
6113   ac_check_lib_save_LIBS=$LIBS
6114 LIBS="-lgpm  $LIBS"
6115 cat >"conftest.$ac_ext" <<_ACEOF
6116 #line 6116 "configure"
6117 #include "confdefs.h"
6118
6119 /* Override any gcc2 internal prototype to avoid an error.  */
6120 #ifdef __cplusplus
6121 extern "C"
6122 #endif
6123 /* We use char because int might match the return type of a gcc2
6124    builtin and then its argument prototype would still apply.  */
6125 char initscr ();
6126 int
6127 main (void)
6128 {
6129 initscr ();
6130   ;
6131   return 0;
6132 }
6133 _ACEOF
6134 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6135 if { (eval echo "$as_me:6135: \"$ac_link\"") >&5
6136   (eval $ac_link) 2>&5
6137   ac_status=$?
6138   echo "$as_me:6138: \$? = $ac_status" >&5
6139   (exit "$ac_status"); } &&
6140          { ac_try='test -s "conftest$ac_exeext"'
6141   { (eval echo "$as_me:6141: \"$ac_try\"") >&5
6142   (eval $ac_try) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit "$ac_status"); }; }; then
6146   ac_cv_lib_gpm_initscr=yes
6147 else
6148   echo "$as_me: failed program was:" >&5
6149 cat "conftest.$ac_ext" >&5
6150 ac_cv_lib_gpm_initscr=no
6151 fi
6152 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6153 LIBS=$ac_check_lib_save_LIBS
6154 fi
6155 echo "$as_me:6155: result: $ac_cv_lib_gpm_initscr" >&5
6156 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6157 if test "$ac_cv_lib_gpm_initscr" = yes; then
6158   LIBS="$cf_ncurses_SAVE"
6159 else
6160   cf_ncurses_LIBS="-lgpm"
6161 fi
6162
6163 fi
6164
6165 case "$host_os" in
6166 (freebsd*)
6167         # This is only necessary if you are linking against an obsolete
6168         # version of ncurses (but it should do no harm, since it is static).
6169         if test "$cf_nculib_root" = ncurses ; then
6170                 echo "$as_me:6170: checking for tgoto in -lmytinfo" >&5
6171 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6172 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6173   echo $ECHO_N "(cached) $ECHO_C" >&6
6174 else
6175   ac_check_lib_save_LIBS=$LIBS
6176 LIBS="-lmytinfo  $LIBS"
6177 cat >"conftest.$ac_ext" <<_ACEOF
6178 #line 6178 "configure"
6179 #include "confdefs.h"
6180
6181 /* Override any gcc2 internal prototype to avoid an error.  */
6182 #ifdef __cplusplus
6183 extern "C"
6184 #endif
6185 /* We use char because int might match the return type of a gcc2
6186    builtin and then its argument prototype would still apply.  */
6187 char tgoto ();
6188 int
6189 main (void)
6190 {
6191 tgoto ();
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6197 if { (eval echo "$as_me:6197: \"$ac_link\"") >&5
6198   (eval $ac_link) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit "$ac_status"); } &&
6202          { ac_try='test -s "conftest$ac_exeext"'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit "$ac_status"); }; }; then
6208   ac_cv_lib_mytinfo_tgoto=yes
6209 else
6210   echo "$as_me: failed program was:" >&5
6211 cat "conftest.$ac_ext" >&5
6212 ac_cv_lib_mytinfo_tgoto=no
6213 fi
6214 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6215 LIBS=$ac_check_lib_save_LIBS
6216 fi
6217 echo "$as_me:6217: result: $ac_cv_lib_mytinfo_tgoto" >&5
6218 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6219 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6220   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6221 fi
6222
6223         fi
6224         ;;
6225 esac
6226
6227 cf_add_libs="$LIBS"
6228 # reverse order
6229 cf_add_0lib=
6230 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6231 # filter duplicates
6232 for cf_add_1lib in $cf_add_0lib; do
6233         for cf_add_2lib in $cf_add_libs; do
6234                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6235                         cf_add_1lib=
6236                         break
6237                 fi
6238         done
6239         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6240 done
6241 LIBS="$cf_add_libs"
6242
6243 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6244 then
6245
6246 cf_add_libs="$LIBS"
6247 # reverse order
6248 cf_add_0lib=
6249 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6250 # filter duplicates
6251 for cf_add_1lib in $cf_add_0lib; do
6252         for cf_add_2lib in $cf_add_libs; do
6253                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6254                         cf_add_1lib=
6255                         break
6256                 fi
6257         done
6258         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6259 done
6260 LIBS="$cf_add_libs"
6261
6262 else
6263
6264         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6265         cf_libdir=""
6266         echo "$as_me:6266: checking for initscr" >&5
6267 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6268 if test "${ac_cv_func_initscr+set}" = set; then
6269   echo $ECHO_N "(cached) $ECHO_C" >&6
6270 else
6271   cat >"conftest.$ac_ext" <<_ACEOF
6272 #line 6272 "configure"
6273 #include "confdefs.h"
6274 #define initscr autoconf_temporary
6275 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6276 #undef initscr
6277
6278 #ifdef __cplusplus
6279 extern "C"
6280 #endif
6281
6282 /* We use char because int might match the return type of a gcc2
6283    builtin and then its argument prototype would still apply.  */
6284 char initscr (void);
6285
6286 int
6287 main (void)
6288 {
6289
6290 /* The GNU C library defines stubs for functions which it implements
6291     to always fail with ENOSYS.  Some functions are actually named
6292     something starting with __ and the normal name is an alias.  */
6293 #if defined (__stub_initscr) || defined (__stub___initscr)
6294 #error found stub for initscr
6295 #endif
6296
6297         return initscr ();
6298   ;
6299   return 0;
6300 }
6301 _ACEOF
6302 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6303 if { (eval echo "$as_me:6303: \"$ac_link\"") >&5
6304   (eval $ac_link) 2>&5
6305   ac_status=$?
6306   echo "$as_me:6306: \$? = $ac_status" >&5
6307   (exit "$ac_status"); } &&
6308          { ac_try='test -s "conftest$ac_exeext"'
6309   { (eval echo "$as_me:6309: \"$ac_try\"") >&5
6310   (eval $ac_try) 2>&5
6311   ac_status=$?
6312   echo "$as_me:6312: \$? = $ac_status" >&5
6313   (exit "$ac_status"); }; }; then
6314   ac_cv_func_initscr=yes
6315 else
6316   echo "$as_me: failed program was:" >&5
6317 cat "conftest.$ac_ext" >&5
6318 ac_cv_func_initscr=no
6319 fi
6320 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6321 fi
6322 echo "$as_me:6322: result: $ac_cv_func_initscr" >&5
6323 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6324 if test "$ac_cv_func_initscr" = yes; then
6325   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6326 else
6327
6328                 cf_save_LIBS="$LIBS"
6329                 echo "$as_me:6329: checking for initscr in -l$cf_nculib_root" >&5
6330 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6331                 LIBS="-l$cf_nculib_root $LIBS"
6332                 cat >"conftest.$ac_ext" <<_ACEOF
6333 #line 6333 "configure"
6334 #include "confdefs.h"
6335 #include <${cf_cv_ncurses_header:-curses.h}>
6336 int
6337 main (void)
6338 {
6339 initscr()
6340   ;
6341   return 0;
6342 }
6343 _ACEOF
6344 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6345 if { (eval echo "$as_me:6345: \"$ac_link\"") >&5
6346   (eval $ac_link) 2>&5
6347   ac_status=$?
6348   echo "$as_me:6348: \$? = $ac_status" >&5
6349   (exit "$ac_status"); } &&
6350          { ac_try='test -s "conftest$ac_exeext"'
6351   { (eval echo "$as_me:6351: \"$ac_try\"") >&5
6352   (eval $ac_try) 2>&5
6353   ac_status=$?
6354   echo "$as_me:6354: \$? = $ac_status" >&5
6355   (exit "$ac_status"); }; }; then
6356   echo "$as_me:6356: result: yes" >&5
6357 echo "${ECHO_T}yes" >&6
6358                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6359
6360 else
6361   echo "$as_me: failed program was:" >&5
6362 cat "conftest.$ac_ext" >&5
6363 echo "$as_me:6363: result: no" >&5
6364 echo "${ECHO_T}no" >&6
6365
6366 cf_search=
6367 cf_library_path_list=""
6368 if test -n "${LDFLAGS}${LIBS}" ; then
6369         for cf_library_path in $LDFLAGS $LIBS
6370         do
6371                 case "$cf_library_path" in
6372                 (-L*)
6373                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6374
6375 test "x$cf_library_path" != "xNONE" && \
6376 test -d "$cf_library_path" && \
6377  {
6378         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6379         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6380         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6381         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6382         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6383         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"
6384 }
6385
6386                         cf_library_path_list="$cf_library_path_list $cf_search"
6387                         ;;
6388                 esac
6389         done
6390 fi
6391
6392 cf_search=
6393
6394 test "x$prefix" != "xNONE" && \
6395 test -d "$prefix" && \
6396  {
6397         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6398         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6399         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6400         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6401         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6402         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6403 }
6404
6405 for cf_subdir_prefix in \
6406         /usr \
6407         /usr/local \
6408         /usr/pkg \
6409         /opt \
6410         /opt/local \
6411         $HOME
6412 do
6413
6414 test "x$cf_subdir_prefix" != "x$prefix" && \
6415 test -d "$cf_subdir_prefix" && \
6416 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6417         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6418         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6419         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6420         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6421         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6422         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"
6423 }
6424
6425 done
6426
6427 cf_search="$cf_library_path_list $cf_search"
6428
6429                         for cf_libdir in $cf_search
6430                         do
6431                                 echo "$as_me:6431: checking for -l$cf_nculib_root in $cf_libdir" >&5
6432 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6433                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6434                                 cat >"conftest.$ac_ext" <<_ACEOF
6435 #line 6435 "configure"
6436 #include "confdefs.h"
6437 #include <${cf_cv_ncurses_header:-curses.h}>
6438 int
6439 main (void)
6440 {
6441 initscr()
6442   ;
6443   return 0;
6444 }
6445 _ACEOF
6446 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6447 if { (eval echo "$as_me:6447: \"$ac_link\"") >&5
6448   (eval $ac_link) 2>&5
6449   ac_status=$?
6450   echo "$as_me:6450: \$? = $ac_status" >&5
6451   (exit "$ac_status"); } &&
6452          { ac_try='test -s "conftest$ac_exeext"'
6453   { (eval echo "$as_me:6453: \"$ac_try\"") >&5
6454   (eval $ac_try) 2>&5
6455   ac_status=$?
6456   echo "$as_me:6456: \$? = $ac_status" >&5
6457   (exit "$ac_status"); }; }; then
6458   echo "$as_me:6458: result: yes" >&5
6459 echo "${ECHO_T}yes" >&6
6460                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6461                                          break
6462 else
6463   echo "$as_me: failed program was:" >&5
6464 cat "conftest.$ac_ext" >&5
6465 echo "$as_me:6465: result: no" >&5
6466 echo "${ECHO_T}no" >&6
6467                                          LIBS="$cf_save_LIBS"
6468 fi
6469 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6470                         done
6471
6472 fi
6473 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6474
6475 fi
6476
6477 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6478
6479 if test "$cf_found_library" = no ; then
6480         { { echo "$as_me:6480: error: Cannot link $cf_nculib_root library" >&5
6481 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6482    { (exit 1); exit 1; }; }
6483 fi
6484
6485 fi
6486
6487 if test -n "$cf_ncurses_LIBS" ; then
6488         echo "$as_me:6488: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6489 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6490         cf_ncurses_SAVE="$LIBS"
6491         for p in $cf_ncurses_LIBS ; do
6492                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6493                 if test "$q" != "$LIBS" ; then
6494                         LIBS="$q"
6495                 fi
6496         done
6497         cat >"conftest.$ac_ext" <<_ACEOF
6498 #line 6498 "configure"
6499 #include "confdefs.h"
6500 #include <${cf_cv_ncurses_header:-curses.h}>
6501 int
6502 main (void)
6503 {
6504 initscr(); mousemask(0,0); tigetstr((char *)0);
6505   ;
6506   return 0;
6507 }
6508 _ACEOF
6509 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6510 if { (eval echo "$as_me:6510: \"$ac_link\"") >&5
6511   (eval $ac_link) 2>&5
6512   ac_status=$?
6513   echo "$as_me:6513: \$? = $ac_status" >&5
6514   (exit "$ac_status"); } &&
6515          { ac_try='test -s "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   echo "$as_me:6521: result: yes" >&5
6522 echo "${ECHO_T}yes" >&6
6523 else
6524   echo "$as_me: failed program was:" >&5
6525 cat "conftest.$ac_ext" >&5
6526 echo "$as_me:6526: result: no" >&5
6527 echo "${ECHO_T}no" >&6
6528                  LIBS="$cf_ncurses_SAVE"
6529 fi
6530 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6531 fi
6532
6533 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6534
6535 cat >>confdefs.h <<EOF
6536 #define $cf_nculib_ROOT 1
6537 EOF
6538
6539         fi
6540 else
6541         NCURSES_CONFIG=none
6542 fi
6543
6544 echo "$as_me:6544: checking if you want wide-character code" >&5
6545 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6546
6547 # Check whether --enable-widec or --disable-widec was given.
6548 if test "${enable_widec+set}" = set; then
6549   enableval="$enable_widec"
6550   with_widec=$enableval
6551 else
6552   with_widec=no
6553 fi;
6554 echo "$as_me:6554: result: $with_widec" >&5
6555 echo "${ECHO_T}$with_widec" >&6
6556 if test "$with_widec" = yes ; then
6557
6558 for ac_header in wchar.h
6559 do
6560 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6561 echo "$as_me:6561: checking for $ac_header" >&5
6562 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6563 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6564   echo $ECHO_N "(cached) $ECHO_C" >&6
6565 else
6566   cat >"conftest.$ac_ext" <<_ACEOF
6567 #line 6567 "configure"
6568 #include "confdefs.h"
6569 #include <$ac_header>
6570 _ACEOF
6571 if { (eval echo "$as_me:6571: \"$ac_cpp "conftest.$ac_ext"\"") >&5
6572   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
6573   ac_status=$?
6574   $EGREP -v '^ *\+' conftest.er1 >conftest.err
6575   rm -f conftest.er1
6576   cat conftest.err >&5
6577   echo "$as_me:6577: \$? = $ac_status" >&5
6578   (exit "$ac_status"); } >/dev/null; then
6579   if test -s conftest.err; then
6580     ac_cpp_err=$ac_c_preproc_warn_flag
6581   else
6582     ac_cpp_err=
6583   fi
6584 else
6585   ac_cpp_err=yes
6586 fi
6587 if test -z "$ac_cpp_err"; then
6588   eval "$as_ac_Header=yes"
6589 else
6590   echo "$as_me: failed program was:" >&5
6591   cat "conftest.$ac_ext" >&5
6592   eval "$as_ac_Header=no"
6593 fi
6594 rm -f conftest.err "conftest.$ac_ext"
6595 fi
6596 echo "$as_me:6596: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
6597 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
6598 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
6599   cat >>confdefs.h <<EOF
6600 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6601 EOF
6602
6603 fi
6604 done
6605
6606 echo "$as_me:6606: checking for multibyte character support" >&5
6607 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6608 if test "${cf_cv_utf8_lib+set}" = set; then
6609   echo $ECHO_N "(cached) $ECHO_C" >&6
6610 else
6611
6612         cf_save_LIBS="$LIBS"
6613         cat >"conftest.$ac_ext" <<_ACEOF
6614 #line 6614 "configure"
6615 #include "confdefs.h"
6616
6617 #include <stdlib.h>
6618 #include <stdio.h>
6619 #ifdef HAVE_WCHAR_H
6620 #include <wchar.h>
6621 #endif
6622
6623 int
6624 main (void)
6625 {
6626 putwc(0,0);
6627   ;
6628   return 0;
6629 }
6630 _ACEOF
6631 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6632 if { (eval echo "$as_me:6632: \"$ac_link\"") >&5
6633   (eval $ac_link) 2>&5
6634   ac_status=$?
6635   echo "$as_me:6635: \$? = $ac_status" >&5
6636   (exit "$ac_status"); } &&
6637          { ac_try='test -s "conftest$ac_exeext"'
6638   { (eval echo "$as_me:6638: \"$ac_try\"") >&5
6639   (eval $ac_try) 2>&5
6640   ac_status=$?
6641   echo "$as_me:6641: \$? = $ac_status" >&5
6642   (exit "$ac_status"); }; }; then
6643   cf_cv_utf8_lib=yes
6644 else
6645   echo "$as_me: failed program was:" >&5
6646 cat "conftest.$ac_ext" >&5
6647
6648 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6649 # will be set on completion of the AC_TRY_LINK below.
6650 cf_cv_header_path_utf8=
6651 cf_cv_library_path_utf8=
6652
6653 echo "${as_me:-configure}:6653: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6654
6655 cf_save_LIBS="$LIBS"
6656
6657 cat >"conftest.$ac_ext" <<_ACEOF
6658 #line 6658 "configure"
6659 #include "confdefs.h"
6660
6661 #include <libutf8.h>
6662 int
6663 main (void)
6664 {
6665 putwc(0,0);
6666   ;
6667   return 0;
6668 }
6669 _ACEOF
6670 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6671 if { (eval echo "$as_me:6671: \"$ac_link\"") >&5
6672   (eval $ac_link) 2>&5
6673   ac_status=$?
6674   echo "$as_me:6674: \$? = $ac_status" >&5
6675   (exit "$ac_status"); } &&
6676          { ac_try='test -s "conftest$ac_exeext"'
6677   { (eval echo "$as_me:6677: \"$ac_try\"") >&5
6678   (eval $ac_try) 2>&5
6679   ac_status=$?
6680   echo "$as_me:6680: \$? = $ac_status" >&5
6681   (exit "$ac_status"); }; }; then
6682
6683         cf_cv_find_linkage_utf8=yes
6684         cf_cv_header_path_utf8=/usr/include
6685         cf_cv_library_path_utf8=/usr/lib
6686
6687 else
6688   echo "$as_me: failed program was:" >&5
6689 cat "conftest.$ac_ext" >&5
6690
6691 LIBS="-lutf8  $cf_save_LIBS"
6692
6693 cat >"conftest.$ac_ext" <<_ACEOF
6694 #line 6694 "configure"
6695 #include "confdefs.h"
6696
6697 #include <libutf8.h>
6698 int
6699 main (void)
6700 {
6701 putwc(0,0);
6702   ;
6703   return 0;
6704 }
6705 _ACEOF
6706 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6707 if { (eval echo "$as_me:6707: \"$ac_link\"") >&5
6708   (eval $ac_link) 2>&5
6709   ac_status=$?
6710   echo "$as_me:6710: \$? = $ac_status" >&5
6711   (exit "$ac_status"); } &&
6712          { ac_try='test -s "conftest$ac_exeext"'
6713   { (eval echo "$as_me:6713: \"$ac_try\"") >&5
6714   (eval $ac_try) 2>&5
6715   ac_status=$?
6716   echo "$as_me:6716: \$? = $ac_status" >&5
6717   (exit "$ac_status"); }; }; then
6718
6719         cf_cv_find_linkage_utf8=yes
6720         cf_cv_header_path_utf8=/usr/include
6721         cf_cv_library_path_utf8=/usr/lib
6722         cf_cv_library_file_utf8="-lutf8"
6723
6724 else
6725   echo "$as_me: failed program was:" >&5
6726 cat "conftest.$ac_ext" >&5
6727
6728         cf_cv_find_linkage_utf8=no
6729         LIBS="$cf_save_LIBS"
6730
6731         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6732
6733 echo "${as_me:-configure}:6733: testing find linkage for utf8 library ..." 1>&5
6734
6735 echo "${as_me:-configure}:6735: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6736
6737         cf_save_CPPFLAGS="$CPPFLAGS"
6738         cf_test_CPPFLAGS="$CPPFLAGS"
6739
6740 cf_search=
6741
6742 # collect the current set of include-directories from compiler flags
6743 cf_header_path_list=""
6744 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6745         for cf_header_path in $CPPFLAGS $CFLAGS
6746         do
6747                 case "$cf_header_path" in
6748                 (-I*)
6749                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6750
6751 test "x$cf_header_path" != "xNONE" && \
6752 test -d "$cf_header_path" && \
6753  {
6754         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6755         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6756         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6757         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6758         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6759         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6760 }
6761
6762                         cf_header_path_list="$cf_header_path_list $cf_search"
6763                         ;;
6764                 esac
6765         done
6766 fi
6767
6768 # add the variations for the package we are looking for
6769
6770 cf_search=
6771
6772 test "x$prefix" != "xNONE" && \
6773 test -d "$prefix" && \
6774  {
6775         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6776         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6777         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6778         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6779         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6780         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6781 }
6782
6783 for cf_subdir_prefix in \
6784         /usr \
6785         /usr/local \
6786         /usr/pkg \
6787         /opt \
6788         /opt/local \
6789         $HOME
6790 do
6791
6792 test "x$cf_subdir_prefix" != "x$prefix" && \
6793 test -d "$cf_subdir_prefix" && \
6794 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6795         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6796         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6797         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6798         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6799         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6800         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6801 }
6802
6803 done
6804
6805 test "$includedir" != NONE && \
6806 test "$includedir" != "/usr/include" && \
6807 test -d "$includedir" && {
6808         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6809         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6810 }
6811
6812 test "$oldincludedir" != NONE && \
6813 test "$oldincludedir" != "/usr/include" && \
6814 test -d "$oldincludedir" && {
6815         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6816         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6817 }
6818
6819 cf_search="$cf_search $cf_header_path_list"
6820
6821         for cf_cv_header_path_utf8 in $cf_search
6822         do
6823                 if test -d "$cf_cv_header_path_utf8" ; then
6824                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6825
6826 echo "${as_me:-configure}:6826: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6827
6828                         CPPFLAGS="$cf_save_CPPFLAGS"
6829
6830         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6831         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6832
6833                         cat >"conftest.$ac_ext" <<_ACEOF
6834 #line 6834 "configure"
6835 #include "confdefs.h"
6836
6837 #include <libutf8.h>
6838 int
6839 main (void)
6840 {
6841 putwc(0,0);
6842   ;
6843   return 0;
6844 }
6845 _ACEOF
6846 rm -f "conftest.$ac_objext"
6847 if { (eval echo "$as_me:6847: \"$ac_compile\"") >&5
6848   (eval $ac_compile) 2>&5
6849   ac_status=$?
6850   echo "$as_me:6850: \$? = $ac_status" >&5
6851   (exit "$ac_status"); } &&
6852          { ac_try='test -s "conftest.$ac_objext"'
6853   { (eval echo "$as_me:6853: \"$ac_try\"") >&5
6854   (eval $ac_try) 2>&5
6855   ac_status=$?
6856   echo "$as_me:6856: \$? = $ac_status" >&5
6857   (exit "$ac_status"); }; }; then
6858
6859                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6860
6861 echo "${as_me:-configure}:6861: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6862
6863                                 cf_cv_find_linkage_utf8=maybe
6864                                 cf_test_CPPFLAGS="$CPPFLAGS"
6865                                 break
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat "conftest.$ac_ext" >&5
6869
6870                                 CPPFLAGS="$cf_save_CPPFLAGS"
6871
6872 fi
6873 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6874                 fi
6875         done
6876
6877         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6878
6879 echo "${as_me:-configure}:6879: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6880
6881                 cf_save_LIBS="$LIBS"
6882                 cf_save_LDFLAGS="$LDFLAGS"
6883
6884                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6885
6886 cf_search=
6887 cf_library_path_list=""
6888 if test -n "${LDFLAGS}${LIBS}" ; then
6889         for cf_library_path in $LDFLAGS $LIBS
6890         do
6891                 case "$cf_library_path" in
6892                 (-L*)
6893                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6894
6895 test "x$cf_library_path" != "xNONE" && \
6896 test -d "$cf_library_path" && \
6897  {
6898         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6899         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6900         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6901         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6902         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6903         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6904 }
6905
6906                         cf_library_path_list="$cf_library_path_list $cf_search"
6907                         ;;
6908                 esac
6909         done
6910 fi
6911
6912 cf_search=
6913
6914 test "x$prefix" != "xNONE" && \
6915 test -d "$prefix" && \
6916  {
6917         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6918         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6919         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6920         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6921         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6922         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6923 }
6924
6925 for cf_subdir_prefix in \
6926         /usr \
6927         /usr/local \
6928         /usr/pkg \
6929         /opt \
6930         /opt/local \
6931         $HOME
6932 do
6933
6934 test "x$cf_subdir_prefix" != "x$prefix" && \
6935 test -d "$cf_subdir_prefix" && \
6936 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6937         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6938         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6939         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6940         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6941         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6942         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6943 }
6944
6945 done
6946
6947 cf_search="$cf_library_path_list $cf_search"
6948
6949                         for cf_cv_library_path_utf8 in $cf_search
6950                         do
6951                                 if test -d "$cf_cv_library_path_utf8" ; then
6952                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6953
6954 echo "${as_me:-configure}:6954: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6955
6956                                         CPPFLAGS="$cf_test_CPPFLAGS"
6957                                         LIBS="-lutf8  $cf_save_LIBS"
6958                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6959                                         cat >"conftest.$ac_ext" <<_ACEOF
6960 #line 6960 "configure"
6961 #include "confdefs.h"
6962
6963 #include <libutf8.h>
6964 int
6965 main (void)
6966 {
6967 putwc(0,0);
6968   ;
6969   return 0;
6970 }
6971 _ACEOF
6972 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6973 if { (eval echo "$as_me:6973: \"$ac_link\"") >&5
6974   (eval $ac_link) 2>&5
6975   ac_status=$?
6976   echo "$as_me:6976: \$? = $ac_status" >&5
6977   (exit "$ac_status"); } &&
6978          { ac_try='test -s "conftest$ac_exeext"'
6979   { (eval echo "$as_me:6979: \"$ac_try\"") >&5
6980   (eval $ac_try) 2>&5
6981   ac_status=$?
6982   echo "$as_me:6982: \$? = $ac_status" >&5
6983   (exit "$ac_status"); }; }; then
6984
6985                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6986
6987 echo "${as_me:-configure}:6987: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6988
6989                                         cf_cv_find_linkage_utf8=yes
6990                                         cf_cv_library_file_utf8="-lutf8"
6991                                         break
6992 else
6993   echo "$as_me: failed program was:" >&5
6994 cat "conftest.$ac_ext" >&5
6995
6996                                         CPPFLAGS="$cf_save_CPPFLAGS"
6997                                         LIBS="$cf_save_LIBS"
6998                                         LDFLAGS="$cf_save_LDFLAGS"
6999
7000 fi
7001 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7002                                 fi
7003                         done
7004                         CPPFLAGS="$cf_save_CPPFLAGS"
7005                         LDFLAGS="$cf_save_LDFLAGS"
7006                 fi
7007
7008         else
7009                 cf_cv_find_linkage_utf8=no
7010         fi
7011
7012 fi
7013 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7014
7015 fi
7016 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7017
7018 LIBS="$cf_save_LIBS"
7019
7020 if test "$cf_cv_find_linkage_utf8" = yes ; then
7021 cf_cv_utf8_lib=add-on
7022 else
7023 cf_cv_utf8_lib=no
7024 fi
7025
7026 fi
7027 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7028 fi
7029 echo "$as_me:7029: result: $cf_cv_utf8_lib" >&5
7030 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7031
7032 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7033 # ncurses/ncursesw:
7034 if test "$cf_cv_utf8_lib" = "add-on" ; then
7035
7036 cat >>confdefs.h <<\EOF
7037 #define HAVE_LIBUTF8_H 1
7038 EOF
7039
7040 if test -n "$cf_cv_header_path_utf8" ; then
7041   for cf_add_incdir in $cf_cv_header_path_utf8
7042   do
7043         while test "$cf_add_incdir" != /usr/include
7044         do
7045           if test -d "$cf_add_incdir"
7046           then
7047                 cf_have_incdir=no
7048                 if test -n "$CFLAGS$CPPFLAGS" ; then
7049                   # a loop is needed to ensure we can add subdirs of existing dirs
7050                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7051                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7052                           cf_have_incdir=yes; break
7053                         fi
7054                   done
7055                 fi
7056
7057                 if test "$cf_have_incdir" = no ; then
7058                   if test "$cf_add_incdir" = /usr/local/include ; then
7059                         if test "$GCC" = yes
7060                         then
7061                           cf_save_CPPFLAGS=$CPPFLAGS
7062
7063         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7064         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7065
7066                           cat >"conftest.$ac_ext" <<_ACEOF
7067 #line 7067 "configure"
7068 #include "confdefs.h"
7069 #include <stdio.h>
7070 int
7071 main (void)
7072 {
7073 printf("Hello")
7074   ;
7075   return 0;
7076 }
7077 _ACEOF
7078 rm -f "conftest.$ac_objext"
7079 if { (eval echo "$as_me:7079: \"$ac_compile\"") >&5
7080   (eval $ac_compile) 2>&5
7081   ac_status=$?
7082   echo "$as_me:7082: \$? = $ac_status" >&5
7083   (exit "$ac_status"); } &&
7084          { ac_try='test -s "conftest.$ac_objext"'
7085   { (eval echo "$as_me:7085: \"$ac_try\"") >&5
7086   (eval $ac_try) 2>&5
7087   ac_status=$?
7088   echo "$as_me:7088: \$? = $ac_status" >&5
7089   (exit "$ac_status"); }; }; then
7090   :
7091 else
7092   echo "$as_me: failed program was:" >&5
7093 cat "conftest.$ac_ext" >&5
7094 cf_have_incdir=yes
7095 fi
7096 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7097                           CPPFLAGS=$cf_save_CPPFLAGS
7098                         fi
7099                   fi
7100                 fi
7101
7102                 if test "$cf_have_incdir" = no ; then
7103                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7104
7105 echo "${as_me:-configure}:7105: testing adding $cf_add_incdir to include-path ..." 1>&5
7106
7107                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7108
7109                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7110                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7111                   cf_add_incdir="$cf_top_incdir"
7112                 else
7113                   break
7114                 fi
7115           else
7116                 break
7117           fi
7118         done
7119   done
7120 fi
7121
7122 if test -n "$cf_cv_library_path_utf8" ; then
7123         for cf_add_libdir in $cf_cv_library_path_utf8
7124         do
7125                 if test "$cf_add_libdir" = /usr/lib ; then
7126                         :
7127                 elif test -d "$cf_add_libdir"
7128                 then
7129                         cf_have_libdir=no
7130                         if test -n "$LDFLAGS$LIBS" ; then
7131                                 # a loop is needed to ensure we can add subdirs of existing dirs
7132                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7133                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7134                                                 cf_have_libdir=yes; break
7135                                         fi
7136                                 done
7137                         fi
7138                         if test "$cf_have_libdir" = no ; then
7139                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7140
7141 echo "${as_me:-configure}:7141: testing adding $cf_add_libdir to library-path ..." 1>&5
7142
7143                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7144                         fi
7145                 fi
7146         done
7147 fi
7148
7149 cf_add_libs="$LIBS"
7150 # reverse order
7151 cf_add_0lib=
7152 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7153 # filter duplicates
7154 for cf_add_1lib in $cf_add_0lib; do
7155         for cf_add_2lib in $cf_add_libs; do
7156                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7157                         cf_add_1lib=
7158                         break
7159                 fi
7160         done
7161         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7162 done
7163 LIBS="$cf_add_libs"
7164
7165 fi
7166
7167 cf_ncuconfig_root=ncursesw
7168 cf_have_ncuconfig=no
7169
7170 if test "x${PKG_CONFIG:=none}" != xnone; then
7171         echo "$as_me:7171: checking pkg-config for $cf_ncuconfig_root" >&5
7172 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7173         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7174                 echo "$as_me:7174: result: yes" >&5
7175 echo "${ECHO_T}yes" >&6
7176
7177                 echo "$as_me:7177: checking if the $cf_ncuconfig_root package files work" >&5
7178 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7179                 cf_have_ncuconfig=unknown
7180
7181                 cf_save_CFLAGS="$CFLAGS"
7182                 cf_save_CPPFLAGS="$CPPFLAGS"
7183                 cf_save_LIBS="$LIBS"
7184
7185                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7186                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7187
7188                 # while -W for passing linker flags is prevalent, it is not "standard".
7189                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7190                 # incompatible _and_ non-standard -W option which gives an error.  Work
7191                 # around that pitfall.
7192                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7193                 (x*c[89]9@@*-W*)
7194
7195 cf_fix_cppflags=no
7196 cf_new_cflags=
7197 cf_new_cppflags=
7198 cf_new_extra_cppflags=
7199
7200 for cf_add_cflags in $cf_pkg_cflags
7201 do
7202 case "$cf_fix_cppflags" in
7203 (no)
7204         case "$cf_add_cflags" in
7205         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7206                 case "$cf_add_cflags" in
7207                 (-D*)
7208                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7209
7210                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7211                                 && test -z "${cf_tst_cflags}" \
7212                                 && cf_fix_cppflags=yes
7213
7214                         if test "$cf_fix_cppflags" = yes ; then
7215
7216         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7217         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7218
7219                                 continue
7220                         elif test "${cf_tst_cflags}" = "\"'" ; then
7221
7222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7224
7225                                 continue
7226                         fi
7227                         ;;
7228                 esac
7229                 case "$CPPFLAGS" in
7230                 (*$cf_add_cflags)
7231                         ;;
7232                 (*)
7233                         case "$cf_add_cflags" in
7234                         (-D*)
7235                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7236
7237 CPPFLAGS=`echo "$CPPFLAGS" | \
7238         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7239                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7240
7241                                 ;;
7242                         esac
7243
7244         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7245         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7246
7247                         ;;
7248                 esac
7249                 ;;
7250         (*)
7251
7252         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7253         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7254
7255                 ;;
7256         esac
7257         ;;
7258 (yes)
7259
7260         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7261         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7262
7263         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7264
7265         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7266                 && test -z "${cf_tst_cflags}" \
7267                 && cf_fix_cppflags=no
7268         ;;
7269 esac
7270 done
7271
7272 if test -n "$cf_new_cflags" ; then
7273
7274         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7275         CFLAGS="${CFLAGS}$cf_new_cflags"
7276
7277 fi
7278
7279 if test -n "$cf_new_cppflags" ; then
7280
7281         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7282         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7283
7284 fi
7285
7286 if test -n "$cf_new_extra_cppflags" ; then
7287
7288         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7289         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7290
7291 fi
7292
7293 cf_add_libs="$LIBS"
7294 # reverse order
7295 cf_add_0lib=
7296 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7297 # filter duplicates
7298 for cf_add_1lib in $cf_add_0lib; do
7299         for cf_add_2lib in $cf_add_libs; do
7300                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7301                         cf_add_1lib=
7302                         break
7303                 fi
7304         done
7305         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7306 done
7307 LIBS="$cf_add_libs"
7308
7309                         cat >"conftest.$ac_ext" <<_ACEOF
7310 #line 7310 "configure"
7311 #include "confdefs.h"
7312 #include <${cf_cv_ncurses_header:-curses.h}>
7313 int
7314 main (void)
7315 {
7316 initscr(); mousemask(0,0); tigetstr((char *)0);
7317   ;
7318   return 0;
7319 }
7320 _ACEOF
7321 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7322 if { (eval echo "$as_me:7322: \"$ac_link\"") >&5
7323   (eval $ac_link) 2>&5
7324   ac_status=$?
7325   echo "$as_me:7325: \$? = $ac_status" >&5
7326   (exit "$ac_status"); } &&
7327          { ac_try='test -s "conftest$ac_exeext"'
7328   { (eval echo "$as_me:7328: \"$ac_try\"") >&5
7329   (eval $ac_try) 2>&5
7330   ac_status=$?
7331   echo "$as_me:7331: \$? = $ac_status" >&5
7332   (exit "$ac_status"); }; }; then
7333   if test "$cross_compiling" = yes; then
7334   cf_test_ncuconfig=maybe
7335 else
7336   cat >"conftest.$ac_ext" <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339 #include <${cf_cv_ncurses_header:-curses.h}>
7340                                         int main(void)
7341                                         { const char *xx = curses_version(); return (xx == 0); }
7342 _ACEOF
7343 rm -f "conftest$ac_exeext"
7344 if { (eval echo "$as_me:7344: \"$ac_link\"") >&5
7345   (eval $ac_link) 2>&5
7346   ac_status=$?
7347   echo "$as_me:7347: \$? = $ac_status" >&5
7348   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7349   { (eval echo "$as_me:7349: \"$ac_try\"") >&5
7350   (eval $ac_try) 2>&5
7351   ac_status=$?
7352   echo "$as_me:7352: \$? = $ac_status" >&5
7353   (exit "$ac_status"); }; }; then
7354   cf_test_ncuconfig=yes
7355 else
7356   echo "$as_me: program exited with status $ac_status" >&5
7357 echo "$as_me: failed program was:" >&5
7358 cat "conftest.$ac_ext" >&5
7359 cf_test_ncuconfig=no
7360 fi
7361 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7362 fi
7363 else
7364   echo "$as_me: failed program was:" >&5
7365 cat "conftest.$ac_ext" >&5
7366 cf_test_ncuconfig=no
7367 fi
7368 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7369
7370                         CFLAGS="$cf_save_CFLAGS"
7371                         CPPFLAGS="$cf_save_CPPFLAGS"
7372                         LIBS="$cf_save_LIBS"
7373
7374                         if test "x$cf_test_ncuconfig" != xyes; then
7375                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7376                                 cf_pkg_cflags="$cf_temp"
7377                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7378                                 cf_pkg_libs="$cf_temp"
7379                         fi
7380                         ;;
7381                 esac
7382
7383 for cf_add_cflags in $cf_pkg_cflags
7384 do
7385         case "x$cf_add_cflags" in
7386         (x-[DU]*)
7387
7388 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7389 while true
7390 do
7391         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'`
7392         test "$CFLAGS" != "$cf_old_cflag" || break
7393
7394         CFLAGS="$cf_old_cflag"
7395 done
7396
7397 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7398 while true
7399 do
7400         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'`
7401         test "$CPPFLAGS" != "$cf_old_cflag" || break
7402
7403         CPPFLAGS="$cf_old_cflag"
7404 done
7405
7406                 ;;
7407         esac
7408
7409 cf_fix_cppflags=no
7410 cf_new_cflags=
7411 cf_new_cppflags=
7412 cf_new_extra_cppflags=
7413
7414 for cf_add_cflags in $cf_add_cflags
7415 do
7416 case "$cf_fix_cppflags" in
7417 (no)
7418         case "$cf_add_cflags" in
7419         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7420                 case "$cf_add_cflags" in
7421                 (-D*)
7422                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7423
7424                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7425                                 && test -z "${cf_tst_cflags}" \
7426                                 && cf_fix_cppflags=yes
7427
7428                         if test "$cf_fix_cppflags" = yes ; then
7429
7430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7432
7433                                 continue
7434                         elif test "${cf_tst_cflags}" = "\"'" ; then
7435
7436         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7437         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7438
7439                                 continue
7440                         fi
7441                         ;;
7442                 esac
7443                 case "$CPPFLAGS" in
7444                 (*$cf_add_cflags)
7445                         ;;
7446                 (*)
7447                         case "$cf_add_cflags" in
7448                         (-D*)
7449                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7450
7451 CPPFLAGS=`echo "$CPPFLAGS" | \
7452         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7453                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7454
7455                                 ;;
7456                         esac
7457
7458         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7459         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7460
7461                         ;;
7462                 esac
7463                 ;;
7464         (*)
7465
7466         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7467         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7468
7469                 ;;
7470         esac
7471         ;;
7472 (yes)
7473
7474         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7475         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7476
7477         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7478
7479         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7480                 && test -z "${cf_tst_cflags}" \
7481                 && cf_fix_cppflags=no
7482         ;;
7483 esac
7484 done
7485
7486 if test -n "$cf_new_cflags" ; then
7487
7488         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7489         CFLAGS="${CFLAGS}$cf_new_cflags"
7490
7491 fi
7492
7493 if test -n "$cf_new_cppflags" ; then
7494
7495         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7496         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7497
7498 fi
7499
7500 if test -n "$cf_new_extra_cppflags" ; then
7501
7502         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7503         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7504
7505 fi
7506
7507 done
7508
7509 cf_add_libs="$LIBS"
7510 # reverse order
7511 cf_add_0lib=
7512 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7513 # filter duplicates
7514 for cf_add_1lib in $cf_add_0lib; do
7515         for cf_add_2lib in $cf_add_libs; do
7516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7517                         cf_add_1lib=
7518                         break
7519                 fi
7520         done
7521         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7522 done
7523 LIBS="$cf_add_libs"
7524
7525                 cat >"conftest.$ac_ext" <<_ACEOF
7526 #line 7526 "configure"
7527 #include "confdefs.h"
7528 #include <${cf_cv_ncurses_header:-curses.h}>
7529 int
7530 main (void)
7531 {
7532 initscr(); mousemask(0,0); tigetstr((char *)0);
7533   ;
7534   return 0;
7535 }
7536 _ACEOF
7537 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7538 if { (eval echo "$as_me:7538: \"$ac_link\"") >&5
7539   (eval $ac_link) 2>&5
7540   ac_status=$?
7541   echo "$as_me:7541: \$? = $ac_status" >&5
7542   (exit "$ac_status"); } &&
7543          { ac_try='test -s "conftest$ac_exeext"'
7544   { (eval echo "$as_me:7544: \"$ac_try\"") >&5
7545   (eval $ac_try) 2>&5
7546   ac_status=$?
7547   echo "$as_me:7547: \$? = $ac_status" >&5
7548   (exit "$ac_status"); }; }; then
7549   if test "$cross_compiling" = yes; then
7550   cf_have_ncuconfig=maybe
7551 else
7552   cat >"conftest.$ac_ext" <<_ACEOF
7553 #line 7553 "configure"
7554 #include "confdefs.h"
7555 #include <${cf_cv_ncurses_header:-curses.h}>
7556                                 int main(void)
7557                                 { const char *xx = curses_version(); return (xx == 0); }
7558 _ACEOF
7559 rm -f "conftest$ac_exeext"
7560 if { (eval echo "$as_me:7560: \"$ac_link\"") >&5
7561   (eval $ac_link) 2>&5
7562   ac_status=$?
7563   echo "$as_me:7563: \$? = $ac_status" >&5
7564   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7565   { (eval echo "$as_me:7565: \"$ac_try\"") >&5
7566   (eval $ac_try) 2>&5
7567   ac_status=$?
7568   echo "$as_me:7568: \$? = $ac_status" >&5
7569   (exit "$ac_status"); }; }; then
7570   cf_have_ncuconfig=yes
7571 else
7572   echo "$as_me: program exited with status $ac_status" >&5
7573 echo "$as_me: failed program was:" >&5
7574 cat "conftest.$ac_ext" >&5
7575 cf_have_ncuconfig=no
7576 fi
7577 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7578 fi
7579 else
7580   echo "$as_me: failed program was:" >&5
7581 cat "conftest.$ac_ext" >&5
7582 cf_have_ncuconfig=no
7583 fi
7584 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7585                 echo "$as_me:7585: result: $cf_have_ncuconfig" >&5
7586 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7587                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7588                 if test "$cf_have_ncuconfig" != "yes"
7589                 then
7590                         CPPFLAGS="$cf_save_CPPFLAGS"
7591                         LIBS="$cf_save_LIBS"
7592                         NCURSES_CONFIG_PKG=none
7593                 else
7594
7595 cat >>confdefs.h <<\EOF
7596 #define NCURSES 1
7597 EOF
7598
7599                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7600
7601 echo "$as_me:7601: checking for terminfo header" >&5
7602 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7603 if test "${cf_cv_term_header+set}" = set; then
7604   echo $ECHO_N "(cached) $ECHO_C" >&6
7605 else
7606
7607 case "${cf_cv_ncurses_header}" in
7608 (*/ncurses.h|*/ncursesw.h)
7609         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7610         ;;
7611 (*)
7612         cf_term_header=term.h
7613         ;;
7614 esac
7615
7616 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7617 do
7618 cat >"conftest.$ac_ext" <<_ACEOF
7619 #line 7619 "configure"
7620 #include "confdefs.h"
7621 #include <stdio.h>
7622 #include <${cf_cv_ncurses_header:-curses.h}>
7623 #include <$cf_test>
7624
7625 int
7626 main (void)
7627 {
7628 int x = auto_left_margin; (void)x
7629   ;
7630   return 0;
7631 }
7632 _ACEOF
7633 rm -f "conftest.$ac_objext"
7634 if { (eval echo "$as_me:7634: \"$ac_compile\"") >&5
7635   (eval $ac_compile) 2>&5
7636   ac_status=$?
7637   echo "$as_me:7637: \$? = $ac_status" >&5
7638   (exit "$ac_status"); } &&
7639          { ac_try='test -s "conftest.$ac_objext"'
7640   { (eval echo "$as_me:7640: \"$ac_try\"") >&5
7641   (eval $ac_try) 2>&5
7642   ac_status=$?
7643   echo "$as_me:7643: \$? = $ac_status" >&5
7644   (exit "$ac_status"); }; }; then
7645
7646         cf_cv_term_header="$cf_test"
7647 else
7648   echo "$as_me: failed program was:" >&5
7649 cat "conftest.$ac_ext" >&5
7650
7651         cf_cv_term_header=unknown
7652
7653 fi
7654 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7655         test "$cf_cv_term_header" != unknown && break
7656 done
7657
7658 fi
7659 echo "$as_me:7659: result: $cf_cv_term_header" >&5
7660 echo "${ECHO_T}$cf_cv_term_header" >&6
7661
7662 # Set definitions to allow ifdef'ing to accommodate subdirectories
7663
7664 case "$cf_cv_term_header" in
7665 (*term.h)
7666
7667 cat >>confdefs.h <<\EOF
7668 #define HAVE_TERM_H 1
7669 EOF
7670
7671         ;;
7672 esac
7673
7674 case "$cf_cv_term_header" in
7675 (ncurses/term.h)
7676
7677 cat >>confdefs.h <<\EOF
7678 #define HAVE_NCURSES_TERM_H 1
7679 EOF
7680
7681         ;;
7682 (ncursesw/term.h)
7683
7684 cat >>confdefs.h <<\EOF
7685 #define HAVE_NCURSESW_TERM_H 1
7686 EOF
7687
7688         ;;
7689 esac
7690
7691                 fi
7692
7693         else
7694                 echo "$as_me:7694: result: no" >&5
7695 echo "${ECHO_T}no" >&6
7696                 NCURSES_CONFIG_PKG=none
7697         fi
7698 else
7699         NCURSES_CONFIG_PKG=none
7700 fi
7701
7702 if test "x$cf_have_ncuconfig" = "xno"; then
7703         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7704
7705 if test -n "$ac_tool_prefix"; then
7706   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7707   do
7708     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7709 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7710 echo "$as_me:7710: checking for $ac_word" >&5
7711 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7712 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7713   echo $ECHO_N "(cached) $ECHO_C" >&6
7714 else
7715   if test -n "$NCURSES_CONFIG"; then
7716   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7717 else
7718   ac_save_IFS=$IFS; IFS=$ac_path_separator
7719 ac_dummy="$PATH"
7720 for ac_dir in $ac_dummy; do
7721   IFS=$ac_save_IFS
7722   test -z "$ac_dir" && ac_dir=.
7723   $as_executable_p "$ac_dir/$ac_word" || continue
7724 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7725 echo "$as_me:7725: found $ac_dir/$ac_word" >&5
7726 break
7727 done
7728
7729 fi
7730 fi
7731 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7732 if test -n "$NCURSES_CONFIG"; then
7733   echo "$as_me:7733: result: $NCURSES_CONFIG" >&5
7734 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7735 else
7736   echo "$as_me:7736: result: no" >&5
7737 echo "${ECHO_T}no" >&6
7738 fi
7739
7740     test -n "$NCURSES_CONFIG" && break
7741   done
7742 fi
7743 if test -z "$NCURSES_CONFIG"; then
7744   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7745   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7746 do
7747   # Extract the first word of "$ac_prog", so it can be a program name with args.
7748 set dummy $ac_prog; ac_word=$2
7749 echo "$as_me:7749: checking for $ac_word" >&5
7750 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7751 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7752   echo $ECHO_N "(cached) $ECHO_C" >&6
7753 else
7754   if test -n "$ac_ct_NCURSES_CONFIG"; then
7755   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7756 else
7757   ac_save_IFS=$IFS; IFS=$ac_path_separator
7758 ac_dummy="$PATH"
7759 for ac_dir in $ac_dummy; do
7760   IFS=$ac_save_IFS
7761   test -z "$ac_dir" && ac_dir=.
7762   $as_executable_p "$ac_dir/$ac_word" || continue
7763 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7764 echo "$as_me:7764: found $ac_dir/$ac_word" >&5
7765 break
7766 done
7767
7768 fi
7769 fi
7770 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7771 if test -n "$ac_ct_NCURSES_CONFIG"; then
7772   echo "$as_me:7772: result: $ac_ct_NCURSES_CONFIG" >&5
7773 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7774 else
7775   echo "$as_me:7775: result: no" >&5
7776 echo "${ECHO_T}no" >&6
7777 fi
7778
7779   test -n "$ac_ct_NCURSES_CONFIG" && break
7780 done
7781 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7782
7783   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7784 fi
7785
7786         if test "$NCURSES_CONFIG" != none ; then
7787
7788 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7789 do
7790         case "x$cf_add_cflags" in
7791         (x-[DU]*)
7792
7793 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7794 while true
7795 do
7796         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'`
7797         test "$CFLAGS" != "$cf_old_cflag" || break
7798
7799         CFLAGS="$cf_old_cflag"
7800 done
7801
7802 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
7803 while true
7804 do
7805         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'`
7806         test "$CPPFLAGS" != "$cf_old_cflag" || break
7807
7808         CPPFLAGS="$cf_old_cflag"
7809 done
7810
7811                 ;;
7812         esac
7813
7814 cf_fix_cppflags=no
7815 cf_new_cflags=
7816 cf_new_cppflags=
7817 cf_new_extra_cppflags=
7818
7819 for cf_add_cflags in $cf_add_cflags
7820 do
7821 case "$cf_fix_cppflags" in
7822 (no)
7823         case "$cf_add_cflags" in
7824         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7825                 case "$cf_add_cflags" in
7826                 (-D*)
7827                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7828
7829                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7830                                 && test -z "${cf_tst_cflags}" \
7831                                 && cf_fix_cppflags=yes
7832
7833                         if test "$cf_fix_cppflags" = yes ; then
7834
7835         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7836         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7837
7838                                 continue
7839                         elif test "${cf_tst_cflags}" = "\"'" ; then
7840
7841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7843
7844                                 continue
7845                         fi
7846                         ;;
7847                 esac
7848                 case "$CPPFLAGS" in
7849                 (*$cf_add_cflags)
7850                         ;;
7851                 (*)
7852                         case "$cf_add_cflags" in
7853                         (-D*)
7854                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7855
7856 CPPFLAGS=`echo "$CPPFLAGS" | \
7857         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7858                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7859
7860                                 ;;
7861                         esac
7862
7863         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7864         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7865
7866                         ;;
7867                 esac
7868                 ;;
7869         (*)
7870
7871         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7872         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7873
7874                 ;;
7875         esac
7876         ;;
7877 (yes)
7878
7879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7881
7882         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7883
7884         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7885                 && test -z "${cf_tst_cflags}" \
7886                 && cf_fix_cppflags=no
7887         ;;
7888 esac
7889 done
7890
7891 if test -n "$cf_new_cflags" ; then
7892
7893         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7894         CFLAGS="${CFLAGS}$cf_new_cflags"
7895
7896 fi
7897
7898 if test -n "$cf_new_cppflags" ; then
7899
7900         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7901         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7902
7903 fi
7904
7905 if test -n "$cf_new_extra_cppflags" ; then
7906
7907         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7908         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7909
7910 fi
7911
7912 done
7913
7914 cf_add_libs="$LIBS"
7915 # reverse order
7916 cf_add_0lib=
7917 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7918 # filter duplicates
7919 for cf_add_1lib in $cf_add_0lib; do
7920         for cf_add_2lib in $cf_add_libs; do
7921                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7922                         cf_add_1lib=
7923                         break
7924                 fi
7925         done
7926         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7927 done
7928 LIBS="$cf_add_libs"
7929
7930                 # even with config script, some packages use no-override for curses.h
7931
7932 echo "$as_me:7932: checking if we have identified curses headers" >&5
7933 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7934 if test "${cf_cv_ncurses_header+set}" = set; then
7935   echo $ECHO_N "(cached) $ECHO_C" >&6
7936 else
7937
7938 cf_cv_ncurses_header=none
7939 for cf_header in \
7940         ncurses.h ncursesw/ncurses.h \
7941         curses.h ncursesw/curses.h
7942 do
7943 cat >"conftest.$ac_ext" <<_ACEOF
7944 #line 7944 "configure"
7945 #include "confdefs.h"
7946 #include <${cf_header}>
7947 int
7948 main (void)
7949 {
7950 initscr(); tgoto("?", 0,0)
7951   ;
7952   return 0;
7953 }
7954 _ACEOF
7955 rm -f "conftest.$ac_objext"
7956 if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5
7957   (eval $ac_compile) 2>&5
7958   ac_status=$?
7959   echo "$as_me:7959: \$? = $ac_status" >&5
7960   (exit "$ac_status"); } &&
7961          { ac_try='test -s "conftest.$ac_objext"'
7962   { (eval echo "$as_me:7962: \"$ac_try\"") >&5
7963   (eval $ac_try) 2>&5
7964   ac_status=$?
7965   echo "$as_me:7965: \$? = $ac_status" >&5
7966   (exit "$ac_status"); }; }; then
7967   cf_cv_ncurses_header=$cf_header; break
7968 else
7969   echo "$as_me: failed program was:" >&5
7970 cat "conftest.$ac_ext" >&5
7971 fi
7972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7973 done
7974
7975 fi
7976 echo "$as_me:7976: result: $cf_cv_ncurses_header" >&5
7977 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7978
7979 if test "$cf_cv_ncurses_header" = none ; then
7980         { { echo "$as_me:7980: error: No curses header-files found" >&5
7981 echo "$as_me: error: No curses header-files found" >&2;}
7982    { (exit 1); exit 1; }; }
7983 fi
7984
7985 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7986
7987 for ac_header in $cf_cv_ncurses_header
7988 do
7989 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7990 echo "$as_me:7990: checking for $ac_header" >&5
7991 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7992 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7993   echo $ECHO_N "(cached) $ECHO_C" >&6
7994 else
7995   cat >"conftest.$ac_ext" <<_ACEOF
7996 #line 7996 "configure"
7997 #include "confdefs.h"
7998 #include <$ac_header>
7999 _ACEOF
8000 if { (eval echo "$as_me:8000: \"$ac_cpp "conftest.$ac_ext"\"") >&5
8001   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
8002   ac_status=$?
8003   $EGREP -v '^ *\+' conftest.er1 >conftest.err
8004   rm -f conftest.er1
8005   cat conftest.err >&5
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit "$ac_status"); } >/dev/null; then
8008   if test -s conftest.err; then
8009     ac_cpp_err=$ac_c_preproc_warn_flag
8010   else
8011     ac_cpp_err=
8012   fi
8013 else
8014   ac_cpp_err=yes
8015 fi
8016 if test -z "$ac_cpp_err"; then
8017   eval "$as_ac_Header=yes"
8018 else
8019   echo "$as_me: failed program was:" >&5
8020   cat "conftest.$ac_ext" >&5
8021   eval "$as_ac_Header=no"
8022 fi
8023 rm -f conftest.err "conftest.$ac_ext"
8024 fi
8025 echo "$as_me:8025: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
8026 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
8027 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
8028   cat >>confdefs.h <<EOF
8029 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8030 EOF
8031
8032 fi
8033 done
8034
8035 cat >>confdefs.h <<\EOF
8036 #define NCURSES 1
8037 EOF
8038
8039 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8040
8041                 cat >>confdefs.h <<EOF
8042 #define $cf_nculib_ROOT 1
8043 EOF
8044
8045                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
8046
8047         else
8048
8049 cf_ncuhdr_root=ncursesw
8050
8051 test -n "$cf_cv_curses_dir" && \
8052 test "$cf_cv_curses_dir" != "no" && { \
8053
8054 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8055   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8056   do
8057         while test "$cf_add_incdir" != /usr/include
8058         do
8059           if test -d "$cf_add_incdir"
8060           then
8061                 cf_have_incdir=no
8062                 if test -n "$CFLAGS$CPPFLAGS" ; then
8063                   # a loop is needed to ensure we can add subdirs of existing dirs
8064                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8065                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8066                           cf_have_incdir=yes; break
8067                         fi
8068                   done
8069                 fi
8070
8071                 if test "$cf_have_incdir" = no ; then
8072                   if test "$cf_add_incdir" = /usr/local/include ; then
8073                         if test "$GCC" = yes
8074                         then
8075                           cf_save_CPPFLAGS=$CPPFLAGS
8076
8077         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8078         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8079
8080                           cat >"conftest.$ac_ext" <<_ACEOF
8081 #line 8081 "configure"
8082 #include "confdefs.h"
8083 #include <stdio.h>
8084 int
8085 main (void)
8086 {
8087 printf("Hello")
8088   ;
8089   return 0;
8090 }
8091 _ACEOF
8092 rm -f "conftest.$ac_objext"
8093 if { (eval echo "$as_me:8093: \"$ac_compile\"") >&5
8094   (eval $ac_compile) 2>&5
8095   ac_status=$?
8096   echo "$as_me:8096: \$? = $ac_status" >&5
8097   (exit "$ac_status"); } &&
8098          { ac_try='test -s "conftest.$ac_objext"'
8099   { (eval echo "$as_me:8099: \"$ac_try\"") >&5
8100   (eval $ac_try) 2>&5
8101   ac_status=$?
8102   echo "$as_me:8102: \$? = $ac_status" >&5
8103   (exit "$ac_status"); }; }; then
8104   :
8105 else
8106   echo "$as_me: failed program was:" >&5
8107 cat "conftest.$ac_ext" >&5
8108 cf_have_incdir=yes
8109 fi
8110 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8111                           CPPFLAGS=$cf_save_CPPFLAGS
8112                         fi
8113                   fi
8114                 fi
8115
8116                 if test "$cf_have_incdir" = no ; then
8117                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8118
8119 echo "${as_me:-configure}:8119: testing adding $cf_add_incdir to include-path ..." 1>&5
8120
8121                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8122
8123                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8124                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8125                   cf_add_incdir="$cf_top_incdir"
8126                 else
8127                   break
8128                 fi
8129           else
8130                 break
8131           fi
8132         done
8133   done
8134 fi
8135
8136 }
8137
8138 echo "$as_me:8138: checking for $cf_ncuhdr_root header in include-path" >&5
8139 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8140 if test "${cf_cv_ncurses_h+set}" = set; then
8141   echo $ECHO_N "(cached) $ECHO_C" >&6
8142 else
8143
8144         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8145         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
8146         for cf_header in $cf_header_list
8147         do
8148
8149         cat >"conftest.$ac_ext" <<_ACEOF
8150 #line 8150 "configure"
8151 #include "confdefs.h"
8152
8153 #define _XOPEN_SOURCE_EXTENDED
8154 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8155 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8156
8157 #include <$cf_header>
8158 int
8159 main (void)
8160 {
8161
8162 #ifdef NCURSES_VERSION
8163
8164 #ifndef WACS_BSSB
8165         make an error
8166 #endif
8167
8168 printf("%s\\n", NCURSES_VERSION);
8169 #else
8170 #ifdef __NCURSES_H
8171 printf("old\\n");
8172 #else
8173         make an error
8174 #endif
8175 #endif
8176
8177   ;
8178   return 0;
8179 }
8180 _ACEOF
8181 rm -f "conftest.$ac_objext"
8182 if { (eval echo "$as_me:8182: \"$ac_compile\"") >&5
8183   (eval $ac_compile) 2>&5
8184   ac_status=$?
8185   echo "$as_me:8185: \$? = $ac_status" >&5
8186   (exit "$ac_status"); } &&
8187          { ac_try='test -s "conftest.$ac_objext"'
8188   { (eval echo "$as_me:8188: \"$ac_try\"") >&5
8189   (eval $ac_try) 2>&5
8190   ac_status=$?
8191   echo "$as_me:8191: \$? = $ac_status" >&5
8192   (exit "$ac_status"); }; }; then
8193   cf_cv_ncurses_h=$cf_header
8194
8195 else
8196   echo "$as_me: failed program was:" >&5
8197 cat "conftest.$ac_ext" >&5
8198 cf_cv_ncurses_h=no
8199 fi
8200 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8201
8202                 test "$cf_cv_ncurses_h" != no && break
8203         done
8204
8205 fi
8206 echo "$as_me:8206: result: $cf_cv_ncurses_h" >&5
8207 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8208
8209 if test "$cf_cv_ncurses_h" != no ; then
8210         cf_cv_ncurses_header=$cf_cv_ncurses_h
8211 else
8212
8213 echo "$as_me:8213: checking for $cf_ncuhdr_root include-path" >&5
8214 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8215 if test "${cf_cv_ncurses_h2+set}" = set; then
8216   echo $ECHO_N "(cached) $ECHO_C" >&6
8217 else
8218
8219         test -n "$verbose" && echo
8220
8221 cf_search=
8222
8223 # collect the current set of include-directories from compiler flags
8224 cf_header_path_list=""
8225 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8226         for cf_header_path in $CPPFLAGS $CFLAGS
8227         do
8228                 case "$cf_header_path" in
8229                 (-I*)
8230                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8231
8232 test "x$cf_header_path" != "xNONE" && \
8233 test -d "$cf_header_path" && \
8234  {
8235         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8236         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8237         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8238         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8239         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8240         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"
8241 }
8242
8243                         cf_header_path_list="$cf_header_path_list $cf_search"
8244                         ;;
8245                 esac
8246         done
8247 fi
8248
8249 # add the variations for the package we are looking for
8250
8251 cf_search=
8252
8253 test "x$prefix" != "xNONE" && \
8254 test -d "$prefix" && \
8255  {
8256         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8257         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8258         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8259         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8260         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8261         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8262 }
8263
8264 for cf_subdir_prefix in \
8265         /usr \
8266         /usr/local \
8267         /usr/pkg \
8268         /opt \
8269         /opt/local \
8270         $HOME
8271 do
8272
8273 test "x$cf_subdir_prefix" != "x$prefix" && \
8274 test -d "$cf_subdir_prefix" && \
8275 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8276         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8277         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8278         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8279         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8280         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8281         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"
8282 }
8283
8284 done
8285
8286 test "$includedir" != NONE && \
8287 test "$includedir" != "/usr/include" && \
8288 test -d "$includedir" && {
8289         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8290         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8291 }
8292
8293 test "$oldincludedir" != NONE && \
8294 test "$oldincludedir" != "/usr/include" && \
8295 test -d "$oldincludedir" && {
8296         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8297         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8298 }
8299
8300 cf_search="$cf_search $cf_header_path_list"
8301
8302         test -n "$verbose" && echo "search path $cf_search"
8303         cf_save2_CPPFLAGS="$CPPFLAGS"
8304         for cf_incdir in $cf_search
8305         do
8306
8307 if test -n "$cf_incdir" ; then
8308   for cf_add_incdir in $cf_incdir
8309   do
8310         while test "$cf_add_incdir" != /usr/include
8311         do
8312           if test -d "$cf_add_incdir"
8313           then
8314                 cf_have_incdir=no
8315                 if test -n "$CFLAGS$CPPFLAGS" ; then
8316                   # a loop is needed to ensure we can add subdirs of existing dirs
8317                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8318                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8319                           cf_have_incdir=yes; break
8320                         fi
8321                   done
8322                 fi
8323
8324                 if test "$cf_have_incdir" = no ; then
8325                   if test "$cf_add_incdir" = /usr/local/include ; then
8326                         if test "$GCC" = yes
8327                         then
8328                           cf_save_CPPFLAGS=$CPPFLAGS
8329
8330         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8331         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8332
8333                           cat >"conftest.$ac_ext" <<_ACEOF
8334 #line 8334 "configure"
8335 #include "confdefs.h"
8336 #include <stdio.h>
8337 int
8338 main (void)
8339 {
8340 printf("Hello")
8341   ;
8342   return 0;
8343 }
8344 _ACEOF
8345 rm -f "conftest.$ac_objext"
8346 if { (eval echo "$as_me:8346: \"$ac_compile\"") >&5
8347   (eval $ac_compile) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit "$ac_status"); } &&
8351          { ac_try='test -s "conftest.$ac_objext"'
8352   { (eval echo "$as_me:8352: \"$ac_try\"") >&5
8353   (eval $ac_try) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit "$ac_status"); }; }; then
8357   :
8358 else
8359   echo "$as_me: failed program was:" >&5
8360 cat "conftest.$ac_ext" >&5
8361 cf_have_incdir=yes
8362 fi
8363 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8364                           CPPFLAGS=$cf_save_CPPFLAGS
8365                         fi
8366                   fi
8367                 fi
8368
8369                 if test "$cf_have_incdir" = no ; then
8370                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8371
8372 echo "${as_me:-configure}:8372: testing adding $cf_add_incdir to include-path ..." 1>&5
8373
8374                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8375
8376                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8377                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8378                   cf_add_incdir="$cf_top_incdir"
8379                 else
8380                   break
8381                 fi
8382           else
8383                 break
8384           fi
8385         done
8386   done
8387 fi
8388
8389                 for cf_header in \
8390                         ncurses.h \
8391                         curses.h
8392                 do
8393
8394         cat >"conftest.$ac_ext" <<_ACEOF
8395 #line 8395 "configure"
8396 #include "confdefs.h"
8397
8398 #include <$cf_header>
8399 int
8400 main (void)
8401 {
8402
8403 #ifdef NCURSES_VERSION
8404
8405 printf("%s\\n", NCURSES_VERSION);
8406 #else
8407 #ifdef __NCURSES_H
8408 printf("old\\n");
8409 #else
8410         make an error
8411 #endif
8412 #endif
8413
8414   ;
8415   return 0;
8416 }
8417 _ACEOF
8418 rm -f "conftest.$ac_objext"
8419 if { (eval echo "$as_me:8419: \"$ac_compile\"") >&5
8420   (eval $ac_compile) 2>&5
8421   ac_status=$?
8422   echo "$as_me:8422: \$? = $ac_status" >&5
8423   (exit "$ac_status"); } &&
8424          { ac_try='test -s "conftest.$ac_objext"'
8425   { (eval echo "$as_me:8425: \"$ac_try\"") >&5
8426   (eval $ac_try) 2>&5
8427   ac_status=$?
8428   echo "$as_me:8428: \$? = $ac_status" >&5
8429   (exit "$ac_status"); }; }; then
8430   cf_cv_ncurses_h2=$cf_header
8431
8432 else
8433   echo "$as_me: failed program was:" >&5
8434 cat "conftest.$ac_ext" >&5
8435 cf_cv_ncurses_h2=no
8436 fi
8437 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8438
8439                         if test "$cf_cv_ncurses_h2" != no ; then
8440                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8441                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8442                                 break
8443                         fi
8444                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8445                 done
8446                 CPPFLAGS="$cf_save2_CPPFLAGS"
8447                 test "$cf_cv_ncurses_h2" != no && break
8448         done
8449         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8449: error: not found" >&5
8450 echo "$as_me: error: not found" >&2;}
8451    { (exit 1); exit 1; }; }
8452
8453 fi
8454 echo "$as_me:8454: result: $cf_cv_ncurses_h2" >&5
8455 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8456
8457         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8458         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8459         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8460                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8461         fi
8462
8463 if test -n "$cf_1st_incdir" ; then
8464   for cf_add_incdir in $cf_1st_incdir
8465   do
8466         while test "$cf_add_incdir" != /usr/include
8467         do
8468           if test -d "$cf_add_incdir"
8469           then
8470                 cf_have_incdir=no
8471                 if test -n "$CFLAGS$CPPFLAGS" ; then
8472                   # a loop is needed to ensure we can add subdirs of existing dirs
8473                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8474                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8475                           cf_have_incdir=yes; break
8476                         fi
8477                   done
8478                 fi
8479
8480                 if test "$cf_have_incdir" = no ; then
8481                   if test "$cf_add_incdir" = /usr/local/include ; then
8482                         if test "$GCC" = yes
8483                         then
8484                           cf_save_CPPFLAGS=$CPPFLAGS
8485
8486         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8487         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8488
8489                           cat >"conftest.$ac_ext" <<_ACEOF
8490 #line 8490 "configure"
8491 #include "confdefs.h"
8492 #include <stdio.h>
8493 int
8494 main (void)
8495 {
8496 printf("Hello")
8497   ;
8498   return 0;
8499 }
8500 _ACEOF
8501 rm -f "conftest.$ac_objext"
8502 if { (eval echo "$as_me:8502: \"$ac_compile\"") >&5
8503   (eval $ac_compile) 2>&5
8504   ac_status=$?
8505   echo "$as_me:8505: \$? = $ac_status" >&5
8506   (exit "$ac_status"); } &&
8507          { ac_try='test -s "conftest.$ac_objext"'
8508   { (eval echo "$as_me:8508: \"$ac_try\"") >&5
8509   (eval $ac_try) 2>&5
8510   ac_status=$?
8511   echo "$as_me:8511: \$? = $ac_status" >&5
8512   (exit "$ac_status"); }; }; then
8513   :
8514 else
8515   echo "$as_me: failed program was:" >&5
8516 cat "conftest.$ac_ext" >&5
8517 cf_have_incdir=yes
8518 fi
8519 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8520                           CPPFLAGS=$cf_save_CPPFLAGS
8521                         fi
8522                   fi
8523                 fi
8524
8525                 if test "$cf_have_incdir" = no ; then
8526                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8527
8528 echo "${as_me:-configure}:8528: testing adding $cf_add_incdir to include-path ..." 1>&5
8529
8530                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8531
8532                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8533                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8534                   cf_add_incdir="$cf_top_incdir"
8535                 else
8536                   break
8537                 fi
8538           else
8539                 break
8540           fi
8541         done
8542   done
8543 fi
8544
8545 fi
8546
8547 # Set definitions to allow ifdef'ing for ncurses.h
8548
8549 case "$cf_cv_ncurses_header" in
8550 (*ncurses.h)
8551
8552 cat >>confdefs.h <<\EOF
8553 #define HAVE_NCURSES_H 1
8554 EOF
8555
8556         ;;
8557 esac
8558
8559 case "$cf_cv_ncurses_header" in
8560 (ncurses/curses.h|ncurses/ncurses.h)
8561
8562 cat >>confdefs.h <<\EOF
8563 #define HAVE_NCURSES_NCURSES_H 1
8564 EOF
8565
8566         ;;
8567 (ncursesw/curses.h|ncursesw/ncurses.h)
8568
8569 cat >>confdefs.h <<\EOF
8570 #define HAVE_NCURSESW_NCURSES_H 1
8571 EOF
8572
8573         ;;
8574 esac
8575
8576 echo "$as_me:8576: checking for terminfo header" >&5
8577 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8578 if test "${cf_cv_term_header+set}" = set; then
8579   echo $ECHO_N "(cached) $ECHO_C" >&6
8580 else
8581
8582 case "${cf_cv_ncurses_header}" in
8583 (*/ncurses.h|*/ncursesw.h)
8584         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8585         ;;
8586 (*)
8587         cf_term_header=term.h
8588         ;;
8589 esac
8590
8591 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8592 do
8593 cat >"conftest.$ac_ext" <<_ACEOF
8594 #line 8594 "configure"
8595 #include "confdefs.h"
8596 #include <stdio.h>
8597 #include <${cf_cv_ncurses_header:-curses.h}>
8598 #include <$cf_test>
8599
8600 int
8601 main (void)
8602 {
8603 int x = auto_left_margin; (void)x
8604   ;
8605   return 0;
8606 }
8607 _ACEOF
8608 rm -f "conftest.$ac_objext"
8609 if { (eval echo "$as_me:8609: \"$ac_compile\"") >&5
8610   (eval $ac_compile) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit "$ac_status"); } &&
8614          { ac_try='test -s "conftest.$ac_objext"'
8615   { (eval echo "$as_me:8615: \"$ac_try\"") >&5
8616   (eval $ac_try) 2>&5
8617   ac_status=$?
8618   echo "$as_me:8618: \$? = $ac_status" >&5
8619   (exit "$ac_status"); }; }; then
8620
8621         cf_cv_term_header="$cf_test"
8622 else
8623   echo "$as_me: failed program was:" >&5
8624 cat "conftest.$ac_ext" >&5
8625
8626         cf_cv_term_header=unknown
8627
8628 fi
8629 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8630         test "$cf_cv_term_header" != unknown && break
8631 done
8632
8633 fi
8634 echo "$as_me:8634: result: $cf_cv_term_header" >&5
8635 echo "${ECHO_T}$cf_cv_term_header" >&6
8636
8637 # Set definitions to allow ifdef'ing to accommodate subdirectories
8638
8639 case "$cf_cv_term_header" in
8640 (*term.h)
8641
8642 cat >>confdefs.h <<\EOF
8643 #define HAVE_TERM_H 1
8644 EOF
8645
8646         ;;
8647 esac
8648
8649 case "$cf_cv_term_header" in
8650 (ncurses/term.h)
8651
8652 cat >>confdefs.h <<\EOF
8653 #define HAVE_NCURSES_TERM_H 1
8654 EOF
8655
8656         ;;
8657 (ncursesw/term.h)
8658
8659 cat >>confdefs.h <<\EOF
8660 #define HAVE_NCURSESW_TERM_H 1
8661 EOF
8662
8663         ;;
8664 esac
8665
8666 # some applications need this, but should check for NCURSES_VERSION
8667
8668 cat >>confdefs.h <<\EOF
8669 #define NCURSES 1
8670 EOF
8671
8672 echo "$as_me:8672: checking for ncurses version" >&5
8673 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8674 if test "${cf_cv_ncurses_version+set}" = set; then
8675   echo $ECHO_N "(cached) $ECHO_C" >&6
8676 else
8677
8678         cf_cv_ncurses_version=no
8679         cf_tempfile=out$$
8680         rm -f "$cf_tempfile"
8681         if test "$cross_compiling" = yes; then
8682
8683         # This will not work if the preprocessor splits the line after the
8684         # Autoconf token.  The 'unproto' program does that.
8685         cat > "conftest.$ac_ext" <<EOF
8686 #include <${cf_cv_ncurses_header:-curses.h}>
8687 #undef Autoconf
8688 #ifdef NCURSES_VERSION
8689 Autoconf NCURSES_VERSION
8690 #else
8691 #ifdef __NCURSES_H
8692 Autoconf "old"
8693 #endif
8694 ;
8695 #endif
8696 EOF
8697         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8698         { (eval echo "$as_me:8698: \"$cf_try\"") >&5
8699   (eval $cf_try) 2>&5
8700   ac_status=$?
8701   echo "$as_me:8701: \$? = $ac_status" >&5
8702   (exit "$ac_status"); }
8703         if test -f conftest.out ; then
8704                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8705                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8706                 rm -f conftest.out
8707         fi
8708
8709 else
8710   cat >"conftest.$ac_ext" <<_ACEOF
8711 #line 8711 "configure"
8712 #include "confdefs.h"
8713
8714 #include <${cf_cv_ncurses_header:-curses.h}>
8715 #include <stdio.h>
8716 int main(void)
8717 {
8718         FILE *fp = fopen("$cf_tempfile", "w");
8719 #ifdef NCURSES_VERSION
8720 # ifdef NCURSES_VERSION_PATCH
8721         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8722 # else
8723         fprintf(fp, "%s\\n", NCURSES_VERSION);
8724 # endif
8725 #else
8726 # ifdef __NCURSES_H
8727         fprintf(fp, "old\\n");
8728 # else
8729         make an error
8730 # endif
8731 #endif
8732         ${cf_cv_main_return:-return}(0);
8733 }
8734 _ACEOF
8735 rm -f "conftest$ac_exeext"
8736 if { (eval echo "$as_me:8736: \"$ac_link\"") >&5
8737   (eval $ac_link) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8741   { (eval echo "$as_me:8741: \"$ac_try\"") >&5
8742   (eval $ac_try) 2>&5
8743   ac_status=$?
8744   echo "$as_me:8744: \$? = $ac_status" >&5
8745   (exit "$ac_status"); }; }; then
8746
8747         cf_cv_ncurses_version=`cat $cf_tempfile`
8748 else
8749   echo "$as_me: program exited with status $ac_status" >&5
8750 echo "$as_me: failed program was:" >&5
8751 cat "conftest.$ac_ext" >&5
8752 fi
8753 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8754 fi
8755         rm -f "$cf_tempfile"
8756
8757 fi
8758 echo "$as_me:8758: result: $cf_cv_ncurses_version" >&5
8759 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8760 test "$cf_cv_ncurses_version" = no ||
8761 cat >>confdefs.h <<\EOF
8762 #define NCURSES 1
8763 EOF
8764
8765 cf_nculib_root=ncursesw
8766         # This works, except for the special case where we find gpm, but
8767         # ncurses is in a nonstandard location via $LIBS, and we really want
8768         # to link gpm.
8769 cf_ncurses_LIBS=""
8770 cf_ncurses_SAVE="$LIBS"
8771 echo "$as_me:8771: checking for Gpm_Open in -lgpm" >&5
8772 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8773 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8774   echo $ECHO_N "(cached) $ECHO_C" >&6
8775 else
8776   ac_check_lib_save_LIBS=$LIBS
8777 LIBS="-lgpm  $LIBS"
8778 cat >"conftest.$ac_ext" <<_ACEOF
8779 #line 8779 "configure"
8780 #include "confdefs.h"
8781
8782 /* Override any gcc2 internal prototype to avoid an error.  */
8783 #ifdef __cplusplus
8784 extern "C"
8785 #endif
8786 /* We use char because int might match the return type of a gcc2
8787    builtin and then its argument prototype would still apply.  */
8788 char Gpm_Open ();
8789 int
8790 main (void)
8791 {
8792 Gpm_Open ();
8793   ;
8794   return 0;
8795 }
8796 _ACEOF
8797 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8798 if { (eval echo "$as_me:8798: \"$ac_link\"") >&5
8799   (eval $ac_link) 2>&5
8800   ac_status=$?
8801   echo "$as_me:8801: \$? = $ac_status" >&5
8802   (exit "$ac_status"); } &&
8803          { ac_try='test -s "conftest$ac_exeext"'
8804   { (eval echo "$as_me:8804: \"$ac_try\"") >&5
8805   (eval $ac_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit "$ac_status"); }; }; then
8809   ac_cv_lib_gpm_Gpm_Open=yes
8810 else
8811   echo "$as_me: failed program was:" >&5
8812 cat "conftest.$ac_ext" >&5
8813 ac_cv_lib_gpm_Gpm_Open=no
8814 fi
8815 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8816 LIBS=$ac_check_lib_save_LIBS
8817 fi
8818 echo "$as_me:8818: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8819 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8820 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8821   echo "$as_me:8821: checking for initscr in -lgpm" >&5
8822 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8823 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8824   echo $ECHO_N "(cached) $ECHO_C" >&6
8825 else
8826   ac_check_lib_save_LIBS=$LIBS
8827 LIBS="-lgpm  $LIBS"
8828 cat >"conftest.$ac_ext" <<_ACEOF
8829 #line 8829 "configure"
8830 #include "confdefs.h"
8831
8832 /* Override any gcc2 internal prototype to avoid an error.  */
8833 #ifdef __cplusplus
8834 extern "C"
8835 #endif
8836 /* We use char because int might match the return type of a gcc2
8837    builtin and then its argument prototype would still apply.  */
8838 char initscr ();
8839 int
8840 main (void)
8841 {
8842 initscr ();
8843   ;
8844   return 0;
8845 }
8846 _ACEOF
8847 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8848 if { (eval echo "$as_me:8848: \"$ac_link\"") >&5
8849   (eval $ac_link) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit "$ac_status"); } &&
8853          { ac_try='test -s "conftest$ac_exeext"'
8854   { (eval echo "$as_me:8854: \"$ac_try\"") >&5
8855   (eval $ac_try) 2>&5
8856   ac_status=$?
8857   echo "$as_me:8857: \$? = $ac_status" >&5
8858   (exit "$ac_status"); }; }; then
8859   ac_cv_lib_gpm_initscr=yes
8860 else
8861   echo "$as_me: failed program was:" >&5
8862 cat "conftest.$ac_ext" >&5
8863 ac_cv_lib_gpm_initscr=no
8864 fi
8865 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8866 LIBS=$ac_check_lib_save_LIBS
8867 fi
8868 echo "$as_me:8868: result: $ac_cv_lib_gpm_initscr" >&5
8869 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8870 if test "$ac_cv_lib_gpm_initscr" = yes; then
8871   LIBS="$cf_ncurses_SAVE"
8872 else
8873   cf_ncurses_LIBS="-lgpm"
8874 fi
8875
8876 fi
8877
8878 case "$host_os" in
8879 (freebsd*)
8880         # This is only necessary if you are linking against an obsolete
8881         # version of ncurses (but it should do no harm, since it is static).
8882         if test "$cf_nculib_root" = ncurses ; then
8883                 echo "$as_me:8883: checking for tgoto in -lmytinfo" >&5
8884 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8885 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8886   echo $ECHO_N "(cached) $ECHO_C" >&6
8887 else
8888   ac_check_lib_save_LIBS=$LIBS
8889 LIBS="-lmytinfo  $LIBS"
8890 cat >"conftest.$ac_ext" <<_ACEOF
8891 #line 8891 "configure"
8892 #include "confdefs.h"
8893
8894 /* Override any gcc2 internal prototype to avoid an error.  */
8895 #ifdef __cplusplus
8896 extern "C"
8897 #endif
8898 /* We use char because int might match the return type of a gcc2
8899    builtin and then its argument prototype would still apply.  */
8900 char tgoto ();
8901 int
8902 main (void)
8903 {
8904 tgoto ();
8905   ;
8906   return 0;
8907 }
8908 _ACEOF
8909 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8910 if { (eval echo "$as_me:8910: \"$ac_link\"") >&5
8911   (eval $ac_link) 2>&5
8912   ac_status=$?
8913   echo "$as_me:8913: \$? = $ac_status" >&5
8914   (exit "$ac_status"); } &&
8915          { ac_try='test -s "conftest$ac_exeext"'
8916   { (eval echo "$as_me:8916: \"$ac_try\"") >&5
8917   (eval $ac_try) 2>&5
8918   ac_status=$?
8919   echo "$as_me:8919: \$? = $ac_status" >&5
8920   (exit "$ac_status"); }; }; then
8921   ac_cv_lib_mytinfo_tgoto=yes
8922 else
8923   echo "$as_me: failed program was:" >&5
8924 cat "conftest.$ac_ext" >&5
8925 ac_cv_lib_mytinfo_tgoto=no
8926 fi
8927 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8928 LIBS=$ac_check_lib_save_LIBS
8929 fi
8930 echo "$as_me:8930: result: $ac_cv_lib_mytinfo_tgoto" >&5
8931 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8932 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8933   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8934 fi
8935
8936         fi
8937         ;;
8938 esac
8939
8940 cf_add_libs="$LIBS"
8941 # reverse order
8942 cf_add_0lib=
8943 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8944 # filter duplicates
8945 for cf_add_1lib in $cf_add_0lib; do
8946         for cf_add_2lib in $cf_add_libs; do
8947                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8948                         cf_add_1lib=
8949                         break
8950                 fi
8951         done
8952         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8953 done
8954 LIBS="$cf_add_libs"
8955
8956 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8957 then
8958
8959 cf_add_libs="$LIBS"
8960 # reverse order
8961 cf_add_0lib=
8962 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8963 # filter duplicates
8964 for cf_add_1lib in $cf_add_0lib; do
8965         for cf_add_2lib in $cf_add_libs; do
8966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8967                         cf_add_1lib=
8968                         break
8969                 fi
8970         done
8971         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8972 done
8973 LIBS="$cf_add_libs"
8974
8975 else
8976
8977         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8978         cf_libdir=""
8979         echo "$as_me:8979: checking for initscr" >&5
8980 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8981 if test "${ac_cv_func_initscr+set}" = set; then
8982   echo $ECHO_N "(cached) $ECHO_C" >&6
8983 else
8984   cat >"conftest.$ac_ext" <<_ACEOF
8985 #line 8985 "configure"
8986 #include "confdefs.h"
8987 #define initscr autoconf_temporary
8988 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8989 #undef initscr
8990
8991 #ifdef __cplusplus
8992 extern "C"
8993 #endif
8994
8995 /* We use char because int might match the return type of a gcc2
8996    builtin and then its argument prototype would still apply.  */
8997 char initscr (void);
8998
8999 int
9000 main (void)
9001 {
9002
9003 /* The GNU C library defines stubs for functions which it implements
9004     to always fail with ENOSYS.  Some functions are actually named
9005     something starting with __ and the normal name is an alias.  */
9006 #if defined (__stub_initscr) || defined (__stub___initscr)
9007 #error found stub for initscr
9008 #endif
9009
9010         return initscr ();
9011   ;
9012   return 0;
9013 }
9014 _ACEOF
9015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9016 if { (eval echo "$as_me:9016: \"$ac_link\"") >&5
9017   (eval $ac_link) 2>&5
9018   ac_status=$?
9019   echo "$as_me:9019: \$? = $ac_status" >&5
9020   (exit "$ac_status"); } &&
9021          { ac_try='test -s "conftest$ac_exeext"'
9022   { (eval echo "$as_me:9022: \"$ac_try\"") >&5
9023   (eval $ac_try) 2>&5
9024   ac_status=$?
9025   echo "$as_me:9025: \$? = $ac_status" >&5
9026   (exit "$ac_status"); }; }; then
9027   ac_cv_func_initscr=yes
9028 else
9029   echo "$as_me: failed program was:" >&5
9030 cat "conftest.$ac_ext" >&5
9031 ac_cv_func_initscr=no
9032 fi
9033 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9034 fi
9035 echo "$as_me:9035: result: $ac_cv_func_initscr" >&5
9036 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9037 if test "$ac_cv_func_initscr" = yes; then
9038   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9039 else
9040
9041                 cf_save_LIBS="$LIBS"
9042                 echo "$as_me:9042: checking for initscr in -l$cf_nculib_root" >&5
9043 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9044                 LIBS="-l$cf_nculib_root $LIBS"
9045                 cat >"conftest.$ac_ext" <<_ACEOF
9046 #line 9046 "configure"
9047 #include "confdefs.h"
9048 #include <${cf_cv_ncurses_header:-curses.h}>
9049 int
9050 main (void)
9051 {
9052 initscr()
9053   ;
9054   return 0;
9055 }
9056 _ACEOF
9057 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9058 if { (eval echo "$as_me:9058: \"$ac_link\"") >&5
9059   (eval $ac_link) 2>&5
9060   ac_status=$?
9061   echo "$as_me:9061: \$? = $ac_status" >&5
9062   (exit "$ac_status"); } &&
9063          { ac_try='test -s "conftest$ac_exeext"'
9064   { (eval echo "$as_me:9064: \"$ac_try\"") >&5
9065   (eval $ac_try) 2>&5
9066   ac_status=$?
9067   echo "$as_me:9067: \$? = $ac_status" >&5
9068   (exit "$ac_status"); }; }; then
9069   echo "$as_me:9069: result: yes" >&5
9070 echo "${ECHO_T}yes" >&6
9071                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9072
9073 else
9074   echo "$as_me: failed program was:" >&5
9075 cat "conftest.$ac_ext" >&5
9076 echo "$as_me:9076: result: no" >&5
9077 echo "${ECHO_T}no" >&6
9078
9079 cf_search=
9080 cf_library_path_list=""
9081 if test -n "${LDFLAGS}${LIBS}" ; then
9082         for cf_library_path in $LDFLAGS $LIBS
9083         do
9084                 case "$cf_library_path" in
9085                 (-L*)
9086                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9087
9088 test "x$cf_library_path" != "xNONE" && \
9089 test -d "$cf_library_path" && \
9090  {
9091         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9092         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
9093         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9094         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9095         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9096         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"
9097 }
9098
9099                         cf_library_path_list="$cf_library_path_list $cf_search"
9100                         ;;
9101                 esac
9102         done
9103 fi
9104
9105 cf_search=
9106
9107 test "x$prefix" != "xNONE" && \
9108 test -d "$prefix" && \
9109  {
9110         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9111         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
9112         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9113         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9114         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9115         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9116 }
9117
9118 for cf_subdir_prefix in \
9119         /usr \
9120         /usr/local \
9121         /usr/pkg \
9122         /opt \
9123         /opt/local \
9124         $HOME
9125 do
9126
9127 test "x$cf_subdir_prefix" != "x$prefix" && \
9128 test -d "$cf_subdir_prefix" && \
9129 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
9130         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9131         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9132         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9133         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9134         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9135         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"
9136 }
9137
9138 done
9139
9140 cf_search="$cf_library_path_list $cf_search"
9141
9142                         for cf_libdir in $cf_search
9143                         do
9144                                 echo "$as_me:9144: checking for -l$cf_nculib_root in $cf_libdir" >&5
9145 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9146                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9147                                 cat >"conftest.$ac_ext" <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150 #include <${cf_cv_ncurses_header:-curses.h}>
9151 int
9152 main (void)
9153 {
9154 initscr()
9155   ;
9156   return 0;
9157 }
9158 _ACEOF
9159 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9160 if { (eval echo "$as_me:9160: \"$ac_link\"") >&5
9161   (eval $ac_link) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit "$ac_status"); } &&
9165          { ac_try='test -s "conftest$ac_exeext"'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit "$ac_status"); }; }; then
9171   echo "$as_me:9171: result: yes" >&5
9172 echo "${ECHO_T}yes" >&6
9173                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
9174                                          break
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat "conftest.$ac_ext" >&5
9178 echo "$as_me:9178: result: no" >&5
9179 echo "${ECHO_T}no" >&6
9180                                          LIBS="$cf_save_LIBS"
9181 fi
9182 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9183                         done
9184
9185 fi
9186 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9187
9188 fi
9189
9190 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
9191
9192 if test "$cf_found_library" = no ; then
9193         { { echo "$as_me:9193: error: Cannot link $cf_nculib_root library" >&5
9194 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9195    { (exit 1); exit 1; }; }
9196 fi
9197
9198 fi
9199
9200 if test -n "$cf_ncurses_LIBS" ; then
9201         echo "$as_me:9201: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9202 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9203         cf_ncurses_SAVE="$LIBS"
9204         for p in $cf_ncurses_LIBS ; do
9205                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
9206                 if test "$q" != "$LIBS" ; then
9207                         LIBS="$q"
9208                 fi
9209         done
9210         cat >"conftest.$ac_ext" <<_ACEOF
9211 #line 9211 "configure"
9212 #include "confdefs.h"
9213 #include <${cf_cv_ncurses_header:-curses.h}>
9214 int
9215 main (void)
9216 {
9217 initscr(); mousemask(0,0); tigetstr((char *)0);
9218   ;
9219   return 0;
9220 }
9221 _ACEOF
9222 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9223 if { (eval echo "$as_me:9223: \"$ac_link\"") >&5
9224   (eval $ac_link) 2>&5
9225   ac_status=$?
9226   echo "$as_me:9226: \$? = $ac_status" >&5
9227   (exit "$ac_status"); } &&
9228          { ac_try='test -s "conftest$ac_exeext"'
9229   { (eval echo "$as_me:9229: \"$ac_try\"") >&5
9230   (eval $ac_try) 2>&5
9231   ac_status=$?
9232   echo "$as_me:9232: \$? = $ac_status" >&5
9233   (exit "$ac_status"); }; }; then
9234   echo "$as_me:9234: result: yes" >&5
9235 echo "${ECHO_T}yes" >&6
9236 else
9237   echo "$as_me: failed program was:" >&5
9238 cat "conftest.$ac_ext" >&5
9239 echo "$as_me:9239: result: no" >&5
9240 echo "${ECHO_T}no" >&6
9241                  LIBS="$cf_ncurses_SAVE"
9242 fi
9243 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9244 fi
9245
9246 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9247
9248 cat >>confdefs.h <<EOF
9249 #define $cf_nculib_ROOT 1
9250 EOF
9251
9252         fi
9253 else
9254         NCURSES_CONFIG=none
9255 fi
9256
9257 else
9258
9259 cf_ncuconfig_root=ncurses
9260 cf_have_ncuconfig=no
9261
9262 if test "x${PKG_CONFIG:=none}" != xnone; then
9263         echo "$as_me:9263: checking pkg-config for $cf_ncuconfig_root" >&5
9264 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9265         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9266                 echo "$as_me:9266: result: yes" >&5
9267 echo "${ECHO_T}yes" >&6
9268
9269                 echo "$as_me:9269: checking if the $cf_ncuconfig_root package files work" >&5
9270 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9271                 cf_have_ncuconfig=unknown
9272
9273                 cf_save_CFLAGS="$CFLAGS"
9274                 cf_save_CPPFLAGS="$CPPFLAGS"
9275                 cf_save_LIBS="$LIBS"
9276
9277                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9278                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9279
9280                 # while -W for passing linker flags is prevalent, it is not "standard".
9281                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9282                 # incompatible _and_ non-standard -W option which gives an error.  Work
9283                 # around that pitfall.
9284                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9285                 (x*c[89]9@@*-W*)
9286
9287 cf_fix_cppflags=no
9288 cf_new_cflags=
9289 cf_new_cppflags=
9290 cf_new_extra_cppflags=
9291
9292 for cf_add_cflags in $cf_pkg_cflags
9293 do
9294 case "$cf_fix_cppflags" in
9295 (no)
9296         case "$cf_add_cflags" in
9297         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9298                 case "$cf_add_cflags" in
9299                 (-D*)
9300                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9301
9302                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9303                                 && test -z "${cf_tst_cflags}" \
9304                                 && cf_fix_cppflags=yes
9305
9306                         if test "$cf_fix_cppflags" = yes ; then
9307
9308         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9309         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9310
9311                                 continue
9312                         elif test "${cf_tst_cflags}" = "\"'" ; then
9313
9314         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9315         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9316
9317                                 continue
9318                         fi
9319                         ;;
9320                 esac
9321                 case "$CPPFLAGS" in
9322                 (*$cf_add_cflags)
9323                         ;;
9324                 (*)
9325                         case "$cf_add_cflags" in
9326                         (-D*)
9327                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9328
9329 CPPFLAGS=`echo "$CPPFLAGS" | \
9330         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9331                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9332
9333                                 ;;
9334                         esac
9335
9336         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9337         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9338
9339                         ;;
9340                 esac
9341                 ;;
9342         (*)
9343
9344         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9345         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9346
9347                 ;;
9348         esac
9349         ;;
9350 (yes)
9351
9352         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9353         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9354
9355         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9356
9357         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9358                 && test -z "${cf_tst_cflags}" \
9359                 && cf_fix_cppflags=no
9360         ;;
9361 esac
9362 done
9363
9364 if test -n "$cf_new_cflags" ; then
9365
9366         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9367         CFLAGS="${CFLAGS}$cf_new_cflags"
9368
9369 fi
9370
9371 if test -n "$cf_new_cppflags" ; then
9372
9373         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9374         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9375
9376 fi
9377
9378 if test -n "$cf_new_extra_cppflags" ; then
9379
9380         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9381         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9382
9383 fi
9384
9385 cf_add_libs="$LIBS"
9386 # reverse order
9387 cf_add_0lib=
9388 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9389 # filter duplicates
9390 for cf_add_1lib in $cf_add_0lib; do
9391         for cf_add_2lib in $cf_add_libs; do
9392                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9393                         cf_add_1lib=
9394                         break
9395                 fi
9396         done
9397         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9398 done
9399 LIBS="$cf_add_libs"
9400
9401                         cat >"conftest.$ac_ext" <<_ACEOF
9402 #line 9402 "configure"
9403 #include "confdefs.h"
9404 #include <${cf_cv_ncurses_header:-curses.h}>
9405 int
9406 main (void)
9407 {
9408 initscr(); mousemask(0,0); tigetstr((char *)0);
9409   ;
9410   return 0;
9411 }
9412 _ACEOF
9413 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9414 if { (eval echo "$as_me:9414: \"$ac_link\"") >&5
9415   (eval $ac_link) 2>&5
9416   ac_status=$?
9417   echo "$as_me:9417: \$? = $ac_status" >&5
9418   (exit "$ac_status"); } &&
9419          { ac_try='test -s "conftest$ac_exeext"'
9420   { (eval echo "$as_me:9420: \"$ac_try\"") >&5
9421   (eval $ac_try) 2>&5
9422   ac_status=$?
9423   echo "$as_me:9423: \$? = $ac_status" >&5
9424   (exit "$ac_status"); }; }; then
9425   if test "$cross_compiling" = yes; then
9426   cf_test_ncuconfig=maybe
9427 else
9428   cat >"conftest.$ac_ext" <<_ACEOF
9429 #line 9429 "configure"
9430 #include "confdefs.h"
9431 #include <${cf_cv_ncurses_header:-curses.h}>
9432                                         int main(void)
9433                                         { const char *xx = curses_version(); return (xx == 0); }
9434 _ACEOF
9435 rm -f "conftest$ac_exeext"
9436 if { (eval echo "$as_me:9436: \"$ac_link\"") >&5
9437   (eval $ac_link) 2>&5
9438   ac_status=$?
9439   echo "$as_me:9439: \$? = $ac_status" >&5
9440   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9441   { (eval echo "$as_me:9441: \"$ac_try\"") >&5
9442   (eval $ac_try) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit "$ac_status"); }; }; then
9446   cf_test_ncuconfig=yes
9447 else
9448   echo "$as_me: program exited with status $ac_status" >&5
9449 echo "$as_me: failed program was:" >&5
9450 cat "conftest.$ac_ext" >&5
9451 cf_test_ncuconfig=no
9452 fi
9453 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9454 fi
9455 else
9456   echo "$as_me: failed program was:" >&5
9457 cat "conftest.$ac_ext" >&5
9458 cf_test_ncuconfig=no
9459 fi
9460 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9461
9462                         CFLAGS="$cf_save_CFLAGS"
9463                         CPPFLAGS="$cf_save_CPPFLAGS"
9464                         LIBS="$cf_save_LIBS"
9465
9466                         if test "x$cf_test_ncuconfig" != xyes; then
9467                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9468                                 cf_pkg_cflags="$cf_temp"
9469                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9470                                 cf_pkg_libs="$cf_temp"
9471                         fi
9472                         ;;
9473                 esac
9474
9475 for cf_add_cflags in $cf_pkg_cflags
9476 do
9477         case "x$cf_add_cflags" in
9478         (x-[DU]*)
9479
9480 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9481 while true
9482 do
9483         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'`
9484         test "$CFLAGS" != "$cf_old_cflag" || break
9485
9486         CFLAGS="$cf_old_cflag"
9487 done
9488
9489 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9490 while true
9491 do
9492         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'`
9493         test "$CPPFLAGS" != "$cf_old_cflag" || break
9494
9495         CPPFLAGS="$cf_old_cflag"
9496 done
9497
9498                 ;;
9499         esac
9500
9501 cf_fix_cppflags=no
9502 cf_new_cflags=
9503 cf_new_cppflags=
9504 cf_new_extra_cppflags=
9505
9506 for cf_add_cflags in $cf_add_cflags
9507 do
9508 case "$cf_fix_cppflags" in
9509 (no)
9510         case "$cf_add_cflags" in
9511         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9512                 case "$cf_add_cflags" in
9513                 (-D*)
9514                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9515
9516                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9517                                 && test -z "${cf_tst_cflags}" \
9518                                 && cf_fix_cppflags=yes
9519
9520                         if test "$cf_fix_cppflags" = yes ; then
9521
9522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9524
9525                                 continue
9526                         elif test "${cf_tst_cflags}" = "\"'" ; then
9527
9528         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9529         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9530
9531                                 continue
9532                         fi
9533                         ;;
9534                 esac
9535                 case "$CPPFLAGS" in
9536                 (*$cf_add_cflags)
9537                         ;;
9538                 (*)
9539                         case "$cf_add_cflags" in
9540                         (-D*)
9541                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9542
9543 CPPFLAGS=`echo "$CPPFLAGS" | \
9544         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9545                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9546
9547                                 ;;
9548                         esac
9549
9550         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9551         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9552
9553                         ;;
9554                 esac
9555                 ;;
9556         (*)
9557
9558         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9559         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9560
9561                 ;;
9562         esac
9563         ;;
9564 (yes)
9565
9566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9568
9569         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9570
9571         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9572                 && test -z "${cf_tst_cflags}" \
9573                 && cf_fix_cppflags=no
9574         ;;
9575 esac
9576 done
9577
9578 if test -n "$cf_new_cflags" ; then
9579
9580         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9581         CFLAGS="${CFLAGS}$cf_new_cflags"
9582
9583 fi
9584
9585 if test -n "$cf_new_cppflags" ; then
9586
9587         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9588         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9589
9590 fi
9591
9592 if test -n "$cf_new_extra_cppflags" ; then
9593
9594         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9595         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9596
9597 fi
9598
9599 done
9600
9601 cf_add_libs="$LIBS"
9602 # reverse order
9603 cf_add_0lib=
9604 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9605 # filter duplicates
9606 for cf_add_1lib in $cf_add_0lib; do
9607         for cf_add_2lib in $cf_add_libs; do
9608                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9609                         cf_add_1lib=
9610                         break
9611                 fi
9612         done
9613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9614 done
9615 LIBS="$cf_add_libs"
9616
9617                 cat >"conftest.$ac_ext" <<_ACEOF
9618 #line 9618 "configure"
9619 #include "confdefs.h"
9620 #include <${cf_cv_ncurses_header:-curses.h}>
9621 int
9622 main (void)
9623 {
9624 initscr(); mousemask(0,0); tigetstr((char *)0);
9625   ;
9626   return 0;
9627 }
9628 _ACEOF
9629 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9630 if { (eval echo "$as_me:9630: \"$ac_link\"") >&5
9631   (eval $ac_link) 2>&5
9632   ac_status=$?
9633   echo "$as_me:9633: \$? = $ac_status" >&5
9634   (exit "$ac_status"); } &&
9635          { ac_try='test -s "conftest$ac_exeext"'
9636   { (eval echo "$as_me:9636: \"$ac_try\"") >&5
9637   (eval $ac_try) 2>&5
9638   ac_status=$?
9639   echo "$as_me:9639: \$? = $ac_status" >&5
9640   (exit "$ac_status"); }; }; then
9641   if test "$cross_compiling" = yes; then
9642   cf_have_ncuconfig=maybe
9643 else
9644   cat >"conftest.$ac_ext" <<_ACEOF
9645 #line 9645 "configure"
9646 #include "confdefs.h"
9647 #include <${cf_cv_ncurses_header:-curses.h}>
9648                                 int main(void)
9649                                 { const char *xx = curses_version(); return (xx == 0); }
9650 _ACEOF
9651 rm -f "conftest$ac_exeext"
9652 if { (eval echo "$as_me:9652: \"$ac_link\"") >&5
9653   (eval $ac_link) 2>&5
9654   ac_status=$?
9655   echo "$as_me:9655: \$? = $ac_status" >&5
9656   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9657   { (eval echo "$as_me:9657: \"$ac_try\"") >&5
9658   (eval $ac_try) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit "$ac_status"); }; }; then
9662   cf_have_ncuconfig=yes
9663 else
9664   echo "$as_me: program exited with status $ac_status" >&5
9665 echo "$as_me: failed program was:" >&5
9666 cat "conftest.$ac_ext" >&5
9667 cf_have_ncuconfig=no
9668 fi
9669 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9670 fi
9671 else
9672   echo "$as_me: failed program was:" >&5
9673 cat "conftest.$ac_ext" >&5
9674 cf_have_ncuconfig=no
9675 fi
9676 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9677                 echo "$as_me:9677: result: $cf_have_ncuconfig" >&5
9678 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9679                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9680                 if test "$cf_have_ncuconfig" != "yes"
9681                 then
9682                         CPPFLAGS="$cf_save_CPPFLAGS"
9683                         LIBS="$cf_save_LIBS"
9684                         NCURSES_CONFIG_PKG=none
9685                 else
9686
9687 cat >>confdefs.h <<\EOF
9688 #define NCURSES 1
9689 EOF
9690
9691                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9692
9693 echo "$as_me:9693: checking for terminfo header" >&5
9694 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9695 if test "${cf_cv_term_header+set}" = set; then
9696   echo $ECHO_N "(cached) $ECHO_C" >&6
9697 else
9698
9699 case "${cf_cv_ncurses_header}" in
9700 (*/ncurses.h|*/ncursesw.h)
9701         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9702         ;;
9703 (*)
9704         cf_term_header=term.h
9705         ;;
9706 esac
9707
9708 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9709 do
9710 cat >"conftest.$ac_ext" <<_ACEOF
9711 #line 9711 "configure"
9712 #include "confdefs.h"
9713 #include <stdio.h>
9714 #include <${cf_cv_ncurses_header:-curses.h}>
9715 #include <$cf_test>
9716
9717 int
9718 main (void)
9719 {
9720 int x = auto_left_margin; (void)x
9721   ;
9722   return 0;
9723 }
9724 _ACEOF
9725 rm -f "conftest.$ac_objext"
9726 if { (eval echo "$as_me:9726: \"$ac_compile\"") >&5
9727   (eval $ac_compile) 2>&5
9728   ac_status=$?
9729   echo "$as_me:9729: \$? = $ac_status" >&5
9730   (exit "$ac_status"); } &&
9731          { ac_try='test -s "conftest.$ac_objext"'
9732   { (eval echo "$as_me:9732: \"$ac_try\"") >&5
9733   (eval $ac_try) 2>&5
9734   ac_status=$?
9735   echo "$as_me:9735: \$? = $ac_status" >&5
9736   (exit "$ac_status"); }; }; then
9737
9738         cf_cv_term_header="$cf_test"
9739 else
9740   echo "$as_me: failed program was:" >&5
9741 cat "conftest.$ac_ext" >&5
9742
9743         cf_cv_term_header=unknown
9744
9745 fi
9746 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9747         test "$cf_cv_term_header" != unknown && break
9748 done
9749
9750 fi
9751 echo "$as_me:9751: result: $cf_cv_term_header" >&5
9752 echo "${ECHO_T}$cf_cv_term_header" >&6
9753
9754 # Set definitions to allow ifdef'ing to accommodate subdirectories
9755
9756 case "$cf_cv_term_header" in
9757 (*term.h)
9758
9759 cat >>confdefs.h <<\EOF
9760 #define HAVE_TERM_H 1
9761 EOF
9762
9763         ;;
9764 esac
9765
9766 case "$cf_cv_term_header" in
9767 (ncurses/term.h)
9768
9769 cat >>confdefs.h <<\EOF
9770 #define HAVE_NCURSES_TERM_H 1
9771 EOF
9772
9773         ;;
9774 (ncursesw/term.h)
9775
9776 cat >>confdefs.h <<\EOF
9777 #define HAVE_NCURSESW_TERM_H 1
9778 EOF
9779
9780         ;;
9781 esac
9782
9783                 fi
9784
9785         else
9786                 echo "$as_me:9786: result: no" >&5
9787 echo "${ECHO_T}no" >&6
9788                 NCURSES_CONFIG_PKG=none
9789         fi
9790 else
9791         NCURSES_CONFIG_PKG=none
9792 fi
9793
9794 if test "x$cf_have_ncuconfig" = "xno"; then
9795         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9796
9797 if test -n "$ac_tool_prefix"; then
9798   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9799   do
9800     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9801 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9802 echo "$as_me:9802: checking for $ac_word" >&5
9803 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9804 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9805   echo $ECHO_N "(cached) $ECHO_C" >&6
9806 else
9807   if test -n "$NCURSES_CONFIG"; then
9808   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9809 else
9810   ac_save_IFS=$IFS; IFS=$ac_path_separator
9811 ac_dummy="$PATH"
9812 for ac_dir in $ac_dummy; do
9813   IFS=$ac_save_IFS
9814   test -z "$ac_dir" && ac_dir=.
9815   $as_executable_p "$ac_dir/$ac_word" || continue
9816 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9817 echo "$as_me:9817: found $ac_dir/$ac_word" >&5
9818 break
9819 done
9820
9821 fi
9822 fi
9823 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9824 if test -n "$NCURSES_CONFIG"; then
9825   echo "$as_me:9825: result: $NCURSES_CONFIG" >&5
9826 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9827 else
9828   echo "$as_me:9828: result: no" >&5
9829 echo "${ECHO_T}no" >&6
9830 fi
9831
9832     test -n "$NCURSES_CONFIG" && break
9833   done
9834 fi
9835 if test -z "$NCURSES_CONFIG"; then
9836   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9837   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9838 do
9839   # Extract the first word of "$ac_prog", so it can be a program name with args.
9840 set dummy $ac_prog; ac_word=$2
9841 echo "$as_me:9841: checking for $ac_word" >&5
9842 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9843 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9844   echo $ECHO_N "(cached) $ECHO_C" >&6
9845 else
9846   if test -n "$ac_ct_NCURSES_CONFIG"; then
9847   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9848 else
9849   ac_save_IFS=$IFS; IFS=$ac_path_separator
9850 ac_dummy="$PATH"
9851 for ac_dir in $ac_dummy; do
9852   IFS=$ac_save_IFS
9853   test -z "$ac_dir" && ac_dir=.
9854   $as_executable_p "$ac_dir/$ac_word" || continue
9855 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9856 echo "$as_me:9856: found $ac_dir/$ac_word" >&5
9857 break
9858 done
9859
9860 fi
9861 fi
9862 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9863 if test -n "$ac_ct_NCURSES_CONFIG"; then
9864   echo "$as_me:9864: result: $ac_ct_NCURSES_CONFIG" >&5
9865 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9866 else
9867   echo "$as_me:9867: result: no" >&5
9868 echo "${ECHO_T}no" >&6
9869 fi
9870
9871   test -n "$ac_ct_NCURSES_CONFIG" && break
9872 done
9873 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9874
9875   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9876 fi
9877
9878         if test "$NCURSES_CONFIG" != none ; then
9879
9880 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9881 do
9882         case "x$cf_add_cflags" in
9883         (x-[DU]*)
9884
9885 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9886 while true
9887 do
9888         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'`
9889         test "$CFLAGS" != "$cf_old_cflag" || break
9890
9891         CFLAGS="$cf_old_cflag"
9892 done
9893
9894 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
9895 while true
9896 do
9897         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'`
9898         test "$CPPFLAGS" != "$cf_old_cflag" || break
9899
9900         CPPFLAGS="$cf_old_cflag"
9901 done
9902
9903                 ;;
9904         esac
9905
9906 cf_fix_cppflags=no
9907 cf_new_cflags=
9908 cf_new_cppflags=
9909 cf_new_extra_cppflags=
9910
9911 for cf_add_cflags in $cf_add_cflags
9912 do
9913 case "$cf_fix_cppflags" in
9914 (no)
9915         case "$cf_add_cflags" in
9916         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9917                 case "$cf_add_cflags" in
9918                 (-D*)
9919                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9920
9921                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9922                                 && test -z "${cf_tst_cflags}" \
9923                                 && cf_fix_cppflags=yes
9924
9925                         if test "$cf_fix_cppflags" = yes ; then
9926
9927         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9928         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9929
9930                                 continue
9931                         elif test "${cf_tst_cflags}" = "\"'" ; then
9932
9933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9935
9936                                 continue
9937                         fi
9938                         ;;
9939                 esac
9940                 case "$CPPFLAGS" in
9941                 (*$cf_add_cflags)
9942                         ;;
9943                 (*)
9944                         case "$cf_add_cflags" in
9945                         (-D*)
9946                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9947
9948 CPPFLAGS=`echo "$CPPFLAGS" | \
9949         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9950                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9951
9952                                 ;;
9953                         esac
9954
9955         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9956         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9957
9958                         ;;
9959                 esac
9960                 ;;
9961         (*)
9962
9963         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9964         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9965
9966                 ;;
9967         esac
9968         ;;
9969 (yes)
9970
9971         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9972         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9973
9974         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9975
9976         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9977                 && test -z "${cf_tst_cflags}" \
9978                 && cf_fix_cppflags=no
9979         ;;
9980 esac
9981 done
9982
9983 if test -n "$cf_new_cflags" ; then
9984
9985         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9986         CFLAGS="${CFLAGS}$cf_new_cflags"
9987
9988 fi
9989
9990 if test -n "$cf_new_cppflags" ; then
9991
9992         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9993         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9994
9995 fi
9996
9997 if test -n "$cf_new_extra_cppflags" ; then
9998
9999         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10000         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10001
10002 fi
10003
10004 done
10005
10006 cf_add_libs="$LIBS"
10007 # reverse order
10008 cf_add_0lib=
10009 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10010 # filter duplicates
10011 for cf_add_1lib in $cf_add_0lib; do
10012         for cf_add_2lib in $cf_add_libs; do
10013                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10014                         cf_add_1lib=
10015                         break
10016                 fi
10017         done
10018         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10019 done
10020 LIBS="$cf_add_libs"
10021
10022                 # even with config script, some packages use no-override for curses.h
10023
10024 echo "$as_me:10024: checking if we have identified curses headers" >&5
10025 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10026 if test "${cf_cv_ncurses_header+set}" = set; then
10027   echo $ECHO_N "(cached) $ECHO_C" >&6
10028 else
10029
10030 cf_cv_ncurses_header=none
10031 for cf_header in \
10032         ncurses.h ncurses/ncurses.h \
10033         curses.h ncurses/curses.h
10034 do
10035 cat >"conftest.$ac_ext" <<_ACEOF
10036 #line 10036 "configure"
10037 #include "confdefs.h"
10038 #include <${cf_header}>
10039 int
10040 main (void)
10041 {
10042 initscr(); tgoto("?", 0,0)
10043   ;
10044   return 0;
10045 }
10046 _ACEOF
10047 rm -f "conftest.$ac_objext"
10048 if { (eval echo "$as_me:10048: \"$ac_compile\"") >&5
10049   (eval $ac_compile) 2>&5
10050   ac_status=$?
10051   echo "$as_me:10051: \$? = $ac_status" >&5
10052   (exit "$ac_status"); } &&
10053          { ac_try='test -s "conftest.$ac_objext"'
10054   { (eval echo "$as_me:10054: \"$ac_try\"") >&5
10055   (eval $ac_try) 2>&5
10056   ac_status=$?
10057   echo "$as_me:10057: \$? = $ac_status" >&5
10058   (exit "$ac_status"); }; }; then
10059   cf_cv_ncurses_header=$cf_header; break
10060 else
10061   echo "$as_me: failed program was:" >&5
10062 cat "conftest.$ac_ext" >&5
10063 fi
10064 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10065 done
10066
10067 fi
10068 echo "$as_me:10068: result: $cf_cv_ncurses_header" >&5
10069 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10070
10071 if test "$cf_cv_ncurses_header" = none ; then
10072         { { echo "$as_me:10072: error: No curses header-files found" >&5
10073 echo "$as_me: error: No curses header-files found" >&2;}
10074    { (exit 1); exit 1; }; }
10075 fi
10076
10077 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10078
10079 for ac_header in $cf_cv_ncurses_header
10080 do
10081 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10082 echo "$as_me:10082: checking for $ac_header" >&5
10083 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10084 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10085   echo $ECHO_N "(cached) $ECHO_C" >&6
10086 else
10087   cat >"conftest.$ac_ext" <<_ACEOF
10088 #line 10088 "configure"
10089 #include "confdefs.h"
10090 #include <$ac_header>
10091 _ACEOF
10092 if { (eval echo "$as_me:10092: \"$ac_cpp "conftest.$ac_ext"\"") >&5
10093   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
10094   ac_status=$?
10095   $EGREP -v '^ *\+' conftest.er1 >conftest.err
10096   rm -f conftest.er1
10097   cat conftest.err >&5
10098   echo "$as_me:10098: \$? = $ac_status" >&5
10099   (exit "$ac_status"); } >/dev/null; then
10100   if test -s conftest.err; then
10101     ac_cpp_err=$ac_c_preproc_warn_flag
10102   else
10103     ac_cpp_err=
10104   fi
10105 else
10106   ac_cpp_err=yes
10107 fi
10108 if test -z "$ac_cpp_err"; then
10109   eval "$as_ac_Header=yes"
10110 else
10111   echo "$as_me: failed program was:" >&5
10112   cat "conftest.$ac_ext" >&5
10113   eval "$as_ac_Header=no"
10114 fi
10115 rm -f conftest.err "conftest.$ac_ext"
10116 fi
10117 echo "$as_me:10117: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
10118 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
10119 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
10120   cat >>confdefs.h <<EOF
10121 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10122 EOF
10123
10124 fi
10125 done
10126
10127 cat >>confdefs.h <<\EOF
10128 #define NCURSES 1
10129 EOF
10130
10131 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10132
10133                 cat >>confdefs.h <<EOF
10134 #define $cf_nculib_ROOT 1
10135 EOF
10136
10137                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
10138
10139         else
10140
10141 cf_ncuhdr_root=ncurses
10142
10143 test -n "$cf_cv_curses_dir" && \
10144 test "$cf_cv_curses_dir" != "no" && { \
10145
10146 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10147   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10148   do
10149         while test "$cf_add_incdir" != /usr/include
10150         do
10151           if test -d "$cf_add_incdir"
10152           then
10153                 cf_have_incdir=no
10154                 if test -n "$CFLAGS$CPPFLAGS" ; then
10155                   # a loop is needed to ensure we can add subdirs of existing dirs
10156                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10157                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10158                           cf_have_incdir=yes; break
10159                         fi
10160                   done
10161                 fi
10162
10163                 if test "$cf_have_incdir" = no ; then
10164                   if test "$cf_add_incdir" = /usr/local/include ; then
10165                         if test "$GCC" = yes
10166                         then
10167                           cf_save_CPPFLAGS=$CPPFLAGS
10168
10169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10170         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10171
10172                           cat >"conftest.$ac_ext" <<_ACEOF
10173 #line 10173 "configure"
10174 #include "confdefs.h"
10175 #include <stdio.h>
10176 int
10177 main (void)
10178 {
10179 printf("Hello")
10180   ;
10181   return 0;
10182 }
10183 _ACEOF
10184 rm -f "conftest.$ac_objext"
10185 if { (eval echo "$as_me:10185: \"$ac_compile\"") >&5
10186   (eval $ac_compile) 2>&5
10187   ac_status=$?
10188   echo "$as_me:10188: \$? = $ac_status" >&5
10189   (exit "$ac_status"); } &&
10190          { ac_try='test -s "conftest.$ac_objext"'
10191   { (eval echo "$as_me:10191: \"$ac_try\"") >&5
10192   (eval $ac_try) 2>&5
10193   ac_status=$?
10194   echo "$as_me:10194: \$? = $ac_status" >&5
10195   (exit "$ac_status"); }; }; then
10196   :
10197 else
10198   echo "$as_me: failed program was:" >&5
10199 cat "conftest.$ac_ext" >&5
10200 cf_have_incdir=yes
10201 fi
10202 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10203                           CPPFLAGS=$cf_save_CPPFLAGS
10204                         fi
10205                   fi
10206                 fi
10207
10208                 if test "$cf_have_incdir" = no ; then
10209                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10210
10211 echo "${as_me:-configure}:10211: testing adding $cf_add_incdir to include-path ..." 1>&5
10212
10213                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10214
10215                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10216                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10217                   cf_add_incdir="$cf_top_incdir"
10218                 else
10219                   break
10220                 fi
10221           else
10222                 break
10223           fi
10224         done
10225   done
10226 fi
10227
10228 }
10229
10230 echo "$as_me:10230: checking for $cf_ncuhdr_root header in include-path" >&5
10231 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10232 if test "${cf_cv_ncurses_h+set}" = set; then
10233   echo $ECHO_N "(cached) $ECHO_C" >&6
10234 else
10235
10236         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10237         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
10238         for cf_header in $cf_header_list
10239         do
10240
10241         cat >"conftest.$ac_ext" <<_ACEOF
10242 #line 10242 "configure"
10243 #include "confdefs.h"
10244
10245 #include <$cf_header>
10246 int
10247 main (void)
10248 {
10249
10250 #ifdef NCURSES_VERSION
10251
10252 printf("%s\\n", NCURSES_VERSION);
10253 #else
10254 #ifdef __NCURSES_H
10255 printf("old\\n");
10256 #else
10257         make an error
10258 #endif
10259 #endif
10260
10261   ;
10262   return 0;
10263 }
10264 _ACEOF
10265 rm -f "conftest.$ac_objext"
10266 if { (eval echo "$as_me:10266: \"$ac_compile\"") >&5
10267   (eval $ac_compile) 2>&5
10268   ac_status=$?
10269   echo "$as_me:10269: \$? = $ac_status" >&5
10270   (exit "$ac_status"); } &&
10271          { ac_try='test -s "conftest.$ac_objext"'
10272   { (eval echo "$as_me:10272: \"$ac_try\"") >&5
10273   (eval $ac_try) 2>&5
10274   ac_status=$?
10275   echo "$as_me:10275: \$? = $ac_status" >&5
10276   (exit "$ac_status"); }; }; then
10277   cf_cv_ncurses_h=$cf_header
10278
10279 else
10280   echo "$as_me: failed program was:" >&5
10281 cat "conftest.$ac_ext" >&5
10282 cf_cv_ncurses_h=no
10283 fi
10284 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10285
10286                 test "$cf_cv_ncurses_h" != no && break
10287         done
10288
10289 fi
10290 echo "$as_me:10290: result: $cf_cv_ncurses_h" >&5
10291 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10292
10293 if test "$cf_cv_ncurses_h" != no ; then
10294         cf_cv_ncurses_header=$cf_cv_ncurses_h
10295 else
10296
10297 echo "$as_me:10297: checking for $cf_ncuhdr_root include-path" >&5
10298 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10299 if test "${cf_cv_ncurses_h2+set}" = set; then
10300   echo $ECHO_N "(cached) $ECHO_C" >&6
10301 else
10302
10303         test -n "$verbose" && echo
10304
10305 cf_search=
10306
10307 # collect the current set of include-directories from compiler flags
10308 cf_header_path_list=""
10309 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10310         for cf_header_path in $CPPFLAGS $CFLAGS
10311         do
10312                 case "$cf_header_path" in
10313                 (-I*)
10314                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10315
10316 test "x$cf_header_path" != "xNONE" && \
10317 test -d "$cf_header_path" && \
10318  {
10319         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10320         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10321         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10322         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10323         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10324         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"
10325 }
10326
10327                         cf_header_path_list="$cf_header_path_list $cf_search"
10328                         ;;
10329                 esac
10330         done
10331 fi
10332
10333 # add the variations for the package we are looking for
10334
10335 cf_search=
10336
10337 test "x$prefix" != "xNONE" && \
10338 test -d "$prefix" && \
10339  {
10340         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10341         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10342         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10343         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10344         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10345         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10346 }
10347
10348 for cf_subdir_prefix in \
10349         /usr \
10350         /usr/local \
10351         /usr/pkg \
10352         /opt \
10353         /opt/local \
10354         $HOME
10355 do
10356
10357 test "x$cf_subdir_prefix" != "x$prefix" && \
10358 test -d "$cf_subdir_prefix" && \
10359 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10360         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10361         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10362         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10363         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10364         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10365         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"
10366 }
10367
10368 done
10369
10370 test "$includedir" != NONE && \
10371 test "$includedir" != "/usr/include" && \
10372 test -d "$includedir" && {
10373         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10374         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10375 }
10376
10377 test "$oldincludedir" != NONE && \
10378 test "$oldincludedir" != "/usr/include" && \
10379 test -d "$oldincludedir" && {
10380         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10381         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10382 }
10383
10384 cf_search="$cf_search $cf_header_path_list"
10385
10386         test -n "$verbose" && echo "search path $cf_search"
10387         cf_save2_CPPFLAGS="$CPPFLAGS"
10388         for cf_incdir in $cf_search
10389         do
10390
10391 if test -n "$cf_incdir" ; then
10392   for cf_add_incdir in $cf_incdir
10393   do
10394         while test "$cf_add_incdir" != /usr/include
10395         do
10396           if test -d "$cf_add_incdir"
10397           then
10398                 cf_have_incdir=no
10399                 if test -n "$CFLAGS$CPPFLAGS" ; then
10400                   # a loop is needed to ensure we can add subdirs of existing dirs
10401                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10402                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10403                           cf_have_incdir=yes; break
10404                         fi
10405                   done
10406                 fi
10407
10408                 if test "$cf_have_incdir" = no ; then
10409                   if test "$cf_add_incdir" = /usr/local/include ; then
10410                         if test "$GCC" = yes
10411                         then
10412                           cf_save_CPPFLAGS=$CPPFLAGS
10413
10414         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10415         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10416
10417                           cat >"conftest.$ac_ext" <<_ACEOF
10418 #line 10418 "configure"
10419 #include "confdefs.h"
10420 #include <stdio.h>
10421 int
10422 main (void)
10423 {
10424 printf("Hello")
10425   ;
10426   return 0;
10427 }
10428 _ACEOF
10429 rm -f "conftest.$ac_objext"
10430 if { (eval echo "$as_me:10430: \"$ac_compile\"") >&5
10431   (eval $ac_compile) 2>&5
10432   ac_status=$?
10433   echo "$as_me:10433: \$? = $ac_status" >&5
10434   (exit "$ac_status"); } &&
10435          { ac_try='test -s "conftest.$ac_objext"'
10436   { (eval echo "$as_me:10436: \"$ac_try\"") >&5
10437   (eval $ac_try) 2>&5
10438   ac_status=$?
10439   echo "$as_me:10439: \$? = $ac_status" >&5
10440   (exit "$ac_status"); }; }; then
10441   :
10442 else
10443   echo "$as_me: failed program was:" >&5
10444 cat "conftest.$ac_ext" >&5
10445 cf_have_incdir=yes
10446 fi
10447 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10448                           CPPFLAGS=$cf_save_CPPFLAGS
10449                         fi
10450                   fi
10451                 fi
10452
10453                 if test "$cf_have_incdir" = no ; then
10454                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10455
10456 echo "${as_me:-configure}:10456: testing adding $cf_add_incdir to include-path ..." 1>&5
10457
10458                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10459
10460                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10461                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10462                   cf_add_incdir="$cf_top_incdir"
10463                 else
10464                   break
10465                 fi
10466           else
10467                 break
10468           fi
10469         done
10470   done
10471 fi
10472
10473                 for cf_header in \
10474                         ncurses.h \
10475                         curses.h
10476                 do
10477
10478         cat >"conftest.$ac_ext" <<_ACEOF
10479 #line 10479 "configure"
10480 #include "confdefs.h"
10481
10482 #include <$cf_header>
10483 int
10484 main (void)
10485 {
10486
10487 #ifdef NCURSES_VERSION
10488
10489 printf("%s\\n", NCURSES_VERSION);
10490 #else
10491 #ifdef __NCURSES_H
10492 printf("old\\n");
10493 #else
10494         make an error
10495 #endif
10496 #endif
10497
10498   ;
10499   return 0;
10500 }
10501 _ACEOF
10502 rm -f "conftest.$ac_objext"
10503 if { (eval echo "$as_me:10503: \"$ac_compile\"") >&5
10504   (eval $ac_compile) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit "$ac_status"); } &&
10508          { ac_try='test -s "conftest.$ac_objext"'
10509   { (eval echo "$as_me:10509: \"$ac_try\"") >&5
10510   (eval $ac_try) 2>&5
10511   ac_status=$?
10512   echo "$as_me:10512: \$? = $ac_status" >&5
10513   (exit "$ac_status"); }; }; then
10514   cf_cv_ncurses_h2=$cf_header
10515
10516 else
10517   echo "$as_me: failed program was:" >&5
10518 cat "conftest.$ac_ext" >&5
10519 cf_cv_ncurses_h2=no
10520 fi
10521 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10522
10523                         if test "$cf_cv_ncurses_h2" != no ; then
10524                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10525                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10526                                 break
10527                         fi
10528                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10529                 done
10530                 CPPFLAGS="$cf_save2_CPPFLAGS"
10531                 test "$cf_cv_ncurses_h2" != no && break
10532         done
10533         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10533: error: not found" >&5
10534 echo "$as_me: error: not found" >&2;}
10535    { (exit 1); exit 1; }; }
10536
10537 fi
10538 echo "$as_me:10538: result: $cf_cv_ncurses_h2" >&5
10539 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10540
10541         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10542         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10543         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10544                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10545         fi
10546
10547 if test -n "$cf_1st_incdir" ; then
10548   for cf_add_incdir in $cf_1st_incdir
10549   do
10550         while test "$cf_add_incdir" != /usr/include
10551         do
10552           if test -d "$cf_add_incdir"
10553           then
10554                 cf_have_incdir=no
10555                 if test -n "$CFLAGS$CPPFLAGS" ; then
10556                   # a loop is needed to ensure we can add subdirs of existing dirs
10557                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10558                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10559                           cf_have_incdir=yes; break
10560                         fi
10561                   done
10562                 fi
10563
10564                 if test "$cf_have_incdir" = no ; then
10565                   if test "$cf_add_incdir" = /usr/local/include ; then
10566                         if test "$GCC" = yes
10567                         then
10568                           cf_save_CPPFLAGS=$CPPFLAGS
10569
10570         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10571         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10572
10573                           cat >"conftest.$ac_ext" <<_ACEOF
10574 #line 10574 "configure"
10575 #include "confdefs.h"
10576 #include <stdio.h>
10577 int
10578 main (void)
10579 {
10580 printf("Hello")
10581   ;
10582   return 0;
10583 }
10584 _ACEOF
10585 rm -f "conftest.$ac_objext"
10586 if { (eval echo "$as_me:10586: \"$ac_compile\"") >&5
10587   (eval $ac_compile) 2>&5
10588   ac_status=$?
10589   echo "$as_me:10589: \$? = $ac_status" >&5
10590   (exit "$ac_status"); } &&
10591          { ac_try='test -s "conftest.$ac_objext"'
10592   { (eval echo "$as_me:10592: \"$ac_try\"") >&5
10593   (eval $ac_try) 2>&5
10594   ac_status=$?
10595   echo "$as_me:10595: \$? = $ac_status" >&5
10596   (exit "$ac_status"); }; }; then
10597   :
10598 else
10599   echo "$as_me: failed program was:" >&5
10600 cat "conftest.$ac_ext" >&5
10601 cf_have_incdir=yes
10602 fi
10603 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10604                           CPPFLAGS=$cf_save_CPPFLAGS
10605                         fi
10606                   fi
10607                 fi
10608
10609                 if test "$cf_have_incdir" = no ; then
10610                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10611
10612 echo "${as_me:-configure}:10612: testing adding $cf_add_incdir to include-path ..." 1>&5
10613
10614                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10615
10616                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10617                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10618                   cf_add_incdir="$cf_top_incdir"
10619                 else
10620                   break
10621                 fi
10622           else
10623                 break
10624           fi
10625         done
10626   done
10627 fi
10628
10629 fi
10630
10631 # Set definitions to allow ifdef'ing for ncurses.h
10632
10633 case "$cf_cv_ncurses_header" in
10634 (*ncurses.h)
10635
10636 cat >>confdefs.h <<\EOF
10637 #define HAVE_NCURSES_H 1
10638 EOF
10639
10640         ;;
10641 esac
10642
10643 case "$cf_cv_ncurses_header" in
10644 (ncurses/curses.h|ncurses/ncurses.h)
10645
10646 cat >>confdefs.h <<\EOF
10647 #define HAVE_NCURSES_NCURSES_H 1
10648 EOF
10649
10650         ;;
10651 (ncursesw/curses.h|ncursesw/ncurses.h)
10652
10653 cat >>confdefs.h <<\EOF
10654 #define HAVE_NCURSESW_NCURSES_H 1
10655 EOF
10656
10657         ;;
10658 esac
10659
10660 echo "$as_me:10660: checking for terminfo header" >&5
10661 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10662 if test "${cf_cv_term_header+set}" = set; then
10663   echo $ECHO_N "(cached) $ECHO_C" >&6
10664 else
10665
10666 case "${cf_cv_ncurses_header}" in
10667 (*/ncurses.h|*/ncursesw.h)
10668         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10669         ;;
10670 (*)
10671         cf_term_header=term.h
10672         ;;
10673 esac
10674
10675 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10676 do
10677 cat >"conftest.$ac_ext" <<_ACEOF
10678 #line 10678 "configure"
10679 #include "confdefs.h"
10680 #include <stdio.h>
10681 #include <${cf_cv_ncurses_header:-curses.h}>
10682 #include <$cf_test>
10683
10684 int
10685 main (void)
10686 {
10687 int x = auto_left_margin; (void)x
10688   ;
10689   return 0;
10690 }
10691 _ACEOF
10692 rm -f "conftest.$ac_objext"
10693 if { (eval echo "$as_me:10693: \"$ac_compile\"") >&5
10694   (eval $ac_compile) 2>&5
10695   ac_status=$?
10696   echo "$as_me:10696: \$? = $ac_status" >&5
10697   (exit "$ac_status"); } &&
10698          { ac_try='test -s "conftest.$ac_objext"'
10699   { (eval echo "$as_me:10699: \"$ac_try\"") >&5
10700   (eval $ac_try) 2>&5
10701   ac_status=$?
10702   echo "$as_me:10702: \$? = $ac_status" >&5
10703   (exit "$ac_status"); }; }; then
10704
10705         cf_cv_term_header="$cf_test"
10706 else
10707   echo "$as_me: failed program was:" >&5
10708 cat "conftest.$ac_ext" >&5
10709
10710         cf_cv_term_header=unknown
10711
10712 fi
10713 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10714         test "$cf_cv_term_header" != unknown && break
10715 done
10716
10717 fi
10718 echo "$as_me:10718: result: $cf_cv_term_header" >&5
10719 echo "${ECHO_T}$cf_cv_term_header" >&6
10720
10721 # Set definitions to allow ifdef'ing to accommodate subdirectories
10722
10723 case "$cf_cv_term_header" in
10724 (*term.h)
10725
10726 cat >>confdefs.h <<\EOF
10727 #define HAVE_TERM_H 1
10728 EOF
10729
10730         ;;
10731 esac
10732
10733 case "$cf_cv_term_header" in
10734 (ncurses/term.h)
10735
10736 cat >>confdefs.h <<\EOF
10737 #define HAVE_NCURSES_TERM_H 1
10738 EOF
10739
10740         ;;
10741 (ncursesw/term.h)
10742
10743 cat >>confdefs.h <<\EOF
10744 #define HAVE_NCURSESW_TERM_H 1
10745 EOF
10746
10747         ;;
10748 esac
10749
10750 # some applications need this, but should check for NCURSES_VERSION
10751
10752 cat >>confdefs.h <<\EOF
10753 #define NCURSES 1
10754 EOF
10755
10756 echo "$as_me:10756: checking for ncurses version" >&5
10757 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10758 if test "${cf_cv_ncurses_version+set}" = set; then
10759   echo $ECHO_N "(cached) $ECHO_C" >&6
10760 else
10761
10762         cf_cv_ncurses_version=no
10763         cf_tempfile=out$$
10764         rm -f "$cf_tempfile"
10765         if test "$cross_compiling" = yes; then
10766
10767         # This will not work if the preprocessor splits the line after the
10768         # Autoconf token.  The 'unproto' program does that.
10769         cat > "conftest.$ac_ext" <<EOF
10770 #include <${cf_cv_ncurses_header:-curses.h}>
10771 #undef Autoconf
10772 #ifdef NCURSES_VERSION
10773 Autoconf NCURSES_VERSION
10774 #else
10775 #ifdef __NCURSES_H
10776 Autoconf "old"
10777 #endif
10778 ;
10779 #endif
10780 EOF
10781         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10782         { (eval echo "$as_me:10782: \"$cf_try\"") >&5
10783   (eval $cf_try) 2>&5
10784   ac_status=$?
10785   echo "$as_me:10785: \$? = $ac_status" >&5
10786   (exit "$ac_status"); }
10787         if test -f conftest.out ; then
10788                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10789                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10790                 rm -f conftest.out
10791         fi
10792
10793 else
10794   cat >"conftest.$ac_ext" <<_ACEOF
10795 #line 10795 "configure"
10796 #include "confdefs.h"
10797
10798 #include <${cf_cv_ncurses_header:-curses.h}>
10799 #include <stdio.h>
10800 int main(void)
10801 {
10802         FILE *fp = fopen("$cf_tempfile", "w");
10803 #ifdef NCURSES_VERSION
10804 # ifdef NCURSES_VERSION_PATCH
10805         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10806 # else
10807         fprintf(fp, "%s\\n", NCURSES_VERSION);
10808 # endif
10809 #else
10810 # ifdef __NCURSES_H
10811         fprintf(fp, "old\\n");
10812 # else
10813         make an error
10814 # endif
10815 #endif
10816         ${cf_cv_main_return:-return}(0);
10817 }
10818 _ACEOF
10819 rm -f "conftest$ac_exeext"
10820 if { (eval echo "$as_me:10820: \"$ac_link\"") >&5
10821   (eval $ac_link) 2>&5
10822   ac_status=$?
10823   echo "$as_me:10823: \$? = $ac_status" >&5
10824   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10825   { (eval echo "$as_me:10825: \"$ac_try\"") >&5
10826   (eval $ac_try) 2>&5
10827   ac_status=$?
10828   echo "$as_me:10828: \$? = $ac_status" >&5
10829   (exit "$ac_status"); }; }; then
10830
10831         cf_cv_ncurses_version=`cat $cf_tempfile`
10832 else
10833   echo "$as_me: program exited with status $ac_status" >&5
10834 echo "$as_me: failed program was:" >&5
10835 cat "conftest.$ac_ext" >&5
10836 fi
10837 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10838 fi
10839         rm -f "$cf_tempfile"
10840
10841 fi
10842 echo "$as_me:10842: result: $cf_cv_ncurses_version" >&5
10843 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10844 test "$cf_cv_ncurses_version" = no ||
10845 cat >>confdefs.h <<\EOF
10846 #define NCURSES 1
10847 EOF
10848
10849 cf_nculib_root=ncurses
10850         # This works, except for the special case where we find gpm, but
10851         # ncurses is in a nonstandard location via $LIBS, and we really want
10852         # to link gpm.
10853 cf_ncurses_LIBS=""
10854 cf_ncurses_SAVE="$LIBS"
10855 echo "$as_me:10855: checking for Gpm_Open in -lgpm" >&5
10856 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10857 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10858   echo $ECHO_N "(cached) $ECHO_C" >&6
10859 else
10860   ac_check_lib_save_LIBS=$LIBS
10861 LIBS="-lgpm  $LIBS"
10862 cat >"conftest.$ac_ext" <<_ACEOF
10863 #line 10863 "configure"
10864 #include "confdefs.h"
10865
10866 /* Override any gcc2 internal prototype to avoid an error.  */
10867 #ifdef __cplusplus
10868 extern "C"
10869 #endif
10870 /* We use char because int might match the return type of a gcc2
10871    builtin and then its argument prototype would still apply.  */
10872 char Gpm_Open ();
10873 int
10874 main (void)
10875 {
10876 Gpm_Open ();
10877   ;
10878   return 0;
10879 }
10880 _ACEOF
10881 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10882 if { (eval echo "$as_me:10882: \"$ac_link\"") >&5
10883   (eval $ac_link) 2>&5
10884   ac_status=$?
10885   echo "$as_me:10885: \$? = $ac_status" >&5
10886   (exit "$ac_status"); } &&
10887          { ac_try='test -s "conftest$ac_exeext"'
10888   { (eval echo "$as_me:10888: \"$ac_try\"") >&5
10889   (eval $ac_try) 2>&5
10890   ac_status=$?
10891   echo "$as_me:10891: \$? = $ac_status" >&5
10892   (exit "$ac_status"); }; }; then
10893   ac_cv_lib_gpm_Gpm_Open=yes
10894 else
10895   echo "$as_me: failed program was:" >&5
10896 cat "conftest.$ac_ext" >&5
10897 ac_cv_lib_gpm_Gpm_Open=no
10898 fi
10899 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10900 LIBS=$ac_check_lib_save_LIBS
10901 fi
10902 echo "$as_me:10902: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10903 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10904 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10905   echo "$as_me:10905: checking for initscr in -lgpm" >&5
10906 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10907 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10908   echo $ECHO_N "(cached) $ECHO_C" >&6
10909 else
10910   ac_check_lib_save_LIBS=$LIBS
10911 LIBS="-lgpm  $LIBS"
10912 cat >"conftest.$ac_ext" <<_ACEOF
10913 #line 10913 "configure"
10914 #include "confdefs.h"
10915
10916 /* Override any gcc2 internal prototype to avoid an error.  */
10917 #ifdef __cplusplus
10918 extern "C"
10919 #endif
10920 /* We use char because int might match the return type of a gcc2
10921    builtin and then its argument prototype would still apply.  */
10922 char initscr ();
10923 int
10924 main (void)
10925 {
10926 initscr ();
10927   ;
10928   return 0;
10929 }
10930 _ACEOF
10931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10932 if { (eval echo "$as_me:10932: \"$ac_link\"") >&5
10933   (eval $ac_link) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit "$ac_status"); } &&
10937          { ac_try='test -s "conftest$ac_exeext"'
10938   { (eval echo "$as_me:10938: \"$ac_try\"") >&5
10939   (eval $ac_try) 2>&5
10940   ac_status=$?
10941   echo "$as_me:10941: \$? = $ac_status" >&5
10942   (exit "$ac_status"); }; }; then
10943   ac_cv_lib_gpm_initscr=yes
10944 else
10945   echo "$as_me: failed program was:" >&5
10946 cat "conftest.$ac_ext" >&5
10947 ac_cv_lib_gpm_initscr=no
10948 fi
10949 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10950 LIBS=$ac_check_lib_save_LIBS
10951 fi
10952 echo "$as_me:10952: result: $ac_cv_lib_gpm_initscr" >&5
10953 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10954 if test "$ac_cv_lib_gpm_initscr" = yes; then
10955   LIBS="$cf_ncurses_SAVE"
10956 else
10957   cf_ncurses_LIBS="-lgpm"
10958 fi
10959
10960 fi
10961
10962 case "$host_os" in
10963 (freebsd*)
10964         # This is only necessary if you are linking against an obsolete
10965         # version of ncurses (but it should do no harm, since it is static).
10966         if test "$cf_nculib_root" = ncurses ; then
10967                 echo "$as_me:10967: checking for tgoto in -lmytinfo" >&5
10968 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10969 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10970   echo $ECHO_N "(cached) $ECHO_C" >&6
10971 else
10972   ac_check_lib_save_LIBS=$LIBS
10973 LIBS="-lmytinfo  $LIBS"
10974 cat >"conftest.$ac_ext" <<_ACEOF
10975 #line 10975 "configure"
10976 #include "confdefs.h"
10977
10978 /* Override any gcc2 internal prototype to avoid an error.  */
10979 #ifdef __cplusplus
10980 extern "C"
10981 #endif
10982 /* We use char because int might match the return type of a gcc2
10983    builtin and then its argument prototype would still apply.  */
10984 char tgoto ();
10985 int
10986 main (void)
10987 {
10988 tgoto ();
10989   ;
10990   return 0;
10991 }
10992 _ACEOF
10993 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10994 if { (eval echo "$as_me:10994: \"$ac_link\"") >&5
10995   (eval $ac_link) 2>&5
10996   ac_status=$?
10997   echo "$as_me:10997: \$? = $ac_status" >&5
10998   (exit "$ac_status"); } &&
10999          { ac_try='test -s "conftest$ac_exeext"'
11000   { (eval echo "$as_me:11000: \"$ac_try\"") >&5
11001   (eval $ac_try) 2>&5
11002   ac_status=$?
11003   echo "$as_me:11003: \$? = $ac_status" >&5
11004   (exit "$ac_status"); }; }; then
11005   ac_cv_lib_mytinfo_tgoto=yes
11006 else
11007   echo "$as_me: failed program was:" >&5
11008 cat "conftest.$ac_ext" >&5
11009 ac_cv_lib_mytinfo_tgoto=no
11010 fi
11011 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11012 LIBS=$ac_check_lib_save_LIBS
11013 fi
11014 echo "$as_me:11014: result: $ac_cv_lib_mytinfo_tgoto" >&5
11015 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11016 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
11017   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11018 fi
11019
11020         fi
11021         ;;
11022 esac
11023
11024 cf_add_libs="$LIBS"
11025 # reverse order
11026 cf_add_0lib=
11027 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11028 # filter duplicates
11029 for cf_add_1lib in $cf_add_0lib; do
11030         for cf_add_2lib in $cf_add_libs; do
11031                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11032                         cf_add_1lib=
11033                         break
11034                 fi
11035         done
11036         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11037 done
11038 LIBS="$cf_add_libs"
11039
11040 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
11041 then
11042
11043 cf_add_libs="$LIBS"
11044 # reverse order
11045 cf_add_0lib=
11046 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11047 # filter duplicates
11048 for cf_add_1lib in $cf_add_0lib; do
11049         for cf_add_2lib in $cf_add_libs; do
11050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11051                         cf_add_1lib=
11052                         break
11053                 fi
11054         done
11055         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11056 done
11057 LIBS="$cf_add_libs"
11058
11059 else
11060
11061         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
11062         cf_libdir=""
11063         echo "$as_me:11063: checking for initscr" >&5
11064 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11065 if test "${ac_cv_func_initscr+set}" = set; then
11066   echo $ECHO_N "(cached) $ECHO_C" >&6
11067 else
11068   cat >"conftest.$ac_ext" <<_ACEOF
11069 #line 11069 "configure"
11070 #include "confdefs.h"
11071 #define initscr autoconf_temporary
11072 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11073 #undef initscr
11074
11075 #ifdef __cplusplus
11076 extern "C"
11077 #endif
11078
11079 /* We use char because int might match the return type of a gcc2
11080    builtin and then its argument prototype would still apply.  */
11081 char initscr (void);
11082
11083 int
11084 main (void)
11085 {
11086
11087 /* The GNU C library defines stubs for functions which it implements
11088     to always fail with ENOSYS.  Some functions are actually named
11089     something starting with __ and the normal name is an alias.  */
11090 #if defined (__stub_initscr) || defined (__stub___initscr)
11091 #error found stub for initscr
11092 #endif
11093
11094         return initscr ();
11095   ;
11096   return 0;
11097 }
11098 _ACEOF
11099 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11100 if { (eval echo "$as_me:11100: \"$ac_link\"") >&5
11101   (eval $ac_link) 2>&5
11102   ac_status=$?
11103   echo "$as_me:11103: \$? = $ac_status" >&5
11104   (exit "$ac_status"); } &&
11105          { ac_try='test -s "conftest$ac_exeext"'
11106   { (eval echo "$as_me:11106: \"$ac_try\"") >&5
11107   (eval $ac_try) 2>&5
11108   ac_status=$?
11109   echo "$as_me:11109: \$? = $ac_status" >&5
11110   (exit "$ac_status"); }; }; then
11111   ac_cv_func_initscr=yes
11112 else
11113   echo "$as_me: failed program was:" >&5
11114 cat "conftest.$ac_ext" >&5
11115 ac_cv_func_initscr=no
11116 fi
11117 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11118 fi
11119 echo "$as_me:11119: result: $ac_cv_func_initscr" >&5
11120 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11121 if test "$ac_cv_func_initscr" = yes; then
11122   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11123 else
11124
11125                 cf_save_LIBS="$LIBS"
11126                 echo "$as_me:11126: checking for initscr in -l$cf_nculib_root" >&5
11127 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11128                 LIBS="-l$cf_nculib_root $LIBS"
11129                 cat >"conftest.$ac_ext" <<_ACEOF
11130 #line 11130 "configure"
11131 #include "confdefs.h"
11132 #include <${cf_cv_ncurses_header:-curses.h}>
11133 int
11134 main (void)
11135 {
11136 initscr()
11137   ;
11138   return 0;
11139 }
11140 _ACEOF
11141 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11142 if { (eval echo "$as_me:11142: \"$ac_link\"") >&5
11143   (eval $ac_link) 2>&5
11144   ac_status=$?
11145   echo "$as_me:11145: \$? = $ac_status" >&5
11146   (exit "$ac_status"); } &&
11147          { ac_try='test -s "conftest$ac_exeext"'
11148   { (eval echo "$as_me:11148: \"$ac_try\"") >&5
11149   (eval $ac_try) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit "$ac_status"); }; }; then
11153   echo "$as_me:11153: result: yes" >&5
11154 echo "${ECHO_T}yes" >&6
11155                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11156
11157 else
11158   echo "$as_me: failed program was:" >&5
11159 cat "conftest.$ac_ext" >&5
11160 echo "$as_me:11160: result: no" >&5
11161 echo "${ECHO_T}no" >&6
11162
11163 cf_search=
11164 cf_library_path_list=""
11165 if test -n "${LDFLAGS}${LIBS}" ; then
11166         for cf_library_path in $LDFLAGS $LIBS
11167         do
11168                 case "$cf_library_path" in
11169                 (-L*)
11170                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11171
11172 test "x$cf_library_path" != "xNONE" && \
11173 test -d "$cf_library_path" && \
11174  {
11175         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11176         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
11177         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11178         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11179         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11180         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"
11181 }
11182
11183                         cf_library_path_list="$cf_library_path_list $cf_search"
11184                         ;;
11185                 esac
11186         done
11187 fi
11188
11189 cf_search=
11190
11191 test "x$prefix" != "xNONE" && \
11192 test -d "$prefix" && \
11193  {
11194         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11195         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
11196         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11197         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11198         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11199         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11200 }
11201
11202 for cf_subdir_prefix in \
11203         /usr \
11204         /usr/local \
11205         /usr/pkg \
11206         /opt \
11207         /opt/local \
11208         $HOME
11209 do
11210
11211 test "x$cf_subdir_prefix" != "x$prefix" && \
11212 test -d "$cf_subdir_prefix" && \
11213 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
11214         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11215         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11216         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11217         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11218         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11219         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"
11220 }
11221
11222 done
11223
11224 cf_search="$cf_library_path_list $cf_search"
11225
11226                         for cf_libdir in $cf_search
11227                         do
11228                                 echo "$as_me:11228: checking for -l$cf_nculib_root in $cf_libdir" >&5
11229 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11230                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11231                                 cat >"conftest.$ac_ext" <<_ACEOF
11232 #line 11232 "configure"
11233 #include "confdefs.h"
11234 #include <${cf_cv_ncurses_header:-curses.h}>
11235 int
11236 main (void)
11237 {
11238 initscr()
11239   ;
11240   return 0;
11241 }
11242 _ACEOF
11243 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11244 if { (eval echo "$as_me:11244: \"$ac_link\"") >&5
11245   (eval $ac_link) 2>&5
11246   ac_status=$?
11247   echo "$as_me:11247: \$? = $ac_status" >&5
11248   (exit "$ac_status"); } &&
11249          { ac_try='test -s "conftest$ac_exeext"'
11250   { (eval echo "$as_me:11250: \"$ac_try\"") >&5
11251   (eval $ac_try) 2>&5
11252   ac_status=$?
11253   echo "$as_me:11253: \$? = $ac_status" >&5
11254   (exit "$ac_status"); }; }; then
11255   echo "$as_me:11255: result: yes" >&5
11256 echo "${ECHO_T}yes" >&6
11257                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
11258                                          break
11259 else
11260   echo "$as_me: failed program was:" >&5
11261 cat "conftest.$ac_ext" >&5
11262 echo "$as_me:11262: result: no" >&5
11263 echo "${ECHO_T}no" >&6
11264                                          LIBS="$cf_save_LIBS"
11265 fi
11266 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11267                         done
11268
11269 fi
11270 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11271
11272 fi
11273
11274 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
11275
11276 if test "$cf_found_library" = no ; then
11277         { { echo "$as_me:11277: error: Cannot link $cf_nculib_root library" >&5
11278 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11279    { (exit 1); exit 1; }; }
11280 fi
11281
11282 fi
11283
11284 if test -n "$cf_ncurses_LIBS" ; then
11285         echo "$as_me:11285: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11286 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11287         cf_ncurses_SAVE="$LIBS"
11288         for p in $cf_ncurses_LIBS ; do
11289                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11290                 if test "$q" != "$LIBS" ; then
11291                         LIBS="$q"
11292                 fi
11293         done
11294         cat >"conftest.$ac_ext" <<_ACEOF
11295 #line 11295 "configure"
11296 #include "confdefs.h"
11297 #include <${cf_cv_ncurses_header:-curses.h}>
11298 int
11299 main (void)
11300 {
11301 initscr(); mousemask(0,0); tigetstr((char *)0);
11302   ;
11303   return 0;
11304 }
11305 _ACEOF
11306 rm -f "conftest.$ac_objext" "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"); } &&
11312          { ac_try='test -s "conftest$ac_exeext"'
11313   { (eval echo "$as_me:11313: \"$ac_try\"") >&5
11314   (eval $ac_try) 2>&5
11315   ac_status=$?
11316   echo "$as_me:11316: \$? = $ac_status" >&5
11317   (exit "$ac_status"); }; }; then
11318   echo "$as_me:11318: result: yes" >&5
11319 echo "${ECHO_T}yes" >&6
11320 else
11321   echo "$as_me: failed program was:" >&5
11322 cat "conftest.$ac_ext" >&5
11323 echo "$as_me:11323: result: no" >&5
11324 echo "${ECHO_T}no" >&6
11325                  LIBS="$cf_ncurses_SAVE"
11326 fi
11327 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11328 fi
11329
11330 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11331
11332 cat >>confdefs.h <<EOF
11333 #define $cf_nculib_ROOT 1
11334 EOF
11335
11336         fi
11337 else
11338         NCURSES_CONFIG=none
11339 fi
11340
11341 fi
11342
11343 if test "$NCURSES_CONFIG_PKG" != none ; then
11344         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11345
11346         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11347         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11348         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11349
11350         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11351         if test -z "$cf_cv_abi_version"
11352         then
11353                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11354         fi
11355
11356 elif test "$NCURSES_CONFIG" != none ; then
11357
11358         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11359
11360         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11361         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11362         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11363
11364         # ABI version is not available from headers
11365         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11366
11367 else
11368
11369         for cf_name in MAJOR MINOR PATCH
11370         do
11371         cat >conftest.$ac_ext <<CF_EOF
11372         #include <${cf_cv_ncurses_header:-curses.h}>
11373         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11374 CF_EOF
11375                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11376                 { (eval echo "$as_me:11376: \"$cf_try\"") >&5
11377   (eval $cf_try) 2>&5
11378   ac_status=$?
11379   echo "$as_me:11379: \$? = $ac_status" >&5
11380   (exit "$ac_status"); }
11381                 if test -f conftest.out ; then
11382                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11383                         eval NCURSES_$cf_name=\"$cf_result\"
11384                         # cat conftest.$ac_ext
11385                         # cat conftest.out
11386                 fi
11387         done
11388
11389         cf_cv_abi_version=${NCURSES_MAJOR}
11390
11391 fi
11392
11393 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11394
11395 cf_cv_timestamp=`date`
11396
11397 echo "$as_me:11397: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11398 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11399
11400 echo "$as_me:11400: checking if you want to have a library-prefix" >&5
11401 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11402
11403 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11404 if test "${with_lib_prefix+set}" = set; then
11405   withval="$with_lib_prefix"
11406   with_lib_prefix=$withval
11407 else
11408   with_lib_prefix=auto
11409 fi;
11410 echo "$as_me:11410: result: $with_lib_prefix" >&5
11411 echo "${ECHO_T}$with_lib_prefix" >&6
11412
11413 if test "$with_lib_prefix" = auto
11414 then
11415
11416         case "$cf_cv_system_name" in
11417         (OS/2*|os2*)
11418                 if test "$DFT_LWR_MODEL" = libtool; then
11419                         LIB_PREFIX='lib'
11420                 else
11421                         LIB_PREFIX=''
11422                 fi
11423                 ;;
11424         (*-msvc*)
11425                 LIB_PREFIX=''
11426                 ;;
11427         (*)     LIB_PREFIX='lib'
11428                 ;;
11429         esac
11430 cf_prefix=$LIB_PREFIX
11431
11432 elif test "$with_lib_prefix" = no
11433 then
11434         LIB_PREFIX=
11435 else
11436         LIB_PREFIX=$with_lib_prefix
11437 fi
11438
11439 LIB_SUFFIX=
11440
11441 ###############################################################################
11442
11443 if test X"$CC_G_OPT" = X"" ; then
11444         CC_G_OPT='-g'
11445         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11446 fi
11447
11448 echo "$as_me:11448: checking for default loader flags" >&5
11449 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11450 case $DFT_LWR_MODEL in
11451 (normal)  LD_MODEL=''   ;;
11452 (debug)   LD_MODEL=$CC_G_OPT ;;
11453 (profile) LD_MODEL='-pg';;
11454 (shared)  LD_MODEL=''   ;;
11455 esac
11456 echo "$as_me:11456: result: $LD_MODEL" >&5
11457 echo "${ECHO_T}$LD_MODEL" >&6
11458
11459 LD_RPATH_OPT=
11460 if test "x$cf_cv_enable_rpath" != xno
11461 then
11462         echo "$as_me:11462: checking for an rpath option" >&5
11463 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11464         case "$cf_cv_system_name" in
11465         (irix*)
11466                 if test "$GCC" = yes; then
11467                         LD_RPATH_OPT="-Wl,-rpath,"
11468                 else
11469                         LD_RPATH_OPT="-rpath "
11470                 fi
11471                 ;;
11472         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11473                 LD_RPATH_OPT="-Wl,-rpath,"
11474                 ;;
11475         (openbsd[2-9].*|mirbsd*)
11476                 LD_RPATH_OPT="-Wl,-rpath,"
11477                 ;;
11478         (dragonfly*)
11479                 LD_RPATH_OPT="-rpath "
11480                 ;;
11481         (netbsd*)
11482                 LD_RPATH_OPT="-Wl,-rpath,"
11483                 ;;
11484         (osf*|mls+*)
11485                 LD_RPATH_OPT="-rpath "
11486                 ;;
11487         (solaris2*)
11488                 LD_RPATH_OPT="-R"
11489                 ;;
11490         (*)
11491                 ;;
11492         esac
11493         echo "$as_me:11493: result: $LD_RPATH_OPT" >&5
11494 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11495
11496         case "x$LD_RPATH_OPT" in
11497         (x-R*)
11498                 echo "$as_me:11498: checking if we need a space after rpath option" >&5
11499 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11500                 cf_save_LIBS="$LIBS"
11501
11502 cf_add_libs="$LIBS"
11503 # reverse order
11504 cf_add_0lib=
11505 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11506 # filter duplicates
11507 for cf_add_1lib in $cf_add_0lib; do
11508         for cf_add_2lib in $cf_add_libs; do
11509                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11510                         cf_add_1lib=
11511                         break
11512                 fi
11513         done
11514         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11515 done
11516 LIBS="$cf_add_libs"
11517
11518                 cat >"conftest.$ac_ext" <<_ACEOF
11519 #line 11519 "configure"
11520 #include "confdefs.h"
11521
11522 int
11523 main (void)
11524 {
11525
11526   ;
11527   return 0;
11528 }
11529 _ACEOF
11530 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11531 if { (eval echo "$as_me:11531: \"$ac_link\"") >&5
11532   (eval $ac_link) 2>&5
11533   ac_status=$?
11534   echo "$as_me:11534: \$? = $ac_status" >&5
11535   (exit "$ac_status"); } &&
11536          { ac_try='test -s "conftest$ac_exeext"'
11537   { (eval echo "$as_me:11537: \"$ac_try\"") >&5
11538   (eval $ac_try) 2>&5
11539   ac_status=$?
11540   echo "$as_me:11540: \$? = $ac_status" >&5
11541   (exit "$ac_status"); }; }; then
11542   cf_rpath_space=no
11543 else
11544   echo "$as_me: failed program was:" >&5
11545 cat "conftest.$ac_ext" >&5
11546 cf_rpath_space=yes
11547 fi
11548 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11549                 LIBS="$cf_save_LIBS"
11550                 echo "$as_me:11550: result: $cf_rpath_space" >&5
11551 echo "${ECHO_T}$cf_rpath_space" >&6
11552                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11553                 ;;
11554         esac
11555 fi
11556
11557         RM_SHARED_OPTS=
11558         LOCAL_LDFLAGS=
11559         LOCAL_LDFLAGS2=
11560         LD_SHARED_OPTS=
11561         INSTALL_LIB="-m 644"
11562         : ${rel_builddir:=.}
11563
11564         shlibdir=$libdir
11565
11566         MAKE_DLLS="#"
11567
11568         cf_cv_do_symlinks=no
11569         cf_ld_rpath_opt=
11570         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11571
11572         echo "$as_me:11572: checking if release/abi version should be used for shared libs" >&5
11573 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11574
11575 # Check whether --with-shlib-version or --without-shlib-version was given.
11576 if test "${with_shlib_version+set}" = set; then
11577   withval="$with_shlib_version"
11578   test -z "$withval" && withval=auto
11579         case "$withval" in
11580         (yes)
11581                 cf_cv_shlib_version=auto
11582                 ;;
11583         (rel|abi|auto)
11584                 cf_cv_shlib_version=$withval
11585                 ;;
11586         (*)
11587                 echo "$as_me:11587: result: $withval" >&5
11588 echo "${ECHO_T}$withval" >&6
11589                 { { echo "$as_me:11589: error: option value must be one of: rel, abi, or auto" >&5
11590 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11591    { (exit 1); exit 1; }; }
11592                 ;;
11593         esac
11594
11595 else
11596   cf_cv_shlib_version=auto
11597 fi;
11598         echo "$as_me:11598: result: $cf_cv_shlib_version" >&5
11599 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11600
11601         cf_cv_rm_so_locs=no
11602         cf_try_cflags=
11603
11604         # Some less-capable ports of gcc support only -fpic
11605         CC_SHARED_OPTS=
11606
11607         cf_try_fPIC=no
11608         if test "$GCC" = yes
11609         then
11610                 cf_try_fPIC=yes
11611         else
11612                 case "$cf_cv_system_name" in
11613                 (*linux*)       # e.g., PGI compiler
11614                         cf_try_fPIC=yes
11615                         ;;
11616                 esac
11617         fi
11618
11619         if test "$cf_try_fPIC" = yes
11620         then
11621                 echo "$as_me:11621: checking which $CC option to use" >&5
11622 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11623                 cf_save_CFLAGS="$CFLAGS"
11624                 for CC_SHARED_OPTS in -fPIC -fpic ''
11625                 do
11626                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11627                         cat >"conftest.$ac_ext" <<_ACEOF
11628 #line 11628 "configure"
11629 #include "confdefs.h"
11630 #include <stdio.h>
11631 int
11632 main (void)
11633 {
11634 int x = 1
11635   ;
11636   return 0;
11637 }
11638 _ACEOF
11639 rm -f "conftest.$ac_objext"
11640 if { (eval echo "$as_me:11640: \"$ac_compile\"") >&5
11641   (eval $ac_compile) 2>&5
11642   ac_status=$?
11643   echo "$as_me:11643: \$? = $ac_status" >&5
11644   (exit "$ac_status"); } &&
11645          { ac_try='test -s "conftest.$ac_objext"'
11646   { (eval echo "$as_me:11646: \"$ac_try\"") >&5
11647   (eval $ac_try) 2>&5
11648   ac_status=$?
11649   echo "$as_me:11649: \$? = $ac_status" >&5
11650   (exit "$ac_status"); }; }; then
11651   break
11652 else
11653   echo "$as_me: failed program was:" >&5
11654 cat "conftest.$ac_ext" >&5
11655 fi
11656 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11657                 done
11658                 echo "$as_me:11658: result: $CC_SHARED_OPTS" >&5
11659 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11660                 CFLAGS="$cf_save_CFLAGS"
11661         fi
11662
11663         cf_cv_shlib_version_infix=no
11664
11665         case "$cf_cv_system_name" in
11666         (aix4.3-9*|aix[5-7]*)
11667                 if test "$GCC" = yes; then
11668                         CC_SHARED_OPTS='-Wl,-brtl'
11669                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11670                 else
11671                         CC_SHARED_OPTS='-brtl'
11672                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11673                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11674                 fi
11675                 ;;
11676         (beos*)
11677                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11678                 ;;
11679         (cygwin*)
11680                 CC_SHARED_OPTS=
11681                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11682                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11683                 cf_cv_shlib_version=cygdll
11684                 cf_cv_shlib_version_infix=cygdll
11685                 shlibdir=$bindir
11686                 MAKE_DLLS=
11687                 cat >mk_shared_lib.sh <<-CF_EOF
11688                 #!$SHELL
11689                 SHARED_LIB=\$1
11690                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11691                 shift
11692                 cat <<-EOF
11693                 Linking shared library
11694                 ** SHARED_LIB \$SHARED_LIB
11695                 ** IMPORT_LIB \$IMPORT_LIB
11696 EOF
11697                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11698 CF_EOF
11699                 chmod +x mk_shared_lib.sh
11700                 ;;
11701         (msys*)
11702                 CC_SHARED_OPTS=
11703                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11704                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11705                 cf_cv_shlib_version=msysdll
11706                 cf_cv_shlib_version_infix=msysdll
11707                 shlibdir=$bindir
11708                 MAKE_DLLS=
11709                 cat >mk_shared_lib.sh <<-CF_EOF
11710                 #!$SHELL
11711                 SHARED_LIB=\$1
11712                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11713                 shift
11714                 cat <<-EOF
11715                 Linking shared library
11716                 ** SHARED_LIB \$SHARED_LIB
11717                 ** IMPORT_LIB \$IMPORT_LIB
11718 EOF
11719                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11720 CF_EOF
11721                 chmod +x mk_shared_lib.sh
11722                 ;;
11723         (darwin*)
11724                 cf_try_cflags="no-cpp-precomp"
11725                 CC_SHARED_OPTS="-dynamic"
11726                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11727                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11728                 cf_cv_shlib_version_infix=yes
11729                 echo "$as_me:11729: checking if ld -search_paths_first works" >&5
11730 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11731 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11732   echo $ECHO_N "(cached) $ECHO_C" >&6
11733 else
11734
11735                         cf_save_LDFLAGS=$LDFLAGS
11736                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11737                         cat >"conftest.$ac_ext" <<_ACEOF
11738 #line 11738 "configure"
11739 #include "confdefs.h"
11740
11741 int
11742 main (void)
11743 {
11744 int i;
11745   ;
11746   return 0;
11747 }
11748 _ACEOF
11749 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11750 if { (eval echo "$as_me:11750: \"$ac_link\"") >&5
11751   (eval $ac_link) 2>&5
11752   ac_status=$?
11753   echo "$as_me:11753: \$? = $ac_status" >&5
11754   (exit "$ac_status"); } &&
11755          { ac_try='test -s "conftest$ac_exeext"'
11756   { (eval echo "$as_me:11756: \"$ac_try\"") >&5
11757   (eval $ac_try) 2>&5
11758   ac_status=$?
11759   echo "$as_me:11759: \$? = $ac_status" >&5
11760   (exit "$ac_status"); }; }; then
11761   cf_cv_ldflags_search_paths_first=yes
11762 else
11763   echo "$as_me: failed program was:" >&5
11764 cat "conftest.$ac_ext" >&5
11765 cf_cv_ldflags_search_paths_first=no
11766 fi
11767 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11768                                 LDFLAGS=$cf_save_LDFLAGS
11769 fi
11770 echo "$as_me:11770: result: $cf_cv_ldflags_search_paths_first" >&5
11771 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11772                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11773                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11774                 fi
11775                 ;;
11776         (haiku*)
11777
11778         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11779         if test "$cf_cv_shlib_version" = rel; then
11780                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11781         else
11782                 cf_cv_shared_soname='`basename $@`'
11783         fi
11784
11785                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11786                 ;;
11787         (hpux[7-8]*)
11788                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11789                 if test "$GCC" != yes; then
11790                         CC_SHARED_OPTS='+Z'
11791                 fi
11792                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11793                 INSTALL_LIB="-m 555"
11794                 ;;
11795         (hpux*)
11796                 # (tested with gcc 2.7.2 -- I don't have c89)
11797                 if test "$GCC" = yes; then
11798                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11799                 else
11800                         CC_SHARED_OPTS='+Z'
11801                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11802                 fi
11803                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11804                 # HP-UX shared libraries must be executable, and should be
11805                 # readonly to exploit a quirk in the memory manager.
11806                 INSTALL_LIB="-m 555"
11807                 ;;
11808         (interix*)
11809                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11810                 if test "$cf_cv_shlib_version" = rel; then
11811                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11812                 else
11813                         cf_shared_soname='`basename $@`'
11814                 fi
11815                 CC_SHARED_OPTS=
11816                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11817                 ;;
11818         (irix*)
11819                 if test "$cf_cv_enable_rpath" = yes ; then
11820                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11821                 fi
11822                 # tested with IRIX 5.2 and 'cc'.
11823                 if test "$GCC" != yes; then
11824                         CC_SHARED_OPTS='-KPIC'
11825                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11826                 else
11827                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11828                 fi
11829                 cf_cv_rm_so_locs=yes
11830                 ;;
11831         (linux*|gnu*|k*bsd*-gnu)
11832                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11833                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11834                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11835                 fi
11836                 if test "$cf_cv_enable_rpath" = yes ; then
11837                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11838                 fi
11839
11840         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11841         if test "$cf_cv_shlib_version" = rel; then
11842                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11843         else
11844                 cf_cv_shared_soname='`basename $@`'
11845         fi
11846
11847                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11848                 ;;
11849         (mingw*msvc*)
11850                 cf_cv_shlib_version=msvcdll
11851                 cf_cv_shlib_version_infix=msvcdll
11852                 shlibdir=$bindir
11853                 MAKE_DLLS=
11854                 if test "$DFT_LWR_MODEL" = "shared" ; then
11855                         LOCAL_LDFLAGS="-link -dll"
11856                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11857                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11858                 fi
11859                 CC_SHARED_OPTS=
11860                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11861                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11862                 cat >mk_shared_lib.sh <<-CF_EOF
11863                 #!$SHELL
11864                 SHARED_LIB=\$1
11865                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11866                 shift
11867                 my_ld=\$1
11868                 shift
11869                 cat <<-EOF
11870                 Linking shared library
11871                 ** SHARED LIB \$SHARED_LIB
11872                 ** IMPORT_LIB \$IMPORT_LIB
11873 EOF
11874                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11875                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11876                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11877 CF_EOF
11878                 chmod +x mk_shared_lib.sh
11879                 cat >mk_prog.sh <<-CF_EOF
11880                 #!$SHELL
11881                 shift
11882                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11883                 LD="$LD"
11884                 clopts=()
11885                 ldopts=("/subsystem:console")
11886                 libs=()
11887                 isdll=0
11888                 while test \$# -gt 0; do
11889                         case "\$1" in
11890                                 -link)
11891                                         # ignore -link argument
11892                                         ;;
11893                                 -M[TD] | -M[TD]d)
11894                                         # ignore runtime-library option
11895                                         ;;
11896                                 -dll)
11897                                         isdll=1
11898                                         ;;
11899                                 -W* | -w*)
11900                                         # ignore warnings
11901                                         ;;
11902                                 -D*)
11903                                         clopts+=("\$1")
11904                                         ;;
11905                                 -I*)
11906                                         clopts+=("\$1")
11907                                         ;;
11908                                 -l*)
11909                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11910                                         ;;
11911                                 -L*)
11912                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11913                                         ;;
11914                                 *.obj | *.o)
11915                                         ldopts+=("\$1")
11916                                         ;;
11917                                 -Wl,*)
11918                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11919                                                 ldopts+=("\${linkarg}")
11920                                         done
11921                                         ;;
11922                                 *.lib)
11923                                         ldopts+=("\$1")
11924                                         ;;
11925                                 -o)
11926                                         shift
11927                                         ldopts+=("-out:\$1")
11928                                         ;;
11929                                 *)
11930                                         clopts+=("\$1")
11931                                         ldopts+=("\$1")
11932                                         ;;
11933                         esac
11934                         shift
11935                 done
11936                 if [ "\$isdll" -ne 0 ]; then
11937                         for lib in \${libs[*]}; do
11938                                 ldopts+=("\$lib.dll.lib")
11939                         done
11940                 else
11941                         for lib in \${libs[*]}; do
11942                                 ldopts+=("\$lib.lib")
11943                         done
11944                 fi
11945                 cat <<-EOF
11946                 Creating program
11947                 ** ld options:   "\${ldopts[@]}"
11948 EOF
11949                 exec \$LD \${ldopts[@]}
11950 CF_EOF
11951                 chmod +x mk_prog.sh
11952                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11953                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11954                 ;;
11955         (mingw*)
11956                 cf_cv_shlib_version=mingw
11957                 cf_cv_shlib_version_infix=mingw
11958                 shlibdir=$bindir
11959                 MAKE_DLLS=
11960                 if test "$DFT_LWR_MODEL" = "shared" ; then
11961                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11962                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11963                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11964                 fi
11965                 CC_SHARED_OPTS=
11966                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11967                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11968                 cat >mk_shared_lib.sh <<-CF_EOF
11969                 #!$SHELL
11970                 SHARED_LIB=\$1
11971                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11972                 shift
11973                 cat <<-EOF
11974                 Linking shared library
11975                 ** SHARED_LIB \$SHARED_LIB
11976                 ** IMPORT_LIB \$IMPORT_LIB
11977 EOF
11978                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11979 CF_EOF
11980                 chmod +x mk_shared_lib.sh
11981                 ;;
11982         (openbsd[2-9].*|mirbsd*)
11983                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11984                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11985                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11986                 fi
11987                 if test "$cf_cv_enable_rpath" = yes ; then
11988                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11989                 fi
11990                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11991
11992         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11993         if test "$cf_cv_shlib_version" = rel; then
11994                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11995         else
11996                 cf_cv_shared_soname='`basename $@`'
11997         fi
11998
11999                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12000                 ;;
12001         (nskJ*)
12002                 CC_SHARED_OPTS=
12003                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
12004                 ;;
12005         (nskL*)
12006                 CC_SHARED_OPTS=
12007                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
12008                 ;;
12009         (nto-qnx*|openbsd*|freebsd[12].*)
12010                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12011                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
12012                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12013                 ;;
12014         (dragonfly*|freebsd*)
12015                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12016                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12017                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12018                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
12019                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12020                 fi
12021
12022         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12023         if test "$cf_cv_shlib_version" = rel; then
12024                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12025         else
12026                 cf_cv_shared_soname='`basename $@`'
12027         fi
12028
12029                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
12030                 ;;
12031         (netbsd*)
12032                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
12033                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
12034                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
12035                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12036                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
12037                         if test "$cf_cv_shlib_version" = auto; then
12038                         if test -f /usr/libexec/ld.elf_so; then
12039                                 cf_cv_shlib_version=abi
12040                         else
12041                                 cf_cv_shlib_version=rel
12042                         fi
12043                         fi
12044
12045         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12046         if test "$cf_cv_shlib_version" = rel; then
12047                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12048         else
12049                 cf_cv_shared_soname='`basename $@`'
12050         fi
12051
12052                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
12053                 else
12054                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
12055                 fi
12056                 ;;
12057         (osf*|mls+*)
12058                 # tested with OSF/1 V3.2 and 'cc'
12059                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
12060                 # link with shared libs).
12061                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
12062                 case "$host_os" in
12063                 (osf4*)
12064                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
12065                         ;;
12066                 esac
12067                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
12068                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
12069                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
12070                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12071                 fi
12072                 cf_cv_rm_so_locs=yes
12073                 ;;
12074         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
12075                 # tested with osr5.0.5
12076                 if test "$GCC" != yes; then
12077                         CC_SHARED_OPTS='-belf -KPIC'
12078                 fi
12079                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
12080                 if test "$cf_cv_enable_rpath" = yes ; then
12081                         # only way is to set LD_RUN_PATH but no switch for it
12082                         RUN_PATH=$libdir
12083                 fi
12084                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12085                 LINK_PROGS='LD_RUN_PATH=${libdir}'
12086                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
12087                 ;;
12088         (sunos4*)
12089                 # tested with SunOS 4.1.1 and gcc 2.7.0
12090                 if test "$GCC" != yes; then
12091                         CC_SHARED_OPTS='-KPIC'
12092                 fi
12093                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
12094                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12095                 ;;
12096         (solaris2*)
12097                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
12098                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
12099                 if test "$DFT_LWR_MODEL" = "shared" ; then
12100                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
12101                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
12102                 fi
12103                 if test "$cf_cv_enable_rpath" = yes ; then
12104                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
12105                 fi
12106
12107         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
12108         if test "$cf_cv_shlib_version" = rel; then
12109                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
12110         else
12111                 cf_cv_shared_soname='`basename $@`'
12112         fi
12113
12114                 if test "$GCC" != yes; then
12115                         cf_save_CFLAGS="$CFLAGS"
12116                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
12117                         do
12118                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
12119                                 cat >"conftest.$ac_ext" <<_ACEOF
12120 #line 12120 "configure"
12121 #include "confdefs.h"
12122 #include <stdio.h>
12123 int
12124 main (void)
12125 {
12126 printf("Hello\\n");
12127   ;
12128   return 0;
12129 }
12130 _ACEOF
12131 rm -f "conftest.$ac_objext"
12132 if { (eval echo "$as_me:12132: \"$ac_compile\"") >&5
12133   (eval $ac_compile) 2>&5
12134   ac_status=$?
12135   echo "$as_me:12135: \$? = $ac_status" >&5
12136   (exit "$ac_status"); } &&
12137          { ac_try='test -s "conftest.$ac_objext"'
12138   { (eval echo "$as_me:12138: \"$ac_try\"") >&5
12139   (eval $ac_try) 2>&5
12140   ac_status=$?
12141   echo "$as_me:12141: \$? = $ac_status" >&5
12142   (exit "$ac_status"); }; }; then
12143   break
12144 else
12145   echo "$as_me: failed program was:" >&5
12146 cat "conftest.$ac_ext" >&5
12147 fi
12148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12149                         done
12150                         CFLAGS="$cf_save_CFLAGS"
12151                         CC_SHARED_OPTS=$cf_shared_opts
12152                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
12153                 else
12154                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
12155                 fi
12156                 ;;
12157         (sysv5uw7*|unix_sv*)
12158                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
12159                 if test "$GCC" != yes; then
12160                         CC_SHARED_OPTS='-KPIC'
12161                 fi
12162                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
12163                 ;;
12164         (*)
12165                 CC_SHARED_OPTS='unknown'
12166                 MK_SHARED_LIB='echo unknown'
12167                 ;;
12168         esac
12169
12170         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
12171         case "$cf_cv_shlib_version" in
12172         (rel|abi)
12173                 case "$MK_SHARED_LIB" in
12174                 (*'-o $@')
12175                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
12176                         ;;
12177                 (*)
12178                         { echo "$as_me:12178: WARNING: ignored --with-shlib-version" >&5
12179 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
12180                         ;;
12181                 esac
12182                 ;;
12183         esac
12184
12185         if test -n "$cf_try_cflags"
12186         then
12187 cat > conftest.$ac_ext <<EOF
12188 #line 12188 "${as_me:-configure}"
12189 #include <stdio.h>
12190 int main(int argc, char *argv[])
12191 {
12192         printf("hello\\n");
12193         return (argv[argc-1] == 0) ;
12194 }
12195 EOF
12196                 cf_save_CFLAGS="$CFLAGS"
12197                 for cf_opt in $cf_try_cflags
12198                 do
12199                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
12200                         echo "$as_me:12200: checking if CFLAGS option -$cf_opt works" >&5
12201 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
12202                         if { (eval echo "$as_me:12202: \"$ac_compile\"") >&5
12203   (eval $ac_compile) 2>&5
12204   ac_status=$?
12205   echo "$as_me:12205: \$? = $ac_status" >&5
12206   (exit "$ac_status"); }; then
12207                                 echo "$as_me:12207: result: yes" >&5
12208 echo "${ECHO_T}yes" >&6
12209                                 cf_save_CFLAGS="$CFLAGS"
12210                         else
12211                                 echo "$as_me:12211: result: no" >&5
12212 echo "${ECHO_T}no" >&6
12213                         fi
12214                 done
12215                 CFLAGS="$cf_save_CFLAGS"
12216         fi
12217
12218         # RPATH_LIST is a colon-separated list of directories
12219         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
12220         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
12221
12222         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
12223
12224         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
12225
12226 echo "${as_me:-configure}:12226: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
12227
12228         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
12229
12230 echo "${as_me:-configure}:12230: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
12231
12232 # The test/sample programs in the original tree link using rpath option.
12233 # Make it optional for packagers.
12234 if test -n "$LOCAL_LDFLAGS"
12235 then
12236         echo "$as_me:12236: checking if you want to link sample programs with rpath option" >&5
12237 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
12238
12239 # Check whether --enable-rpath-link or --disable-rpath-link was given.
12240 if test "${enable_rpath_link+set}" = set; then
12241   enableval="$enable_rpath_link"
12242   with_rpath_link=$enableval
12243 else
12244   with_rpath_link=yes
12245 fi;
12246         echo "$as_me:12246: result: $with_rpath_link" >&5
12247 echo "${ECHO_T}$with_rpath_link" >&6
12248         if test "$with_rpath_link" = no
12249         then
12250                 LOCAL_LDFLAGS=
12251                 LOCAL_LDFLAGS2=
12252         fi
12253 fi
12254
12255 ###############################################################################
12256
12257 ###   use option --enable-broken-linker to force on use of broken-linker support
12258
12259 echo "$as_me:12259: checking if you want broken-linker support code" >&5
12260 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
12261
12262 # Check whether --enable-broken_linker or --disable-broken_linker was given.
12263 if test "${enable_broken_linker+set}" = set; then
12264   enableval="$enable_broken_linker"
12265   with_broken_linker=$enableval
12266 else
12267   with_broken_linker=no
12268 fi;
12269 echo "$as_me:12269: result: $with_broken_linker" >&5
12270 echo "${ECHO_T}$with_broken_linker" >&6
12271
12272 : "${BROKEN_LINKER:=0}"
12273 if test "x$with_broken_linker" = xyes ; then
12274
12275 cat >>confdefs.h <<\EOF
12276 #define BROKEN_LINKER 1
12277 EOF
12278
12279         BROKEN_LINKER=1
12280 fi
12281
12282 # Check to define _XOPEN_SOURCE "automatically"
12283
12284 echo "$as_me:12284: checking if the POSIX test-macros are already defined" >&5
12285 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
12286 if test "${cf_cv_posix_visible+set}" = set; then
12287   echo $ECHO_N "(cached) $ECHO_C" >&6
12288 else
12289
12290 cat >"conftest.$ac_ext" <<_ACEOF
12291 #line 12291 "configure"
12292 #include "confdefs.h"
12293 #include <stdio.h>
12294 int
12295 main (void)
12296 {
12297
12298 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12299         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12300         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12301         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12302 #error conflicting symbols found
12303 #endif
12304
12305   ;
12306   return 0;
12307 }
12308 _ACEOF
12309 rm -f "conftest.$ac_objext"
12310 if { (eval echo "$as_me:12310: \"$ac_compile\"") >&5
12311   (eval $ac_compile) 2>&5
12312   ac_status=$?
12313   echo "$as_me:12313: \$? = $ac_status" >&5
12314   (exit "$ac_status"); } &&
12315          { ac_try='test -s "conftest.$ac_objext"'
12316   { (eval echo "$as_me:12316: \"$ac_try\"") >&5
12317   (eval $ac_try) 2>&5
12318   ac_status=$?
12319   echo "$as_me:12319: \$? = $ac_status" >&5
12320   (exit "$ac_status"); }; }; then
12321   cf_cv_posix_visible=no
12322 else
12323   echo "$as_me: failed program was:" >&5
12324 cat "conftest.$ac_ext" >&5
12325 cf_cv_posix_visible=yes
12326 fi
12327 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12328
12329 fi
12330 echo "$as_me:12330: result: $cf_cv_posix_visible" >&5
12331 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12332
12333 if test "$cf_cv_posix_visible" = no; then
12334
12335 cf_XOPEN_SOURCE=600
12336 cf_POSIX_C_SOURCE=199506L
12337 cf_xopen_source=
12338
12339 case "$host_os" in
12340 (aix[4-7]*)
12341         cf_xopen_source="-D_ALL_SOURCE"
12342         ;;
12343 (msys)
12344         cf_XOPEN_SOURCE=600
12345         ;;
12346 (darwin[0-8].*)
12347         cf_xopen_source="-D_APPLE_C_SOURCE"
12348         ;;
12349 (darwin*)
12350         cf_xopen_source="-D_DARWIN_C_SOURCE"
12351         cf_XOPEN_SOURCE=
12352         ;;
12353 (freebsd*|dragonfly*|midnightbsd*)
12354         # 5.x headers associate
12355         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12356         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12357         cf_POSIX_C_SOURCE=200112L
12358         cf_XOPEN_SOURCE=600
12359         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12360         ;;
12361 (hpux11*)
12362         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12363         ;;
12364 (hpux*)
12365         cf_xopen_source="-D_HPUX_SOURCE"
12366         ;;
12367 (irix[56].*)
12368         cf_xopen_source="-D_SGI_SOURCE"
12369         cf_XOPEN_SOURCE=
12370         ;;
12371 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12372
12373 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12374
12375 echo "$as_me:12375: checking if this is the GNU C library" >&5
12376 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12377 if test "${cf_cv_gnu_library+set}" = set; then
12378   echo $ECHO_N "(cached) $ECHO_C" >&6
12379 else
12380
12381 cat >"conftest.$ac_ext" <<_ACEOF
12382 #line 12382 "configure"
12383 #include "confdefs.h"
12384 #include <sys/types.h>
12385 int
12386 main (void)
12387 {
12388
12389         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12390                 return 0;
12391         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12392                 return 0;
12393         #else
12394         #       error not GNU C library
12395         #endif
12396   ;
12397   return 0;
12398 }
12399 _ACEOF
12400 rm -f "conftest.$ac_objext"
12401 if { (eval echo "$as_me:12401: \"$ac_compile\"") >&5
12402   (eval $ac_compile) 2>&5
12403   ac_status=$?
12404   echo "$as_me:12404: \$? = $ac_status" >&5
12405   (exit "$ac_status"); } &&
12406          { ac_try='test -s "conftest.$ac_objext"'
12407   { (eval echo "$as_me:12407: \"$ac_try\"") >&5
12408   (eval $ac_try) 2>&5
12409   ac_status=$?
12410   echo "$as_me:12410: \$? = $ac_status" >&5
12411   (exit "$ac_status"); }; }; then
12412   cf_cv_gnu_library=yes
12413 else
12414   echo "$as_me: failed program was:" >&5
12415 cat "conftest.$ac_ext" >&5
12416 cf_cv_gnu_library=no
12417 fi
12418 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12419
12420 fi
12421 echo "$as_me:12421: result: $cf_cv_gnu_library" >&5
12422 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12423
12424 if test x$cf_cv_gnu_library = xyes; then
12425
12426         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12427         # was changed to help a little.  newlib incorporated the change about 4
12428         # years later.
12429         echo "$as_me:12429: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12430 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12431 if test "${cf_cv_gnu_library_219+set}" = set; then
12432   echo $ECHO_N "(cached) $ECHO_C" >&6
12433 else
12434
12435                 cf_save="$CPPFLAGS"
12436
12437         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12438         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12439
12440                 cat >"conftest.$ac_ext" <<_ACEOF
12441 #line 12441 "configure"
12442 #include "confdefs.h"
12443 #include <sys/types.h>
12444 int
12445 main (void)
12446 {
12447
12448                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12449                                 return 0;
12450                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12451                                 return 0;
12452                         #else
12453                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12454                         #endif
12455   ;
12456   return 0;
12457 }
12458 _ACEOF
12459 rm -f "conftest.$ac_objext"
12460 if { (eval echo "$as_me:12460: \"$ac_compile\"") >&5
12461   (eval $ac_compile) 2>&5
12462   ac_status=$?
12463   echo "$as_me:12463: \$? = $ac_status" >&5
12464   (exit "$ac_status"); } &&
12465          { ac_try='test -s "conftest.$ac_objext"'
12466   { (eval echo "$as_me:12466: \"$ac_try\"") >&5
12467   (eval $ac_try) 2>&5
12468   ac_status=$?
12469   echo "$as_me:12469: \$? = $ac_status" >&5
12470   (exit "$ac_status"); }; }; then
12471   cf_cv_gnu_library_219=yes
12472 else
12473   echo "$as_me: failed program was:" >&5
12474 cat "conftest.$ac_ext" >&5
12475 cf_cv_gnu_library_219=no
12476 fi
12477 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12478                 CPPFLAGS="$cf_save"
12479
12480 fi
12481 echo "$as_me:12481: result: $cf_cv_gnu_library_219" >&5
12482 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12483
12484         if test "x$cf_cv_gnu_library_219" = xyes; then
12485                 cf_save="$CPPFLAGS"
12486                 echo "$as_me:12486: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12487 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12488 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12489   echo $ECHO_N "(cached) $ECHO_C" >&6
12490 else
12491
12492 cf_fix_cppflags=no
12493 cf_new_cflags=
12494 cf_new_cppflags=
12495 cf_new_extra_cppflags=
12496
12497 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12498 do
12499 case "$cf_fix_cppflags" in
12500 (no)
12501         case "$cf_add_cflags" in
12502         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12503                 case "$cf_add_cflags" in
12504                 (-D*)
12505                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12506
12507                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12508                                 && test -z "${cf_tst_cflags}" \
12509                                 && cf_fix_cppflags=yes
12510
12511                         if test "$cf_fix_cppflags" = yes ; then
12512
12513         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12514         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12515
12516                                 continue
12517                         elif test "${cf_tst_cflags}" = "\"'" ; then
12518
12519         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12520         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12521
12522                                 continue
12523                         fi
12524                         ;;
12525                 esac
12526                 case "$CPPFLAGS" in
12527                 (*$cf_add_cflags)
12528                         ;;
12529                 (*)
12530                         case "$cf_add_cflags" in
12531                         (-D*)
12532                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12533
12534 CPPFLAGS=`echo "$CPPFLAGS" | \
12535         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12536                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12537
12538                                 ;;
12539                         esac
12540
12541         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12542         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12543
12544                         ;;
12545                 esac
12546                 ;;
12547         (*)
12548
12549         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12550         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12551
12552                 ;;
12553         esac
12554         ;;
12555 (yes)
12556
12557         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12558         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12559
12560         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12561
12562         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12563                 && test -z "${cf_tst_cflags}" \
12564                 && cf_fix_cppflags=no
12565         ;;
12566 esac
12567 done
12568
12569 if test -n "$cf_new_cflags" ; then
12570
12571         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12572         CFLAGS="${CFLAGS}$cf_new_cflags"
12573
12574 fi
12575
12576 if test -n "$cf_new_cppflags" ; then
12577
12578         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12579         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12580
12581 fi
12582
12583 if test -n "$cf_new_extra_cppflags" ; then
12584
12585         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12586         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12587
12588 fi
12589
12590                         cat >"conftest.$ac_ext" <<_ACEOF
12591 #line 12591 "configure"
12592 #include "confdefs.h"
12593
12594                                 #include <limits.h>
12595                                 #include <sys/types.h>
12596
12597 int
12598 main (void)
12599 {
12600
12601                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12602                                         return 0;
12603                                 #else
12604                                 #       error GNU C library is too old
12605                                 #endif
12606   ;
12607   return 0;
12608 }
12609 _ACEOF
12610 rm -f "conftest.$ac_objext"
12611 if { (eval echo "$as_me:12611: \"$ac_compile\"") >&5
12612   (eval $ac_compile) 2>&5
12613   ac_status=$?
12614   echo "$as_me:12614: \$? = $ac_status" >&5
12615   (exit "$ac_status"); } &&
12616          { ac_try='test -s "conftest.$ac_objext"'
12617   { (eval echo "$as_me:12617: \"$ac_try\"") >&5
12618   (eval $ac_try) 2>&5
12619   ac_status=$?
12620   echo "$as_me:12620: \$? = $ac_status" >&5
12621   (exit "$ac_status"); }; }; then
12622   cf_cv_gnu_dftsrc_219=yes
12623 else
12624   echo "$as_me: failed program was:" >&5
12625 cat "conftest.$ac_ext" >&5
12626 cf_cv_gnu_dftsrc_219=no
12627 fi
12628 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12629
12630 fi
12631 echo "$as_me:12631: result: $cf_cv_gnu_dftsrc_219" >&5
12632 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12633                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12634         else
12635                 cf_cv_gnu_dftsrc_219=maybe
12636         fi
12637
12638         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12639
12640                 echo "$as_me:12640: checking if we must define _GNU_SOURCE" >&5
12641 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12642 if test "${cf_cv_gnu_source+set}" = set; then
12643   echo $ECHO_N "(cached) $ECHO_C" >&6
12644 else
12645
12646                 cat >"conftest.$ac_ext" <<_ACEOF
12647 #line 12647 "configure"
12648 #include "confdefs.h"
12649 #include <sys/types.h>
12650 int
12651 main (void)
12652 {
12653
12654                         #ifndef _XOPEN_SOURCE
12655                         #error  expected _XOPEN_SOURCE to be defined
12656                         #endif
12657   ;
12658   return 0;
12659 }
12660 _ACEOF
12661 rm -f "conftest.$ac_objext"
12662 if { (eval echo "$as_me:12662: \"$ac_compile\"") >&5
12663   (eval $ac_compile) 2>&5
12664   ac_status=$?
12665   echo "$as_me:12665: \$? = $ac_status" >&5
12666   (exit "$ac_status"); } &&
12667          { ac_try='test -s "conftest.$ac_objext"'
12668   { (eval echo "$as_me:12668: \"$ac_try\"") >&5
12669   (eval $ac_try) 2>&5
12670   ac_status=$?
12671   echo "$as_me:12671: \$? = $ac_status" >&5
12672   (exit "$ac_status"); }; }; then
12673   cf_cv_gnu_source=no
12674 else
12675   echo "$as_me: failed program was:" >&5
12676 cat "conftest.$ac_ext" >&5
12677 cf_save="$CPPFLAGS"
12678
12679 cf_fix_cppflags=no
12680 cf_new_cflags=
12681 cf_new_cppflags=
12682 cf_new_extra_cppflags=
12683
12684 for cf_add_cflags in -D_GNU_SOURCE
12685 do
12686 case "$cf_fix_cppflags" in
12687 (no)
12688         case "$cf_add_cflags" in
12689         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12690                 case "$cf_add_cflags" in
12691                 (-D*)
12692                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12693
12694                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12695                                 && test -z "${cf_tst_cflags}" \
12696                                 && cf_fix_cppflags=yes
12697
12698                         if test "$cf_fix_cppflags" = yes ; then
12699
12700         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12701         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12702
12703                                 continue
12704                         elif test "${cf_tst_cflags}" = "\"'" ; then
12705
12706         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12707         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12708
12709                                 continue
12710                         fi
12711                         ;;
12712                 esac
12713                 case "$CPPFLAGS" in
12714                 (*$cf_add_cflags)
12715                         ;;
12716                 (*)
12717                         case "$cf_add_cflags" in
12718                         (-D*)
12719                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12720
12721 CPPFLAGS=`echo "$CPPFLAGS" | \
12722         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12723                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12724
12725                                 ;;
12726                         esac
12727
12728         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12729         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12730
12731                         ;;
12732                 esac
12733                 ;;
12734         (*)
12735
12736         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12737         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12738
12739                 ;;
12740         esac
12741         ;;
12742 (yes)
12743
12744         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12745         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12746
12747         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12748
12749         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12750                 && test -z "${cf_tst_cflags}" \
12751                 && cf_fix_cppflags=no
12752         ;;
12753 esac
12754 done
12755
12756 if test -n "$cf_new_cflags" ; then
12757
12758         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12759         CFLAGS="${CFLAGS}$cf_new_cflags"
12760
12761 fi
12762
12763 if test -n "$cf_new_cppflags" ; then
12764
12765         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12766         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12767
12768 fi
12769
12770 if test -n "$cf_new_extra_cppflags" ; then
12771
12772         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12773         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12774
12775 fi
12776
12777                          cat >"conftest.$ac_ext" <<_ACEOF
12778 #line 12778 "configure"
12779 #include "confdefs.h"
12780 #include <sys/types.h>
12781 int
12782 main (void)
12783 {
12784
12785                                 #ifdef _XOPEN_SOURCE
12786                                 #error  expected _XOPEN_SOURCE to be undefined
12787                                 #endif
12788   ;
12789   return 0;
12790 }
12791 _ACEOF
12792 rm -f "conftest.$ac_objext"
12793 if { (eval echo "$as_me:12793: \"$ac_compile\"") >&5
12794   (eval $ac_compile) 2>&5
12795   ac_status=$?
12796   echo "$as_me:12796: \$? = $ac_status" >&5
12797   (exit "$ac_status"); } &&
12798          { ac_try='test -s "conftest.$ac_objext"'
12799   { (eval echo "$as_me:12799: \"$ac_try\"") >&5
12800   (eval $ac_try) 2>&5
12801   ac_status=$?
12802   echo "$as_me:12802: \$? = $ac_status" >&5
12803   (exit "$ac_status"); }; }; then
12804   cf_cv_gnu_source=no
12805 else
12806   echo "$as_me: failed program was:" >&5
12807 cat "conftest.$ac_ext" >&5
12808 cf_cv_gnu_source=yes
12809 fi
12810 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12811                         CPPFLAGS="$cf_save"
12812
12813 fi
12814 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12815
12816 fi
12817 echo "$as_me:12817: result: $cf_cv_gnu_source" >&5
12818 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12819
12820                 if test "$cf_cv_gnu_source" = yes
12821                 then
12822                 echo "$as_me:12822: checking if we should also define _DEFAULT_SOURCE" >&5
12823 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12824 if test "${cf_cv_default_source+set}" = set; then
12825   echo $ECHO_N "(cached) $ECHO_C" >&6
12826 else
12827
12828         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12829         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12830
12831                         cat >"conftest.$ac_ext" <<_ACEOF
12832 #line 12832 "configure"
12833 #include "confdefs.h"
12834 #include <sys/types.h>
12835 int
12836 main (void)
12837 {
12838
12839                                 #ifdef _DEFAULT_SOURCE
12840                                 #error  expected _DEFAULT_SOURCE to be undefined
12841                                 #endif
12842   ;
12843   return 0;
12844 }
12845 _ACEOF
12846 rm -f "conftest.$ac_objext"
12847 if { (eval echo "$as_me:12847: \"$ac_compile\"") >&5
12848   (eval $ac_compile) 2>&5
12849   ac_status=$?
12850   echo "$as_me:12850: \$? = $ac_status" >&5
12851   (exit "$ac_status"); } &&
12852          { ac_try='test -s "conftest.$ac_objext"'
12853   { (eval echo "$as_me:12853: \"$ac_try\"") >&5
12854   (eval $ac_try) 2>&5
12855   ac_status=$?
12856   echo "$as_me:12856: \$? = $ac_status" >&5
12857   (exit "$ac_status"); }; }; then
12858   cf_cv_default_source=no
12859 else
12860   echo "$as_me: failed program was:" >&5
12861 cat "conftest.$ac_ext" >&5
12862 cf_cv_default_source=yes
12863 fi
12864 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12865
12866 fi
12867 echo "$as_me:12867: result: $cf_cv_default_source" >&5
12868 echo "${ECHO_T}$cf_cv_default_source" >&6
12869                         if test "$cf_cv_default_source" = yes
12870                         then
12871
12872         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12873         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12874
12875                         fi
12876                 fi
12877         fi
12878
12879 fi
12880
12881         ;;
12882 (minix*)
12883         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12884         ;;
12885 (mirbsd*)
12886         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12887         cf_XOPEN_SOURCE=
12888
12889 if test "$cf_cv_posix_visible" = no; then
12890
12891 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12892
12893 cf_save_CFLAGS="$CFLAGS"
12894 cf_save_CPPFLAGS="$CPPFLAGS"
12895
12896 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12897         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12898                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12899
12900 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12901         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12902                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12903
12904 echo "$as_me:12904: checking if we should define _POSIX_C_SOURCE" >&5
12905 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12906 if test "${cf_cv_posix_c_source+set}" = set; then
12907   echo $ECHO_N "(cached) $ECHO_C" >&6
12908 else
12909
12910 echo "${as_me:-configure}:12910: testing if the symbol is already defined go no further ..." 1>&5
12911
12912         cat >"conftest.$ac_ext" <<_ACEOF
12913 #line 12913 "configure"
12914 #include "confdefs.h"
12915 #include <sys/types.h>
12916 int
12917 main (void)
12918 {
12919
12920 #ifndef _POSIX_C_SOURCE
12921 make an error
12922 #endif
12923   ;
12924   return 0;
12925 }
12926 _ACEOF
12927 rm -f "conftest.$ac_objext"
12928 if { (eval echo "$as_me:12928: \"$ac_compile\"") >&5
12929   (eval $ac_compile) 2>&5
12930   ac_status=$?
12931   echo "$as_me:12931: \$? = $ac_status" >&5
12932   (exit "$ac_status"); } &&
12933          { ac_try='test -s "conftest.$ac_objext"'
12934   { (eval echo "$as_me:12934: \"$ac_try\"") >&5
12935   (eval $ac_try) 2>&5
12936   ac_status=$?
12937   echo "$as_me:12937: \$? = $ac_status" >&5
12938   (exit "$ac_status"); }; }; then
12939   cf_cv_posix_c_source=no
12940 else
12941   echo "$as_me: failed program was:" >&5
12942 cat "conftest.$ac_ext" >&5
12943 cf_want_posix_source=no
12944          case .$cf_POSIX_C_SOURCE in
12945          (.[12]??*)
12946                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12947                 ;;
12948          (.2)
12949                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12950                 cf_want_posix_source=yes
12951                 ;;
12952          (.*)
12953                 cf_want_posix_source=yes
12954                 ;;
12955          esac
12956          if test "$cf_want_posix_source" = yes ; then
12957                 cat >"conftest.$ac_ext" <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960 #include <sys/types.h>
12961 int
12962 main (void)
12963 {
12964
12965 #ifdef _POSIX_SOURCE
12966 make an error
12967 #endif
12968   ;
12969   return 0;
12970 }
12971 _ACEOF
12972 rm -f "conftest.$ac_objext"
12973 if { (eval echo "$as_me:12973: \"$ac_compile\"") >&5
12974   (eval $ac_compile) 2>&5
12975   ac_status=$?
12976   echo "$as_me:12976: \$? = $ac_status" >&5
12977   (exit "$ac_status"); } &&
12978          { ac_try='test -s "conftest.$ac_objext"'
12979   { (eval echo "$as_me:12979: \"$ac_try\"") >&5
12980   (eval $ac_try) 2>&5
12981   ac_status=$?
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit "$ac_status"); }; }; then
12984   :
12985 else
12986   echo "$as_me: failed program was:" >&5
12987 cat "conftest.$ac_ext" >&5
12988 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12989 fi
12990 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12991          fi
12992
12993 echo "${as_me:-configure}:12993: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12994
12995          CFLAGS="$cf_trim_CFLAGS"
12996          CPPFLAGS="$cf_trim_CPPFLAGS"
12997
12998         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12999         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13000
13001 echo "${as_me:-configure}:13001: testing if the second compile does not leave our definition intact error ..." 1>&5
13002
13003          cat >"conftest.$ac_ext" <<_ACEOF
13004 #line 13004 "configure"
13005 #include "confdefs.h"
13006 #include <sys/types.h>
13007 int
13008 main (void)
13009 {
13010
13011 #ifndef _POSIX_C_SOURCE
13012 make an error
13013 #endif
13014   ;
13015   return 0;
13016 }
13017 _ACEOF
13018 rm -f "conftest.$ac_objext"
13019 if { (eval echo "$as_me:13019: \"$ac_compile\"") >&5
13020   (eval $ac_compile) 2>&5
13021   ac_status=$?
13022   echo "$as_me:13022: \$? = $ac_status" >&5
13023   (exit "$ac_status"); } &&
13024          { ac_try='test -s "conftest.$ac_objext"'
13025   { (eval echo "$as_me:13025: \"$ac_try\"") >&5
13026   (eval $ac_try) 2>&5
13027   ac_status=$?
13028   echo "$as_me:13028: \$? = $ac_status" >&5
13029   (exit "$ac_status"); }; }; then
13030   :
13031 else
13032   echo "$as_me: failed program was:" >&5
13033 cat "conftest.$ac_ext" >&5
13034 cf_cv_posix_c_source=no
13035 fi
13036 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13037          CFLAGS="$cf_save_CFLAGS"
13038          CPPFLAGS="$cf_save_CPPFLAGS"
13039
13040 fi
13041 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13042
13043 fi
13044 echo "$as_me:13044: result: $cf_cv_posix_c_source" >&5
13045 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13046
13047 if test "$cf_cv_posix_c_source" != no ; then
13048         CFLAGS="$cf_trim_CFLAGS"
13049         CPPFLAGS="$cf_trim_CPPFLAGS"
13050
13051 cf_fix_cppflags=no
13052 cf_new_cflags=
13053 cf_new_cppflags=
13054 cf_new_extra_cppflags=
13055
13056 for cf_add_cflags in $cf_cv_posix_c_source
13057 do
13058 case "$cf_fix_cppflags" in
13059 (no)
13060         case "$cf_add_cflags" in
13061         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13062                 case "$cf_add_cflags" in
13063                 (-D*)
13064                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13065
13066                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13067                                 && test -z "${cf_tst_cflags}" \
13068                                 && cf_fix_cppflags=yes
13069
13070                         if test "$cf_fix_cppflags" = yes ; then
13071
13072         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13073         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13074
13075                                 continue
13076                         elif test "${cf_tst_cflags}" = "\"'" ; then
13077
13078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13080
13081                                 continue
13082                         fi
13083                         ;;
13084                 esac
13085                 case "$CPPFLAGS" in
13086                 (*$cf_add_cflags)
13087                         ;;
13088                 (*)
13089                         case "$cf_add_cflags" in
13090                         (-D*)
13091                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13092
13093 CPPFLAGS=`echo "$CPPFLAGS" | \
13094         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13095                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13096
13097                                 ;;
13098                         esac
13099
13100         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13101         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13102
13103                         ;;
13104                 esac
13105                 ;;
13106         (*)
13107
13108         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13109         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13110
13111                 ;;
13112         esac
13113         ;;
13114 (yes)
13115
13116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13118
13119         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13120
13121         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13122                 && test -z "${cf_tst_cflags}" \
13123                 && cf_fix_cppflags=no
13124         ;;
13125 esac
13126 done
13127
13128 if test -n "$cf_new_cflags" ; then
13129
13130         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13131         CFLAGS="${CFLAGS}$cf_new_cflags"
13132
13133 fi
13134
13135 if test -n "$cf_new_cppflags" ; then
13136
13137         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13138         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13139
13140 fi
13141
13142 if test -n "$cf_new_extra_cppflags" ; then
13143
13144         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13145         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13146
13147 fi
13148
13149 fi
13150
13151 fi # cf_cv_posix_visible
13152
13153         ;;
13154 (netbsd*)
13155         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
13156         ;;
13157 (openbsd[6-9]*)
13158         # OpenBSD 6.x has broken locale support, both compile-time and runtime.
13159         # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
13160         # Abusing the conformance level is a workaround.
13161         { echo "$as_me:13161: WARNING: this system does not provide usable locale support" >&5
13162 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;}
13163         cf_xopen_source="-D_BSD_SOURCE"
13164         cf_XOPEN_SOURCE=700
13165         ;;
13166 (openbsd[4-5]*)
13167         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
13168         cf_xopen_source="-D_BSD_SOURCE"
13169         cf_XOPEN_SOURCE=600
13170         ;;
13171 (openbsd*)
13172         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
13173         ;;
13174 (osf[45]*)
13175         cf_xopen_source="-D_OSF_SOURCE"
13176         ;;
13177 (nto-qnx*)
13178         cf_xopen_source="-D_QNX_SOURCE"
13179         ;;
13180 (sco*)
13181         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
13182         ;;
13183 (solaris2.*)
13184         cf_xopen_source="-D__EXTENSIONS__"
13185         cf_cv_xopen_source=broken
13186         ;;
13187 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
13188         cf_XOPEN_SOURCE=
13189         cf_POSIX_C_SOURCE=
13190         ;;
13191 (*)
13192
13193 echo "$as_me:13193: checking if we should define _XOPEN_SOURCE" >&5
13194 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13195 if test "${cf_cv_xopen_source+set}" = set; then
13196   echo $ECHO_N "(cached) $ECHO_C" >&6
13197 else
13198
13199         cat >"conftest.$ac_ext" <<_ACEOF
13200 #line 13200 "configure"
13201 #include "confdefs.h"
13202
13203 #include <stdlib.h>
13204 #include <string.h>
13205 #include <sys/types.h>
13206
13207 int
13208 main (void)
13209 {
13210
13211 #ifndef _XOPEN_SOURCE
13212 make an error
13213 #endif
13214   ;
13215   return 0;
13216 }
13217 _ACEOF
13218 rm -f "conftest.$ac_objext"
13219 if { (eval echo "$as_me:13219: \"$ac_compile\"") >&5
13220   (eval $ac_compile) 2>&5
13221   ac_status=$?
13222   echo "$as_me:13222: \$? = $ac_status" >&5
13223   (exit "$ac_status"); } &&
13224          { ac_try='test -s "conftest.$ac_objext"'
13225   { (eval echo "$as_me:13225: \"$ac_try\"") >&5
13226   (eval $ac_try) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit "$ac_status"); }; }; then
13230   cf_cv_xopen_source=no
13231 else
13232   echo "$as_me: failed program was:" >&5
13233 cat "conftest.$ac_ext" >&5
13234 cf_save="$CPPFLAGS"
13235
13236         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13237         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13238
13239          cat >"conftest.$ac_ext" <<_ACEOF
13240 #line 13240 "configure"
13241 #include "confdefs.h"
13242
13243 #include <stdlib.h>
13244 #include <string.h>
13245 #include <sys/types.h>
13246
13247 int
13248 main (void)
13249 {
13250
13251 #ifdef _XOPEN_SOURCE
13252 make an error
13253 #endif
13254   ;
13255   return 0;
13256 }
13257 _ACEOF
13258 rm -f "conftest.$ac_objext"
13259 if { (eval echo "$as_me:13259: \"$ac_compile\"") >&5
13260   (eval $ac_compile) 2>&5
13261   ac_status=$?
13262   echo "$as_me:13262: \$? = $ac_status" >&5
13263   (exit "$ac_status"); } &&
13264          { ac_try='test -s "conftest.$ac_objext"'
13265   { (eval echo "$as_me:13265: \"$ac_try\"") >&5
13266   (eval $ac_try) 2>&5
13267   ac_status=$?
13268   echo "$as_me:13268: \$? = $ac_status" >&5
13269   (exit "$ac_status"); }; }; then
13270   cf_cv_xopen_source=no
13271 else
13272   echo "$as_me: failed program was:" >&5
13273 cat "conftest.$ac_ext" >&5
13274 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13275 fi
13276 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13277         CPPFLAGS="$cf_save"
13278
13279 fi
13280 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13281
13282 fi
13283 echo "$as_me:13283: result: $cf_cv_xopen_source" >&5
13284 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13285
13286 if test "$cf_cv_xopen_source" != no ; then
13287
13288 CFLAGS=`echo "$CFLAGS" | \
13289         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13290                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13291
13292 CPPFLAGS=`echo "$CPPFLAGS" | \
13293         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13294                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13295
13296         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13297
13298 for cf_add_cflags in $cf_temp_xopen_source
13299 do
13300         case "x$cf_add_cflags" in
13301         (x-[DU]*)
13302
13303 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13304 while true
13305 do
13306         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'`
13307         test "$CFLAGS" != "$cf_old_cflag" || break
13308
13309         CFLAGS="$cf_old_cflag"
13310 done
13311
13312 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13313 while true
13314 do
13315         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'`
13316         test "$CPPFLAGS" != "$cf_old_cflag" || break
13317
13318         CPPFLAGS="$cf_old_cflag"
13319 done
13320
13321                 ;;
13322         esac
13323
13324 cf_fix_cppflags=no
13325 cf_new_cflags=
13326 cf_new_cppflags=
13327 cf_new_extra_cppflags=
13328
13329 for cf_add_cflags in $cf_add_cflags
13330 do
13331 case "$cf_fix_cppflags" in
13332 (no)
13333         case "$cf_add_cflags" in
13334         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13335                 case "$cf_add_cflags" in
13336                 (-D*)
13337                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13338
13339                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13340                                 && test -z "${cf_tst_cflags}" \
13341                                 && cf_fix_cppflags=yes
13342
13343                         if test "$cf_fix_cppflags" = yes ; then
13344
13345         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13346         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13347
13348                                 continue
13349                         elif test "${cf_tst_cflags}" = "\"'" ; then
13350
13351         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13352         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13353
13354                                 continue
13355                         fi
13356                         ;;
13357                 esac
13358                 case "$CPPFLAGS" in
13359                 (*$cf_add_cflags)
13360                         ;;
13361                 (*)
13362                         case "$cf_add_cflags" in
13363                         (-D*)
13364                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13365
13366 CPPFLAGS=`echo "$CPPFLAGS" | \
13367         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13368                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13369
13370                                 ;;
13371                         esac
13372
13373         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13374         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13375
13376                         ;;
13377                 esac
13378                 ;;
13379         (*)
13380
13381         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13382         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13383
13384                 ;;
13385         esac
13386         ;;
13387 (yes)
13388
13389         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13390         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13391
13392         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13393
13394         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13395                 && test -z "${cf_tst_cflags}" \
13396                 && cf_fix_cppflags=no
13397         ;;
13398 esac
13399 done
13400
13401 if test -n "$cf_new_cflags" ; then
13402
13403         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13404         CFLAGS="${CFLAGS}$cf_new_cflags"
13405
13406 fi
13407
13408 if test -n "$cf_new_cppflags" ; then
13409
13410         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13411         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13412
13413 fi
13414
13415 if test -n "$cf_new_extra_cppflags" ; then
13416
13417         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13418         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13419
13420 fi
13421
13422 done
13423
13424 fi
13425
13426 if test "$cf_cv_posix_visible" = no; then
13427
13428 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13429
13430 cf_save_CFLAGS="$CFLAGS"
13431 cf_save_CPPFLAGS="$CPPFLAGS"
13432
13433 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13434         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13435                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13436
13437 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13438         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13439                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13440
13441 echo "$as_me:13441: checking if we should define _POSIX_C_SOURCE" >&5
13442 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13443 if test "${cf_cv_posix_c_source+set}" = set; then
13444   echo $ECHO_N "(cached) $ECHO_C" >&6
13445 else
13446
13447 echo "${as_me:-configure}:13447: testing if the symbol is already defined go no further ..." 1>&5
13448
13449         cat >"conftest.$ac_ext" <<_ACEOF
13450 #line 13450 "configure"
13451 #include "confdefs.h"
13452 #include <sys/types.h>
13453 int
13454 main (void)
13455 {
13456
13457 #ifndef _POSIX_C_SOURCE
13458 make an error
13459 #endif
13460   ;
13461   return 0;
13462 }
13463 _ACEOF
13464 rm -f "conftest.$ac_objext"
13465 if { (eval echo "$as_me:13465: \"$ac_compile\"") >&5
13466   (eval $ac_compile) 2>&5
13467   ac_status=$?
13468   echo "$as_me:13468: \$? = $ac_status" >&5
13469   (exit "$ac_status"); } &&
13470          { ac_try='test -s "conftest.$ac_objext"'
13471   { (eval echo "$as_me:13471: \"$ac_try\"") >&5
13472   (eval $ac_try) 2>&5
13473   ac_status=$?
13474   echo "$as_me:13474: \$? = $ac_status" >&5
13475   (exit "$ac_status"); }; }; then
13476   cf_cv_posix_c_source=no
13477 else
13478   echo "$as_me: failed program was:" >&5
13479 cat "conftest.$ac_ext" >&5
13480 cf_want_posix_source=no
13481          case .$cf_POSIX_C_SOURCE in
13482          (.[12]??*)
13483                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13484                 ;;
13485          (.2)
13486                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13487                 cf_want_posix_source=yes
13488                 ;;
13489          (.*)
13490                 cf_want_posix_source=yes
13491                 ;;
13492          esac
13493          if test "$cf_want_posix_source" = yes ; then
13494                 cat >"conftest.$ac_ext" <<_ACEOF
13495 #line 13495 "configure"
13496 #include "confdefs.h"
13497 #include <sys/types.h>
13498 int
13499 main (void)
13500 {
13501
13502 #ifdef _POSIX_SOURCE
13503 make an error
13504 #endif
13505   ;
13506   return 0;
13507 }
13508 _ACEOF
13509 rm -f "conftest.$ac_objext"
13510 if { (eval echo "$as_me:13510: \"$ac_compile\"") >&5
13511   (eval $ac_compile) 2>&5
13512   ac_status=$?
13513   echo "$as_me:13513: \$? = $ac_status" >&5
13514   (exit "$ac_status"); } &&
13515          { ac_try='test -s "conftest.$ac_objext"'
13516   { (eval echo "$as_me:13516: \"$ac_try\"") >&5
13517   (eval $ac_try) 2>&5
13518   ac_status=$?
13519   echo "$as_me:13519: \$? = $ac_status" >&5
13520   (exit "$ac_status"); }; }; then
13521   :
13522 else
13523   echo "$as_me: failed program was:" >&5
13524 cat "conftest.$ac_ext" >&5
13525 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13526 fi
13527 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13528          fi
13529
13530 echo "${as_me:-configure}:13530: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13531
13532          CFLAGS="$cf_trim_CFLAGS"
13533          CPPFLAGS="$cf_trim_CPPFLAGS"
13534
13535         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13536         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13537
13538 echo "${as_me:-configure}:13538: testing if the second compile does not leave our definition intact error ..." 1>&5
13539
13540          cat >"conftest.$ac_ext" <<_ACEOF
13541 #line 13541 "configure"
13542 #include "confdefs.h"
13543 #include <sys/types.h>
13544 int
13545 main (void)
13546 {
13547
13548 #ifndef _POSIX_C_SOURCE
13549 make an error
13550 #endif
13551   ;
13552   return 0;
13553 }
13554 _ACEOF
13555 rm -f "conftest.$ac_objext"
13556 if { (eval echo "$as_me:13556: \"$ac_compile\"") >&5
13557   (eval $ac_compile) 2>&5
13558   ac_status=$?
13559   echo "$as_me:13559: \$? = $ac_status" >&5
13560   (exit "$ac_status"); } &&
13561          { ac_try='test -s "conftest.$ac_objext"'
13562   { (eval echo "$as_me:13562: \"$ac_try\"") >&5
13563   (eval $ac_try) 2>&5
13564   ac_status=$?
13565   echo "$as_me:13565: \$? = $ac_status" >&5
13566   (exit "$ac_status"); }; }; then
13567   :
13568 else
13569   echo "$as_me: failed program was:" >&5
13570 cat "conftest.$ac_ext" >&5
13571 cf_cv_posix_c_source=no
13572 fi
13573 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13574          CFLAGS="$cf_save_CFLAGS"
13575          CPPFLAGS="$cf_save_CPPFLAGS"
13576
13577 fi
13578 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13579
13580 fi
13581 echo "$as_me:13581: result: $cf_cv_posix_c_source" >&5
13582 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13583
13584 if test "$cf_cv_posix_c_source" != no ; then
13585         CFLAGS="$cf_trim_CFLAGS"
13586         CPPFLAGS="$cf_trim_CPPFLAGS"
13587
13588 cf_fix_cppflags=no
13589 cf_new_cflags=
13590 cf_new_cppflags=
13591 cf_new_extra_cppflags=
13592
13593 for cf_add_cflags in $cf_cv_posix_c_source
13594 do
13595 case "$cf_fix_cppflags" in
13596 (no)
13597         case "$cf_add_cflags" in
13598         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13599                 case "$cf_add_cflags" in
13600                 (-D*)
13601                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13602
13603                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13604                                 && test -z "${cf_tst_cflags}" \
13605                                 && cf_fix_cppflags=yes
13606
13607                         if test "$cf_fix_cppflags" = yes ; then
13608
13609         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13610         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13611
13612                                 continue
13613                         elif test "${cf_tst_cflags}" = "\"'" ; then
13614
13615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13617
13618                                 continue
13619                         fi
13620                         ;;
13621                 esac
13622                 case "$CPPFLAGS" in
13623                 (*$cf_add_cflags)
13624                         ;;
13625                 (*)
13626                         case "$cf_add_cflags" in
13627                         (-D*)
13628                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13629
13630 CPPFLAGS=`echo "$CPPFLAGS" | \
13631         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13632                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13633
13634                                 ;;
13635                         esac
13636
13637         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13638         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13639
13640                         ;;
13641                 esac
13642                 ;;
13643         (*)
13644
13645         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13646         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13647
13648                 ;;
13649         esac
13650         ;;
13651 (yes)
13652
13653         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13654         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13655
13656         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13657
13658         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13659                 && test -z "${cf_tst_cflags}" \
13660                 && cf_fix_cppflags=no
13661         ;;
13662 esac
13663 done
13664
13665 if test -n "$cf_new_cflags" ; then
13666
13667         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13668         CFLAGS="${CFLAGS}$cf_new_cflags"
13669
13670 fi
13671
13672 if test -n "$cf_new_cppflags" ; then
13673
13674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13675         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13676
13677 fi
13678
13679 if test -n "$cf_new_extra_cppflags" ; then
13680
13681         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13682         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13683
13684 fi
13685
13686 fi
13687
13688 fi # cf_cv_posix_visible
13689
13690         ;;
13691 esac
13692
13693 if test -n "$cf_xopen_source" ; then
13694
13695 for cf_add_cflags in $cf_xopen_source
13696 do
13697         case "x$cf_add_cflags" in
13698         (x-[DU]*)
13699
13700 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13701 while true
13702 do
13703         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'`
13704         test "$CFLAGS" != "$cf_old_cflag" || break
13705         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CFLAGS" 1>&6
13706
13707 echo "${as_me:-configure}:13707: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5
13708
13709         CFLAGS="$cf_old_cflag"
13710 done
13711
13712 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
13713 while true
13714 do
13715         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'`
13716         test "$CPPFLAGS" != "$cf_old_cflag" || break
13717         test -n "$verbose" && echo "    removing old option $cf_add_cflags from CPPFLAGS" 1>&6
13718
13719 echo "${as_me:-configure}:13719: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5
13720
13721         CPPFLAGS="$cf_old_cflag"
13722 done
13723
13724                 ;;
13725         esac
13726
13727 cf_fix_cppflags=no
13728 cf_new_cflags=
13729 cf_new_cppflags=
13730 cf_new_extra_cppflags=
13731
13732 for cf_add_cflags in $cf_add_cflags
13733 do
13734 case "$cf_fix_cppflags" in
13735 (no)
13736         case "$cf_add_cflags" in
13737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13738                 case "$cf_add_cflags" in
13739                 (-D*)
13740                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13741
13742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13743                                 && test -z "${cf_tst_cflags}" \
13744                                 && cf_fix_cppflags=yes
13745
13746                         if test "$cf_fix_cppflags" = yes ; then
13747
13748         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13749         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13750
13751                                 continue
13752                         elif test "${cf_tst_cflags}" = "\"'" ; then
13753
13754         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13755         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13756
13757                                 continue
13758                         fi
13759                         ;;
13760                 esac
13761                 case "$CPPFLAGS" in
13762                 (*$cf_add_cflags)
13763                         ;;
13764                 (*)
13765                         case "$cf_add_cflags" in
13766                         (-D*)
13767                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13768
13769 CPPFLAGS=`echo "$CPPFLAGS" | \
13770         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13771                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13772
13773                                 ;;
13774                         esac
13775
13776         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13777         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13778
13779                         ;;
13780                 esac
13781                 ;;
13782         (*)
13783
13784         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13785         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13786
13787                 ;;
13788         esac
13789         ;;
13790 (yes)
13791
13792         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13793         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13794
13795         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13796
13797         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13798                 && test -z "${cf_tst_cflags}" \
13799                 && cf_fix_cppflags=no
13800         ;;
13801 esac
13802 done
13803
13804 if test -n "$cf_new_cflags" ; then
13805         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13806
13807 echo "${as_me:-configure}:13807: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13808
13809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13810         CFLAGS="${CFLAGS}$cf_new_cflags"
13811
13812 fi
13813
13814 if test -n "$cf_new_cppflags" ; then
13815         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13816
13817 echo "${as_me:-configure}:13817: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13818
13819         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13820         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13821
13822 fi
13823
13824 if test -n "$cf_new_extra_cppflags" ; then
13825         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13826
13827 echo "${as_me:-configure}:13827: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13828
13829         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13830         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13831
13832 fi
13833
13834 done
13835
13836 fi
13837
13838 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13839         echo "$as_me:13839: checking if _XOPEN_SOURCE really is set" >&5
13840 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13841         cat >"conftest.$ac_ext" <<_ACEOF
13842 #line 13842 "configure"
13843 #include "confdefs.h"
13844 #include <stdlib.h>
13845 int
13846 main (void)
13847 {
13848
13849 #ifndef _XOPEN_SOURCE
13850 make an error
13851 #endif
13852   ;
13853   return 0;
13854 }
13855 _ACEOF
13856 rm -f "conftest.$ac_objext"
13857 if { (eval echo "$as_me:13857: \"$ac_compile\"") >&5
13858   (eval $ac_compile) 2>&5
13859   ac_status=$?
13860   echo "$as_me:13860: \$? = $ac_status" >&5
13861   (exit "$ac_status"); } &&
13862          { ac_try='test -s "conftest.$ac_objext"'
13863   { (eval echo "$as_me:13863: \"$ac_try\"") >&5
13864   (eval $ac_try) 2>&5
13865   ac_status=$?
13866   echo "$as_me:13866: \$? = $ac_status" >&5
13867   (exit "$ac_status"); }; }; then
13868   cf_XOPEN_SOURCE_set=yes
13869 else
13870   echo "$as_me: failed program was:" >&5
13871 cat "conftest.$ac_ext" >&5
13872 cf_XOPEN_SOURCE_set=no
13873 fi
13874 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13875         echo "$as_me:13875: result: $cf_XOPEN_SOURCE_set" >&5
13876 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13877         if test "$cf_XOPEN_SOURCE_set" = yes
13878         then
13879                 cat >"conftest.$ac_ext" <<_ACEOF
13880 #line 13880 "configure"
13881 #include "confdefs.h"
13882 #include <stdlib.h>
13883 int
13884 main (void)
13885 {
13886
13887 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13888 make an error
13889 #endif
13890   ;
13891   return 0;
13892 }
13893 _ACEOF
13894 rm -f "conftest.$ac_objext"
13895 if { (eval echo "$as_me:13895: \"$ac_compile\"") >&5
13896   (eval $ac_compile) 2>&5
13897   ac_status=$?
13898   echo "$as_me:13898: \$? = $ac_status" >&5
13899   (exit "$ac_status"); } &&
13900          { ac_try='test -s "conftest.$ac_objext"'
13901   { (eval echo "$as_me:13901: \"$ac_try\"") >&5
13902   (eval $ac_try) 2>&5
13903   ac_status=$?
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit "$ac_status"); }; }; then
13906   cf_XOPEN_SOURCE_set_ok=yes
13907 else
13908   echo "$as_me: failed program was:" >&5
13909 cat "conftest.$ac_ext" >&5
13910 cf_XOPEN_SOURCE_set_ok=no
13911 fi
13912 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13913                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13914                 then
13915                         { echo "$as_me:13915: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13916 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13917                 fi
13918         else
13919
13920 echo "$as_me:13920: checking if we should define _XOPEN_SOURCE" >&5
13921 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13922 if test "${cf_cv_xopen_source+set}" = set; then
13923   echo $ECHO_N "(cached) $ECHO_C" >&6
13924 else
13925
13926         cat >"conftest.$ac_ext" <<_ACEOF
13927 #line 13927 "configure"
13928 #include "confdefs.h"
13929
13930 #include <stdlib.h>
13931 #include <string.h>
13932 #include <sys/types.h>
13933
13934 int
13935 main (void)
13936 {
13937
13938 #ifndef _XOPEN_SOURCE
13939 make an error
13940 #endif
13941   ;
13942   return 0;
13943 }
13944 _ACEOF
13945 rm -f "conftest.$ac_objext"
13946 if { (eval echo "$as_me:13946: \"$ac_compile\"") >&5
13947   (eval $ac_compile) 2>&5
13948   ac_status=$?
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit "$ac_status"); } &&
13951          { ac_try='test -s "conftest.$ac_objext"'
13952   { (eval echo "$as_me:13952: \"$ac_try\"") >&5
13953   (eval $ac_try) 2>&5
13954   ac_status=$?
13955   echo "$as_me:13955: \$? = $ac_status" >&5
13956   (exit "$ac_status"); }; }; then
13957   cf_cv_xopen_source=no
13958 else
13959   echo "$as_me: failed program was:" >&5
13960 cat "conftest.$ac_ext" >&5
13961 cf_save="$CPPFLAGS"
13962
13963         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13964         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13965
13966          cat >"conftest.$ac_ext" <<_ACEOF
13967 #line 13967 "configure"
13968 #include "confdefs.h"
13969
13970 #include <stdlib.h>
13971 #include <string.h>
13972 #include <sys/types.h>
13973
13974 int
13975 main (void)
13976 {
13977
13978 #ifdef _XOPEN_SOURCE
13979 make an error
13980 #endif
13981   ;
13982   return 0;
13983 }
13984 _ACEOF
13985 rm -f "conftest.$ac_objext"
13986 if { (eval echo "$as_me:13986: \"$ac_compile\"") >&5
13987   (eval $ac_compile) 2>&5
13988   ac_status=$?
13989   echo "$as_me:13989: \$? = $ac_status" >&5
13990   (exit "$ac_status"); } &&
13991          { ac_try='test -s "conftest.$ac_objext"'
13992   { (eval echo "$as_me:13992: \"$ac_try\"") >&5
13993   (eval $ac_try) 2>&5
13994   ac_status=$?
13995   echo "$as_me:13995: \$? = $ac_status" >&5
13996   (exit "$ac_status"); }; }; then
13997   cf_cv_xopen_source=no
13998 else
13999   echo "$as_me: failed program was:" >&5
14000 cat "conftest.$ac_ext" >&5
14001 cf_cv_xopen_source=$cf_XOPEN_SOURCE
14002 fi
14003 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14004         CPPFLAGS="$cf_save"
14005
14006 fi
14007 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14008
14009 fi
14010 echo "$as_me:14010: result: $cf_cv_xopen_source" >&5
14011 echo "${ECHO_T}$cf_cv_xopen_source" >&6
14012
14013 if test "$cf_cv_xopen_source" != no ; then
14014
14015 CFLAGS=`echo "$CFLAGS" | \
14016         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14017                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14018
14019 CPPFLAGS=`echo "$CPPFLAGS" | \
14020         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
14021                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
14022
14023         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
14024
14025 for cf_add_cflags in $cf_temp_xopen_source
14026 do
14027         case "x$cf_add_cflags" in
14028         (x-[DU]*)
14029
14030 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14031 while true
14032 do
14033         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'`
14034         test "$CFLAGS" != "$cf_old_cflag" || break
14035
14036         CFLAGS="$cf_old_cflag"
14037 done
14038
14039 cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'`
14040 while true
14041 do
14042         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'`
14043         test "$CPPFLAGS" != "$cf_old_cflag" || break
14044
14045         CPPFLAGS="$cf_old_cflag"
14046 done
14047
14048                 ;;
14049         esac
14050
14051 cf_fix_cppflags=no
14052 cf_new_cflags=
14053 cf_new_cppflags=
14054 cf_new_extra_cppflags=
14055
14056 for cf_add_cflags in $cf_add_cflags
14057 do
14058 case "$cf_fix_cppflags" in
14059 (no)
14060         case "$cf_add_cflags" in
14061         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14062                 case "$cf_add_cflags" in
14063                 (-D*)
14064                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14065
14066                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14067                                 && test -z "${cf_tst_cflags}" \
14068                                 && cf_fix_cppflags=yes
14069
14070                         if test "$cf_fix_cppflags" = yes ; then
14071
14072         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14073         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14074
14075                                 continue
14076                         elif test "${cf_tst_cflags}" = "\"'" ; then
14077
14078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14080
14081                                 continue
14082                         fi
14083                         ;;
14084                 esac
14085                 case "$CPPFLAGS" in
14086                 (*$cf_add_cflags)
14087                         ;;
14088                 (*)
14089                         case "$cf_add_cflags" in
14090                         (-D*)
14091                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14092
14093 CPPFLAGS=`echo "$CPPFLAGS" | \
14094         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14095                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14096
14097                                 ;;
14098                         esac
14099
14100         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14101         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14102
14103                         ;;
14104                 esac
14105                 ;;
14106         (*)
14107
14108         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14109         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14110
14111                 ;;
14112         esac
14113         ;;
14114 (yes)
14115
14116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14118
14119         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
14120
14121         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14122                 && test -z "${cf_tst_cflags}" \
14123                 && cf_fix_cppflags=no
14124         ;;
14125 esac
14126 done
14127
14128 if test -n "$cf_new_cflags" ; then
14129
14130         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14131         CFLAGS="${CFLAGS}$cf_new_cflags"
14132
14133 fi
14134
14135 if test -n "$cf_new_cppflags" ; then
14136
14137         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14138         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14139
14140 fi
14141
14142 if test -n "$cf_new_extra_cppflags" ; then
14143
14144         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14145         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14146
14147 fi
14148
14149 done
14150
14151 fi
14152
14153         fi
14154 fi
14155 fi # cf_cv_posix_visible
14156
14157 # Check whether --enable-largefile or --disable-largefile was given.
14158 if test "${enable_largefile+set}" = set; then
14159   enableval="$enable_largefile"
14160
14161 fi;
14162 if test "$enable_largefile" != no; then
14163
14164   echo "$as_me:14164: checking for special C compiler options needed for large files" >&5
14165 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
14166 if test "${ac_cv_sys_largefile_CC+set}" = set; then
14167   echo $ECHO_N "(cached) $ECHO_C" >&6
14168 else
14169   ac_cv_sys_largefile_CC=no
14170      if test "$GCC" != yes; then
14171        ac_save_CC=$CC
14172        while :; do
14173          # IRIX 6.2 and later do not support large files by default,
14174          # so use the C compiler's -n32 option if that helps.
14175          cat >"conftest.$ac_ext" <<_ACEOF
14176 #line 14176 "configure"
14177 #include "confdefs.h"
14178 #include <sys/types.h>
14179  /* Check that off_t can represent 2**63 - 1 correctly.
14180     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14181     since some C++ compilers masquerading as C compilers
14182     incorrectly reject 9223372036854775807.  */
14183 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14184   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14185                        && LARGE_OFF_T % 2147483647 == 1)
14186                       ? 1 : -1];
14187 int
14188 main (void)
14189 {
14190
14191   ;
14192   return 0;
14193 }
14194 _ACEOF
14195          rm -f "conftest.$ac_objext"
14196 if { (eval echo "$as_me:14196: \"$ac_compile\"") >&5
14197   (eval $ac_compile) 2>&5
14198   ac_status=$?
14199   echo "$as_me:14199: \$? = $ac_status" >&5
14200   (exit "$ac_status"); } &&
14201          { ac_try='test -s "conftest.$ac_objext"'
14202   { (eval echo "$as_me:14202: \"$ac_try\"") >&5
14203   (eval $ac_try) 2>&5
14204   ac_status=$?
14205   echo "$as_me:14205: \$? = $ac_status" >&5
14206   (exit "$ac_status"); }; }; then
14207   break
14208 else
14209   echo "$as_me: failed program was:" >&5
14210 cat "conftest.$ac_ext" >&5
14211 fi
14212 rm -f "conftest.$ac_objext"
14213          CC="$CC -n32"
14214          rm -f "conftest.$ac_objext"
14215 if { (eval echo "$as_me:14215: \"$ac_compile\"") >&5
14216   (eval $ac_compile) 2>&5
14217   ac_status=$?
14218   echo "$as_me:14218: \$? = $ac_status" >&5
14219   (exit "$ac_status"); } &&
14220          { ac_try='test -s "conftest.$ac_objext"'
14221   { (eval echo "$as_me:14221: \"$ac_try\"") >&5
14222   (eval $ac_try) 2>&5
14223   ac_status=$?
14224   echo "$as_me:14224: \$? = $ac_status" >&5
14225   (exit "$ac_status"); }; }; then
14226   ac_cv_sys_largefile_CC=' -n32'; break
14227 else
14228   echo "$as_me: failed program was:" >&5
14229 cat "conftest.$ac_ext" >&5
14230 fi
14231 rm -f "conftest.$ac_objext"
14232          break
14233        done
14234        CC=$ac_save_CC
14235        rm -f "conftest.$ac_ext"
14236     fi
14237 fi
14238 echo "$as_me:14238: result: $ac_cv_sys_largefile_CC" >&5
14239 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
14240   if test "$ac_cv_sys_largefile_CC" != no; then
14241     CC=$CC$ac_cv_sys_largefile_CC
14242   fi
14243
14244   echo "$as_me:14244: checking for _FILE_OFFSET_BITS value needed for large files" >&5
14245 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
14246 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
14247   echo $ECHO_N "(cached) $ECHO_C" >&6
14248 else
14249   while :; do
14250   ac_cv_sys_file_offset_bits=no
14251   cat >"conftest.$ac_ext" <<_ACEOF
14252 #line 14252 "configure"
14253 #include "confdefs.h"
14254 #include <sys/types.h>
14255  /* Check that off_t can represent 2**63 - 1 correctly.
14256     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14257     since some C++ compilers masquerading as C compilers
14258     incorrectly reject 9223372036854775807.  */
14259 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14260   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14261                        && LARGE_OFF_T % 2147483647 == 1)
14262                       ? 1 : -1];
14263 int
14264 main (void)
14265 {
14266
14267   ;
14268   return 0;
14269 }
14270 _ACEOF
14271 rm -f "conftest.$ac_objext"
14272 if { (eval echo "$as_me:14272: \"$ac_compile\"") >&5
14273   (eval $ac_compile) 2>&5
14274   ac_status=$?
14275   echo "$as_me:14275: \$? = $ac_status" >&5
14276   (exit "$ac_status"); } &&
14277          { ac_try='test -s "conftest.$ac_objext"'
14278   { (eval echo "$as_me:14278: \"$ac_try\"") >&5
14279   (eval $ac_try) 2>&5
14280   ac_status=$?
14281   echo "$as_me:14281: \$? = $ac_status" >&5
14282   (exit "$ac_status"); }; }; then
14283   break
14284 else
14285   echo "$as_me: failed program was:" >&5
14286 cat "conftest.$ac_ext" >&5
14287 fi
14288 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14289   cat >"conftest.$ac_ext" <<_ACEOF
14290 #line 14290 "configure"
14291 #include "confdefs.h"
14292 #define _FILE_OFFSET_BITS 64
14293 #include <sys/types.h>
14294  /* Check that off_t can represent 2**63 - 1 correctly.
14295     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14296     since some C++ compilers masquerading as C compilers
14297     incorrectly reject 9223372036854775807.  */
14298 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14299   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14300                        && LARGE_OFF_T % 2147483647 == 1)
14301                       ? 1 : -1];
14302 int
14303 main (void)
14304 {
14305
14306   ;
14307   return 0;
14308 }
14309 _ACEOF
14310 rm -f "conftest.$ac_objext"
14311 if { (eval echo "$as_me:14311: \"$ac_compile\"") >&5
14312   (eval $ac_compile) 2>&5
14313   ac_status=$?
14314   echo "$as_me:14314: \$? = $ac_status" >&5
14315   (exit "$ac_status"); } &&
14316          { ac_try='test -s "conftest.$ac_objext"'
14317   { (eval echo "$as_me:14317: \"$ac_try\"") >&5
14318   (eval $ac_try) 2>&5
14319   ac_status=$?
14320   echo "$as_me:14320: \$? = $ac_status" >&5
14321   (exit "$ac_status"); }; }; then
14322   ac_cv_sys_file_offset_bits=64; break
14323 else
14324   echo "$as_me: failed program was:" >&5
14325 cat "conftest.$ac_ext" >&5
14326 fi
14327 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14328   break
14329 done
14330 fi
14331 echo "$as_me:14331: result: $ac_cv_sys_file_offset_bits" >&5
14332 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
14333 if test "$ac_cv_sys_file_offset_bits" != no; then
14334
14335 cat >>confdefs.h <<EOF
14336 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
14337 EOF
14338
14339 fi
14340 rm -rf conftest*
14341   echo "$as_me:14341: checking for _LARGE_FILES value needed for large files" >&5
14342 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
14343 if test "${ac_cv_sys_large_files+set}" = set; then
14344   echo $ECHO_N "(cached) $ECHO_C" >&6
14345 else
14346   while :; do
14347   ac_cv_sys_large_files=no
14348   cat >"conftest.$ac_ext" <<_ACEOF
14349 #line 14349 "configure"
14350 #include "confdefs.h"
14351 #include <sys/types.h>
14352  /* Check that off_t can represent 2**63 - 1 correctly.
14353     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14354     since some C++ compilers masquerading as C compilers
14355     incorrectly reject 9223372036854775807.  */
14356 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14357   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14358                        && LARGE_OFF_T % 2147483647 == 1)
14359                       ? 1 : -1];
14360 int
14361 main (void)
14362 {
14363
14364   ;
14365   return 0;
14366 }
14367 _ACEOF
14368 rm -f "conftest.$ac_objext"
14369 if { (eval echo "$as_me:14369: \"$ac_compile\"") >&5
14370   (eval $ac_compile) 2>&5
14371   ac_status=$?
14372   echo "$as_me:14372: \$? = $ac_status" >&5
14373   (exit "$ac_status"); } &&
14374          { ac_try='test -s "conftest.$ac_objext"'
14375   { (eval echo "$as_me:14375: \"$ac_try\"") >&5
14376   (eval $ac_try) 2>&5
14377   ac_status=$?
14378   echo "$as_me:14378: \$? = $ac_status" >&5
14379   (exit "$ac_status"); }; }; then
14380   break
14381 else
14382   echo "$as_me: failed program was:" >&5
14383 cat "conftest.$ac_ext" >&5
14384 fi
14385 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14386   cat >"conftest.$ac_ext" <<_ACEOF
14387 #line 14387 "configure"
14388 #include "confdefs.h"
14389 #define _LARGE_FILES 1
14390 #include <sys/types.h>
14391  /* Check that off_t can represent 2**63 - 1 correctly.
14392     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14393     since some C++ compilers masquerading as C compilers
14394     incorrectly reject 9223372036854775807.  */
14395 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14396   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14397                        && LARGE_OFF_T % 2147483647 == 1)
14398                       ? 1 : -1];
14399 int
14400 main (void)
14401 {
14402
14403   ;
14404   return 0;
14405 }
14406 _ACEOF
14407 rm -f "conftest.$ac_objext"
14408 if { (eval echo "$as_me:14408: \"$ac_compile\"") >&5
14409   (eval $ac_compile) 2>&5
14410   ac_status=$?
14411   echo "$as_me:14411: \$? = $ac_status" >&5
14412   (exit "$ac_status"); } &&
14413          { ac_try='test -s "conftest.$ac_objext"'
14414   { (eval echo "$as_me:14414: \"$ac_try\"") >&5
14415   (eval $ac_try) 2>&5
14416   ac_status=$?
14417   echo "$as_me:14417: \$? = $ac_status" >&5
14418   (exit "$ac_status"); }; }; then
14419   ac_cv_sys_large_files=1; break
14420 else
14421   echo "$as_me: failed program was:" >&5
14422 cat "conftest.$ac_ext" >&5
14423 fi
14424 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14425   break
14426 done
14427 fi
14428 echo "$as_me:14428: result: $ac_cv_sys_large_files" >&5
14429 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14430 if test "$ac_cv_sys_large_files" != no; then
14431
14432 cat >>confdefs.h <<EOF
14433 #define _LARGE_FILES $ac_cv_sys_large_files
14434 EOF
14435
14436 fi
14437 rm -rf conftest*
14438 fi
14439
14440         if test "$enable_largefile" != no ; then
14441         echo "$as_me:14441: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14442 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14443 if test "${ac_cv_sys_largefile_source+set}" = set; then
14444   echo $ECHO_N "(cached) $ECHO_C" >&6
14445 else
14446   while :; do
14447   ac_cv_sys_largefile_source=no
14448   cat >"conftest.$ac_ext" <<_ACEOF
14449 #line 14449 "configure"
14450 #include "confdefs.h"
14451 #include <stdio.h>
14452 int
14453 main (void)
14454 {
14455 return !fseeko;
14456   ;
14457   return 0;
14458 }
14459 _ACEOF
14460 rm -f "conftest.$ac_objext"
14461 if { (eval echo "$as_me:14461: \"$ac_compile\"") >&5
14462   (eval $ac_compile) 2>&5
14463   ac_status=$?
14464   echo "$as_me:14464: \$? = $ac_status" >&5
14465   (exit "$ac_status"); } &&
14466          { ac_try='test -s "conftest.$ac_objext"'
14467   { (eval echo "$as_me:14467: \"$ac_try\"") >&5
14468   (eval $ac_try) 2>&5
14469   ac_status=$?
14470   echo "$as_me:14470: \$? = $ac_status" >&5
14471   (exit "$ac_status"); }; }; then
14472   break
14473 else
14474   echo "$as_me: failed program was:" >&5
14475 cat "conftest.$ac_ext" >&5
14476 fi
14477 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14478   cat >"conftest.$ac_ext" <<_ACEOF
14479 #line 14479 "configure"
14480 #include "confdefs.h"
14481 #define _LARGEFILE_SOURCE 1
14482 #include <stdio.h>
14483 int
14484 main (void)
14485 {
14486 return !fseeko;
14487   ;
14488   return 0;
14489 }
14490 _ACEOF
14491 rm -f "conftest.$ac_objext"
14492 if { (eval echo "$as_me:14492: \"$ac_compile\"") >&5
14493   (eval $ac_compile) 2>&5
14494   ac_status=$?
14495   echo "$as_me:14495: \$? = $ac_status" >&5
14496   (exit "$ac_status"); } &&
14497          { ac_try='test -s "conftest.$ac_objext"'
14498   { (eval echo "$as_me:14498: \"$ac_try\"") >&5
14499   (eval $ac_try) 2>&5
14500   ac_status=$?
14501   echo "$as_me:14501: \$? = $ac_status" >&5
14502   (exit "$ac_status"); }; }; then
14503   ac_cv_sys_largefile_source=1; break
14504 else
14505   echo "$as_me: failed program was:" >&5
14506 cat "conftest.$ac_ext" >&5
14507 fi
14508 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14509   break
14510 done
14511 fi
14512 echo "$as_me:14512: result: $ac_cv_sys_largefile_source" >&5
14513 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14514 if test "$ac_cv_sys_largefile_source" != no; then
14515
14516 cat >>confdefs.h <<EOF
14517 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14518 EOF
14519
14520 fi
14521 rm -rf conftest*
14522
14523 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14524 # in glibc 2.1.3, but that breaks too many other things.
14525 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14526 echo "$as_me:14526: checking for fseeko" >&5
14527 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14528 if test "${ac_cv_func_fseeko+set}" = set; then
14529   echo $ECHO_N "(cached) $ECHO_C" >&6
14530 else
14531   cat >"conftest.$ac_ext" <<_ACEOF
14532 #line 14532 "configure"
14533 #include "confdefs.h"
14534 #include <stdio.h>
14535 int
14536 main (void)
14537 {
14538 return fseeko && fseeko (stdin, 0, 0);
14539   ;
14540   return 0;
14541 }
14542 _ACEOF
14543 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14544 if { (eval echo "$as_me:14544: \"$ac_link\"") >&5
14545   (eval $ac_link) 2>&5
14546   ac_status=$?
14547   echo "$as_me:14547: \$? = $ac_status" >&5
14548   (exit "$ac_status"); } &&
14549          { ac_try='test -s "conftest$ac_exeext"'
14550   { (eval echo "$as_me:14550: \"$ac_try\"") >&5
14551   (eval $ac_try) 2>&5
14552   ac_status=$?
14553   echo "$as_me:14553: \$? = $ac_status" >&5
14554   (exit "$ac_status"); }; }; then
14555   ac_cv_func_fseeko=yes
14556 else
14557   echo "$as_me: failed program was:" >&5
14558 cat "conftest.$ac_ext" >&5
14559 ac_cv_func_fseeko=no
14560 fi
14561 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14562 fi
14563 echo "$as_me:14563: result: $ac_cv_func_fseeko" >&5
14564 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14565 if test $ac_cv_func_fseeko = yes; then
14566
14567 cat >>confdefs.h <<\EOF
14568 #define HAVE_FSEEKO 1
14569 EOF
14570
14571 fi
14572
14573         # Normally we would collect these definitions in the config.h,
14574         # but (like _XOPEN_SOURCE), some environments rely on having these
14575         # defined before any of the system headers are included.  Another
14576         # case comes up with C++, e.g., on AIX the compiler compiles the
14577         # header files by themselves before looking at the body files it is
14578         # told to compile.  For ncurses, those header files do not include
14579         # the config.h
14580         if test "$ac_cv_sys_large_files" != no
14581         then
14582
14583         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14584         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14585
14586         fi
14587         if test "$ac_cv_sys_largefile_source" != no
14588         then
14589
14590         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14591         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14592
14593         fi
14594         if test "$ac_cv_sys_file_offset_bits" != no
14595         then
14596
14597         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14598         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14599
14600         fi
14601
14602         echo "$as_me:14602: checking whether to use struct dirent64" >&5
14603 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14604 if test "${cf_cv_struct_dirent64+set}" = set; then
14605   echo $ECHO_N "(cached) $ECHO_C" >&6
14606 else
14607
14608                 cat >"conftest.$ac_ext" <<_ACEOF
14609 #line 14609 "configure"
14610 #include "confdefs.h"
14611
14612 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14613 #include <sys/types.h>
14614 #include <dirent.h>
14615
14616 int
14617 main (void)
14618 {
14619
14620                 /* if transitional largefile support is setup, this is true */
14621                 extern struct dirent64 * readdir(DIR *);
14622                 struct dirent64 *x = readdir((DIR *)0);
14623                 struct dirent *y = readdir((DIR *)0);
14624                 int z = x - y;
14625                 (void)z;
14626
14627   ;
14628   return 0;
14629 }
14630 _ACEOF
14631 rm -f "conftest.$ac_objext"
14632 if { (eval echo "$as_me:14632: \"$ac_compile\"") >&5
14633   (eval $ac_compile) 2>&5
14634   ac_status=$?
14635   echo "$as_me:14635: \$? = $ac_status" >&5
14636   (exit "$ac_status"); } &&
14637          { ac_try='test -s "conftest.$ac_objext"'
14638   { (eval echo "$as_me:14638: \"$ac_try\"") >&5
14639   (eval $ac_try) 2>&5
14640   ac_status=$?
14641   echo "$as_me:14641: \$? = $ac_status" >&5
14642   (exit "$ac_status"); }; }; then
14643   cf_cv_struct_dirent64=yes
14644 else
14645   echo "$as_me: failed program was:" >&5
14646 cat "conftest.$ac_ext" >&5
14647 cf_cv_struct_dirent64=no
14648 fi
14649 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14650
14651 fi
14652 echo "$as_me:14652: result: $cf_cv_struct_dirent64" >&5
14653 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14654         test "$cf_cv_struct_dirent64" = yes &&
14655 cat >>confdefs.h <<\EOF
14656 #define HAVE_STRUCT_DIRENT64 1
14657 EOF
14658
14659         fi
14660
14661 ### Enable compiling-in rcs id's
14662 echo "$as_me:14662: checking if RCS identifiers should be compiled-in" >&5
14663 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14664
14665 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14666 if test "${with_rcs_ids+set}" = set; then
14667   withval="$with_rcs_ids"
14668   with_rcs_ids=$withval
14669 else
14670   with_rcs_ids=no
14671 fi;
14672 echo "$as_me:14672: result: $with_rcs_ids" >&5
14673 echo "${ECHO_T}$with_rcs_ids" >&6
14674 test "$with_rcs_ids" = yes &&
14675 cat >>confdefs.h <<\EOF
14676 #define USE_RCS_IDS 1
14677 EOF
14678
14679 ###############################################################################
14680
14681 ### Note that some functions (such as const) are normally disabled anyway.
14682 echo "$as_me:14682: checking if you want to build with function extensions" >&5
14683 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14684
14685 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14686 if test "${enable_ext_funcs+set}" = set; then
14687   enableval="$enable_ext_funcs"
14688   with_ext_funcs=$enableval
14689 else
14690   with_ext_funcs=yes
14691 fi;
14692 echo "$as_me:14692: result: $with_ext_funcs" >&5
14693 echo "${ECHO_T}$with_ext_funcs" >&6
14694 if test "$with_ext_funcs" = yes ; then
14695         NCURSES_EXT_FUNCS=1
14696
14697 cat >>confdefs.h <<\EOF
14698 #define HAVE_USE_DEFAULT_COLORS 1
14699 EOF
14700
14701 cat >>confdefs.h <<\EOF
14702 #define NCURSES_EXT_FUNCS 1
14703 EOF
14704
14705 else
14706         NCURSES_EXT_FUNCS=0
14707 fi
14708
14709 ###   use option --enable-const to turn on use of const beyond that in XSI.
14710 echo "$as_me:14710: checking for extended use of const keyword" >&5
14711 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14712
14713 # Check whether --enable-const or --disable-const was given.
14714 if test "${enable_const+set}" = set; then
14715   enableval="$enable_const"
14716   with_ext_const=$enableval
14717 else
14718   with_ext_const=no
14719 fi;
14720 echo "$as_me:14720: result: $with_ext_const" >&5
14721 echo "${ECHO_T}$with_ext_const" >&6
14722 NCURSES_CONST='/*nothing*/'
14723 if test "$with_ext_const" = yes ; then
14724         NCURSES_CONST=const
14725 fi
14726
14727 ###############################################################################
14728 # These options are relatively safe to experiment with.
14729
14730 echo "$as_me:14730: checking if you want all development code" >&5
14731 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14732
14733 # Check whether --with-develop or --without-develop was given.
14734 if test "${with_develop+set}" = set; then
14735   withval="$with_develop"
14736   with_develop=$withval
14737 else
14738   with_develop=no
14739 fi;
14740 echo "$as_me:14740: result: $with_develop" >&5
14741 echo "${ECHO_T}$with_develop" >&6
14742
14743 ###############################################################################
14744 # These are just experimental, probably should not be in a package:
14745
14746 # This is still experimental (20080329), but should ultimately be moved to
14747 # the script-block --with-normal, etc.
14748
14749 echo "$as_me:14749: checking if you want to link with the pthread library" >&5
14750 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14751
14752 # Check whether --with-pthread or --without-pthread was given.
14753 if test "${with_pthread+set}" = set; then
14754   withval="$with_pthread"
14755   with_pthread=$withval
14756 else
14757   with_pthread=no
14758 fi;
14759 echo "$as_me:14759: result: $with_pthread" >&5
14760 echo "${ECHO_T}$with_pthread" >&6
14761
14762 if test "$with_pthread" != no ; then
14763         echo "$as_me:14763: checking for pthread.h" >&5
14764 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14765 if test "${ac_cv_header_pthread_h+set}" = set; then
14766   echo $ECHO_N "(cached) $ECHO_C" >&6
14767 else
14768   cat >"conftest.$ac_ext" <<_ACEOF
14769 #line 14769 "configure"
14770 #include "confdefs.h"
14771 #include <pthread.h>
14772 _ACEOF
14773 if { (eval echo "$as_me:14773: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14774   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14775   ac_status=$?
14776   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14777   rm -f conftest.er1
14778   cat conftest.err >&5
14779   echo "$as_me:14779: \$? = $ac_status" >&5
14780   (exit "$ac_status"); } >/dev/null; then
14781   if test -s conftest.err; then
14782     ac_cpp_err=$ac_c_preproc_warn_flag
14783   else
14784     ac_cpp_err=
14785   fi
14786 else
14787   ac_cpp_err=yes
14788 fi
14789 if test -z "$ac_cpp_err"; then
14790   ac_cv_header_pthread_h=yes
14791 else
14792   echo "$as_me: failed program was:" >&5
14793   cat "conftest.$ac_ext" >&5
14794   ac_cv_header_pthread_h=no
14795 fi
14796 rm -f conftest.err "conftest.$ac_ext"
14797 fi
14798 echo "$as_me:14798: result: $ac_cv_header_pthread_h" >&5
14799 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14800 if test "$ac_cv_header_pthread_h" = yes; then
14801
14802 cat >>confdefs.h <<\EOF
14803 #define HAVE_PTHREADS_H 1
14804 EOF
14805
14806         for cf_lib_pthread in pthread c_r
14807         do
14808             echo "$as_me:14808: checking if we can link with the $cf_lib_pthread library" >&5
14809 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14810             cf_save_LIBS="$LIBS"
14811
14812 cf_add_libs="$LIBS"
14813 # reverse order
14814 cf_add_0lib=
14815 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14816 # filter duplicates
14817 for cf_add_1lib in $cf_add_0lib; do
14818         for cf_add_2lib in $cf_add_libs; do
14819                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14820                         cf_add_1lib=
14821                         break
14822                 fi
14823         done
14824         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14825 done
14826 LIBS="$cf_add_libs"
14827
14828             cat >"conftest.$ac_ext" <<_ACEOF
14829 #line 14829 "configure"
14830 #include "confdefs.h"
14831
14832 #include <pthread.h>
14833
14834 int
14835 main (void)
14836 {
14837
14838                 int rc = pthread_create(0,0,0,0);
14839                 int r2 = pthread_mutexattr_settype(0, 0);
14840
14841   ;
14842   return 0;
14843 }
14844 _ACEOF
14845 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14846 if { (eval echo "$as_me:14846: \"$ac_link\"") >&5
14847   (eval $ac_link) 2>&5
14848   ac_status=$?
14849   echo "$as_me:14849: \$? = $ac_status" >&5
14850   (exit "$ac_status"); } &&
14851          { ac_try='test -s "conftest$ac_exeext"'
14852   { (eval echo "$as_me:14852: \"$ac_try\"") >&5
14853   (eval $ac_try) 2>&5
14854   ac_status=$?
14855   echo "$as_me:14855: \$? = $ac_status" >&5
14856   (exit "$ac_status"); }; }; then
14857   with_pthread=yes
14858 else
14859   echo "$as_me: failed program was:" >&5
14860 cat "conftest.$ac_ext" >&5
14861 with_pthread=no
14862 fi
14863 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14864             LIBS="$cf_save_LIBS"
14865             echo "$as_me:14865: result: $with_pthread" >&5
14866 echo "${ECHO_T}$with_pthread" >&6
14867             test "$with_pthread" = yes && break
14868         done
14869
14870         if test "$with_pthread" = yes ; then
14871
14872 cf_add_libs="$LIBS"
14873 # reverse order
14874 cf_add_0lib=
14875 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14876 # filter duplicates
14877 for cf_add_1lib in $cf_add_0lib; do
14878         for cf_add_2lib in $cf_add_libs; do
14879                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14880                         cf_add_1lib=
14881                         break
14882                 fi
14883         done
14884         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14885 done
14886 LIBS="$cf_add_libs"
14887
14888 cat >>confdefs.h <<\EOF
14889 #define HAVE_LIBPTHREADS 1
14890 EOF
14891
14892         else
14893             { { echo "$as_me:14893: error: Cannot link with pthread library" >&5
14894 echo "$as_me: error: Cannot link with pthread library" >&2;}
14895    { (exit 1); exit 1; }; }
14896         fi
14897
14898 fi
14899
14900 fi
14901
14902 echo "$as_me:14902: checking if you want to use weak-symbols for pthreads" >&5
14903 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14904
14905 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14906 if test "${enable_weak_symbols+set}" = set; then
14907   enableval="$enable_weak_symbols"
14908   use_weak_symbols=$withval
14909 else
14910   use_weak_symbols=no
14911 fi;
14912 echo "$as_me:14912: result: $use_weak_symbols" >&5
14913 echo "${ECHO_T}$use_weak_symbols" >&6
14914 if test "$use_weak_symbols" = yes ; then
14915
14916 echo "$as_me:14916: checking if $CC supports weak symbols" >&5
14917 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14918 if test "${cf_cv_weak_symbols+set}" = set; then
14919   echo $ECHO_N "(cached) $ECHO_C" >&6
14920 else
14921
14922 cat >"conftest.$ac_ext" <<_ACEOF
14923 #line 14923 "configure"
14924 #include "confdefs.h"
14925
14926 #include <stdio.h>
14927 int
14928 main (void)
14929 {
14930
14931 #if defined(__GNUC__)
14932 #  if defined __USE_ISOC99
14933 #    define _cat_pragma(exp)    _Pragma(#exp)
14934 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14935 #  else
14936 #    define _weak_pragma(exp)
14937 #  endif
14938 #  define _declare(name)        __extension__ extern __typeof__(name) name
14939 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14940 #endif
14941
14942 weak_symbol(fopen);
14943
14944   ;
14945   return 0;
14946 }
14947 _ACEOF
14948 rm -f "conftest.$ac_objext"
14949 if { (eval echo "$as_me:14949: \"$ac_compile\"") >&5
14950   (eval $ac_compile) 2>&5
14951   ac_status=$?
14952   echo "$as_me:14952: \$? = $ac_status" >&5
14953   (exit "$ac_status"); } &&
14954          { ac_try='test -s "conftest.$ac_objext"'
14955   { (eval echo "$as_me:14955: \"$ac_try\"") >&5
14956   (eval $ac_try) 2>&5
14957   ac_status=$?
14958   echo "$as_me:14958: \$? = $ac_status" >&5
14959   (exit "$ac_status"); }; }; then
14960   cf_cv_weak_symbols=yes
14961 else
14962   echo "$as_me: failed program was:" >&5
14963 cat "conftest.$ac_ext" >&5
14964 cf_cv_weak_symbols=no
14965 fi
14966 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14967
14968 fi
14969 echo "$as_me:14969: result: $cf_cv_weak_symbols" >&5
14970 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14971
14972 else
14973         cf_cv_weak_symbols=no
14974 fi
14975
14976 if test $cf_cv_weak_symbols = yes ; then
14977
14978 cat >>confdefs.h <<\EOF
14979 #define USE_WEAK_SYMBOLS 1
14980 EOF
14981
14982 fi
14983
14984 PTHREAD=
14985 if test "$with_pthread" = "yes" ; then
14986
14987 cat >>confdefs.h <<\EOF
14988 #define USE_PTHREADS 1
14989 EOF
14990
14991         enable_reentrant=yes
14992         if test $cf_cv_weak_symbols = yes ; then
14993                 PTHREAD=-lpthread
14994         fi
14995 fi
14996
14997 # OpenSUSE is installing ncurses6, using reentrant option.
14998 echo "$as_me:14998: checking for _nc_TABSIZE" >&5
14999 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
15000 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
15001   echo $ECHO_N "(cached) $ECHO_C" >&6
15002 else
15003   cat >"conftest.$ac_ext" <<_ACEOF
15004 #line 15004 "configure"
15005 #include "confdefs.h"
15006 #define _nc_TABSIZE autoconf_temporary
15007 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15008 #undef _nc_TABSIZE
15009
15010 #ifdef __cplusplus
15011 extern "C"
15012 #endif
15013
15014 /* We use char because int might match the return type of a gcc2
15015    builtin and then its argument prototype would still apply.  */
15016 char _nc_TABSIZE (void);
15017
15018 int
15019 main (void)
15020 {
15021
15022 /* The GNU C library defines stubs for functions which it implements
15023     to always fail with ENOSYS.  Some functions are actually named
15024     something starting with __ and the normal name is an alias.  */
15025 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
15026 #error found stub for _nc_TABSIZE
15027 #endif
15028
15029         return _nc_TABSIZE ();
15030   ;
15031   return 0;
15032 }
15033 _ACEOF
15034 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15035 if { (eval echo "$as_me:15035: \"$ac_link\"") >&5
15036   (eval $ac_link) 2>&5
15037   ac_status=$?
15038   echo "$as_me:15038: \$? = $ac_status" >&5
15039   (exit "$ac_status"); } &&
15040          { ac_try='test -s "conftest$ac_exeext"'
15041   { (eval echo "$as_me:15041: \"$ac_try\"") >&5
15042   (eval $ac_try) 2>&5
15043   ac_status=$?
15044   echo "$as_me:15044: \$? = $ac_status" >&5
15045   (exit "$ac_status"); }; }; then
15046   ac_cv_func__nc_TABSIZE=yes
15047 else
15048   echo "$as_me: failed program was:" >&5
15049 cat "conftest.$ac_ext" >&5
15050 ac_cv_func__nc_TABSIZE=no
15051 fi
15052 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15053 fi
15054 echo "$as_me:15054: result: $ac_cv_func__nc_TABSIZE" >&5
15055 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
15056 if test "$ac_cv_func__nc_TABSIZE" = yes; then
15057   assume_reentrant=yes
15058 else
15059   assume_reentrant=no
15060 fi
15061
15062 # Reentrant code has to be opaque; there's little advantage to making ncurses
15063 # opaque outside of that, so there is no --enable-opaque option.  We can use
15064 # this option without --with-pthreads, but this will be always set for
15065 # pthreads.
15066 echo "$as_me:15066: checking if you want experimental reentrant code" >&5
15067 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
15068
15069 # Check whether --enable-reentrant or --disable-reentrant was given.
15070 if test "${enable_reentrant+set}" = set; then
15071   enableval="$enable_reentrant"
15072   with_reentrant=$enableval
15073 else
15074   with_reentrant=$assume_reentrant
15075 fi;
15076 echo "$as_me:15076: result: $with_reentrant" >&5
15077 echo "${ECHO_T}$with_reentrant" >&6
15078 if test "$with_reentrant" = yes ; then
15079         cf_cv_enable_reentrant=1
15080         if test $cf_cv_weak_symbols = yes ; then
15081
15082 # remove pthread library from $LIBS
15083 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
15084
15085         elif test "$assume_reentrant" = no ; then
15086                 LIB_SUFFIX="t${LIB_SUFFIX}"
15087         fi
15088
15089 cat >>confdefs.h <<\EOF
15090 #define USE_REENTRANT 1
15091 EOF
15092
15093 else
15094         cf_cv_enable_reentrant=0
15095 fi
15096
15097 ### Allow using a different wrap-prefix
15098 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
15099         echo "$as_me:15099: checking for prefix used to wrap public variables" >&5
15100 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
15101
15102 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
15103 if test "${with_wrap_prefix+set}" = set; then
15104   withval="$with_wrap_prefix"
15105   NCURSES_WRAP_PREFIX=$withval
15106 else
15107   NCURSES_WRAP_PREFIX=_nc_
15108 fi;
15109         echo "$as_me:15109: result: $NCURSES_WRAP_PREFIX" >&5
15110 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
15111 else
15112         NCURSES_WRAP_PREFIX=_nc_
15113 fi
15114
15115 cat >>confdefs.h <<EOF
15116 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
15117 EOF
15118
15119 ###############################################################################
15120
15121 ###     use option --disable-echo to suppress full display compiling commands
15122
15123 echo "$as_me:15123: checking if you want to see long compiling messages" >&5
15124 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
15125
15126 # Check whether --enable-echo or --disable-echo was given.
15127 if test "${enable_echo+set}" = set; then
15128   enableval="$enable_echo"
15129   test "$enableval" != no && enableval=yes
15130         if test "$enableval" != "yes" ; then
15131
15132         ECHO_LT='--silent'
15133         ECHO_LD='@echo linking $@;'
15134         RULE_CC='@echo compiling $<'
15135         SHOW_CC='@echo compiling $@'
15136         ECHO_CC='@'
15137
15138         else
15139
15140         ECHO_LT=''
15141         ECHO_LD=''
15142         RULE_CC=''
15143         SHOW_CC=''
15144         ECHO_CC=''
15145
15146         fi
15147 else
15148   enableval=yes
15149
15150         ECHO_LT=''
15151         ECHO_LD=''
15152         RULE_CC=''
15153         SHOW_CC=''
15154         ECHO_CC=''
15155
15156 fi;
15157 echo "$as_me:15157: result: $enableval" >&5
15158 echo "${ECHO_T}$enableval" >&6
15159
15160 echo "$as_me:15160: checking if you want to use C11 _Noreturn feature" >&5
15161 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
15162
15163 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
15164 if test "${enable_stdnoreturn+set}" = set; then
15165   enableval="$enable_stdnoreturn"
15166   test "$enableval" != yes && enableval=no
15167         if test "$enableval" != "no" ; then
15168     enable_stdnoreturn=yes
15169         else
15170                 enable_stdnoreturn=no
15171         fi
15172 else
15173   enableval=no
15174         enable_stdnoreturn=no
15175
15176 fi;
15177 echo "$as_me:15177: result: $enable_stdnoreturn" >&5
15178 echo "${ECHO_T}$enable_stdnoreturn" >&6
15179
15180 if test $enable_stdnoreturn = yes; then
15181 echo "$as_me:15181: checking for C11 _Noreturn feature" >&5
15182 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
15183 if test "${cf_cv_c11_noreturn+set}" = set; then
15184   echo $ECHO_N "(cached) $ECHO_C" >&6
15185 else
15186   cat >"conftest.$ac_ext" <<_ACEOF
15187 #line 15187 "configure"
15188 #include "confdefs.h"
15189
15190 #include <stdio.h>
15191 #include <stdlib.h>
15192 #include <stdnoreturn.h>
15193 static _Noreturn void giveup(void) { exit(0); }
15194
15195 int
15196 main (void)
15197 {
15198 if (feof(stdin)) giveup()
15199   ;
15200   return 0;
15201 }
15202 _ACEOF
15203 rm -f "conftest.$ac_objext"
15204 if { (eval echo "$as_me:15204: \"$ac_compile\"") >&5
15205   (eval $ac_compile) 2>&5
15206   ac_status=$?
15207   echo "$as_me:15207: \$? = $ac_status" >&5
15208   (exit "$ac_status"); } &&
15209          { ac_try='test -s "conftest.$ac_objext"'
15210   { (eval echo "$as_me:15210: \"$ac_try\"") >&5
15211   (eval $ac_try) 2>&5
15212   ac_status=$?
15213   echo "$as_me:15213: \$? = $ac_status" >&5
15214   (exit "$ac_status"); }; }; then
15215   cf_cv_c11_noreturn=yes
15216 else
15217   echo "$as_me: failed program was:" >&5
15218 cat "conftest.$ac_ext" >&5
15219 cf_cv_c11_noreturn=no
15220 fi
15221 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15222
15223 fi
15224 echo "$as_me:15224: result: $cf_cv_c11_noreturn" >&5
15225 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
15226 else
15227         cf_cv_c11_noreturn=no,
15228 fi
15229
15230 if test "$cf_cv_c11_noreturn" = yes; then
15231
15232 cat >>confdefs.h <<\EOF
15233 #define HAVE_STDNORETURN_H 1
15234 EOF
15235
15236 cat >>confdefs.h <<EOF
15237 #define STDC_NORETURN _Noreturn
15238 EOF
15239
15240         HAVE_STDNORETURN_H=1
15241 else
15242         HAVE_STDNORETURN_H=0
15243 fi
15244
15245 if test "$GCC" = yes || test "$GXX" = yes
15246 then
15247
15248 if test "$GCC" = yes || test "$GXX" = yes
15249 then
15250         case $CFLAGS in
15251         (*-Werror=*)
15252                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
15253
15254 echo "${as_me:-configure}:15254: testing repairing CFLAGS: $CFLAGS ..." 1>&5
15255
15256                 cf_temp_flags=
15257                 for cf_temp_scan in $CFLAGS
15258                 do
15259                         case "x$cf_temp_scan" in
15260                         (x-Werror=*)
15261
15262         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15263         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15264
15265                                 ;;
15266                         (*)
15267
15268         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15269         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15270
15271                                 ;;
15272                         esac
15273                 done
15274                 CFLAGS="$cf_temp_flags"
15275                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
15276
15277 echo "${as_me:-configure}:15277: testing ... fixed $CFLAGS ..." 1>&5
15278
15279                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15280
15281 echo "${as_me:-configure}:15281: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15282
15283                 ;;
15284         esac
15285 fi
15286
15287 if test "$GCC" = yes || test "$GXX" = yes
15288 then
15289         case $CPPFLAGS in
15290         (*-Werror=*)
15291                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
15292
15293 echo "${as_me:-configure}:15293: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
15294
15295                 cf_temp_flags=
15296                 for cf_temp_scan in $CPPFLAGS
15297                 do
15298                         case "x$cf_temp_scan" in
15299                         (x-Werror=*)
15300
15301         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15302         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15303
15304                                 ;;
15305                         (*)
15306
15307         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15308         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15309
15310                                 ;;
15311                         esac
15312                 done
15313                 CPPFLAGS="$cf_temp_flags"
15314                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
15315
15316 echo "${as_me:-configure}:15316: testing ... fixed $CPPFLAGS ..." 1>&5
15317
15318                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15319
15320 echo "${as_me:-configure}:15320: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15321
15322                 ;;
15323         esac
15324 fi
15325
15326 if test "$GCC" = yes || test "$GXX" = yes
15327 then
15328         case $LDFLAGS in
15329         (*-Werror=*)
15330                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
15331
15332 echo "${as_me:-configure}:15332: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
15333
15334                 cf_temp_flags=
15335                 for cf_temp_scan in $LDFLAGS
15336                 do
15337                         case "x$cf_temp_scan" in
15338                         (x-Werror=*)
15339
15340         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
15341         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
15342
15343                                 ;;
15344                         (*)
15345
15346         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
15347         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
15348
15349                                 ;;
15350                         esac
15351                 done
15352                 LDFLAGS="$cf_temp_flags"
15353                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
15354
15355 echo "${as_me:-configure}:15355: testing ... fixed $LDFLAGS ..." 1>&5
15356
15357                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
15358
15359 echo "${as_me:-configure}:15359: testing ... extra $EXTRA_CFLAGS ..." 1>&5
15360
15361                 ;;
15362         esac
15363 fi
15364
15365 echo "$as_me:15365: checking if you want to turn on gcc warnings" >&5
15366 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15367
15368 # Check whether --enable-warnings or --disable-warnings was given.
15369 if test "${enable_warnings+set}" = set; then
15370   enableval="$enable_warnings"
15371   test "$enableval" != yes && enableval=no
15372         if test "$enableval" != "no" ; then
15373     enable_warnings=yes
15374         else
15375                 enable_warnings=no
15376         fi
15377 else
15378   enableval=no
15379         enable_warnings=no
15380
15381 fi;
15382 echo "$as_me:15382: result: $enable_warnings" >&5
15383 echo "${ECHO_T}$enable_warnings" >&6
15384 if test "$enable_warnings" = "yes"
15385 then
15386
15387 if test "x$have_x" = xyes; then
15388
15389 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
15390 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
15391 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
15392 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15393 for cf_X_CFLAGS in $X_CFLAGS
15394 do
15395         case "x$cf_X_CFLAGS" in
15396         x-[IUD]*)
15397                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15398                 ;;
15399         *)
15400                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15401                 ;;
15402         esac
15403 done
15404
15405 cat >"conftest.$ac_ext" <<_ACEOF
15406 #line 15406 "configure"
15407 #include "confdefs.h"
15408
15409 #include <stdlib.h>
15410 #include <X11/Intrinsic.h>
15411
15412 int
15413 main (void)
15414 {
15415 String foo = malloc(1); free((void*)foo)
15416   ;
15417   return 0;
15418 }
15419 _ACEOF
15420 rm -f "conftest.$ac_objext"
15421 if { (eval echo "$as_me:15421: \"$ac_compile\"") >&5
15422   (eval $ac_compile) 2>&5
15423   ac_status=$?
15424   echo "$as_me:15424: \$? = $ac_status" >&5
15425   (exit "$ac_status"); } &&
15426          { ac_try='test -s "conftest.$ac_objext"'
15427   { (eval echo "$as_me:15427: \"$ac_try\"") >&5
15428   (eval $ac_try) 2>&5
15429   ac_status=$?
15430   echo "$as_me:15430: \$? = $ac_status" >&5
15431   (exit "$ac_status"); }; }; then
15432
15433 echo "$as_me:15433: checking for X11/Xt const-feature" >&5
15434 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15435 if test "${cf_cv_const_x_string+set}" = set; then
15436   echo $ECHO_N "(cached) $ECHO_C" >&6
15437 else
15438
15439         cat >"conftest.$ac_ext" <<_ACEOF
15440 #line 15440 "configure"
15441 #include "confdefs.h"
15442
15443 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15444 #undef  XTSTRINGDEFINES /* X11R5 and later */
15445 #include <stdlib.h>
15446 #include <X11/Intrinsic.h>
15447
15448 int
15449 main (void)
15450 {
15451 String foo = malloc(1); *foo = 0
15452   ;
15453   return 0;
15454 }
15455 _ACEOF
15456 rm -f "conftest.$ac_objext"
15457 if { (eval echo "$as_me:15457: \"$ac_compile\"") >&5
15458   (eval $ac_compile) 2>&5
15459   ac_status=$?
15460   echo "$as_me:15460: \$? = $ac_status" >&5
15461   (exit "$ac_status"); } &&
15462          { ac_try='test -s "conftest.$ac_objext"'
15463   { (eval echo "$as_me:15463: \"$ac_try\"") >&5
15464   (eval $ac_try) 2>&5
15465   ac_status=$?
15466   echo "$as_me:15466: \$? = $ac_status" >&5
15467   (exit "$ac_status"); }; }; then
15468
15469                         cf_cv_const_x_string=no
15470
15471 else
15472   echo "$as_me: failed program was:" >&5
15473 cat "conftest.$ac_ext" >&5
15474
15475                         cf_cv_const_x_string=yes
15476
15477 fi
15478 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15479
15480 fi
15481 echo "$as_me:15481: result: $cf_cv_const_x_string" >&5
15482 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15483
15484 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15485 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15486 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15487
15488 case "$cf_cv_const_x_string" in
15489 (no)
15490
15491         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15492         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15493
15494         ;;
15495 (*)
15496
15497         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15498         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15499
15500         ;;
15501 esac
15502
15503 else
15504   echo "$as_me: failed program was:" >&5
15505 cat "conftest.$ac_ext" >&5
15506 fi
15507 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15508  fi
15509 cat > "conftest.$ac_ext" <<EOF
15510 #line 15510 "${as_me:-configure}"
15511 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15512 EOF
15513 if test "$INTEL_COMPILER" = yes
15514 then
15515 # The "-wdXXX" options suppress warnings:
15516 # remark #1419: external declaration in primary source file
15517 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15518 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15519 # remark #193: zero used for undefined preprocessing identifier
15520 # remark #593: variable "curs_sb_left_arrow" was set but never used
15521 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15522 # remark #869: parameter "tw" was never referenced
15523 # remark #981: operands are evaluated in unspecified order
15524 # warning #279: controlling expression is constant
15525
15526         { echo "$as_me:15526: checking for $CC warning options..." >&5
15527 echo "$as_me: checking for $CC warning options..." >&6;}
15528         cf_save_CFLAGS="$CFLAGS"
15529         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15530         for cf_opt in \
15531                 wd1419 \
15532                 wd1683 \
15533                 wd1684 \
15534                 wd193 \
15535                 wd593 \
15536                 wd279 \
15537                 wd810 \
15538                 wd869 \
15539                 wd981
15540         do
15541                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15542                 if { (eval echo "$as_me:15542: \"$ac_compile\"") >&5
15543   (eval $ac_compile) 2>&5
15544   ac_status=$?
15545   echo "$as_me:15545: \$? = $ac_status" >&5
15546   (exit "$ac_status"); }; then
15547                         test -n "$verbose" && echo "$as_me:15547: result: ... -$cf_opt" >&5
15548 echo "${ECHO_T}... -$cf_opt" >&6
15549                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15550                 fi
15551         done
15552         CFLAGS="$cf_save_CFLAGS"
15553 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15554 then
15555         { echo "$as_me:15555: checking for $CC warning options..." >&5
15556 echo "$as_me: checking for $CC warning options..." >&6;}
15557         cf_save_CFLAGS="$CFLAGS"
15558         cf_warn_CONST=""
15559         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15560         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15561         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15562         for cf_opt in W Wall \
15563                 Wbad-function-cast \
15564                 Wcast-align \
15565                 Wcast-qual \
15566                 Wdeclaration-after-statement \
15567                 Wextra \
15568                 Winline \
15569                 Wmissing-declarations \
15570                 Wmissing-prototypes \
15571                 Wnested-externs \
15572                 Wpointer-arith \
15573                 Wshadow \
15574                 Wstrict-prototypes \
15575                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15576         do
15577                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15578                 if { (eval echo "$as_me:15578: \"$ac_compile\"") >&5
15579   (eval $ac_compile) 2>&5
15580   ac_status=$?
15581   echo "$as_me:15581: \$? = $ac_status" >&5
15582   (exit "$ac_status"); }; then
15583                         test -n "$verbose" && echo "$as_me:15583: result: ... -$cf_opt" >&5
15584 echo "${ECHO_T}... -$cf_opt" >&6
15585                         case "$cf_opt" in
15586                         (Winline)
15587                                 case "$GCC_VERSION" in
15588                                 ([34].*)
15589                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15590
15591 echo "${as_me:-configure}:15591: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15592
15593                                         continue;;
15594                                 esac
15595                                 ;;
15596                         (Wpointer-arith)
15597                                 case "$GCC_VERSION" in
15598                                 ([12].*)
15599                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15600
15601 echo "${as_me:-configure}:15601: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15602
15603                                         continue;;
15604                                 esac
15605                                 ;;
15606                         esac
15607                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15608                 fi
15609         done
15610         CFLAGS="$cf_save_CFLAGS"
15611 fi
15612 rm -rf ./conftest*
15613
15614 fi
15615
15616 if test "$GCC" = yes || test "$GXX" = yes
15617 then
15618 cat > conftest.i <<EOF
15619 #ifndef GCC_PRINTF
15620 #define GCC_PRINTF 0
15621 #endif
15622 #ifndef GCC_SCANF
15623 #define GCC_SCANF 0
15624 #endif
15625 #ifndef GCC_NORETURN
15626 #define GCC_NORETURN /* nothing */
15627 #endif
15628 #ifndef GCC_UNUSED
15629 #define GCC_UNUSED /* nothing */
15630 #endif
15631 EOF
15632 if test "$GCC" = yes
15633 then
15634         { echo "$as_me:15634: checking for $CC __attribute__ directives..." >&5
15635 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15636 cat > "conftest.$ac_ext" <<EOF
15637 #line 15637 "${as_me:-configure}"
15638 #include "confdefs.h"
15639 #include "conftest.h"
15640 #include "conftest.i"
15641 #if     GCC_PRINTF
15642 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15643 #else
15644 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15645 #endif
15646 #if     GCC_SCANF
15647 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15648 #else
15649 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15650 #endif
15651 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15652 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15653 extern GCC_NORETURN void foo(void);
15654 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15655 EOF
15656         cf_printf_attribute=no
15657         cf_scanf_attribute=no
15658         for cf_attribute in scanf printf unused noreturn
15659         do
15660
15661 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15662
15663                 cf_directive="__attribute__(($cf_attribute))"
15664                 echo "checking for $CC $cf_directive" 1>&5
15665
15666                 case "$cf_attribute" in
15667                 (printf)
15668                         cf_printf_attribute=yes
15669                         cat >conftest.h <<EOF
15670 #define GCC_$cf_ATTRIBUTE 1
15671 EOF
15672                         ;;
15673                 (scanf)
15674                         cf_scanf_attribute=yes
15675                         cat >conftest.h <<EOF
15676 #define GCC_$cf_ATTRIBUTE 1
15677 EOF
15678                         ;;
15679                 (*)
15680                         cat >conftest.h <<EOF
15681 #define GCC_$cf_ATTRIBUTE $cf_directive
15682 EOF
15683                         ;;
15684                 esac
15685
15686                 if { (eval echo "$as_me:15686: \"$ac_compile\"") >&5
15687   (eval $ac_compile) 2>&5
15688   ac_status=$?
15689   echo "$as_me:15689: \$? = $ac_status" >&5
15690   (exit "$ac_status"); }; then
15691                         test -n "$verbose" && echo "$as_me:15691: result: ... $cf_attribute" >&5
15692 echo "${ECHO_T}... $cf_attribute" >&6
15693                         cat conftest.h >>confdefs.h
15694                         case "$cf_attribute" in
15695                         (noreturn)
15696
15697 cat >>confdefs.h <<EOF
15698 #define GCC_NORETURN $cf_directive
15699 EOF
15700
15701                                 ;;
15702                         (printf)
15703                                 cf_value='/* nothing */'
15704                                 if test "$cf_printf_attribute" != no ; then
15705                                         cf_value='__attribute__((format(printf,fmt,var)))'
15706
15707 cat >>confdefs.h <<\EOF
15708 #define GCC_PRINTF 1
15709 EOF
15710
15711                                 fi
15712
15713 cat >>confdefs.h <<EOF
15714 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15715 EOF
15716
15717                                 ;;
15718                         (scanf)
15719                                 cf_value='/* nothing */'
15720                                 if test "$cf_scanf_attribute" != no ; then
15721                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15722
15723 cat >>confdefs.h <<\EOF
15724 #define GCC_SCANF 1
15725 EOF
15726
15727                                 fi
15728
15729 cat >>confdefs.h <<EOF
15730 #define GCC_SCANFLIKE(fmt,var) $cf_value
15731 EOF
15732
15733                                 ;;
15734                         (unused)
15735
15736 cat >>confdefs.h <<EOF
15737 #define GCC_UNUSED $cf_directive
15738 EOF
15739
15740                                 ;;
15741                         esac
15742                 fi
15743         done
15744 else
15745         ${FGREP-fgrep} define conftest.i >>confdefs.h
15746 fi
15747 rm -rf ./conftest*
15748 fi
15749
15750 fi
15751
15752 if test "x$enable_warnings" = "xyes"; then
15753
15754         ADAFLAGS="$ADAFLAGS -gnatg"
15755
15756 fi
15757
15758 ###     use option --enable-assertions to turn on generation of assertion code
15759 echo "$as_me:15759: checking if you want to enable runtime assertions" >&5
15760 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15761
15762 # Check whether --enable-assertions or --disable-assertions was given.
15763 if test "${enable_assertions+set}" = set; then
15764   enableval="$enable_assertions"
15765   with_assertions=$enableval
15766 else
15767   with_assertions=no
15768 fi;
15769 echo "$as_me:15769: result: $with_assertions" >&5
15770 echo "${ECHO_T}$with_assertions" >&6
15771 if test -n "$GCC"
15772 then
15773         if test "$with_assertions" = no
15774         then
15775                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15776         else
15777
15778         ADAFLAGS="$ADAFLAGS -gnata"
15779
15780         fi
15781 fi
15782
15783 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15784
15785 cat >>confdefs.h <<\EOF
15786 #define HAVE_NC_ALLOC_H 1
15787 EOF
15788
15789 ###     use option --enable-expanded to generate certain macros as functions
15790
15791 # Check whether --enable-expanded or --disable-expanded was given.
15792 if test "${enable_expanded+set}" = set; then
15793   enableval="$enable_expanded"
15794   test "$enableval" = yes &&
15795 cat >>confdefs.h <<\EOF
15796 #define NCURSES_EXPANDED 1
15797 EOF
15798
15799 fi;
15800
15801 ###     use option --disable-macros to suppress macros in favor of functions
15802
15803 # Check whether --enable-macros or --disable-macros was given.
15804 if test "${enable_macros+set}" = set; then
15805   enableval="$enable_macros"
15806   test "$enableval" = no &&
15807 cat >>confdefs.h <<\EOF
15808 #define NCURSES_NOMACROS 1
15809 EOF
15810
15811 fi;
15812
15813 # Normally we only add trace() to the debug-library.  Allow this to be
15814 # extended to all models of the ncurses library:
15815 cf_all_traces=no
15816 case "$CFLAGS $CPPFLAGS" in
15817 (*-DTRACE*)
15818         cf_all_traces=yes
15819         ;;
15820 esac
15821
15822 echo "$as_me:15822: checking whether to add trace feature to all models" >&5
15823 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15824
15825 # Check whether --with-trace or --without-trace was given.
15826 if test "${with_trace+set}" = set; then
15827   withval="$with_trace"
15828   cf_with_trace=$withval
15829 else
15830   cf_with_trace=$cf_all_traces
15831 fi;
15832 echo "$as_me:15832: result: $cf_with_trace" >&5
15833 echo "${ECHO_T}$cf_with_trace" >&6
15834
15835 if test "$cf_with_trace" = yes ; then
15836         ADA_TRACE=TRUE
15837
15838 cf_fix_cppflags=no
15839 cf_new_cflags=
15840 cf_new_cppflags=
15841 cf_new_extra_cppflags=
15842
15843 for cf_add_cflags in -DTRACE
15844 do
15845 case "$cf_fix_cppflags" in
15846 (no)
15847         case "$cf_add_cflags" in
15848         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15849                 case "$cf_add_cflags" in
15850                 (-D*)
15851                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15852
15853                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15854                                 && test -z "${cf_tst_cflags}" \
15855                                 && cf_fix_cppflags=yes
15856
15857                         if test "$cf_fix_cppflags" = yes ; then
15858
15859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15861
15862                                 continue
15863                         elif test "${cf_tst_cflags}" = "\"'" ; then
15864
15865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15867
15868                                 continue
15869                         fi
15870                         ;;
15871                 esac
15872                 case "$CPPFLAGS" in
15873                 (*$cf_add_cflags)
15874                         ;;
15875                 (*)
15876                         case "$cf_add_cflags" in
15877                         (-D*)
15878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15879
15880 CPPFLAGS=`echo "$CPPFLAGS" | \
15881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15883
15884                                 ;;
15885                         esac
15886
15887         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15888         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15889
15890                         ;;
15891                 esac
15892                 ;;
15893         (*)
15894
15895         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15896         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15897
15898                 ;;
15899         esac
15900         ;;
15901 (yes)
15902
15903         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15904         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15905
15906         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15907
15908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15909                 && test -z "${cf_tst_cflags}" \
15910                 && cf_fix_cppflags=no
15911         ;;
15912 esac
15913 done
15914
15915 if test -n "$cf_new_cflags" ; then
15916
15917         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15918         CFLAGS="${CFLAGS}$cf_new_cflags"
15919
15920 fi
15921
15922 if test -n "$cf_new_cppflags" ; then
15923
15924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15925         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15926
15927 fi
15928
15929 if test -n "$cf_new_extra_cppflags" ; then
15930
15931         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15932         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15933
15934 fi
15935
15936 else
15937         ADA_TRACE=FALSE
15938 fi
15939
15940 echo "$as_me:15940: checking if we want to use GNAT projects" >&5
15941 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15942
15943 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15944 if test "${enable_gnat_projects+set}" = set; then
15945   enableval="$enable_gnat_projects"
15946   test "$enableval" != no && enableval=yes
15947         if test "$enableval" != "yes" ; then
15948     enable_gnat_projects=no
15949         else
15950                 enable_gnat_projects=yes
15951         fi
15952 else
15953   enableval=yes
15954         enable_gnat_projects=yes
15955
15956 fi;
15957 echo "$as_me:15957: result: $enable_gnat_projects" >&5
15958 echo "${ECHO_T}$enable_gnat_projects" >&6
15959
15960 ###     Checks for libraries.
15961 case $cf_cv_system_name in
15962 (*mingw32*)
15963         ;;
15964 (*)
15965 echo "$as_me:15965: checking for gettimeofday" >&5
15966 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15967 if test "${ac_cv_func_gettimeofday+set}" = set; then
15968   echo $ECHO_N "(cached) $ECHO_C" >&6
15969 else
15970   cat >"conftest.$ac_ext" <<_ACEOF
15971 #line 15971 "configure"
15972 #include "confdefs.h"
15973 #define gettimeofday autoconf_temporary
15974 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15975 #undef gettimeofday
15976
15977 #ifdef __cplusplus
15978 extern "C"
15979 #endif
15980
15981 /* We use char because int might match the return type of a gcc2
15982    builtin and then its argument prototype would still apply.  */
15983 char gettimeofday (void);
15984
15985 int
15986 main (void)
15987 {
15988
15989 /* The GNU C library defines stubs for functions which it implements
15990     to always fail with ENOSYS.  Some functions are actually named
15991     something starting with __ and the normal name is an alias.  */
15992 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15993 #error found stub for gettimeofday
15994 #endif
15995
15996         return gettimeofday ();
15997   ;
15998   return 0;
15999 }
16000 _ACEOF
16001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16002 if { (eval echo "$as_me:16002: \"$ac_link\"") >&5
16003   (eval $ac_link) 2>&5
16004   ac_status=$?
16005   echo "$as_me:16005: \$? = $ac_status" >&5
16006   (exit "$ac_status"); } &&
16007          { ac_try='test -s "conftest$ac_exeext"'
16008   { (eval echo "$as_me:16008: \"$ac_try\"") >&5
16009   (eval $ac_try) 2>&5
16010   ac_status=$?
16011   echo "$as_me:16011: \$? = $ac_status" >&5
16012   (exit "$ac_status"); }; }; then
16013   ac_cv_func_gettimeofday=yes
16014 else
16015   echo "$as_me: failed program was:" >&5
16016 cat "conftest.$ac_ext" >&5
16017 ac_cv_func_gettimeofday=no
16018 fi
16019 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16020 fi
16021 echo "$as_me:16021: result: $ac_cv_func_gettimeofday" >&5
16022 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
16023 if test "$ac_cv_func_gettimeofday" = yes; then
16024   cat >>confdefs.h <<\EOF
16025 #define HAVE_GETTIMEOFDAY 1
16026 EOF
16027
16028 else
16029
16030 echo "$as_me:16030: checking for gettimeofday in -lbsd" >&5
16031 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
16032 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
16033   echo $ECHO_N "(cached) $ECHO_C" >&6
16034 else
16035   ac_check_lib_save_LIBS=$LIBS
16036 LIBS="-lbsd  $LIBS"
16037 cat >"conftest.$ac_ext" <<_ACEOF
16038 #line 16038 "configure"
16039 #include "confdefs.h"
16040
16041 /* Override any gcc2 internal prototype to avoid an error.  */
16042 #ifdef __cplusplus
16043 extern "C"
16044 #endif
16045 /* We use char because int might match the return type of a gcc2
16046    builtin and then its argument prototype would still apply.  */
16047 char gettimeofday ();
16048 int
16049 main (void)
16050 {
16051 gettimeofday ();
16052   ;
16053   return 0;
16054 }
16055 _ACEOF
16056 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16057 if { (eval echo "$as_me:16057: \"$ac_link\"") >&5
16058   (eval $ac_link) 2>&5
16059   ac_status=$?
16060   echo "$as_me:16060: \$? = $ac_status" >&5
16061   (exit "$ac_status"); } &&
16062          { ac_try='test -s "conftest$ac_exeext"'
16063   { (eval echo "$as_me:16063: \"$ac_try\"") >&5
16064   (eval $ac_try) 2>&5
16065   ac_status=$?
16066   echo "$as_me:16066: \$? = $ac_status" >&5
16067   (exit "$ac_status"); }; }; then
16068   ac_cv_lib_bsd_gettimeofday=yes
16069 else
16070   echo "$as_me: failed program was:" >&5
16071 cat "conftest.$ac_ext" >&5
16072 ac_cv_lib_bsd_gettimeofday=no
16073 fi
16074 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16075 LIBS=$ac_check_lib_save_LIBS
16076 fi
16077 echo "$as_me:16077: result: $ac_cv_lib_bsd_gettimeofday" >&5
16078 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
16079 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
16080
16081 cat >>confdefs.h <<\EOF
16082 #define HAVE_GETTIMEOFDAY 1
16083 EOF
16084
16085         LIBS="$LIBS -lbsd"
16086 fi
16087
16088 fi
16089         ;;
16090 esac
16091
16092 ###     Checks for header files.
16093 echo "$as_me:16093: checking for ANSI C header files" >&5
16094 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16095 if test "${ac_cv_header_stdc+set}" = set; then
16096   echo $ECHO_N "(cached) $ECHO_C" >&6
16097 else
16098   cat >"conftest.$ac_ext" <<_ACEOF
16099 #line 16099 "configure"
16100 #include "confdefs.h"
16101 #include <stdlib.h>
16102 #include <stdarg.h>
16103 #include <string.h>
16104 #include <float.h>
16105
16106 _ACEOF
16107 if { (eval echo "$as_me:16107: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16108   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16109   ac_status=$?
16110   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16111   rm -f conftest.er1
16112   cat conftest.err >&5
16113   echo "$as_me:16113: \$? = $ac_status" >&5
16114   (exit "$ac_status"); } >/dev/null; then
16115   if test -s conftest.err; then
16116     ac_cpp_err=$ac_c_preproc_warn_flag
16117   else
16118     ac_cpp_err=
16119   fi
16120 else
16121   ac_cpp_err=yes
16122 fi
16123 if test -z "$ac_cpp_err"; then
16124   ac_cv_header_stdc=yes
16125 else
16126   echo "$as_me: failed program was:" >&5
16127   cat "conftest.$ac_ext" >&5
16128   ac_cv_header_stdc=no
16129 fi
16130 rm -f conftest.err "conftest.$ac_ext"
16131
16132 if test $ac_cv_header_stdc = yes; then
16133   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16134   cat >"conftest.$ac_ext" <<_ACEOF
16135 #line 16135 "configure"
16136 #include "confdefs.h"
16137 #include <string.h>
16138
16139 _ACEOF
16140 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16141   $EGREP "memchr" >/dev/null 2>&1; then
16142   :
16143 else
16144   ac_cv_header_stdc=no
16145 fi
16146 rm -rf conftest*
16147
16148 fi
16149
16150 if test $ac_cv_header_stdc = yes; then
16151   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16152   cat >"conftest.$ac_ext" <<_ACEOF
16153 #line 16153 "configure"
16154 #include "confdefs.h"
16155 #include <stdlib.h>
16156
16157 _ACEOF
16158 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16159   $EGREP "free" >/dev/null 2>&1; then
16160   :
16161 else
16162   ac_cv_header_stdc=no
16163 fi
16164 rm -rf conftest*
16165
16166 fi
16167
16168 if test $ac_cv_header_stdc = yes; then
16169   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16170   if test "$cross_compiling" = yes; then
16171   :
16172 else
16173   cat >"conftest.$ac_ext" <<_ACEOF
16174 #line 16174 "configure"
16175 #include "confdefs.h"
16176 #include <ctype.h>
16177 #if ((' ' & 0x0FF) == 0x020)
16178 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16179 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16180 #else
16181 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16182                      || ('j' <= (c) && (c) <= 'r') \
16183                      || ('s' <= (c) && (c) <= 'z'))
16184 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16185 #endif
16186
16187 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16188 int
16189 main (void)
16190 {
16191   int i;
16192   for (i = 0; i < 256; i++)
16193     if (XOR (islower (i), ISLOWER (i))
16194         || toupper (i) != TOUPPER (i))
16195       $ac_main_return(2);
16196   $ac_main_return (0);
16197 }
16198 _ACEOF
16199 rm -f "conftest$ac_exeext"
16200 if { (eval echo "$as_me:16200: \"$ac_link\"") >&5
16201   (eval $ac_link) 2>&5
16202   ac_status=$?
16203   echo "$as_me:16203: \$? = $ac_status" >&5
16204   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16205   { (eval echo "$as_me:16205: \"$ac_try\"") >&5
16206   (eval $ac_try) 2>&5
16207   ac_status=$?
16208   echo "$as_me:16208: \$? = $ac_status" >&5
16209   (exit "$ac_status"); }; }; then
16210   :
16211 else
16212   echo "$as_me: program exited with status $ac_status" >&5
16213 echo "$as_me: failed program was:" >&5
16214 cat "conftest.$ac_ext" >&5
16215 ac_cv_header_stdc=no
16216 fi
16217 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16218 fi
16219 fi
16220 fi
16221 echo "$as_me:16221: result: $ac_cv_header_stdc" >&5
16222 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16223 if test $ac_cv_header_stdc = yes; then
16224
16225 cat >>confdefs.h <<\EOF
16226 #define STDC_HEADERS 1
16227 EOF
16228
16229 fi
16230
16231 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
16232
16233 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
16234                   inttypes.h stdint.h unistd.h
16235 do
16236 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16237 echo "$as_me:16237: checking for $ac_header" >&5
16238 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16239 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16240   echo $ECHO_N "(cached) $ECHO_C" >&6
16241 else
16242   cat >"conftest.$ac_ext" <<_ACEOF
16243 #line 16243 "configure"
16244 #include "confdefs.h"
16245 $ac_includes_default
16246 #include <$ac_header>
16247 _ACEOF
16248 rm -f "conftest.$ac_objext"
16249 if { (eval echo "$as_me:16249: \"$ac_compile\"") >&5
16250   (eval $ac_compile) 2>&5
16251   ac_status=$?
16252   echo "$as_me:16252: \$? = $ac_status" >&5
16253   (exit "$ac_status"); } &&
16254          { ac_try='test -s "conftest.$ac_objext"'
16255   { (eval echo "$as_me:16255: \"$ac_try\"") >&5
16256   (eval $ac_try) 2>&5
16257   ac_status=$?
16258   echo "$as_me:16258: \$? = $ac_status" >&5
16259   (exit "$ac_status"); }; }; then
16260   eval "$as_ac_Header=yes"
16261 else
16262   echo "$as_me: failed program was:" >&5
16263 cat "conftest.$ac_ext" >&5
16264 eval "$as_ac_Header=no"
16265 fi
16266 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16267 fi
16268 echo "$as_me:16268: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16269 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16270 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16271   cat >>confdefs.h <<EOF
16272 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16273 EOF
16274
16275 fi
16276 done
16277
16278 echo "$as_me:16278: checking for signed char" >&5
16279 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
16280 if test "${ac_cv_type_signed_char+set}" = set; then
16281   echo $ECHO_N "(cached) $ECHO_C" >&6
16282 else
16283   cat >"conftest.$ac_ext" <<_ACEOF
16284 #line 16284 "configure"
16285 #include "confdefs.h"
16286 $ac_includes_default
16287 int
16288 main (void)
16289 {
16290 if ((signed char *) 0)
16291   return 0;
16292 if (sizeof (signed char))
16293   return 0;
16294   ;
16295   return 0;
16296 }
16297 _ACEOF
16298 rm -f "conftest.$ac_objext"
16299 if { (eval echo "$as_me:16299: \"$ac_compile\"") >&5
16300   (eval $ac_compile) 2>&5
16301   ac_status=$?
16302   echo "$as_me:16302: \$? = $ac_status" >&5
16303   (exit "$ac_status"); } &&
16304          { ac_try='test -s "conftest.$ac_objext"'
16305   { (eval echo "$as_me:16305: \"$ac_try\"") >&5
16306   (eval $ac_try) 2>&5
16307   ac_status=$?
16308   echo "$as_me:16308: \$? = $ac_status" >&5
16309   (exit "$ac_status"); }; }; then
16310   ac_cv_type_signed_char=yes
16311 else
16312   echo "$as_me: failed program was:" >&5
16313 cat "conftest.$ac_ext" >&5
16314 ac_cv_type_signed_char=no
16315 fi
16316 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16317 fi
16318 echo "$as_me:16318: result: $ac_cv_type_signed_char" >&5
16319 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
16320
16321 echo "$as_me:16321: checking size of signed char" >&5
16322 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
16323 if test "${ac_cv_sizeof_signed_char+set}" = set; then
16324   echo $ECHO_N "(cached) $ECHO_C" >&6
16325 else
16326   if test "$ac_cv_type_signed_char" = yes; then
16327   if test "$cross_compiling" = yes; then
16328   # Depending upon the size, compute the lo and hi bounds.
16329 cat >"conftest.$ac_ext" <<_ACEOF
16330 #line 16330 "configure"
16331 #include "confdefs.h"
16332 $ac_includes_default
16333 int
16334 main (void)
16335 {
16336 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
16337   ;
16338   return 0;
16339 }
16340 _ACEOF
16341 rm -f "conftest.$ac_objext"
16342 if { (eval echo "$as_me:16342: \"$ac_compile\"") >&5
16343   (eval $ac_compile) 2>&5
16344   ac_status=$?
16345   echo "$as_me:16345: \$? = $ac_status" >&5
16346   (exit "$ac_status"); } &&
16347          { ac_try='test -s "conftest.$ac_objext"'
16348   { (eval echo "$as_me:16348: \"$ac_try\"") >&5
16349   (eval $ac_try) 2>&5
16350   ac_status=$?
16351   echo "$as_me:16351: \$? = $ac_status" >&5
16352   (exit "$ac_status"); }; }; then
16353   ac_lo=0 ac_mid=0
16354   while :; do
16355     cat >"conftest.$ac_ext" <<_ACEOF
16356 #line 16356 "configure"
16357 #include "confdefs.h"
16358 $ac_includes_default
16359 int
16360 main (void)
16361 {
16362 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16363   ;
16364   return 0;
16365 }
16366 _ACEOF
16367 rm -f "conftest.$ac_objext"
16368 if { (eval echo "$as_me:16368: \"$ac_compile\"") >&5
16369   (eval $ac_compile) 2>&5
16370   ac_status=$?
16371   echo "$as_me:16371: \$? = $ac_status" >&5
16372   (exit "$ac_status"); } &&
16373          { ac_try='test -s "conftest.$ac_objext"'
16374   { (eval echo "$as_me:16374: \"$ac_try\"") >&5
16375   (eval $ac_try) 2>&5
16376   ac_status=$?
16377   echo "$as_me:16377: \$? = $ac_status" >&5
16378   (exit "$ac_status"); }; }; then
16379   ac_hi=$ac_mid; break
16380 else
16381   echo "$as_me: failed program was:" >&5
16382 cat "conftest.$ac_ext" >&5
16383 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
16384 fi
16385 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16386   done
16387 else
16388   echo "$as_me: failed program was:" >&5
16389 cat "conftest.$ac_ext" >&5
16390 ac_hi=-1 ac_mid=-1
16391   while :; do
16392     cat >"conftest.$ac_ext" <<_ACEOF
16393 #line 16393 "configure"
16394 #include "confdefs.h"
16395 $ac_includes_default
16396 int
16397 main (void)
16398 {
16399 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16400   ;
16401   return 0;
16402 }
16403 _ACEOF
16404 rm -f "conftest.$ac_objext"
16405 if { (eval echo "$as_me:16405: \"$ac_compile\"") >&5
16406   (eval $ac_compile) 2>&5
16407   ac_status=$?
16408   echo "$as_me:16408: \$? = $ac_status" >&5
16409   (exit "$ac_status"); } &&
16410          { ac_try='test -s "conftest.$ac_objext"'
16411   { (eval echo "$as_me:16411: \"$ac_try\"") >&5
16412   (eval $ac_try) 2>&5
16413   ac_status=$?
16414   echo "$as_me:16414: \$? = $ac_status" >&5
16415   (exit "$ac_status"); }; }; then
16416   ac_lo=$ac_mid; break
16417 else
16418   echo "$as_me: failed program was:" >&5
16419 cat "conftest.$ac_ext" >&5
16420 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16421 fi
16422 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16423   done
16424 fi
16425 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16426 # Binary search between lo and hi bounds.
16427 while test "x$ac_lo" != "x$ac_hi"; do
16428   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16429   cat >"conftest.$ac_ext" <<_ACEOF
16430 #line 16430 "configure"
16431 #include "confdefs.h"
16432 $ac_includes_default
16433 int
16434 main (void)
16435 {
16436 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16437   ;
16438   return 0;
16439 }
16440 _ACEOF
16441 rm -f "conftest.$ac_objext"
16442 if { (eval echo "$as_me:16442: \"$ac_compile\"") >&5
16443   (eval $ac_compile) 2>&5
16444   ac_status=$?
16445   echo "$as_me:16445: \$? = $ac_status" >&5
16446   (exit "$ac_status"); } &&
16447          { ac_try='test -s "conftest.$ac_objext"'
16448   { (eval echo "$as_me:16448: \"$ac_try\"") >&5
16449   (eval $ac_try) 2>&5
16450   ac_status=$?
16451   echo "$as_me:16451: \$? = $ac_status" >&5
16452   (exit "$ac_status"); }; }; then
16453   ac_hi=$ac_mid
16454 else
16455   echo "$as_me: failed program was:" >&5
16456 cat "conftest.$ac_ext" >&5
16457 ac_lo=`expr "$ac_mid" + 1`
16458 fi
16459 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16460 done
16461 ac_cv_sizeof_signed_char=$ac_lo
16462 else
16463   if test "$cross_compiling" = yes; then
16464   { { echo "$as_me:16464: error: cannot run test program while cross compiling" >&5
16465 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16466    { (exit 1); exit 1; }; }
16467 else
16468   cat >"conftest.$ac_ext" <<_ACEOF
16469 #line 16469 "configure"
16470 #include "confdefs.h"
16471 $ac_includes_default
16472 int
16473 main (void)
16474 {
16475 FILE *f = fopen ("conftest.val", "w");
16476 if (!f)
16477   $ac_main_return (1);
16478 fprintf (f, "%ld", (long)(sizeof (signed char)));
16479 fclose (f);
16480   ;
16481   return 0;
16482 }
16483 _ACEOF
16484 rm -f "conftest$ac_exeext"
16485 if { (eval echo "$as_me:16485: \"$ac_link\"") >&5
16486   (eval $ac_link) 2>&5
16487   ac_status=$?
16488   echo "$as_me:16488: \$? = $ac_status" >&5
16489   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16490   { (eval echo "$as_me:16490: \"$ac_try\"") >&5
16491   (eval $ac_try) 2>&5
16492   ac_status=$?
16493   echo "$as_me:16493: \$? = $ac_status" >&5
16494   (exit "$ac_status"); }; }; then
16495   ac_cv_sizeof_signed_char=`cat conftest.val`
16496 else
16497   echo "$as_me: program exited with status $ac_status" >&5
16498 echo "$as_me: failed program was:" >&5
16499 cat "conftest.$ac_ext" >&5
16500 fi
16501 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16502 fi
16503 fi
16504 rm -f conftest.val
16505 else
16506   ac_cv_sizeof_signed_char=0
16507 fi
16508 fi
16509 echo "$as_me:16509: result: $ac_cv_sizeof_signed_char" >&5
16510 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16511 cat >>confdefs.h <<EOF
16512 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16513 EOF
16514
16515 echo "$as_me:16515: checking for ANSI C header files" >&5
16516 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16517 if test "${ac_cv_header_stdc+set}" = set; then
16518   echo $ECHO_N "(cached) $ECHO_C" >&6
16519 else
16520   cat >"conftest.$ac_ext" <<_ACEOF
16521 #line 16521 "configure"
16522 #include "confdefs.h"
16523 #include <stdlib.h>
16524 #include <stdarg.h>
16525 #include <string.h>
16526 #include <float.h>
16527
16528 _ACEOF
16529 if { (eval echo "$as_me:16529: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16530   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16531   ac_status=$?
16532   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16533   rm -f conftest.er1
16534   cat conftest.err >&5
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit "$ac_status"); } >/dev/null; then
16537   if test -s conftest.err; then
16538     ac_cpp_err=$ac_c_preproc_warn_flag
16539   else
16540     ac_cpp_err=
16541   fi
16542 else
16543   ac_cpp_err=yes
16544 fi
16545 if test -z "$ac_cpp_err"; then
16546   ac_cv_header_stdc=yes
16547 else
16548   echo "$as_me: failed program was:" >&5
16549   cat "conftest.$ac_ext" >&5
16550   ac_cv_header_stdc=no
16551 fi
16552 rm -f conftest.err "conftest.$ac_ext"
16553
16554 if test $ac_cv_header_stdc = yes; then
16555   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16556   cat >"conftest.$ac_ext" <<_ACEOF
16557 #line 16557 "configure"
16558 #include "confdefs.h"
16559 #include <string.h>
16560
16561 _ACEOF
16562 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16563   $EGREP "memchr" >/dev/null 2>&1; then
16564   :
16565 else
16566   ac_cv_header_stdc=no
16567 fi
16568 rm -rf conftest*
16569
16570 fi
16571
16572 if test $ac_cv_header_stdc = yes; then
16573   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16574   cat >"conftest.$ac_ext" <<_ACEOF
16575 #line 16575 "configure"
16576 #include "confdefs.h"
16577 #include <stdlib.h>
16578
16579 _ACEOF
16580 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16581   $EGREP "free" >/dev/null 2>&1; then
16582   :
16583 else
16584   ac_cv_header_stdc=no
16585 fi
16586 rm -rf conftest*
16587
16588 fi
16589
16590 if test $ac_cv_header_stdc = yes; then
16591   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16592   if test "$cross_compiling" = yes; then
16593   :
16594 else
16595   cat >"conftest.$ac_ext" <<_ACEOF
16596 #line 16596 "configure"
16597 #include "confdefs.h"
16598 #include <ctype.h>
16599 #if ((' ' & 0x0FF) == 0x020)
16600 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16601 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16602 #else
16603 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16604                      || ('j' <= (c) && (c) <= 'r') \
16605                      || ('s' <= (c) && (c) <= 'z'))
16606 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16607 #endif
16608
16609 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16610 int
16611 main (void)
16612 {
16613   int i;
16614   for (i = 0; i < 256; i++)
16615     if (XOR (islower (i), ISLOWER (i))
16616         || toupper (i) != TOUPPER (i))
16617       $ac_main_return(2);
16618   $ac_main_return (0);
16619 }
16620 _ACEOF
16621 rm -f "conftest$ac_exeext"
16622 if { (eval echo "$as_me:16622: \"$ac_link\"") >&5
16623   (eval $ac_link) 2>&5
16624   ac_status=$?
16625   echo "$as_me:16625: \$? = $ac_status" >&5
16626   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16627   { (eval echo "$as_me:16627: \"$ac_try\"") >&5
16628   (eval $ac_try) 2>&5
16629   ac_status=$?
16630   echo "$as_me:16630: \$? = $ac_status" >&5
16631   (exit "$ac_status"); }; }; then
16632   :
16633 else
16634   echo "$as_me: program exited with status $ac_status" >&5
16635 echo "$as_me: failed program was:" >&5
16636 cat "conftest.$ac_ext" >&5
16637 ac_cv_header_stdc=no
16638 fi
16639 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16640 fi
16641 fi
16642 fi
16643 echo "$as_me:16643: result: $ac_cv_header_stdc" >&5
16644 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16645 if test $ac_cv_header_stdc = yes; then
16646
16647 cat >>confdefs.h <<\EOF
16648 #define STDC_HEADERS 1
16649 EOF
16650
16651 fi
16652
16653 ac_header_dirent=no
16654 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16655   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16656 echo "$as_me:16656: checking for $ac_hdr that defines DIR" >&5
16657 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16658 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16659   echo $ECHO_N "(cached) $ECHO_C" >&6
16660 else
16661   cat >"conftest.$ac_ext" <<_ACEOF
16662 #line 16662 "configure"
16663 #include "confdefs.h"
16664 #include <sys/types.h>
16665 #include <$ac_hdr>
16666
16667 int
16668 main (void)
16669 {
16670 if ((DIR *) 0)
16671 return 0;
16672   ;
16673   return 0;
16674 }
16675 _ACEOF
16676 rm -f "conftest.$ac_objext"
16677 if { (eval echo "$as_me:16677: \"$ac_compile\"") >&5
16678   (eval $ac_compile) 2>&5
16679   ac_status=$?
16680   echo "$as_me:16680: \$? = $ac_status" >&5
16681   (exit "$ac_status"); } &&
16682          { ac_try='test -s "conftest.$ac_objext"'
16683   { (eval echo "$as_me:16683: \"$ac_try\"") >&5
16684   (eval $ac_try) 2>&5
16685   ac_status=$?
16686   echo "$as_me:16686: \$? = $ac_status" >&5
16687   (exit "$ac_status"); }; }; then
16688   eval "$as_ac_Header=yes"
16689 else
16690   echo "$as_me: failed program was:" >&5
16691 cat "conftest.$ac_ext" >&5
16692 eval "$as_ac_Header=no"
16693 fi
16694 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16695 fi
16696 echo "$as_me:16696: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16697 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16698 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16699   cat >>confdefs.h <<EOF
16700 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16701 EOF
16702
16703 ac_header_dirent=$ac_hdr; break
16704 fi
16705
16706 done
16707 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16708 if test $ac_header_dirent = dirent.h; then
16709   echo "$as_me:16709: checking for opendir in -ldir" >&5
16710 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16711 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16712   echo $ECHO_N "(cached) $ECHO_C" >&6
16713 else
16714   ac_check_lib_save_LIBS=$LIBS
16715 LIBS="-ldir  $LIBS"
16716 cat >"conftest.$ac_ext" <<_ACEOF
16717 #line 16717 "configure"
16718 #include "confdefs.h"
16719
16720 /* Override any gcc2 internal prototype to avoid an error.  */
16721 #ifdef __cplusplus
16722 extern "C"
16723 #endif
16724 /* We use char because int might match the return type of a gcc2
16725    builtin and then its argument prototype would still apply.  */
16726 char opendir ();
16727 int
16728 main (void)
16729 {
16730 opendir ();
16731   ;
16732   return 0;
16733 }
16734 _ACEOF
16735 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16736 if { (eval echo "$as_me:16736: \"$ac_link\"") >&5
16737   (eval $ac_link) 2>&5
16738   ac_status=$?
16739   echo "$as_me:16739: \$? = $ac_status" >&5
16740   (exit "$ac_status"); } &&
16741          { ac_try='test -s "conftest$ac_exeext"'
16742   { (eval echo "$as_me:16742: \"$ac_try\"") >&5
16743   (eval $ac_try) 2>&5
16744   ac_status=$?
16745   echo "$as_me:16745: \$? = $ac_status" >&5
16746   (exit "$ac_status"); }; }; then
16747   ac_cv_lib_dir_opendir=yes
16748 else
16749   echo "$as_me: failed program was:" >&5
16750 cat "conftest.$ac_ext" >&5
16751 ac_cv_lib_dir_opendir=no
16752 fi
16753 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16754 LIBS=$ac_check_lib_save_LIBS
16755 fi
16756 echo "$as_me:16756: result: $ac_cv_lib_dir_opendir" >&5
16757 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16758 if test "$ac_cv_lib_dir_opendir" = yes; then
16759   LIBS="$LIBS -ldir"
16760 fi
16761
16762 else
16763   echo "$as_me:16763: checking for opendir in -lx" >&5
16764 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16765 if test "${ac_cv_lib_x_opendir+set}" = set; then
16766   echo $ECHO_N "(cached) $ECHO_C" >&6
16767 else
16768   ac_check_lib_save_LIBS=$LIBS
16769 LIBS="-lx  $LIBS"
16770 cat >"conftest.$ac_ext" <<_ACEOF
16771 #line 16771 "configure"
16772 #include "confdefs.h"
16773
16774 /* Override any gcc2 internal prototype to avoid an error.  */
16775 #ifdef __cplusplus
16776 extern "C"
16777 #endif
16778 /* We use char because int might match the return type of a gcc2
16779    builtin and then its argument prototype would still apply.  */
16780 char opendir ();
16781 int
16782 main (void)
16783 {
16784 opendir ();
16785   ;
16786   return 0;
16787 }
16788 _ACEOF
16789 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16790 if { (eval echo "$as_me:16790: \"$ac_link\"") >&5
16791   (eval $ac_link) 2>&5
16792   ac_status=$?
16793   echo "$as_me:16793: \$? = $ac_status" >&5
16794   (exit "$ac_status"); } &&
16795          { ac_try='test -s "conftest$ac_exeext"'
16796   { (eval echo "$as_me:16796: \"$ac_try\"") >&5
16797   (eval $ac_try) 2>&5
16798   ac_status=$?
16799   echo "$as_me:16799: \$? = $ac_status" >&5
16800   (exit "$ac_status"); }; }; then
16801   ac_cv_lib_x_opendir=yes
16802 else
16803   echo "$as_me: failed program was:" >&5
16804 cat "conftest.$ac_ext" >&5
16805 ac_cv_lib_x_opendir=no
16806 fi
16807 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16808 LIBS=$ac_check_lib_save_LIBS
16809 fi
16810 echo "$as_me:16810: result: $ac_cv_lib_x_opendir" >&5
16811 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16812 if test "$ac_cv_lib_x_opendir" = yes; then
16813   LIBS="$LIBS -lx"
16814 fi
16815
16816 fi
16817
16818 echo "$as_me:16818: checking whether time.h and sys/time.h may both be included" >&5
16819 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16820 if test "${ac_cv_header_time+set}" = set; then
16821   echo $ECHO_N "(cached) $ECHO_C" >&6
16822 else
16823   cat >"conftest.$ac_ext" <<_ACEOF
16824 #line 16824 "configure"
16825 #include "confdefs.h"
16826 #include <sys/types.h>
16827 #include <sys/time.h>
16828 #include <time.h>
16829
16830 int
16831 main (void)
16832 {
16833 if ((struct tm *) 0)
16834 return 0;
16835   ;
16836   return 0;
16837 }
16838 _ACEOF
16839 rm -f "conftest.$ac_objext"
16840 if { (eval echo "$as_me:16840: \"$ac_compile\"") >&5
16841   (eval $ac_compile) 2>&5
16842   ac_status=$?
16843   echo "$as_me:16843: \$? = $ac_status" >&5
16844   (exit "$ac_status"); } &&
16845          { ac_try='test -s "conftest.$ac_objext"'
16846   { (eval echo "$as_me:16846: \"$ac_try\"") >&5
16847   (eval $ac_try) 2>&5
16848   ac_status=$?
16849   echo "$as_me:16849: \$? = $ac_status" >&5
16850   (exit "$ac_status"); }; }; then
16851   ac_cv_header_time=yes
16852 else
16853   echo "$as_me: failed program was:" >&5
16854 cat "conftest.$ac_ext" >&5
16855 ac_cv_header_time=no
16856 fi
16857 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16858 fi
16859 echo "$as_me:16859: result: $ac_cv_header_time" >&5
16860 echo "${ECHO_T}$ac_cv_header_time" >&6
16861 if test $ac_cv_header_time = yes; then
16862
16863 cat >>confdefs.h <<\EOF
16864 #define TIME_WITH_SYS_TIME 1
16865 EOF
16866
16867 fi
16868
16869 ###     checks for compiler characteristics
16870 ac_ext=c
16871 ac_cpp='$CPP $CPPFLAGS'
16872 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16873 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16874 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16875 ac_main_return="return"
16876
16877 echo "$as_me:16877: checking for an ANSI C-conforming const" >&5
16878 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16879 if test "${ac_cv_c_const+set}" = set; then
16880   echo $ECHO_N "(cached) $ECHO_C" >&6
16881 else
16882   cat >"conftest.$ac_ext" <<_ACEOF
16883 #line 16883 "configure"
16884 #include "confdefs.h"
16885
16886 int
16887 main (void)
16888 {
16889 /* FIXME: Include the comments suggested by Paul. */
16890 #ifndef __cplusplus
16891   /* Ultrix mips cc rejects this.  */
16892   typedef int charset[2];
16893   const charset x;
16894   /* SunOS 4.1.1 cc rejects this.  */
16895   char const *const *ccp;
16896   char **p;
16897   /* NEC SVR4.0.2 mips cc rejects this.  */
16898   struct point {int x, y;};
16899   static struct point const zero = {0,0};
16900   /* AIX XL C 1.02.0.0 rejects this.
16901      It does not let you subtract one const X* pointer from another in
16902      an arm of an if-expression whose if-part is not a constant
16903      expression */
16904   const char *g = "string";
16905   ccp = &g + (g ? g-g : 0);
16906   /* HPUX 7.0 cc rejects these. */
16907   ++ccp;
16908   p = (char**) ccp;
16909   ccp = (char const *const *) p;
16910   { /* SCO 3.2v4 cc rejects this.  */
16911     char *t;
16912     char const *s = 0 ? (char *) 0 : (char const *) 0;
16913
16914     *t++ = 0;
16915   }
16916   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16917     int x[] = {25, 17};
16918     const int *foo = &x[0];
16919     ++foo;
16920   }
16921   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16922     typedef const int *iptr;
16923     iptr p = 0;
16924     ++p;
16925   }
16926   { /* AIX XL C 1.02.0.0 rejects this saying
16927        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16928     struct s { int j; const int *ap[3]; };
16929     struct s *b; b->j = 5;
16930   }
16931   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16932     const int foo = 10;
16933   }
16934 #endif
16935
16936   ;
16937   return 0;
16938 }
16939 _ACEOF
16940 rm -f "conftest.$ac_objext"
16941 if { (eval echo "$as_me:16941: \"$ac_compile\"") >&5
16942   (eval $ac_compile) 2>&5
16943   ac_status=$?
16944   echo "$as_me:16944: \$? = $ac_status" >&5
16945   (exit "$ac_status"); } &&
16946          { ac_try='test -s "conftest.$ac_objext"'
16947   { (eval echo "$as_me:16947: \"$ac_try\"") >&5
16948   (eval $ac_try) 2>&5
16949   ac_status=$?
16950   echo "$as_me:16950: \$? = $ac_status" >&5
16951   (exit "$ac_status"); }; }; then
16952   ac_cv_c_const=yes
16953 else
16954   echo "$as_me: failed program was:" >&5
16955 cat "conftest.$ac_ext" >&5
16956 ac_cv_c_const=no
16957 fi
16958 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16959 fi
16960 echo "$as_me:16960: result: $ac_cv_c_const" >&5
16961 echo "${ECHO_T}$ac_cv_c_const" >&6
16962 if test $ac_cv_c_const = no; then
16963
16964 cat >>confdefs.h <<\EOF
16965 #define const
16966 EOF
16967
16968 fi
16969
16970 ###     Checks for external-data
16971
16972 echo "$as_me:16972: checking if data-only library module links" >&5
16973 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16974 if test "${cf_cv_link_dataonly+set}" = set; then
16975   echo $ECHO_N "(cached) $ECHO_C" >&6
16976 else
16977
16978         rm -f conftest.a
16979         cat >conftest.$ac_ext <<EOF
16980 #line 16980 "configure"
16981 int     testdata[3] = { 123, 456, 789 };
16982 EOF
16983         if { (eval echo "$as_me:16983: \"$ac_compile\"") >&5
16984   (eval $ac_compile) 2>&5
16985   ac_status=$?
16986   echo "$as_me:16986: \$? = $ac_status" >&5
16987   (exit "$ac_status"); } ; then
16988                 mv conftest.o data.o && \
16989                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16990         fi
16991         rm -f conftest.$ac_ext data.o
16992         cat >conftest.$ac_ext <<EOF
16993 #line 16993 "configure"
16994 int     testfunc(void)
16995 {
16996 #if defined(NeXT)
16997         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16998 #else
16999         extern int testdata[3];
17000         return testdata[0] == 123
17001            &&  testdata[1] == 456
17002            &&  testdata[2] == 789;
17003 #endif
17004 }
17005 EOF
17006         if { (eval echo "$as_me:17006: \"$ac_compile\"") >&5
17007   (eval $ac_compile) 2>&5
17008   ac_status=$?
17009   echo "$as_me:17009: \$? = $ac_status" >&5
17010   (exit "$ac_status"); }; then
17011                 mv conftest.o func.o && \
17012                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
17013         fi
17014         rm -f conftest.$ac_ext func.o
17015         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
17016         cf_saveLIBS="$LIBS"
17017         LIBS="conftest.a $LIBS"
17018         if test "$cross_compiling" = yes; then
17019   cf_cv_link_dataonly=unknown
17020 else
17021   cat >"conftest.$ac_ext" <<_ACEOF
17022 #line 17022 "configure"
17023 #include "confdefs.h"
17024
17025         int main(void)
17026         {
17027                 extern int testfunc();
17028                 ${cf_cv_main_return:-return} (!testfunc());
17029         }
17030
17031 _ACEOF
17032 rm -f "conftest$ac_exeext"
17033 if { (eval echo "$as_me:17033: \"$ac_link\"") >&5
17034   (eval $ac_link) 2>&5
17035   ac_status=$?
17036   echo "$as_me:17036: \$? = $ac_status" >&5
17037   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17038   { (eval echo "$as_me:17038: \"$ac_try\"") >&5
17039   (eval $ac_try) 2>&5
17040   ac_status=$?
17041   echo "$as_me:17041: \$? = $ac_status" >&5
17042   (exit "$ac_status"); }; }; then
17043   cf_cv_link_dataonly=yes
17044 else
17045   echo "$as_me: program exited with status $ac_status" >&5
17046 echo "$as_me: failed program was:" >&5
17047 cat "conftest.$ac_ext" >&5
17048 cf_cv_link_dataonly=no
17049 fi
17050 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17051 fi
17052         LIBS="$cf_saveLIBS"
17053
17054 fi
17055
17056 echo "$as_me:17056: result: $cf_cv_link_dataonly" >&5
17057 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
17058
17059 if test "$cf_cv_link_dataonly" = no ; then
17060
17061 cat >>confdefs.h <<\EOF
17062 #define BROKEN_LINKER 1
17063 EOF
17064
17065         BROKEN_LINKER=1
17066 fi
17067
17068 ###     Checks for library functions.
17069
17070 for ac_header in \
17071 unistd.h \
17072
17073 do
17074 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17075 echo "$as_me:17075: checking for $ac_header" >&5
17076 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17077 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17078   echo $ECHO_N "(cached) $ECHO_C" >&6
17079 else
17080   cat >"conftest.$ac_ext" <<_ACEOF
17081 #line 17081 "configure"
17082 #include "confdefs.h"
17083 #include <$ac_header>
17084 _ACEOF
17085 if { (eval echo "$as_me:17085: \"$ac_cpp "conftest.$ac_ext"\"") >&5
17086   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
17087   ac_status=$?
17088   $EGREP -v '^ *\+' conftest.er1 >conftest.err
17089   rm -f conftest.er1
17090   cat conftest.err >&5
17091   echo "$as_me:17091: \$? = $ac_status" >&5
17092   (exit "$ac_status"); } >/dev/null; then
17093   if test -s conftest.err; then
17094     ac_cpp_err=$ac_c_preproc_warn_flag
17095   else
17096     ac_cpp_err=
17097   fi
17098 else
17099   ac_cpp_err=yes
17100 fi
17101 if test -z "$ac_cpp_err"; then
17102   eval "$as_ac_Header=yes"
17103 else
17104   echo "$as_me: failed program was:" >&5
17105   cat "conftest.$ac_ext" >&5
17106   eval "$as_ac_Header=no"
17107 fi
17108 rm -f conftest.err "conftest.$ac_ext"
17109 fi
17110 echo "$as_me:17110: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
17111 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
17112 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
17113   cat >>confdefs.h <<EOF
17114 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17115 EOF
17116
17117 fi
17118 done
17119
17120 echo "$as_me:17120: checking for working mkstemp" >&5
17121 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
17122 if test "${cf_cv_func_mkstemp+set}" = set; then
17123   echo $ECHO_N "(cached) $ECHO_C" >&6
17124 else
17125
17126 rm -rf ./conftest*
17127 if test "$cross_compiling" = yes; then
17128   cf_cv_func_mkstemp=maybe
17129 else
17130   cat >"conftest.$ac_ext" <<_ACEOF
17131 #line 17131 "configure"
17132 #include "confdefs.h"
17133
17134 #include <sys/types.h>
17135 #ifdef HAVE_UNISTD_H
17136 #include <unistd.h>
17137 #endif
17138 #include <stdlib.h>
17139 #include <stdio.h>
17140 #include <string.h>
17141 #include <sys/stat.h>
17142 int main(void)
17143 {
17144         char *tmpl = "conftestXXXXXX";
17145         char name[2][80];
17146         int n;
17147         int result = 0;
17148         int fd;
17149         struct stat sb;
17150
17151         umask(077);
17152         for (n = 0; n < 2; ++n) {
17153                 strcpy(name[n], tmpl);
17154                 if ((fd = mkstemp(name[n])) >= 0) {
17155                         if (!strcmp(name[n], tmpl)
17156                          || stat(name[n], &sb) != 0
17157                          || (sb.st_mode & S_IFMT) != S_IFREG
17158                          || (sb.st_mode & 077) != 0) {
17159                                 result = 1;
17160                         }
17161                         close(fd);
17162                 }
17163         }
17164         if (result == 0
17165          && !strcmp(name[0], name[1]))
17166                 result = 1;
17167         ${cf_cv_main_return:-return}(result);
17168 }
17169
17170 _ACEOF
17171 rm -f "conftest$ac_exeext"
17172 if { (eval echo "$as_me:17172: \"$ac_link\"") >&5
17173   (eval $ac_link) 2>&5
17174   ac_status=$?
17175   echo "$as_me:17175: \$? = $ac_status" >&5
17176   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
17177   { (eval echo "$as_me:17177: \"$ac_try\"") >&5
17178   (eval $ac_try) 2>&5
17179   ac_status=$?
17180   echo "$as_me:17180: \$? = $ac_status" >&5
17181   (exit "$ac_status"); }; }; then
17182   cf_cv_func_mkstemp=yes
17183
17184 else
17185   echo "$as_me: program exited with status $ac_status" >&5
17186 echo "$as_me: failed program was:" >&5
17187 cat "conftest.$ac_ext" >&5
17188 cf_cv_func_mkstemp=no
17189
17190 fi
17191 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
17192 fi
17193
17194 fi
17195 echo "$as_me:17195: result: $cf_cv_func_mkstemp" >&5
17196 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
17197 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
17198         echo "$as_me:17198: checking for mkstemp" >&5
17199 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
17200 if test "${ac_cv_func_mkstemp+set}" = set; then
17201   echo $ECHO_N "(cached) $ECHO_C" >&6
17202 else
17203   cat >"conftest.$ac_ext" <<_ACEOF
17204 #line 17204 "configure"
17205 #include "confdefs.h"
17206 #define mkstemp autoconf_temporary
17207 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17208 #undef mkstemp
17209
17210 #ifdef __cplusplus
17211 extern "C"
17212 #endif
17213
17214 /* We use char because int might match the return type of a gcc2
17215    builtin and then its argument prototype would still apply.  */
17216 char mkstemp (void);
17217
17218 int
17219 main (void)
17220 {
17221
17222 /* The GNU C library defines stubs for functions which it implements
17223     to always fail with ENOSYS.  Some functions are actually named
17224     something starting with __ and the normal name is an alias.  */
17225 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
17226 #error found stub for mkstemp
17227 #endif
17228
17229         return mkstemp ();
17230   ;
17231   return 0;
17232 }
17233 _ACEOF
17234 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
17235 if { (eval echo "$as_me:17235: \"$ac_link\"") >&5
17236   (eval $ac_link) 2>&5
17237   ac_status=$?
17238   echo "$as_me:17238: \$? = $ac_status" >&5
17239   (exit "$ac_status"); } &&
17240          { ac_try='test -s "conftest$ac_exeext"'
17241   { (eval echo "$as_me:17241: \"$ac_try\"") >&5
17242   (eval $ac_try) 2>&5
17243   ac_status=$?
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit "$ac_status"); }; }; then
17246   ac_cv_func_mkstemp=yes
17247 else
17248   echo "$as_me: failed program was:" >&5
17249 cat "conftest.$ac_ext" >&5
17250 ac_cv_func_mkstemp=no
17251 fi
17252 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
17253 fi
17254 echo "$as_me:17254: result: $ac_cv_func_mkstemp" >&5
17255 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
17256
17257 fi
17258 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
17259
17260 cat >>confdefs.h <<\EOF
17261 #define HAVE_MKSTEMP 1
17262 EOF
17263
17264 fi
17265
17266 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
17267         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17268         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
17269 fi
17270
17271 cf_with_ada=yes
17272 if test "$cf_with_ada" != "no" ; then
17273
17274 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
17275 do
17276
17277 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17278
17279         unset ac_cv_path_cf_TEMP_gnat
17280         unset cf_TEMP_gnat
17281         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
17282 set dummy $cf_prog_gnat; ac_word=$2
17283 echo "$as_me:17283: checking for $ac_word" >&5
17284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17285 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
17286   echo $ECHO_N "(cached) $ECHO_C" >&6
17287 else
17288   case $cf_TEMP_gnat in
17289   [\\/]* | ?:[\\/]*)
17290   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
17291   ;;
17292   *)
17293   ac_save_IFS=$IFS; IFS=$ac_path_separator
17294 ac_dummy="$PATH"
17295 for ac_dir in $ac_dummy; do
17296   IFS=$ac_save_IFS
17297   test -z "$ac_dir" && ac_dir=.
17298   if $as_executable_p "$ac_dir/$ac_word"; then
17299    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
17300    echo "$as_me:17300: found $ac_dir/$ac_word" >&5
17301    break
17302 fi
17303 done
17304
17305   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
17306   ;;
17307 esac
17308 fi
17309 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
17310
17311 if test -n "$cf_TEMP_gnat"; then
17312   echo "$as_me:17312: result: $cf_TEMP_gnat" >&5
17313 echo "${ECHO_T}$cf_TEMP_gnat" >&6
17314 else
17315   echo "$as_me:17315: result: no" >&5
17316 echo "${ECHO_T}no" >&6
17317 fi
17318
17319         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
17320
17321         if test "x$cf_TEMP_gnat" != xno; then
17322                 unset cf_cv_gnat_version
17323                 unset cf_TEMP_gnat
17324
17325 echo "$as_me:17325: checking for $cf_prog_gnat version" >&5
17326 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
17327 if test "${cf_cv_gnat_version+set}" = set; then
17328   echo $ECHO_N "(cached) $ECHO_C" >&6
17329 else
17330
17331 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
17332         grep '[0-9].[0-9][0-9]*' |\
17333         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17334
17335 fi
17336 echo "$as_me:17336: result: $cf_cv_gnat_version" >&5
17337 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17338 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17339 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
17340
17341         fi
17342         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
17343
17344         unset cf_TEMP_gnat
17345         unset cf_cv_gnat_version
17346         unset ac_cv_path_cf_TEMP_gnat
17347 done
17348
17349 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
17350         cf_ada_make=
17351         cf_cv_prog_gnat_correct=no
17352 else
17353         cf_ada_make=gnatmake
17354         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
17355                 # gprconfig is newer than gnatmake; we can continue...
17356                 cf_ada_config="##"
17357         else
17358                 rm -rf ./conftest* ./*~conftest*
17359                 if mkdir conftest.src
17360                 then
17361                         cf_ada_config=""
17362                         cd conftest.src
17363                         for cf_gprconfig in Ada C
17364                         do
17365                                 echo "$as_me:17365: checking for gprconfig name for $cf_gprconfig" >&5
17366 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
17367                                 if test "$cf_gprconfig" = C
17368                                 then
17369                                         for cf_gprconfig_param in \
17370                                                 "$cf_gprconfig,,,,GNATGCC" \
17371                                                 "$cf_gprconfig,,,,GCC" \
17372                                                 "$cf_gprconfig"
17373                                         do
17374                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17375                                                 test -n "$cf_gprconfig_value" && break
17376                                         done
17377                                 else
17378                                         cf_gprconfig_param=$cf_gprconfig
17379                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
17380                                 fi
17381                                 if test -n "$cf_gprconfig_value"
17382                                 then
17383                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
17384                                         echo "$as_me:17384: result: $cf_gprconfig_value" >&5
17385 echo "${ECHO_T}$cf_gprconfig_value" >&6
17386                                 else
17387                                         echo "$as_me:17387: result: missing" >&5
17388 echo "${ECHO_T}missing" >&6
17389                                         cf_ada_config="#"
17390                                         break
17391                                 fi
17392                         done
17393                         cd ..
17394                         rm -rf ./conftest* ./*~conftest*
17395                 fi
17396         fi
17397         if test "x$cf_ada_config" != "x#"
17398         then
17399
17400 echo "$as_me:17400: checking for gnat version" >&5
17401 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17402 if test "${cf_cv_gnat_version+set}" = set; then
17403   echo $ECHO_N "(cached) $ECHO_C" >&6
17404 else
17405
17406 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17407         grep '[0-9].[0-9][0-9]*' |\
17408         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17409
17410 fi
17411 echo "$as_me:17411: result: $cf_cv_gnat_version" >&5
17412 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17413 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17414
17415 case "$cf_cv_gnat_version" in
17416 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17417         cf_cv_prog_gnat_correct=yes
17418         ;;
17419 (*)
17420         { echo "$as_me:17420: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17421 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17422         cf_cv_prog_gnat_correct=no
17423         ;;
17424 esac
17425
17426                 # Extract the first word of "m4", so it can be a program name with args.
17427 set dummy m4; ac_word=$2
17428 echo "$as_me:17428: checking for $ac_word" >&5
17429 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17430 if test "${ac_cv_prog_M4_exists+set}" = set; then
17431   echo $ECHO_N "(cached) $ECHO_C" >&6
17432 else
17433   if test -n "$M4_exists"; then
17434   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17435 else
17436   ac_save_IFS=$IFS; IFS=$ac_path_separator
17437 ac_dummy="$PATH"
17438 for ac_dir in $ac_dummy; do
17439   IFS=$ac_save_IFS
17440   test -z "$ac_dir" && ac_dir=.
17441   $as_executable_p "$ac_dir/$ac_word" || continue
17442 ac_cv_prog_M4_exists="yes"
17443 echo "$as_me:17443: found $ac_dir/$ac_word" >&5
17444 break
17445 done
17446
17447   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17448 fi
17449 fi
17450 M4_exists=$ac_cv_prog_M4_exists
17451 if test -n "$M4_exists"; then
17452   echo "$as_me:17452: result: $M4_exists" >&5
17453 echo "${ECHO_T}$M4_exists" >&6
17454 else
17455   echo "$as_me:17455: result: no" >&5
17456 echo "${ECHO_T}no" >&6
17457 fi
17458
17459                 if test "$ac_cv_prog_M4_exists" = no; then
17460                         cf_cv_prog_gnat_correct=no
17461                         { echo "$as_me:17461: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17462 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17463                 fi
17464                 if test "$cf_cv_prog_gnat_correct" = yes; then
17465                         echo "$as_me:17465: checking if GNAT works" >&5
17466 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17467
17468 rm -rf ./conftest* ./*~conftest*
17469 cat >>conftest.ads <<CF_EOF
17470 procedure conftest;
17471 CF_EOF
17472 cat >>conftest.adb <<CF_EOF
17473 with Text_IO;
17474 with GNAT.OS_Lib;
17475 procedure conftest is
17476 begin
17477    Text_IO.Put ("Hello World");
17478    Text_IO.New_Line;
17479    GNAT.OS_Lib.OS_Exit (0);
17480 end conftest;
17481 CF_EOF
17482 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17483    if ( ./conftest 1>&5 2>&1 ) ; then
17484       cf_cv_prog_gnat_correct=yes
17485    else
17486       cf_cv_prog_gnat_correct=no
17487    fi
17488 else
17489    cf_cv_prog_gnat_correct=no
17490 fi
17491 rm -rf ./conftest* ./*~conftest*
17492
17493                         echo "$as_me:17493: result: $cf_cv_prog_gnat_correct" >&5
17494 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17495                 fi
17496         else
17497                 cf_cv_prog_gnat_correct=no
17498         fi
17499 fi
17500
17501         if test "$cf_cv_prog_gnat_correct" = yes; then
17502
17503         echo "$as_me:17503: checking optimization options for ADAFLAGS" >&5
17504 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17505         case "$CFLAGS" in
17506         (*-g*)
17507
17508         ADAFLAGS="$ADAFLAGS -g"
17509
17510                 ;;
17511         esac
17512         case "$CFLAGS" in
17513         (*-O*)
17514                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17515
17516         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17517
17518                 ;;
17519         esac
17520         echo "$as_me:17520: result: $ADAFLAGS" >&5
17521 echo "${ECHO_T}$ADAFLAGS" >&6
17522
17523 echo "$as_me:17523: checking if GNATPREP supports -T option" >&5
17524 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17525 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17526   echo $ECHO_N "(cached) $ECHO_C" >&6
17527 else
17528
17529 cf_cv_gnatprep_opt_t=no
17530 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17531
17532 fi
17533 echo "$as_me:17533: result: $cf_cv_gnatprep_opt_t" >&5
17534 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17535 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17536
17537 echo "$as_me:17537: checking if GNAT supports generics" >&5
17538 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17539 case "$cf_cv_gnat_version" in
17540 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17541         cf_gnat_generics=yes
17542         ;;
17543 (*)
17544         cf_gnat_generics=no
17545         ;;
17546 esac
17547 echo "$as_me:17547: result: $cf_gnat_generics" >&5
17548 echo "${ECHO_T}$cf_gnat_generics" >&6
17549
17550 if test "$cf_gnat_generics" = yes
17551 then
17552         cf_compile_generics=generics
17553         cf_generic_objects="\${GENOBJS}"
17554 else
17555         cf_compile_generics=
17556         cf_generic_objects=
17557 fi
17558
17559 echo "$as_me:17559: checking if GNAT supports SIGINT" >&5
17560 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17561 if test "${cf_cv_gnat_sigint+set}" = set; then
17562   echo $ECHO_N "(cached) $ECHO_C" >&6
17563 else
17564
17565 rm -rf ./conftest* ./*~conftest*
17566 cat >>conftest.ads <<CF_EOF
17567 with Ada.Interrupts.Names;
17568
17569 package ConfTest is
17570
17571    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17572    pragma Unreserve_All_Interrupts;
17573    pragma Warnings (On);
17574
17575    protected Process is
17576       procedure Stop;
17577       function Continue return Boolean;
17578       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17579    private
17580       Done : Boolean := False;
17581    end Process;
17582
17583 end ConfTest;
17584 CF_EOF
17585 cat >>conftest.adb <<CF_EOF
17586 package body ConfTest is
17587    protected body Process is
17588       procedure Stop is
17589       begin
17590          Done := True;
17591       end Stop;
17592       function Continue return Boolean is
17593       begin
17594          return not Done;
17595       end Continue;
17596    end Process;
17597 end ConfTest;
17598 CF_EOF
17599 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17600       cf_cv_gnat_sigint=yes
17601 else
17602    cf_cv_gnat_sigint=no
17603 fi
17604 rm -rf ./conftest* ./*~conftest*
17605
17606 fi
17607 echo "$as_me:17607: result: $cf_cv_gnat_sigint" >&5
17608 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17609
17610 if test "$cf_cv_gnat_sigint" = yes ; then
17611         USE_GNAT_SIGINT=""
17612 else
17613         USE_GNAT_SIGINT="#"
17614 fi
17615
17616 cf_gnat_libraries=no
17617 cf_gnat_projects=no
17618
17619 if test "$enable_gnat_projects" != no ; then
17620 echo "$as_me:17620: checking if GNAT supports project files" >&5
17621 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17622 case "$cf_cv_gnat_version" in
17623 (3.[0-9]*)
17624         ;;
17625 (*)
17626         case "$cf_cv_system_name" in
17627         (cygwin*|msys*)
17628                 ;;
17629         (*)
17630                 rm -rf ./conftest* ./*~conftest*
17631                 if mkdir conftest.src conftest.bin conftest.lib
17632                 then
17633                         cd conftest.src
17634                         rm -rf ./conftest* ./*~conftest*
17635                         cat >>library.gpr <<CF_EOF
17636 project Library is
17637   Kind := External ("LIB_KIND");
17638   for Library_Name use "ConfTest";
17639   for Object_Dir use ".";
17640   for Library_ALI_Dir use External("LIBRARY_DIR");
17641   for Library_Version use External ("SONAME");
17642   for Library_Kind use Kind;
17643   for Library_Dir use External("BUILD_DIR");
17644   Source_Dir := External ("SOURCE_DIR");
17645   for Source_Dirs use (Source_Dir);
17646 end Library;
17647 CF_EOF
17648                         cat >>confpackage.ads <<CF_EOF
17649 package ConfPackage is
17650    procedure conftest;
17651 end ConfPackage;
17652 CF_EOF
17653                         cat >>confpackage.adb <<CF_EOF
17654 with Text_IO;
17655 package body ConfPackage is
17656    procedure conftest is
17657    begin
17658       Text_IO.Put ("Hello World");
17659       Text_IO.New_Line;
17660    end conftest;
17661 end ConfPackage;
17662 CF_EOF
17663                         if ( "$cf_ada_make" $ADAFLAGS \
17664                                         -Plibrary.gpr \
17665                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17666                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17667                                         -XSOURCE_DIR="`pwd`" \
17668                                         -XSONAME=libConfTest.so.1 \
17669                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17670                                 cf_gnat_projects=yes
17671                         fi
17672                         cd ..
17673                 fi
17674                 if test -f conftest.lib/confpackage.ali
17675                 then
17676                         cf_gnat_libraries=yes
17677                 fi
17678                 rm -rf ./conftest* ./*~conftest*
17679                 ;;
17680         esac
17681         ;;
17682 esac
17683 echo "$as_me:17683: result: $cf_gnat_projects" >&5
17684 echo "${ECHO_T}$cf_gnat_projects" >&6
17685 fi # enable_gnat_projects
17686
17687 if test "$cf_gnat_projects" = yes
17688 then
17689         echo "$as_me:17689: checking if GNAT supports libraries" >&5
17690 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17691         echo "$as_me:17691: result: $cf_gnat_libraries" >&5
17692 echo "${ECHO_T}$cf_gnat_libraries" >&6
17693 fi
17694
17695 USE_OLD_MAKERULES=""
17696 USE_GNAT_PROJECTS="#"
17697 USE_GNAT_MAKE_GPR="#"
17698 USE_GNAT_GPRBUILD="#"
17699
17700 if test "$cf_gnat_projects" = yes
17701 then
17702         USE_OLD_MAKERULES="#"
17703         USE_GNAT_PROJECTS=""
17704         if test "$cf_cv_VERSION_GPRBUILD" != no
17705         then
17706                 USE_GNAT_GPRBUILD=""
17707         elif test "$cf_cv_VERSION_GNATMAKE" != no
17708         then
17709                 USE_GNAT_MAKE_GPR=""
17710         else
17711                 { echo "$as_me:17711: WARNING: use old makefile rules since tools are missing" >&5
17712 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17713         fi
17714 fi
17715
17716 if test "$cf_gnat_libraries" = yes
17717 then
17718         USE_GNAT_LIBRARIES=""
17719 else
17720         USE_GNAT_LIBRARIES="#"
17721 fi
17722
17723 echo "$as_me:17723: checking for ada-compiler" >&5
17724 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17725
17726 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17727 if test "${with_ada_compiler+set}" = set; then
17728   withval="$with_ada_compiler"
17729   cf_ada_compiler=$withval
17730 else
17731   cf_ada_compiler=gnatmake
17732 fi;
17733
17734 echo "$as_me:17734: result: $cf_ada_compiler" >&5
17735 echo "${ECHO_T}$cf_ada_compiler" >&6
17736
17737                 cf_ada_package=terminal_interface
17738
17739 echo "$as_me:17739: checking for ada-include" >&5
17740 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17741
17742 # Check whether --with-ada-include or --without-ada-include was given.
17743 if test "${with_ada_include+set}" = set; then
17744   withval="$with_ada_include"
17745
17746 else
17747   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17748 fi; if test -n "$prefix/share/ada/adainclude" ; then
17749
17750 if test "x$prefix" != xNONE; then
17751         cf_path_syntax="$prefix"
17752 else
17753         cf_path_syntax="$ac_default_prefix"
17754 fi
17755
17756 case ".$withval" in
17757 (.\$\(*\)*|.\'*\'*)
17758         ;;
17759 (..|./*|.\\*)
17760         ;;
17761 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17762         ;;
17763 (.\$\{*prefix\}*|.\$\{*dir\}*)
17764         eval withval="$withval"
17765         case ".$withval" in
17766         (.NONE/*)
17767                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17768                 ;;
17769         esac
17770         ;;
17771 (.no|.NONE/*)
17772         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17773         ;;
17774 (*)
17775         { { echo "$as_me:17775: error: expected a pathname, not \"$withval\"" >&5
17776 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17777    { (exit 1); exit 1; }; }
17778         ;;
17779 esac
17780
17781 fi
17782 eval ADA_INCLUDE="$withval"
17783
17784 echo "$as_me:17784: result: $ADA_INCLUDE" >&5
17785 echo "${ECHO_T}$ADA_INCLUDE" >&6
17786
17787 echo "$as_me:17787: checking for ada-objects" >&5
17788 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17789
17790 # Check whether --with-ada-objects or --without-ada-objects was given.
17791 if test "${with_ada_objects+set}" = set; then
17792   withval="$with_ada_objects"
17793
17794 else
17795   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17796 fi; if test -n "$prefix/lib/ada/adalib" ; then
17797
17798 if test "x$prefix" != xNONE; then
17799         cf_path_syntax="$prefix"
17800 else
17801         cf_path_syntax="$ac_default_prefix"
17802 fi
17803
17804 case ".$withval" in
17805 (.\$\(*\)*|.\'*\'*)
17806         ;;
17807 (..|./*|.\\*)
17808         ;;
17809 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17810         ;;
17811 (.\$\{*prefix\}*|.\$\{*dir\}*)
17812         eval withval="$withval"
17813         case ".$withval" in
17814         (.NONE/*)
17815                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17816                 ;;
17817         esac
17818         ;;
17819 (.no|.NONE/*)
17820         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17821         ;;
17822 (*)
17823         { { echo "$as_me:17823: error: expected a pathname, not \"$withval\"" >&5
17824 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17825    { (exit 1); exit 1; }; }
17826         ;;
17827 esac
17828
17829 fi
17830 eval ADA_OBJECTS="$withval"
17831
17832 echo "$as_me:17832: result: $ADA_OBJECTS" >&5
17833 echo "${ECHO_T}$ADA_OBJECTS" >&6
17834
17835 echo "$as_me:17835: checking if an Ada95 shared-library should be built" >&5
17836 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17837
17838 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17839 if test "${with_ada_sharedlib+set}" = set; then
17840   withval="$with_ada_sharedlib"
17841   with_ada_sharedlib=$withval
17842 else
17843   with_ada_sharedlib=no
17844 fi;
17845 echo "$as_me:17845: result: $with_ada_sharedlib" >&5
17846 echo "${ECHO_T}$with_ada_sharedlib" >&6
17847
17848 if test "x$with_ada_sharedlib" != xno
17849 then
17850         if test "x$cf_gnat_projects" != xyes
17851         then
17852                 { echo "$as_me:17852: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17853 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17854                 with_ada_sharedlib=no
17855         fi
17856 fi
17857
17858 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17859 MAKE_ADA_SHAREDLIB="#"
17860
17861 if test "x$with_ada_sharedlib" != xno
17862 then
17863         MAKE_ADA_SHAREDLIB=
17864         if test "x$with_ada_sharedlib" != xyes
17865         then
17866                 ADA_SHAREDLIB="$with_ada_sharedlib"
17867         fi
17868 fi
17869
17870                 # allow the Ada binding to be renamed
17871
17872 echo "$as_me:17872: checking for ada-libname" >&5
17873 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17874
17875 # Check whether --with-ada-libname or --without-ada-libname was given.
17876 if test "${with_ada_libname+set}" = set; then
17877   withval="$with_ada_libname"
17878   ADA_LIBNAME=$withval
17879 else
17880   ADA_LIBNAME=AdaCurses
17881 fi;
17882 case "x$ADA_LIBNAME" in
17883 (x|xyes|xno)
17884         ADA_LIBNAME=AdaCurses
17885         ;;
17886 esac
17887
17888 echo "$as_me:17888: result: $ADA_LIBNAME" >&5
17889 echo "${ECHO_T}$ADA_LIBNAME" >&6
17890
17891         else
17892                 { { echo "$as_me:17892: error: No usable Ada compiler found" >&5
17893 echo "$as_me: error: No usable Ada compiler found" >&2;}
17894    { (exit 1); exit 1; }; }
17895         fi
17896 else
17897         { { echo "$as_me:17897: error: The Ada compiler is needed for this package" >&5
17898 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17899    { (exit 1); exit 1; }; }
17900 fi
17901
17902 ################################################################################
17903
17904 # not needed
17905 TINFO_LDFLAGS2=
17906
17907 TINFO_LIBS=
17908
17909 ### Construct the list of include-directories to be generated
17910
17911 if test "$srcdir" != "."; then
17912         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17913 fi
17914 CPPFLAGS="-I../include $CPPFLAGS"
17915 if test "$srcdir" != "."; then
17916         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17917 fi
17918 CPPFLAGS="-I. $CPPFLAGS"
17919
17920 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17921 if test "$srcdir" != "."; then
17922         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17923 fi
17924 if test "$GCC" != yes; then
17925         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17926 elif test "$includedir" != "/usr/include"; then
17927         if test "$includedir" = '${prefix}/include' ; then
17928                 if test x$prefix != x/usr ; then
17929                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17930                 fi
17931         else
17932                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17933         fi
17934 fi
17935
17936 ### Build up pieces for makefile rules
17937 echo "$as_me:17937: checking default library suffix" >&5
17938 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17939
17940         case $DFT_LWR_MODEL in
17941         (libtool) DFT_ARG_SUFFIX=''   ;;
17942         (normal)  DFT_ARG_SUFFIX=''   ;;
17943         (debug)   DFT_ARG_SUFFIX='_g' ;;
17944         (profile) DFT_ARG_SUFFIX='_p' ;;
17945         (shared)  DFT_ARG_SUFFIX=''   ;;
17946         esac
17947         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17948 echo "$as_me:17948: result: $DFT_ARG_SUFFIX" >&5
17949 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17950
17951 echo "$as_me:17951: checking default library-dependency suffix" >&5
17952 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17953
17954         case X$DFT_LWR_MODEL in
17955         (Xlibtool)
17956                 DFT_LIB_SUFFIX='.la'
17957                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17958                 ;;
17959         (Xdebug)
17960                 case "$cf_cv_system_name" in
17961                 (*-msvc*)
17962                         DFT_LIB_SUFFIX='_g.lib'
17963                         ;;
17964                 (*)
17965                         DFT_LIB_SUFFIX='_g.a'
17966                         ;;
17967                 esac
17968                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17969                 ;;
17970         (Xprofile)
17971                 case "$cf_cv_system_name" in
17972                 (*-msvc*)
17973                         DFT_LIB_SUFFIX='_p.lib'
17974                         ;;
17975                 (*)
17976                         DFT_LIB_SUFFIX='_p.a'
17977                         ;;
17978                 esac
17979                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17980                 ;;
17981         (Xshared)
17982                 case "$cf_cv_system_name" in
17983                 (aix[5-7]*)
17984                         DFT_LIB_SUFFIX='.so'
17985                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17986                         ;;
17987                 (*-msvc*)
17988                         DFT_LIB_SUFFIX='.dll'
17989                         DFT_DEP_SUFFIX='.dll.lib'
17990                         ;;
17991                 (cygwin*|msys*|mingw*)
17992                         DFT_LIB_SUFFIX='.dll'
17993                         DFT_DEP_SUFFIX='.dll.a'
17994                         ;;
17995                 (darwin*)
17996                         DFT_LIB_SUFFIX='.dylib'
17997                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17998                         ;;
17999                 (hpux*)
18000                         case "$target" in
18001                         (ia64*)
18002                                 DFT_LIB_SUFFIX='.so'
18003                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18004                                 ;;
18005                         (*)
18006                                 DFT_LIB_SUFFIX='.sl'
18007                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18008                                 ;;
18009                         esac
18010                         ;;
18011                 (*)
18012                         DFT_LIB_SUFFIX='.so'
18013                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18014                         ;;
18015                 esac
18016                 ;;
18017         (*)
18018                 case "$target" in
18019                 (*-msvc*)
18020                         DFT_LIB_SUFFIX='.lib'
18021                         ;;
18022                 (*)
18023                         DFT_LIB_SUFFIX='.a'
18024                         ;;
18025                 esac
18026                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
18027                 ;;
18028         esac
18029         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
18030         then
18031                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
18032                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
18033         fi
18034 echo "$as_me:18034: result: $DFT_DEP_SUFFIX" >&5
18035 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
18036
18037 echo "$as_me:18037: checking default object directory" >&5
18038 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
18039
18040         case $DFT_LWR_MODEL in
18041         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
18042         (normal)  DFT_OBJ_SUBDIR='objects' ;;
18043         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
18044         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
18045         (shared)
18046                 case "$cf_cv_system_name" in
18047                 (cygwin|msys)
18048                         DFT_OBJ_SUBDIR='objects' ;;
18049                 (*)
18050                         DFT_OBJ_SUBDIR='obj_s' ;;
18051                 esac
18052         esac
18053 echo "$as_me:18053: result: $DFT_OBJ_SUBDIR" >&5
18054 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
18055
18056 ### Set up low-level terminfo dependencies for makefiles.
18057
18058 if test "$DFT_LWR_MODEL" = shared ; then
18059         case $cf_cv_system_name in
18060         (cygwin*)
18061                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
18062                 ;;
18063         (msys*)
18064                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
18065                 ;;
18066         esac
18067 fi
18068
18069 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
18070
18071 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
18072
18073 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
18074
18075 ### Construct the list of subdirectories for which we'll customize makefiles
18076 ### with the appropriate compile-rules.
18077
18078 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
18079
18080 cat >>confdefs.h <<EOF
18081 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
18082 EOF
18083
18084 ################################################################################
18085
18086 TEST_ARG2=
18087
18088 TEST_LIBS2=
18089
18090 NCURSES_SHLIB2="sh -c"
18091
18092 ADA_SUBDIRS="include gen src doc"
18093 if test "x$cf_with_tests" != "xno" ; then
18094         ADA_SUBDIRS="$ADA_SUBDIRS samples"
18095 fi
18096 for cf_dir in $ADA_SUBDIRS
18097 do
18098         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
18099 done
18100
18101 NCURSES_TREE="#"
18102
18103 EXTERNAL_TREE=
18104
18105 # match layout used by make-tar.sh
18106 ADAHTML_DIR=../doc/ada
18107
18108 if test "x$cross_compiling" = xyes ; then
18109         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
18110 else
18111         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
18112 fi
18113
18114 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"
18115 ac_config_commands="$ac_config_commands default"
18116 cat >confcache <<\_ACEOF
18117 # This file is a shell script that caches the results of configure
18118 # tests run on this system so they can be shared between configure
18119 # scripts and configure runs, see configure's option --config-cache.
18120 # It is not useful on other systems.  If it contains results you don't
18121 # want to keep, you may remove or edit it.
18122 #
18123 # config.status only pays attention to the cache file if you give it
18124 # the --recheck option to rerun configure.
18125 #
18126 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18127 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18128 # following values.
18129
18130 _ACEOF
18131
18132 # The following way of writing the cache mishandles newlines in values,
18133 # but we know of no workaround that is simple, portable, and efficient.
18134 # So, don't put newlines in cache variables' values.
18135 # Ultrix sh set writes to stderr and can't be redirected directly,
18136 # and sets the high bit in the cache file unless we assign to the vars.
18137 {
18138   (set) 2>&1 |
18139     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18140     *ac_space=\ *)
18141       # `set' does not quote correctly, so add quotes (double-quote
18142       # substitution turns \\\\ into \\, and sed turns \\ into \).
18143       sed -n \
18144         "s/'/'\\\\''/g;
18145           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18146       ;;
18147     *)
18148       # `set' quotes correctly as required by POSIX, so do not add quotes.
18149       sed -n \
18150         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18151       ;;
18152     esac;
18153 } |
18154   sed '
18155      t clear
18156      : clear
18157      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18158      t end
18159      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18160      : end' >>confcache
18161 if cmp -s $cache_file confcache; then :; else
18162   if test -w $cache_file; then
18163     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18164     cat confcache >$cache_file
18165   else
18166     echo "not updating unwritable cache $cache_file"
18167   fi
18168 fi
18169 rm -f confcache
18170
18171 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18172 # Let make expand exec_prefix.
18173 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18174
18175 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18176 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18177 # trailing colons and then remove the whole line if VPATH becomes empty
18178 # (actually we leave an empty line to preserve line numbers).
18179 if test "x$srcdir" = x.; then
18180   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18181 s/:*\$(srcdir):*/:/;
18182 s/:*\${srcdir}:*/:/;
18183 s/:*@srcdir@:*/:/;
18184 s/^\([^=]*=[    ]*\):*/\1/;
18185 s/:*$//;
18186 s/^[^=]*=[      ]*$//;
18187 }'
18188 fi
18189
18190 DEFS=-DHAVE_CONFIG_H
18191
18192 : "${CONFIG_STATUS=./config.status}"
18193 ac_clean_files_save=$ac_clean_files
18194 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18195 { echo "$as_me:18195: creating $CONFIG_STATUS" >&5
18196 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18197 cat >"$CONFIG_STATUS" <<_ACEOF
18198 #! $SHELL
18199 # Generated automatically by configure.
18200 # Run this file to recreate the current configuration.
18201 # Compiler output produced by configure, useful for debugging
18202 # configure, is in config.log if it exists.
18203
18204 debug=false
18205 SHELL=\${CONFIG_SHELL-$SHELL}
18206 ac_cs_invocation="\$0 \$@"
18207
18208 CLICOLOR_FORCE= GREP_OPTIONS=
18209 unset CLICOLOR_FORCE GREP_OPTIONS
18210 _ACEOF
18211
18212 cat >>"$CONFIG_STATUS" <<\_ACEOF
18213 # Be Bourne compatible
18214 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18215   emulate sh
18216   NULLCMD=:
18217 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18218   set -o posix
18219 fi
18220
18221 # Name of the executable.
18222 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18223
18224 if expr a : '\(a\)' >/dev/null 2>&1; then
18225   as_expr=expr
18226 else
18227   as_expr=false
18228 fi
18229
18230 rm -f conf$$ conf$$.exe conf$$.file
18231 echo >conf$$.file
18232 if ln -s conf$$.file conf$$ 2>/dev/null; then
18233   # We could just check for DJGPP; but this test a) works b) is more generic
18234   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18235   if test -f conf$$.exe; then
18236     # Don't use ln at all; we don't have any links
18237     as_ln_s='cp -p'
18238   else
18239     as_ln_s='ln -s'
18240   fi
18241 elif ln conf$$.file conf$$ 2>/dev/null; then
18242   as_ln_s=ln
18243 else
18244   as_ln_s='cp -p'
18245 fi
18246 rm -f conf$$ conf$$.exe conf$$.file
18247
18248 as_executable_p="test -f"
18249
18250 # Support unset when possible.
18251 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18252   as_unset="unset"
18253 else
18254   as_unset="false"
18255 fi
18256
18257 # NLS nuisances.
18258 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18259 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18260 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18261 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18262 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18263 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18264 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18265 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18266
18267 # IFS
18268 # We need space, tab and new line, in precisely that order.
18269 as_nl='
18270 '
18271 IFS="   $as_nl"
18272
18273 # CDPATH.
18274 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18275
18276 exec 6>&1
18277
18278 _ACEOF
18279
18280 # Files that config.status was made for.
18281 if test -n "$ac_config_files"; then
18282   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
18283 fi
18284
18285 if test -n "$ac_config_headers"; then
18286   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
18287 fi
18288
18289 if test -n "$ac_config_links"; then
18290   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
18291 fi
18292
18293 if test -n "$ac_config_commands"; then
18294   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
18295 fi
18296
18297 cat >>"$CONFIG_STATUS" <<\EOF
18298
18299 ac_cs_usage="\
18300 \`$as_me' instantiates files from templates according to the
18301 current configuration.
18302
18303 Usage: $0 [OPTIONS] [FILE]...
18304
18305   -h, --help       print this help, then exit
18306   -V, --version    print version number, then exit
18307   -d, --debug      don't remove temporary files
18308       --recheck    update $as_me by reconfiguring in the same conditions
18309   --file=FILE[:TEMPLATE]
18310                    instantiate the configuration file FILE
18311   --header=FILE[:TEMPLATE]
18312                    instantiate the configuration header FILE
18313
18314 Configuration files:
18315 $config_files
18316
18317 Configuration headers:
18318 $config_headers
18319
18320 Configuration commands:
18321 $config_commands
18322
18323 Report bugs to <dickey@invisible-island.net>."
18324 EOF
18325
18326 cat >>"$CONFIG_STATUS" <<EOF
18327 ac_cs_version="\\
18328 config.status
18329 configured by $0, generated by GNU Autoconf 2.52.20210509,
18330   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18331
18332 Copyright 2003-2020,2021        Thomas E. Dickey
18333 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18334 Free Software Foundation, Inc.
18335 This config.status script is free software; the Free Software Foundation
18336 gives unlimited permission to copy, distribute and modify it."
18337 srcdir="$srcdir"
18338 INSTALL="$INSTALL"
18339 EOF
18340
18341 cat >>"$CONFIG_STATUS" <<\EOF
18342 # If no file are specified by the user, then we need to provide default
18343 # value.  By we need to know if files were specified by the user.
18344 ac_need_defaults=:
18345 while test $# != 0
18346 do
18347   case $1 in
18348   --*=*)
18349     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18350     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18351     shift
18352     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18353     shift
18354     ;;
18355   -*);;
18356   *) # This is not an option, so the user has probably given explicit
18357      # arguments.
18358      ac_need_defaults=false;;
18359   esac
18360
18361   case $1 in
18362   # Handling of the options.
18363 EOF
18364 cat >>"$CONFIG_STATUS" <<EOF
18365   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18366     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18367     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18368 EOF
18369 cat >>"$CONFIG_STATUS" <<\EOF
18370   --version | --vers* | -V )
18371     echo "$ac_cs_version"; exit 0 ;;
18372   --he | --h)
18373     # Conflict between --help and --header
18374     { { echo "$as_me:18374: error: ambiguous option: $1
18375 Try \`$0 --help' for more information." >&5
18376 echo "$as_me: error: ambiguous option: $1
18377 Try \`$0 --help' for more information." >&2;}
18378    { (exit 1); exit 1; }; };;
18379   --help | --hel | -h )
18380     echo "$ac_cs_usage"; exit 0 ;;
18381   --debug | --d* | -d )
18382     debug=: ;;
18383   --file | --fil | --fi | --f )
18384     shift
18385     CONFIG_FILES="$CONFIG_FILES $1"
18386     ac_need_defaults=false;;
18387   --header | --heade | --head | --hea )
18388     shift
18389     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18390     ac_need_defaults=false;;
18391
18392   # This is an error.
18393   -*) { { echo "$as_me:18393: error: unrecognized option: $1
18394 Try \`$0 --help' for more information." >&5
18395 echo "$as_me: error: unrecognized option: $1
18396 Try \`$0 --help' for more information." >&2;}
18397    { (exit 1); exit 1; }; } ;;
18398
18399   *) ac_config_targets="$ac_config_targets $1" ;;
18400
18401   esac
18402   shift
18403 done
18404
18405 exec 5>>config.log
18406 cat >&5 << _ACEOF
18407
18408 ## ----------------------- ##
18409 ## Running config.status.  ##
18410 ## ----------------------- ##
18411
18412 This file was extended by $as_me 2.52.20210509, executed with
18413   CONFIG_FILES    = $CONFIG_FILES
18414   CONFIG_HEADERS  = $CONFIG_HEADERS
18415   CONFIG_LINKS    = $CONFIG_LINKS
18416   CONFIG_COMMANDS = $CONFIG_COMMANDS
18417   > "$ac_cs_invocation"
18418 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18419
18420 _ACEOF
18421 EOF
18422
18423 cat >>"$CONFIG_STATUS" <<EOF
18424 #
18425 # INIT-COMMANDS section.
18426 #
18427
18428 ### Special initialization commands, used to pass information from the
18429 ### configuration-run into config.status
18430
18431 AWK="$AWK"
18432 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18433 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18434 LIB_NAME="$LIB_NAME"
18435 LIB_PREFIX="$LIB_PREFIX"
18436 LIB_SUFFIX="$LIB_SUFFIX"
18437 LN_S="$LN_S"
18438 NCURSES_MAJOR="$NCURSES_MAJOR"
18439 NCURSES_MINOR="$NCURSES_MINOR"
18440 NCURSES_PATCH="$NCURSES_PATCH"
18441 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18442 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18443 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18444 cf_cv_abi_version="$cf_cv_abi_version"
18445 cf_cv_rel_version="$cf_cv_rel_version"
18446 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18447 cf_cv_shared_soname='$cf_cv_shared_soname'
18448 cf_cv_shlib_version="$cf_cv_shlib_version"
18449 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18450 cf_cv_system_name="$cf_cv_system_name"
18451 host="$host"
18452 target="$target"
18453
18454 EOF
18455
18456 cat >>"$CONFIG_STATUS" <<\EOF
18457 for ac_config_target in $ac_config_targets
18458 do
18459   case "$ac_config_target" in
18460   # Handling of arguments.
18461   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18462   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18463   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18464   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18465   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18466   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18467   *) { { echo "$as_me:18467: error: invalid argument: $ac_config_target" >&5
18468 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18469    { (exit 1); exit 1; }; };;
18470   esac
18471 done
18472
18473 # If the user did not use the arguments to specify the items to instantiate,
18474 # then the envvar interface is used.  Set only those that are not.
18475 # We use the long form for the default assignment because of an extremely
18476 # bizarre bug on SunOS 4.1.3.
18477 if "$ac_need_defaults"; then
18478   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18479   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18480   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18481 fi
18482
18483 # Create a temporary directory, and hook for its removal unless debugging.
18484 $debug ||
18485 {
18486   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18487   trap '{ (exit 1); exit 1; }' 1 2 13 15
18488 }
18489
18490 # Create a (secure) tmp directory for tmp files.
18491 : ${TMPDIR=/tmp}
18492 {
18493   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18494   test -n "$tmp" && test -d "$tmp"
18495 }  ||
18496 {
18497   tmp=$TMPDIR/cs$$-$RANDOM
18498   (umask 077 && mkdir $tmp)
18499 } ||
18500 {
18501    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18502    { (exit 1); exit 1; }
18503 }
18504
18505 EOF
18506
18507 cat >>"$CONFIG_STATUS" <<EOF
18508
18509 #
18510 # CONFIG_FILES section.
18511 #
18512
18513 # No need to generate the scripts if there are no CONFIG_FILES.
18514 # This happens for instance when ./config.status config.h
18515 if test -n "\$CONFIG_FILES"; then
18516   # Protect against being on the right side of a sed subst in config.status.
18517   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18518    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18519 s,@SHELL@,$SHELL,;t t
18520 s,@exec_prefix@,$exec_prefix,;t t
18521 s,@prefix@,$prefix,;t t
18522 s,@program_transform_name@,$program_transform_name,;t t
18523 s,@bindir@,$bindir,;t t
18524 s,@sbindir@,$sbindir,;t t
18525 s,@libexecdir@,$libexecdir,;t t
18526 s,@datarootdir@,$datarootdir,;t t
18527 s,@datadir@,$datadir,;t t
18528 s,@sysconfdir@,$sysconfdir,;t t
18529 s,@sharedstatedir@,$sharedstatedir,;t t
18530 s,@localstatedir@,$localstatedir,;t t
18531 s,@runstatedir@,$runstatedir,;t t
18532 s,@libdir@,$libdir,;t t
18533 s,@includedir@,$includedir,;t t
18534 s,@oldincludedir@,$oldincludedir,;t t
18535 s,@infodir@,$infodir,;t t
18536 s,@mandir@,$mandir,;t t
18537 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18538 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18539 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18540 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18541 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18542 s,@build_alias@,$build_alias,;t t
18543 s,@host_alias@,$host_alias,;t t
18544 s,@target_alias@,$target_alias,;t t
18545 s,@ECHO_C@,$ECHO_C,;t t
18546 s,@ECHO_N@,$ECHO_N,;t t
18547 s,@ECHO_T@,$ECHO_T,;t t
18548 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18549 s,@DEFS@,$DEFS,;t t
18550 s,@LIBS@,$LIBS,;t t
18551 s,@top_builddir@,$top_builddir,;t t
18552 s,@build@,$build,;t t
18553 s,@build_cpu@,$build_cpu,;t t
18554 s,@build_vendor@,$build_vendor,;t t
18555 s,@build_os@,$build_os,;t t
18556 s,@host@,$host,;t t
18557 s,@host_cpu@,$host_cpu,;t t
18558 s,@host_vendor@,$host_vendor,;t t
18559 s,@host_os@,$host_os,;t t
18560 s,@target@,$target,;t t
18561 s,@target_cpu@,$target_cpu,;t t
18562 s,@target_vendor@,$target_vendor,;t t
18563 s,@target_os@,$target_os,;t t
18564 s,@GREP@,$GREP,;t t
18565 s,@FGREP@,$FGREP,;t t
18566 s,@CC@,$CC,;t t
18567 s,@CFLAGS@,$CFLAGS,;t t
18568 s,@LDFLAGS@,$LDFLAGS,;t t
18569 s,@CPPFLAGS@,$CPPFLAGS,;t t
18570 s,@ac_ct_CC@,$ac_ct_CC,;t t
18571 s,@EXEEXT@,$EXEEXT,;t t
18572 s,@OBJEXT@,$OBJEXT,;t t
18573 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18574 s,@CPP@,$CPP,;t t
18575 s,@EGREP@,$EGREP,;t t
18576 s,@AWK@,$AWK,;t t
18577 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18578 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18579 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18580 s,@LN_S@,$LN_S,;t t
18581 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18582 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18583 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18584 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18585 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18586 s,@SET_MAKE@,$SET_MAKE,;t t
18587 s,@MAKE_NO_PHONY@,$MAKE_NO_PHONY,;t t
18588 s,@MAKE_PHONY@,$MAKE_PHONY,;t t
18589 s,@CTAGS@,$CTAGS,;t t
18590 s,@ETAGS@,$ETAGS,;t t
18591 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18592 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18593 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18594 s,@RANLIB@,$RANLIB,;t t
18595 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18596 s,@LD@,$LD,;t t
18597 s,@ac_ct_LD@,$ac_ct_LD,;t t
18598 s,@AR@,$AR,;t t
18599 s,@ac_ct_AR@,$ac_ct_AR,;t t
18600 s,@ARFLAGS@,$ARFLAGS,;t t
18601 s,@DESTDIR@,$DESTDIR,;t t
18602 s,@BUILD_CC@,$BUILD_CC,;t t
18603 s,@BUILD_CPP@,$BUILD_CPP,;t t
18604 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18605 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18606 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18607 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18608 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18609 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18610 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18611 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18612 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18613 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18614 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18615 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18616 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18617 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18618 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18619 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18620 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18621 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18622 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18623 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18624 s,@CC_G_OPT@,$CC_G_OPT,;t t
18625 s,@LD_MODEL@,$LD_MODEL,;t t
18626 s,@shlibdir@,$shlibdir,;t t
18627 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18628 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18629 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18630 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18631 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18632 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18633 s,@LINK_PROGS@,$LINK_PROGS,;t t
18634 s,@LINK_TESTS@,$LINK_TESTS,;t t
18635 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18636 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18637 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18638 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18639 s,@RPATH_LIST@,$RPATH_LIST,;t t
18640 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18641 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18642 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18643 s,@PTHREAD@,$PTHREAD,;t t
18644 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18645 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18646 s,@ECHO_LT@,$ECHO_LT,;t t
18647 s,@ECHO_LD@,$ECHO_LD,;t t
18648 s,@RULE_CC@,$RULE_CC,;t t
18649 s,@SHOW_CC@,$SHOW_CC,;t t
18650 s,@ECHO_CC@,$ECHO_CC,;t t
18651 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18652 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18653 s,@STDC_NORETURN@,$STDC_NORETURN,;t t
18654 s,@ADAFLAGS@,$ADAFLAGS,;t t
18655 s,@ADA_TRACE@,$ADA_TRACE,;t t
18656 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18657 s,@M4_exists@,$M4_exists,;t t
18658 s,@cf_ada_make@,$cf_ada_make,;t t
18659 s,@cf_ada_config@,$cf_ada_config,;t t
18660 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18661 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18662 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18663 s,@cf_compile_generics@,$cf_compile_generics,;t t
18664 s,@cf_generic_objects@,$cf_generic_objects,;t t
18665 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18666 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18667 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18668 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18669 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18670 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18671 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18672 s,@cf_ada_package@,$cf_ada_package,;t t
18673 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18674 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18675 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18676 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18677 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18678 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18679 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18680 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18681 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18682 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18683 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18684 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18685 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18686 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18687 s,@TEST_ARG2@,$TEST_ARG2,;t t
18688 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18689 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18690 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18691 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18692 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18693 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18694 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18695 CEOF
18696
18697 EOF
18698
18699   cat >>"$CONFIG_STATUS" <<\EOF
18700   # Split the substitutions into bite-sized pieces for seds with
18701   # small command number limits, like on Digital OSF/1 and HP-UX.
18702   ac_max_sed_lines=48
18703   ac_sed_frag=1 # Number of current file.
18704   ac_beg=1 # First line for current file.
18705   ac_end=$ac_max_sed_lines # Line after last line for current file.
18706   ac_more_lines=:
18707   ac_sed_cmds=
18708   while "$ac_more_lines"; do
18709     if test "$ac_beg" -gt 1; then
18710       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18711     else
18712       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18713     fi
18714     if test ! -s $tmp/subs.frag; then
18715       ac_more_lines=false
18716     else
18717       # The purpose of the label and of the branching condition is to
18718       # speed up the sed processing (if there are no `@' at all, there
18719       # is no need to browse any of the substitutions).
18720       # These are the two extra sed commands mentioned above.
18721       (echo ':t
18722   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18723       # It is possible to make a multiline substitution using escaped newlines.
18724       # Ensure that we do not split the substitution between script fragments.
18725       ac_BEG=$ac_end
18726       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18727       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18728       if test -s $tmp/subs.next; then
18729         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18730         if test ! -s $tmp/subs.edit; then
18731           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18732           if test ! -s $tmp/subs.edit; then
18733             if test "$ac_beg" -gt 1; then
18734               ac_end=`expr "$ac_end" - 1`
18735               continue
18736             fi
18737           fi
18738         fi
18739       fi
18740
18741       if test -z "$ac_sed_cmds"; then
18742         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18743       else
18744         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18745       fi
18746       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18747       ac_beg=$ac_end
18748       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18749     fi
18750   done
18751   if test -z "$ac_sed_cmds"; then
18752     ac_sed_cmds=cat
18753   fi
18754 fi # test -n "$CONFIG_FILES"
18755
18756 EOF
18757 cat >>"$CONFIG_STATUS" <<\EOF
18758 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18759   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18760   case "$ac_file" in
18761   - | *:- | *:-:* ) # input from stdin
18762         cat >$tmp/stdin
18763         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18764         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18765   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18766         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18767   * )   ac_file_in=$ac_file.in ;;
18768   esac
18769
18770   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18771   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18772          X"$ac_file" : 'X\(//\)[^/]' \| \
18773          X"$ac_file" : 'X\(//\)$' \| \
18774          X"$ac_file" : 'X\(/\)' \| \
18775          .     : '\(.\)' 2>/dev/null ||
18776 echo X"$ac_file" |
18777     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18778           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18779           /^X\(\/\/\)$/{ s//\1/; q; }
18780           /^X\(\/\).*/{ s//\1/; q; }
18781           s/.*/./; q'`
18782   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18783     { case "$ac_dir" in
18784   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18785   *)                      as_incr_dir=.;;
18786 esac
18787 as_dummy="$ac_dir"
18788 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18789   case $as_mkdir_dir in
18790     # Skip DOS drivespec
18791     ?:) as_incr_dir=$as_mkdir_dir ;;
18792     *)
18793       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18794       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18795     ;;
18796   esac
18797 done; }
18798
18799     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18800     # A "../" for each directory in $ac_dir_suffix.
18801     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18802   else
18803     ac_dir_suffix= ac_dots=
18804   fi
18805
18806   case "$srcdir" in
18807   .)  ac_srcdir=.
18808       if test -z "$ac_dots"; then
18809          ac_top_srcdir=.
18810       else
18811          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18812       fi ;;
18813   [\\/]* | ?:[\\/]* )
18814       ac_srcdir="$srcdir$ac_dir_suffix";
18815       ac_top_srcdir="$srcdir" ;;
18816   *) # Relative path.
18817     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18818     ac_top_srcdir="$ac_dots$srcdir" ;;
18819   esac
18820
18821   case $INSTALL in
18822   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18823   *) ac_INSTALL=$ac_dots$INSTALL ;;
18824   esac
18825
18826   if test x"$ac_file" != x-; then
18827     { echo "$as_me:18827: creating $ac_file" >&5
18828 echo "$as_me: creating $ac_file" >&6;}
18829     rm -f "$ac_file"
18830   fi
18831   # Let's still pretend it is `configure' which instantiates (i.e., don't
18832   # use $as_me), people would be surprised to read:
18833   #    /* config.h.  Generated automatically by config.status.  */
18834   configure_input="Generated automatically from `echo $ac_file_in |
18835                                                  sed 's,.*/,,'` by configure."
18836
18837   # First look for the input files in the build tree, otherwise in the
18838   # src tree.
18839   ac_file_inputs=`IFS=:
18840     for f in $ac_file_in; do
18841       case $f in
18842       -) echo $tmp/stdin ;;
18843       [\\/$]*)
18844          # Absolute (can't be DOS-style, as IFS=:)
18845          test -f "$f" || { { echo "$as_me:18845: error: cannot find input file: $f" >&5
18846 echo "$as_me: error: cannot find input file: $f" >&2;}
18847    { (exit 1); exit 1; }; }
18848          echo $f;;
18849       *) # Relative
18850          if test -f "$f"; then
18851            # Build tree
18852            echo $f
18853          elif test -f "$srcdir/$f"; then
18854            # Source tree
18855            echo "$srcdir/$f"
18856          else
18857            # /dev/null tree
18858            { { echo "$as_me:18858: error: cannot find input file: $f" >&5
18859 echo "$as_me: error: cannot find input file: $f" >&2;}
18860    { (exit 1); exit 1; }; }
18861          fi;;
18862       esac
18863     done` || { (exit 1); exit 1; }
18864 EOF
18865 cat >>"$CONFIG_STATUS" <<\EOF
18866   ac_warn_datarootdir=no
18867   if test x"$ac_file" != x-; then
18868     for ac_item in $ac_file_inputs
18869     do
18870       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18871       if test -n "$ac_seen"; then
18872         ac_used=`grep '@datarootdir@' "$ac_item"`
18873         if test -z "$ac_used"; then
18874           { echo "$as_me:18874: WARNING: datarootdir was used implicitly but not set:
18875 $ac_seen" >&5
18876 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18877 $ac_seen" >&2;}
18878           ac_warn_datarootdir=yes
18879         fi
18880       fi
18881       ac_seen=`grep '${datarootdir}' "$ac_item"`
18882       if test -n "$ac_seen"; then
18883         { echo "$as_me:18883: WARNING: datarootdir was used explicitly but not set:
18884 $ac_seen" >&5
18885 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18886 $ac_seen" >&2;}
18887         ac_warn_datarootdir=yes
18888       fi
18889     done
18890   fi
18891
18892 if test "x$ac_warn_datarootdir" = xyes; then
18893   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18894 fi
18895
18896 EOF
18897 cat >>"$CONFIG_STATUS" <<EOF
18898   sed "$ac_vpsub
18899 $extrasub
18900 EOF
18901 cat >>"$CONFIG_STATUS" <<\EOF
18902 :t
18903 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18904 s,@configure_input@,$configure_input,;t t
18905 s,@srcdir@,$ac_srcdir,;t t
18906 s,@top_srcdir@,$ac_top_srcdir,;t t
18907 s,@INSTALL@,$ac_INSTALL,;t t
18908 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18909   rm -f $tmp/stdin
18910   if test x"$ac_file" != x-; then
18911     cp "$tmp/out" "$ac_file"
18912
18913     for ac_name in prefix exec_prefix datarootdir
18914     do
18915         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18916         if test -n "$ac_seen"; then
18917             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18918             if test -z "$ac_init"; then
18919               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18920               { echo "$as_me:18920: WARNING: Variable $ac_name is used but was not set:
18921 $ac_seen" >&5
18922 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18923 $ac_seen" >&2;}
18924             fi
18925         fi
18926     done
18927     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18928     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18929     if test -s $tmp/out; then
18930       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18931       { echo "$as_me:18931: WARNING: Some variables may not be substituted:
18932 $ac_seen" >&5
18933 echo "$as_me: WARNING: Some variables may not be substituted:
18934 $ac_seen" >&2;}
18935     fi
18936   else
18937     cat $tmp/out
18938   fi
18939   rm -f $tmp/out
18940
18941 done
18942 EOF
18943 cat >>"$CONFIG_STATUS" <<\EOF
18944
18945 #
18946 # CONFIG_HEADER section.
18947 #
18948
18949 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18950 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18951 #
18952 # ac_d sets the value in "#define NAME VALUE" lines.
18953 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18954 ac_dB='[        ].*$,\1#\2'
18955 ac_dC=' '
18956 ac_dD=',;t'
18957 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18958 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18959 ac_iB='\([      ]\),\1#\2define\3'
18960 ac_iC=' '
18961 ac_iD='\4,;t'
18962 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18963 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18964 ac_uB='$,\1#\2define\3'
18965 ac_uC=' '
18966 ac_uD=',;t'
18967
18968 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18969   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18970   case "$ac_file" in
18971   - | *:- | *:-:* ) # input from stdin
18972         cat >$tmp/stdin
18973         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18974         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18975   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18976         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18977   * )   ac_file_in=$ac_file.in ;;
18978   esac
18979
18980   test x"$ac_file" != x- && { echo "$as_me:18980: creating $ac_file" >&5
18981 echo "$as_me: creating $ac_file" >&6;}
18982
18983   # First look for the input files in the build tree, otherwise in the
18984   # src tree.
18985   ac_file_inputs=`IFS=:
18986     for f in $ac_file_in; do
18987       case $f in
18988       -) echo $tmp/stdin ;;
18989       [\\/$]*)
18990          # Absolute (can't be DOS-style, as IFS=:)
18991          test -f "$f" || { { echo "$as_me:18991: error: cannot find input file: $f" >&5
18992 echo "$as_me: error: cannot find input file: $f" >&2;}
18993    { (exit 1); exit 1; }; }
18994          echo $f;;
18995       *) # Relative
18996          if test -f "$f"; then
18997            # Build tree
18998            echo $f
18999          elif test -f "$srcdir/$f"; then
19000            # Source tree
19001            echo "$srcdir/$f"
19002          else
19003            # /dev/null tree
19004            { { echo "$as_me:19004: error: cannot find input file: $f" >&5
19005 echo "$as_me: error: cannot find input file: $f" >&2;}
19006    { (exit 1); exit 1; }; }
19007          fi;;
19008       esac
19009     done` || { (exit 1); exit 1; }
19010   # Remove the trailing spaces.
19011   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19012
19013 EOF
19014
19015 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19016 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19017 # be either 'cat' or 'sort'.
19018 cat confdefs.h | uniq >conftest.vals
19019
19020 # Break up conftest.vals because some shells have a limit on
19021 # the size of here documents, and old seds have small limits too.
19022
19023 rm -f conftest.tail
19024 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
19025 while grep . conftest.vals >/dev/null
19026 do
19027   # Write chunks of a limited-size here document to conftest.frag.
19028   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
19029   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
19030   echo 'CEOF' >> "$CONFIG_STATUS"
19031   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
19032   rm -f conftest.vals
19033   mv conftest.tail conftest.vals
19034 done
19035 rm -f conftest.vals
19036
19037 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19038 # marker @DEFS@.
19039 echo '  cat >> conftest.edit <<CEOF
19040 /@DEFS@/r conftest.frag
19041 /@DEFS@/d
19042 CEOF
19043 sed -f conftest.edit $tmp/in > $tmp/out
19044 rm -f $tmp/in
19045 mv $tmp/out $tmp/in
19046 rm -f conftest.edit conftest.frag
19047 ' >> "$CONFIG_STATUS"
19048
19049 cat >>"$CONFIG_STATUS" <<\EOF
19050   # Let's still pretend it is `configure' which instantiates (i.e., don't
19051   # use $as_me), people would be surprised to read:
19052   #    /* config.h.  Generated automatically by config.status.  */
19053   if test x"$ac_file" = x-; then
19054     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19055   else
19056     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19057   fi
19058   cat $tmp/in >>$tmp/config.h
19059   rm -f $tmp/in
19060   if test x"$ac_file" != x-; then
19061     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
19062       { echo "$as_me:19062: $ac_file is unchanged" >&5
19063 echo "$as_me: $ac_file is unchanged" >&6;}
19064     else
19065       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19066          X"$ac_file" : 'X\(//\)[^/]' \| \
19067          X"$ac_file" : 'X\(//\)$' \| \
19068          X"$ac_file" : 'X\(/\)' \| \
19069          .     : '\(.\)' 2>/dev/null ||
19070 echo X"$ac_file" |
19071     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19072           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19073           /^X\(\/\/\)$/{ s//\1/; q; }
19074           /^X\(\/\).*/{ s//\1/; q; }
19075           s/.*/./; q'`
19076       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19077         { case "$ac_dir" in
19078   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19079   *)                      as_incr_dir=.;;
19080 esac
19081 as_dummy="$ac_dir"
19082 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19083   case $as_mkdir_dir in
19084     # Skip DOS drivespec
19085     ?:) as_incr_dir=$as_mkdir_dir ;;
19086     *)
19087       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19088       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19089     ;;
19090   esac
19091 done; }
19092
19093       fi
19094       rm -f "$ac_file"
19095       mv "$tmp/config.h" "$ac_file"
19096     fi
19097   else
19098     cat $tmp/config.h
19099     rm -f $tmp/config.h
19100   fi
19101 done
19102 EOF
19103 cat >>"$CONFIG_STATUS" <<\EOF
19104 #
19105 # CONFIG_COMMANDS section.
19106 #
19107 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19108   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19109   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19110
19111   case "$ac_dest" in
19112     default )
19113 if test -z "$USE_OLD_MAKERULES" ; then
19114         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
19115 fi
19116  ;;
19117   esac
19118 done
19119 EOF
19120
19121 cat >>"$CONFIG_STATUS" <<\EOF
19122
19123 { (exit 0); exit 0; }
19124 EOF
19125 chmod +x "$CONFIG_STATUS"
19126 ac_clean_files=$ac_clean_files_save
19127
19128 # configure is writing to config.log, and then calls config.status.
19129 # config.status does its own redirection, appending to config.log.
19130 # Unfortunately, on DOS this fails, as config.log is still kept open
19131 # by configure, so config.status won't be able to write to it; its
19132 # output is simply discarded.  So we exec the FD to /dev/null,
19133 # effectively closing config.log, so it can be properly (re)opened and
19134 # appended to by config.status.  When coming back to configure, we
19135 # need to make the FD available again.
19136 if test "$no_create" != yes; then
19137   ac_cs_success=:
19138   exec 5>/dev/null
19139   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
19140   exec 5>>config.log
19141   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19142   # would make configure fail if this is the last instruction.
19143   "$ac_cs_success" || { (exit 1); exit 1; }
19144 fi
19145 ${MAKE:-make} preinstall