]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.2 - patch 20210123
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.82 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20210105.
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-assertions     test: turn on generation of assertion code
744   --enable-expanded       test: generate functions for certain macros
745   --disable-macros        test: use functions rather than macros
746   --with-trace            test: add trace() function to all models of ncurses
747   --disable-gnat-projects test: disable GNAT projects even if usable
748 Ada95 Binding Options:
749   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
750   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
751   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
752   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
753   --with-ada-libname=XXX  override default Ada library-name
754
755 Some influential environment variables:
756   CC          C compiler command
757   CFLAGS      C compiler flags
758   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
759               nonstandard directory <lib dir>
760   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
761               headers in a nonstandard directory <include dir>
762   CPP         C preprocessor
763
764 Use these variables to override the choices made by `configure' or to help
765 it to find libraries and programs with nonstandard names/locations.
766
767 EOF
768 fi
769
770 if test "$ac_init_help" = "recursive"; then
771   # If there are subdirs, report their specific --help.
772   ac_popdir=`pwd`
773   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
774     cd "$ac_subdir"
775     # A "../" for each directory in /$ac_subdir.
776     ac_dots=`echo "$ac_subdir" |
777              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
778
779     case "$srcdir" in
780     .) # No --srcdir option.  We are building in place.
781       ac_sub_srcdir="$srcdir" ;;
782     [\\/]* | ?:[\\/]* ) # Absolute path.
783       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
784     *) # Relative path.
785       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
786     esac
787
788     # Check for guested configure; otherwise get Cygnus style configure.
789     if test -f "$ac_sub_srcdir/configure.gnu"; then
790       echo
791       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
792     elif test -f "$ac_sub_srcdir/configure"; then
793       echo
794       $SHELL "$ac_sub_srcdir/configure" --help=recursive
795     elif test -f "$ac_sub_srcdir/configure.ac" ||
796            test -f "$ac_sub_srcdir/configure.in"; then
797       echo
798       "$ac_configure" --help
799     else
800       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
801     fi
802     cd "$ac_popdir"
803   done
804 fi
805
806 test -n "$ac_init_help" && exit 0
807 if "$ac_init_version"; then
808   cat <<\EOF
809
810 Copyright 2003-2020,2021        Thomas E. Dickey
811 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
812 Free Software Foundation, Inc.
813 This configure script is free software; the Free Software Foundation
814 gives unlimited permission to copy, distribute and modify it.
815 EOF
816   exit 0
817 fi
818 exec 5>config.log
819 cat >&5 <<EOF
820 This file contains any messages produced by compilers while
821 running configure, to aid debugging if configure makes a mistake.
822
823 It was created by $as_me, which was
824 generated by GNU Autoconf 2.52.20210105.  Invocation command line was
825
826   $ $0 $@
827
828 EOF
829 {
830 cat <<_ASUNAME
831 ## ---------- ##
832 ## Platform.  ##
833 ## ---------- ##
834
835 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
836 uname -m = `(uname -m) 2>/dev/null || echo unknown`
837 uname -r = `(uname -r) 2>/dev/null || echo unknown`
838 uname -s = `(uname -s) 2>/dev/null || echo unknown`
839 uname -v = `(uname -v) 2>/dev/null || echo unknown`
840
841 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
842 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
843
844 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
845 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
846 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
847 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
848 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
849 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
850 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
851
852 PATH = $PATH
853
854 _ASUNAME
855 } >&5
856
857 cat >&5 <<EOF
858 ## ------------ ##
859 ## Core tests.  ##
860 ## ------------ ##
861
862 EOF
863
864 # Keep a trace of the command line.
865 # Strip out --no-create and --no-recursion so they do not pile up.
866 # Also quote any args containing shell meta-characters.
867 ac_configure_args=
868 ac_sep=
869 for ac_arg
870 do
871   case "$ac_arg" in
872   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
873   | --no-cr | --no-c) ;;
874   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
875   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
876   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
877     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
878     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
879     ac_sep=" " ;;
880   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
881      ac_sep=" " ;;
882   esac
883   # Get rid of the leading space.
884 done
885
886 # When interrupted or exit'd, cleanup temporary files, and complete
887 # config.log.  We remove comments because anyway the quotes in there
888 # would cause problems or look ugly.
889 trap 'exit_status=$?
890   # Save into config.log some information that might help in debugging.
891   echo >&5
892   echo "## ----------------- ##" >&5
893   echo "## Cache variables.  ##" >&5
894   echo "## ----------------- ##" >&5
895   echo >&5
896   # The following way of writing the cache mishandles newlines in values,
897 {
898   (set) 2>&1 |
899     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
900     *ac_space=\ *)
901       sed -n \
902         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
903           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
904       ;;
905     *)
906       sed -n \
907         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
908       ;;
909     esac;
910 } >&5
911   sed "/^$/d" confdefs.h >conftest.log
912   if test -s conftest.log; then
913     echo >&5
914     echo "## ------------ ##" >&5
915     echo "## confdefs.h.  ##" >&5
916     echo "## ------------ ##" >&5
917     echo >&5
918     cat conftest.log >&5
919   fi
920   (echo; echo) >&5
921   test "$ac_signal" != 0 &&
922     echo "$as_me: caught signal $ac_signal" >&5
923   echo "$as_me: exit $exit_status" >&5
924   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
925     exit $exit_status
926      ' 0
927 for ac_signal in 1 2 13 15; do
928   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
929 done
930 ac_signal=0
931
932 # confdefs.h avoids OS command line length limits that DEFS can exceed.
933 rm -rf conftest* confdefs.h
934 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
935 echo >confdefs.h
936
937 # Let the site file select an alternate cache file if it wants to.
938 # Prefer explicitly selected file to automatically selected ones.
939 if test -z "$CONFIG_SITE"; then
940   if test "x$prefix" != xNONE; then
941     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
942   else
943     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
944   fi
945 fi
946 for ac_site_file in $CONFIG_SITE; do
947   if test -r "$ac_site_file"; then
948     { echo "$as_me:948: loading site script $ac_site_file" >&5
949 echo "$as_me: loading site script $ac_site_file" >&6;}
950     cat "$ac_site_file" >&5
951     . "$ac_site_file"
952   fi
953 done
954
955 if test -r "$cache_file"; then
956   # Some versions of bash will fail to source /dev/null (special
957   # files actually), so we avoid doing that.
958   if test -f "$cache_file"; then
959     { echo "$as_me:959: loading cache $cache_file" >&5
960 echo "$as_me: loading cache $cache_file" >&6;}
961     case $cache_file in
962       [\\/]* | ?:[\\/]* ) . $cache_file;;
963       *)                      . ./$cache_file;;
964     esac
965   fi
966 else
967   { echo "$as_me:967: creating cache $cache_file" >&5
968 echo "$as_me: creating cache $cache_file" >&6;}
969   >$cache_file
970 fi
971
972 # Check that the precious variables saved in the cache have kept the same
973 # value.
974 ac_cache_corrupted=false
975 for ac_var in `(set) 2>&1 |
976                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
977   eval ac_old_set=\$ac_cv_env_${ac_var}_set
978   eval ac_new_set=\$ac_env_${ac_var}_set
979   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
980   eval ac_new_val="\$ac_env_${ac_var}_value"
981   case "$ac_old_set,$ac_new_set" in
982     set,)
983       { echo "$as_me:983: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
984 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
985       ac_cache_corrupted=: ;;
986     ,set)
987       { echo "$as_me:987: error: \`$ac_var' was not set in the previous run" >&5
988 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
989       ac_cache_corrupted=: ;;
990     ,);;
991     *)
992       if test "x$ac_old_val" != "x$ac_new_val"; then
993         { echo "$as_me:993: error: \`$ac_var' has changed since the previous run:" >&5
994 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
995         { echo "$as_me:995:   former value:  $ac_old_val" >&5
996 echo "$as_me:   former value:  $ac_old_val" >&2;}
997         { echo "$as_me:997:   current value: $ac_new_val" >&5
998 echo "$as_me:   current value: $ac_new_val" >&2;}
999         ac_cache_corrupted=:
1000       fi;;
1001   esac
1002   # Pass precious variables to config.status.  It doesn't matter if
1003   # we pass some twice (in addition to the command line arguments).
1004   if test "$ac_new_set" = set; then
1005     case "$ac_new_val" in
1006     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1007       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1008       ac_configure_args="$ac_configure_args '$ac_arg'"
1009       ;;
1010     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1011        ;;
1012     esac
1013   fi
1014 done
1015 if "$ac_cache_corrupted"; then
1016   { echo "$as_me:1016: error: changes in the environment can compromise the build" >&5
1017 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1018   { { echo "$as_me:1018: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1019 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022
1023 ac_ext=c
1024 ac_cpp='$CPP $CPPFLAGS'
1025 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1026 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1027 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1028 ac_main_return="return"
1029
1030 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1031   *c*,-n*) ECHO_N=
1032            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1033            ECHO_T='     '
1034            ;;
1035   *c*,*  ) ECHO_N=-n
1036            ECHO_C=
1037            ECHO_T=
1038            ;;
1039   *)       ECHO_N=
1040            ECHO_C='\c'
1041            ECHO_T=
1042            ;;
1043 esac
1044 echo "#! $SHELL" >conftest.sh
1045 echo  "exit 0"   >>conftest.sh
1046 chmod +x conftest.sh
1047 if { (echo "$as_me:1047: PATH=\".;.\"; conftest.sh") >&5
1048   (PATH=".;."; conftest.sh) 2>&5
1049   ac_status=$?
1050   echo "$as_me:1050: \$? = $ac_status" >&5
1051   (exit "$ac_status"); }; then
1052   ac_path_separator=';'
1053 else
1054   ac_path_separator=:
1055 fi
1056 PATH_SEPARATOR="$ac_path_separator"
1057 rm -f conftest.sh
1058
1059 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1060
1061 top_builddir=`pwd`
1062
1063 ac_aux_dir=
1064 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1065   if test -f "$ac_dir/install-sh"; then
1066     ac_aux_dir=$ac_dir
1067     ac_install_sh="$ac_aux_dir/install-sh -c"
1068     break
1069   elif test -f "$ac_dir/install.sh"; then
1070     ac_aux_dir=$ac_dir
1071     ac_install_sh="$ac_aux_dir/install.sh -c"
1072     break
1073   elif test -f "$ac_dir/shtool"; then
1074     ac_aux_dir=$ac_dir
1075     ac_install_sh="$ac_aux_dir/shtool install -c"
1076     break
1077   fi
1078 done
1079 if test -z "$ac_aux_dir"; then
1080   { { echo "$as_me:1080: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1081 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1082    { (exit 1); exit 1; }; }
1083 fi
1084 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1085 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1086 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1087
1088 # Make sure we can run config.sub.
1089 $ac_config_sub sun4 >/dev/null 2>&1 ||
1090   { { echo "$as_me:1090: error: cannot run $ac_config_sub" >&5
1091 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1092    { (exit 1); exit 1; }; }
1093
1094 echo "$as_me:1094: checking build system type" >&5
1095 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1096 if test "${ac_cv_build+set}" = set; then
1097   echo $ECHO_N "(cached) $ECHO_C" >&6
1098 else
1099   ac_cv_build_alias=$build_alias
1100 test -z "$ac_cv_build_alias" &&
1101   ac_cv_build_alias=`$ac_config_guess`
1102 test -z "$ac_cv_build_alias" &&
1103   { { echo "$as_me:1103: error: cannot guess build type; you must specify one" >&5
1104 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1105    { (exit 1); exit 1; }; }
1106 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1107   { { echo "$as_me:1107: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1108 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1109    { (exit 1); exit 1; }; }
1110
1111 fi
1112 echo "$as_me:1112: result: $ac_cv_build" >&5
1113 echo "${ECHO_T}$ac_cv_build" >&6
1114 build=$ac_cv_build
1115 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1116 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1117 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1118
1119 echo "$as_me:1119: checking host system type" >&5
1120 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1121 if test "${ac_cv_host+set}" = set; then
1122   echo $ECHO_N "(cached) $ECHO_C" >&6
1123 else
1124   ac_cv_host_alias=$host_alias
1125 test -z "$ac_cv_host_alias" &&
1126   ac_cv_host_alias=$ac_cv_build_alias
1127 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1128   { { echo "$as_me:1128: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1129 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1130    { (exit 1); exit 1; }; }
1131
1132 fi
1133 echo "$as_me:1133: result: $ac_cv_host" >&5
1134 echo "${ECHO_T}$ac_cv_host" >&6
1135 host=$ac_cv_host
1136 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1137 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1138 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1139
1140 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1141         echo "$as_me:1141: checking target system type" >&5
1142 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1143 if test "${ac_cv_target+set}" = set; then
1144   echo $ECHO_N "(cached) $ECHO_C" >&6
1145 else
1146   ac_cv_target_alias=$target_alias
1147 test "x$ac_cv_target_alias" = "x" &&
1148   ac_cv_target_alias=$ac_cv_host_alias
1149 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1150   { { echo "$as_me:1150: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1151 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1152    { (exit 1); exit 1; }; }
1153
1154 fi
1155 echo "$as_me:1155: result: $ac_cv_target" >&5
1156 echo "${ECHO_T}$ac_cv_target" >&6
1157 target=$ac_cv_target
1158 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1159 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1160 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1161
1162 # The aliases save the names the user supplied, while $host etc.
1163 # will get canonicalized.
1164 test -n "$target_alias" &&
1165   test "$program_prefix$program_suffix$program_transform_name" = \
1166     NONENONEs,x,x, &&
1167   program_prefix=${target_alias}-
1168         system_name="$host_os"
1169 else
1170         system_name="`(uname -s -r) 2>/dev/null`"
1171         if test -z "$system_name" ; then
1172                 system_name="`(hostname) 2>/dev/null`"
1173         fi
1174 fi
1175 test -n "$system_name" &&
1176 cat >>confdefs.h <<EOF
1177 #define SYSTEM_NAME "$system_name"
1178 EOF
1179
1180 if test "${cf_cv_system_name+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   cf_cv_system_name="$system_name"
1184 fi
1185
1186 test -z "$system_name" && system_name="$cf_cv_system_name"
1187 test -n "$cf_cv_system_name" && echo "$as_me:1187: result: Configuring for $cf_cv_system_name" >&5
1188 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1189
1190 if test ".$system_name" != ".$cf_cv_system_name" ; then
1191         echo "$as_me:1191: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1192 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1193         { { echo "$as_me:1193: error: \"Please remove config.cache and try again.\"" >&5
1194 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1195    { (exit 1); exit 1; }; }
1196 fi
1197
1198 # Check whether --with-system-type or --without-system-type was given.
1199 if test "${with_system_type+set}" = set; then
1200   withval="$with_system_type"
1201   { echo "$as_me:1201: WARNING: overriding system type to $withval" >&5
1202 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1203         cf_cv_system_name=$withval
1204         host_os=$withval
1205
1206 fi;
1207
1208 ###     Save the given $CFLAGS to allow user-override.
1209 cf_user_CFLAGS="$CFLAGS"
1210
1211 ###     Default install-location
1212 for ac_prog in ggrep grep
1213 do
1214   # Extract the first word of "$ac_prog", so it can be a program name with args.
1215 set dummy $ac_prog; ac_word=$2
1216 echo "$as_me:1216: checking for $ac_word" >&5
1217 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1218 if test "${ac_cv_prog_GREP+set}" = set; then
1219   echo $ECHO_N "(cached) $ECHO_C" >&6
1220 else
1221   if test -n "$GREP"; then
1222   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1223 else
1224   ac_save_IFS=$IFS; IFS=$ac_path_separator
1225 ac_dummy="$PATH"
1226 for ac_dir in $ac_dummy; do
1227   IFS=$ac_save_IFS
1228   test -z "$ac_dir" && ac_dir=.
1229   $as_executable_p "$ac_dir/$ac_word" || continue
1230 ac_cv_prog_GREP="$ac_prog"
1231 echo "$as_me:1231: found $ac_dir/$ac_word" >&5
1232 break
1233 done
1234
1235 fi
1236 fi
1237 GREP=$ac_cv_prog_GREP
1238 if test -n "$GREP"; then
1239   echo "$as_me:1239: result: $GREP" >&5
1240 echo "${ECHO_T}$GREP" >&6
1241 else
1242   echo "$as_me:1242: result: no" >&5
1243 echo "${ECHO_T}no" >&6
1244 fi
1245
1246   test -n "$GREP" && break
1247 done
1248 test -n "$GREP" || GREP=": "
1249
1250 echo "$as_me:1250: checking for fgrep" >&5
1251 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1252 if test "${ac_cv_path_FGREP+set}" = set; then
1253   echo $ECHO_N "(cached) $ECHO_C" >&6
1254 else
1255   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1256    then ac_cv_path_FGREP="$GREP -F"
1257    else
1258      for ac_prog in gfgrep fgrep
1259 do
1260   # Extract the first word of "$ac_prog", so it can be a program name with args.
1261 set dummy $ac_prog; ac_word=$2
1262 echo "$as_me:1262: checking for $ac_word" >&5
1263 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1264 if test "${ac_cv_path_FGREP+set}" = set; then
1265   echo $ECHO_N "(cached) $ECHO_C" >&6
1266 else
1267   case $FGREP in
1268   [\\/]* | ?:[\\/]*)
1269   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1270   ;;
1271   *)
1272   ac_save_IFS=$IFS; IFS=$ac_path_separator
1273 ac_dummy="$PATH"
1274 for ac_dir in $ac_dummy; do
1275   IFS=$ac_save_IFS
1276   test -z "$ac_dir" && ac_dir=.
1277   if $as_executable_p "$ac_dir/$ac_word"; then
1278    ac_cv_path_FGREP="$ac_dir/$ac_word"
1279    echo "$as_me:1279: found $ac_dir/$ac_word" >&5
1280    break
1281 fi
1282 done
1283
1284   ;;
1285 esac
1286 fi
1287 FGREP=$ac_cv_path_FGREP
1288
1289 if test -n "$FGREP"; then
1290   echo "$as_me:1290: result: $FGREP" >&5
1291 echo "${ECHO_T}$FGREP" >&6
1292 else
1293   echo "$as_me:1293: result: no" >&5
1294 echo "${ECHO_T}no" >&6
1295 fi
1296
1297   test -n "$FGREP" && break
1298 done
1299 test -n "$FGREP" || FGREP=": "
1300
1301      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1301: error: cannot find workable fgrep" >&5
1302 echo "$as_me: error: cannot find workable fgrep" >&2;}
1303    { (exit 1); exit 1; }; }
1304    fi
1305 fi
1306 echo "$as_me:1306: result: $ac_cv_path_FGREP" >&5
1307 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1308  FGREP="$ac_cv_path_FGREP"
1309
1310 echo "$as_me:1310: checking for prefix" >&5
1311 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1312 if test "x$prefix" = "xNONE" ; then
1313         case "$cf_cv_system_name" in
1314                 # non-vendor systems don't have a conflict
1315         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1316                 prefix=/usr
1317                 ;;
1318         (*)     prefix=$ac_default_prefix
1319                 ;;
1320         esac
1321 fi
1322 echo "$as_me:1322: result: $prefix" >&5
1323 echo "${ECHO_T}$prefix" >&6
1324
1325 if test "x$prefix" = "xNONE" ; then
1326 echo "$as_me:1326: checking for default include-directory" >&5
1327 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1328 test -n "$verbose" && echo 1>&6
1329 for cf_symbol in \
1330         "$includedir" \
1331         "$includedir/ncurses" \
1332         "$prefix/include" \
1333         "$prefix/include/ncurses" \
1334         /usr/local/include \
1335         /usr/local/include/ncurses \
1336         /usr/include \
1337         /usr/include/ncurses
1338 do
1339         cf_dir=`eval echo "$cf_symbol"`
1340         if test -f "$cf_dir/curses.h" ; then
1341         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1342                 includedir="$cf_symbol"
1343                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1344                 break
1345         fi
1346         fi
1347         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1348 done
1349 echo "$as_me:1349: result: $includedir" >&5
1350 echo "${ECHO_T}$includedir" >&6
1351 fi
1352
1353 ###     Checks for programs.
1354
1355 ac_ext=c
1356 ac_cpp='$CPP $CPPFLAGS'
1357 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1358 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1359 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1360 ac_main_return="return"
1361 if test -n "$ac_tool_prefix"; then
1362   for ac_prog in gnatgcc gcc cc
1363   do
1364     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1365 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1366 echo "$as_me:1366: checking for $ac_word" >&5
1367 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1368 if test "${ac_cv_prog_CC+set}" = set; then
1369   echo $ECHO_N "(cached) $ECHO_C" >&6
1370 else
1371   if test -n "$CC"; then
1372   ac_cv_prog_CC="$CC" # Let the user override the test.
1373 else
1374   ac_save_IFS=$IFS; IFS=$ac_path_separator
1375 ac_dummy="$PATH"
1376 for ac_dir in $ac_dummy; do
1377   IFS=$ac_save_IFS
1378   test -z "$ac_dir" && ac_dir=.
1379   $as_executable_p "$ac_dir/$ac_word" || continue
1380 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1381 echo "$as_me:1381: found $ac_dir/$ac_word" >&5
1382 break
1383 done
1384
1385 fi
1386 fi
1387 CC=$ac_cv_prog_CC
1388 if test -n "$CC"; then
1389   echo "$as_me:1389: result: $CC" >&5
1390 echo "${ECHO_T}$CC" >&6
1391 else
1392   echo "$as_me:1392: result: no" >&5
1393 echo "${ECHO_T}no" >&6
1394 fi
1395
1396     test -n "$CC" && break
1397   done
1398 fi
1399 if test -z "$CC"; then
1400   ac_ct_CC=$CC
1401   for ac_prog in gnatgcc gcc cc
1402 do
1403   # Extract the first word of "$ac_prog", so it can be a program name with args.
1404 set dummy $ac_prog; ac_word=$2
1405 echo "$as_me:1405: checking for $ac_word" >&5
1406 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1407 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1408   echo $ECHO_N "(cached) $ECHO_C" >&6
1409 else
1410   if test -n "$ac_ct_CC"; then
1411   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1412 else
1413   ac_save_IFS=$IFS; IFS=$ac_path_separator
1414 ac_dummy="$PATH"
1415 for ac_dir in $ac_dummy; do
1416   IFS=$ac_save_IFS
1417   test -z "$ac_dir" && ac_dir=.
1418   $as_executable_p "$ac_dir/$ac_word" || continue
1419 ac_cv_prog_ac_ct_CC="$ac_prog"
1420 echo "$as_me:1420: found $ac_dir/$ac_word" >&5
1421 break
1422 done
1423
1424 fi
1425 fi
1426 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1427 if test -n "$ac_ct_CC"; then
1428   echo "$as_me:1428: result: $ac_ct_CC" >&5
1429 echo "${ECHO_T}$ac_ct_CC" >&6
1430 else
1431   echo "$as_me:1431: result: no" >&5
1432 echo "${ECHO_T}no" >&6
1433 fi
1434
1435   test -n "$ac_ct_CC" && break
1436 done
1437
1438   CC=$ac_ct_CC
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo "$2"`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit "$ac_status"); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit "$ac_status"); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit "$ac_status"); }
1464
1465 cat >"conftest.$ac_ext" <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit "$ac_status"); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat "conftest.$ac_ext" >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit "$ac_status"); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe "conftest$ac_cv_exeext"
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit "$ac_status"); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f "conftest$ac_cv_exeext"
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f "conftest.$ac_ext"
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >"conftest.$ac_ext" <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit "$ac_status"); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat "conftest.$ac_ext" >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >"conftest.$ac_ext" <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f "conftest.$ac_objext"
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit "$ac_status"); } &&
1661          { ac_try='test -s "conftest.$ac_objext"'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit "$ac_status"); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat "conftest.$ac_ext" >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >"conftest.$ac_ext" <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f "conftest.$ac_objext"
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit "$ac_status"); } &&
1706          { ac_try='test -s "conftest.$ac_objext"'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit "$ac_status"); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat "conftest.$ac_ext" >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >"conftest.$ac_ext" <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f "conftest.$ac_objext"
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit "$ac_status"); } &&
1752          { ac_try='test -s "conftest.$ac_objext"'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit "$ac_status"); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >"conftest.$ac_ext" <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f "conftest.$ac_objext"
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit "$ac_status"); } &&
1786          { ac_try='test -s "conftest.$ac_objext"'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit "$ac_status"); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat "conftest.$ac_ext" >&5
1796 continue
1797 fi
1798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1799   cat >"conftest.$ac_ext" <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f "conftest.$ac_objext"
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit "$ac_status"); } &&
1817          { ac_try='test -s "conftest.$ac_objext"'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit "$ac_status"); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat "conftest.$ac_ext" >&5
1827 fi
1828 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo "$ac_declaration"    >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat "conftest.$ac_ext" >&5
1840 fi
1841 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1845 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return="return"
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         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.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 INTEL_COMPILER=no
1860
1861 if test "$GCC" = yes ; then
1862         case "$host_os" in
1863         (linux*|gnu*)
1864                 echo "$as_me:1864: checking if this is really Intel C compiler" >&5
1865 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1866                 cf_save_CFLAGS="$CFLAGS"
1867                 CFLAGS="$CFLAGS -no-gcc"
1868                 cat >"conftest.$ac_ext" <<_ACEOF
1869 #line 1869 "configure"
1870 #include "confdefs.h"
1871
1872 int
1873 main (void)
1874 {
1875
1876 #ifdef __INTEL_COMPILER
1877 #else
1878 make an error
1879 #endif
1880
1881   ;
1882   return 0;
1883 }
1884 _ACEOF
1885 rm -f "conftest.$ac_objext"
1886 if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
1887   (eval $ac_compile) 2>&5
1888   ac_status=$?
1889   echo "$as_me:1889: \$? = $ac_status" >&5
1890   (exit "$ac_status"); } &&
1891          { ac_try='test -s "conftest.$ac_objext"'
1892   { (eval echo "$as_me:1892: \"$ac_try\"") >&5
1893   (eval $ac_try) 2>&5
1894   ac_status=$?
1895   echo "$as_me:1895: \$? = $ac_status" >&5
1896   (exit "$ac_status"); }; }; then
1897   INTEL_COMPILER=yes
1898 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1899
1900 else
1901   echo "$as_me: failed program was:" >&5
1902 cat "conftest.$ac_ext" >&5
1903 fi
1904 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1905                 CFLAGS="$cf_save_CFLAGS"
1906                 echo "$as_me:1906: result: $INTEL_COMPILER" >&5
1907 echo "${ECHO_T}$INTEL_COMPILER" >&6
1908                 ;;
1909         esac
1910 fi
1911
1912 CLANG_COMPILER=no
1913
1914 if test "$GCC" = yes ; then
1915         echo "$as_me:1915: checking if this is really Clang C compiler" >&5
1916 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1917         cf_save_CFLAGS="$CFLAGS"
1918         cat >"conftest.$ac_ext" <<_ACEOF
1919 #line 1919 "configure"
1920 #include "confdefs.h"
1921
1922 int
1923 main (void)
1924 {
1925
1926 #ifdef __clang__
1927 #else
1928 make an error
1929 #endif
1930
1931   ;
1932   return 0;
1933 }
1934 _ACEOF
1935 rm -f "conftest.$ac_objext"
1936 if { (eval echo "$as_me:1936: \"$ac_compile\"") >&5
1937   (eval $ac_compile) 2>&5
1938   ac_status=$?
1939   echo "$as_me:1939: \$? = $ac_status" >&5
1940   (exit "$ac_status"); } &&
1941          { ac_try='test -s "conftest.$ac_objext"'
1942   { (eval echo "$as_me:1942: \"$ac_try\"") >&5
1943   (eval $ac_try) 2>&5
1944   ac_status=$?
1945   echo "$as_me:1945: \$? = $ac_status" >&5
1946   (exit "$ac_status"); }; }; then
1947   CLANG_COMPILER=yes
1948
1949 else
1950   echo "$as_me: failed program was:" >&5
1951 cat "conftest.$ac_ext" >&5
1952 fi
1953 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1954         CFLAGS="$cf_save_CFLAGS"
1955         echo "$as_me:1955: result: $CLANG_COMPILER" >&5
1956 echo "${ECHO_T}$CLANG_COMPILER" >&6
1957 fi
1958
1959 CLANG_VERSION=none
1960
1961 if test "x$CLANG_COMPILER" = "xyes" ; then
1962         case "$CC" in
1963         (c[1-9][0-9]|*/c[1-9][0-9])
1964                 { echo "$as_me:1964: WARNING: replacing broken compiler alias $CC" >&5
1965 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1966                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1967                 CC=clang
1968                 ;;
1969         esac
1970
1971         echo "$as_me:1971: checking version of $CC" >&5
1972 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1973         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.].*//'`"
1974         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1975         echo "$as_me:1975: result: $CLANG_VERSION" >&5
1976 echo "${ECHO_T}$CLANG_VERSION" >&6
1977
1978         for cf_clang_opt in \
1979                 -Qunused-arguments \
1980                 -Wno-error=implicit-function-declaration
1981         do
1982                 echo "$as_me:1982: checking if option $cf_clang_opt works" >&5
1983 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1984                 cf_save_CFLAGS="$CFLAGS"
1985                 CFLAGS="$CFLAGS $cf_clang_opt"
1986                 cat >"conftest.$ac_ext" <<_ACEOF
1987 #line 1987 "configure"
1988 #include "confdefs.h"
1989
1990                         #include <stdio.h>
1991 int
1992 main (void)
1993 {
1994
1995                         printf("hello!\\n");
1996   ;
1997   return 0;
1998 }
1999 _ACEOF
2000 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2001 if { (eval echo "$as_me:2001: \"$ac_link\"") >&5
2002   (eval $ac_link) 2>&5
2003   ac_status=$?
2004   echo "$as_me:2004: \$? = $ac_status" >&5
2005   (exit "$ac_status"); } &&
2006          { ac_try='test -s "conftest$ac_exeext"'
2007   { (eval echo "$as_me:2007: \"$ac_try\"") >&5
2008   (eval $ac_try) 2>&5
2009   ac_status=$?
2010   echo "$as_me:2010: \$? = $ac_status" >&5
2011   (exit "$ac_status"); }; }; then
2012
2013                         cf_clang_optok=yes
2014 else
2015   echo "$as_me: failed program was:" >&5
2016 cat "conftest.$ac_ext" >&5
2017
2018                         cf_clang_optok=no
2019 fi
2020 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2021                 echo "$as_me:2021: result: $cf_clang_optok" >&5
2022 echo "${ECHO_T}$cf_clang_optok" >&6
2023                 CFLAGS="$cf_save_CFLAGS"
2024                 if test "$cf_clang_optok" = yes; then
2025                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2026
2027 echo "${as_me:-configure}:2027: testing adding option $cf_clang_opt ..." 1>&5
2028
2029         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2030         CFLAGS="${CFLAGS}$cf_clang_opt"
2031
2032                 fi
2033         done
2034 fi
2035
2036 echo "$as_me:2036: checking for $CC option to accept ANSI C" >&5
2037 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2038 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2039   echo $ECHO_N "(cached) $ECHO_C" >&6
2040 else
2041   ac_cv_prog_cc_stdc=no
2042 ac_save_CC=$CC
2043 cat >"conftest.$ac_ext" <<_ACEOF
2044 #line 2044 "configure"
2045 #include "confdefs.h"
2046 #include <stdarg.h>
2047 #include <stdio.h>
2048 #include <sys/types.h>
2049 #include <sys/stat.h>
2050 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2051 struct buf { int x; };
2052 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2053 static char *e (p, i)
2054      char **p;
2055      int i;
2056 {
2057   return p[i];
2058 }
2059 static char *f (char * (*g) (char **, int), char **p, ...)
2060 {
2061   char *s;
2062   va_list v;
2063   va_start (v,p);
2064   s = g (p, va_arg (v,int));
2065   va_end (v);
2066   return s;
2067 }
2068 int test (int i, double x);
2069 struct s1 {int (*f) (int a);};
2070 struct s2 {int (*f) (double a);};
2071 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2072 int argc;
2073 char **argv;
2074 int
2075 main (void)
2076 {
2077 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2078   ;
2079   return 0;
2080 }
2081 _ACEOF
2082 # Don't try gcc -ansi; that turns off useful extensions and
2083 # breaks some systems' header files.
2084 # AIX                   -qlanglvl=ansi
2085 # Ultrix and OSF/1      -std1
2086 # HP-UX 10.20 and later -Ae
2087 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2088 # SVR4                  -Xc -D__EXTENSIONS__
2089 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2090 do
2091   CC="$ac_save_CC $ac_arg"
2092   rm -f "conftest.$ac_objext"
2093 if { (eval echo "$as_me:2093: \"$ac_compile\"") >&5
2094   (eval $ac_compile) 2>&5
2095   ac_status=$?
2096   echo "$as_me:2096: \$? = $ac_status" >&5
2097   (exit "$ac_status"); } &&
2098          { ac_try='test -s "conftest.$ac_objext"'
2099   { (eval echo "$as_me:2099: \"$ac_try\"") >&5
2100   (eval $ac_try) 2>&5
2101   ac_status=$?
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit "$ac_status"); }; }; then
2104   ac_cv_prog_cc_stdc=$ac_arg
2105 break
2106 else
2107   echo "$as_me: failed program was:" >&5
2108 cat "conftest.$ac_ext" >&5
2109 fi
2110 rm -f "conftest.$ac_objext"
2111 done
2112 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2113 CC=$ac_save_CC
2114
2115 fi
2116
2117 case "x$ac_cv_prog_cc_stdc" in
2118   x|xno)
2119     echo "$as_me:2119: result: none needed" >&5
2120 echo "${ECHO_T}none needed" >&6 ;;
2121   *)
2122     echo "$as_me:2122: result: $ac_cv_prog_cc_stdc" >&5
2123 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2124     CC="$CC $ac_cv_prog_cc_stdc" ;;
2125 esac
2126
2127 # This should have been defined by AC_PROG_CC
2128 : "${CC:=cc}"
2129
2130 echo "$as_me:2130: checking \$CFLAGS variable" >&5
2131 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2132 case "x$CFLAGS" in
2133 (*-[IUD]*)
2134         echo "$as_me:2134: result: broken" >&5
2135 echo "${ECHO_T}broken" >&6
2136         { echo "$as_me:2136: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2137 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2138         cf_flags="$CFLAGS"
2139         CFLAGS=
2140         for cf_arg in $cf_flags
2141         do
2142
2143 cf_fix_cppflags=no
2144 cf_new_cflags=
2145 cf_new_cppflags=
2146 cf_new_extra_cppflags=
2147
2148 for cf_add_cflags in $cf_arg
2149 do
2150 case "$cf_fix_cppflags" in
2151 (no)
2152         case "$cf_add_cflags" in
2153         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2154                 case "$cf_add_cflags" in
2155                 (-D*)
2156                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2157
2158                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2159                                 && test -z "${cf_tst_cflags}" \
2160                                 && cf_fix_cppflags=yes
2161
2162                         if test "$cf_fix_cppflags" = yes ; then
2163
2164         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2165         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2166
2167                                 continue
2168                         elif test "${cf_tst_cflags}" = "\"'" ; then
2169
2170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2172
2173                                 continue
2174                         fi
2175                         ;;
2176                 esac
2177                 case "$CPPFLAGS" in
2178                 (*$cf_add_cflags)
2179                         ;;
2180                 (*)
2181                         case "$cf_add_cflags" in
2182                         (-D*)
2183                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2184
2185 CPPFLAGS=`echo "$CPPFLAGS" | \
2186         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2187                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2188
2189                                 ;;
2190                         esac
2191
2192         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2193         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2194
2195                         ;;
2196                 esac
2197                 ;;
2198         (*)
2199
2200         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2201         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2202
2203                 ;;
2204         esac
2205         ;;
2206 (yes)
2207
2208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2210
2211         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2212
2213         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2214                 && test -z "${cf_tst_cflags}" \
2215                 && cf_fix_cppflags=no
2216         ;;
2217 esac
2218 done
2219
2220 if test -n "$cf_new_cflags" ; then
2221
2222         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2223         CFLAGS="${CFLAGS}$cf_new_cflags"
2224
2225 fi
2226
2227 if test -n "$cf_new_cppflags" ; then
2228
2229         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2230         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2231
2232 fi
2233
2234 if test -n "$cf_new_extra_cppflags" ; then
2235
2236         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2237         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2238
2239 fi
2240
2241         done
2242         ;;
2243 (*)
2244         echo "$as_me:2244: result: ok" >&5
2245 echo "${ECHO_T}ok" >&6
2246         ;;
2247 esac
2248
2249 echo "$as_me:2249: checking \$CC variable" >&5
2250 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2251 case "$CC" in
2252 (*[\ \  ]-*)
2253         echo "$as_me:2253: result: broken" >&5
2254 echo "${ECHO_T}broken" >&6
2255         { echo "$as_me:2255: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2256 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2257         # humor him...
2258         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2259         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2260         CC="$cf_prog"
2261         for cf_arg in $cf_flags
2262         do
2263                 case "x$cf_arg" in
2264                 (x-[IUDfgOW]*)
2265
2266 cf_fix_cppflags=no
2267 cf_new_cflags=
2268 cf_new_cppflags=
2269 cf_new_extra_cppflags=
2270
2271 for cf_add_cflags in $cf_arg
2272 do
2273 case "$cf_fix_cppflags" in
2274 (no)
2275         case "$cf_add_cflags" in
2276         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2277                 case "$cf_add_cflags" in
2278                 (-D*)
2279                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2280
2281                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2282                                 && test -z "${cf_tst_cflags}" \
2283                                 && cf_fix_cppflags=yes
2284
2285                         if test "$cf_fix_cppflags" = yes ; then
2286
2287         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2288         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2289
2290                                 continue
2291                         elif test "${cf_tst_cflags}" = "\"'" ; then
2292
2293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2295
2296                                 continue
2297                         fi
2298                         ;;
2299                 esac
2300                 case "$CPPFLAGS" in
2301                 (*$cf_add_cflags)
2302                         ;;
2303                 (*)
2304                         case "$cf_add_cflags" in
2305                         (-D*)
2306                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2307
2308 CPPFLAGS=`echo "$CPPFLAGS" | \
2309         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2310                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2311
2312                                 ;;
2313                         esac
2314
2315         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2316         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2317
2318                         ;;
2319                 esac
2320                 ;;
2321         (*)
2322
2323         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2324         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2325
2326                 ;;
2327         esac
2328         ;;
2329 (yes)
2330
2331         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2332         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2333
2334         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2335
2336         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2337                 && test -z "${cf_tst_cflags}" \
2338                 && cf_fix_cppflags=no
2339         ;;
2340 esac
2341 done
2342
2343 if test -n "$cf_new_cflags" ; then
2344
2345         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2346         CFLAGS="${CFLAGS}$cf_new_cflags"
2347
2348 fi
2349
2350 if test -n "$cf_new_cppflags" ; then
2351
2352         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2353         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2354
2355 fi
2356
2357 if test -n "$cf_new_extra_cppflags" ; then
2358
2359         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2360         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2361
2362 fi
2363
2364                         ;;
2365                 (*)
2366                         CC="$CC $cf_arg"
2367                         ;;
2368                 esac
2369         done
2370         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2371
2372 echo "${as_me:-configure}:2372: testing resulting CC: '$CC' ..." 1>&5
2373
2374         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2375
2376 echo "${as_me:-configure}:2376: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2377
2378         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2379
2380 echo "${as_me:-configure}:2380: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2381
2382         ;;
2383 (*)
2384         echo "$as_me:2384: result: ok" >&5
2385 echo "${ECHO_T}ok" >&6
2386         ;;
2387 esac
2388
2389 echo "$as_me:2389: checking for egrep" >&5
2390 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2391 if test "${ac_cv_path_EGREP+set}" = set; then
2392   echo $ECHO_N "(cached) $ECHO_C" >&6
2393 else
2394   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2395    then ac_cv_path_EGREP="$GREP -E"
2396    else
2397      for ac_prog in gegrep egrep
2398 do
2399   # Extract the first word of "$ac_prog", so it can be a program name with args.
2400 set dummy $ac_prog; ac_word=$2
2401 echo "$as_me:2401: checking for $ac_word" >&5
2402 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2403 if test "${ac_cv_path_EGREP+set}" = set; then
2404   echo $ECHO_N "(cached) $ECHO_C" >&6
2405 else
2406   case $EGREP in
2407   [\\/]* | ?:[\\/]*)
2408   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2409   ;;
2410   *)
2411   ac_save_IFS=$IFS; IFS=$ac_path_separator
2412 ac_dummy="$PATH"
2413 for ac_dir in $ac_dummy; do
2414   IFS=$ac_save_IFS
2415   test -z "$ac_dir" && ac_dir=.
2416   if $as_executable_p "$ac_dir/$ac_word"; then
2417    ac_cv_path_EGREP="$ac_dir/$ac_word"
2418    echo "$as_me:2418: found $ac_dir/$ac_word" >&5
2419    break
2420 fi
2421 done
2422
2423   ;;
2424 esac
2425 fi
2426 EGREP=$ac_cv_path_EGREP
2427
2428 if test -n "$EGREP"; then
2429   echo "$as_me:2429: result: $EGREP" >&5
2430 echo "${ECHO_T}$EGREP" >&6
2431 else
2432   echo "$as_me:2432: result: no" >&5
2433 echo "${ECHO_T}no" >&6
2434 fi
2435
2436   test -n "$EGREP" && break
2437 done
2438 test -n "$EGREP" || EGREP=": "
2439
2440      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2440: error: cannot find workable egrep" >&5
2441 echo "$as_me: error: cannot find workable egrep" >&2;}
2442    { (exit 1); exit 1; }; }
2443    fi
2444 fi
2445 echo "$as_me:2445: result: $ac_cv_path_EGREP" >&5
2446 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2447  EGREP="$ac_cv_path_EGREP"
2448
2449 ac_ext=c
2450 ac_cpp='$CPP $CPPFLAGS'
2451 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2452 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2453 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2454 ac_main_return="return"
2455 echo "$as_me:2455: checking how to run the C preprocessor" >&5
2456 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2457 # On Suns, sometimes $CPP names a directory.
2458 if test -n "$CPP" && test -d "$CPP"; then
2459   CPP=
2460 fi
2461 if test -z "$CPP"; then
2462   if test "${ac_cv_prog_CPP+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465       # Double quotes because CPP needs to be expanded
2466     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2467     do
2468       ac_preproc_ok=false
2469 for ac_c_preproc_warn_flag in '' yes
2470 do
2471   # Use a header file that comes with gcc, so configuring glibc
2472   # with a fresh cross-compiler works.
2473   # On the NeXT, cc -E runs the code through the compiler's parser,
2474   # not just through cpp. "Syntax error" is here to catch this case.
2475   cat >"conftest.$ac_ext" <<_ACEOF
2476 #line 2476 "configure"
2477 #include "confdefs.h"
2478 #include <assert.h>
2479                      Syntax error
2480 _ACEOF
2481 if { (eval echo "$as_me:2481: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2482   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2483   ac_status=$?
2484   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2485   rm -f conftest.er1
2486   cat conftest.err >&5
2487   echo "$as_me:2487: \$? = $ac_status" >&5
2488   (exit "$ac_status"); } >/dev/null; then
2489   if test -s conftest.err; then
2490     ac_cpp_err=$ac_c_preproc_warn_flag
2491   else
2492     ac_cpp_err=
2493   fi
2494 else
2495   ac_cpp_err=yes
2496 fi
2497 if test -z "$ac_cpp_err"; then
2498   :
2499 else
2500   echo "$as_me: failed program was:" >&5
2501   cat "conftest.$ac_ext" >&5
2502   # Broken: fails on valid input.
2503 continue
2504 fi
2505 rm -f conftest.err "conftest.$ac_ext"
2506
2507   # OK, works on sane cases.  Now check whether non-existent headers
2508   # can be detected and how.
2509   cat >"conftest.$ac_ext" <<_ACEOF
2510 #line 2510 "configure"
2511 #include "confdefs.h"
2512 #include <ac_nonexistent.h>
2513 _ACEOF
2514 if { (eval echo "$as_me:2514: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2515   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2516   ac_status=$?
2517   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2518   rm -f conftest.er1
2519   cat conftest.err >&5
2520   echo "$as_me:2520: \$? = $ac_status" >&5
2521   (exit "$ac_status"); } >/dev/null; then
2522   if test -s conftest.err; then
2523     ac_cpp_err=$ac_c_preproc_warn_flag
2524   else
2525     ac_cpp_err=
2526   fi
2527 else
2528   ac_cpp_err=yes
2529 fi
2530 if test -z "$ac_cpp_err"; then
2531   # Broken: success on invalid input.
2532 continue
2533 else
2534   echo "$as_me: failed program was:" >&5
2535   cat "conftest.$ac_ext" >&5
2536   # Passes both tests.
2537 ac_preproc_ok=:
2538 break
2539 fi
2540 rm -f conftest.err "conftest.$ac_ext"
2541
2542 done
2543 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2544 rm -f conftest.err "conftest.$ac_ext"
2545 if $ac_preproc_ok; then
2546   break
2547 fi
2548
2549     done
2550     ac_cv_prog_CPP=$CPP
2551
2552 fi
2553   CPP=$ac_cv_prog_CPP
2554 else
2555   ac_cv_prog_CPP=$CPP
2556 fi
2557 echo "$as_me:2557: result: $CPP" >&5
2558 echo "${ECHO_T}$CPP" >&6
2559 ac_preproc_ok=false
2560 for ac_c_preproc_warn_flag in '' yes
2561 do
2562   # Use a header file that comes with gcc, so configuring glibc
2563   # with a fresh cross-compiler works.
2564   # On the NeXT, cc -E runs the code through the compiler's parser,
2565   # not just through cpp. "Syntax error" is here to catch this case.
2566   cat >"conftest.$ac_ext" <<_ACEOF
2567 #line 2567 "configure"
2568 #include "confdefs.h"
2569 #include <assert.h>
2570                      Syntax error
2571 _ACEOF
2572 if { (eval echo "$as_me:2572: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2573   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2574   ac_status=$?
2575   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2576   rm -f conftest.er1
2577   cat conftest.err >&5
2578   echo "$as_me:2578: \$? = $ac_status" >&5
2579   (exit "$ac_status"); } >/dev/null; then
2580   if test -s conftest.err; then
2581     ac_cpp_err=$ac_c_preproc_warn_flag
2582   else
2583     ac_cpp_err=
2584   fi
2585 else
2586   ac_cpp_err=yes
2587 fi
2588 if test -z "$ac_cpp_err"; then
2589   :
2590 else
2591   echo "$as_me: failed program was:" >&5
2592   cat "conftest.$ac_ext" >&5
2593   # Broken: fails on valid input.
2594 continue
2595 fi
2596 rm -f conftest.err "conftest.$ac_ext"
2597
2598   # OK, works on sane cases.  Now check whether non-existent headers
2599   # can be detected and how.
2600   cat >"conftest.$ac_ext" <<_ACEOF
2601 #line 2601 "configure"
2602 #include "confdefs.h"
2603 #include <ac_nonexistent.h>
2604 _ACEOF
2605 if { (eval echo "$as_me:2605: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2606   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2607   ac_status=$?
2608   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2609   rm -f conftest.er1
2610   cat conftest.err >&5
2611   echo "$as_me:2611: \$? = $ac_status" >&5
2612   (exit "$ac_status"); } >/dev/null; then
2613   if test -s conftest.err; then
2614     ac_cpp_err=$ac_c_preproc_warn_flag
2615   else
2616     ac_cpp_err=
2617   fi
2618 else
2619   ac_cpp_err=yes
2620 fi
2621 if test -z "$ac_cpp_err"; then
2622   # Broken: success on invalid input.
2623 continue
2624 else
2625   echo "$as_me: failed program was:" >&5
2626   cat "conftest.$ac_ext" >&5
2627   # Passes both tests.
2628 ac_preproc_ok=:
2629 break
2630 fi
2631 rm -f conftest.err "conftest.$ac_ext"
2632
2633 done
2634 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2635 rm -f conftest.err "conftest.$ac_ext"
2636 if $ac_preproc_ok; then
2637   :
2638 else
2639   { { echo "$as_me:2639: error: C preprocessor \"$CPP\" fails sanity check" >&5
2640 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2641    { (exit 1); exit 1; }; }
2642 fi
2643
2644 ac_ext=c
2645 ac_cpp='$CPP $CPPFLAGS'
2646 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2647 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2648 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2649 ac_main_return="return"
2650
2651 if test $ac_cv_c_compiler_gnu = yes; then
2652     echo "$as_me:2652: checking whether $CC needs -traditional" >&5
2653 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2654 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2655   echo $ECHO_N "(cached) $ECHO_C" >&6
2656 else
2657     ac_pattern="Autoconf.*'x'"
2658   cat >"conftest.$ac_ext" <<_ACEOF
2659 #line 2659 "configure"
2660 #include "confdefs.h"
2661 #include <sgtty.h>
2662 int Autoconf = TIOCGETP;
2663 _ACEOF
2664 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2665   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2666   ac_cv_prog_gcc_traditional=yes
2667 else
2668   ac_cv_prog_gcc_traditional=no
2669 fi
2670 rm -rf conftest*
2671
2672   if test $ac_cv_prog_gcc_traditional = no; then
2673     cat >"conftest.$ac_ext" <<_ACEOF
2674 #line 2674 "configure"
2675 #include "confdefs.h"
2676 #include <termio.h>
2677 int Autoconf = TCGETA;
2678 _ACEOF
2679 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2680   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2681   ac_cv_prog_gcc_traditional=yes
2682 fi
2683 rm -rf conftest*
2684
2685   fi
2686 fi
2687 echo "$as_me:2687: result: $ac_cv_prog_gcc_traditional" >&5
2688 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2689   if test $ac_cv_prog_gcc_traditional = yes; then
2690     CC="$CC -traditional"
2691   fi
2692 fi
2693
2694 echo "$as_me:2694: checking whether $CC understands -c and -o together" >&5
2695 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2696 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2697   echo $ECHO_N "(cached) $ECHO_C" >&6
2698 else
2699
2700 cat > conftest.$ac_ext <<CF_EOF
2701 int main(void)
2702 {
2703         ${cf_cv_main_return:-return}(0);
2704 }
2705 CF_EOF
2706 # We do the test twice because some compilers refuse to overwrite an
2707 # existing .o file with -o, though they will create one.
2708 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2709 if { (eval echo "$as_me:2709: \"$ac_try\"") >&5
2710   (eval $ac_try) 2>&5
2711   ac_status=$?
2712   echo "$as_me:2712: \$? = $ac_status" >&5
2713   (exit "$ac_status"); } &&
2714   test -f conftest2.$ac_objext && { (eval echo "$as_me:2714: \"$ac_try\"") >&5
2715   (eval $ac_try) 2>&5
2716   ac_status=$?
2717   echo "$as_me:2717: \$? = $ac_status" >&5
2718   (exit "$ac_status"); };
2719 then
2720   eval cf_cv_prog_CC_c_o=yes
2721 else
2722   eval cf_cv_prog_CC_c_o=no
2723 fi
2724 rm -rf ./conftest*
2725
2726 fi
2727 if test "$cf_cv_prog_CC_c_o" = yes; then
2728   echo "$as_me:2728: result: yes" >&5
2729 echo "${ECHO_T}yes" >&6
2730 else
2731   echo "$as_me:2731: result: no" >&5
2732 echo "${ECHO_T}no" >&6
2733 fi
2734
2735 test "$program_prefix" != NONE &&
2736   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2737 # Use a double $ so make ignores it.
2738 test "$program_suffix" != NONE &&
2739   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2740 # Double any \ or $.  echo might interpret backslashes.
2741 # By default was `s,x,x', remove it if useless.
2742 cat <<\_ACEOF >conftest.sed
2743 s/[\\$]/&&/g;s/;s,x,x,$//
2744 _ACEOF
2745 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2746 rm conftest.sed
2747
2748 for ac_prog in mawk gawk nawk awk
2749 do
2750   # Extract the first word of "$ac_prog", so it can be a program name with args.
2751 set dummy $ac_prog; ac_word=$2
2752 echo "$as_me:2752: checking for $ac_word" >&5
2753 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2754 if test "${ac_cv_prog_AWK+set}" = set; then
2755   echo $ECHO_N "(cached) $ECHO_C" >&6
2756 else
2757   if test -n "$AWK"; then
2758   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2759 else
2760   ac_save_IFS=$IFS; IFS=$ac_path_separator
2761 ac_dummy="$PATH"
2762 for ac_dir in $ac_dummy; do
2763   IFS=$ac_save_IFS
2764   test -z "$ac_dir" && ac_dir=.
2765   $as_executable_p "$ac_dir/$ac_word" || continue
2766 ac_cv_prog_AWK="$ac_prog"
2767 echo "$as_me:2767: found $ac_dir/$ac_word" >&5
2768 break
2769 done
2770
2771 fi
2772 fi
2773 AWK=$ac_cv_prog_AWK
2774 if test -n "$AWK"; then
2775   echo "$as_me:2775: result: $AWK" >&5
2776 echo "${ECHO_T}$AWK" >&6
2777 else
2778   echo "$as_me:2778: result: no" >&5
2779 echo "${ECHO_T}no" >&6
2780 fi
2781
2782   test -n "$AWK" && break
2783 done
2784
2785 test -z "$AWK" && { { echo "$as_me:2785: error: No awk program found" >&5
2786 echo "$as_me: error: No awk program found" >&2;}
2787    { (exit 1); exit 1; }; }
2788
2789 echo "$as_me:2789: checking for egrep" >&5
2790 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2791 if test "${ac_cv_prog_egrep+set}" = set; then
2792   echo $ECHO_N "(cached) $ECHO_C" >&6
2793 else
2794   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2795                 then ac_cv_prog_egrep='grep -E'
2796                 else ac_cv_prog_egrep='egrep'
2797         fi
2798 fi
2799 echo "$as_me:2799: result: $ac_cv_prog_egrep" >&5
2800 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2801         EGREP=$ac_cv_prog_egrep
2802
2803         test -z "$EGREP" && { { echo "$as_me:2803: error: No egrep program found" >&5
2804 echo "$as_me: error: No egrep program found" >&2;}
2805    { (exit 1); exit 1; }; }
2806
2807 # Find a good install program.  We prefer a C program (faster),
2808 # so one script is as good as another.  But avoid the broken or
2809 # incompatible versions:
2810 # SysV /etc/install, /usr/sbin/install
2811 # SunOS /usr/etc/install
2812 # IRIX /sbin/install
2813 # AIX /bin/install
2814 # AmigaOS /C/install, which installs bootblocks on floppy discs
2815 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2816 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2817 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2818 # ./install, which can be erroneously created by make from ./install.sh.
2819 echo "$as_me:2819: checking for a BSD compatible install" >&5
2820 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2821 if test -z "$INSTALL"; then
2822 if test "${ac_cv_path_install+set}" = set; then
2823   echo $ECHO_N "(cached) $ECHO_C" >&6
2824 else
2825     ac_save_IFS=$IFS; IFS=$ac_path_separator
2826   for ac_dir in $PATH; do
2827     IFS=$ac_save_IFS
2828     # Account for people who put trailing slashes in PATH elements.
2829     case $ac_dir/ in
2830     / | ./ | .// | /cC/* \
2831     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2832     | /usr/ucb/* ) ;;
2833     *)
2834       # OSF1 and SCO ODT 3.0 have their own names for install.
2835       # Don't use installbsd from OSF since it installs stuff as root
2836       # by default.
2837       for ac_prog in ginstall scoinst install; do
2838         if $as_executable_p "$ac_dir/$ac_prog"; then
2839           if test $ac_prog = install &&
2840             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2841             # AIX install.  It has an incompatible calling convention.
2842             :
2843           elif test $ac_prog = install &&
2844             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2845             # program-specific install script used by HP pwplus--don't use.
2846             :
2847           else
2848             ac_cv_path_install="$ac_dir/$ac_prog -c"
2849             break 2
2850           fi
2851         fi
2852       done
2853       ;;
2854     esac
2855   done
2856
2857 fi
2858   if test "${ac_cv_path_install+set}" = set; then
2859     INSTALL=$ac_cv_path_install
2860   else
2861     # As a last resort, use the slow shell script.  We don't cache a
2862     # path for INSTALL within a source directory, because that will
2863     # break other packages using the cache if that directory is
2864     # removed, or if the path is relative.
2865     INSTALL=$ac_install_sh
2866   fi
2867 fi
2868 echo "$as_me:2868: result: $INSTALL" >&5
2869 echo "${ECHO_T}$INSTALL" >&6
2870
2871 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2872 # It thinks the first close brace ends the variable substitution.
2873 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2874
2875 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2876
2877 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2878
2879 echo "$as_me:2879: checking whether ln -s works" >&5
2880 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2881 LN_S=$as_ln_s
2882 if test "$LN_S" = "ln -s"; then
2883   echo "$as_me:2883: result: yes" >&5
2884 echo "${ECHO_T}yes" >&6
2885 else
2886   echo "$as_me:2886: result: no, using $LN_S" >&5
2887 echo "${ECHO_T}no, using $LN_S" >&6
2888 fi
2889
2890 echo "$as_me:2890: checking if $LN_S -f options work" >&5
2891 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2892
2893 rm -f conf$$.src conf$$dst
2894 echo >conf$$.dst
2895 echo first >conf$$.src
2896 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2897         cf_prog_ln_sf=yes
2898 else
2899         cf_prog_ln_sf=no
2900 fi
2901 rm -f conf$$.dst conf$$src
2902 echo "$as_me:2902: result: $cf_prog_ln_sf" >&5
2903 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2904
2905 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2906
2907 # Find a good install program.  We prefer a C program (faster),
2908 # so one script is as good as another.  But avoid the broken or
2909 # incompatible versions:
2910 # SysV /etc/install, /usr/sbin/install
2911 # SunOS /usr/etc/install
2912 # IRIX /sbin/install
2913 # AIX /bin/install
2914 # AmigaOS /C/install, which installs bootblocks on floppy discs
2915 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2916 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2917 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2918 # ./install, which can be erroneously created by make from ./install.sh.
2919 echo "$as_me:2919: checking for a BSD compatible install" >&5
2920 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2921 if test -z "$INSTALL"; then
2922 if test "${ac_cv_path_install+set}" = set; then
2923   echo $ECHO_N "(cached) $ECHO_C" >&6
2924 else
2925     ac_save_IFS=$IFS; IFS=$ac_path_separator
2926   for ac_dir in $PATH; do
2927     IFS=$ac_save_IFS
2928     # Account for people who put trailing slashes in PATH elements.
2929     case $ac_dir/ in
2930     / | ./ | .// | /cC/* \
2931     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2932     | /usr/ucb/* ) ;;
2933     *)
2934       # OSF1 and SCO ODT 3.0 have their own names for install.
2935       # Don't use installbsd from OSF since it installs stuff as root
2936       # by default.
2937       for ac_prog in ginstall scoinst install; do
2938         if $as_executable_p "$ac_dir/$ac_prog"; then
2939           if test $ac_prog = install &&
2940             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2941             # AIX install.  It has an incompatible calling convention.
2942             :
2943           elif test $ac_prog = install &&
2944             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2945             # program-specific install script used by HP pwplus--don't use.
2946             :
2947           else
2948             ac_cv_path_install="$ac_dir/$ac_prog -c"
2949             break 2
2950           fi
2951         fi
2952       done
2953       ;;
2954     esac
2955   done
2956
2957 fi
2958   if test "${ac_cv_path_install+set}" = set; then
2959     INSTALL=$ac_cv_path_install
2960   else
2961     # As a last resort, use the slow shell script.  We don't cache a
2962     # path for INSTALL within a source directory, because that will
2963     # break other packages using the cache if that directory is
2964     # removed, or if the path is relative.
2965     INSTALL=$ac_install_sh
2966   fi
2967 fi
2968 echo "$as_me:2968: result: $INSTALL" >&5
2969 echo "${ECHO_T}$INSTALL" >&6
2970
2971 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2972 # It thinks the first close brace ends the variable substitution.
2973 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2974
2975 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2976
2977 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2978
2979 case $INSTALL in
2980 (/*)
2981         ;;
2982 (*)
2983         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2984         test -z "$cf_dir" && cf_dir=.
2985         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2986         ;;
2987 esac
2988
2989 echo "$as_me:2989: checking if you want to install stripped executables" >&5
2990 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2991
2992 # Check whether --enable-stripping or --disable-stripping was given.
2993 if test "${enable_stripping+set}" = set; then
2994   enableval="$enable_stripping"
2995   test "$enableval" != no && enableval=yes
2996         if test "$enableval" != "yes" ; then
2997     enable_stripping=no
2998         else
2999                 enable_stripping=yes
3000         fi
3001 else
3002   enableval=yes
3003         enable_stripping=yes
3004
3005 fi;
3006 echo "$as_me:3006: result: $enable_stripping" >&5
3007 echo "${ECHO_T}$enable_stripping" >&6
3008
3009 if test "$enable_stripping" = yes
3010 then
3011         INSTALL_OPT_S="-s"
3012 else
3013         INSTALL_OPT_S=
3014 fi
3015
3016 : "${INSTALL:=install}"
3017 echo "$as_me:3017: checking if install accepts -p option" >&5
3018 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3019 if test "${cf_cv_install_p+set}" = set; then
3020   echo $ECHO_N "(cached) $ECHO_C" >&6
3021 else
3022
3023         rm -rf ./conftest*
3024         date >conftest.in
3025         mkdir conftest.out
3026         sleep 3
3027         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3028         then
3029                 if test -f conftest.out/conftest.in
3030                 then
3031                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3032                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3033                         if test -s conftest.err
3034                         then
3035                                 cf_cv_install_p=no
3036                         else
3037                                 cf_cv_install_p=yes
3038                         fi
3039                 else
3040                         cf_cv_install_p=no
3041                 fi
3042         else
3043                 cf_cv_install_p=no
3044         fi
3045         rm -rf ./conftest*
3046
3047 fi
3048 echo "$as_me:3048: result: $cf_cv_install_p" >&5
3049 echo "${ECHO_T}$cf_cv_install_p" >&6
3050
3051 echo "$as_me:3051: checking if install needs to be told about ownership" >&5
3052 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3053 case `$ac_config_guess` in
3054 (*minix)
3055         with_install_o=yes
3056         ;;
3057 (*)
3058         with_install_o=no
3059         ;;
3060 esac
3061
3062 echo "$as_me:3062: result: $with_install_o" >&5
3063 echo "${ECHO_T}$with_install_o" >&6
3064 if test "x$with_install_o" = xyes
3065 then
3066         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'`"
3067 else
3068         INSTALL_OPT_O=
3069 fi
3070
3071 echo "$as_me:3071: checking for long file names" >&5
3072 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3073 if test "${ac_cv_sys_long_file_names+set}" = set; then
3074   echo $ECHO_N "(cached) $ECHO_C" >&6
3075 else
3076   ac_cv_sys_long_file_names=yes
3077 # Test for long file names in all the places we know might matter:
3078 #      .                the current directory, where building will happen
3079 #      $prefix/lib      where we will be installing things
3080 #      $exec_prefix/lib likewise
3081 # eval it to expand exec_prefix.
3082 #      $TMPDIR          if set, where it might want to write temporary files
3083 # if $TMPDIR is not set:
3084 #      /tmp             where it might want to write temporary files
3085 #      /var/tmp         likewise
3086 #      /usr/tmp         likewise
3087 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3088   ac_tmpdirs=$TMPDIR
3089 else
3090   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3091 fi
3092 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3093   test -d "$ac_dir" || continue
3094   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3095   ac_xdir=$ac_dir/cf$$
3096   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3097   ac_tf1=$ac_xdir/conftest9012345
3098   ac_tf2=$ac_xdir/conftest9012346
3099   (echo 1 >"$ac_tf1") 2>/dev/null
3100   (echo 2 >"$ac_tf2") 2>/dev/null
3101   ac_val=`cat "$ac_tf1" 2>/dev/null`
3102   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3103     ac_cv_sys_long_file_names=no
3104     rm -rf "$ac_xdir" 2>/dev/null
3105     break
3106   fi
3107   rm -rf "$ac_xdir" 2>/dev/null
3108 done
3109 fi
3110 echo "$as_me:3110: result: $ac_cv_sys_long_file_names" >&5
3111 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3112 if test "$ac_cv_sys_long_file_names" = yes; then
3113
3114 cat >>confdefs.h <<\EOF
3115 #define HAVE_LONG_FILE_NAMES 1
3116 EOF
3117
3118 fi
3119
3120 # if we find pkg-config, check if we should install the ".pc" files.
3121
3122 echo "$as_me:3122: checking if you want to use pkg-config" >&5
3123 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3124
3125 # Check whether --with-pkg-config or --without-pkg-config was given.
3126 if test "${with_pkg_config+set}" = set; then
3127   withval="$with_pkg_config"
3128   cf_pkg_config=$withval
3129 else
3130   cf_pkg_config=yes
3131 fi;
3132 echo "$as_me:3132: result: $cf_pkg_config" >&5
3133 echo "${ECHO_T}$cf_pkg_config" >&6
3134
3135 case "$cf_pkg_config" in
3136 (no)
3137         PKG_CONFIG=none
3138         ;;
3139 (yes)
3140
3141 if test -n "$ac_tool_prefix"; then
3142   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3143 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   case $PKG_CONFIG in
3150   [\\/]* | ?:[\\/]*)
3151   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3152   ;;
3153   *)
3154   ac_save_IFS=$IFS; IFS=$ac_path_separator
3155 ac_dummy="$PATH"
3156 for ac_dir in $ac_dummy; do
3157   IFS=$ac_save_IFS
3158   test -z "$ac_dir" && ac_dir=.
3159   if $as_executable_p "$ac_dir/$ac_word"; then
3160    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3161    echo "$as_me:3161: found $ac_dir/$ac_word" >&5
3162    break
3163 fi
3164 done
3165
3166   ;;
3167 esac
3168 fi
3169 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3170
3171 if test -n "$PKG_CONFIG"; then
3172   echo "$as_me:3172: result: $PKG_CONFIG" >&5
3173 echo "${ECHO_T}$PKG_CONFIG" >&6
3174 else
3175   echo "$as_me:3175: result: no" >&5
3176 echo "${ECHO_T}no" >&6
3177 fi
3178
3179 fi
3180 if test -z "$ac_cv_path_PKG_CONFIG"; then
3181   ac_pt_PKG_CONFIG=$PKG_CONFIG
3182   # Extract the first word of "pkg-config", so it can be a program name with args.
3183 set dummy pkg-config; ac_word=$2
3184 echo "$as_me:3184: checking for $ac_word" >&5
3185 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3186 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3187   echo $ECHO_N "(cached) $ECHO_C" >&6
3188 else
3189   case $ac_pt_PKG_CONFIG in
3190   [\\/]* | ?:[\\/]*)
3191   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3192   ;;
3193   *)
3194   ac_save_IFS=$IFS; IFS=$ac_path_separator
3195 ac_dummy="$PATH"
3196 for ac_dir in $ac_dummy; do
3197   IFS=$ac_save_IFS
3198   test -z "$ac_dir" && ac_dir=.
3199   if $as_executable_p "$ac_dir/$ac_word"; then
3200    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3201    echo "$as_me:3201: found $ac_dir/$ac_word" >&5
3202    break
3203 fi
3204 done
3205
3206   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3207   ;;
3208 esac
3209 fi
3210 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3211
3212 if test -n "$ac_pt_PKG_CONFIG"; then
3213   echo "$as_me:3213: result: $ac_pt_PKG_CONFIG" >&5
3214 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3215 else
3216   echo "$as_me:3216: result: no" >&5
3217 echo "${ECHO_T}no" >&6
3218 fi
3219
3220   PKG_CONFIG=$ac_pt_PKG_CONFIG
3221 else
3222   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3223 fi
3224
3225         ;;
3226 (*)
3227         PKG_CONFIG=$withval
3228         ;;
3229 esac
3230
3231 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3232 if test "$PKG_CONFIG" != none ; then
3233
3234 if test "x$prefix" != xNONE; then
3235         cf_path_syntax="$prefix"
3236 else
3237         cf_path_syntax="$ac_default_prefix"
3238 fi
3239
3240 case ".$PKG_CONFIG" in
3241 (.\$\(*\)*|.\'*\'*)
3242         ;;
3243 (..|./*|.\\*)
3244         ;;
3245 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3246         ;;
3247 (.\$\{*prefix\}*|.\$\{*dir\}*)
3248         eval PKG_CONFIG="$PKG_CONFIG"
3249         case ".$PKG_CONFIG" in
3250         (.NONE/*)
3251                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3252                 ;;
3253         esac
3254         ;;
3255 (.no|.NONE/*)
3256         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3257         ;;
3258 (*)
3259         { { echo "$as_me:3259: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3260 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3261    { (exit 1); exit 1; }; }
3262         ;;
3263 esac
3264
3265 elif test "x$cf_pkg_config" != xno ; then
3266         { echo "$as_me:3266: WARNING: pkg-config is not installed" >&5
3267 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3268 fi
3269
3270 case "$PKG_CONFIG" in
3271 (no|none|yes)
3272         echo "$as_me:3272: checking for pkg-config library directory" >&5
3273 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3274         ;;
3275 (*)
3276         echo "$as_me:3276: checking for $PKG_CONFIG library directory" >&5
3277 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3278         ;;
3279 esac
3280
3281 PKG_CONFIG_LIBDIR=no
3282
3283 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3284 if test "${with_pkg_config_libdir+set}" = set; then
3285   withval="$with_pkg_config_libdir"
3286   PKG_CONFIG_LIBDIR=$withval
3287 else
3288   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3289 fi;
3290
3291 case x$PKG_CONFIG_LIBDIR in
3292 (x/*)
3293         ;;
3294 (xyes)
3295         # Look for the library directory using the same prefix as the executable
3296         if test "x$PKG_CONFIG" = xnone
3297         then
3298                 cf_path=$prefix
3299         else
3300                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3301         fi
3302
3303         # If you don't like using the default architecture, you have to specify the
3304         # intended library directory and corresponding compiler/linker options.
3305         #
3306         # This case allows for Debian's 2014-flavor of multiarch, along with the
3307         # most common variations before that point.  Some other variants spell the
3308         # directory differently, e.g., "pkg-config", and put it in unusual places.
3309         # pkg-config has always been poorly standardized, which is ironic...
3310         case x`(arch) 2>/dev/null` in
3311         (*64)
3312                 cf_search_path="\
3313                         $cf_path/lib/*64-linux-gnu \
3314                         $cf_path/share \
3315                         $cf_path/lib64 \
3316                         $cf_path/lib32 \
3317                         $cf_path/lib"
3318                 ;;
3319         (*)
3320                 cf_search_path="\
3321                         $cf_path/lib/*-linux-gnu \
3322                         $cf_path/share \
3323                         $cf_path/lib32 \
3324                         $cf_path/lib \
3325                         $cf_path/libdata"
3326                 ;;
3327         esac
3328
3329         test -n "$verbose" && echo "    list..." 1>&6
3330
3331 echo "${as_me:-configure}:3331: testing list... ..." 1>&5
3332
3333         for cf_config in $cf_search_path
3334         do
3335                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3336
3337 echo "${as_me:-configure}:3337: testing checking $cf_config/pkgconfig ..." 1>&5
3338
3339                 if test -d "$cf_config/pkgconfig"
3340                 then
3341                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3342                         echo "$as_me:3342: checking done" >&5
3343 echo $ECHO_N "checking done... $ECHO_C" >&6
3344                         break
3345                 fi
3346         done
3347         ;;
3348 (*)
3349         ;;
3350 esac
3351
3352 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3353         echo "$as_me:3353: result: $PKG_CONFIG_LIBDIR" >&5
3354 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3355 fi
3356
3357 echo "$as_me:3357: checking if you want to build test-programs" >&5
3358 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3359
3360 # Check whether --with-tests or --without-tests was given.
3361 if test "${with_tests+set}" = set; then
3362   withval="$with_tests"
3363   cf_with_tests=$withval
3364 else
3365   cf_with_tests=yes
3366 fi;
3367 echo "$as_me:3367: result: $cf_with_tests" >&5
3368 echo "${ECHO_T}$cf_with_tests" >&6
3369
3370 echo "$as_me:3370: checking if we should assume mixed-case filenames" >&5
3371 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3372
3373 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3374 if test "${enable_mixed_case+set}" = set; then
3375   enableval="$enable_mixed_case"
3376   enable_mixedcase=$enableval
3377 else
3378   enable_mixedcase=auto
3379 fi;
3380 echo "$as_me:3380: result: $enable_mixedcase" >&5
3381 echo "${ECHO_T}$enable_mixedcase" >&6
3382 if test "$enable_mixedcase" = "auto" ; then
3383
3384 echo "$as_me:3384: checking if filesystem supports mixed-case filenames" >&5
3385 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3386 if test "${cf_cv_mixedcase+set}" = set; then
3387   echo $ECHO_N "(cached) $ECHO_C" >&6
3388 else
3389
3390 if test "$cross_compiling" = yes ; then
3391         case "$target_alias" in
3392         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3393                 cf_cv_mixedcase=no
3394                 ;;
3395         (*)
3396                 cf_cv_mixedcase=yes
3397                 ;;
3398         esac
3399 else
3400         rm -f conftest CONFTEST
3401         echo test >conftest
3402         if test -f CONFTEST ; then
3403                 cf_cv_mixedcase=no
3404         else
3405                 cf_cv_mixedcase=yes
3406         fi
3407         rm -f conftest CONFTEST
3408 fi
3409
3410 fi
3411 echo "$as_me:3411: result: $cf_cv_mixedcase" >&5
3412 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3413 test "$cf_cv_mixedcase" = yes &&
3414 cat >>confdefs.h <<\EOF
3415 #define MIXEDCASE_FILENAMES 1
3416 EOF
3417
3418 else
3419         cf_cv_mixedcase=$enable_mixedcase
3420         if test "$enable_mixedcase" = "yes" ; then
3421                 cat >>confdefs.h <<\EOF
3422 #define MIXEDCASE_FILENAMES 1
3423 EOF
3424
3425         fi
3426 fi
3427
3428 # do this after mixed-case option (tags/TAGS is not as important as tic).
3429 echo "$as_me:3429: checking whether ${MAKE-make} sets \${MAKE}" >&5
3430 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3431 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3432 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3433   echo $ECHO_N "(cached) $ECHO_C" >&6
3434 else
3435   cat >conftest.make <<\EOF
3436 all:
3437         @echo 'ac_maketemp="${MAKE}"'
3438 EOF
3439 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3440 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3441 if test -n "$ac_maketemp"; then
3442   eval ac_cv_prog_make_${ac_make}_set=yes
3443 else
3444   eval ac_cv_prog_make_${ac_make}_set=no
3445 fi
3446 rm -f conftest.make
3447 fi
3448 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3449   echo "$as_me:3449: result: yes" >&5
3450 echo "${ECHO_T}yes" >&6
3451   SET_MAKE=
3452 else
3453   echo "$as_me:3453: result: no" >&5
3454 echo "${ECHO_T}no" >&6
3455   SET_MAKE="MAKE=${MAKE-make}"
3456 fi
3457
3458 for ac_prog in exctags ctags
3459 do
3460   # Extract the first word of "$ac_prog", so it can be a program name with args.
3461 set dummy $ac_prog; ac_word=$2
3462 echo "$as_me:3462: checking for $ac_word" >&5
3463 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3464 if test "${ac_cv_prog_CTAGS+set}" = set; then
3465   echo $ECHO_N "(cached) $ECHO_C" >&6
3466 else
3467   if test -n "$CTAGS"; then
3468   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3469 else
3470   ac_save_IFS=$IFS; IFS=$ac_path_separator
3471 ac_dummy="$PATH"
3472 for ac_dir in $ac_dummy; do
3473   IFS=$ac_save_IFS
3474   test -z "$ac_dir" && ac_dir=.
3475   $as_executable_p "$ac_dir/$ac_word" || continue
3476 ac_cv_prog_CTAGS="$ac_prog"
3477 echo "$as_me:3477: found $ac_dir/$ac_word" >&5
3478 break
3479 done
3480
3481 fi
3482 fi
3483 CTAGS=$ac_cv_prog_CTAGS
3484 if test -n "$CTAGS"; then
3485   echo "$as_me:3485: result: $CTAGS" >&5
3486 echo "${ECHO_T}$CTAGS" >&6
3487 else
3488   echo "$as_me:3488: result: no" >&5
3489 echo "${ECHO_T}no" >&6
3490 fi
3491
3492   test -n "$CTAGS" && break
3493 done
3494
3495 for ac_prog in exetags etags
3496 do
3497   # Extract the first word of "$ac_prog", so it can be a program name with args.
3498 set dummy $ac_prog; ac_word=$2
3499 echo "$as_me:3499: checking for $ac_word" >&5
3500 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3501 if test "${ac_cv_prog_ETAGS+set}" = set; then
3502   echo $ECHO_N "(cached) $ECHO_C" >&6
3503 else
3504   if test -n "$ETAGS"; then
3505   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3506 else
3507   ac_save_IFS=$IFS; IFS=$ac_path_separator
3508 ac_dummy="$PATH"
3509 for ac_dir in $ac_dummy; do
3510   IFS=$ac_save_IFS
3511   test -z "$ac_dir" && ac_dir=.
3512   $as_executable_p "$ac_dir/$ac_word" || continue
3513 ac_cv_prog_ETAGS="$ac_prog"
3514 echo "$as_me:3514: found $ac_dir/$ac_word" >&5
3515 break
3516 done
3517
3518 fi
3519 fi
3520 ETAGS=$ac_cv_prog_ETAGS
3521 if test -n "$ETAGS"; then
3522   echo "$as_me:3522: result: $ETAGS" >&5
3523 echo "${ECHO_T}$ETAGS" >&6
3524 else
3525   echo "$as_me:3525: result: no" >&5
3526 echo "${ECHO_T}no" >&6
3527 fi
3528
3529   test -n "$ETAGS" && break
3530 done
3531
3532 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3533 set dummy ${CTAGS:-ctags}; ac_word=$2
3534 echo "$as_me:3534: checking for $ac_word" >&5
3535 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3536 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3537   echo $ECHO_N "(cached) $ECHO_C" >&6
3538 else
3539   if test -n "$MAKE_LOWER_TAGS"; then
3540   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3541 else
3542   ac_save_IFS=$IFS; IFS=$ac_path_separator
3543 ac_dummy="$PATH"
3544 for ac_dir in $ac_dummy; do
3545   IFS=$ac_save_IFS
3546   test -z "$ac_dir" && ac_dir=.
3547   $as_executable_p "$ac_dir/$ac_word" || continue
3548 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3549 echo "$as_me:3549: found $ac_dir/$ac_word" >&5
3550 break
3551 done
3552
3553   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3554 fi
3555 fi
3556 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3557 if test -n "$MAKE_LOWER_TAGS"; then
3558   echo "$as_me:3558: result: $MAKE_LOWER_TAGS" >&5
3559 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3560 else
3561   echo "$as_me:3561: result: no" >&5
3562 echo "${ECHO_T}no" >&6
3563 fi
3564
3565 if test "$cf_cv_mixedcase" = yes ; then
3566         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3567 set dummy ${ETAGS:-etags}; ac_word=$2
3568 echo "$as_me:3568: checking for $ac_word" >&5
3569 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3570 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3571   echo $ECHO_N "(cached) $ECHO_C" >&6
3572 else
3573   if test -n "$MAKE_UPPER_TAGS"; then
3574   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3575 else
3576   ac_save_IFS=$IFS; IFS=$ac_path_separator
3577 ac_dummy="$PATH"
3578 for ac_dir in $ac_dummy; do
3579   IFS=$ac_save_IFS
3580   test -z "$ac_dir" && ac_dir=.
3581   $as_executable_p "$ac_dir/$ac_word" || continue
3582 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3583 echo "$as_me:3583: found $ac_dir/$ac_word" >&5
3584 break
3585 done
3586
3587   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3588 fi
3589 fi
3590 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3591 if test -n "$MAKE_UPPER_TAGS"; then
3592   echo "$as_me:3592: result: $MAKE_UPPER_TAGS" >&5
3593 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3594 else
3595   echo "$as_me:3595: result: no" >&5
3596 echo "${ECHO_T}no" >&6
3597 fi
3598
3599 else
3600         MAKE_UPPER_TAGS=no
3601 fi
3602
3603 if test "$MAKE_UPPER_TAGS" = yes ; then
3604         MAKE_UPPER_TAGS=
3605 else
3606         MAKE_UPPER_TAGS="#"
3607 fi
3608
3609 if test "$MAKE_LOWER_TAGS" = yes ; then
3610         MAKE_LOWER_TAGS=
3611 else
3612         MAKE_LOWER_TAGS="#"
3613 fi
3614
3615 echo "$as_me:3615: checking for makeflags variable" >&5
3616 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3617 if test "${cf_cv_makeflags+set}" = set; then
3618   echo $ECHO_N "(cached) $ECHO_C" >&6
3619 else
3620
3621         cf_cv_makeflags=''
3622         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3623         do
3624                 cat >cf_makeflags.tmp <<CF_EOF
3625 SHELL = $SHELL
3626 all :
3627         @ echo '.$cf_option'
3628 CF_EOF
3629                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3630                 case "$cf_result" in
3631                 (.*k|.*kw)
3632                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3633                         case "$cf_result" in
3634                         (.*CC=*)        cf_cv_makeflags=
3635                                 ;;
3636                         (*)     cf_cv_makeflags=$cf_option
3637                                 ;;
3638                         esac
3639                         break
3640                         ;;
3641                 (.-)
3642                         ;;
3643                 (*)
3644
3645 echo "${as_me:-configure}:3645: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3646
3647                         ;;
3648                 esac
3649         done
3650         rm -f cf_makeflags.tmp
3651
3652 fi
3653 echo "$as_me:3653: result: $cf_cv_makeflags" >&5
3654 echo "${ECHO_T}$cf_cv_makeflags" >&6
3655
3656 if test -n "$ac_tool_prefix"; then
3657   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3658 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3659 echo "$as_me:3659: checking for $ac_word" >&5
3660 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3661 if test "${ac_cv_prog_RANLIB+set}" = set; then
3662   echo $ECHO_N "(cached) $ECHO_C" >&6
3663 else
3664   if test -n "$RANLIB"; then
3665   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3666 else
3667   ac_save_IFS=$IFS; IFS=$ac_path_separator
3668 ac_dummy="$PATH"
3669 for ac_dir in $ac_dummy; do
3670   IFS=$ac_save_IFS
3671   test -z "$ac_dir" && ac_dir=.
3672   $as_executable_p "$ac_dir/$ac_word" || continue
3673 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3674 echo "$as_me:3674: found $ac_dir/$ac_word" >&5
3675 break
3676 done
3677
3678 fi
3679 fi
3680 RANLIB=$ac_cv_prog_RANLIB
3681 if test -n "$RANLIB"; then
3682   echo "$as_me:3682: result: $RANLIB" >&5
3683 echo "${ECHO_T}$RANLIB" >&6
3684 else
3685   echo "$as_me:3685: result: no" >&5
3686 echo "${ECHO_T}no" >&6
3687 fi
3688
3689 fi
3690 if test -z "$ac_cv_prog_RANLIB"; then
3691   ac_ct_RANLIB=$RANLIB
3692   # Extract the first word of "ranlib", so it can be a program name with args.
3693 set dummy ranlib; ac_word=$2
3694 echo "$as_me:3694: checking for $ac_word" >&5
3695 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3696 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3697   echo $ECHO_N "(cached) $ECHO_C" >&6
3698 else
3699   if test -n "$ac_ct_RANLIB"; then
3700   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3701 else
3702   ac_save_IFS=$IFS; IFS=$ac_path_separator
3703 ac_dummy="$PATH"
3704 for ac_dir in $ac_dummy; do
3705   IFS=$ac_save_IFS
3706   test -z "$ac_dir" && ac_dir=.
3707   $as_executable_p "$ac_dir/$ac_word" || continue
3708 ac_cv_prog_ac_ct_RANLIB="ranlib"
3709 echo "$as_me:3709: found $ac_dir/$ac_word" >&5
3710 break
3711 done
3712
3713   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3714 fi
3715 fi
3716 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3717 if test -n "$ac_ct_RANLIB"; then
3718   echo "$as_me:3718: result: $ac_ct_RANLIB" >&5
3719 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3720 else
3721   echo "$as_me:3721: result: no" >&5
3722 echo "${ECHO_T}no" >&6
3723 fi
3724
3725   RANLIB=$ac_ct_RANLIB
3726 else
3727   RANLIB="$ac_cv_prog_RANLIB"
3728 fi
3729
3730 if test -n "$ac_tool_prefix"; then
3731   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3732 set dummy ${ac_tool_prefix}ld; ac_word=$2
3733 echo "$as_me:3733: checking for $ac_word" >&5
3734 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3735 if test "${ac_cv_prog_LD+set}" = set; then
3736   echo $ECHO_N "(cached) $ECHO_C" >&6
3737 else
3738   if test -n "$LD"; then
3739   ac_cv_prog_LD="$LD" # Let the user override the test.
3740 else
3741   ac_save_IFS=$IFS; IFS=$ac_path_separator
3742 ac_dummy="$PATH"
3743 for ac_dir in $ac_dummy; do
3744   IFS=$ac_save_IFS
3745   test -z "$ac_dir" && ac_dir=.
3746   $as_executable_p "$ac_dir/$ac_word" || continue
3747 ac_cv_prog_LD="${ac_tool_prefix}ld"
3748 echo "$as_me:3748: found $ac_dir/$ac_word" >&5
3749 break
3750 done
3751
3752 fi
3753 fi
3754 LD=$ac_cv_prog_LD
3755 if test -n "$LD"; then
3756   echo "$as_me:3756: result: $LD" >&5
3757 echo "${ECHO_T}$LD" >&6
3758 else
3759   echo "$as_me:3759: result: no" >&5
3760 echo "${ECHO_T}no" >&6
3761 fi
3762
3763 fi
3764 if test -z "$ac_cv_prog_LD"; then
3765   ac_ct_LD=$LD
3766   # Extract the first word of "ld", so it can be a program name with args.
3767 set dummy ld; ac_word=$2
3768 echo "$as_me:3768: checking for $ac_word" >&5
3769 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3770 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3771   echo $ECHO_N "(cached) $ECHO_C" >&6
3772 else
3773   if test -n "$ac_ct_LD"; then
3774   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3775 else
3776   ac_save_IFS=$IFS; IFS=$ac_path_separator
3777 ac_dummy="$PATH"
3778 for ac_dir in $ac_dummy; do
3779   IFS=$ac_save_IFS
3780   test -z "$ac_dir" && ac_dir=.
3781   $as_executable_p "$ac_dir/$ac_word" || continue
3782 ac_cv_prog_ac_ct_LD="ld"
3783 echo "$as_me:3783: found $ac_dir/$ac_word" >&5
3784 break
3785 done
3786
3787   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3788 fi
3789 fi
3790 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3791 if test -n "$ac_ct_LD"; then
3792   echo "$as_me:3792: result: $ac_ct_LD" >&5
3793 echo "${ECHO_T}$ac_ct_LD" >&6
3794 else
3795   echo "$as_me:3795: result: no" >&5
3796 echo "${ECHO_T}no" >&6
3797 fi
3798
3799   LD=$ac_ct_LD
3800 else
3801   LD="$ac_cv_prog_LD"
3802 fi
3803
3804 if test -n "$ac_tool_prefix"; then
3805   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3806 set dummy ${ac_tool_prefix}ar; ac_word=$2
3807 echo "$as_me:3807: checking for $ac_word" >&5
3808 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3809 if test "${ac_cv_prog_AR+set}" = set; then
3810   echo $ECHO_N "(cached) $ECHO_C" >&6
3811 else
3812   if test -n "$AR"; then
3813   ac_cv_prog_AR="$AR" # Let the user override the test.
3814 else
3815   ac_save_IFS=$IFS; IFS=$ac_path_separator
3816 ac_dummy="$PATH"
3817 for ac_dir in $ac_dummy; do
3818   IFS=$ac_save_IFS
3819   test -z "$ac_dir" && ac_dir=.
3820   $as_executable_p "$ac_dir/$ac_word" || continue
3821 ac_cv_prog_AR="${ac_tool_prefix}ar"
3822 echo "$as_me:3822: found $ac_dir/$ac_word" >&5
3823 break
3824 done
3825
3826 fi
3827 fi
3828 AR=$ac_cv_prog_AR
3829 if test -n "$AR"; then
3830   echo "$as_me:3830: result: $AR" >&5
3831 echo "${ECHO_T}$AR" >&6
3832 else
3833   echo "$as_me:3833: result: no" >&5
3834 echo "${ECHO_T}no" >&6
3835 fi
3836
3837 fi
3838 if test -z "$ac_cv_prog_AR"; then
3839   ac_ct_AR=$AR
3840   # Extract the first word of "ar", so it can be a program name with args.
3841 set dummy ar; ac_word=$2
3842 echo "$as_me:3842: checking for $ac_word" >&5
3843 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3844 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3845   echo $ECHO_N "(cached) $ECHO_C" >&6
3846 else
3847   if test -n "$ac_ct_AR"; then
3848   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3849 else
3850   ac_save_IFS=$IFS; IFS=$ac_path_separator
3851 ac_dummy="$PATH"
3852 for ac_dir in $ac_dummy; do
3853   IFS=$ac_save_IFS
3854   test -z "$ac_dir" && ac_dir=.
3855   $as_executable_p "$ac_dir/$ac_word" || continue
3856 ac_cv_prog_ac_ct_AR="ar"
3857 echo "$as_me:3857: found $ac_dir/$ac_word" >&5
3858 break
3859 done
3860
3861   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3862 fi
3863 fi
3864 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3865 if test -n "$ac_ct_AR"; then
3866   echo "$as_me:3866: result: $ac_ct_AR" >&5
3867 echo "${ECHO_T}$ac_ct_AR" >&6
3868 else
3869   echo "$as_me:3869: result: no" >&5
3870 echo "${ECHO_T}no" >&6
3871 fi
3872
3873   AR=$ac_ct_AR
3874 else
3875   AR="$ac_cv_prog_AR"
3876 fi
3877
3878 if test -n "$ac_tool_prefix"; then
3879   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3880 set dummy ${ac_tool_prefix}ar; ac_word=$2
3881 echo "$as_me:3881: checking for $ac_word" >&5
3882 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3883 if test "${ac_cv_prog_AR+set}" = set; then
3884   echo $ECHO_N "(cached) $ECHO_C" >&6
3885 else
3886   if test -n "$AR"; then
3887   ac_cv_prog_AR="$AR" # Let the user override the test.
3888 else
3889   ac_save_IFS=$IFS; IFS=$ac_path_separator
3890 ac_dummy="$PATH"
3891 for ac_dir in $ac_dummy; do
3892   IFS=$ac_save_IFS
3893   test -z "$ac_dir" && ac_dir=.
3894   $as_executable_p "$ac_dir/$ac_word" || continue
3895 ac_cv_prog_AR="${ac_tool_prefix}ar"
3896 echo "$as_me:3896: found $ac_dir/$ac_word" >&5
3897 break
3898 done
3899
3900 fi
3901 fi
3902 AR=$ac_cv_prog_AR
3903 if test -n "$AR"; then
3904   echo "$as_me:3904: result: $AR" >&5
3905 echo "${ECHO_T}$AR" >&6
3906 else
3907   echo "$as_me:3907: result: no" >&5
3908 echo "${ECHO_T}no" >&6
3909 fi
3910
3911 fi
3912 if test -z "$ac_cv_prog_AR"; then
3913   ac_ct_AR=$AR
3914   # Extract the first word of "ar", so it can be a program name with args.
3915 set dummy ar; ac_word=$2
3916 echo "$as_me:3916: checking for $ac_word" >&5
3917 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3918 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3919   echo $ECHO_N "(cached) $ECHO_C" >&6
3920 else
3921   if test -n "$ac_ct_AR"; then
3922   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3923 else
3924   ac_save_IFS=$IFS; IFS=$ac_path_separator
3925 ac_dummy="$PATH"
3926 for ac_dir in $ac_dummy; do
3927   IFS=$ac_save_IFS
3928   test -z "$ac_dir" && ac_dir=.
3929   $as_executable_p "$ac_dir/$ac_word" || continue
3930 ac_cv_prog_ac_ct_AR="ar"
3931 echo "$as_me:3931: found $ac_dir/$ac_word" >&5
3932 break
3933 done
3934
3935   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3936 fi
3937 fi
3938 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3939 if test -n "$ac_ct_AR"; then
3940   echo "$as_me:3940: result: $ac_ct_AR" >&5
3941 echo "${ECHO_T}$ac_ct_AR" >&6
3942 else
3943   echo "$as_me:3943: result: no" >&5
3944 echo "${ECHO_T}no" >&6
3945 fi
3946
3947   AR=$ac_ct_AR
3948 else
3949   AR="$ac_cv_prog_AR"
3950 fi
3951
3952 echo "$as_me:3952: checking for options to update archives" >&5
3953 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3954 if test "${cf_cv_ar_flags+set}" = set; then
3955   echo $ECHO_N "(cached) $ECHO_C" >&6
3956 else
3957
3958         case "$cf_cv_system_name" in
3959         (*-msvc*)
3960                 cf_cv_ar_flags=''
3961                 cat >mk_static_lib.sh <<-EOF
3962                 #!$SHELL
3963                 MSVC_BIN="$AR"
3964                 out="\$1"
3965                 shift
3966                 exec \$MSVC_BIN -out:"\$out" \$@
3967                 EOF
3968                 chmod +x mk_static_lib.sh
3969                 AR=`pwd`/mk_static_lib.sh
3970                 ;;
3971         (*)
3972                 cf_cv_ar_flags=unknown
3973                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3974                 do
3975
3976                         # check if $ARFLAGS already contains this choice
3977                         if test "x$ARFLAGS" != "x" ; then
3978                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3979                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3980                                         cf_cv_ar_flags=
3981                                         break
3982                                 fi
3983                         fi
3984
3985                         rm -f "conftest.$ac_cv_objext"
3986                         rm -f conftest.a
3987
3988                         cat >"conftest.$ac_ext" <<EOF
3989 #line 3989 "configure"
3990 int     testdata[3] = { 123, 456, 789 };
3991 EOF
3992                         if { (eval echo "$as_me:3992: \"$ac_compile\"") >&5
3993   (eval $ac_compile) 2>&5
3994   ac_status=$?
3995   echo "$as_me:3995: \$? = $ac_status" >&5
3996   (exit "$ac_status"); } ; then
3997                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3998                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
3999                                 if test -f conftest.a ; then
4000                                         cf_cv_ar_flags="$cf_ar_flags"
4001                                         break
4002                                 fi
4003                         else
4004                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4005
4006 echo "${as_me:-configure}:4006: testing cannot compile test-program ..." 1>&5
4007
4008                                 break
4009                         fi
4010                 done
4011                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4012                 ;;
4013         esac
4014
4015 fi
4016 echo "$as_me:4016: result: $cf_cv_ar_flags" >&5
4017 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4018
4019 if test -n "$ARFLAGS" ; then
4020         if test -n "$cf_cv_ar_flags" ; then
4021                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4022         fi
4023 else
4024         ARFLAGS=$cf_cv_ar_flags
4025 fi
4026
4027         echo "$as_me:4027: checking for PATH separator" >&5
4028 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4029         case "$cf_cv_system_name" in
4030         (os2*)  PATH_SEPARATOR=';'  ;;
4031         (*)     ${PATH_SEPARATOR:=':'}  ;;
4032         esac
4033
4034         echo "$as_me:4034: result: $PATH_SEPARATOR" >&5
4035 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4036
4037 echo "$as_me:4037: checking if you have specified an install-prefix" >&5
4038 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4039
4040 # Check whether --with-install-prefix or --without-install-prefix was given.
4041 if test "${with_install_prefix+set}" = set; then
4042   withval="$with_install_prefix"
4043   case "$withval" in
4044         (yes|no)
4045                 ;;
4046         (*)     DESTDIR="$withval"
4047                 ;;
4048         esac
4049 fi;
4050 echo "$as_me:4050: result: $DESTDIR" >&5
4051 echo "${ECHO_T}$DESTDIR" >&6
4052
4053 ###############################################################################
4054
4055 # If we're cross-compiling, allow the user to override the tools and their
4056 # options.  The configure script is oriented toward identifying the host
4057 # compiler, etc., but we need a build compiler to generate parts of the source.
4058
4059 if test "$cross_compiling" = yes ; then
4060
4061         # defaults that we might want to override
4062         : ${BUILD_CFLAGS:=''}
4063         : ${BUILD_CPPFLAGS:=''}
4064         : ${BUILD_LDFLAGS:=''}
4065         : ${BUILD_LIBS:=''}
4066         : ${BUILD_EXEEXT:='$x'}
4067         : ${BUILD_OBJEXT:='o'}
4068
4069 # Check whether --with-build-cc or --without-build-cc was given.
4070 if test "${with_build_cc+set}" = set; then
4071   withval="$with_build_cc"
4072   BUILD_CC="$withval"
4073 else
4074   for ac_prog in gcc clang c99 c89 cc cl
4075 do
4076   # Extract the first word of "$ac_prog", so it can be a program name with args.
4077 set dummy $ac_prog; ac_word=$2
4078 echo "$as_me:4078: checking for $ac_word" >&5
4079 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4080 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4081   echo $ECHO_N "(cached) $ECHO_C" >&6
4082 else
4083   if test -n "$BUILD_CC"; then
4084   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4085 else
4086   ac_save_IFS=$IFS; IFS=$ac_path_separator
4087 ac_dummy="$PATH"
4088 for ac_dir in $ac_dummy; do
4089   IFS=$ac_save_IFS
4090   test -z "$ac_dir" && ac_dir=.
4091   $as_executable_p "$ac_dir/$ac_word" || continue
4092 ac_cv_prog_BUILD_CC="$ac_prog"
4093 echo "$as_me:4093: found $ac_dir/$ac_word" >&5
4094 break
4095 done
4096
4097 fi
4098 fi
4099 BUILD_CC=$ac_cv_prog_BUILD_CC
4100 if test -n "$BUILD_CC"; then
4101   echo "$as_me:4101: result: $BUILD_CC" >&5
4102 echo "${ECHO_T}$BUILD_CC" >&6
4103 else
4104   echo "$as_me:4104: result: no" >&5
4105 echo "${ECHO_T}no" >&6
4106 fi
4107
4108   test -n "$BUILD_CC" && break
4109 done
4110 test -n "$BUILD_CC" || BUILD_CC="none"
4111
4112 fi;
4113         echo "$as_me:4113: checking for native build C compiler" >&5
4114 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4115         echo "$as_me:4115: result: $BUILD_CC" >&5
4116 echo "${ECHO_T}$BUILD_CC" >&6
4117
4118         echo "$as_me:4118: checking for native build C preprocessor" >&5
4119 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4120
4121 # Check whether --with-build-cpp or --without-build-cpp was given.
4122 if test "${with_build_cpp+set}" = set; then
4123   withval="$with_build_cpp"
4124   BUILD_CPP="$withval"
4125 else
4126   BUILD_CPP='${BUILD_CC} -E'
4127 fi;
4128         echo "$as_me:4128: result: $BUILD_CPP" >&5
4129 echo "${ECHO_T}$BUILD_CPP" >&6
4130
4131         echo "$as_me:4131: checking for native build C flags" >&5
4132 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4133
4134 # Check whether --with-build-cflags or --without-build-cflags was given.
4135 if test "${with_build_cflags+set}" = set; then
4136   withval="$with_build_cflags"
4137   BUILD_CFLAGS="$withval"
4138 fi;
4139         echo "$as_me:4139: result: $BUILD_CFLAGS" >&5
4140 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4141
4142         echo "$as_me:4142: checking for native build C preprocessor-flags" >&5
4143 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4144
4145 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4146 if test "${with_build_cppflags+set}" = set; then
4147   withval="$with_build_cppflags"
4148   BUILD_CPPFLAGS="$withval"
4149 fi;
4150         echo "$as_me:4150: result: $BUILD_CPPFLAGS" >&5
4151 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4152
4153         echo "$as_me:4153: checking for native build linker-flags" >&5
4154 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4155
4156 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4157 if test "${with_build_ldflags+set}" = set; then
4158   withval="$with_build_ldflags"
4159   BUILD_LDFLAGS="$withval"
4160 fi;
4161         echo "$as_me:4161: result: $BUILD_LDFLAGS" >&5
4162 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4163
4164         echo "$as_me:4164: checking for native build linker-libraries" >&5
4165 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4166
4167 # Check whether --with-build-libs or --without-build-libs was given.
4168 if test "${with_build_libs+set}" = set; then
4169   withval="$with_build_libs"
4170   BUILD_LIBS="$withval"
4171 fi;
4172         echo "$as_me:4172: result: $BUILD_LIBS" >&5
4173 echo "${ECHO_T}$BUILD_LIBS" >&6
4174
4175         # this assumes we're on Unix.
4176         BUILD_EXEEXT=
4177         BUILD_OBJEXT=o
4178
4179         : ${BUILD_CC:='${CC}'}
4180
4181         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4182                 { { echo "$as_me:4182: error: Cross-build requires two compilers.
4183 Use --with-build-cc to specify the native compiler." >&5
4184 echo "$as_me: error: Cross-build requires two compilers.
4185 Use --with-build-cc to specify the native compiler." >&2;}
4186    { (exit 1); exit 1; }; }
4187         fi
4188
4189 else
4190         : ${BUILD_CC:='${CC}'}
4191         : ${BUILD_CPP:='${CPP}'}
4192         : ${BUILD_CFLAGS:='${CFLAGS}'}
4193         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4194         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4195         : ${BUILD_LIBS:='${LIBS}'}
4196         : ${BUILD_EXEEXT:='$x'}
4197         : ${BUILD_OBJEXT:='o'}
4198 fi
4199
4200 ###############################################################################
4201
4202 ### Options to allow the user to specify the set of libraries which are used.
4203 ### Use "--without-normal --with-shared" to allow the default model to be
4204 ### shared, for example.
4205 cf_list_models=""
4206
4207 echo "$as_me:4207: checking if you want to build shared C-objects" >&5
4208 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4209
4210 # Check whether --with-shared or --without-shared was given.
4211 if test "${with_shared+set}" = set; then
4212   withval="$with_shared"
4213   with_shared=$withval
4214 else
4215   with_shared=no
4216 fi;
4217 echo "$as_me:4217: result: $with_shared" >&5
4218 echo "${ECHO_T}$with_shared" >&6
4219 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4220
4221 echo "$as_me:4221: checking for specified models" >&5
4222 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4223 test -z "$cf_list_models" && cf_list_models=normal
4224 echo "$as_me:4224: result: $cf_list_models" >&5
4225 echo "${ECHO_T}$cf_list_models" >&6
4226
4227 ### Use the first model as the default, and save its suffix for use in building
4228 ### up test-applications.
4229 echo "$as_me:4229: checking for default model" >&5
4230 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4231 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4232 echo "$as_me:4232: result: $DFT_LWR_MODEL" >&5
4233 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4234
4235 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4236
4237 echo "$as_me:4237: checking for specific curses-directory" >&5
4238 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4239
4240 # Check whether --with-curses-dir or --without-curses-dir was given.
4241 if test "${with_curses_dir+set}" = set; then
4242   withval="$with_curses_dir"
4243   cf_cv_curses_dir=$withval
4244 else
4245   cf_cv_curses_dir=no
4246 fi;
4247 echo "$as_me:4247: result: $cf_cv_curses_dir" >&5
4248 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4249
4250 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4251 then
4252
4253 if test "x$prefix" != xNONE; then
4254         cf_path_syntax="$prefix"
4255 else
4256         cf_path_syntax="$ac_default_prefix"
4257 fi
4258
4259 case ".$withval" in
4260 (.\$\(*\)*|.\'*\'*)
4261         ;;
4262 (..|./*|.\\*)
4263         ;;
4264 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4265         ;;
4266 (.\$\{*prefix\}*|.\$\{*dir\}*)
4267         eval withval="$withval"
4268         case ".$withval" in
4269         (.NONE/*)
4270                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4271                 ;;
4272         esac
4273         ;;
4274 (.no|.NONE/*)
4275         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4276         ;;
4277 (*)
4278         { { echo "$as_me:4278: error: expected a pathname, not \"$withval\"" >&5
4279 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4280    { (exit 1); exit 1; }; }
4281         ;;
4282 esac
4283
4284         if test -d "$cf_cv_curses_dir"
4285         then
4286
4287 if test -n "$cf_cv_curses_dir/include" ; then
4288   for cf_add_incdir in $cf_cv_curses_dir/include
4289   do
4290         while test "$cf_add_incdir" != /usr/include
4291         do
4292           if test -d "$cf_add_incdir"
4293           then
4294                 cf_have_incdir=no
4295                 if test -n "$CFLAGS$CPPFLAGS" ; then
4296                   # a loop is needed to ensure we can add subdirs of existing dirs
4297                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4298                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4299                           cf_have_incdir=yes; break
4300                         fi
4301                   done
4302                 fi
4303
4304                 if test "$cf_have_incdir" = no ; then
4305                   if test "$cf_add_incdir" = /usr/local/include ; then
4306                         if test "$GCC" = yes
4307                         then
4308                           cf_save_CPPFLAGS=$CPPFLAGS
4309
4310         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4311         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4312
4313                           cat >"conftest.$ac_ext" <<_ACEOF
4314 #line 4314 "configure"
4315 #include "confdefs.h"
4316 #include <stdio.h>
4317 int
4318 main (void)
4319 {
4320 printf("Hello")
4321   ;
4322   return 0;
4323 }
4324 _ACEOF
4325 rm -f "conftest.$ac_objext"
4326 if { (eval echo "$as_me:4326: \"$ac_compile\"") >&5
4327   (eval $ac_compile) 2>&5
4328   ac_status=$?
4329   echo "$as_me:4329: \$? = $ac_status" >&5
4330   (exit "$ac_status"); } &&
4331          { ac_try='test -s "conftest.$ac_objext"'
4332   { (eval echo "$as_me:4332: \"$ac_try\"") >&5
4333   (eval $ac_try) 2>&5
4334   ac_status=$?
4335   echo "$as_me:4335: \$? = $ac_status" >&5
4336   (exit "$ac_status"); }; }; then
4337   :
4338 else
4339   echo "$as_me: failed program was:" >&5
4340 cat "conftest.$ac_ext" >&5
4341 cf_have_incdir=yes
4342 fi
4343 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4344                           CPPFLAGS=$cf_save_CPPFLAGS
4345                         fi
4346                   fi
4347                 fi
4348
4349                 if test "$cf_have_incdir" = no ; then
4350                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4351
4352 echo "${as_me:-configure}:4352: testing adding $cf_add_incdir to include-path ..." 1>&5
4353
4354                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4355
4356                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4357                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4358                   cf_add_incdir="$cf_top_incdir"
4359                 else
4360                   break
4361                 fi
4362           else
4363                 break
4364           fi
4365         done
4366   done
4367 fi
4368
4369 if test -n "$cf_cv_curses_dir/lib" ; then
4370         for cf_add_libdir in $cf_cv_curses_dir/lib
4371         do
4372                 if test "$cf_add_libdir" = /usr/lib ; then
4373                         :
4374                 elif test -d "$cf_add_libdir"
4375                 then
4376                         cf_have_libdir=no
4377                         if test -n "$LDFLAGS$LIBS" ; then
4378                                 # a loop is needed to ensure we can add subdirs of existing dirs
4379                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4380                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4381                                                 cf_have_libdir=yes; break
4382                                         fi
4383                                 done
4384                         fi
4385                         if test "$cf_have_libdir" = no ; then
4386                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4387
4388 echo "${as_me:-configure}:4388: testing adding $cf_add_libdir to library-path ..." 1>&5
4389
4390                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4391                         fi
4392                 fi
4393         done
4394 fi
4395
4396         fi
4397 fi
4398
4399 cf_ncuconfig_root=ncurses
4400 cf_have_ncuconfig=no
4401
4402 if test "x${PKG_CONFIG:=none}" != xnone; then
4403         echo "$as_me:4403: checking pkg-config for $cf_ncuconfig_root" >&5
4404 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4405         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4406                 echo "$as_me:4406: result: yes" >&5
4407 echo "${ECHO_T}yes" >&6
4408
4409                 echo "$as_me:4409: checking if the $cf_ncuconfig_root package files work" >&5
4410 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4411                 cf_have_ncuconfig=unknown
4412
4413                 cf_save_CFLAGS="$CFLAGS"
4414                 cf_save_CPPFLAGS="$CPPFLAGS"
4415                 cf_save_LIBS="$LIBS"
4416
4417                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4418                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4419
4420                 # while -W for passing linker flags is prevalent, it is not "standard".
4421                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4422                 # incompatible _and_ non-standard -W option which gives an error.  Work
4423                 # around that pitfall.
4424                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4425                 (x*c[89]9@@*-W*)
4426
4427 cf_fix_cppflags=no
4428 cf_new_cflags=
4429 cf_new_cppflags=
4430 cf_new_extra_cppflags=
4431
4432 for cf_add_cflags in $cf_pkg_cflags
4433 do
4434 case "$cf_fix_cppflags" in
4435 (no)
4436         case "$cf_add_cflags" in
4437         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4438                 case "$cf_add_cflags" in
4439                 (-D*)
4440                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4441
4442                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4443                                 && test -z "${cf_tst_cflags}" \
4444                                 && cf_fix_cppflags=yes
4445
4446                         if test "$cf_fix_cppflags" = yes ; then
4447
4448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4450
4451                                 continue
4452                         elif test "${cf_tst_cflags}" = "\"'" ; then
4453
4454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4456
4457                                 continue
4458                         fi
4459                         ;;
4460                 esac
4461                 case "$CPPFLAGS" in
4462                 (*$cf_add_cflags)
4463                         ;;
4464                 (*)
4465                         case "$cf_add_cflags" in
4466                         (-D*)
4467                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4468
4469 CPPFLAGS=`echo "$CPPFLAGS" | \
4470         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4471                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4472
4473                                 ;;
4474                         esac
4475
4476         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4477         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4478
4479                         ;;
4480                 esac
4481                 ;;
4482         (*)
4483
4484         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4485         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4486
4487                 ;;
4488         esac
4489         ;;
4490 (yes)
4491
4492         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4493         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4494
4495         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4496
4497         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4498                 && test -z "${cf_tst_cflags}" \
4499                 && cf_fix_cppflags=no
4500         ;;
4501 esac
4502 done
4503
4504 if test -n "$cf_new_cflags" ; then
4505
4506         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4507         CFLAGS="${CFLAGS}$cf_new_cflags"
4508
4509 fi
4510
4511 if test -n "$cf_new_cppflags" ; then
4512
4513         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4514         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4515
4516 fi
4517
4518 if test -n "$cf_new_extra_cppflags" ; then
4519
4520         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4521         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4522
4523 fi
4524
4525 cf_add_libs="$LIBS"
4526 # reverse order
4527 cf_add_0lib=
4528 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4529 # filter duplicates
4530 for cf_add_1lib in $cf_add_0lib; do
4531         for cf_add_2lib in $cf_add_libs; do
4532                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4533                         cf_add_1lib=
4534                         break
4535                 fi
4536         done
4537         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4538 done
4539 LIBS="$cf_add_libs"
4540
4541                         cat >"conftest.$ac_ext" <<_ACEOF
4542 #line 4542 "configure"
4543 #include "confdefs.h"
4544 #include <${cf_cv_ncurses_header:-curses.h}>
4545 int
4546 main (void)
4547 {
4548 initscr(); mousemask(0,0); tigetstr((char *)0);
4549   ;
4550   return 0;
4551 }
4552 _ACEOF
4553 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4554 if { (eval echo "$as_me:4554: \"$ac_link\"") >&5
4555   (eval $ac_link) 2>&5
4556   ac_status=$?
4557   echo "$as_me:4557: \$? = $ac_status" >&5
4558   (exit "$ac_status"); } &&
4559          { ac_try='test -s "conftest$ac_exeext"'
4560   { (eval echo "$as_me:4560: \"$ac_try\"") >&5
4561   (eval $ac_try) 2>&5
4562   ac_status=$?
4563   echo "$as_me:4563: \$? = $ac_status" >&5
4564   (exit "$ac_status"); }; }; then
4565   if test "$cross_compiling" = yes; then
4566   cf_test_ncuconfig=maybe
4567 else
4568   cat >"conftest.$ac_ext" <<_ACEOF
4569 #line 4569 "configure"
4570 #include "confdefs.h"
4571 #include <${cf_cv_ncurses_header:-curses.h}>
4572                                         int main(void)
4573                                         { char *xx = curses_version(); return (xx == 0); }
4574 _ACEOF
4575 rm -f "conftest$ac_exeext"
4576 if { (eval echo "$as_me:4576: \"$ac_link\"") >&5
4577   (eval $ac_link) 2>&5
4578   ac_status=$?
4579   echo "$as_me:4579: \$? = $ac_status" >&5
4580   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4581   { (eval echo "$as_me:4581: \"$ac_try\"") >&5
4582   (eval $ac_try) 2>&5
4583   ac_status=$?
4584   echo "$as_me:4584: \$? = $ac_status" >&5
4585   (exit "$ac_status"); }; }; then
4586   cf_test_ncuconfig=yes
4587 else
4588   echo "$as_me: program exited with status $ac_status" >&5
4589 echo "$as_me: failed program was:" >&5
4590 cat "conftest.$ac_ext" >&5
4591 cf_test_ncuconfig=no
4592 fi
4593 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4594 fi
4595 else
4596   echo "$as_me: failed program was:" >&5
4597 cat "conftest.$ac_ext" >&5
4598 cf_test_ncuconfig=no
4599 fi
4600 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4601
4602                         CFLAGS="$cf_save_CFLAGS"
4603                         CPPFLAGS="$cf_save_CPPFLAGS"
4604                         LIBS="$cf_save_LIBS"
4605
4606                         if test "x$cf_test_ncuconfig" != xyes; then
4607                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4608                                 cf_pkg_cflags="$cf_temp"
4609                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4610                                 cf_pkg_libs="$cf_temp"
4611                         fi
4612                         ;;
4613                 esac
4614
4615 cf_fix_cppflags=no
4616 cf_new_cflags=
4617 cf_new_cppflags=
4618 cf_new_extra_cppflags=
4619
4620 for cf_add_cflags in $cf_pkg_cflags
4621 do
4622 case "$cf_fix_cppflags" in
4623 (no)
4624         case "$cf_add_cflags" in
4625         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4626                 case "$cf_add_cflags" in
4627                 (-D*)
4628                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4629
4630                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4631                                 && test -z "${cf_tst_cflags}" \
4632                                 && cf_fix_cppflags=yes
4633
4634                         if test "$cf_fix_cppflags" = yes ; then
4635
4636         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4637         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4638
4639                                 continue
4640                         elif test "${cf_tst_cflags}" = "\"'" ; then
4641
4642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4644
4645                                 continue
4646                         fi
4647                         ;;
4648                 esac
4649                 case "$CPPFLAGS" in
4650                 (*$cf_add_cflags)
4651                         ;;
4652                 (*)
4653                         case "$cf_add_cflags" in
4654                         (-D*)
4655                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4656
4657 CPPFLAGS=`echo "$CPPFLAGS" | \
4658         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4659                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4660
4661                                 ;;
4662                         esac
4663
4664         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4665         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4666
4667                         ;;
4668                 esac
4669                 ;;
4670         (*)
4671
4672         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4673         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4674
4675                 ;;
4676         esac
4677         ;;
4678 (yes)
4679
4680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4682
4683         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4684
4685         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4686                 && test -z "${cf_tst_cflags}" \
4687                 && cf_fix_cppflags=no
4688         ;;
4689 esac
4690 done
4691
4692 if test -n "$cf_new_cflags" ; then
4693
4694         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4695         CFLAGS="${CFLAGS}$cf_new_cflags"
4696
4697 fi
4698
4699 if test -n "$cf_new_cppflags" ; then
4700
4701         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4702         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4703
4704 fi
4705
4706 if test -n "$cf_new_extra_cppflags" ; then
4707
4708         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4709         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4710
4711 fi
4712
4713 cf_add_libs="$LIBS"
4714 # reverse order
4715 cf_add_0lib=
4716 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4717 # filter duplicates
4718 for cf_add_1lib in $cf_add_0lib; do
4719         for cf_add_2lib in $cf_add_libs; do
4720                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4721                         cf_add_1lib=
4722                         break
4723                 fi
4724         done
4725         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4726 done
4727 LIBS="$cf_add_libs"
4728
4729                 cat >"conftest.$ac_ext" <<_ACEOF
4730 #line 4730 "configure"
4731 #include "confdefs.h"
4732 #include <${cf_cv_ncurses_header:-curses.h}>
4733 int
4734 main (void)
4735 {
4736 initscr(); mousemask(0,0); tigetstr((char *)0);
4737   ;
4738   return 0;
4739 }
4740 _ACEOF
4741 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4742 if { (eval echo "$as_me:4742: \"$ac_link\"") >&5
4743   (eval $ac_link) 2>&5
4744   ac_status=$?
4745   echo "$as_me:4745: \$? = $ac_status" >&5
4746   (exit "$ac_status"); } &&
4747          { ac_try='test -s "conftest$ac_exeext"'
4748   { (eval echo "$as_me:4748: \"$ac_try\"") >&5
4749   (eval $ac_try) 2>&5
4750   ac_status=$?
4751   echo "$as_me:4751: \$? = $ac_status" >&5
4752   (exit "$ac_status"); }; }; then
4753   if test "$cross_compiling" = yes; then
4754   cf_have_ncuconfig=maybe
4755 else
4756   cat >"conftest.$ac_ext" <<_ACEOF
4757 #line 4757 "configure"
4758 #include "confdefs.h"
4759 #include <${cf_cv_ncurses_header:-curses.h}>
4760                                 int main(void)
4761                                 { char *xx = curses_version(); return (xx == 0); }
4762 _ACEOF
4763 rm -f "conftest$ac_exeext"
4764 if { (eval echo "$as_me:4764: \"$ac_link\"") >&5
4765   (eval $ac_link) 2>&5
4766   ac_status=$?
4767   echo "$as_me:4767: \$? = $ac_status" >&5
4768   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4769   { (eval echo "$as_me:4769: \"$ac_try\"") >&5
4770   (eval $ac_try) 2>&5
4771   ac_status=$?
4772   echo "$as_me:4772: \$? = $ac_status" >&5
4773   (exit "$ac_status"); }; }; then
4774   cf_have_ncuconfig=yes
4775 else
4776   echo "$as_me: program exited with status $ac_status" >&5
4777 echo "$as_me: failed program was:" >&5
4778 cat "conftest.$ac_ext" >&5
4779 cf_have_ncuconfig=no
4780 fi
4781 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4782 fi
4783 else
4784   echo "$as_me: failed program was:" >&5
4785 cat "conftest.$ac_ext" >&5
4786 cf_have_ncuconfig=no
4787 fi
4788 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4789                 echo "$as_me:4789: result: $cf_have_ncuconfig" >&5
4790 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4791                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4792                 if test "$cf_have_ncuconfig" != "yes"
4793                 then
4794                         CPPFLAGS="$cf_save_CPPFLAGS"
4795                         LIBS="$cf_save_LIBS"
4796                         NCURSES_CONFIG_PKG=none
4797                 else
4798
4799 cat >>confdefs.h <<\EOF
4800 #define NCURSES 1
4801 EOF
4802
4803                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4804
4805 echo "$as_me:4805: checking for terminfo header" >&5
4806 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4807 if test "${cf_cv_term_header+set}" = set; then
4808   echo $ECHO_N "(cached) $ECHO_C" >&6
4809 else
4810
4811 case "${cf_cv_ncurses_header}" in
4812 (*/ncurses.h|*/ncursesw.h)
4813         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4814         ;;
4815 (*)
4816         cf_term_header=term.h
4817         ;;
4818 esac
4819
4820 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4821 do
4822 cat >"conftest.$ac_ext" <<_ACEOF
4823 #line 4823 "configure"
4824 #include "confdefs.h"
4825 #include <stdio.h>
4826 #include <${cf_cv_ncurses_header:-curses.h}>
4827 #include <$cf_test>
4828
4829 int
4830 main (void)
4831 {
4832 int x = auto_left_margin; (void)x
4833   ;
4834   return 0;
4835 }
4836 _ACEOF
4837 rm -f "conftest.$ac_objext"
4838 if { (eval echo "$as_me:4838: \"$ac_compile\"") >&5
4839   (eval $ac_compile) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit "$ac_status"); } &&
4843          { ac_try='test -s "conftest.$ac_objext"'
4844   { (eval echo "$as_me:4844: \"$ac_try\"") >&5
4845   (eval $ac_try) 2>&5
4846   ac_status=$?
4847   echo "$as_me:4847: \$? = $ac_status" >&5
4848   (exit "$ac_status"); }; }; then
4849
4850         cf_cv_term_header="$cf_test"
4851 else
4852   echo "$as_me: failed program was:" >&5
4853 cat "conftest.$ac_ext" >&5
4854
4855         cf_cv_term_header=unknown
4856
4857 fi
4858 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4859         test "$cf_cv_term_header" != unknown && break
4860 done
4861
4862 fi
4863 echo "$as_me:4863: result: $cf_cv_term_header" >&5
4864 echo "${ECHO_T}$cf_cv_term_header" >&6
4865
4866 # Set definitions to allow ifdef'ing to accommodate subdirectories
4867
4868 case "$cf_cv_term_header" in
4869 (*term.h)
4870
4871 cat >>confdefs.h <<\EOF
4872 #define HAVE_TERM_H 1
4873 EOF
4874
4875         ;;
4876 esac
4877
4878 case "$cf_cv_term_header" in
4879 (ncurses/term.h)
4880
4881 cat >>confdefs.h <<\EOF
4882 #define HAVE_NCURSES_TERM_H 1
4883 EOF
4884
4885         ;;
4886 (ncursesw/term.h)
4887
4888 cat >>confdefs.h <<\EOF
4889 #define HAVE_NCURSESW_TERM_H 1
4890 EOF
4891
4892         ;;
4893 esac
4894
4895                 fi
4896
4897         else
4898                 echo "$as_me:4898: result: no" >&5
4899 echo "${ECHO_T}no" >&6
4900                 NCURSES_CONFIG_PKG=none
4901         fi
4902 else
4903         NCURSES_CONFIG_PKG=none
4904 fi
4905
4906 if test "x$cf_have_ncuconfig" = "xno"; then
4907         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4908
4909 if test -n "$ac_tool_prefix"; then
4910   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4911   do
4912     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4913 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4914 echo "$as_me:4914: checking for $ac_word" >&5
4915 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4916 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4917   echo $ECHO_N "(cached) $ECHO_C" >&6
4918 else
4919   if test -n "$NCURSES_CONFIG"; then
4920   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4921 else
4922   ac_save_IFS=$IFS; IFS=$ac_path_separator
4923 ac_dummy="$PATH"
4924 for ac_dir in $ac_dummy; do
4925   IFS=$ac_save_IFS
4926   test -z "$ac_dir" && ac_dir=.
4927   $as_executable_p "$ac_dir/$ac_word" || continue
4928 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4929 echo "$as_me:4929: found $ac_dir/$ac_word" >&5
4930 break
4931 done
4932
4933 fi
4934 fi
4935 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4936 if test -n "$NCURSES_CONFIG"; then
4937   echo "$as_me:4937: result: $NCURSES_CONFIG" >&5
4938 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4939 else
4940   echo "$as_me:4940: result: no" >&5
4941 echo "${ECHO_T}no" >&6
4942 fi
4943
4944     test -n "$NCURSES_CONFIG" && break
4945   done
4946 fi
4947 if test -z "$NCURSES_CONFIG"; then
4948   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4949   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4950 do
4951   # Extract the first word of "$ac_prog", so it can be a program name with args.
4952 set dummy $ac_prog; ac_word=$2
4953 echo "$as_me:4953: checking for $ac_word" >&5
4954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4955 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4956   echo $ECHO_N "(cached) $ECHO_C" >&6
4957 else
4958   if test -n "$ac_ct_NCURSES_CONFIG"; then
4959   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4960 else
4961   ac_save_IFS=$IFS; IFS=$ac_path_separator
4962 ac_dummy="$PATH"
4963 for ac_dir in $ac_dummy; do
4964   IFS=$ac_save_IFS
4965   test -z "$ac_dir" && ac_dir=.
4966   $as_executable_p "$ac_dir/$ac_word" || continue
4967 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4968 echo "$as_me:4968: found $ac_dir/$ac_word" >&5
4969 break
4970 done
4971
4972 fi
4973 fi
4974 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4975 if test -n "$ac_ct_NCURSES_CONFIG"; then
4976   echo "$as_me:4976: result: $ac_ct_NCURSES_CONFIG" >&5
4977 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4978 else
4979   echo "$as_me:4979: result: no" >&5
4980 echo "${ECHO_T}no" >&6
4981 fi
4982
4983   test -n "$ac_ct_NCURSES_CONFIG" && break
4984 done
4985 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4986
4987   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4988 fi
4989
4990         if test "$NCURSES_CONFIG" != none ; then
4991
4992 cf_fix_cppflags=no
4993 cf_new_cflags=
4994 cf_new_cppflags=
4995 cf_new_extra_cppflags=
4996
4997 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4998 do
4999 case "$cf_fix_cppflags" in
5000 (no)
5001         case "$cf_add_cflags" in
5002         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5003                 case "$cf_add_cflags" in
5004                 (-D*)
5005                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5006
5007                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5008                                 && test -z "${cf_tst_cflags}" \
5009                                 && cf_fix_cppflags=yes
5010
5011                         if test "$cf_fix_cppflags" = yes ; then
5012
5013         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5014         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5015
5016                                 continue
5017                         elif test "${cf_tst_cflags}" = "\"'" ; then
5018
5019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5021
5022                                 continue
5023                         fi
5024                         ;;
5025                 esac
5026                 case "$CPPFLAGS" in
5027                 (*$cf_add_cflags)
5028                         ;;
5029                 (*)
5030                         case "$cf_add_cflags" in
5031                         (-D*)
5032                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5033
5034 CPPFLAGS=`echo "$CPPFLAGS" | \
5035         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5036                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5037
5038                                 ;;
5039                         esac
5040
5041         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5042         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5043
5044                         ;;
5045                 esac
5046                 ;;
5047         (*)
5048
5049         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5050         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5051
5052                 ;;
5053         esac
5054         ;;
5055 (yes)
5056
5057         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5058         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5059
5060         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5061
5062         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5063                 && test -z "${cf_tst_cflags}" \
5064                 && cf_fix_cppflags=no
5065         ;;
5066 esac
5067 done
5068
5069 if test -n "$cf_new_cflags" ; then
5070
5071         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5072         CFLAGS="${CFLAGS}$cf_new_cflags"
5073
5074 fi
5075
5076 if test -n "$cf_new_cppflags" ; then
5077
5078         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5079         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5080
5081 fi
5082
5083 if test -n "$cf_new_extra_cppflags" ; then
5084
5085         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5086         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5087
5088 fi
5089
5090 cf_add_libs="$LIBS"
5091 # reverse order
5092 cf_add_0lib=
5093 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5094 # filter duplicates
5095 for cf_add_1lib in $cf_add_0lib; do
5096         for cf_add_2lib in $cf_add_libs; do
5097                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5098                         cf_add_1lib=
5099                         break
5100                 fi
5101         done
5102         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5103 done
5104 LIBS="$cf_add_libs"
5105
5106                 # even with config script, some packages use no-override for curses.h
5107
5108 echo "$as_me:5108: checking if we have identified curses headers" >&5
5109 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5110 if test "${cf_cv_ncurses_header+set}" = set; then
5111   echo $ECHO_N "(cached) $ECHO_C" >&6
5112 else
5113
5114 cf_cv_ncurses_header=none
5115 for cf_header in \
5116         ncurses.h ncurses/ncurses.h \
5117         curses.h ncurses/curses.h
5118 do
5119 cat >"conftest.$ac_ext" <<_ACEOF
5120 #line 5120 "configure"
5121 #include "confdefs.h"
5122 #include <${cf_header}>
5123 int
5124 main (void)
5125 {
5126 initscr(); tgoto("?", 0,0)
5127   ;
5128   return 0;
5129 }
5130 _ACEOF
5131 rm -f "conftest.$ac_objext"
5132 if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
5133   (eval $ac_compile) 2>&5
5134   ac_status=$?
5135   echo "$as_me:5135: \$? = $ac_status" >&5
5136   (exit "$ac_status"); } &&
5137          { ac_try='test -s "conftest.$ac_objext"'
5138   { (eval echo "$as_me:5138: \"$ac_try\"") >&5
5139   (eval $ac_try) 2>&5
5140   ac_status=$?
5141   echo "$as_me:5141: \$? = $ac_status" >&5
5142   (exit "$ac_status"); }; }; then
5143   cf_cv_ncurses_header=$cf_header; break
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat "conftest.$ac_ext" >&5
5147 fi
5148 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5149 done
5150
5151 fi
5152 echo "$as_me:5152: result: $cf_cv_ncurses_header" >&5
5153 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5154
5155 if test "$cf_cv_ncurses_header" = none ; then
5156         { { echo "$as_me:5156: error: No curses header-files found" >&5
5157 echo "$as_me: error: No curses header-files found" >&2;}
5158    { (exit 1); exit 1; }; }
5159 fi
5160
5161 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5162
5163 for ac_header in $cf_cv_ncurses_header
5164 do
5165 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5166 echo "$as_me:5166: checking for $ac_header" >&5
5167 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5168 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5169   echo $ECHO_N "(cached) $ECHO_C" >&6
5170 else
5171   cat >"conftest.$ac_ext" <<_ACEOF
5172 #line 5172 "configure"
5173 #include "confdefs.h"
5174 #include <$ac_header>
5175 _ACEOF
5176 if { (eval echo "$as_me:5176: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5177   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5178   ac_status=$?
5179   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5180   rm -f conftest.er1
5181   cat conftest.err >&5
5182   echo "$as_me:5182: \$? = $ac_status" >&5
5183   (exit "$ac_status"); } >/dev/null; then
5184   if test -s conftest.err; then
5185     ac_cpp_err=$ac_c_preproc_warn_flag
5186   else
5187     ac_cpp_err=
5188   fi
5189 else
5190   ac_cpp_err=yes
5191 fi
5192 if test -z "$ac_cpp_err"; then
5193   eval "$as_ac_Header=yes"
5194 else
5195   echo "$as_me: failed program was:" >&5
5196   cat "conftest.$ac_ext" >&5
5197   eval "$as_ac_Header=no"
5198 fi
5199 rm -f conftest.err "conftest.$ac_ext"
5200 fi
5201 echo "$as_me:5201: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5202 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5203 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5204   cat >>confdefs.h <<EOF
5205 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5206 EOF
5207
5208 fi
5209 done
5210
5211 cat >>confdefs.h <<\EOF
5212 #define NCURSES 1
5213 EOF
5214
5215 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5216
5217                 cat >>confdefs.h <<EOF
5218 #define $cf_nculib_ROOT 1
5219 EOF
5220
5221                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5222
5223         else
5224
5225 cf_ncuhdr_root=ncurses
5226
5227 test -n "$cf_cv_curses_dir" && \
5228 test "$cf_cv_curses_dir" != "no" && { \
5229
5230 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5231   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5232   do
5233         while test "$cf_add_incdir" != /usr/include
5234         do
5235           if test -d "$cf_add_incdir"
5236           then
5237                 cf_have_incdir=no
5238                 if test -n "$CFLAGS$CPPFLAGS" ; then
5239                   # a loop is needed to ensure we can add subdirs of existing dirs
5240                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5241                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5242                           cf_have_incdir=yes; break
5243                         fi
5244                   done
5245                 fi
5246
5247                 if test "$cf_have_incdir" = no ; then
5248                   if test "$cf_add_incdir" = /usr/local/include ; then
5249                         if test "$GCC" = yes
5250                         then
5251                           cf_save_CPPFLAGS=$CPPFLAGS
5252
5253         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5254         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5255
5256                           cat >"conftest.$ac_ext" <<_ACEOF
5257 #line 5257 "configure"
5258 #include "confdefs.h"
5259 #include <stdio.h>
5260 int
5261 main (void)
5262 {
5263 printf("Hello")
5264   ;
5265   return 0;
5266 }
5267 _ACEOF
5268 rm -f "conftest.$ac_objext"
5269 if { (eval echo "$as_me:5269: \"$ac_compile\"") >&5
5270   (eval $ac_compile) 2>&5
5271   ac_status=$?
5272   echo "$as_me:5272: \$? = $ac_status" >&5
5273   (exit "$ac_status"); } &&
5274          { ac_try='test -s "conftest.$ac_objext"'
5275   { (eval echo "$as_me:5275: \"$ac_try\"") >&5
5276   (eval $ac_try) 2>&5
5277   ac_status=$?
5278   echo "$as_me:5278: \$? = $ac_status" >&5
5279   (exit "$ac_status"); }; }; then
5280   :
5281 else
5282   echo "$as_me: failed program was:" >&5
5283 cat "conftest.$ac_ext" >&5
5284 cf_have_incdir=yes
5285 fi
5286 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5287                           CPPFLAGS=$cf_save_CPPFLAGS
5288                         fi
5289                   fi
5290                 fi
5291
5292                 if test "$cf_have_incdir" = no ; then
5293                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5294
5295 echo "${as_me:-configure}:5295: testing adding $cf_add_incdir to include-path ..." 1>&5
5296
5297                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5298
5299                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5300                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5301                   cf_add_incdir="$cf_top_incdir"
5302                 else
5303                   break
5304                 fi
5305           else
5306                 break
5307           fi
5308         done
5309   done
5310 fi
5311
5312 }
5313
5314 echo "$as_me:5314: checking for $cf_ncuhdr_root header in include-path" >&5
5315 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5316 if test "${cf_cv_ncurses_h+set}" = set; then
5317   echo $ECHO_N "(cached) $ECHO_C" >&6
5318 else
5319
5320         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5321         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5322         for cf_header in $cf_header_list
5323         do
5324
5325         cat >"conftest.$ac_ext" <<_ACEOF
5326 #line 5326 "configure"
5327 #include "confdefs.h"
5328
5329 #include <$cf_header>
5330 int
5331 main (void)
5332 {
5333
5334 #ifdef NCURSES_VERSION
5335
5336 printf("%s\\n", NCURSES_VERSION);
5337 #else
5338 #ifdef __NCURSES_H
5339 printf("old\\n");
5340 #else
5341         make an error
5342 #endif
5343 #endif
5344
5345   ;
5346   return 0;
5347 }
5348 _ACEOF
5349 rm -f "conftest.$ac_objext"
5350 if { (eval echo "$as_me:5350: \"$ac_compile\"") >&5
5351   (eval $ac_compile) 2>&5
5352   ac_status=$?
5353   echo "$as_me:5353: \$? = $ac_status" >&5
5354   (exit "$ac_status"); } &&
5355          { ac_try='test -s "conftest.$ac_objext"'
5356   { (eval echo "$as_me:5356: \"$ac_try\"") >&5
5357   (eval $ac_try) 2>&5
5358   ac_status=$?
5359   echo "$as_me:5359: \$? = $ac_status" >&5
5360   (exit "$ac_status"); }; }; then
5361   cf_cv_ncurses_h=$cf_header
5362
5363 else
5364   echo "$as_me: failed program was:" >&5
5365 cat "conftest.$ac_ext" >&5
5366 cf_cv_ncurses_h=no
5367 fi
5368 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5369
5370                 test "$cf_cv_ncurses_h" != no && break
5371         done
5372
5373 fi
5374 echo "$as_me:5374: result: $cf_cv_ncurses_h" >&5
5375 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5376
5377 if test "$cf_cv_ncurses_h" != no ; then
5378         cf_cv_ncurses_header=$cf_cv_ncurses_h
5379 else
5380
5381 echo "$as_me:5381: checking for $cf_ncuhdr_root include-path" >&5
5382 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5383 if test "${cf_cv_ncurses_h2+set}" = set; then
5384   echo $ECHO_N "(cached) $ECHO_C" >&6
5385 else
5386
5387         test -n "$verbose" && echo
5388
5389 cf_search=
5390
5391 # collect the current set of include-directories from compiler flags
5392 cf_header_path_list=""
5393 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5394         for cf_header_path in $CPPFLAGS $CFLAGS
5395         do
5396                 case "$cf_header_path" in
5397                 (-I*)
5398                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5399
5400 test "x$cf_header_path" != "xNONE" && \
5401 test -d "$cf_header_path" && \
5402  {
5403         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5404         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5405         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5406         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5407         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5408         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"
5409 }
5410
5411                         cf_header_path_list="$cf_header_path_list $cf_search"
5412                         ;;
5413                 esac
5414         done
5415 fi
5416
5417 # add the variations for the package we are looking for
5418
5419 cf_search=
5420
5421 test "x$prefix" != "xNONE" && \
5422 test -d "$prefix" && \
5423  {
5424         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5425         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5426         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5427         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5428         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5429         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5430 }
5431
5432 for cf_subdir_prefix in \
5433         /usr \
5434         /usr/local \
5435         /usr/pkg \
5436         /opt \
5437         /opt/local \
5438         $HOME
5439 do
5440
5441 test "x$cf_subdir_prefix" != "x$prefix" && \
5442 test -d "$cf_subdir_prefix" && \
5443 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5444         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5445         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5446         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5447         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5448         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5449         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"
5450 }
5451
5452 done
5453
5454 test "$includedir" != NONE && \
5455 test "$includedir" != "/usr/include" && \
5456 test -d "$includedir" && {
5457         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5458         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5459 }
5460
5461 test "$oldincludedir" != NONE && \
5462 test "$oldincludedir" != "/usr/include" && \
5463 test -d "$oldincludedir" && {
5464         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5465         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5466 }
5467
5468 cf_search="$cf_search $cf_header_path_list"
5469
5470         test -n "$verbose" && echo "search path $cf_search"
5471         cf_save2_CPPFLAGS="$CPPFLAGS"
5472         for cf_incdir in $cf_search
5473         do
5474
5475 if test -n "$cf_incdir" ; then
5476   for cf_add_incdir in $cf_incdir
5477   do
5478         while test "$cf_add_incdir" != /usr/include
5479         do
5480           if test -d "$cf_add_incdir"
5481           then
5482                 cf_have_incdir=no
5483                 if test -n "$CFLAGS$CPPFLAGS" ; then
5484                   # a loop is needed to ensure we can add subdirs of existing dirs
5485                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5486                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5487                           cf_have_incdir=yes; break
5488                         fi
5489                   done
5490                 fi
5491
5492                 if test "$cf_have_incdir" = no ; then
5493                   if test "$cf_add_incdir" = /usr/local/include ; then
5494                         if test "$GCC" = yes
5495                         then
5496                           cf_save_CPPFLAGS=$CPPFLAGS
5497
5498         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5499         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5500
5501                           cat >"conftest.$ac_ext" <<_ACEOF
5502 #line 5502 "configure"
5503 #include "confdefs.h"
5504 #include <stdio.h>
5505 int
5506 main (void)
5507 {
5508 printf("Hello")
5509   ;
5510   return 0;
5511 }
5512 _ACEOF
5513 rm -f "conftest.$ac_objext"
5514 if { (eval echo "$as_me:5514: \"$ac_compile\"") >&5
5515   (eval $ac_compile) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit "$ac_status"); } &&
5519          { ac_try='test -s "conftest.$ac_objext"'
5520   { (eval echo "$as_me:5520: \"$ac_try\"") >&5
5521   (eval $ac_try) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit "$ac_status"); }; }; then
5525   :
5526 else
5527   echo "$as_me: failed program was:" >&5
5528 cat "conftest.$ac_ext" >&5
5529 cf_have_incdir=yes
5530 fi
5531 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5532                           CPPFLAGS=$cf_save_CPPFLAGS
5533                         fi
5534                   fi
5535                 fi
5536
5537                 if test "$cf_have_incdir" = no ; then
5538                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5539
5540 echo "${as_me:-configure}:5540: testing adding $cf_add_incdir to include-path ..." 1>&5
5541
5542                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5543
5544                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5545                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5546                   cf_add_incdir="$cf_top_incdir"
5547                 else
5548                   break
5549                 fi
5550           else
5551                 break
5552           fi
5553         done
5554   done
5555 fi
5556
5557                 for cf_header in \
5558                         ncurses.h \
5559                         curses.h
5560                 do
5561
5562         cat >"conftest.$ac_ext" <<_ACEOF
5563 #line 5563 "configure"
5564 #include "confdefs.h"
5565
5566 #include <$cf_header>
5567 int
5568 main (void)
5569 {
5570
5571 #ifdef NCURSES_VERSION
5572
5573 printf("%s\\n", NCURSES_VERSION);
5574 #else
5575 #ifdef __NCURSES_H
5576 printf("old\\n");
5577 #else
5578         make an error
5579 #endif
5580 #endif
5581
5582   ;
5583   return 0;
5584 }
5585 _ACEOF
5586 rm -f "conftest.$ac_objext"
5587 if { (eval echo "$as_me:5587: \"$ac_compile\"") >&5
5588   (eval $ac_compile) 2>&5
5589   ac_status=$?
5590   echo "$as_me:5590: \$? = $ac_status" >&5
5591   (exit "$ac_status"); } &&
5592          { ac_try='test -s "conftest.$ac_objext"'
5593   { (eval echo "$as_me:5593: \"$ac_try\"") >&5
5594   (eval $ac_try) 2>&5
5595   ac_status=$?
5596   echo "$as_me:5596: \$? = $ac_status" >&5
5597   (exit "$ac_status"); }; }; then
5598   cf_cv_ncurses_h2=$cf_header
5599
5600 else
5601   echo "$as_me: failed program was:" >&5
5602 cat "conftest.$ac_ext" >&5
5603 cf_cv_ncurses_h2=no
5604 fi
5605 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5606
5607                         if test "$cf_cv_ncurses_h2" != no ; then
5608                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5609                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5610                                 break
5611                         fi
5612                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5613                 done
5614                 CPPFLAGS="$cf_save2_CPPFLAGS"
5615                 test "$cf_cv_ncurses_h2" != no && break
5616         done
5617         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5617: error: not found" >&5
5618 echo "$as_me: error: not found" >&2;}
5619    { (exit 1); exit 1; }; }
5620
5621 fi
5622 echo "$as_me:5622: result: $cf_cv_ncurses_h2" >&5
5623 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5624
5625         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5626         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5627         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5628                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5629         fi
5630
5631 if test -n "$cf_1st_incdir" ; then
5632   for cf_add_incdir in $cf_1st_incdir
5633   do
5634         while test "$cf_add_incdir" != /usr/include
5635         do
5636           if test -d "$cf_add_incdir"
5637           then
5638                 cf_have_incdir=no
5639                 if test -n "$CFLAGS$CPPFLAGS" ; then
5640                   # a loop is needed to ensure we can add subdirs of existing dirs
5641                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5642                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5643                           cf_have_incdir=yes; break
5644                         fi
5645                   done
5646                 fi
5647
5648                 if test "$cf_have_incdir" = no ; then
5649                   if test "$cf_add_incdir" = /usr/local/include ; then
5650                         if test "$GCC" = yes
5651                         then
5652                           cf_save_CPPFLAGS=$CPPFLAGS
5653
5654         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5655         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5656
5657                           cat >"conftest.$ac_ext" <<_ACEOF
5658 #line 5658 "configure"
5659 #include "confdefs.h"
5660 #include <stdio.h>
5661 int
5662 main (void)
5663 {
5664 printf("Hello")
5665   ;
5666   return 0;
5667 }
5668 _ACEOF
5669 rm -f "conftest.$ac_objext"
5670 if { (eval echo "$as_me:5670: \"$ac_compile\"") >&5
5671   (eval $ac_compile) 2>&5
5672   ac_status=$?
5673   echo "$as_me:5673: \$? = $ac_status" >&5
5674   (exit "$ac_status"); } &&
5675          { ac_try='test -s "conftest.$ac_objext"'
5676   { (eval echo "$as_me:5676: \"$ac_try\"") >&5
5677   (eval $ac_try) 2>&5
5678   ac_status=$?
5679   echo "$as_me:5679: \$? = $ac_status" >&5
5680   (exit "$ac_status"); }; }; then
5681   :
5682 else
5683   echo "$as_me: failed program was:" >&5
5684 cat "conftest.$ac_ext" >&5
5685 cf_have_incdir=yes
5686 fi
5687 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5688                           CPPFLAGS=$cf_save_CPPFLAGS
5689                         fi
5690                   fi
5691                 fi
5692
5693                 if test "$cf_have_incdir" = no ; then
5694                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5695
5696 echo "${as_me:-configure}:5696: testing adding $cf_add_incdir to include-path ..." 1>&5
5697
5698                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5699
5700                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5701                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5702                   cf_add_incdir="$cf_top_incdir"
5703                 else
5704                   break
5705                 fi
5706           else
5707                 break
5708           fi
5709         done
5710   done
5711 fi
5712
5713 fi
5714
5715 # Set definitions to allow ifdef'ing for ncurses.h
5716
5717 case "$cf_cv_ncurses_header" in
5718 (*ncurses.h)
5719
5720 cat >>confdefs.h <<\EOF
5721 #define HAVE_NCURSES_H 1
5722 EOF
5723
5724         ;;
5725 esac
5726
5727 case "$cf_cv_ncurses_header" in
5728 (ncurses/curses.h|ncurses/ncurses.h)
5729
5730 cat >>confdefs.h <<\EOF
5731 #define HAVE_NCURSES_NCURSES_H 1
5732 EOF
5733
5734         ;;
5735 (ncursesw/curses.h|ncursesw/ncurses.h)
5736
5737 cat >>confdefs.h <<\EOF
5738 #define HAVE_NCURSESW_NCURSES_H 1
5739 EOF
5740
5741         ;;
5742 esac
5743
5744 echo "$as_me:5744: checking for terminfo header" >&5
5745 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5746 if test "${cf_cv_term_header+set}" = set; then
5747   echo $ECHO_N "(cached) $ECHO_C" >&6
5748 else
5749
5750 case "${cf_cv_ncurses_header}" in
5751 (*/ncurses.h|*/ncursesw.h)
5752         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5753         ;;
5754 (*)
5755         cf_term_header=term.h
5756         ;;
5757 esac
5758
5759 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5760 do
5761 cat >"conftest.$ac_ext" <<_ACEOF
5762 #line 5762 "configure"
5763 #include "confdefs.h"
5764 #include <stdio.h>
5765 #include <${cf_cv_ncurses_header:-curses.h}>
5766 #include <$cf_test>
5767
5768 int
5769 main (void)
5770 {
5771 int x = auto_left_margin; (void)x
5772   ;
5773   return 0;
5774 }
5775 _ACEOF
5776 rm -f "conftest.$ac_objext"
5777 if { (eval echo "$as_me:5777: \"$ac_compile\"") >&5
5778   (eval $ac_compile) 2>&5
5779   ac_status=$?
5780   echo "$as_me:5780: \$? = $ac_status" >&5
5781   (exit "$ac_status"); } &&
5782          { ac_try='test -s "conftest.$ac_objext"'
5783   { (eval echo "$as_me:5783: \"$ac_try\"") >&5
5784   (eval $ac_try) 2>&5
5785   ac_status=$?
5786   echo "$as_me:5786: \$? = $ac_status" >&5
5787   (exit "$ac_status"); }; }; then
5788
5789         cf_cv_term_header="$cf_test"
5790 else
5791   echo "$as_me: failed program was:" >&5
5792 cat "conftest.$ac_ext" >&5
5793
5794         cf_cv_term_header=unknown
5795
5796 fi
5797 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5798         test "$cf_cv_term_header" != unknown && break
5799 done
5800
5801 fi
5802 echo "$as_me:5802: result: $cf_cv_term_header" >&5
5803 echo "${ECHO_T}$cf_cv_term_header" >&6
5804
5805 # Set definitions to allow ifdef'ing to accommodate subdirectories
5806
5807 case "$cf_cv_term_header" in
5808 (*term.h)
5809
5810 cat >>confdefs.h <<\EOF
5811 #define HAVE_TERM_H 1
5812 EOF
5813
5814         ;;
5815 esac
5816
5817 case "$cf_cv_term_header" in
5818 (ncurses/term.h)
5819
5820 cat >>confdefs.h <<\EOF
5821 #define HAVE_NCURSES_TERM_H 1
5822 EOF
5823
5824         ;;
5825 (ncursesw/term.h)
5826
5827 cat >>confdefs.h <<\EOF
5828 #define HAVE_NCURSESW_TERM_H 1
5829 EOF
5830
5831         ;;
5832 esac
5833
5834 # some applications need this, but should check for NCURSES_VERSION
5835
5836 cat >>confdefs.h <<\EOF
5837 #define NCURSES 1
5838 EOF
5839
5840 echo "$as_me:5840: checking for ncurses version" >&5
5841 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5842 if test "${cf_cv_ncurses_version+set}" = set; then
5843   echo $ECHO_N "(cached) $ECHO_C" >&6
5844 else
5845
5846         cf_cv_ncurses_version=no
5847         cf_tempfile=out$$
5848         rm -f "$cf_tempfile"
5849         if test "$cross_compiling" = yes; then
5850
5851         # This will not work if the preprocessor splits the line after the
5852         # Autoconf token.  The 'unproto' program does that.
5853         cat > "conftest.$ac_ext" <<EOF
5854 #include <${cf_cv_ncurses_header:-curses.h}>
5855 #undef Autoconf
5856 #ifdef NCURSES_VERSION
5857 Autoconf NCURSES_VERSION
5858 #else
5859 #ifdef __NCURSES_H
5860 Autoconf "old"
5861 #endif
5862 ;
5863 #endif
5864 EOF
5865         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5866         { (eval echo "$as_me:5866: \"$cf_try\"") >&5
5867   (eval $cf_try) 2>&5
5868   ac_status=$?
5869   echo "$as_me:5869: \$? = $ac_status" >&5
5870   (exit "$ac_status"); }
5871         if test -f conftest.out ; then
5872                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5873                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5874                 rm -f conftest.out
5875         fi
5876
5877 else
5878   cat >"conftest.$ac_ext" <<_ACEOF
5879 #line 5879 "configure"
5880 #include "confdefs.h"
5881
5882 #include <${cf_cv_ncurses_header:-curses.h}>
5883 #include <stdio.h>
5884 int main(void)
5885 {
5886         FILE *fp = fopen("$cf_tempfile", "w");
5887 #ifdef NCURSES_VERSION
5888 # ifdef NCURSES_VERSION_PATCH
5889         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5890 # else
5891         fprintf(fp, "%s\\n", NCURSES_VERSION);
5892 # endif
5893 #else
5894 # ifdef __NCURSES_H
5895         fprintf(fp, "old\\n");
5896 # else
5897         make an error
5898 # endif
5899 #endif
5900         ${cf_cv_main_return:-return}(0);
5901 }
5902 _ACEOF
5903 rm -f "conftest$ac_exeext"
5904 if { (eval echo "$as_me:5904: \"$ac_link\"") >&5
5905   (eval $ac_link) 2>&5
5906   ac_status=$?
5907   echo "$as_me:5907: \$? = $ac_status" >&5
5908   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5909   { (eval echo "$as_me:5909: \"$ac_try\"") >&5
5910   (eval $ac_try) 2>&5
5911   ac_status=$?
5912   echo "$as_me:5912: \$? = $ac_status" >&5
5913   (exit "$ac_status"); }; }; then
5914
5915         cf_cv_ncurses_version=`cat $cf_tempfile`
5916 else
5917   echo "$as_me: program exited with status $ac_status" >&5
5918 echo "$as_me: failed program was:" >&5
5919 cat "conftest.$ac_ext" >&5
5920 fi
5921 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5922 fi
5923         rm -f "$cf_tempfile"
5924
5925 fi
5926 echo "$as_me:5926: result: $cf_cv_ncurses_version" >&5
5927 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5928 test "$cf_cv_ncurses_version" = no ||
5929 cat >>confdefs.h <<\EOF
5930 #define NCURSES 1
5931 EOF
5932
5933 cf_nculib_root=ncurses
5934         # This works, except for the special case where we find gpm, but
5935         # ncurses is in a nonstandard location via $LIBS, and we really want
5936         # to link gpm.
5937 cf_ncurses_LIBS=""
5938 cf_ncurses_SAVE="$LIBS"
5939 echo "$as_me:5939: checking for Gpm_Open in -lgpm" >&5
5940 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5941 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5942   echo $ECHO_N "(cached) $ECHO_C" >&6
5943 else
5944   ac_check_lib_save_LIBS=$LIBS
5945 LIBS="-lgpm  $LIBS"
5946 cat >"conftest.$ac_ext" <<_ACEOF
5947 #line 5947 "configure"
5948 #include "confdefs.h"
5949
5950 /* Override any gcc2 internal prototype to avoid an error.  */
5951 #ifdef __cplusplus
5952 extern "C"
5953 #endif
5954 /* We use char because int might match the return type of a gcc2
5955    builtin and then its argument prototype would still apply.  */
5956 char Gpm_Open ();
5957 int
5958 main (void)
5959 {
5960 Gpm_Open ();
5961   ;
5962   return 0;
5963 }
5964 _ACEOF
5965 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5966 if { (eval echo "$as_me:5966: \"$ac_link\"") >&5
5967   (eval $ac_link) 2>&5
5968   ac_status=$?
5969   echo "$as_me:5969: \$? = $ac_status" >&5
5970   (exit "$ac_status"); } &&
5971          { ac_try='test -s "conftest$ac_exeext"'
5972   { (eval echo "$as_me:5972: \"$ac_try\"") >&5
5973   (eval $ac_try) 2>&5
5974   ac_status=$?
5975   echo "$as_me:5975: \$? = $ac_status" >&5
5976   (exit "$ac_status"); }; }; then
5977   ac_cv_lib_gpm_Gpm_Open=yes
5978 else
5979   echo "$as_me: failed program was:" >&5
5980 cat "conftest.$ac_ext" >&5
5981 ac_cv_lib_gpm_Gpm_Open=no
5982 fi
5983 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5984 LIBS=$ac_check_lib_save_LIBS
5985 fi
5986 echo "$as_me:5986: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5987 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5988 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
5989   echo "$as_me:5989: checking for initscr in -lgpm" >&5
5990 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5991 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5992   echo $ECHO_N "(cached) $ECHO_C" >&6
5993 else
5994   ac_check_lib_save_LIBS=$LIBS
5995 LIBS="-lgpm  $LIBS"
5996 cat >"conftest.$ac_ext" <<_ACEOF
5997 #line 5997 "configure"
5998 #include "confdefs.h"
5999
6000 /* Override any gcc2 internal prototype to avoid an error.  */
6001 #ifdef __cplusplus
6002 extern "C"
6003 #endif
6004 /* We use char because int might match the return type of a gcc2
6005    builtin and then its argument prototype would still apply.  */
6006 char initscr ();
6007 int
6008 main (void)
6009 {
6010 initscr ();
6011   ;
6012   return 0;
6013 }
6014 _ACEOF
6015 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6016 if { (eval echo "$as_me:6016: \"$ac_link\"") >&5
6017   (eval $ac_link) 2>&5
6018   ac_status=$?
6019   echo "$as_me:6019: \$? = $ac_status" >&5
6020   (exit "$ac_status"); } &&
6021          { ac_try='test -s "conftest$ac_exeext"'
6022   { (eval echo "$as_me:6022: \"$ac_try\"") >&5
6023   (eval $ac_try) 2>&5
6024   ac_status=$?
6025   echo "$as_me:6025: \$? = $ac_status" >&5
6026   (exit "$ac_status"); }; }; then
6027   ac_cv_lib_gpm_initscr=yes
6028 else
6029   echo "$as_me: failed program was:" >&5
6030 cat "conftest.$ac_ext" >&5
6031 ac_cv_lib_gpm_initscr=no
6032 fi
6033 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6034 LIBS=$ac_check_lib_save_LIBS
6035 fi
6036 echo "$as_me:6036: result: $ac_cv_lib_gpm_initscr" >&5
6037 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6038 if test "$ac_cv_lib_gpm_initscr" = yes; then
6039   LIBS="$cf_ncurses_SAVE"
6040 else
6041   cf_ncurses_LIBS="-lgpm"
6042 fi
6043
6044 fi
6045
6046 case "$host_os" in
6047 (freebsd*)
6048         # This is only necessary if you are linking against an obsolete
6049         # version of ncurses (but it should do no harm, since it's static).
6050         if test "$cf_nculib_root" = ncurses ; then
6051                 echo "$as_me:6051: checking for tgoto in -lmytinfo" >&5
6052 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6053 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6054   echo $ECHO_N "(cached) $ECHO_C" >&6
6055 else
6056   ac_check_lib_save_LIBS=$LIBS
6057 LIBS="-lmytinfo  $LIBS"
6058 cat >"conftest.$ac_ext" <<_ACEOF
6059 #line 6059 "configure"
6060 #include "confdefs.h"
6061
6062 /* Override any gcc2 internal prototype to avoid an error.  */
6063 #ifdef __cplusplus
6064 extern "C"
6065 #endif
6066 /* We use char because int might match the return type of a gcc2
6067    builtin and then its argument prototype would still apply.  */
6068 char tgoto ();
6069 int
6070 main (void)
6071 {
6072 tgoto ();
6073   ;
6074   return 0;
6075 }
6076 _ACEOF
6077 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6078 if { (eval echo "$as_me:6078: \"$ac_link\"") >&5
6079   (eval $ac_link) 2>&5
6080   ac_status=$?
6081   echo "$as_me:6081: \$? = $ac_status" >&5
6082   (exit "$ac_status"); } &&
6083          { ac_try='test -s "conftest$ac_exeext"'
6084   { (eval echo "$as_me:6084: \"$ac_try\"") >&5
6085   (eval $ac_try) 2>&5
6086   ac_status=$?
6087   echo "$as_me:6087: \$? = $ac_status" >&5
6088   (exit "$ac_status"); }; }; then
6089   ac_cv_lib_mytinfo_tgoto=yes
6090 else
6091   echo "$as_me: failed program was:" >&5
6092 cat "conftest.$ac_ext" >&5
6093 ac_cv_lib_mytinfo_tgoto=no
6094 fi
6095 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6096 LIBS=$ac_check_lib_save_LIBS
6097 fi
6098 echo "$as_me:6098: result: $ac_cv_lib_mytinfo_tgoto" >&5
6099 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6100 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6101   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6102 fi
6103
6104         fi
6105         ;;
6106 esac
6107
6108 cf_add_libs="$LIBS"
6109 # reverse order
6110 cf_add_0lib=
6111 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6112 # filter duplicates
6113 for cf_add_1lib in $cf_add_0lib; do
6114         for cf_add_2lib in $cf_add_libs; do
6115                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6116                         cf_add_1lib=
6117                         break
6118                 fi
6119         done
6120         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6121 done
6122 LIBS="$cf_add_libs"
6123
6124 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6125 then
6126
6127 cf_add_libs="$LIBS"
6128 # reverse order
6129 cf_add_0lib=
6130 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6131 # filter duplicates
6132 for cf_add_1lib in $cf_add_0lib; do
6133         for cf_add_2lib in $cf_add_libs; do
6134                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6135                         cf_add_1lib=
6136                         break
6137                 fi
6138         done
6139         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6140 done
6141 LIBS="$cf_add_libs"
6142
6143 else
6144
6145         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6146         cf_libdir=""
6147         echo "$as_me:6147: checking for initscr" >&5
6148 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6149 if test "${ac_cv_func_initscr+set}" = set; then
6150   echo $ECHO_N "(cached) $ECHO_C" >&6
6151 else
6152   cat >"conftest.$ac_ext" <<_ACEOF
6153 #line 6153 "configure"
6154 #include "confdefs.h"
6155 #define initscr autoconf_temporary
6156 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6157 #undef initscr
6158
6159 #ifdef __cplusplus
6160 extern "C"
6161 #endif
6162
6163 /* We use char because int might match the return type of a gcc2
6164    builtin and then its argument prototype would still apply.  */
6165 char initscr (void);
6166
6167 int
6168 main (void)
6169 {
6170
6171 /* The GNU C library defines stubs for functions which it implements
6172     to always fail with ENOSYS.  Some functions are actually named
6173     something starting with __ and the normal name is an alias.  */
6174 #if defined (__stub_initscr) || defined (__stub___initscr)
6175 #error found stub for initscr
6176 #endif
6177
6178         return initscr ();
6179   ;
6180   return 0;
6181 }
6182 _ACEOF
6183 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6184 if { (eval echo "$as_me:6184: \"$ac_link\"") >&5
6185   (eval $ac_link) 2>&5
6186   ac_status=$?
6187   echo "$as_me:6187: \$? = $ac_status" >&5
6188   (exit "$ac_status"); } &&
6189          { ac_try='test -s "conftest$ac_exeext"'
6190   { (eval echo "$as_me:6190: \"$ac_try\"") >&5
6191   (eval $ac_try) 2>&5
6192   ac_status=$?
6193   echo "$as_me:6193: \$? = $ac_status" >&5
6194   (exit "$ac_status"); }; }; then
6195   ac_cv_func_initscr=yes
6196 else
6197   echo "$as_me: failed program was:" >&5
6198 cat "conftest.$ac_ext" >&5
6199 ac_cv_func_initscr=no
6200 fi
6201 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6202 fi
6203 echo "$as_me:6203: result: $ac_cv_func_initscr" >&5
6204 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6205 if test "$ac_cv_func_initscr" = yes; then
6206   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6207 else
6208
6209                 cf_save_LIBS="$LIBS"
6210                 echo "$as_me:6210: checking for initscr in -l$cf_nculib_root" >&5
6211 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6212                 LIBS="-l$cf_nculib_root $LIBS"
6213                 cat >"conftest.$ac_ext" <<_ACEOF
6214 #line 6214 "configure"
6215 #include "confdefs.h"
6216 #include <${cf_cv_ncurses_header:-curses.h}>
6217 int
6218 main (void)
6219 {
6220 initscr()
6221   ;
6222   return 0;
6223 }
6224 _ACEOF
6225 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6226 if { (eval echo "$as_me:6226: \"$ac_link\"") >&5
6227   (eval $ac_link) 2>&5
6228   ac_status=$?
6229   echo "$as_me:6229: \$? = $ac_status" >&5
6230   (exit "$ac_status"); } &&
6231          { ac_try='test -s "conftest$ac_exeext"'
6232   { (eval echo "$as_me:6232: \"$ac_try\"") >&5
6233   (eval $ac_try) 2>&5
6234   ac_status=$?
6235   echo "$as_me:6235: \$? = $ac_status" >&5
6236   (exit "$ac_status"); }; }; then
6237   echo "$as_me:6237: result: yes" >&5
6238 echo "${ECHO_T}yes" >&6
6239                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6240
6241 else
6242   echo "$as_me: failed program was:" >&5
6243 cat "conftest.$ac_ext" >&5
6244 echo "$as_me:6244: result: no" >&5
6245 echo "${ECHO_T}no" >&6
6246
6247 cf_search=
6248 cf_library_path_list=""
6249 if test -n "${LDFLAGS}${LIBS}" ; then
6250         for cf_library_path in $LDFLAGS $LIBS
6251         do
6252                 case "$cf_library_path" in
6253                 (-L*)
6254                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6255
6256 test "x$cf_library_path" != "xNONE" && \
6257 test -d "$cf_library_path" && \
6258  {
6259         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6260         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6261         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6262         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6263         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6264         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"
6265 }
6266
6267                         cf_library_path_list="$cf_library_path_list $cf_search"
6268                         ;;
6269                 esac
6270         done
6271 fi
6272
6273 cf_search=
6274
6275 test "x$prefix" != "xNONE" && \
6276 test -d "$prefix" && \
6277  {
6278         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6279         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6280         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6281         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6282         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6283         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6284 }
6285
6286 for cf_subdir_prefix in \
6287         /usr \
6288         /usr/local \
6289         /usr/pkg \
6290         /opt \
6291         /opt/local \
6292         $HOME
6293 do
6294
6295 test "x$cf_subdir_prefix" != "x$prefix" && \
6296 test -d "$cf_subdir_prefix" && \
6297 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6298         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6299         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6300         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6301         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6302         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6303         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"
6304 }
6305
6306 done
6307
6308 cf_search="$cf_library_path_list $cf_search"
6309
6310                         for cf_libdir in $cf_search
6311                         do
6312                                 echo "$as_me:6312: checking for -l$cf_nculib_root in $cf_libdir" >&5
6313 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6314                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6315                                 cat >"conftest.$ac_ext" <<_ACEOF
6316 #line 6316 "configure"
6317 #include "confdefs.h"
6318 #include <${cf_cv_ncurses_header:-curses.h}>
6319 int
6320 main (void)
6321 {
6322 initscr()
6323   ;
6324   return 0;
6325 }
6326 _ACEOF
6327 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6328 if { (eval echo "$as_me:6328: \"$ac_link\"") >&5
6329   (eval $ac_link) 2>&5
6330   ac_status=$?
6331   echo "$as_me:6331: \$? = $ac_status" >&5
6332   (exit "$ac_status"); } &&
6333          { ac_try='test -s "conftest$ac_exeext"'
6334   { (eval echo "$as_me:6334: \"$ac_try\"") >&5
6335   (eval $ac_try) 2>&5
6336   ac_status=$?
6337   echo "$as_me:6337: \$? = $ac_status" >&5
6338   (exit "$ac_status"); }; }; then
6339   echo "$as_me:6339: result: yes" >&5
6340 echo "${ECHO_T}yes" >&6
6341                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6342                                          break
6343 else
6344   echo "$as_me: failed program was:" >&5
6345 cat "conftest.$ac_ext" >&5
6346 echo "$as_me:6346: result: no" >&5
6347 echo "${ECHO_T}no" >&6
6348                                          LIBS="$cf_save_LIBS"
6349 fi
6350 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6351                         done
6352
6353 fi
6354 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6355
6356 fi
6357
6358 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6359
6360 if test "$cf_found_library" = no ; then
6361         { { echo "$as_me:6361: error: Cannot link $cf_nculib_root library" >&5
6362 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6363    { (exit 1); exit 1; }; }
6364 fi
6365
6366 fi
6367
6368 if test -n "$cf_ncurses_LIBS" ; then
6369         echo "$as_me:6369: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6370 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6371         cf_ncurses_SAVE="$LIBS"
6372         for p in $cf_ncurses_LIBS ; do
6373                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6374                 if test "$q" != "$LIBS" ; then
6375                         LIBS="$q"
6376                 fi
6377         done
6378         cat >"conftest.$ac_ext" <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #include <${cf_cv_ncurses_header:-curses.h}>
6382 int
6383 main (void)
6384 {
6385 initscr(); mousemask(0,0); tigetstr((char *)0);
6386   ;
6387   return 0;
6388 }
6389 _ACEOF
6390 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6391 if { (eval echo "$as_me:6391: \"$ac_link\"") >&5
6392   (eval $ac_link) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit "$ac_status"); } &&
6396          { ac_try='test -s "conftest$ac_exeext"'
6397   { (eval echo "$as_me:6397: \"$ac_try\"") >&5
6398   (eval $ac_try) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit "$ac_status"); }; }; then
6402   echo "$as_me:6402: result: yes" >&5
6403 echo "${ECHO_T}yes" >&6
6404 else
6405   echo "$as_me: failed program was:" >&5
6406 cat "conftest.$ac_ext" >&5
6407 echo "$as_me:6407: result: no" >&5
6408 echo "${ECHO_T}no" >&6
6409                  LIBS="$cf_ncurses_SAVE"
6410 fi
6411 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6412 fi
6413
6414 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6415
6416 cat >>confdefs.h <<EOF
6417 #define $cf_nculib_ROOT 1
6418 EOF
6419
6420         fi
6421 else
6422         NCURSES_CONFIG=none
6423 fi
6424
6425 echo "$as_me:6425: checking if you want wide-character code" >&5
6426 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6427
6428 # Check whether --enable-widec or --disable-widec was given.
6429 if test "${enable_widec+set}" = set; then
6430   enableval="$enable_widec"
6431   with_widec=$enableval
6432 else
6433   with_widec=no
6434 fi;
6435 echo "$as_me:6435: result: $with_widec" >&5
6436 echo "${ECHO_T}$with_widec" >&6
6437 if test "$with_widec" = yes ; then
6438
6439 echo "$as_me:6439: checking for multibyte character support" >&5
6440 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6441 if test "${cf_cv_utf8_lib+set}" = set; then
6442   echo $ECHO_N "(cached) $ECHO_C" >&6
6443 else
6444
6445         cf_save_LIBS="$LIBS"
6446         cat >"conftest.$ac_ext" <<_ACEOF
6447 #line 6447 "configure"
6448 #include "confdefs.h"
6449
6450 #include <stdlib.h>
6451 int
6452 main (void)
6453 {
6454 putwc(0,0);
6455   ;
6456   return 0;
6457 }
6458 _ACEOF
6459 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6460 if { (eval echo "$as_me:6460: \"$ac_link\"") >&5
6461   (eval $ac_link) 2>&5
6462   ac_status=$?
6463   echo "$as_me:6463: \$? = $ac_status" >&5
6464   (exit "$ac_status"); } &&
6465          { ac_try='test -s "conftest$ac_exeext"'
6466   { (eval echo "$as_me:6466: \"$ac_try\"") >&5
6467   (eval $ac_try) 2>&5
6468   ac_status=$?
6469   echo "$as_me:6469: \$? = $ac_status" >&5
6470   (exit "$ac_status"); }; }; then
6471   cf_cv_utf8_lib=yes
6472 else
6473   echo "$as_me: failed program was:" >&5
6474 cat "conftest.$ac_ext" >&5
6475
6476 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6477 # will be set on completion of the AC_TRY_LINK below.
6478 cf_cv_header_path_utf8=
6479 cf_cv_library_path_utf8=
6480
6481 echo "${as_me:-configure}:6481: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6482
6483 cf_save_LIBS="$LIBS"
6484
6485 cat >"conftest.$ac_ext" <<_ACEOF
6486 #line 6486 "configure"
6487 #include "confdefs.h"
6488
6489 #include <libutf8.h>
6490 int
6491 main (void)
6492 {
6493 putwc(0,0);
6494   ;
6495   return 0;
6496 }
6497 _ACEOF
6498 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6499 if { (eval echo "$as_me:6499: \"$ac_link\"") >&5
6500   (eval $ac_link) 2>&5
6501   ac_status=$?
6502   echo "$as_me:6502: \$? = $ac_status" >&5
6503   (exit "$ac_status"); } &&
6504          { ac_try='test -s "conftest$ac_exeext"'
6505   { (eval echo "$as_me:6505: \"$ac_try\"") >&5
6506   (eval $ac_try) 2>&5
6507   ac_status=$?
6508   echo "$as_me:6508: \$? = $ac_status" >&5
6509   (exit "$ac_status"); }; }; then
6510
6511         cf_cv_find_linkage_utf8=yes
6512         cf_cv_header_path_utf8=/usr/include
6513         cf_cv_library_path_utf8=/usr/lib
6514
6515 else
6516   echo "$as_me: failed program was:" >&5
6517 cat "conftest.$ac_ext" >&5
6518
6519 LIBS="-lutf8  $cf_save_LIBS"
6520
6521 cat >"conftest.$ac_ext" <<_ACEOF
6522 #line 6522 "configure"
6523 #include "confdefs.h"
6524
6525 #include <libutf8.h>
6526 int
6527 main (void)
6528 {
6529 putwc(0,0);
6530   ;
6531   return 0;
6532 }
6533 _ACEOF
6534 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6535 if { (eval echo "$as_me:6535: \"$ac_link\"") >&5
6536   (eval $ac_link) 2>&5
6537   ac_status=$?
6538   echo "$as_me:6538: \$? = $ac_status" >&5
6539   (exit "$ac_status"); } &&
6540          { ac_try='test -s "conftest$ac_exeext"'
6541   { (eval echo "$as_me:6541: \"$ac_try\"") >&5
6542   (eval $ac_try) 2>&5
6543   ac_status=$?
6544   echo "$as_me:6544: \$? = $ac_status" >&5
6545   (exit "$ac_status"); }; }; then
6546
6547         cf_cv_find_linkage_utf8=yes
6548         cf_cv_header_path_utf8=/usr/include
6549         cf_cv_library_path_utf8=/usr/lib
6550         cf_cv_library_file_utf8="-lutf8"
6551
6552 else
6553   echo "$as_me: failed program was:" >&5
6554 cat "conftest.$ac_ext" >&5
6555
6556         cf_cv_find_linkage_utf8=no
6557         LIBS="$cf_save_LIBS"
6558
6559         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6560
6561 echo "${as_me:-configure}:6561: testing find linkage for utf8 library ..." 1>&5
6562
6563 echo "${as_me:-configure}:6563: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6564
6565         cf_save_CPPFLAGS="$CPPFLAGS"
6566         cf_test_CPPFLAGS="$CPPFLAGS"
6567
6568 cf_search=
6569
6570 # collect the current set of include-directories from compiler flags
6571 cf_header_path_list=""
6572 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6573         for cf_header_path in $CPPFLAGS $CFLAGS
6574         do
6575                 case "$cf_header_path" in
6576                 (-I*)
6577                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6578
6579 test "x$cf_header_path" != "xNONE" && \
6580 test -d "$cf_header_path" && \
6581  {
6582         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6583         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6584         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6585         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6586         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6587         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6588 }
6589
6590                         cf_header_path_list="$cf_header_path_list $cf_search"
6591                         ;;
6592                 esac
6593         done
6594 fi
6595
6596 # add the variations for the package we are looking for
6597
6598 cf_search=
6599
6600 test "x$prefix" != "xNONE" && \
6601 test -d "$prefix" && \
6602  {
6603         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6604         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6605         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6606         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6607         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6608         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6609 }
6610
6611 for cf_subdir_prefix in \
6612         /usr \
6613         /usr/local \
6614         /usr/pkg \
6615         /opt \
6616         /opt/local \
6617         $HOME
6618 do
6619
6620 test "x$cf_subdir_prefix" != "x$prefix" && \
6621 test -d "$cf_subdir_prefix" && \
6622 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6623         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6624         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6625         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6626         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6627         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6628         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6629 }
6630
6631 done
6632
6633 test "$includedir" != NONE && \
6634 test "$includedir" != "/usr/include" && \
6635 test -d "$includedir" && {
6636         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6637         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6638 }
6639
6640 test "$oldincludedir" != NONE && \
6641 test "$oldincludedir" != "/usr/include" && \
6642 test -d "$oldincludedir" && {
6643         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6644         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6645 }
6646
6647 cf_search="$cf_search $cf_header_path_list"
6648
6649         for cf_cv_header_path_utf8 in $cf_search
6650         do
6651                 if test -d "$cf_cv_header_path_utf8" ; then
6652                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6653
6654 echo "${as_me:-configure}:6654: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6655
6656                         CPPFLAGS="$cf_save_CPPFLAGS"
6657
6658         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6659         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6660
6661                         cat >"conftest.$ac_ext" <<_ACEOF
6662 #line 6662 "configure"
6663 #include "confdefs.h"
6664
6665 #include <libutf8.h>
6666 int
6667 main (void)
6668 {
6669 putwc(0,0);
6670   ;
6671   return 0;
6672 }
6673 _ACEOF
6674 rm -f "conftest.$ac_objext"
6675 if { (eval echo "$as_me:6675: \"$ac_compile\"") >&5
6676   (eval $ac_compile) 2>&5
6677   ac_status=$?
6678   echo "$as_me:6678: \$? = $ac_status" >&5
6679   (exit "$ac_status"); } &&
6680          { ac_try='test -s "conftest.$ac_objext"'
6681   { (eval echo "$as_me:6681: \"$ac_try\"") >&5
6682   (eval $ac_try) 2>&5
6683   ac_status=$?
6684   echo "$as_me:6684: \$? = $ac_status" >&5
6685   (exit "$ac_status"); }; }; then
6686
6687                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6688
6689 echo "${as_me:-configure}:6689: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6690
6691                                 cf_cv_find_linkage_utf8=maybe
6692                                 cf_test_CPPFLAGS="$CPPFLAGS"
6693                                 break
6694 else
6695   echo "$as_me: failed program was:" >&5
6696 cat "conftest.$ac_ext" >&5
6697
6698                                 CPPFLAGS="$cf_save_CPPFLAGS"
6699
6700 fi
6701 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6702                 fi
6703         done
6704
6705         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6706
6707 echo "${as_me:-configure}:6707: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6708
6709                 cf_save_LIBS="$LIBS"
6710                 cf_save_LDFLAGS="$LDFLAGS"
6711
6712                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6713
6714 cf_search=
6715 cf_library_path_list=""
6716 if test -n "${LDFLAGS}${LIBS}" ; then
6717         for cf_library_path in $LDFLAGS $LIBS
6718         do
6719                 case "$cf_library_path" in
6720                 (-L*)
6721                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6722
6723 test "x$cf_library_path" != "xNONE" && \
6724 test -d "$cf_library_path" && \
6725  {
6726         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6727         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6728         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6729         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6730         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6731         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6732 }
6733
6734                         cf_library_path_list="$cf_library_path_list $cf_search"
6735                         ;;
6736                 esac
6737         done
6738 fi
6739
6740 cf_search=
6741
6742 test "x$prefix" != "xNONE" && \
6743 test -d "$prefix" && \
6744  {
6745         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6746         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6747         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6748         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6749         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6750         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6751 }
6752
6753 for cf_subdir_prefix in \
6754         /usr \
6755         /usr/local \
6756         /usr/pkg \
6757         /opt \
6758         /opt/local \
6759         $HOME
6760 do
6761
6762 test "x$cf_subdir_prefix" != "x$prefix" && \
6763 test -d "$cf_subdir_prefix" && \
6764 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6765         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6766         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6767         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6768         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6769         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6770         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6771 }
6772
6773 done
6774
6775 cf_search="$cf_library_path_list $cf_search"
6776
6777                         for cf_cv_library_path_utf8 in $cf_search
6778                         do
6779                                 if test -d "$cf_cv_library_path_utf8" ; then
6780                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6781
6782 echo "${as_me:-configure}:6782: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6783
6784                                         CPPFLAGS="$cf_test_CPPFLAGS"
6785                                         LIBS="-lutf8  $cf_save_LIBS"
6786                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6787                                         cat >"conftest.$ac_ext" <<_ACEOF
6788 #line 6788 "configure"
6789 #include "confdefs.h"
6790
6791 #include <libutf8.h>
6792 int
6793 main (void)
6794 {
6795 putwc(0,0);
6796   ;
6797   return 0;
6798 }
6799 _ACEOF
6800 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6801 if { (eval echo "$as_me:6801: \"$ac_link\"") >&5
6802   (eval $ac_link) 2>&5
6803   ac_status=$?
6804   echo "$as_me:6804: \$? = $ac_status" >&5
6805   (exit "$ac_status"); } &&
6806          { ac_try='test -s "conftest$ac_exeext"'
6807   { (eval echo "$as_me:6807: \"$ac_try\"") >&5
6808   (eval $ac_try) 2>&5
6809   ac_status=$?
6810   echo "$as_me:6810: \$? = $ac_status" >&5
6811   (exit "$ac_status"); }; }; then
6812
6813                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6814
6815 echo "${as_me:-configure}:6815: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6816
6817                                         cf_cv_find_linkage_utf8=yes
6818                                         cf_cv_library_file_utf8="-lutf8"
6819                                         break
6820 else
6821   echo "$as_me: failed program was:" >&5
6822 cat "conftest.$ac_ext" >&5
6823
6824                                         CPPFLAGS="$cf_save_CPPFLAGS"
6825                                         LIBS="$cf_save_LIBS"
6826                                         LDFLAGS="$cf_save_LDFLAGS"
6827
6828 fi
6829 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6830                                 fi
6831                         done
6832                         CPPFLAGS="$cf_save_CPPFLAGS"
6833                         LDFLAGS="$cf_save_LDFLAGS"
6834                 fi
6835
6836         else
6837                 cf_cv_find_linkage_utf8=no
6838         fi
6839
6840 fi
6841 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6842
6843 fi
6844 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6845
6846 LIBS="$cf_save_LIBS"
6847
6848 if test "$cf_cv_find_linkage_utf8" = yes ; then
6849 cf_cv_utf8_lib=add-on
6850 else
6851 cf_cv_utf8_lib=no
6852 fi
6853
6854 fi
6855 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6856 fi
6857 echo "$as_me:6857: result: $cf_cv_utf8_lib" >&5
6858 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6859
6860 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6861 # ncurses/ncursesw:
6862 if test "$cf_cv_utf8_lib" = "add-on" ; then
6863
6864 cat >>confdefs.h <<\EOF
6865 #define HAVE_LIBUTF8_H 1
6866 EOF
6867
6868 if test -n "$cf_cv_header_path_utf8" ; then
6869   for cf_add_incdir in $cf_cv_header_path_utf8
6870   do
6871         while test "$cf_add_incdir" != /usr/include
6872         do
6873           if test -d "$cf_add_incdir"
6874           then
6875                 cf_have_incdir=no
6876                 if test -n "$CFLAGS$CPPFLAGS" ; then
6877                   # a loop is needed to ensure we can add subdirs of existing dirs
6878                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6879                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6880                           cf_have_incdir=yes; break
6881                         fi
6882                   done
6883                 fi
6884
6885                 if test "$cf_have_incdir" = no ; then
6886                   if test "$cf_add_incdir" = /usr/local/include ; then
6887                         if test "$GCC" = yes
6888                         then
6889                           cf_save_CPPFLAGS=$CPPFLAGS
6890
6891         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6892         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6893
6894                           cat >"conftest.$ac_ext" <<_ACEOF
6895 #line 6895 "configure"
6896 #include "confdefs.h"
6897 #include <stdio.h>
6898 int
6899 main (void)
6900 {
6901 printf("Hello")
6902   ;
6903   return 0;
6904 }
6905 _ACEOF
6906 rm -f "conftest.$ac_objext"
6907 if { (eval echo "$as_me:6907: \"$ac_compile\"") >&5
6908   (eval $ac_compile) 2>&5
6909   ac_status=$?
6910   echo "$as_me:6910: \$? = $ac_status" >&5
6911   (exit "$ac_status"); } &&
6912          { ac_try='test -s "conftest.$ac_objext"'
6913   { (eval echo "$as_me:6913: \"$ac_try\"") >&5
6914   (eval $ac_try) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit "$ac_status"); }; }; then
6918   :
6919 else
6920   echo "$as_me: failed program was:" >&5
6921 cat "conftest.$ac_ext" >&5
6922 cf_have_incdir=yes
6923 fi
6924 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6925                           CPPFLAGS=$cf_save_CPPFLAGS
6926                         fi
6927                   fi
6928                 fi
6929
6930                 if test "$cf_have_incdir" = no ; then
6931                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6932
6933 echo "${as_me:-configure}:6933: testing adding $cf_add_incdir to include-path ..." 1>&5
6934
6935                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6936
6937                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6938                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6939                   cf_add_incdir="$cf_top_incdir"
6940                 else
6941                   break
6942                 fi
6943           else
6944                 break
6945           fi
6946         done
6947   done
6948 fi
6949
6950 if test -n "$cf_cv_library_path_utf8" ; then
6951         for cf_add_libdir in $cf_cv_library_path_utf8
6952         do
6953                 if test "$cf_add_libdir" = /usr/lib ; then
6954                         :
6955                 elif test -d "$cf_add_libdir"
6956                 then
6957                         cf_have_libdir=no
6958                         if test -n "$LDFLAGS$LIBS" ; then
6959                                 # a loop is needed to ensure we can add subdirs of existing dirs
6960                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6961                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6962                                                 cf_have_libdir=yes; break
6963                                         fi
6964                                 done
6965                         fi
6966                         if test "$cf_have_libdir" = no ; then
6967                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6968
6969 echo "${as_me:-configure}:6969: testing adding $cf_add_libdir to library-path ..." 1>&5
6970
6971                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6972                         fi
6973                 fi
6974         done
6975 fi
6976
6977 cf_add_libs="$LIBS"
6978 # reverse order
6979 cf_add_0lib=
6980 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6981 # filter duplicates
6982 for cf_add_1lib in $cf_add_0lib; do
6983         for cf_add_2lib in $cf_add_libs; do
6984                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6985                         cf_add_1lib=
6986                         break
6987                 fi
6988         done
6989         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6990 done
6991 LIBS="$cf_add_libs"
6992
6993 fi
6994
6995 cf_ncuconfig_root=ncursesw
6996 cf_have_ncuconfig=no
6997
6998 if test "x${PKG_CONFIG:=none}" != xnone; then
6999         echo "$as_me:6999: checking pkg-config for $cf_ncuconfig_root" >&5
7000 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7001         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7002                 echo "$as_me:7002: result: yes" >&5
7003 echo "${ECHO_T}yes" >&6
7004
7005                 echo "$as_me:7005: checking if the $cf_ncuconfig_root package files work" >&5
7006 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7007                 cf_have_ncuconfig=unknown
7008
7009                 cf_save_CFLAGS="$CFLAGS"
7010                 cf_save_CPPFLAGS="$CPPFLAGS"
7011                 cf_save_LIBS="$LIBS"
7012
7013                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7014                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7015
7016                 # while -W for passing linker flags is prevalent, it is not "standard".
7017                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7018                 # incompatible _and_ non-standard -W option which gives an error.  Work
7019                 # around that pitfall.
7020                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7021                 (x*c[89]9@@*-W*)
7022
7023 cf_fix_cppflags=no
7024 cf_new_cflags=
7025 cf_new_cppflags=
7026 cf_new_extra_cppflags=
7027
7028 for cf_add_cflags in $cf_pkg_cflags
7029 do
7030 case "$cf_fix_cppflags" in
7031 (no)
7032         case "$cf_add_cflags" in
7033         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7034                 case "$cf_add_cflags" in
7035                 (-D*)
7036                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7037
7038                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7039                                 && test -z "${cf_tst_cflags}" \
7040                                 && cf_fix_cppflags=yes
7041
7042                         if test "$cf_fix_cppflags" = yes ; then
7043
7044         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7045         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7046
7047                                 continue
7048                         elif test "${cf_tst_cflags}" = "\"'" ; then
7049
7050         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7051         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7052
7053                                 continue
7054                         fi
7055                         ;;
7056                 esac
7057                 case "$CPPFLAGS" in
7058                 (*$cf_add_cflags)
7059                         ;;
7060                 (*)
7061                         case "$cf_add_cflags" in
7062                         (-D*)
7063                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7064
7065 CPPFLAGS=`echo "$CPPFLAGS" | \
7066         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7067                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7068
7069                                 ;;
7070                         esac
7071
7072         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7073         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7074
7075                         ;;
7076                 esac
7077                 ;;
7078         (*)
7079
7080         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7081         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7082
7083                 ;;
7084         esac
7085         ;;
7086 (yes)
7087
7088         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7089         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7090
7091         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7092
7093         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7094                 && test -z "${cf_tst_cflags}" \
7095                 && cf_fix_cppflags=no
7096         ;;
7097 esac
7098 done
7099
7100 if test -n "$cf_new_cflags" ; then
7101
7102         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7103         CFLAGS="${CFLAGS}$cf_new_cflags"
7104
7105 fi
7106
7107 if test -n "$cf_new_cppflags" ; then
7108
7109         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7110         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7111
7112 fi
7113
7114 if test -n "$cf_new_extra_cppflags" ; then
7115
7116         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7117         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7118
7119 fi
7120
7121 cf_add_libs="$LIBS"
7122 # reverse order
7123 cf_add_0lib=
7124 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7125 # filter duplicates
7126 for cf_add_1lib in $cf_add_0lib; do
7127         for cf_add_2lib in $cf_add_libs; do
7128                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7129                         cf_add_1lib=
7130                         break
7131                 fi
7132         done
7133         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7134 done
7135 LIBS="$cf_add_libs"
7136
7137                         cat >"conftest.$ac_ext" <<_ACEOF
7138 #line 7138 "configure"
7139 #include "confdefs.h"
7140 #include <${cf_cv_ncurses_header:-curses.h}>
7141 int
7142 main (void)
7143 {
7144 initscr(); mousemask(0,0); tigetstr((char *)0);
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7150 if { (eval echo "$as_me:7150: \"$ac_link\"") >&5
7151   (eval $ac_link) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit "$ac_status"); } &&
7155          { ac_try='test -s "conftest$ac_exeext"'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit "$ac_status"); }; }; then
7161   if test "$cross_compiling" = yes; then
7162   cf_test_ncuconfig=maybe
7163 else
7164   cat >"conftest.$ac_ext" <<_ACEOF
7165 #line 7165 "configure"
7166 #include "confdefs.h"
7167 #include <${cf_cv_ncurses_header:-curses.h}>
7168                                         int main(void)
7169                                         { char *xx = curses_version(); return (xx == 0); }
7170 _ACEOF
7171 rm -f "conftest$ac_exeext"
7172 if { (eval echo "$as_me:7172: \"$ac_link\"") >&5
7173   (eval $ac_link) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7177   { (eval echo "$as_me:7177: \"$ac_try\"") >&5
7178   (eval $ac_try) 2>&5
7179   ac_status=$?
7180   echo "$as_me:7180: \$? = $ac_status" >&5
7181   (exit "$ac_status"); }; }; then
7182   cf_test_ncuconfig=yes
7183 else
7184   echo "$as_me: program exited with status $ac_status" >&5
7185 echo "$as_me: failed program was:" >&5
7186 cat "conftest.$ac_ext" >&5
7187 cf_test_ncuconfig=no
7188 fi
7189 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7190 fi
7191 else
7192   echo "$as_me: failed program was:" >&5
7193 cat "conftest.$ac_ext" >&5
7194 cf_test_ncuconfig=no
7195 fi
7196 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7197
7198                         CFLAGS="$cf_save_CFLAGS"
7199                         CPPFLAGS="$cf_save_CPPFLAGS"
7200                         LIBS="$cf_save_LIBS"
7201
7202                         if test "x$cf_test_ncuconfig" != xyes; then
7203                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7204                                 cf_pkg_cflags="$cf_temp"
7205                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7206                                 cf_pkg_libs="$cf_temp"
7207                         fi
7208                         ;;
7209                 esac
7210
7211 cf_fix_cppflags=no
7212 cf_new_cflags=
7213 cf_new_cppflags=
7214 cf_new_extra_cppflags=
7215
7216 for cf_add_cflags in $cf_pkg_cflags
7217 do
7218 case "$cf_fix_cppflags" in
7219 (no)
7220         case "$cf_add_cflags" in
7221         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7222                 case "$cf_add_cflags" in
7223                 (-D*)
7224                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7225
7226                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7227                                 && test -z "${cf_tst_cflags}" \
7228                                 && cf_fix_cppflags=yes
7229
7230                         if test "$cf_fix_cppflags" = yes ; then
7231
7232         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7233         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7234
7235                                 continue
7236                         elif test "${cf_tst_cflags}" = "\"'" ; then
7237
7238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7240
7241                                 continue
7242                         fi
7243                         ;;
7244                 esac
7245                 case "$CPPFLAGS" in
7246                 (*$cf_add_cflags)
7247                         ;;
7248                 (*)
7249                         case "$cf_add_cflags" in
7250                         (-D*)
7251                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7252
7253 CPPFLAGS=`echo "$CPPFLAGS" | \
7254         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7255                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7256
7257                                 ;;
7258                         esac
7259
7260         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7261         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7262
7263                         ;;
7264                 esac
7265                 ;;
7266         (*)
7267
7268         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7269         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7270
7271                 ;;
7272         esac
7273         ;;
7274 (yes)
7275
7276         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7277         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7278
7279         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7280
7281         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7282                 && test -z "${cf_tst_cflags}" \
7283                 && cf_fix_cppflags=no
7284         ;;
7285 esac
7286 done
7287
7288 if test -n "$cf_new_cflags" ; then
7289
7290         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7291         CFLAGS="${CFLAGS}$cf_new_cflags"
7292
7293 fi
7294
7295 if test -n "$cf_new_cppflags" ; then
7296
7297         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7298         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7299
7300 fi
7301
7302 if test -n "$cf_new_extra_cppflags" ; then
7303
7304         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7305         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7306
7307 fi
7308
7309 cf_add_libs="$LIBS"
7310 # reverse order
7311 cf_add_0lib=
7312 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7313 # filter duplicates
7314 for cf_add_1lib in $cf_add_0lib; do
7315         for cf_add_2lib in $cf_add_libs; do
7316                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7317                         cf_add_1lib=
7318                         break
7319                 fi
7320         done
7321         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7322 done
7323 LIBS="$cf_add_libs"
7324
7325                 cat >"conftest.$ac_ext" <<_ACEOF
7326 #line 7326 "configure"
7327 #include "confdefs.h"
7328 #include <${cf_cv_ncurses_header:-curses.h}>
7329 int
7330 main (void)
7331 {
7332 initscr(); mousemask(0,0); tigetstr((char *)0);
7333   ;
7334   return 0;
7335 }
7336 _ACEOF
7337 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7338 if { (eval echo "$as_me:7338: \"$ac_link\"") >&5
7339   (eval $ac_link) 2>&5
7340   ac_status=$?
7341   echo "$as_me:7341: \$? = $ac_status" >&5
7342   (exit "$ac_status"); } &&
7343          { ac_try='test -s "conftest$ac_exeext"'
7344   { (eval echo "$as_me:7344: \"$ac_try\"") >&5
7345   (eval $ac_try) 2>&5
7346   ac_status=$?
7347   echo "$as_me:7347: \$? = $ac_status" >&5
7348   (exit "$ac_status"); }; }; then
7349   if test "$cross_compiling" = yes; then
7350   cf_have_ncuconfig=maybe
7351 else
7352   cat >"conftest.$ac_ext" <<_ACEOF
7353 #line 7353 "configure"
7354 #include "confdefs.h"
7355 #include <${cf_cv_ncurses_header:-curses.h}>
7356                                 int main(void)
7357                                 { char *xx = curses_version(); return (xx == 0); }
7358 _ACEOF
7359 rm -f "conftest$ac_exeext"
7360 if { (eval echo "$as_me:7360: \"$ac_link\"") >&5
7361   (eval $ac_link) 2>&5
7362   ac_status=$?
7363   echo "$as_me:7363: \$? = $ac_status" >&5
7364   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7365   { (eval echo "$as_me:7365: \"$ac_try\"") >&5
7366   (eval $ac_try) 2>&5
7367   ac_status=$?
7368   echo "$as_me:7368: \$? = $ac_status" >&5
7369   (exit "$ac_status"); }; }; then
7370   cf_have_ncuconfig=yes
7371 else
7372   echo "$as_me: program exited with status $ac_status" >&5
7373 echo "$as_me: failed program was:" >&5
7374 cat "conftest.$ac_ext" >&5
7375 cf_have_ncuconfig=no
7376 fi
7377 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7378 fi
7379 else
7380   echo "$as_me: failed program was:" >&5
7381 cat "conftest.$ac_ext" >&5
7382 cf_have_ncuconfig=no
7383 fi
7384 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7385                 echo "$as_me:7385: result: $cf_have_ncuconfig" >&5
7386 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7387                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7388                 if test "$cf_have_ncuconfig" != "yes"
7389                 then
7390                         CPPFLAGS="$cf_save_CPPFLAGS"
7391                         LIBS="$cf_save_LIBS"
7392                         NCURSES_CONFIG_PKG=none
7393                 else
7394
7395 cat >>confdefs.h <<\EOF
7396 #define NCURSES 1
7397 EOF
7398
7399                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7400
7401 echo "$as_me:7401: checking for terminfo header" >&5
7402 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7403 if test "${cf_cv_term_header+set}" = set; then
7404   echo $ECHO_N "(cached) $ECHO_C" >&6
7405 else
7406
7407 case "${cf_cv_ncurses_header}" in
7408 (*/ncurses.h|*/ncursesw.h)
7409         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7410         ;;
7411 (*)
7412         cf_term_header=term.h
7413         ;;
7414 esac
7415
7416 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7417 do
7418 cat >"conftest.$ac_ext" <<_ACEOF
7419 #line 7419 "configure"
7420 #include "confdefs.h"
7421 #include <stdio.h>
7422 #include <${cf_cv_ncurses_header:-curses.h}>
7423 #include <$cf_test>
7424
7425 int
7426 main (void)
7427 {
7428 int x = auto_left_margin; (void)x
7429   ;
7430   return 0;
7431 }
7432 _ACEOF
7433 rm -f "conftest.$ac_objext"
7434 if { (eval echo "$as_me:7434: \"$ac_compile\"") >&5
7435   (eval $ac_compile) 2>&5
7436   ac_status=$?
7437   echo "$as_me:7437: \$? = $ac_status" >&5
7438   (exit "$ac_status"); } &&
7439          { ac_try='test -s "conftest.$ac_objext"'
7440   { (eval echo "$as_me:7440: \"$ac_try\"") >&5
7441   (eval $ac_try) 2>&5
7442   ac_status=$?
7443   echo "$as_me:7443: \$? = $ac_status" >&5
7444   (exit "$ac_status"); }; }; then
7445
7446         cf_cv_term_header="$cf_test"
7447 else
7448   echo "$as_me: failed program was:" >&5
7449 cat "conftest.$ac_ext" >&5
7450
7451         cf_cv_term_header=unknown
7452
7453 fi
7454 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7455         test "$cf_cv_term_header" != unknown && break
7456 done
7457
7458 fi
7459 echo "$as_me:7459: result: $cf_cv_term_header" >&5
7460 echo "${ECHO_T}$cf_cv_term_header" >&6
7461
7462 # Set definitions to allow ifdef'ing to accommodate subdirectories
7463
7464 case "$cf_cv_term_header" in
7465 (*term.h)
7466
7467 cat >>confdefs.h <<\EOF
7468 #define HAVE_TERM_H 1
7469 EOF
7470
7471         ;;
7472 esac
7473
7474 case "$cf_cv_term_header" in
7475 (ncurses/term.h)
7476
7477 cat >>confdefs.h <<\EOF
7478 #define HAVE_NCURSES_TERM_H 1
7479 EOF
7480
7481         ;;
7482 (ncursesw/term.h)
7483
7484 cat >>confdefs.h <<\EOF
7485 #define HAVE_NCURSESW_TERM_H 1
7486 EOF
7487
7488         ;;
7489 esac
7490
7491                 fi
7492
7493         else
7494                 echo "$as_me:7494: result: no" >&5
7495 echo "${ECHO_T}no" >&6
7496                 NCURSES_CONFIG_PKG=none
7497         fi
7498 else
7499         NCURSES_CONFIG_PKG=none
7500 fi
7501
7502 if test "x$cf_have_ncuconfig" = "xno"; then
7503         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7504
7505 if test -n "$ac_tool_prefix"; then
7506   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7507   do
7508     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7509 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7510 echo "$as_me:7510: checking for $ac_word" >&5
7511 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7512 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7513   echo $ECHO_N "(cached) $ECHO_C" >&6
7514 else
7515   if test -n "$NCURSES_CONFIG"; then
7516   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7517 else
7518   ac_save_IFS=$IFS; IFS=$ac_path_separator
7519 ac_dummy="$PATH"
7520 for ac_dir in $ac_dummy; do
7521   IFS=$ac_save_IFS
7522   test -z "$ac_dir" && ac_dir=.
7523   $as_executable_p "$ac_dir/$ac_word" || continue
7524 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7525 echo "$as_me:7525: found $ac_dir/$ac_word" >&5
7526 break
7527 done
7528
7529 fi
7530 fi
7531 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7532 if test -n "$NCURSES_CONFIG"; then
7533   echo "$as_me:7533: result: $NCURSES_CONFIG" >&5
7534 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7535 else
7536   echo "$as_me:7536: result: no" >&5
7537 echo "${ECHO_T}no" >&6
7538 fi
7539
7540     test -n "$NCURSES_CONFIG" && break
7541   done
7542 fi
7543 if test -z "$NCURSES_CONFIG"; then
7544   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7545   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7546 do
7547   # Extract the first word of "$ac_prog", so it can be a program name with args.
7548 set dummy $ac_prog; ac_word=$2
7549 echo "$as_me:7549: checking for $ac_word" >&5
7550 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7551 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7552   echo $ECHO_N "(cached) $ECHO_C" >&6
7553 else
7554   if test -n "$ac_ct_NCURSES_CONFIG"; then
7555   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7556 else
7557   ac_save_IFS=$IFS; IFS=$ac_path_separator
7558 ac_dummy="$PATH"
7559 for ac_dir in $ac_dummy; do
7560   IFS=$ac_save_IFS
7561   test -z "$ac_dir" && ac_dir=.
7562   $as_executable_p "$ac_dir/$ac_word" || continue
7563 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7564 echo "$as_me:7564: found $ac_dir/$ac_word" >&5
7565 break
7566 done
7567
7568 fi
7569 fi
7570 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7571 if test -n "$ac_ct_NCURSES_CONFIG"; then
7572   echo "$as_me:7572: result: $ac_ct_NCURSES_CONFIG" >&5
7573 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7574 else
7575   echo "$as_me:7575: result: no" >&5
7576 echo "${ECHO_T}no" >&6
7577 fi
7578
7579   test -n "$ac_ct_NCURSES_CONFIG" && break
7580 done
7581 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7582
7583   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7584 fi
7585
7586         if test "$NCURSES_CONFIG" != none ; then
7587
7588 cf_fix_cppflags=no
7589 cf_new_cflags=
7590 cf_new_cppflags=
7591 cf_new_extra_cppflags=
7592
7593 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7594 do
7595 case "$cf_fix_cppflags" in
7596 (no)
7597         case "$cf_add_cflags" in
7598         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7599                 case "$cf_add_cflags" in
7600                 (-D*)
7601                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7602
7603                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7604                                 && test -z "${cf_tst_cflags}" \
7605                                 && cf_fix_cppflags=yes
7606
7607                         if test "$cf_fix_cppflags" = yes ; then
7608
7609         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7610         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7611
7612                                 continue
7613                         elif test "${cf_tst_cflags}" = "\"'" ; then
7614
7615         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7616         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7617
7618                                 continue
7619                         fi
7620                         ;;
7621                 esac
7622                 case "$CPPFLAGS" in
7623                 (*$cf_add_cflags)
7624                         ;;
7625                 (*)
7626                         case "$cf_add_cflags" in
7627                         (-D*)
7628                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7629
7630 CPPFLAGS=`echo "$CPPFLAGS" | \
7631         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7632                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7633
7634                                 ;;
7635                         esac
7636
7637         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7638         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7639
7640                         ;;
7641                 esac
7642                 ;;
7643         (*)
7644
7645         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7646         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7647
7648                 ;;
7649         esac
7650         ;;
7651 (yes)
7652
7653         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7654         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7655
7656         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7657
7658         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7659                 && test -z "${cf_tst_cflags}" \
7660                 && cf_fix_cppflags=no
7661         ;;
7662 esac
7663 done
7664
7665 if test -n "$cf_new_cflags" ; then
7666
7667         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7668         CFLAGS="${CFLAGS}$cf_new_cflags"
7669
7670 fi
7671
7672 if test -n "$cf_new_cppflags" ; then
7673
7674         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7675         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7676
7677 fi
7678
7679 if test -n "$cf_new_extra_cppflags" ; then
7680
7681         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7682         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7683
7684 fi
7685
7686 cf_add_libs="$LIBS"
7687 # reverse order
7688 cf_add_0lib=
7689 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7690 # filter duplicates
7691 for cf_add_1lib in $cf_add_0lib; do
7692         for cf_add_2lib in $cf_add_libs; do
7693                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7694                         cf_add_1lib=
7695                         break
7696                 fi
7697         done
7698         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7699 done
7700 LIBS="$cf_add_libs"
7701
7702                 # even with config script, some packages use no-override for curses.h
7703
7704 echo "$as_me:7704: checking if we have identified curses headers" >&5
7705 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7706 if test "${cf_cv_ncurses_header+set}" = set; then
7707   echo $ECHO_N "(cached) $ECHO_C" >&6
7708 else
7709
7710 cf_cv_ncurses_header=none
7711 for cf_header in \
7712         ncurses.h ncursesw/ncurses.h \
7713         curses.h ncursesw/curses.h
7714 do
7715 cat >"conftest.$ac_ext" <<_ACEOF
7716 #line 7716 "configure"
7717 #include "confdefs.h"
7718 #include <${cf_header}>
7719 int
7720 main (void)
7721 {
7722 initscr(); tgoto("?", 0,0)
7723   ;
7724   return 0;
7725 }
7726 _ACEOF
7727 rm -f "conftest.$ac_objext"
7728 if { (eval echo "$as_me:7728: \"$ac_compile\"") >&5
7729   (eval $ac_compile) 2>&5
7730   ac_status=$?
7731   echo "$as_me:7731: \$? = $ac_status" >&5
7732   (exit "$ac_status"); } &&
7733          { ac_try='test -s "conftest.$ac_objext"'
7734   { (eval echo "$as_me:7734: \"$ac_try\"") >&5
7735   (eval $ac_try) 2>&5
7736   ac_status=$?
7737   echo "$as_me:7737: \$? = $ac_status" >&5
7738   (exit "$ac_status"); }; }; then
7739   cf_cv_ncurses_header=$cf_header; break
7740 else
7741   echo "$as_me: failed program was:" >&5
7742 cat "conftest.$ac_ext" >&5
7743 fi
7744 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7745 done
7746
7747 fi
7748 echo "$as_me:7748: result: $cf_cv_ncurses_header" >&5
7749 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7750
7751 if test "$cf_cv_ncurses_header" = none ; then
7752         { { echo "$as_me:7752: error: No curses header-files found" >&5
7753 echo "$as_me: error: No curses header-files found" >&2;}
7754    { (exit 1); exit 1; }; }
7755 fi
7756
7757 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7758
7759 for ac_header in $cf_cv_ncurses_header
7760 do
7761 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7762 echo "$as_me:7762: checking for $ac_header" >&5
7763 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7764 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7765   echo $ECHO_N "(cached) $ECHO_C" >&6
7766 else
7767   cat >"conftest.$ac_ext" <<_ACEOF
7768 #line 7768 "configure"
7769 #include "confdefs.h"
7770 #include <$ac_header>
7771 _ACEOF
7772 if { (eval echo "$as_me:7772: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7773   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7774   ac_status=$?
7775   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7776   rm -f conftest.er1
7777   cat conftest.err >&5
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit "$ac_status"); } >/dev/null; then
7780   if test -s conftest.err; then
7781     ac_cpp_err=$ac_c_preproc_warn_flag
7782   else
7783     ac_cpp_err=
7784   fi
7785 else
7786   ac_cpp_err=yes
7787 fi
7788 if test -z "$ac_cpp_err"; then
7789   eval "$as_ac_Header=yes"
7790 else
7791   echo "$as_me: failed program was:" >&5
7792   cat "conftest.$ac_ext" >&5
7793   eval "$as_ac_Header=no"
7794 fi
7795 rm -f conftest.err "conftest.$ac_ext"
7796 fi
7797 echo "$as_me:7797: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7798 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7799 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7800   cat >>confdefs.h <<EOF
7801 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7802 EOF
7803
7804 fi
7805 done
7806
7807 cat >>confdefs.h <<\EOF
7808 #define NCURSES 1
7809 EOF
7810
7811 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7812
7813                 cat >>confdefs.h <<EOF
7814 #define $cf_nculib_ROOT 1
7815 EOF
7816
7817                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
7818
7819         else
7820
7821 cf_ncuhdr_root=ncursesw
7822
7823 test -n "$cf_cv_curses_dir" && \
7824 test "$cf_cv_curses_dir" != "no" && { \
7825
7826 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7827   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7828   do
7829         while test "$cf_add_incdir" != /usr/include
7830         do
7831           if test -d "$cf_add_incdir"
7832           then
7833                 cf_have_incdir=no
7834                 if test -n "$CFLAGS$CPPFLAGS" ; then
7835                   # a loop is needed to ensure we can add subdirs of existing dirs
7836                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7837                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7838                           cf_have_incdir=yes; break
7839                         fi
7840                   done
7841                 fi
7842
7843                 if test "$cf_have_incdir" = no ; then
7844                   if test "$cf_add_incdir" = /usr/local/include ; then
7845                         if test "$GCC" = yes
7846                         then
7847                           cf_save_CPPFLAGS=$CPPFLAGS
7848
7849         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7850         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7851
7852                           cat >"conftest.$ac_ext" <<_ACEOF
7853 #line 7853 "configure"
7854 #include "confdefs.h"
7855 #include <stdio.h>
7856 int
7857 main (void)
7858 {
7859 printf("Hello")
7860   ;
7861   return 0;
7862 }
7863 _ACEOF
7864 rm -f "conftest.$ac_objext"
7865 if { (eval echo "$as_me:7865: \"$ac_compile\"") >&5
7866   (eval $ac_compile) 2>&5
7867   ac_status=$?
7868   echo "$as_me:7868: \$? = $ac_status" >&5
7869   (exit "$ac_status"); } &&
7870          { ac_try='test -s "conftest.$ac_objext"'
7871   { (eval echo "$as_me:7871: \"$ac_try\"") >&5
7872   (eval $ac_try) 2>&5
7873   ac_status=$?
7874   echo "$as_me:7874: \$? = $ac_status" >&5
7875   (exit "$ac_status"); }; }; then
7876   :
7877 else
7878   echo "$as_me: failed program was:" >&5
7879 cat "conftest.$ac_ext" >&5
7880 cf_have_incdir=yes
7881 fi
7882 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7883                           CPPFLAGS=$cf_save_CPPFLAGS
7884                         fi
7885                   fi
7886                 fi
7887
7888                 if test "$cf_have_incdir" = no ; then
7889                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7890
7891 echo "${as_me:-configure}:7891: testing adding $cf_add_incdir to include-path ..." 1>&5
7892
7893                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7894
7895                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7896                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7897                   cf_add_incdir="$cf_top_incdir"
7898                 else
7899                   break
7900                 fi
7901           else
7902                 break
7903           fi
7904         done
7905   done
7906 fi
7907
7908 }
7909
7910 echo "$as_me:7910: checking for $cf_ncuhdr_root header in include-path" >&5
7911 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7912 if test "${cf_cv_ncurses_h+set}" = set; then
7913   echo $ECHO_N "(cached) $ECHO_C" >&6
7914 else
7915
7916         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7917         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
7918         for cf_header in $cf_header_list
7919         do
7920
7921         cat >"conftest.$ac_ext" <<_ACEOF
7922 #line 7922 "configure"
7923 #include "confdefs.h"
7924
7925 #define _XOPEN_SOURCE_EXTENDED
7926 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7927 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7928
7929 #include <$cf_header>
7930 int
7931 main (void)
7932 {
7933
7934 #ifdef NCURSES_VERSION
7935
7936 #ifndef WACS_BSSB
7937         make an error
7938 #endif
7939
7940 printf("%s\\n", NCURSES_VERSION);
7941 #else
7942 #ifdef __NCURSES_H
7943 printf("old\\n");
7944 #else
7945         make an error
7946 #endif
7947 #endif
7948
7949   ;
7950   return 0;
7951 }
7952 _ACEOF
7953 rm -f "conftest.$ac_objext"
7954 if { (eval echo "$as_me:7954: \"$ac_compile\"") >&5
7955   (eval $ac_compile) 2>&5
7956   ac_status=$?
7957   echo "$as_me:7957: \$? = $ac_status" >&5
7958   (exit "$ac_status"); } &&
7959          { ac_try='test -s "conftest.$ac_objext"'
7960   { (eval echo "$as_me:7960: \"$ac_try\"") >&5
7961   (eval $ac_try) 2>&5
7962   ac_status=$?
7963   echo "$as_me:7963: \$? = $ac_status" >&5
7964   (exit "$ac_status"); }; }; then
7965   cf_cv_ncurses_h=$cf_header
7966
7967 else
7968   echo "$as_me: failed program was:" >&5
7969 cat "conftest.$ac_ext" >&5
7970 cf_cv_ncurses_h=no
7971 fi
7972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7973
7974                 test "$cf_cv_ncurses_h" != no && break
7975         done
7976
7977 fi
7978 echo "$as_me:7978: result: $cf_cv_ncurses_h" >&5
7979 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7980
7981 if test "$cf_cv_ncurses_h" != no ; then
7982         cf_cv_ncurses_header=$cf_cv_ncurses_h
7983 else
7984
7985 echo "$as_me:7985: checking for $cf_ncuhdr_root include-path" >&5
7986 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7987 if test "${cf_cv_ncurses_h2+set}" = set; then
7988   echo $ECHO_N "(cached) $ECHO_C" >&6
7989 else
7990
7991         test -n "$verbose" && echo
7992
7993 cf_search=
7994
7995 # collect the current set of include-directories from compiler flags
7996 cf_header_path_list=""
7997 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7998         for cf_header_path in $CPPFLAGS $CFLAGS
7999         do
8000                 case "$cf_header_path" in
8001                 (-I*)
8002                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8003
8004 test "x$cf_header_path" != "xNONE" && \
8005 test -d "$cf_header_path" && \
8006  {
8007         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8008         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8009         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8010         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8011         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8012         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"
8013 }
8014
8015                         cf_header_path_list="$cf_header_path_list $cf_search"
8016                         ;;
8017                 esac
8018         done
8019 fi
8020
8021 # add the variations for the package we are looking for
8022
8023 cf_search=
8024
8025 test "x$prefix" != "xNONE" && \
8026 test -d "$prefix" && \
8027  {
8028         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8029         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8030         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8031         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8032         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8033         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8034 }
8035
8036 for cf_subdir_prefix in \
8037         /usr \
8038         /usr/local \
8039         /usr/pkg \
8040         /opt \
8041         /opt/local \
8042         $HOME
8043 do
8044
8045 test "x$cf_subdir_prefix" != "x$prefix" && \
8046 test -d "$cf_subdir_prefix" && \
8047 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8048         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8049         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8050         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8051         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8052         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8053         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"
8054 }
8055
8056 done
8057
8058 test "$includedir" != NONE && \
8059 test "$includedir" != "/usr/include" && \
8060 test -d "$includedir" && {
8061         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8062         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8063 }
8064
8065 test "$oldincludedir" != NONE && \
8066 test "$oldincludedir" != "/usr/include" && \
8067 test -d "$oldincludedir" && {
8068         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8069         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8070 }
8071
8072 cf_search="$cf_search $cf_header_path_list"
8073
8074         test -n "$verbose" && echo "search path $cf_search"
8075         cf_save2_CPPFLAGS="$CPPFLAGS"
8076         for cf_incdir in $cf_search
8077         do
8078
8079 if test -n "$cf_incdir" ; then
8080   for cf_add_incdir in $cf_incdir
8081   do
8082         while test "$cf_add_incdir" != /usr/include
8083         do
8084           if test -d "$cf_add_incdir"
8085           then
8086                 cf_have_incdir=no
8087                 if test -n "$CFLAGS$CPPFLAGS" ; then
8088                   # a loop is needed to ensure we can add subdirs of existing dirs
8089                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8090                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8091                           cf_have_incdir=yes; break
8092                         fi
8093                   done
8094                 fi
8095
8096                 if test "$cf_have_incdir" = no ; then
8097                   if test "$cf_add_incdir" = /usr/local/include ; then
8098                         if test "$GCC" = yes
8099                         then
8100                           cf_save_CPPFLAGS=$CPPFLAGS
8101
8102         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8103         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8104
8105                           cat >"conftest.$ac_ext" <<_ACEOF
8106 #line 8106 "configure"
8107 #include "confdefs.h"
8108 #include <stdio.h>
8109 int
8110 main (void)
8111 {
8112 printf("Hello")
8113   ;
8114   return 0;
8115 }
8116 _ACEOF
8117 rm -f "conftest.$ac_objext"
8118 if { (eval echo "$as_me:8118: \"$ac_compile\"") >&5
8119   (eval $ac_compile) 2>&5
8120   ac_status=$?
8121   echo "$as_me:8121: \$? = $ac_status" >&5
8122   (exit "$ac_status"); } &&
8123          { ac_try='test -s "conftest.$ac_objext"'
8124   { (eval echo "$as_me:8124: \"$ac_try\"") >&5
8125   (eval $ac_try) 2>&5
8126   ac_status=$?
8127   echo "$as_me:8127: \$? = $ac_status" >&5
8128   (exit "$ac_status"); }; }; then
8129   :
8130 else
8131   echo "$as_me: failed program was:" >&5
8132 cat "conftest.$ac_ext" >&5
8133 cf_have_incdir=yes
8134 fi
8135 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8136                           CPPFLAGS=$cf_save_CPPFLAGS
8137                         fi
8138                   fi
8139                 fi
8140
8141                 if test "$cf_have_incdir" = no ; then
8142                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8143
8144 echo "${as_me:-configure}:8144: testing adding $cf_add_incdir to include-path ..." 1>&5
8145
8146                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8147
8148                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8149                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8150                   cf_add_incdir="$cf_top_incdir"
8151                 else
8152                   break
8153                 fi
8154           else
8155                 break
8156           fi
8157         done
8158   done
8159 fi
8160
8161                 for cf_header in \
8162                         ncurses.h \
8163                         curses.h
8164                 do
8165
8166         cat >"conftest.$ac_ext" <<_ACEOF
8167 #line 8167 "configure"
8168 #include "confdefs.h"
8169
8170 #include <$cf_header>
8171 int
8172 main (void)
8173 {
8174
8175 #ifdef NCURSES_VERSION
8176
8177 printf("%s\\n", NCURSES_VERSION);
8178 #else
8179 #ifdef __NCURSES_H
8180 printf("old\\n");
8181 #else
8182         make an error
8183 #endif
8184 #endif
8185
8186   ;
8187   return 0;
8188 }
8189 _ACEOF
8190 rm -f "conftest.$ac_objext"
8191 if { (eval echo "$as_me:8191: \"$ac_compile\"") >&5
8192   (eval $ac_compile) 2>&5
8193   ac_status=$?
8194   echo "$as_me:8194: \$? = $ac_status" >&5
8195   (exit "$ac_status"); } &&
8196          { ac_try='test -s "conftest.$ac_objext"'
8197   { (eval echo "$as_me:8197: \"$ac_try\"") >&5
8198   (eval $ac_try) 2>&5
8199   ac_status=$?
8200   echo "$as_me:8200: \$? = $ac_status" >&5
8201   (exit "$ac_status"); }; }; then
8202   cf_cv_ncurses_h2=$cf_header
8203
8204 else
8205   echo "$as_me: failed program was:" >&5
8206 cat "conftest.$ac_ext" >&5
8207 cf_cv_ncurses_h2=no
8208 fi
8209 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8210
8211                         if test "$cf_cv_ncurses_h2" != no ; then
8212                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8213                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8214                                 break
8215                         fi
8216                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8217                 done
8218                 CPPFLAGS="$cf_save2_CPPFLAGS"
8219                 test "$cf_cv_ncurses_h2" != no && break
8220         done
8221         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8221: error: not found" >&5
8222 echo "$as_me: error: not found" >&2;}
8223    { (exit 1); exit 1; }; }
8224
8225 fi
8226 echo "$as_me:8226: result: $cf_cv_ncurses_h2" >&5
8227 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8228
8229         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8230         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8231         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8232                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8233         fi
8234
8235 if test -n "$cf_1st_incdir" ; then
8236   for cf_add_incdir in $cf_1st_incdir
8237   do
8238         while test "$cf_add_incdir" != /usr/include
8239         do
8240           if test -d "$cf_add_incdir"
8241           then
8242                 cf_have_incdir=no
8243                 if test -n "$CFLAGS$CPPFLAGS" ; then
8244                   # a loop is needed to ensure we can add subdirs of existing dirs
8245                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8246                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8247                           cf_have_incdir=yes; break
8248                         fi
8249                   done
8250                 fi
8251
8252                 if test "$cf_have_incdir" = no ; then
8253                   if test "$cf_add_incdir" = /usr/local/include ; then
8254                         if test "$GCC" = yes
8255                         then
8256                           cf_save_CPPFLAGS=$CPPFLAGS
8257
8258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8259         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8260
8261                           cat >"conftest.$ac_ext" <<_ACEOF
8262 #line 8262 "configure"
8263 #include "confdefs.h"
8264 #include <stdio.h>
8265 int
8266 main (void)
8267 {
8268 printf("Hello")
8269   ;
8270   return 0;
8271 }
8272 _ACEOF
8273 rm -f "conftest.$ac_objext"
8274 if { (eval echo "$as_me:8274: \"$ac_compile\"") >&5
8275   (eval $ac_compile) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit "$ac_status"); } &&
8279          { ac_try='test -s "conftest.$ac_objext"'
8280   { (eval echo "$as_me:8280: \"$ac_try\"") >&5
8281   (eval $ac_try) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit "$ac_status"); }; }; then
8285   :
8286 else
8287   echo "$as_me: failed program was:" >&5
8288 cat "conftest.$ac_ext" >&5
8289 cf_have_incdir=yes
8290 fi
8291 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8292                           CPPFLAGS=$cf_save_CPPFLAGS
8293                         fi
8294                   fi
8295                 fi
8296
8297                 if test "$cf_have_incdir" = no ; then
8298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8299
8300 echo "${as_me:-configure}:8300: testing adding $cf_add_incdir to include-path ..." 1>&5
8301
8302                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8303
8304                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8305                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8306                   cf_add_incdir="$cf_top_incdir"
8307                 else
8308                   break
8309                 fi
8310           else
8311                 break
8312           fi
8313         done
8314   done
8315 fi
8316
8317 fi
8318
8319 # Set definitions to allow ifdef'ing for ncurses.h
8320
8321 case "$cf_cv_ncurses_header" in
8322 (*ncurses.h)
8323
8324 cat >>confdefs.h <<\EOF
8325 #define HAVE_NCURSES_H 1
8326 EOF
8327
8328         ;;
8329 esac
8330
8331 case "$cf_cv_ncurses_header" in
8332 (ncurses/curses.h|ncurses/ncurses.h)
8333
8334 cat >>confdefs.h <<\EOF
8335 #define HAVE_NCURSES_NCURSES_H 1
8336 EOF
8337
8338         ;;
8339 (ncursesw/curses.h|ncursesw/ncurses.h)
8340
8341 cat >>confdefs.h <<\EOF
8342 #define HAVE_NCURSESW_NCURSES_H 1
8343 EOF
8344
8345         ;;
8346 esac
8347
8348 echo "$as_me:8348: checking for terminfo header" >&5
8349 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8350 if test "${cf_cv_term_header+set}" = set; then
8351   echo $ECHO_N "(cached) $ECHO_C" >&6
8352 else
8353
8354 case "${cf_cv_ncurses_header}" in
8355 (*/ncurses.h|*/ncursesw.h)
8356         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8357         ;;
8358 (*)
8359         cf_term_header=term.h
8360         ;;
8361 esac
8362
8363 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8364 do
8365 cat >"conftest.$ac_ext" <<_ACEOF
8366 #line 8366 "configure"
8367 #include "confdefs.h"
8368 #include <stdio.h>
8369 #include <${cf_cv_ncurses_header:-curses.h}>
8370 #include <$cf_test>
8371
8372 int
8373 main (void)
8374 {
8375 int x = auto_left_margin; (void)x
8376   ;
8377   return 0;
8378 }
8379 _ACEOF
8380 rm -f "conftest.$ac_objext"
8381 if { (eval echo "$as_me:8381: \"$ac_compile\"") >&5
8382   (eval $ac_compile) 2>&5
8383   ac_status=$?
8384   echo "$as_me:8384: \$? = $ac_status" >&5
8385   (exit "$ac_status"); } &&
8386          { ac_try='test -s "conftest.$ac_objext"'
8387   { (eval echo "$as_me:8387: \"$ac_try\"") >&5
8388   (eval $ac_try) 2>&5
8389   ac_status=$?
8390   echo "$as_me:8390: \$? = $ac_status" >&5
8391   (exit "$ac_status"); }; }; then
8392
8393         cf_cv_term_header="$cf_test"
8394 else
8395   echo "$as_me: failed program was:" >&5
8396 cat "conftest.$ac_ext" >&5
8397
8398         cf_cv_term_header=unknown
8399
8400 fi
8401 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8402         test "$cf_cv_term_header" != unknown && break
8403 done
8404
8405 fi
8406 echo "$as_me:8406: result: $cf_cv_term_header" >&5
8407 echo "${ECHO_T}$cf_cv_term_header" >&6
8408
8409 # Set definitions to allow ifdef'ing to accommodate subdirectories
8410
8411 case "$cf_cv_term_header" in
8412 (*term.h)
8413
8414 cat >>confdefs.h <<\EOF
8415 #define HAVE_TERM_H 1
8416 EOF
8417
8418         ;;
8419 esac
8420
8421 case "$cf_cv_term_header" in
8422 (ncurses/term.h)
8423
8424 cat >>confdefs.h <<\EOF
8425 #define HAVE_NCURSES_TERM_H 1
8426 EOF
8427
8428         ;;
8429 (ncursesw/term.h)
8430
8431 cat >>confdefs.h <<\EOF
8432 #define HAVE_NCURSESW_TERM_H 1
8433 EOF
8434
8435         ;;
8436 esac
8437
8438 # some applications need this, but should check for NCURSES_VERSION
8439
8440 cat >>confdefs.h <<\EOF
8441 #define NCURSES 1
8442 EOF
8443
8444 echo "$as_me:8444: checking for ncurses version" >&5
8445 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8446 if test "${cf_cv_ncurses_version+set}" = set; then
8447   echo $ECHO_N "(cached) $ECHO_C" >&6
8448 else
8449
8450         cf_cv_ncurses_version=no
8451         cf_tempfile=out$$
8452         rm -f "$cf_tempfile"
8453         if test "$cross_compiling" = yes; then
8454
8455         # This will not work if the preprocessor splits the line after the
8456         # Autoconf token.  The 'unproto' program does that.
8457         cat > "conftest.$ac_ext" <<EOF
8458 #include <${cf_cv_ncurses_header:-curses.h}>
8459 #undef Autoconf
8460 #ifdef NCURSES_VERSION
8461 Autoconf NCURSES_VERSION
8462 #else
8463 #ifdef __NCURSES_H
8464 Autoconf "old"
8465 #endif
8466 ;
8467 #endif
8468 EOF
8469         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8470         { (eval echo "$as_me:8470: \"$cf_try\"") >&5
8471   (eval $cf_try) 2>&5
8472   ac_status=$?
8473   echo "$as_me:8473: \$? = $ac_status" >&5
8474   (exit "$ac_status"); }
8475         if test -f conftest.out ; then
8476                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8477                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8478                 rm -f conftest.out
8479         fi
8480
8481 else
8482   cat >"conftest.$ac_ext" <<_ACEOF
8483 #line 8483 "configure"
8484 #include "confdefs.h"
8485
8486 #include <${cf_cv_ncurses_header:-curses.h}>
8487 #include <stdio.h>
8488 int main(void)
8489 {
8490         FILE *fp = fopen("$cf_tempfile", "w");
8491 #ifdef NCURSES_VERSION
8492 # ifdef NCURSES_VERSION_PATCH
8493         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8494 # else
8495         fprintf(fp, "%s\\n", NCURSES_VERSION);
8496 # endif
8497 #else
8498 # ifdef __NCURSES_H
8499         fprintf(fp, "old\\n");
8500 # else
8501         make an error
8502 # endif
8503 #endif
8504         ${cf_cv_main_return:-return}(0);
8505 }
8506 _ACEOF
8507 rm -f "conftest$ac_exeext"
8508 if { (eval echo "$as_me:8508: \"$ac_link\"") >&5
8509   (eval $ac_link) 2>&5
8510   ac_status=$?
8511   echo "$as_me:8511: \$? = $ac_status" >&5
8512   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8513   { (eval echo "$as_me:8513: \"$ac_try\"") >&5
8514   (eval $ac_try) 2>&5
8515   ac_status=$?
8516   echo "$as_me:8516: \$? = $ac_status" >&5
8517   (exit "$ac_status"); }; }; then
8518
8519         cf_cv_ncurses_version=`cat $cf_tempfile`
8520 else
8521   echo "$as_me: program exited with status $ac_status" >&5
8522 echo "$as_me: failed program was:" >&5
8523 cat "conftest.$ac_ext" >&5
8524 fi
8525 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8526 fi
8527         rm -f "$cf_tempfile"
8528
8529 fi
8530 echo "$as_me:8530: result: $cf_cv_ncurses_version" >&5
8531 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8532 test "$cf_cv_ncurses_version" = no ||
8533 cat >>confdefs.h <<\EOF
8534 #define NCURSES 1
8535 EOF
8536
8537 cf_nculib_root=ncursesw
8538         # This works, except for the special case where we find gpm, but
8539         # ncurses is in a nonstandard location via $LIBS, and we really want
8540         # to link gpm.
8541 cf_ncurses_LIBS=""
8542 cf_ncurses_SAVE="$LIBS"
8543 echo "$as_me:8543: checking for Gpm_Open in -lgpm" >&5
8544 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8545 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8546   echo $ECHO_N "(cached) $ECHO_C" >&6
8547 else
8548   ac_check_lib_save_LIBS=$LIBS
8549 LIBS="-lgpm  $LIBS"
8550 cat >"conftest.$ac_ext" <<_ACEOF
8551 #line 8551 "configure"
8552 #include "confdefs.h"
8553
8554 /* Override any gcc2 internal prototype to avoid an error.  */
8555 #ifdef __cplusplus
8556 extern "C"
8557 #endif
8558 /* We use char because int might match the return type of a gcc2
8559    builtin and then its argument prototype would still apply.  */
8560 char Gpm_Open ();
8561 int
8562 main (void)
8563 {
8564 Gpm_Open ();
8565   ;
8566   return 0;
8567 }
8568 _ACEOF
8569 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8570 if { (eval echo "$as_me:8570: \"$ac_link\"") >&5
8571   (eval $ac_link) 2>&5
8572   ac_status=$?
8573   echo "$as_me:8573: \$? = $ac_status" >&5
8574   (exit "$ac_status"); } &&
8575          { ac_try='test -s "conftest$ac_exeext"'
8576   { (eval echo "$as_me:8576: \"$ac_try\"") >&5
8577   (eval $ac_try) 2>&5
8578   ac_status=$?
8579   echo "$as_me:8579: \$? = $ac_status" >&5
8580   (exit "$ac_status"); }; }; then
8581   ac_cv_lib_gpm_Gpm_Open=yes
8582 else
8583   echo "$as_me: failed program was:" >&5
8584 cat "conftest.$ac_ext" >&5
8585 ac_cv_lib_gpm_Gpm_Open=no
8586 fi
8587 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8588 LIBS=$ac_check_lib_save_LIBS
8589 fi
8590 echo "$as_me:8590: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8591 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8592 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8593   echo "$as_me:8593: checking for initscr in -lgpm" >&5
8594 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8595 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8596   echo $ECHO_N "(cached) $ECHO_C" >&6
8597 else
8598   ac_check_lib_save_LIBS=$LIBS
8599 LIBS="-lgpm  $LIBS"
8600 cat >"conftest.$ac_ext" <<_ACEOF
8601 #line 8601 "configure"
8602 #include "confdefs.h"
8603
8604 /* Override any gcc2 internal prototype to avoid an error.  */
8605 #ifdef __cplusplus
8606 extern "C"
8607 #endif
8608 /* We use char because int might match the return type of a gcc2
8609    builtin and then its argument prototype would still apply.  */
8610 char initscr ();
8611 int
8612 main (void)
8613 {
8614 initscr ();
8615   ;
8616   return 0;
8617 }
8618 _ACEOF
8619 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8620 if { (eval echo "$as_me:8620: \"$ac_link\"") >&5
8621   (eval $ac_link) 2>&5
8622   ac_status=$?
8623   echo "$as_me:8623: \$? = $ac_status" >&5
8624   (exit "$ac_status"); } &&
8625          { ac_try='test -s "conftest$ac_exeext"'
8626   { (eval echo "$as_me:8626: \"$ac_try\"") >&5
8627   (eval $ac_try) 2>&5
8628   ac_status=$?
8629   echo "$as_me:8629: \$? = $ac_status" >&5
8630   (exit "$ac_status"); }; }; then
8631   ac_cv_lib_gpm_initscr=yes
8632 else
8633   echo "$as_me: failed program was:" >&5
8634 cat "conftest.$ac_ext" >&5
8635 ac_cv_lib_gpm_initscr=no
8636 fi
8637 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8638 LIBS=$ac_check_lib_save_LIBS
8639 fi
8640 echo "$as_me:8640: result: $ac_cv_lib_gpm_initscr" >&5
8641 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8642 if test "$ac_cv_lib_gpm_initscr" = yes; then
8643   LIBS="$cf_ncurses_SAVE"
8644 else
8645   cf_ncurses_LIBS="-lgpm"
8646 fi
8647
8648 fi
8649
8650 case "$host_os" in
8651 (freebsd*)
8652         # This is only necessary if you are linking against an obsolete
8653         # version of ncurses (but it should do no harm, since it's static).
8654         if test "$cf_nculib_root" = ncurses ; then
8655                 echo "$as_me:8655: checking for tgoto in -lmytinfo" >&5
8656 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8657 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8658   echo $ECHO_N "(cached) $ECHO_C" >&6
8659 else
8660   ac_check_lib_save_LIBS=$LIBS
8661 LIBS="-lmytinfo  $LIBS"
8662 cat >"conftest.$ac_ext" <<_ACEOF
8663 #line 8663 "configure"
8664 #include "confdefs.h"
8665
8666 /* Override any gcc2 internal prototype to avoid an error.  */
8667 #ifdef __cplusplus
8668 extern "C"
8669 #endif
8670 /* We use char because int might match the return type of a gcc2
8671    builtin and then its argument prototype would still apply.  */
8672 char tgoto ();
8673 int
8674 main (void)
8675 {
8676 tgoto ();
8677   ;
8678   return 0;
8679 }
8680 _ACEOF
8681 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8682 if { (eval echo "$as_me:8682: \"$ac_link\"") >&5
8683   (eval $ac_link) 2>&5
8684   ac_status=$?
8685   echo "$as_me:8685: \$? = $ac_status" >&5
8686   (exit "$ac_status"); } &&
8687          { ac_try='test -s "conftest$ac_exeext"'
8688   { (eval echo "$as_me:8688: \"$ac_try\"") >&5
8689   (eval $ac_try) 2>&5
8690   ac_status=$?
8691   echo "$as_me:8691: \$? = $ac_status" >&5
8692   (exit "$ac_status"); }; }; then
8693   ac_cv_lib_mytinfo_tgoto=yes
8694 else
8695   echo "$as_me: failed program was:" >&5
8696 cat "conftest.$ac_ext" >&5
8697 ac_cv_lib_mytinfo_tgoto=no
8698 fi
8699 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8700 LIBS=$ac_check_lib_save_LIBS
8701 fi
8702 echo "$as_me:8702: result: $ac_cv_lib_mytinfo_tgoto" >&5
8703 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8704 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8705   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8706 fi
8707
8708         fi
8709         ;;
8710 esac
8711
8712 cf_add_libs="$LIBS"
8713 # reverse order
8714 cf_add_0lib=
8715 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8716 # filter duplicates
8717 for cf_add_1lib in $cf_add_0lib; do
8718         for cf_add_2lib in $cf_add_libs; do
8719                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8720                         cf_add_1lib=
8721                         break
8722                 fi
8723         done
8724         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8725 done
8726 LIBS="$cf_add_libs"
8727
8728 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8729 then
8730
8731 cf_add_libs="$LIBS"
8732 # reverse order
8733 cf_add_0lib=
8734 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8735 # filter duplicates
8736 for cf_add_1lib in $cf_add_0lib; do
8737         for cf_add_2lib in $cf_add_libs; do
8738                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8739                         cf_add_1lib=
8740                         break
8741                 fi
8742         done
8743         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8744 done
8745 LIBS="$cf_add_libs"
8746
8747 else
8748
8749         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8750         cf_libdir=""
8751         echo "$as_me:8751: checking for initscr" >&5
8752 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8753 if test "${ac_cv_func_initscr+set}" = set; then
8754   echo $ECHO_N "(cached) $ECHO_C" >&6
8755 else
8756   cat >"conftest.$ac_ext" <<_ACEOF
8757 #line 8757 "configure"
8758 #include "confdefs.h"
8759 #define initscr autoconf_temporary
8760 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8761 #undef initscr
8762
8763 #ifdef __cplusplus
8764 extern "C"
8765 #endif
8766
8767 /* We use char because int might match the return type of a gcc2
8768    builtin and then its argument prototype would still apply.  */
8769 char initscr (void);
8770
8771 int
8772 main (void)
8773 {
8774
8775 /* The GNU C library defines stubs for functions which it implements
8776     to always fail with ENOSYS.  Some functions are actually named
8777     something starting with __ and the normal name is an alias.  */
8778 #if defined (__stub_initscr) || defined (__stub___initscr)
8779 #error found stub for initscr
8780 #endif
8781
8782         return initscr ();
8783   ;
8784   return 0;
8785 }
8786 _ACEOF
8787 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8788 if { (eval echo "$as_me:8788: \"$ac_link\"") >&5
8789   (eval $ac_link) 2>&5
8790   ac_status=$?
8791   echo "$as_me:8791: \$? = $ac_status" >&5
8792   (exit "$ac_status"); } &&
8793          { ac_try='test -s "conftest$ac_exeext"'
8794   { (eval echo "$as_me:8794: \"$ac_try\"") >&5
8795   (eval $ac_try) 2>&5
8796   ac_status=$?
8797   echo "$as_me:8797: \$? = $ac_status" >&5
8798   (exit "$ac_status"); }; }; then
8799   ac_cv_func_initscr=yes
8800 else
8801   echo "$as_me: failed program was:" >&5
8802 cat "conftest.$ac_ext" >&5
8803 ac_cv_func_initscr=no
8804 fi
8805 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8806 fi
8807 echo "$as_me:8807: result: $ac_cv_func_initscr" >&5
8808 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8809 if test "$ac_cv_func_initscr" = yes; then
8810   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8811 else
8812
8813                 cf_save_LIBS="$LIBS"
8814                 echo "$as_me:8814: checking for initscr in -l$cf_nculib_root" >&5
8815 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8816                 LIBS="-l$cf_nculib_root $LIBS"
8817                 cat >"conftest.$ac_ext" <<_ACEOF
8818 #line 8818 "configure"
8819 #include "confdefs.h"
8820 #include <${cf_cv_ncurses_header:-curses.h}>
8821 int
8822 main (void)
8823 {
8824 initscr()
8825   ;
8826   return 0;
8827 }
8828 _ACEOF
8829 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8830 if { (eval echo "$as_me:8830: \"$ac_link\"") >&5
8831   (eval $ac_link) 2>&5
8832   ac_status=$?
8833   echo "$as_me:8833: \$? = $ac_status" >&5
8834   (exit "$ac_status"); } &&
8835          { ac_try='test -s "conftest$ac_exeext"'
8836   { (eval echo "$as_me:8836: \"$ac_try\"") >&5
8837   (eval $ac_try) 2>&5
8838   ac_status=$?
8839   echo "$as_me:8839: \$? = $ac_status" >&5
8840   (exit "$ac_status"); }; }; then
8841   echo "$as_me:8841: result: yes" >&5
8842 echo "${ECHO_T}yes" >&6
8843                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8844
8845 else
8846   echo "$as_me: failed program was:" >&5
8847 cat "conftest.$ac_ext" >&5
8848 echo "$as_me:8848: result: no" >&5
8849 echo "${ECHO_T}no" >&6
8850
8851 cf_search=
8852 cf_library_path_list=""
8853 if test -n "${LDFLAGS}${LIBS}" ; then
8854         for cf_library_path in $LDFLAGS $LIBS
8855         do
8856                 case "$cf_library_path" in
8857                 (-L*)
8858                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8859
8860 test "x$cf_library_path" != "xNONE" && \
8861 test -d "$cf_library_path" && \
8862  {
8863         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8864         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8865         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8866         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8867         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8868         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"
8869 }
8870
8871                         cf_library_path_list="$cf_library_path_list $cf_search"
8872                         ;;
8873                 esac
8874         done
8875 fi
8876
8877 cf_search=
8878
8879 test "x$prefix" != "xNONE" && \
8880 test -d "$prefix" && \
8881  {
8882         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8883         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
8884         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8885         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8886         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8887         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8888 }
8889
8890 for cf_subdir_prefix in \
8891         /usr \
8892         /usr/local \
8893         /usr/pkg \
8894         /opt \
8895         /opt/local \
8896         $HOME
8897 do
8898
8899 test "x$cf_subdir_prefix" != "x$prefix" && \
8900 test -d "$cf_subdir_prefix" && \
8901 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8902         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8903         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8904         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8905         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8906         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8907         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"
8908 }
8909
8910 done
8911
8912 cf_search="$cf_library_path_list $cf_search"
8913
8914                         for cf_libdir in $cf_search
8915                         do
8916                                 echo "$as_me:8916: checking for -l$cf_nculib_root in $cf_libdir" >&5
8917 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8918                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8919                                 cat >"conftest.$ac_ext" <<_ACEOF
8920 #line 8920 "configure"
8921 #include "confdefs.h"
8922 #include <${cf_cv_ncurses_header:-curses.h}>
8923 int
8924 main (void)
8925 {
8926 initscr()
8927   ;
8928   return 0;
8929 }
8930 _ACEOF
8931 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8932 if { (eval echo "$as_me:8932: \"$ac_link\"") >&5
8933   (eval $ac_link) 2>&5
8934   ac_status=$?
8935   echo "$as_me:8935: \$? = $ac_status" >&5
8936   (exit "$ac_status"); } &&
8937          { ac_try='test -s "conftest$ac_exeext"'
8938   { (eval echo "$as_me:8938: \"$ac_try\"") >&5
8939   (eval $ac_try) 2>&5
8940   ac_status=$?
8941   echo "$as_me:8941: \$? = $ac_status" >&5
8942   (exit "$ac_status"); }; }; then
8943   echo "$as_me:8943: result: yes" >&5
8944 echo "${ECHO_T}yes" >&6
8945                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8946                                          break
8947 else
8948   echo "$as_me: failed program was:" >&5
8949 cat "conftest.$ac_ext" >&5
8950 echo "$as_me:8950: result: no" >&5
8951 echo "${ECHO_T}no" >&6
8952                                          LIBS="$cf_save_LIBS"
8953 fi
8954 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8955                         done
8956
8957 fi
8958 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8959
8960 fi
8961
8962 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
8963
8964 if test "$cf_found_library" = no ; then
8965         { { echo "$as_me:8965: error: Cannot link $cf_nculib_root library" >&5
8966 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8967    { (exit 1); exit 1; }; }
8968 fi
8969
8970 fi
8971
8972 if test -n "$cf_ncurses_LIBS" ; then
8973         echo "$as_me:8973: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8974 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8975         cf_ncurses_SAVE="$LIBS"
8976         for p in $cf_ncurses_LIBS ; do
8977                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
8978                 if test "$q" != "$LIBS" ; then
8979                         LIBS="$q"
8980                 fi
8981         done
8982         cat >"conftest.$ac_ext" <<_ACEOF
8983 #line 8983 "configure"
8984 #include "confdefs.h"
8985 #include <${cf_cv_ncurses_header:-curses.h}>
8986 int
8987 main (void)
8988 {
8989 initscr(); mousemask(0,0); tigetstr((char *)0);
8990   ;
8991   return 0;
8992 }
8993 _ACEOF
8994 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8995 if { (eval echo "$as_me:8995: \"$ac_link\"") >&5
8996   (eval $ac_link) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit "$ac_status"); } &&
9000          { ac_try='test -s "conftest$ac_exeext"'
9001   { (eval echo "$as_me:9001: \"$ac_try\"") >&5
9002   (eval $ac_try) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit "$ac_status"); }; }; then
9006   echo "$as_me:9006: result: yes" >&5
9007 echo "${ECHO_T}yes" >&6
9008 else
9009   echo "$as_me: failed program was:" >&5
9010 cat "conftest.$ac_ext" >&5
9011 echo "$as_me:9011: result: no" >&5
9012 echo "${ECHO_T}no" >&6
9013                  LIBS="$cf_ncurses_SAVE"
9014 fi
9015 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9016 fi
9017
9018 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9019
9020 cat >>confdefs.h <<EOF
9021 #define $cf_nculib_ROOT 1
9022 EOF
9023
9024         fi
9025 else
9026         NCURSES_CONFIG=none
9027 fi
9028
9029 else
9030
9031 cf_ncuconfig_root=ncurses
9032 cf_have_ncuconfig=no
9033
9034 if test "x${PKG_CONFIG:=none}" != xnone; then
9035         echo "$as_me:9035: checking pkg-config for $cf_ncuconfig_root" >&5
9036 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9037         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9038                 echo "$as_me:9038: result: yes" >&5
9039 echo "${ECHO_T}yes" >&6
9040
9041                 echo "$as_me:9041: checking if the $cf_ncuconfig_root package files work" >&5
9042 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9043                 cf_have_ncuconfig=unknown
9044
9045                 cf_save_CFLAGS="$CFLAGS"
9046                 cf_save_CPPFLAGS="$CPPFLAGS"
9047                 cf_save_LIBS="$LIBS"
9048
9049                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9050                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9051
9052                 # while -W for passing linker flags is prevalent, it is not "standard".
9053                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9054                 # incompatible _and_ non-standard -W option which gives an error.  Work
9055                 # around that pitfall.
9056                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9057                 (x*c[89]9@@*-W*)
9058
9059 cf_fix_cppflags=no
9060 cf_new_cflags=
9061 cf_new_cppflags=
9062 cf_new_extra_cppflags=
9063
9064 for cf_add_cflags in $cf_pkg_cflags
9065 do
9066 case "$cf_fix_cppflags" in
9067 (no)
9068         case "$cf_add_cflags" in
9069         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9070                 case "$cf_add_cflags" in
9071                 (-D*)
9072                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9073
9074                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9075                                 && test -z "${cf_tst_cflags}" \
9076                                 && cf_fix_cppflags=yes
9077
9078                         if test "$cf_fix_cppflags" = yes ; then
9079
9080         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9081         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9082
9083                                 continue
9084                         elif test "${cf_tst_cflags}" = "\"'" ; then
9085
9086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9088
9089                                 continue
9090                         fi
9091                         ;;
9092                 esac
9093                 case "$CPPFLAGS" in
9094                 (*$cf_add_cflags)
9095                         ;;
9096                 (*)
9097                         case "$cf_add_cflags" in
9098                         (-D*)
9099                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9100
9101 CPPFLAGS=`echo "$CPPFLAGS" | \
9102         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9103                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9104
9105                                 ;;
9106                         esac
9107
9108         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9109         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9110
9111                         ;;
9112                 esac
9113                 ;;
9114         (*)
9115
9116         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9117         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9118
9119                 ;;
9120         esac
9121         ;;
9122 (yes)
9123
9124         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9125         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9126
9127         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9128
9129         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9130                 && test -z "${cf_tst_cflags}" \
9131                 && cf_fix_cppflags=no
9132         ;;
9133 esac
9134 done
9135
9136 if test -n "$cf_new_cflags" ; then
9137
9138         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9139         CFLAGS="${CFLAGS}$cf_new_cflags"
9140
9141 fi
9142
9143 if test -n "$cf_new_cppflags" ; then
9144
9145         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9146         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9147
9148 fi
9149
9150 if test -n "$cf_new_extra_cppflags" ; then
9151
9152         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9153         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9154
9155 fi
9156
9157 cf_add_libs="$LIBS"
9158 # reverse order
9159 cf_add_0lib=
9160 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9161 # filter duplicates
9162 for cf_add_1lib in $cf_add_0lib; do
9163         for cf_add_2lib in $cf_add_libs; do
9164                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9165                         cf_add_1lib=
9166                         break
9167                 fi
9168         done
9169         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9170 done
9171 LIBS="$cf_add_libs"
9172
9173                         cat >"conftest.$ac_ext" <<_ACEOF
9174 #line 9174 "configure"
9175 #include "confdefs.h"
9176 #include <${cf_cv_ncurses_header:-curses.h}>
9177 int
9178 main (void)
9179 {
9180 initscr(); mousemask(0,0); tigetstr((char *)0);
9181   ;
9182   return 0;
9183 }
9184 _ACEOF
9185 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9186 if { (eval echo "$as_me:9186: \"$ac_link\"") >&5
9187   (eval $ac_link) 2>&5
9188   ac_status=$?
9189   echo "$as_me:9189: \$? = $ac_status" >&5
9190   (exit "$ac_status"); } &&
9191          { ac_try='test -s "conftest$ac_exeext"'
9192   { (eval echo "$as_me:9192: \"$ac_try\"") >&5
9193   (eval $ac_try) 2>&5
9194   ac_status=$?
9195   echo "$as_me:9195: \$? = $ac_status" >&5
9196   (exit "$ac_status"); }; }; then
9197   if test "$cross_compiling" = yes; then
9198   cf_test_ncuconfig=maybe
9199 else
9200   cat >"conftest.$ac_ext" <<_ACEOF
9201 #line 9201 "configure"
9202 #include "confdefs.h"
9203 #include <${cf_cv_ncurses_header:-curses.h}>
9204                                         int main(void)
9205                                         { char *xx = curses_version(); return (xx == 0); }
9206 _ACEOF
9207 rm -f "conftest$ac_exeext"
9208 if { (eval echo "$as_me:9208: \"$ac_link\"") >&5
9209   (eval $ac_link) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9213   { (eval echo "$as_me:9213: \"$ac_try\"") >&5
9214   (eval $ac_try) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit "$ac_status"); }; }; then
9218   cf_test_ncuconfig=yes
9219 else
9220   echo "$as_me: program exited with status $ac_status" >&5
9221 echo "$as_me: failed program was:" >&5
9222 cat "conftest.$ac_ext" >&5
9223 cf_test_ncuconfig=no
9224 fi
9225 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9226 fi
9227 else
9228   echo "$as_me: failed program was:" >&5
9229 cat "conftest.$ac_ext" >&5
9230 cf_test_ncuconfig=no
9231 fi
9232 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9233
9234                         CFLAGS="$cf_save_CFLAGS"
9235                         CPPFLAGS="$cf_save_CPPFLAGS"
9236                         LIBS="$cf_save_LIBS"
9237
9238                         if test "x$cf_test_ncuconfig" != xyes; then
9239                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9240                                 cf_pkg_cflags="$cf_temp"
9241                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9242                                 cf_pkg_libs="$cf_temp"
9243                         fi
9244                         ;;
9245                 esac
9246
9247 cf_fix_cppflags=no
9248 cf_new_cflags=
9249 cf_new_cppflags=
9250 cf_new_extra_cppflags=
9251
9252 for cf_add_cflags in $cf_pkg_cflags
9253 do
9254 case "$cf_fix_cppflags" in
9255 (no)
9256         case "$cf_add_cflags" in
9257         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9258                 case "$cf_add_cflags" in
9259                 (-D*)
9260                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9261
9262                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9263                                 && test -z "${cf_tst_cflags}" \
9264                                 && cf_fix_cppflags=yes
9265
9266                         if test "$cf_fix_cppflags" = yes ; then
9267
9268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9270
9271                                 continue
9272                         elif test "${cf_tst_cflags}" = "\"'" ; then
9273
9274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9276
9277                                 continue
9278                         fi
9279                         ;;
9280                 esac
9281                 case "$CPPFLAGS" in
9282                 (*$cf_add_cflags)
9283                         ;;
9284                 (*)
9285                         case "$cf_add_cflags" in
9286                         (-D*)
9287                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9288
9289 CPPFLAGS=`echo "$CPPFLAGS" | \
9290         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9291                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9292
9293                                 ;;
9294                         esac
9295
9296         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9297         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9298
9299                         ;;
9300                 esac
9301                 ;;
9302         (*)
9303
9304         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9305         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9306
9307                 ;;
9308         esac
9309         ;;
9310 (yes)
9311
9312         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9313         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9314
9315         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9316
9317         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9318                 && test -z "${cf_tst_cflags}" \
9319                 && cf_fix_cppflags=no
9320         ;;
9321 esac
9322 done
9323
9324 if test -n "$cf_new_cflags" ; then
9325
9326         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9327         CFLAGS="${CFLAGS}$cf_new_cflags"
9328
9329 fi
9330
9331 if test -n "$cf_new_cppflags" ; then
9332
9333         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9334         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9335
9336 fi
9337
9338 if test -n "$cf_new_extra_cppflags" ; then
9339
9340         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9341         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9342
9343 fi
9344
9345 cf_add_libs="$LIBS"
9346 # reverse order
9347 cf_add_0lib=
9348 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9349 # filter duplicates
9350 for cf_add_1lib in $cf_add_0lib; do
9351         for cf_add_2lib in $cf_add_libs; do
9352                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9353                         cf_add_1lib=
9354                         break
9355                 fi
9356         done
9357         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9358 done
9359 LIBS="$cf_add_libs"
9360
9361                 cat >"conftest.$ac_ext" <<_ACEOF
9362 #line 9362 "configure"
9363 #include "confdefs.h"
9364 #include <${cf_cv_ncurses_header:-curses.h}>
9365 int
9366 main (void)
9367 {
9368 initscr(); mousemask(0,0); tigetstr((char *)0);
9369   ;
9370   return 0;
9371 }
9372 _ACEOF
9373 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9374 if { (eval echo "$as_me:9374: \"$ac_link\"") >&5
9375   (eval $ac_link) 2>&5
9376   ac_status=$?
9377   echo "$as_me:9377: \$? = $ac_status" >&5
9378   (exit "$ac_status"); } &&
9379          { ac_try='test -s "conftest$ac_exeext"'
9380   { (eval echo "$as_me:9380: \"$ac_try\"") >&5
9381   (eval $ac_try) 2>&5
9382   ac_status=$?
9383   echo "$as_me:9383: \$? = $ac_status" >&5
9384   (exit "$ac_status"); }; }; then
9385   if test "$cross_compiling" = yes; then
9386   cf_have_ncuconfig=maybe
9387 else
9388   cat >"conftest.$ac_ext" <<_ACEOF
9389 #line 9389 "configure"
9390 #include "confdefs.h"
9391 #include <${cf_cv_ncurses_header:-curses.h}>
9392                                 int main(void)
9393                                 { char *xx = curses_version(); return (xx == 0); }
9394 _ACEOF
9395 rm -f "conftest$ac_exeext"
9396 if { (eval echo "$as_me:9396: \"$ac_link\"") >&5
9397   (eval $ac_link) 2>&5
9398   ac_status=$?
9399   echo "$as_me:9399: \$? = $ac_status" >&5
9400   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9401   { (eval echo "$as_me:9401: \"$ac_try\"") >&5
9402   (eval $ac_try) 2>&5
9403   ac_status=$?
9404   echo "$as_me:9404: \$? = $ac_status" >&5
9405   (exit "$ac_status"); }; }; then
9406   cf_have_ncuconfig=yes
9407 else
9408   echo "$as_me: program exited with status $ac_status" >&5
9409 echo "$as_me: failed program was:" >&5
9410 cat "conftest.$ac_ext" >&5
9411 cf_have_ncuconfig=no
9412 fi
9413 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9414 fi
9415 else
9416   echo "$as_me: failed program was:" >&5
9417 cat "conftest.$ac_ext" >&5
9418 cf_have_ncuconfig=no
9419 fi
9420 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9421                 echo "$as_me:9421: result: $cf_have_ncuconfig" >&5
9422 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9423                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9424                 if test "$cf_have_ncuconfig" != "yes"
9425                 then
9426                         CPPFLAGS="$cf_save_CPPFLAGS"
9427                         LIBS="$cf_save_LIBS"
9428                         NCURSES_CONFIG_PKG=none
9429                 else
9430
9431 cat >>confdefs.h <<\EOF
9432 #define NCURSES 1
9433 EOF
9434
9435                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9436
9437 echo "$as_me:9437: checking for terminfo header" >&5
9438 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9439 if test "${cf_cv_term_header+set}" = set; then
9440   echo $ECHO_N "(cached) $ECHO_C" >&6
9441 else
9442
9443 case "${cf_cv_ncurses_header}" in
9444 (*/ncurses.h|*/ncursesw.h)
9445         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9446         ;;
9447 (*)
9448         cf_term_header=term.h
9449         ;;
9450 esac
9451
9452 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9453 do
9454 cat >"conftest.$ac_ext" <<_ACEOF
9455 #line 9455 "configure"
9456 #include "confdefs.h"
9457 #include <stdio.h>
9458 #include <${cf_cv_ncurses_header:-curses.h}>
9459 #include <$cf_test>
9460
9461 int
9462 main (void)
9463 {
9464 int x = auto_left_margin; (void)x
9465   ;
9466   return 0;
9467 }
9468 _ACEOF
9469 rm -f "conftest.$ac_objext"
9470 if { (eval echo "$as_me:9470: \"$ac_compile\"") >&5
9471   (eval $ac_compile) 2>&5
9472   ac_status=$?
9473   echo "$as_me:9473: \$? = $ac_status" >&5
9474   (exit "$ac_status"); } &&
9475          { ac_try='test -s "conftest.$ac_objext"'
9476   { (eval echo "$as_me:9476: \"$ac_try\"") >&5
9477   (eval $ac_try) 2>&5
9478   ac_status=$?
9479   echo "$as_me:9479: \$? = $ac_status" >&5
9480   (exit "$ac_status"); }; }; then
9481
9482         cf_cv_term_header="$cf_test"
9483 else
9484   echo "$as_me: failed program was:" >&5
9485 cat "conftest.$ac_ext" >&5
9486
9487         cf_cv_term_header=unknown
9488
9489 fi
9490 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9491         test "$cf_cv_term_header" != unknown && break
9492 done
9493
9494 fi
9495 echo "$as_me:9495: result: $cf_cv_term_header" >&5
9496 echo "${ECHO_T}$cf_cv_term_header" >&6
9497
9498 # Set definitions to allow ifdef'ing to accommodate subdirectories
9499
9500 case "$cf_cv_term_header" in
9501 (*term.h)
9502
9503 cat >>confdefs.h <<\EOF
9504 #define HAVE_TERM_H 1
9505 EOF
9506
9507         ;;
9508 esac
9509
9510 case "$cf_cv_term_header" in
9511 (ncurses/term.h)
9512
9513 cat >>confdefs.h <<\EOF
9514 #define HAVE_NCURSES_TERM_H 1
9515 EOF
9516
9517         ;;
9518 (ncursesw/term.h)
9519
9520 cat >>confdefs.h <<\EOF
9521 #define HAVE_NCURSESW_TERM_H 1
9522 EOF
9523
9524         ;;
9525 esac
9526
9527                 fi
9528
9529         else
9530                 echo "$as_me:9530: result: no" >&5
9531 echo "${ECHO_T}no" >&6
9532                 NCURSES_CONFIG_PKG=none
9533         fi
9534 else
9535         NCURSES_CONFIG_PKG=none
9536 fi
9537
9538 if test "x$cf_have_ncuconfig" = "xno"; then
9539         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9540
9541 if test -n "$ac_tool_prefix"; then
9542   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9543   do
9544     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9545 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9546 echo "$as_me:9546: checking for $ac_word" >&5
9547 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9548 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9549   echo $ECHO_N "(cached) $ECHO_C" >&6
9550 else
9551   if test -n "$NCURSES_CONFIG"; then
9552   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9553 else
9554   ac_save_IFS=$IFS; IFS=$ac_path_separator
9555 ac_dummy="$PATH"
9556 for ac_dir in $ac_dummy; do
9557   IFS=$ac_save_IFS
9558   test -z "$ac_dir" && ac_dir=.
9559   $as_executable_p "$ac_dir/$ac_word" || continue
9560 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9561 echo "$as_me:9561: found $ac_dir/$ac_word" >&5
9562 break
9563 done
9564
9565 fi
9566 fi
9567 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9568 if test -n "$NCURSES_CONFIG"; then
9569   echo "$as_me:9569: result: $NCURSES_CONFIG" >&5
9570 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9571 else
9572   echo "$as_me:9572: result: no" >&5
9573 echo "${ECHO_T}no" >&6
9574 fi
9575
9576     test -n "$NCURSES_CONFIG" && break
9577   done
9578 fi
9579 if test -z "$NCURSES_CONFIG"; then
9580   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9581   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9582 do
9583   # Extract the first word of "$ac_prog", so it can be a program name with args.
9584 set dummy $ac_prog; ac_word=$2
9585 echo "$as_me:9585: checking for $ac_word" >&5
9586 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9587 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9588   echo $ECHO_N "(cached) $ECHO_C" >&6
9589 else
9590   if test -n "$ac_ct_NCURSES_CONFIG"; then
9591   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9592 else
9593   ac_save_IFS=$IFS; IFS=$ac_path_separator
9594 ac_dummy="$PATH"
9595 for ac_dir in $ac_dummy; do
9596   IFS=$ac_save_IFS
9597   test -z "$ac_dir" && ac_dir=.
9598   $as_executable_p "$ac_dir/$ac_word" || continue
9599 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9600 echo "$as_me:9600: found $ac_dir/$ac_word" >&5
9601 break
9602 done
9603
9604 fi
9605 fi
9606 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9607 if test -n "$ac_ct_NCURSES_CONFIG"; then
9608   echo "$as_me:9608: result: $ac_ct_NCURSES_CONFIG" >&5
9609 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9610 else
9611   echo "$as_me:9611: result: no" >&5
9612 echo "${ECHO_T}no" >&6
9613 fi
9614
9615   test -n "$ac_ct_NCURSES_CONFIG" && break
9616 done
9617 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9618
9619   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9620 fi
9621
9622         if test "$NCURSES_CONFIG" != none ; then
9623
9624 cf_fix_cppflags=no
9625 cf_new_cflags=
9626 cf_new_cppflags=
9627 cf_new_extra_cppflags=
9628
9629 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9630 do
9631 case "$cf_fix_cppflags" in
9632 (no)
9633         case "$cf_add_cflags" in
9634         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9635                 case "$cf_add_cflags" in
9636                 (-D*)
9637                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9638
9639                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9640                                 && test -z "${cf_tst_cflags}" \
9641                                 && cf_fix_cppflags=yes
9642
9643                         if test "$cf_fix_cppflags" = yes ; then
9644
9645         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9646         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9647
9648                                 continue
9649                         elif test "${cf_tst_cflags}" = "\"'" ; then
9650
9651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9653
9654                                 continue
9655                         fi
9656                         ;;
9657                 esac
9658                 case "$CPPFLAGS" in
9659                 (*$cf_add_cflags)
9660                         ;;
9661                 (*)
9662                         case "$cf_add_cflags" in
9663                         (-D*)
9664                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9665
9666 CPPFLAGS=`echo "$CPPFLAGS" | \
9667         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9668                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9669
9670                                 ;;
9671                         esac
9672
9673         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9674         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9675
9676                         ;;
9677                 esac
9678                 ;;
9679         (*)
9680
9681         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9682         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9683
9684                 ;;
9685         esac
9686         ;;
9687 (yes)
9688
9689         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9690         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9691
9692         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9693
9694         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9695                 && test -z "${cf_tst_cflags}" \
9696                 && cf_fix_cppflags=no
9697         ;;
9698 esac
9699 done
9700
9701 if test -n "$cf_new_cflags" ; then
9702
9703         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9704         CFLAGS="${CFLAGS}$cf_new_cflags"
9705
9706 fi
9707
9708 if test -n "$cf_new_cppflags" ; then
9709
9710         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9711         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9712
9713 fi
9714
9715 if test -n "$cf_new_extra_cppflags" ; then
9716
9717         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9718         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9719
9720 fi
9721
9722 cf_add_libs="$LIBS"
9723 # reverse order
9724 cf_add_0lib=
9725 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9726 # filter duplicates
9727 for cf_add_1lib in $cf_add_0lib; do
9728         for cf_add_2lib in $cf_add_libs; do
9729                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9730                         cf_add_1lib=
9731                         break
9732                 fi
9733         done
9734         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9735 done
9736 LIBS="$cf_add_libs"
9737
9738                 # even with config script, some packages use no-override for curses.h
9739
9740 echo "$as_me:9740: checking if we have identified curses headers" >&5
9741 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9742 if test "${cf_cv_ncurses_header+set}" = set; then
9743   echo $ECHO_N "(cached) $ECHO_C" >&6
9744 else
9745
9746 cf_cv_ncurses_header=none
9747 for cf_header in \
9748         ncurses.h ncurses/ncurses.h \
9749         curses.h ncurses/curses.h
9750 do
9751 cat >"conftest.$ac_ext" <<_ACEOF
9752 #line 9752 "configure"
9753 #include "confdefs.h"
9754 #include <${cf_header}>
9755 int
9756 main (void)
9757 {
9758 initscr(); tgoto("?", 0,0)
9759   ;
9760   return 0;
9761 }
9762 _ACEOF
9763 rm -f "conftest.$ac_objext"
9764 if { (eval echo "$as_me:9764: \"$ac_compile\"") >&5
9765   (eval $ac_compile) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit "$ac_status"); } &&
9769          { ac_try='test -s "conftest.$ac_objext"'
9770   { (eval echo "$as_me:9770: \"$ac_try\"") >&5
9771   (eval $ac_try) 2>&5
9772   ac_status=$?
9773   echo "$as_me:9773: \$? = $ac_status" >&5
9774   (exit "$ac_status"); }; }; then
9775   cf_cv_ncurses_header=$cf_header; break
9776 else
9777   echo "$as_me: failed program was:" >&5
9778 cat "conftest.$ac_ext" >&5
9779 fi
9780 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9781 done
9782
9783 fi
9784 echo "$as_me:9784: result: $cf_cv_ncurses_header" >&5
9785 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9786
9787 if test "$cf_cv_ncurses_header" = none ; then
9788         { { echo "$as_me:9788: error: No curses header-files found" >&5
9789 echo "$as_me: error: No curses header-files found" >&2;}
9790    { (exit 1); exit 1; }; }
9791 fi
9792
9793 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9794
9795 for ac_header in $cf_cv_ncurses_header
9796 do
9797 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9798 echo "$as_me:9798: checking for $ac_header" >&5
9799 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9800 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9801   echo $ECHO_N "(cached) $ECHO_C" >&6
9802 else
9803   cat >"conftest.$ac_ext" <<_ACEOF
9804 #line 9804 "configure"
9805 #include "confdefs.h"
9806 #include <$ac_header>
9807 _ACEOF
9808 if { (eval echo "$as_me:9808: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9809   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9810   ac_status=$?
9811   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9812   rm -f conftest.er1
9813   cat conftest.err >&5
9814   echo "$as_me:9814: \$? = $ac_status" >&5
9815   (exit "$ac_status"); } >/dev/null; then
9816   if test -s conftest.err; then
9817     ac_cpp_err=$ac_c_preproc_warn_flag
9818   else
9819     ac_cpp_err=
9820   fi
9821 else
9822   ac_cpp_err=yes
9823 fi
9824 if test -z "$ac_cpp_err"; then
9825   eval "$as_ac_Header=yes"
9826 else
9827   echo "$as_me: failed program was:" >&5
9828   cat "conftest.$ac_ext" >&5
9829   eval "$as_ac_Header=no"
9830 fi
9831 rm -f conftest.err "conftest.$ac_ext"
9832 fi
9833 echo "$as_me:9833: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9834 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9835 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9836   cat >>confdefs.h <<EOF
9837 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9838 EOF
9839
9840 fi
9841 done
9842
9843 cat >>confdefs.h <<\EOF
9844 #define NCURSES 1
9845 EOF
9846
9847 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9848
9849                 cat >>confdefs.h <<EOF
9850 #define $cf_nculib_ROOT 1
9851 EOF
9852
9853                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9854
9855         else
9856
9857 cf_ncuhdr_root=ncurses
9858
9859 test -n "$cf_cv_curses_dir" && \
9860 test "$cf_cv_curses_dir" != "no" && { \
9861
9862 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9863   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9864   do
9865         while test "$cf_add_incdir" != /usr/include
9866         do
9867           if test -d "$cf_add_incdir"
9868           then
9869                 cf_have_incdir=no
9870                 if test -n "$CFLAGS$CPPFLAGS" ; then
9871                   # a loop is needed to ensure we can add subdirs of existing dirs
9872                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9873                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9874                           cf_have_incdir=yes; break
9875                         fi
9876                   done
9877                 fi
9878
9879                 if test "$cf_have_incdir" = no ; then
9880                   if test "$cf_add_incdir" = /usr/local/include ; then
9881                         if test "$GCC" = yes
9882                         then
9883                           cf_save_CPPFLAGS=$CPPFLAGS
9884
9885         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9886         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9887
9888                           cat >"conftest.$ac_ext" <<_ACEOF
9889 #line 9889 "configure"
9890 #include "confdefs.h"
9891 #include <stdio.h>
9892 int
9893 main (void)
9894 {
9895 printf("Hello")
9896   ;
9897   return 0;
9898 }
9899 _ACEOF
9900 rm -f "conftest.$ac_objext"
9901 if { (eval echo "$as_me:9901: \"$ac_compile\"") >&5
9902   (eval $ac_compile) 2>&5
9903   ac_status=$?
9904   echo "$as_me:9904: \$? = $ac_status" >&5
9905   (exit "$ac_status"); } &&
9906          { ac_try='test -s "conftest.$ac_objext"'
9907   { (eval echo "$as_me:9907: \"$ac_try\"") >&5
9908   (eval $ac_try) 2>&5
9909   ac_status=$?
9910   echo "$as_me:9910: \$? = $ac_status" >&5
9911   (exit "$ac_status"); }; }; then
9912   :
9913 else
9914   echo "$as_me: failed program was:" >&5
9915 cat "conftest.$ac_ext" >&5
9916 cf_have_incdir=yes
9917 fi
9918 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9919                           CPPFLAGS=$cf_save_CPPFLAGS
9920                         fi
9921                   fi
9922                 fi
9923
9924                 if test "$cf_have_incdir" = no ; then
9925                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9926
9927 echo "${as_me:-configure}:9927: testing adding $cf_add_incdir to include-path ..." 1>&5
9928
9929                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9930
9931                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9932                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9933                   cf_add_incdir="$cf_top_incdir"
9934                 else
9935                   break
9936                 fi
9937           else
9938                 break
9939           fi
9940         done
9941   done
9942 fi
9943
9944 }
9945
9946 echo "$as_me:9946: checking for $cf_ncuhdr_root header in include-path" >&5
9947 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9948 if test "${cf_cv_ncurses_h+set}" = set; then
9949   echo $ECHO_N "(cached) $ECHO_C" >&6
9950 else
9951
9952         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9953         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9954         for cf_header in $cf_header_list
9955         do
9956
9957         cat >"conftest.$ac_ext" <<_ACEOF
9958 #line 9958 "configure"
9959 #include "confdefs.h"
9960
9961 #include <$cf_header>
9962 int
9963 main (void)
9964 {
9965
9966 #ifdef NCURSES_VERSION
9967
9968 printf("%s\\n", NCURSES_VERSION);
9969 #else
9970 #ifdef __NCURSES_H
9971 printf("old\\n");
9972 #else
9973         make an error
9974 #endif
9975 #endif
9976
9977   ;
9978   return 0;
9979 }
9980 _ACEOF
9981 rm -f "conftest.$ac_objext"
9982 if { (eval echo "$as_me:9982: \"$ac_compile\"") >&5
9983   (eval $ac_compile) 2>&5
9984   ac_status=$?
9985   echo "$as_me:9985: \$? = $ac_status" >&5
9986   (exit "$ac_status"); } &&
9987          { ac_try='test -s "conftest.$ac_objext"'
9988   { (eval echo "$as_me:9988: \"$ac_try\"") >&5
9989   (eval $ac_try) 2>&5
9990   ac_status=$?
9991   echo "$as_me:9991: \$? = $ac_status" >&5
9992   (exit "$ac_status"); }; }; then
9993   cf_cv_ncurses_h=$cf_header
9994
9995 else
9996   echo "$as_me: failed program was:" >&5
9997 cat "conftest.$ac_ext" >&5
9998 cf_cv_ncurses_h=no
9999 fi
10000 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10001
10002                 test "$cf_cv_ncurses_h" != no && break
10003         done
10004
10005 fi
10006 echo "$as_me:10006: result: $cf_cv_ncurses_h" >&5
10007 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10008
10009 if test "$cf_cv_ncurses_h" != no ; then
10010         cf_cv_ncurses_header=$cf_cv_ncurses_h
10011 else
10012
10013 echo "$as_me:10013: checking for $cf_ncuhdr_root include-path" >&5
10014 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10015 if test "${cf_cv_ncurses_h2+set}" = set; then
10016   echo $ECHO_N "(cached) $ECHO_C" >&6
10017 else
10018
10019         test -n "$verbose" && echo
10020
10021 cf_search=
10022
10023 # collect the current set of include-directories from compiler flags
10024 cf_header_path_list=""
10025 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10026         for cf_header_path in $CPPFLAGS $CFLAGS
10027         do
10028                 case "$cf_header_path" in
10029                 (-I*)
10030                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10031
10032 test "x$cf_header_path" != "xNONE" && \
10033 test -d "$cf_header_path" && \
10034  {
10035         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10036         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10037         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10038         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10039         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10040         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"
10041 }
10042
10043                         cf_header_path_list="$cf_header_path_list $cf_search"
10044                         ;;
10045                 esac
10046         done
10047 fi
10048
10049 # add the variations for the package we are looking for
10050
10051 cf_search=
10052
10053 test "x$prefix" != "xNONE" && \
10054 test -d "$prefix" && \
10055  {
10056         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10057         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10058         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10059         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10060         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10061         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10062 }
10063
10064 for cf_subdir_prefix in \
10065         /usr \
10066         /usr/local \
10067         /usr/pkg \
10068         /opt \
10069         /opt/local \
10070         $HOME
10071 do
10072
10073 test "x$cf_subdir_prefix" != "x$prefix" && \
10074 test -d "$cf_subdir_prefix" && \
10075 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10076         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10077         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10078         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10079         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10080         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10081         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"
10082 }
10083
10084 done
10085
10086 test "$includedir" != NONE && \
10087 test "$includedir" != "/usr/include" && \
10088 test -d "$includedir" && {
10089         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10090         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10091 }
10092
10093 test "$oldincludedir" != NONE && \
10094 test "$oldincludedir" != "/usr/include" && \
10095 test -d "$oldincludedir" && {
10096         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10097         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10098 }
10099
10100 cf_search="$cf_search $cf_header_path_list"
10101
10102         test -n "$verbose" && echo "search path $cf_search"
10103         cf_save2_CPPFLAGS="$CPPFLAGS"
10104         for cf_incdir in $cf_search
10105         do
10106
10107 if test -n "$cf_incdir" ; then
10108   for cf_add_incdir in $cf_incdir
10109   do
10110         while test "$cf_add_incdir" != /usr/include
10111         do
10112           if test -d "$cf_add_incdir"
10113           then
10114                 cf_have_incdir=no
10115                 if test -n "$CFLAGS$CPPFLAGS" ; then
10116                   # a loop is needed to ensure we can add subdirs of existing dirs
10117                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10118                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10119                           cf_have_incdir=yes; break
10120                         fi
10121                   done
10122                 fi
10123
10124                 if test "$cf_have_incdir" = no ; then
10125                   if test "$cf_add_incdir" = /usr/local/include ; then
10126                         if test "$GCC" = yes
10127                         then
10128                           cf_save_CPPFLAGS=$CPPFLAGS
10129
10130         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10131         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10132
10133                           cat >"conftest.$ac_ext" <<_ACEOF
10134 #line 10134 "configure"
10135 #include "confdefs.h"
10136 #include <stdio.h>
10137 int
10138 main (void)
10139 {
10140 printf("Hello")
10141   ;
10142   return 0;
10143 }
10144 _ACEOF
10145 rm -f "conftest.$ac_objext"
10146 if { (eval echo "$as_me:10146: \"$ac_compile\"") >&5
10147   (eval $ac_compile) 2>&5
10148   ac_status=$?
10149   echo "$as_me:10149: \$? = $ac_status" >&5
10150   (exit "$ac_status"); } &&
10151          { ac_try='test -s "conftest.$ac_objext"'
10152   { (eval echo "$as_me:10152: \"$ac_try\"") >&5
10153   (eval $ac_try) 2>&5
10154   ac_status=$?
10155   echo "$as_me:10155: \$? = $ac_status" >&5
10156   (exit "$ac_status"); }; }; then
10157   :
10158 else
10159   echo "$as_me: failed program was:" >&5
10160 cat "conftest.$ac_ext" >&5
10161 cf_have_incdir=yes
10162 fi
10163 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10164                           CPPFLAGS=$cf_save_CPPFLAGS
10165                         fi
10166                   fi
10167                 fi
10168
10169                 if test "$cf_have_incdir" = no ; then
10170                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10171
10172 echo "${as_me:-configure}:10172: testing adding $cf_add_incdir to include-path ..." 1>&5
10173
10174                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10175
10176                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10177                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10178                   cf_add_incdir="$cf_top_incdir"
10179                 else
10180                   break
10181                 fi
10182           else
10183                 break
10184           fi
10185         done
10186   done
10187 fi
10188
10189                 for cf_header in \
10190                         ncurses.h \
10191                         curses.h
10192                 do
10193
10194         cat >"conftest.$ac_ext" <<_ACEOF
10195 #line 10195 "configure"
10196 #include "confdefs.h"
10197
10198 #include <$cf_header>
10199 int
10200 main (void)
10201 {
10202
10203 #ifdef NCURSES_VERSION
10204
10205 printf("%s\\n", NCURSES_VERSION);
10206 #else
10207 #ifdef __NCURSES_H
10208 printf("old\\n");
10209 #else
10210         make an error
10211 #endif
10212 #endif
10213
10214   ;
10215   return 0;
10216 }
10217 _ACEOF
10218 rm -f "conftest.$ac_objext"
10219 if { (eval echo "$as_me:10219: \"$ac_compile\"") >&5
10220   (eval $ac_compile) 2>&5
10221   ac_status=$?
10222   echo "$as_me:10222: \$? = $ac_status" >&5
10223   (exit "$ac_status"); } &&
10224          { ac_try='test -s "conftest.$ac_objext"'
10225   { (eval echo "$as_me:10225: \"$ac_try\"") >&5
10226   (eval $ac_try) 2>&5
10227   ac_status=$?
10228   echo "$as_me:10228: \$? = $ac_status" >&5
10229   (exit "$ac_status"); }; }; then
10230   cf_cv_ncurses_h2=$cf_header
10231
10232 else
10233   echo "$as_me: failed program was:" >&5
10234 cat "conftest.$ac_ext" >&5
10235 cf_cv_ncurses_h2=no
10236 fi
10237 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10238
10239                         if test "$cf_cv_ncurses_h2" != no ; then
10240                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10241                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10242                                 break
10243                         fi
10244                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10245                 done
10246                 CPPFLAGS="$cf_save2_CPPFLAGS"
10247                 test "$cf_cv_ncurses_h2" != no && break
10248         done
10249         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10249: error: not found" >&5
10250 echo "$as_me: error: not found" >&2;}
10251    { (exit 1); exit 1; }; }
10252
10253 fi
10254 echo "$as_me:10254: result: $cf_cv_ncurses_h2" >&5
10255 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10256
10257         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10258         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10259         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10260                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10261         fi
10262
10263 if test -n "$cf_1st_incdir" ; then
10264   for cf_add_incdir in $cf_1st_incdir
10265   do
10266         while test "$cf_add_incdir" != /usr/include
10267         do
10268           if test -d "$cf_add_incdir"
10269           then
10270                 cf_have_incdir=no
10271                 if test -n "$CFLAGS$CPPFLAGS" ; then
10272                   # a loop is needed to ensure we can add subdirs of existing dirs
10273                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10274                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10275                           cf_have_incdir=yes; break
10276                         fi
10277                   done
10278                 fi
10279
10280                 if test "$cf_have_incdir" = no ; then
10281                   if test "$cf_add_incdir" = /usr/local/include ; then
10282                         if test "$GCC" = yes
10283                         then
10284                           cf_save_CPPFLAGS=$CPPFLAGS
10285
10286         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10287         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10288
10289                           cat >"conftest.$ac_ext" <<_ACEOF
10290 #line 10290 "configure"
10291 #include "confdefs.h"
10292 #include <stdio.h>
10293 int
10294 main (void)
10295 {
10296 printf("Hello")
10297   ;
10298   return 0;
10299 }
10300 _ACEOF
10301 rm -f "conftest.$ac_objext"
10302 if { (eval echo "$as_me:10302: \"$ac_compile\"") >&5
10303   (eval $ac_compile) 2>&5
10304   ac_status=$?
10305   echo "$as_me:10305: \$? = $ac_status" >&5
10306   (exit "$ac_status"); } &&
10307          { ac_try='test -s "conftest.$ac_objext"'
10308   { (eval echo "$as_me:10308: \"$ac_try\"") >&5
10309   (eval $ac_try) 2>&5
10310   ac_status=$?
10311   echo "$as_me:10311: \$? = $ac_status" >&5
10312   (exit "$ac_status"); }; }; then
10313   :
10314 else
10315   echo "$as_me: failed program was:" >&5
10316 cat "conftest.$ac_ext" >&5
10317 cf_have_incdir=yes
10318 fi
10319 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10320                           CPPFLAGS=$cf_save_CPPFLAGS
10321                         fi
10322                   fi
10323                 fi
10324
10325                 if test "$cf_have_incdir" = no ; then
10326                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10327
10328 echo "${as_me:-configure}:10328: testing adding $cf_add_incdir to include-path ..." 1>&5
10329
10330                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10331
10332                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10333                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10334                   cf_add_incdir="$cf_top_incdir"
10335                 else
10336                   break
10337                 fi
10338           else
10339                 break
10340           fi
10341         done
10342   done
10343 fi
10344
10345 fi
10346
10347 # Set definitions to allow ifdef'ing for ncurses.h
10348
10349 case "$cf_cv_ncurses_header" in
10350 (*ncurses.h)
10351
10352 cat >>confdefs.h <<\EOF
10353 #define HAVE_NCURSES_H 1
10354 EOF
10355
10356         ;;
10357 esac
10358
10359 case "$cf_cv_ncurses_header" in
10360 (ncurses/curses.h|ncurses/ncurses.h)
10361
10362 cat >>confdefs.h <<\EOF
10363 #define HAVE_NCURSES_NCURSES_H 1
10364 EOF
10365
10366         ;;
10367 (ncursesw/curses.h|ncursesw/ncurses.h)
10368
10369 cat >>confdefs.h <<\EOF
10370 #define HAVE_NCURSESW_NCURSES_H 1
10371 EOF
10372
10373         ;;
10374 esac
10375
10376 echo "$as_me:10376: checking for terminfo header" >&5
10377 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10378 if test "${cf_cv_term_header+set}" = set; then
10379   echo $ECHO_N "(cached) $ECHO_C" >&6
10380 else
10381
10382 case "${cf_cv_ncurses_header}" in
10383 (*/ncurses.h|*/ncursesw.h)
10384         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10385         ;;
10386 (*)
10387         cf_term_header=term.h
10388         ;;
10389 esac
10390
10391 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10392 do
10393 cat >"conftest.$ac_ext" <<_ACEOF
10394 #line 10394 "configure"
10395 #include "confdefs.h"
10396 #include <stdio.h>
10397 #include <${cf_cv_ncurses_header:-curses.h}>
10398 #include <$cf_test>
10399
10400 int
10401 main (void)
10402 {
10403 int x = auto_left_margin; (void)x
10404   ;
10405   return 0;
10406 }
10407 _ACEOF
10408 rm -f "conftest.$ac_objext"
10409 if { (eval echo "$as_me:10409: \"$ac_compile\"") >&5
10410   (eval $ac_compile) 2>&5
10411   ac_status=$?
10412   echo "$as_me:10412: \$? = $ac_status" >&5
10413   (exit "$ac_status"); } &&
10414          { ac_try='test -s "conftest.$ac_objext"'
10415   { (eval echo "$as_me:10415: \"$ac_try\"") >&5
10416   (eval $ac_try) 2>&5
10417   ac_status=$?
10418   echo "$as_me:10418: \$? = $ac_status" >&5
10419   (exit "$ac_status"); }; }; then
10420
10421         cf_cv_term_header="$cf_test"
10422 else
10423   echo "$as_me: failed program was:" >&5
10424 cat "conftest.$ac_ext" >&5
10425
10426         cf_cv_term_header=unknown
10427
10428 fi
10429 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10430         test "$cf_cv_term_header" != unknown && break
10431 done
10432
10433 fi
10434 echo "$as_me:10434: result: $cf_cv_term_header" >&5
10435 echo "${ECHO_T}$cf_cv_term_header" >&6
10436
10437 # Set definitions to allow ifdef'ing to accommodate subdirectories
10438
10439 case "$cf_cv_term_header" in
10440 (*term.h)
10441
10442 cat >>confdefs.h <<\EOF
10443 #define HAVE_TERM_H 1
10444 EOF
10445
10446         ;;
10447 esac
10448
10449 case "$cf_cv_term_header" in
10450 (ncurses/term.h)
10451
10452 cat >>confdefs.h <<\EOF
10453 #define HAVE_NCURSES_TERM_H 1
10454 EOF
10455
10456         ;;
10457 (ncursesw/term.h)
10458
10459 cat >>confdefs.h <<\EOF
10460 #define HAVE_NCURSESW_TERM_H 1
10461 EOF
10462
10463         ;;
10464 esac
10465
10466 # some applications need this, but should check for NCURSES_VERSION
10467
10468 cat >>confdefs.h <<\EOF
10469 #define NCURSES 1
10470 EOF
10471
10472 echo "$as_me:10472: checking for ncurses version" >&5
10473 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10474 if test "${cf_cv_ncurses_version+set}" = set; then
10475   echo $ECHO_N "(cached) $ECHO_C" >&6
10476 else
10477
10478         cf_cv_ncurses_version=no
10479         cf_tempfile=out$$
10480         rm -f "$cf_tempfile"
10481         if test "$cross_compiling" = yes; then
10482
10483         # This will not work if the preprocessor splits the line after the
10484         # Autoconf token.  The 'unproto' program does that.
10485         cat > "conftest.$ac_ext" <<EOF
10486 #include <${cf_cv_ncurses_header:-curses.h}>
10487 #undef Autoconf
10488 #ifdef NCURSES_VERSION
10489 Autoconf NCURSES_VERSION
10490 #else
10491 #ifdef __NCURSES_H
10492 Autoconf "old"
10493 #endif
10494 ;
10495 #endif
10496 EOF
10497         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10498         { (eval echo "$as_me:10498: \"$cf_try\"") >&5
10499   (eval $cf_try) 2>&5
10500   ac_status=$?
10501   echo "$as_me:10501: \$? = $ac_status" >&5
10502   (exit "$ac_status"); }
10503         if test -f conftest.out ; then
10504                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10505                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10506                 rm -f conftest.out
10507         fi
10508
10509 else
10510   cat >"conftest.$ac_ext" <<_ACEOF
10511 #line 10511 "configure"
10512 #include "confdefs.h"
10513
10514 #include <${cf_cv_ncurses_header:-curses.h}>
10515 #include <stdio.h>
10516 int main(void)
10517 {
10518         FILE *fp = fopen("$cf_tempfile", "w");
10519 #ifdef NCURSES_VERSION
10520 # ifdef NCURSES_VERSION_PATCH
10521         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10522 # else
10523         fprintf(fp, "%s\\n", NCURSES_VERSION);
10524 # endif
10525 #else
10526 # ifdef __NCURSES_H
10527         fprintf(fp, "old\\n");
10528 # else
10529         make an error
10530 # endif
10531 #endif
10532         ${cf_cv_main_return:-return}(0);
10533 }
10534 _ACEOF
10535 rm -f "conftest$ac_exeext"
10536 if { (eval echo "$as_me:10536: \"$ac_link\"") >&5
10537   (eval $ac_link) 2>&5
10538   ac_status=$?
10539   echo "$as_me:10539: \$? = $ac_status" >&5
10540   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10541   { (eval echo "$as_me:10541: \"$ac_try\"") >&5
10542   (eval $ac_try) 2>&5
10543   ac_status=$?
10544   echo "$as_me:10544: \$? = $ac_status" >&5
10545   (exit "$ac_status"); }; }; then
10546
10547         cf_cv_ncurses_version=`cat $cf_tempfile`
10548 else
10549   echo "$as_me: program exited with status $ac_status" >&5
10550 echo "$as_me: failed program was:" >&5
10551 cat "conftest.$ac_ext" >&5
10552 fi
10553 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10554 fi
10555         rm -f "$cf_tempfile"
10556
10557 fi
10558 echo "$as_me:10558: result: $cf_cv_ncurses_version" >&5
10559 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10560 test "$cf_cv_ncurses_version" = no ||
10561 cat >>confdefs.h <<\EOF
10562 #define NCURSES 1
10563 EOF
10564
10565 cf_nculib_root=ncurses
10566         # This works, except for the special case where we find gpm, but
10567         # ncurses is in a nonstandard location via $LIBS, and we really want
10568         # to link gpm.
10569 cf_ncurses_LIBS=""
10570 cf_ncurses_SAVE="$LIBS"
10571 echo "$as_me:10571: checking for Gpm_Open in -lgpm" >&5
10572 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10573 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10574   echo $ECHO_N "(cached) $ECHO_C" >&6
10575 else
10576   ac_check_lib_save_LIBS=$LIBS
10577 LIBS="-lgpm  $LIBS"
10578 cat >"conftest.$ac_ext" <<_ACEOF
10579 #line 10579 "configure"
10580 #include "confdefs.h"
10581
10582 /* Override any gcc2 internal prototype to avoid an error.  */
10583 #ifdef __cplusplus
10584 extern "C"
10585 #endif
10586 /* We use char because int might match the return type of a gcc2
10587    builtin and then its argument prototype would still apply.  */
10588 char Gpm_Open ();
10589 int
10590 main (void)
10591 {
10592 Gpm_Open ();
10593   ;
10594   return 0;
10595 }
10596 _ACEOF
10597 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10598 if { (eval echo "$as_me:10598: \"$ac_link\"") >&5
10599   (eval $ac_link) 2>&5
10600   ac_status=$?
10601   echo "$as_me:10601: \$? = $ac_status" >&5
10602   (exit "$ac_status"); } &&
10603          { ac_try='test -s "conftest$ac_exeext"'
10604   { (eval echo "$as_me:10604: \"$ac_try\"") >&5
10605   (eval $ac_try) 2>&5
10606   ac_status=$?
10607   echo "$as_me:10607: \$? = $ac_status" >&5
10608   (exit "$ac_status"); }; }; then
10609   ac_cv_lib_gpm_Gpm_Open=yes
10610 else
10611   echo "$as_me: failed program was:" >&5
10612 cat "conftest.$ac_ext" >&5
10613 ac_cv_lib_gpm_Gpm_Open=no
10614 fi
10615 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10616 LIBS=$ac_check_lib_save_LIBS
10617 fi
10618 echo "$as_me:10618: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10619 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10620 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10621   echo "$as_me:10621: checking for initscr in -lgpm" >&5
10622 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10623 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10624   echo $ECHO_N "(cached) $ECHO_C" >&6
10625 else
10626   ac_check_lib_save_LIBS=$LIBS
10627 LIBS="-lgpm  $LIBS"
10628 cat >"conftest.$ac_ext" <<_ACEOF
10629 #line 10629 "configure"
10630 #include "confdefs.h"
10631
10632 /* Override any gcc2 internal prototype to avoid an error.  */
10633 #ifdef __cplusplus
10634 extern "C"
10635 #endif
10636 /* We use char because int might match the return type of a gcc2
10637    builtin and then its argument prototype would still apply.  */
10638 char initscr ();
10639 int
10640 main (void)
10641 {
10642 initscr ();
10643   ;
10644   return 0;
10645 }
10646 _ACEOF
10647 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10648 if { (eval echo "$as_me:10648: \"$ac_link\"") >&5
10649   (eval $ac_link) 2>&5
10650   ac_status=$?
10651   echo "$as_me:10651: \$? = $ac_status" >&5
10652   (exit "$ac_status"); } &&
10653          { ac_try='test -s "conftest$ac_exeext"'
10654   { (eval echo "$as_me:10654: \"$ac_try\"") >&5
10655   (eval $ac_try) 2>&5
10656   ac_status=$?
10657   echo "$as_me:10657: \$? = $ac_status" >&5
10658   (exit "$ac_status"); }; }; then
10659   ac_cv_lib_gpm_initscr=yes
10660 else
10661   echo "$as_me: failed program was:" >&5
10662 cat "conftest.$ac_ext" >&5
10663 ac_cv_lib_gpm_initscr=no
10664 fi
10665 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10666 LIBS=$ac_check_lib_save_LIBS
10667 fi
10668 echo "$as_me:10668: result: $ac_cv_lib_gpm_initscr" >&5
10669 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10670 if test "$ac_cv_lib_gpm_initscr" = yes; then
10671   LIBS="$cf_ncurses_SAVE"
10672 else
10673   cf_ncurses_LIBS="-lgpm"
10674 fi
10675
10676 fi
10677
10678 case "$host_os" in
10679 (freebsd*)
10680         # This is only necessary if you are linking against an obsolete
10681         # version of ncurses (but it should do no harm, since it's static).
10682         if test "$cf_nculib_root" = ncurses ; then
10683                 echo "$as_me:10683: checking for tgoto in -lmytinfo" >&5
10684 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10685 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10686   echo $ECHO_N "(cached) $ECHO_C" >&6
10687 else
10688   ac_check_lib_save_LIBS=$LIBS
10689 LIBS="-lmytinfo  $LIBS"
10690 cat >"conftest.$ac_ext" <<_ACEOF
10691 #line 10691 "configure"
10692 #include "confdefs.h"
10693
10694 /* Override any gcc2 internal prototype to avoid an error.  */
10695 #ifdef __cplusplus
10696 extern "C"
10697 #endif
10698 /* We use char because int might match the return type of a gcc2
10699    builtin and then its argument prototype would still apply.  */
10700 char tgoto ();
10701 int
10702 main (void)
10703 {
10704 tgoto ();
10705   ;
10706   return 0;
10707 }
10708 _ACEOF
10709 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10710 if { (eval echo "$as_me:10710: \"$ac_link\"") >&5
10711   (eval $ac_link) 2>&5
10712   ac_status=$?
10713   echo "$as_me:10713: \$? = $ac_status" >&5
10714   (exit "$ac_status"); } &&
10715          { ac_try='test -s "conftest$ac_exeext"'
10716   { (eval echo "$as_me:10716: \"$ac_try\"") >&5
10717   (eval $ac_try) 2>&5
10718   ac_status=$?
10719   echo "$as_me:10719: \$? = $ac_status" >&5
10720   (exit "$ac_status"); }; }; then
10721   ac_cv_lib_mytinfo_tgoto=yes
10722 else
10723   echo "$as_me: failed program was:" >&5
10724 cat "conftest.$ac_ext" >&5
10725 ac_cv_lib_mytinfo_tgoto=no
10726 fi
10727 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10728 LIBS=$ac_check_lib_save_LIBS
10729 fi
10730 echo "$as_me:10730: result: $ac_cv_lib_mytinfo_tgoto" >&5
10731 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10732 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10733   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10734 fi
10735
10736         fi
10737         ;;
10738 esac
10739
10740 cf_add_libs="$LIBS"
10741 # reverse order
10742 cf_add_0lib=
10743 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10744 # filter duplicates
10745 for cf_add_1lib in $cf_add_0lib; do
10746         for cf_add_2lib in $cf_add_libs; do
10747                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10748                         cf_add_1lib=
10749                         break
10750                 fi
10751         done
10752         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10753 done
10754 LIBS="$cf_add_libs"
10755
10756 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10757 then
10758
10759 cf_add_libs="$LIBS"
10760 # reverse order
10761 cf_add_0lib=
10762 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10763 # filter duplicates
10764 for cf_add_1lib in $cf_add_0lib; do
10765         for cf_add_2lib in $cf_add_libs; do
10766                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10767                         cf_add_1lib=
10768                         break
10769                 fi
10770         done
10771         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10772 done
10773 LIBS="$cf_add_libs"
10774
10775 else
10776
10777         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10778         cf_libdir=""
10779         echo "$as_me:10779: checking for initscr" >&5
10780 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10781 if test "${ac_cv_func_initscr+set}" = set; then
10782   echo $ECHO_N "(cached) $ECHO_C" >&6
10783 else
10784   cat >"conftest.$ac_ext" <<_ACEOF
10785 #line 10785 "configure"
10786 #include "confdefs.h"
10787 #define initscr autoconf_temporary
10788 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10789 #undef initscr
10790
10791 #ifdef __cplusplus
10792 extern "C"
10793 #endif
10794
10795 /* We use char because int might match the return type of a gcc2
10796    builtin and then its argument prototype would still apply.  */
10797 char initscr (void);
10798
10799 int
10800 main (void)
10801 {
10802
10803 /* The GNU C library defines stubs for functions which it implements
10804     to always fail with ENOSYS.  Some functions are actually named
10805     something starting with __ and the normal name is an alias.  */
10806 #if defined (__stub_initscr) || defined (__stub___initscr)
10807 #error found stub for initscr
10808 #endif
10809
10810         return initscr ();
10811   ;
10812   return 0;
10813 }
10814 _ACEOF
10815 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10816 if { (eval echo "$as_me:10816: \"$ac_link\"") >&5
10817   (eval $ac_link) 2>&5
10818   ac_status=$?
10819   echo "$as_me:10819: \$? = $ac_status" >&5
10820   (exit "$ac_status"); } &&
10821          { ac_try='test -s "conftest$ac_exeext"'
10822   { (eval echo "$as_me:10822: \"$ac_try\"") >&5
10823   (eval $ac_try) 2>&5
10824   ac_status=$?
10825   echo "$as_me:10825: \$? = $ac_status" >&5
10826   (exit "$ac_status"); }; }; then
10827   ac_cv_func_initscr=yes
10828 else
10829   echo "$as_me: failed program was:" >&5
10830 cat "conftest.$ac_ext" >&5
10831 ac_cv_func_initscr=no
10832 fi
10833 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10834 fi
10835 echo "$as_me:10835: result: $ac_cv_func_initscr" >&5
10836 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10837 if test "$ac_cv_func_initscr" = yes; then
10838   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10839 else
10840
10841                 cf_save_LIBS="$LIBS"
10842                 echo "$as_me:10842: checking for initscr in -l$cf_nculib_root" >&5
10843 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10844                 LIBS="-l$cf_nculib_root $LIBS"
10845                 cat >"conftest.$ac_ext" <<_ACEOF
10846 #line 10846 "configure"
10847 #include "confdefs.h"
10848 #include <${cf_cv_ncurses_header:-curses.h}>
10849 int
10850 main (void)
10851 {
10852 initscr()
10853   ;
10854   return 0;
10855 }
10856 _ACEOF
10857 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10858 if { (eval echo "$as_me:10858: \"$ac_link\"") >&5
10859   (eval $ac_link) 2>&5
10860   ac_status=$?
10861   echo "$as_me:10861: \$? = $ac_status" >&5
10862   (exit "$ac_status"); } &&
10863          { ac_try='test -s "conftest$ac_exeext"'
10864   { (eval echo "$as_me:10864: \"$ac_try\"") >&5
10865   (eval $ac_try) 2>&5
10866   ac_status=$?
10867   echo "$as_me:10867: \$? = $ac_status" >&5
10868   (exit "$ac_status"); }; }; then
10869   echo "$as_me:10869: result: yes" >&5
10870 echo "${ECHO_T}yes" >&6
10871                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10872
10873 else
10874   echo "$as_me: failed program was:" >&5
10875 cat "conftest.$ac_ext" >&5
10876 echo "$as_me:10876: result: no" >&5
10877 echo "${ECHO_T}no" >&6
10878
10879 cf_search=
10880 cf_library_path_list=""
10881 if test -n "${LDFLAGS}${LIBS}" ; then
10882         for cf_library_path in $LDFLAGS $LIBS
10883         do
10884                 case "$cf_library_path" in
10885                 (-L*)
10886                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10887
10888 test "x$cf_library_path" != "xNONE" && \
10889 test -d "$cf_library_path" && \
10890  {
10891         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10892         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10893         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10894         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10895         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10896         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"
10897 }
10898
10899                         cf_library_path_list="$cf_library_path_list $cf_search"
10900                         ;;
10901                 esac
10902         done
10903 fi
10904
10905 cf_search=
10906
10907 test "x$prefix" != "xNONE" && \
10908 test -d "$prefix" && \
10909  {
10910         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10911         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10912         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10913         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10914         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10915         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10916 }
10917
10918 for cf_subdir_prefix in \
10919         /usr \
10920         /usr/local \
10921         /usr/pkg \
10922         /opt \
10923         /opt/local \
10924         $HOME
10925 do
10926
10927 test "x$cf_subdir_prefix" != "x$prefix" && \
10928 test -d "$cf_subdir_prefix" && \
10929 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10930         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10931         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10932         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10933         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10934         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10935         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"
10936 }
10937
10938 done
10939
10940 cf_search="$cf_library_path_list $cf_search"
10941
10942                         for cf_libdir in $cf_search
10943                         do
10944                                 echo "$as_me:10944: checking for -l$cf_nculib_root in $cf_libdir" >&5
10945 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10946                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10947                                 cat >"conftest.$ac_ext" <<_ACEOF
10948 #line 10948 "configure"
10949 #include "confdefs.h"
10950 #include <${cf_cv_ncurses_header:-curses.h}>
10951 int
10952 main (void)
10953 {
10954 initscr()
10955   ;
10956   return 0;
10957 }
10958 _ACEOF
10959 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10960 if { (eval echo "$as_me:10960: \"$ac_link\"") >&5
10961   (eval $ac_link) 2>&5
10962   ac_status=$?
10963   echo "$as_me:10963: \$? = $ac_status" >&5
10964   (exit "$ac_status"); } &&
10965          { ac_try='test -s "conftest$ac_exeext"'
10966   { (eval echo "$as_me:10966: \"$ac_try\"") >&5
10967   (eval $ac_try) 2>&5
10968   ac_status=$?
10969   echo "$as_me:10969: \$? = $ac_status" >&5
10970   (exit "$ac_status"); }; }; then
10971   echo "$as_me:10971: result: yes" >&5
10972 echo "${ECHO_T}yes" >&6
10973                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10974                                          break
10975 else
10976   echo "$as_me: failed program was:" >&5
10977 cat "conftest.$ac_ext" >&5
10978 echo "$as_me:10978: result: no" >&5
10979 echo "${ECHO_T}no" >&6
10980                                          LIBS="$cf_save_LIBS"
10981 fi
10982 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10983                         done
10984
10985 fi
10986 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10987
10988 fi
10989
10990 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10991
10992 if test "$cf_found_library" = no ; then
10993         { { echo "$as_me:10993: error: Cannot link $cf_nculib_root library" >&5
10994 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10995    { (exit 1); exit 1; }; }
10996 fi
10997
10998 fi
10999
11000 if test -n "$cf_ncurses_LIBS" ; then
11001         echo "$as_me:11001: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11002 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11003         cf_ncurses_SAVE="$LIBS"
11004         for p in $cf_ncurses_LIBS ; do
11005                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11006                 if test "$q" != "$LIBS" ; then
11007                         LIBS="$q"
11008                 fi
11009         done
11010         cat >"conftest.$ac_ext" <<_ACEOF
11011 #line 11011 "configure"
11012 #include "confdefs.h"
11013 #include <${cf_cv_ncurses_header:-curses.h}>
11014 int
11015 main (void)
11016 {
11017 initscr(); mousemask(0,0); tigetstr((char *)0);
11018   ;
11019   return 0;
11020 }
11021 _ACEOF
11022 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11023 if { (eval echo "$as_me:11023: \"$ac_link\"") >&5
11024   (eval $ac_link) 2>&5
11025   ac_status=$?
11026   echo "$as_me:11026: \$? = $ac_status" >&5
11027   (exit "$ac_status"); } &&
11028          { ac_try='test -s "conftest$ac_exeext"'
11029   { (eval echo "$as_me:11029: \"$ac_try\"") >&5
11030   (eval $ac_try) 2>&5
11031   ac_status=$?
11032   echo "$as_me:11032: \$? = $ac_status" >&5
11033   (exit "$ac_status"); }; }; then
11034   echo "$as_me:11034: result: yes" >&5
11035 echo "${ECHO_T}yes" >&6
11036 else
11037   echo "$as_me: failed program was:" >&5
11038 cat "conftest.$ac_ext" >&5
11039 echo "$as_me:11039: result: no" >&5
11040 echo "${ECHO_T}no" >&6
11041                  LIBS="$cf_ncurses_SAVE"
11042 fi
11043 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11044 fi
11045
11046 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11047
11048 cat >>confdefs.h <<EOF
11049 #define $cf_nculib_ROOT 1
11050 EOF
11051
11052         fi
11053 else
11054         NCURSES_CONFIG=none
11055 fi
11056
11057 fi
11058
11059 if test "$NCURSES_CONFIG_PKG" != none ; then
11060         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11061
11062         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11063         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11064         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11065
11066         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11067         if test -z "$cf_cv_abi_version"
11068         then
11069                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11070         fi
11071
11072 elif test "$NCURSES_CONFIG" != none ; then
11073
11074         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11075
11076         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11077         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11078         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11079
11080         # ABI version is not available from headers
11081         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11082
11083 else
11084
11085         for cf_name in MAJOR MINOR PATCH
11086         do
11087         cat >conftest.$ac_ext <<CF_EOF
11088         #include <${cf_cv_ncurses_header:-curses.h}>
11089         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11090 CF_EOF
11091                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11092                 { (eval echo "$as_me:11092: \"$cf_try\"") >&5
11093   (eval $cf_try) 2>&5
11094   ac_status=$?
11095   echo "$as_me:11095: \$? = $ac_status" >&5
11096   (exit "$ac_status"); }
11097                 if test -f conftest.out ; then
11098                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11099                         eval NCURSES_$cf_name=\"$cf_result\"
11100                         # cat conftest.$ac_ext
11101                         # cat conftest.out
11102                 fi
11103         done
11104
11105         cf_cv_abi_version=${NCURSES_MAJOR}
11106
11107 fi
11108
11109 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11110
11111 cf_cv_timestamp=`date`
11112
11113 echo "$as_me:11113: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11114 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11115
11116 echo "$as_me:11116: checking if you want to have a library-prefix" >&5
11117 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11118
11119 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11120 if test "${with_lib_prefix+set}" = set; then
11121   withval="$with_lib_prefix"
11122   with_lib_prefix=$withval
11123 else
11124   with_lib_prefix=auto
11125 fi;
11126 echo "$as_me:11126: result: $with_lib_prefix" >&5
11127 echo "${ECHO_T}$with_lib_prefix" >&6
11128
11129 if test "$with_lib_prefix" = auto
11130 then
11131
11132         case "$cf_cv_system_name" in
11133         (OS/2*|os2*)
11134                 if test "$DFT_LWR_MODEL" = libtool; then
11135                         LIB_PREFIX='lib'
11136                 else
11137                         LIB_PREFIX=''
11138                 fi
11139                 ;;
11140         (*-msvc*)
11141                 LIB_PREFIX=''
11142                 ;;
11143         (*)     LIB_PREFIX='lib'
11144                 ;;
11145         esac
11146 cf_prefix=$LIB_PREFIX
11147
11148 elif test "$with_lib_prefix" = no
11149 then
11150         LIB_PREFIX=
11151 else
11152         LIB_PREFIX=$with_lib_prefix
11153 fi
11154
11155 LIB_SUFFIX=
11156
11157 ###############################################################################
11158
11159 if test X"$CC_G_OPT" = X"" ; then
11160         CC_G_OPT='-g'
11161         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11162 fi
11163
11164 echo "$as_me:11164: checking for default loader flags" >&5
11165 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11166 case $DFT_LWR_MODEL in
11167 (normal)  LD_MODEL=''   ;;
11168 (debug)   LD_MODEL=$CC_G_OPT ;;
11169 (profile) LD_MODEL='-pg';;
11170 (shared)  LD_MODEL=''   ;;
11171 esac
11172 echo "$as_me:11172: result: $LD_MODEL" >&5
11173 echo "${ECHO_T}$LD_MODEL" >&6
11174
11175 LD_RPATH_OPT=
11176 if test "x$cf_cv_enable_rpath" != xno
11177 then
11178         echo "$as_me:11178: checking for an rpath option" >&5
11179 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11180         case "$cf_cv_system_name" in
11181         (irix*)
11182                 if test "$GCC" = yes; then
11183                         LD_RPATH_OPT="-Wl,-rpath,"
11184                 else
11185                         LD_RPATH_OPT="-rpath "
11186                 fi
11187                 ;;
11188         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11189                 LD_RPATH_OPT="-Wl,-rpath,"
11190                 ;;
11191         (openbsd[2-9].*|mirbsd*)
11192                 LD_RPATH_OPT="-Wl,-rpath,"
11193                 ;;
11194         (dragonfly*)
11195                 LD_RPATH_OPT="-rpath "
11196                 ;;
11197         (netbsd*)
11198                 LD_RPATH_OPT="-Wl,-rpath,"
11199                 ;;
11200         (osf*|mls+*)
11201                 LD_RPATH_OPT="-rpath "
11202                 ;;
11203         (solaris2*)
11204                 LD_RPATH_OPT="-R"
11205                 ;;
11206         (*)
11207                 ;;
11208         esac
11209         echo "$as_me:11209: result: $LD_RPATH_OPT" >&5
11210 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11211
11212         case "x$LD_RPATH_OPT" in
11213         (x-R*)
11214                 echo "$as_me:11214: checking if we need a space after rpath option" >&5
11215 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11216                 cf_save_LIBS="$LIBS"
11217
11218 cf_add_libs="$LIBS"
11219 # reverse order
11220 cf_add_0lib=
11221 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11222 # filter duplicates
11223 for cf_add_1lib in $cf_add_0lib; do
11224         for cf_add_2lib in $cf_add_libs; do
11225                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11226                         cf_add_1lib=
11227                         break
11228                 fi
11229         done
11230         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11231 done
11232 LIBS="$cf_add_libs"
11233
11234                 cat >"conftest.$ac_ext" <<_ACEOF
11235 #line 11235 "configure"
11236 #include "confdefs.h"
11237
11238 int
11239 main (void)
11240 {
11241
11242   ;
11243   return 0;
11244 }
11245 _ACEOF
11246 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11247 if { (eval echo "$as_me:11247: \"$ac_link\"") >&5
11248   (eval $ac_link) 2>&5
11249   ac_status=$?
11250   echo "$as_me:11250: \$? = $ac_status" >&5
11251   (exit "$ac_status"); } &&
11252          { ac_try='test -s "conftest$ac_exeext"'
11253   { (eval echo "$as_me:11253: \"$ac_try\"") >&5
11254   (eval $ac_try) 2>&5
11255   ac_status=$?
11256   echo "$as_me:11256: \$? = $ac_status" >&5
11257   (exit "$ac_status"); }; }; then
11258   cf_rpath_space=no
11259 else
11260   echo "$as_me: failed program was:" >&5
11261 cat "conftest.$ac_ext" >&5
11262 cf_rpath_space=yes
11263 fi
11264 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11265                 LIBS="$cf_save_LIBS"
11266                 echo "$as_me:11266: result: $cf_rpath_space" >&5
11267 echo "${ECHO_T}$cf_rpath_space" >&6
11268                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11269                 ;;
11270         esac
11271 fi
11272
11273         RM_SHARED_OPTS=
11274         LOCAL_LDFLAGS=
11275         LOCAL_LDFLAGS2=
11276         LD_SHARED_OPTS=
11277         INSTALL_LIB="-m 644"
11278         : ${rel_builddir:=.}
11279
11280         shlibdir=$libdir
11281
11282         MAKE_DLLS="#"
11283
11284         cf_cv_do_symlinks=no
11285         cf_ld_rpath_opt=
11286         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11287
11288         echo "$as_me:11288: checking if release/abi version should be used for shared libs" >&5
11289 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11290
11291 # Check whether --with-shlib-version or --without-shlib-version was given.
11292 if test "${with_shlib_version+set}" = set; then
11293   withval="$with_shlib_version"
11294   test -z "$withval" && withval=auto
11295         case "$withval" in
11296         (yes)
11297                 cf_cv_shlib_version=auto
11298                 ;;
11299         (rel|abi|auto)
11300                 cf_cv_shlib_version=$withval
11301                 ;;
11302         (*)
11303                 echo "$as_me:11303: result: $withval" >&5
11304 echo "${ECHO_T}$withval" >&6
11305                 { { echo "$as_me:11305: error: option value must be one of: rel, abi, or auto" >&5
11306 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11307    { (exit 1); exit 1; }; }
11308                 ;;
11309         esac
11310
11311 else
11312   cf_cv_shlib_version=auto
11313 fi;
11314         echo "$as_me:11314: result: $cf_cv_shlib_version" >&5
11315 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11316
11317         cf_cv_rm_so_locs=no
11318         cf_try_cflags=
11319
11320         # Some less-capable ports of gcc support only -fpic
11321         CC_SHARED_OPTS=
11322
11323         cf_try_fPIC=no
11324         if test "$GCC" = yes
11325         then
11326                 cf_try_fPIC=yes
11327         else
11328                 case "$cf_cv_system_name" in
11329                 (*linux*)       # e.g., PGI compiler
11330                         cf_try_fPIC=yes
11331                         ;;
11332                 esac
11333         fi
11334
11335         if test "$cf_try_fPIC" = yes
11336         then
11337                 echo "$as_me:11337: checking which $CC option to use" >&5
11338 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11339                 cf_save_CFLAGS="$CFLAGS"
11340                 for CC_SHARED_OPTS in -fPIC -fpic ''
11341                 do
11342                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11343                         cat >"conftest.$ac_ext" <<_ACEOF
11344 #line 11344 "configure"
11345 #include "confdefs.h"
11346 #include <stdio.h>
11347 int
11348 main (void)
11349 {
11350 int x = 1
11351   ;
11352   return 0;
11353 }
11354 _ACEOF
11355 rm -f "conftest.$ac_objext"
11356 if { (eval echo "$as_me:11356: \"$ac_compile\"") >&5
11357   (eval $ac_compile) 2>&5
11358   ac_status=$?
11359   echo "$as_me:11359: \$? = $ac_status" >&5
11360   (exit "$ac_status"); } &&
11361          { ac_try='test -s "conftest.$ac_objext"'
11362   { (eval echo "$as_me:11362: \"$ac_try\"") >&5
11363   (eval $ac_try) 2>&5
11364   ac_status=$?
11365   echo "$as_me:11365: \$? = $ac_status" >&5
11366   (exit "$ac_status"); }; }; then
11367   break
11368 else
11369   echo "$as_me: failed program was:" >&5
11370 cat "conftest.$ac_ext" >&5
11371 fi
11372 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11373                 done
11374                 echo "$as_me:11374: result: $CC_SHARED_OPTS" >&5
11375 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11376                 CFLAGS="$cf_save_CFLAGS"
11377         fi
11378
11379         cf_cv_shlib_version_infix=no
11380
11381         case "$cf_cv_system_name" in
11382         (aix4.3-9*|aix[5-7]*)
11383                 if test "$GCC" = yes; then
11384                         CC_SHARED_OPTS='-Wl,-brtl'
11385                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11386                 else
11387                         CC_SHARED_OPTS='-brtl'
11388                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11389                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11390                 fi
11391                 ;;
11392         (beos*)
11393                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11394                 ;;
11395         (cygwin*)
11396                 CC_SHARED_OPTS=
11397                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11398                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11399                 cf_cv_shlib_version=cygdll
11400                 cf_cv_shlib_version_infix=cygdll
11401                 shlibdir=$bindir
11402                 MAKE_DLLS=
11403                 cat >mk_shared_lib.sh <<-CF_EOF
11404                 #!$SHELL
11405                 SHARED_LIB=\$1
11406                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11407                 shift
11408                 cat <<-EOF
11409                 Linking shared library
11410                 ** SHARED_LIB \$SHARED_LIB
11411                 ** IMPORT_LIB \$IMPORT_LIB
11412 EOF
11413                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11414 CF_EOF
11415                 chmod +x mk_shared_lib.sh
11416                 ;;
11417         (msys*)
11418                 CC_SHARED_OPTS=
11419                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11420                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11421                 cf_cv_shlib_version=msysdll
11422                 cf_cv_shlib_version_infix=msysdll
11423                 shlibdir=$bindir
11424                 MAKE_DLLS=
11425                 cat >mk_shared_lib.sh <<-CF_EOF
11426                 #!$SHELL
11427                 SHARED_LIB=\$1
11428                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11429                 shift
11430                 cat <<-EOF
11431                 Linking shared library
11432                 ** SHARED_LIB \$SHARED_LIB
11433                 ** IMPORT_LIB \$IMPORT_LIB
11434 EOF
11435                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11436 CF_EOF
11437                 chmod +x mk_shared_lib.sh
11438                 ;;
11439         (darwin*)
11440                 cf_try_cflags="no-cpp-precomp"
11441                 CC_SHARED_OPTS="-dynamic"
11442                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11443                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11444                 cf_cv_shlib_version_infix=yes
11445                 echo "$as_me:11445: checking if ld -search_paths_first works" >&5
11446 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11447 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11448   echo $ECHO_N "(cached) $ECHO_C" >&6
11449 else
11450
11451                         cf_save_LDFLAGS=$LDFLAGS
11452                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11453                         cat >"conftest.$ac_ext" <<_ACEOF
11454 #line 11454 "configure"
11455 #include "confdefs.h"
11456
11457 int
11458 main (void)
11459 {
11460 int i;
11461   ;
11462   return 0;
11463 }
11464 _ACEOF
11465 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11466 if { (eval echo "$as_me:11466: \"$ac_link\"") >&5
11467   (eval $ac_link) 2>&5
11468   ac_status=$?
11469   echo "$as_me:11469: \$? = $ac_status" >&5
11470   (exit "$ac_status"); } &&
11471          { ac_try='test -s "conftest$ac_exeext"'
11472   { (eval echo "$as_me:11472: \"$ac_try\"") >&5
11473   (eval $ac_try) 2>&5
11474   ac_status=$?
11475   echo "$as_me:11475: \$? = $ac_status" >&5
11476   (exit "$ac_status"); }; }; then
11477   cf_cv_ldflags_search_paths_first=yes
11478 else
11479   echo "$as_me: failed program was:" >&5
11480 cat "conftest.$ac_ext" >&5
11481 cf_cv_ldflags_search_paths_first=no
11482 fi
11483 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11484                                 LDFLAGS=$cf_save_LDFLAGS
11485 fi
11486 echo "$as_me:11486: result: $cf_cv_ldflags_search_paths_first" >&5
11487 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11488                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11489                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11490                 fi
11491                 ;;
11492         (hpux[7-8]*)
11493                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11494                 if test "$GCC" != yes; then
11495                         CC_SHARED_OPTS='+Z'
11496                 fi
11497                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11498                 INSTALL_LIB="-m 555"
11499                 ;;
11500         (hpux*)
11501                 # (tested with gcc 2.7.2 -- I don't have c89)
11502                 if test "$GCC" = yes; then
11503                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11504                 else
11505                         CC_SHARED_OPTS='+Z'
11506                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11507                 fi
11508                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11509                 # HP-UX shared libraries must be executable, and should be
11510                 # readonly to exploit a quirk in the memory manager.
11511                 INSTALL_LIB="-m 555"
11512                 ;;
11513         (interix*)
11514                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11515                 if test "$cf_cv_shlib_version" = rel; then
11516                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11517                 else
11518                         cf_shared_soname='`basename $@`'
11519                 fi
11520                 CC_SHARED_OPTS=
11521                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11522                 ;;
11523         (irix*)
11524                 if test "$cf_cv_enable_rpath" = yes ; then
11525                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11526                 fi
11527                 # tested with IRIX 5.2 and 'cc'.
11528                 if test "$GCC" != yes; then
11529                         CC_SHARED_OPTS='-KPIC'
11530                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11531                 else
11532                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11533                 fi
11534                 cf_cv_rm_so_locs=yes
11535                 ;;
11536         (linux*|gnu*|k*bsd*-gnu)
11537                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11538                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11539                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11540                 fi
11541                 if test "$cf_cv_enable_rpath" = yes ; then
11542                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11543                 fi
11544
11545         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11546         if test "$cf_cv_shlib_version" = rel; then
11547                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11548         else
11549                 cf_cv_shared_soname='`basename $@`'
11550         fi
11551
11552                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11553                 ;;
11554         (mingw*msvc*)
11555                 cf_cv_shlib_version=msvcdll
11556                 cf_cv_shlib_version_infix=msvcdll
11557                 shlibdir=$bindir
11558                 MAKE_DLLS=
11559                 if test "$DFT_LWR_MODEL" = "shared" ; then
11560                         LOCAL_LDFLAGS="-link -dll"
11561                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11562                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11563                 fi
11564                 CC_SHARED_OPTS=
11565                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11566                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11567                 cat >mk_shared_lib.sh <<-CF_EOF
11568                 #!$SHELL
11569                 SHARED_LIB=\$1
11570                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11571                 shift
11572                 my_ld=\$1
11573                 shift
11574                 cat <<-EOF
11575                 Linking shared library
11576                 ** SHARED LIB \$SHARED_LIB
11577                 ** IMPORT_LIB \$IMPORT_LIB
11578 EOF
11579                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11580                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11581                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11582 CF_EOF
11583                 chmod +x mk_shared_lib.sh
11584                 cat >mk_prog.sh <<-CF_EOF
11585                 #!$SHELL
11586                 shift
11587                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11588                 LD="$LD"
11589                 clopts=()
11590                 ldopts=("/subsystem:console")
11591                 libs=()
11592                 isdll=0
11593                 while test \$# -gt 0; do
11594                         case "\$1" in
11595                                 -link)
11596                                         # ignore -link argument
11597                                         ;;
11598                                 -M[TD] | -M[TD]d)
11599                                         # ignore runtime-library option
11600                                         ;;
11601                                 -dll)
11602                                         isdll=1
11603                                         ;;
11604                                 -W* | -w*)
11605                                         # ignore warnings
11606                                         ;;
11607                                 -D*)
11608                                         clopts+=("\$1")
11609                                         ;;
11610                                 -I*)
11611                                         clopts+=("\$1")
11612                                         ;;
11613                                 -l*)
11614                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11615                                         ;;
11616                                 -L*)
11617                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11618                                         ;;
11619                                 *.obj | *.o)
11620                                         ldopts+=("\$1")
11621                                         ;;
11622                                 -Wl,*)
11623                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11624                                                 ldopts+=("\${linkarg}")
11625                                         done
11626                                         ;;
11627                                 *.lib)
11628                                         ldopts+=("\$1")
11629                                         ;;
11630                                 -o)
11631                                         shift
11632                                         ldopts+=("-out:\$1")
11633                                         ;;
11634                                 *)
11635                                         clopts+=("\$1")
11636                                         ldopts+=("\$1")
11637                                         ;;
11638                         esac
11639                         shift
11640                 done
11641                 if [ "\$isdll" -ne 0 ]; then
11642                         for lib in \${libs[*]}; do
11643                                 ldopts+=("\$lib.dll.lib")
11644                         done
11645                 else
11646                         for lib in \${libs[*]}; do
11647                                 ldopts+=("\$lib.lib")
11648                         done
11649                 fi
11650                 cat <<-EOF
11651                 Creating program
11652                 ** ld options:   "\${ldopts[@]}"
11653 EOF
11654                 exec \$LD \${ldopts[@]}
11655 CF_EOF
11656                 chmod +x mk_prog.sh
11657                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11658                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11659                 ;;
11660         (mingw*)
11661                 cf_cv_shlib_version=mingw
11662                 cf_cv_shlib_version_infix=mingw
11663                 shlibdir=$bindir
11664                 MAKE_DLLS=
11665                 if test "$DFT_LWR_MODEL" = "shared" ; then
11666                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11667                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11668                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11669                 fi
11670                 CC_SHARED_OPTS=
11671                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11672                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11673                 cat >mk_shared_lib.sh <<-CF_EOF
11674                 #!$SHELL
11675                 SHARED_LIB=\$1
11676                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11677                 shift
11678                 cat <<-EOF
11679                 Linking shared library
11680                 ** SHARED_LIB \$SHARED_LIB
11681                 ** IMPORT_LIB \$IMPORT_LIB
11682 EOF
11683                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11684 CF_EOF
11685                 chmod +x mk_shared_lib.sh
11686                 ;;
11687         (openbsd[2-9].*|mirbsd*)
11688                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11689                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11690                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11691                 fi
11692                 if test "$cf_cv_enable_rpath" = yes ; then
11693                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11694                 fi
11695                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11696
11697         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11698         if test "$cf_cv_shlib_version" = rel; then
11699                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11700         else
11701                 cf_cv_shared_soname='`basename $@`'
11702         fi
11703
11704                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11705                 ;;
11706         (nskJ*)
11707                 CC_SHARED_OPTS=
11708                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11709                 ;;
11710         (nskL*)
11711                 CC_SHARED_OPTS=
11712                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11713                 ;;
11714         (nto-qnx*|openbsd*|freebsd[12].*)
11715                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11716                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11717                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11718                 ;;
11719         (dragonfly*|freebsd*)
11720                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11721                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11722                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11723                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11724                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11725                 fi
11726
11727         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11728         if test "$cf_cv_shlib_version" = rel; then
11729                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11730         else
11731                 cf_cv_shared_soname='`basename $@`'
11732         fi
11733
11734                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11735                 ;;
11736         (netbsd*)
11737                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11738                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11739                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11740                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11741                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11742                         if test "$cf_cv_shlib_version" = auto; then
11743                         if test -f /usr/libexec/ld.elf_so; then
11744                                 cf_cv_shlib_version=abi
11745                         else
11746                                 cf_cv_shlib_version=rel
11747                         fi
11748                         fi
11749
11750         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11751         if test "$cf_cv_shlib_version" = rel; then
11752                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11753         else
11754                 cf_cv_shared_soname='`basename $@`'
11755         fi
11756
11757                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11758                 else
11759                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11760                 fi
11761                 ;;
11762         (osf*|mls+*)
11763                 # tested with OSF/1 V3.2 and 'cc'
11764                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11765                 # link with shared libs).
11766                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11767                 case "$host_os" in
11768                 (osf4*)
11769                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11770                         ;;
11771                 esac
11772                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11773                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11774                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11775                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11776                 fi
11777                 cf_cv_rm_so_locs=yes
11778                 ;;
11779         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11780                 # tested with osr5.0.5
11781                 if test "$GCC" != yes; then
11782                         CC_SHARED_OPTS='-belf -KPIC'
11783                 fi
11784                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11785                 if test "$cf_cv_enable_rpath" = yes ; then
11786                         # only way is to set LD_RUN_PATH but no switch for it
11787                         RUN_PATH=$libdir
11788                 fi
11789                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11790                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11791                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11792                 ;;
11793         (sunos4*)
11794                 # tested with SunOS 4.1.1 and gcc 2.7.0
11795                 if test "$GCC" != yes; then
11796                         CC_SHARED_OPTS='-KPIC'
11797                 fi
11798                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11799                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11800                 ;;
11801         (solaris2*)
11802                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11803                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11804                 if test "$DFT_LWR_MODEL" = "shared" ; then
11805                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11806                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11807                 fi
11808                 if test "$cf_cv_enable_rpath" = yes ; then
11809                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11810                 fi
11811
11812         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11813         if test "$cf_cv_shlib_version" = rel; then
11814                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11815         else
11816                 cf_cv_shared_soname='`basename $@`'
11817         fi
11818
11819                 if test "$GCC" != yes; then
11820                         cf_save_CFLAGS="$CFLAGS"
11821                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11822                         do
11823                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11824                                 cat >"conftest.$ac_ext" <<_ACEOF
11825 #line 11825 "configure"
11826 #include "confdefs.h"
11827 #include <stdio.h>
11828 int
11829 main (void)
11830 {
11831 printf("Hello\\n");
11832   ;
11833   return 0;
11834 }
11835 _ACEOF
11836 rm -f "conftest.$ac_objext"
11837 if { (eval echo "$as_me:11837: \"$ac_compile\"") >&5
11838   (eval $ac_compile) 2>&5
11839   ac_status=$?
11840   echo "$as_me:11840: \$? = $ac_status" >&5
11841   (exit "$ac_status"); } &&
11842          { ac_try='test -s "conftest.$ac_objext"'
11843   { (eval echo "$as_me:11843: \"$ac_try\"") >&5
11844   (eval $ac_try) 2>&5
11845   ac_status=$?
11846   echo "$as_me:11846: \$? = $ac_status" >&5
11847   (exit "$ac_status"); }; }; then
11848   break
11849 else
11850   echo "$as_me: failed program was:" >&5
11851 cat "conftest.$ac_ext" >&5
11852 fi
11853 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11854                         done
11855                         CFLAGS="$cf_save_CFLAGS"
11856                         CC_SHARED_OPTS=$cf_shared_opts
11857                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11858                 else
11859                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11860                 fi
11861                 ;;
11862         (sysv5uw7*|unix_sv*)
11863                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11864                 if test "$GCC" != yes; then
11865                         CC_SHARED_OPTS='-KPIC'
11866                 fi
11867                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11868                 ;;
11869         (*)
11870                 CC_SHARED_OPTS='unknown'
11871                 MK_SHARED_LIB='echo unknown'
11872                 ;;
11873         esac
11874
11875         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11876         case "$cf_cv_shlib_version" in
11877         (rel|abi)
11878                 case "$MK_SHARED_LIB" in
11879                 (*'-o $@')
11880                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11881                         ;;
11882                 (*)
11883                         { echo "$as_me:11883: WARNING: ignored --with-shlib-version" >&5
11884 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11885                         ;;
11886                 esac
11887                 ;;
11888         esac
11889
11890         if test -n "$cf_try_cflags"
11891         then
11892 cat > conftest.$ac_ext <<EOF
11893 #line 11893 "${as_me:-configure}"
11894 #include <stdio.h>
11895 int main(int argc, char *argv[])
11896 {
11897         printf("hello\\n");
11898         return (argv[argc-1] == 0) ;
11899 }
11900 EOF
11901                 cf_save_CFLAGS="$CFLAGS"
11902                 for cf_opt in $cf_try_cflags
11903                 do
11904                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11905                         echo "$as_me:11905: checking if CFLAGS option -$cf_opt works" >&5
11906 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11907                         if { (eval echo "$as_me:11907: \"$ac_compile\"") >&5
11908   (eval $ac_compile) 2>&5
11909   ac_status=$?
11910   echo "$as_me:11910: \$? = $ac_status" >&5
11911   (exit "$ac_status"); }; then
11912                                 echo "$as_me:11912: result: yes" >&5
11913 echo "${ECHO_T}yes" >&6
11914                                 cf_save_CFLAGS="$CFLAGS"
11915                         else
11916                                 echo "$as_me:11916: result: no" >&5
11917 echo "${ECHO_T}no" >&6
11918                         fi
11919                 done
11920                 CFLAGS="$cf_save_CFLAGS"
11921         fi
11922
11923         # RPATH_LIST is a colon-separated list of directories
11924         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11925         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11926
11927         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11928
11929         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11930
11931 echo "${as_me:-configure}:11931: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11932
11933         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11934
11935 echo "${as_me:-configure}:11935: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11936
11937 # The test/sample programs in the original tree link using rpath option.
11938 # Make it optional for packagers.
11939 if test -n "$LOCAL_LDFLAGS"
11940 then
11941         echo "$as_me:11941: checking if you want to link sample programs with rpath option" >&5
11942 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11943
11944 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11945 if test "${enable_rpath_link+set}" = set; then
11946   enableval="$enable_rpath_link"
11947   with_rpath_link=$enableval
11948 else
11949   with_rpath_link=yes
11950 fi;
11951         echo "$as_me:11951: result: $with_rpath_link" >&5
11952 echo "${ECHO_T}$with_rpath_link" >&6
11953         if test "$with_rpath_link" = no
11954         then
11955                 LOCAL_LDFLAGS=
11956                 LOCAL_LDFLAGS2=
11957         fi
11958 fi
11959
11960 ###############################################################################
11961
11962 ###   use option --enable-broken-linker to force on use of broken-linker support
11963
11964 echo "$as_me:11964: checking if you want broken-linker support code" >&5
11965 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11966
11967 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11968 if test "${enable_broken_linker+set}" = set; then
11969   enableval="$enable_broken_linker"
11970   with_broken_linker=$enableval
11971 else
11972   with_broken_linker=no
11973 fi;
11974 echo "$as_me:11974: result: $with_broken_linker" >&5
11975 echo "${ECHO_T}$with_broken_linker" >&6
11976
11977 : "${BROKEN_LINKER:=0}"
11978 if test "x$with_broken_linker" = xyes ; then
11979
11980 cat >>confdefs.h <<\EOF
11981 #define BROKEN_LINKER 1
11982 EOF
11983
11984         BROKEN_LINKER=1
11985 fi
11986
11987 # Check to define _XOPEN_SOURCE "automatically"
11988
11989 echo "$as_me:11989: checking if the POSIX test-macros are already defined" >&5
11990 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11991 if test "${cf_cv_posix_visible+set}" = set; then
11992   echo $ECHO_N "(cached) $ECHO_C" >&6
11993 else
11994
11995 cat >"conftest.$ac_ext" <<_ACEOF
11996 #line 11996 "configure"
11997 #include "confdefs.h"
11998 #include <stdio.h>
11999 int
12000 main (void)
12001 {
12002
12003 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12004         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12005         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12006         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12007 #error conflicting symbols found
12008 #endif
12009
12010   ;
12011   return 0;
12012 }
12013 _ACEOF
12014 rm -f "conftest.$ac_objext"
12015 if { (eval echo "$as_me:12015: \"$ac_compile\"") >&5
12016   (eval $ac_compile) 2>&5
12017   ac_status=$?
12018   echo "$as_me:12018: \$? = $ac_status" >&5
12019   (exit "$ac_status"); } &&
12020          { ac_try='test -s "conftest.$ac_objext"'
12021   { (eval echo "$as_me:12021: \"$ac_try\"") >&5
12022   (eval $ac_try) 2>&5
12023   ac_status=$?
12024   echo "$as_me:12024: \$? = $ac_status" >&5
12025   (exit "$ac_status"); }; }; then
12026   cf_cv_posix_visible=no
12027 else
12028   echo "$as_me: failed program was:" >&5
12029 cat "conftest.$ac_ext" >&5
12030 cf_cv_posix_visible=yes
12031 fi
12032 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12033
12034 fi
12035 echo "$as_me:12035: result: $cf_cv_posix_visible" >&5
12036 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12037
12038 if test "$cf_cv_posix_visible" = no; then
12039
12040 cf_XOPEN_SOURCE=600
12041 cf_POSIX_C_SOURCE=199506L
12042 cf_xopen_source=
12043
12044 case "$host_os" in
12045 (aix[4-7]*)
12046         cf_xopen_source="-D_ALL_SOURCE"
12047         ;;
12048 (msys)
12049         cf_XOPEN_SOURCE=600
12050         ;;
12051 (darwin[0-8].*)
12052         cf_xopen_source="-D_APPLE_C_SOURCE"
12053         ;;
12054 (darwin*)
12055         cf_xopen_source="-D_DARWIN_C_SOURCE"
12056         cf_XOPEN_SOURCE=
12057         ;;
12058 (freebsd*|dragonfly*|midnightbsd*)
12059         # 5.x headers associate
12060         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12061         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12062         cf_POSIX_C_SOURCE=200112L
12063         cf_XOPEN_SOURCE=600
12064         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12065         ;;
12066 (hpux11*)
12067         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12068         ;;
12069 (hpux*)
12070         cf_xopen_source="-D_HPUX_SOURCE"
12071         ;;
12072 (irix[56].*)
12073         cf_xopen_source="-D_SGI_SOURCE"
12074         cf_XOPEN_SOURCE=
12075         ;;
12076 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12077
12078 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12079
12080 echo "$as_me:12080: checking if this is the GNU C library" >&5
12081 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12082 if test "${cf_cv_gnu_library+set}" = set; then
12083   echo $ECHO_N "(cached) $ECHO_C" >&6
12084 else
12085
12086 cat >"conftest.$ac_ext" <<_ACEOF
12087 #line 12087 "configure"
12088 #include "confdefs.h"
12089 #include <sys/types.h>
12090 int
12091 main (void)
12092 {
12093
12094         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12095                 return 0;
12096         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12097                 return 0;
12098         #else
12099         #       error not GNU C library
12100         #endif
12101   ;
12102   return 0;
12103 }
12104 _ACEOF
12105 rm -f "conftest.$ac_objext"
12106 if { (eval echo "$as_me:12106: \"$ac_compile\"") >&5
12107   (eval $ac_compile) 2>&5
12108   ac_status=$?
12109   echo "$as_me:12109: \$? = $ac_status" >&5
12110   (exit "$ac_status"); } &&
12111          { ac_try='test -s "conftest.$ac_objext"'
12112   { (eval echo "$as_me:12112: \"$ac_try\"") >&5
12113   (eval $ac_try) 2>&5
12114   ac_status=$?
12115   echo "$as_me:12115: \$? = $ac_status" >&5
12116   (exit "$ac_status"); }; }; then
12117   cf_cv_gnu_library=yes
12118 else
12119   echo "$as_me: failed program was:" >&5
12120 cat "conftest.$ac_ext" >&5
12121 cf_cv_gnu_library=no
12122 fi
12123 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12124
12125 fi
12126 echo "$as_me:12126: result: $cf_cv_gnu_library" >&5
12127 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12128
12129 if test x$cf_cv_gnu_library = xyes; then
12130
12131         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12132         # was changed to help a little.  newlib incorporated the change about 4
12133         # years later.
12134         echo "$as_me:12134: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12135 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12136 if test "${cf_cv_gnu_library_219+set}" = set; then
12137   echo $ECHO_N "(cached) $ECHO_C" >&6
12138 else
12139
12140                 cf_save="$CPPFLAGS"
12141
12142         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12143         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12144
12145                 cat >"conftest.$ac_ext" <<_ACEOF
12146 #line 12146 "configure"
12147 #include "confdefs.h"
12148 #include <sys/types.h>
12149 int
12150 main (void)
12151 {
12152
12153                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12154                                 return 0;
12155                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12156                                 return 0;
12157                         #else
12158                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12159                         #endif
12160   ;
12161   return 0;
12162 }
12163 _ACEOF
12164 rm -f "conftest.$ac_objext"
12165 if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5
12166   (eval $ac_compile) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit "$ac_status"); } &&
12170          { ac_try='test -s "conftest.$ac_objext"'
12171   { (eval echo "$as_me:12171: \"$ac_try\"") >&5
12172   (eval $ac_try) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit "$ac_status"); }; }; then
12176   cf_cv_gnu_library_219=yes
12177 else
12178   echo "$as_me: failed program was:" >&5
12179 cat "conftest.$ac_ext" >&5
12180 cf_cv_gnu_library_219=no
12181 fi
12182 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12183                 CPPFLAGS="$cf_save"
12184
12185 fi
12186 echo "$as_me:12186: result: $cf_cv_gnu_library_219" >&5
12187 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12188
12189         if test "x$cf_cv_gnu_library_219" = xyes; then
12190                 cf_save="$CPPFLAGS"
12191                 echo "$as_me:12191: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12192 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12193 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12194   echo $ECHO_N "(cached) $ECHO_C" >&6
12195 else
12196
12197 cf_fix_cppflags=no
12198 cf_new_cflags=
12199 cf_new_cppflags=
12200 cf_new_extra_cppflags=
12201
12202 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12203 do
12204 case "$cf_fix_cppflags" in
12205 (no)
12206         case "$cf_add_cflags" in
12207         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12208                 case "$cf_add_cflags" in
12209                 (-D*)
12210                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12211
12212                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12213                                 && test -z "${cf_tst_cflags}" \
12214                                 && cf_fix_cppflags=yes
12215
12216                         if test "$cf_fix_cppflags" = yes ; then
12217
12218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12220
12221                                 continue
12222                         elif test "${cf_tst_cflags}" = "\"'" ; then
12223
12224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12226
12227                                 continue
12228                         fi
12229                         ;;
12230                 esac
12231                 case "$CPPFLAGS" in
12232                 (*$cf_add_cflags)
12233                         ;;
12234                 (*)
12235                         case "$cf_add_cflags" in
12236                         (-D*)
12237                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12238
12239 CPPFLAGS=`echo "$CPPFLAGS" | \
12240         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12241                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12242
12243                                 ;;
12244                         esac
12245
12246         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12247         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12248
12249                         ;;
12250                 esac
12251                 ;;
12252         (*)
12253
12254         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12255         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12256
12257                 ;;
12258         esac
12259         ;;
12260 (yes)
12261
12262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12264
12265         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12266
12267         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12268                 && test -z "${cf_tst_cflags}" \
12269                 && cf_fix_cppflags=no
12270         ;;
12271 esac
12272 done
12273
12274 if test -n "$cf_new_cflags" ; then
12275
12276         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12277         CFLAGS="${CFLAGS}$cf_new_cflags"
12278
12279 fi
12280
12281 if test -n "$cf_new_cppflags" ; then
12282
12283         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12284         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12285
12286 fi
12287
12288 if test -n "$cf_new_extra_cppflags" ; then
12289
12290         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12291         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12292
12293 fi
12294
12295                         cat >"conftest.$ac_ext" <<_ACEOF
12296 #line 12296 "configure"
12297 #include "confdefs.h"
12298
12299                                 #include <limits.h>
12300                                 #include <sys/types.h>
12301
12302 int
12303 main (void)
12304 {
12305
12306                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12307                                         return 0;
12308                                 #else
12309                                 #       error GNU C library is too old
12310                                 #endif
12311   ;
12312   return 0;
12313 }
12314 _ACEOF
12315 rm -f "conftest.$ac_objext"
12316 if { (eval echo "$as_me:12316: \"$ac_compile\"") >&5
12317   (eval $ac_compile) 2>&5
12318   ac_status=$?
12319   echo "$as_me:12319: \$? = $ac_status" >&5
12320   (exit "$ac_status"); } &&
12321          { ac_try='test -s "conftest.$ac_objext"'
12322   { (eval echo "$as_me:12322: \"$ac_try\"") >&5
12323   (eval $ac_try) 2>&5
12324   ac_status=$?
12325   echo "$as_me:12325: \$? = $ac_status" >&5
12326   (exit "$ac_status"); }; }; then
12327   cf_cv_gnu_dftsrc_219=yes
12328 else
12329   echo "$as_me: failed program was:" >&5
12330 cat "conftest.$ac_ext" >&5
12331 cf_cv_gnu_dftsrc_219=no
12332 fi
12333 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12334
12335 fi
12336 echo "$as_me:12336: result: $cf_cv_gnu_dftsrc_219" >&5
12337 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12338                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12339         else
12340                 cf_cv_gnu_dftsrc_219=maybe
12341         fi
12342
12343         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12344
12345                 echo "$as_me:12345: checking if we must define _GNU_SOURCE" >&5
12346 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12347 if test "${cf_cv_gnu_source+set}" = set; then
12348   echo $ECHO_N "(cached) $ECHO_C" >&6
12349 else
12350
12351                 cat >"conftest.$ac_ext" <<_ACEOF
12352 #line 12352 "configure"
12353 #include "confdefs.h"
12354 #include <sys/types.h>
12355 int
12356 main (void)
12357 {
12358
12359                         #ifndef _XOPEN_SOURCE
12360                         #error  expected _XOPEN_SOURCE to be defined
12361                         #endif
12362   ;
12363   return 0;
12364 }
12365 _ACEOF
12366 rm -f "conftest.$ac_objext"
12367 if { (eval echo "$as_me:12367: \"$ac_compile\"") >&5
12368   (eval $ac_compile) 2>&5
12369   ac_status=$?
12370   echo "$as_me:12370: \$? = $ac_status" >&5
12371   (exit "$ac_status"); } &&
12372          { ac_try='test -s "conftest.$ac_objext"'
12373   { (eval echo "$as_me:12373: \"$ac_try\"") >&5
12374   (eval $ac_try) 2>&5
12375   ac_status=$?
12376   echo "$as_me:12376: \$? = $ac_status" >&5
12377   (exit "$ac_status"); }; }; then
12378   cf_cv_gnu_source=no
12379 else
12380   echo "$as_me: failed program was:" >&5
12381 cat "conftest.$ac_ext" >&5
12382 cf_save="$CPPFLAGS"
12383
12384 cf_fix_cppflags=no
12385 cf_new_cflags=
12386 cf_new_cppflags=
12387 cf_new_extra_cppflags=
12388
12389 for cf_add_cflags in -D_GNU_SOURCE
12390 do
12391 case "$cf_fix_cppflags" in
12392 (no)
12393         case "$cf_add_cflags" in
12394         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12395                 case "$cf_add_cflags" in
12396                 (-D*)
12397                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12398
12399                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12400                                 && test -z "${cf_tst_cflags}" \
12401                                 && cf_fix_cppflags=yes
12402
12403                         if test "$cf_fix_cppflags" = yes ; then
12404
12405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12407
12408                                 continue
12409                         elif test "${cf_tst_cflags}" = "\"'" ; then
12410
12411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12413
12414                                 continue
12415                         fi
12416                         ;;
12417                 esac
12418                 case "$CPPFLAGS" in
12419                 (*$cf_add_cflags)
12420                         ;;
12421                 (*)
12422                         case "$cf_add_cflags" in
12423                         (-D*)
12424                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12425
12426 CPPFLAGS=`echo "$CPPFLAGS" | \
12427         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12428                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12429
12430                                 ;;
12431                         esac
12432
12433         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12434         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12435
12436                         ;;
12437                 esac
12438                 ;;
12439         (*)
12440
12441         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12442         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12443
12444                 ;;
12445         esac
12446         ;;
12447 (yes)
12448
12449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12451
12452         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12453
12454         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12455                 && test -z "${cf_tst_cflags}" \
12456                 && cf_fix_cppflags=no
12457         ;;
12458 esac
12459 done
12460
12461 if test -n "$cf_new_cflags" ; then
12462
12463         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12464         CFLAGS="${CFLAGS}$cf_new_cflags"
12465
12466 fi
12467
12468 if test -n "$cf_new_cppflags" ; then
12469
12470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12471         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12472
12473 fi
12474
12475 if test -n "$cf_new_extra_cppflags" ; then
12476
12477         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12478         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12479
12480 fi
12481
12482                          cat >"conftest.$ac_ext" <<_ACEOF
12483 #line 12483 "configure"
12484 #include "confdefs.h"
12485 #include <sys/types.h>
12486 int
12487 main (void)
12488 {
12489
12490                                 #ifdef _XOPEN_SOURCE
12491                                 #error  expected _XOPEN_SOURCE to be undefined
12492                                 #endif
12493   ;
12494   return 0;
12495 }
12496 _ACEOF
12497 rm -f "conftest.$ac_objext"
12498 if { (eval echo "$as_me:12498: \"$ac_compile\"") >&5
12499   (eval $ac_compile) 2>&5
12500   ac_status=$?
12501   echo "$as_me:12501: \$? = $ac_status" >&5
12502   (exit "$ac_status"); } &&
12503          { ac_try='test -s "conftest.$ac_objext"'
12504   { (eval echo "$as_me:12504: \"$ac_try\"") >&5
12505   (eval $ac_try) 2>&5
12506   ac_status=$?
12507   echo "$as_me:12507: \$? = $ac_status" >&5
12508   (exit "$ac_status"); }; }; then
12509   cf_cv_gnu_source=no
12510 else
12511   echo "$as_me: failed program was:" >&5
12512 cat "conftest.$ac_ext" >&5
12513 cf_cv_gnu_source=yes
12514 fi
12515 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12516                         CPPFLAGS="$cf_save"
12517
12518 fi
12519 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12520
12521 fi
12522 echo "$as_me:12522: result: $cf_cv_gnu_source" >&5
12523 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12524
12525                 if test "$cf_cv_gnu_source" = yes
12526                 then
12527                 echo "$as_me:12527: checking if we should also define _DEFAULT_SOURCE" >&5
12528 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12529 if test "${cf_cv_default_source+set}" = set; then
12530   echo $ECHO_N "(cached) $ECHO_C" >&6
12531 else
12532
12533         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12534         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12535
12536                         cat >"conftest.$ac_ext" <<_ACEOF
12537 #line 12537 "configure"
12538 #include "confdefs.h"
12539 #include <sys/types.h>
12540 int
12541 main (void)
12542 {
12543
12544                                 #ifdef _DEFAULT_SOURCE
12545                                 #error  expected _DEFAULT_SOURCE to be undefined
12546                                 #endif
12547   ;
12548   return 0;
12549 }
12550 _ACEOF
12551 rm -f "conftest.$ac_objext"
12552 if { (eval echo "$as_me:12552: \"$ac_compile\"") >&5
12553   (eval $ac_compile) 2>&5
12554   ac_status=$?
12555   echo "$as_me:12555: \$? = $ac_status" >&5
12556   (exit "$ac_status"); } &&
12557          { ac_try='test -s "conftest.$ac_objext"'
12558   { (eval echo "$as_me:12558: \"$ac_try\"") >&5
12559   (eval $ac_try) 2>&5
12560   ac_status=$?
12561   echo "$as_me:12561: \$? = $ac_status" >&5
12562   (exit "$ac_status"); }; }; then
12563   cf_cv_default_source=no
12564 else
12565   echo "$as_me: failed program was:" >&5
12566 cat "conftest.$ac_ext" >&5
12567 cf_cv_default_source=yes
12568 fi
12569 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12570
12571 fi
12572 echo "$as_me:12572: result: $cf_cv_default_source" >&5
12573 echo "${ECHO_T}$cf_cv_default_source" >&6
12574                         if test "$cf_cv_default_source" = yes
12575                         then
12576
12577         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12578         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12579
12580                         fi
12581                 fi
12582         fi
12583
12584 fi
12585
12586         ;;
12587 (minix*)
12588         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12589         ;;
12590 (mirbsd*)
12591         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12592         cf_XOPEN_SOURCE=
12593
12594 if test "$cf_cv_posix_visible" = no; then
12595
12596 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12597
12598 cf_save_CFLAGS="$CFLAGS"
12599 cf_save_CPPFLAGS="$CPPFLAGS"
12600
12601 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12602         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12603                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12604
12605 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12606         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12607                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12608
12609 echo "$as_me:12609: checking if we should define _POSIX_C_SOURCE" >&5
12610 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12611 if test "${cf_cv_posix_c_source+set}" = set; then
12612   echo $ECHO_N "(cached) $ECHO_C" >&6
12613 else
12614
12615 echo "${as_me:-configure}:12615: testing if the symbol is already defined go no further ..." 1>&5
12616
12617         cat >"conftest.$ac_ext" <<_ACEOF
12618 #line 12618 "configure"
12619 #include "confdefs.h"
12620 #include <sys/types.h>
12621 int
12622 main (void)
12623 {
12624
12625 #ifndef _POSIX_C_SOURCE
12626 make an error
12627 #endif
12628   ;
12629   return 0;
12630 }
12631 _ACEOF
12632 rm -f "conftest.$ac_objext"
12633 if { (eval echo "$as_me:12633: \"$ac_compile\"") >&5
12634   (eval $ac_compile) 2>&5
12635   ac_status=$?
12636   echo "$as_me:12636: \$? = $ac_status" >&5
12637   (exit "$ac_status"); } &&
12638          { ac_try='test -s "conftest.$ac_objext"'
12639   { (eval echo "$as_me:12639: \"$ac_try\"") >&5
12640   (eval $ac_try) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit "$ac_status"); }; }; then
12644   cf_cv_posix_c_source=no
12645 else
12646   echo "$as_me: failed program was:" >&5
12647 cat "conftest.$ac_ext" >&5
12648 cf_want_posix_source=no
12649          case .$cf_POSIX_C_SOURCE in
12650          (.[12]??*)
12651                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12652                 ;;
12653          (.2)
12654                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12655                 cf_want_posix_source=yes
12656                 ;;
12657          (.*)
12658                 cf_want_posix_source=yes
12659                 ;;
12660          esac
12661          if test "$cf_want_posix_source" = yes ; then
12662                 cat >"conftest.$ac_ext" <<_ACEOF
12663 #line 12663 "configure"
12664 #include "confdefs.h"
12665 #include <sys/types.h>
12666 int
12667 main (void)
12668 {
12669
12670 #ifdef _POSIX_SOURCE
12671 make an error
12672 #endif
12673   ;
12674   return 0;
12675 }
12676 _ACEOF
12677 rm -f "conftest.$ac_objext"
12678 if { (eval echo "$as_me:12678: \"$ac_compile\"") >&5
12679   (eval $ac_compile) 2>&5
12680   ac_status=$?
12681   echo "$as_me:12681: \$? = $ac_status" >&5
12682   (exit "$ac_status"); } &&
12683          { ac_try='test -s "conftest.$ac_objext"'
12684   { (eval echo "$as_me:12684: \"$ac_try\"") >&5
12685   (eval $ac_try) 2>&5
12686   ac_status=$?
12687   echo "$as_me:12687: \$? = $ac_status" >&5
12688   (exit "$ac_status"); }; }; then
12689   :
12690 else
12691   echo "$as_me: failed program was:" >&5
12692 cat "conftest.$ac_ext" >&5
12693 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12694 fi
12695 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12696          fi
12697
12698 echo "${as_me:-configure}:12698: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12699
12700          CFLAGS="$cf_trim_CFLAGS"
12701          CPPFLAGS="$cf_trim_CPPFLAGS"
12702
12703         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12704         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12705
12706 echo "${as_me:-configure}:12706: testing if the second compile does not leave our definition intact error ..." 1>&5
12707
12708          cat >"conftest.$ac_ext" <<_ACEOF
12709 #line 12709 "configure"
12710 #include "confdefs.h"
12711 #include <sys/types.h>
12712 int
12713 main (void)
12714 {
12715
12716 #ifndef _POSIX_C_SOURCE
12717 make an error
12718 #endif
12719   ;
12720   return 0;
12721 }
12722 _ACEOF
12723 rm -f "conftest.$ac_objext"
12724 if { (eval echo "$as_me:12724: \"$ac_compile\"") >&5
12725   (eval $ac_compile) 2>&5
12726   ac_status=$?
12727   echo "$as_me:12727: \$? = $ac_status" >&5
12728   (exit "$ac_status"); } &&
12729          { ac_try='test -s "conftest.$ac_objext"'
12730   { (eval echo "$as_me:12730: \"$ac_try\"") >&5
12731   (eval $ac_try) 2>&5
12732   ac_status=$?
12733   echo "$as_me:12733: \$? = $ac_status" >&5
12734   (exit "$ac_status"); }; }; then
12735   :
12736 else
12737   echo "$as_me: failed program was:" >&5
12738 cat "conftest.$ac_ext" >&5
12739 cf_cv_posix_c_source=no
12740 fi
12741 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12742          CFLAGS="$cf_save_CFLAGS"
12743          CPPFLAGS="$cf_save_CPPFLAGS"
12744
12745 fi
12746 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12747
12748 fi
12749 echo "$as_me:12749: result: $cf_cv_posix_c_source" >&5
12750 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12751
12752 if test "$cf_cv_posix_c_source" != no ; then
12753         CFLAGS="$cf_trim_CFLAGS"
12754         CPPFLAGS="$cf_trim_CPPFLAGS"
12755
12756 cf_fix_cppflags=no
12757 cf_new_cflags=
12758 cf_new_cppflags=
12759 cf_new_extra_cppflags=
12760
12761 for cf_add_cflags in $cf_cv_posix_c_source
12762 do
12763 case "$cf_fix_cppflags" in
12764 (no)
12765         case "$cf_add_cflags" in
12766         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12767                 case "$cf_add_cflags" in
12768                 (-D*)
12769                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12770
12771                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12772                                 && test -z "${cf_tst_cflags}" \
12773                                 && cf_fix_cppflags=yes
12774
12775                         if test "$cf_fix_cppflags" = yes ; then
12776
12777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12779
12780                                 continue
12781                         elif test "${cf_tst_cflags}" = "\"'" ; then
12782
12783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12785
12786                                 continue
12787                         fi
12788                         ;;
12789                 esac
12790                 case "$CPPFLAGS" in
12791                 (*$cf_add_cflags)
12792                         ;;
12793                 (*)
12794                         case "$cf_add_cflags" in
12795                         (-D*)
12796                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12797
12798 CPPFLAGS=`echo "$CPPFLAGS" | \
12799         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12800                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12801
12802                                 ;;
12803                         esac
12804
12805         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12806         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12807
12808                         ;;
12809                 esac
12810                 ;;
12811         (*)
12812
12813         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12814         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12815
12816                 ;;
12817         esac
12818         ;;
12819 (yes)
12820
12821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12823
12824         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12825
12826         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12827                 && test -z "${cf_tst_cflags}" \
12828                 && cf_fix_cppflags=no
12829         ;;
12830 esac
12831 done
12832
12833 if test -n "$cf_new_cflags" ; then
12834
12835         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12836         CFLAGS="${CFLAGS}$cf_new_cflags"
12837
12838 fi
12839
12840 if test -n "$cf_new_cppflags" ; then
12841
12842         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12843         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12844
12845 fi
12846
12847 if test -n "$cf_new_extra_cppflags" ; then
12848
12849         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12850         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12851
12852 fi
12853
12854 fi
12855
12856 fi # cf_cv_posix_visible
12857
12858         ;;
12859 (netbsd*)
12860         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12861         ;;
12862 (openbsd[4-9]*)
12863         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12864         cf_xopen_source="-D_BSD_SOURCE"
12865         cf_XOPEN_SOURCE=600
12866         ;;
12867 (openbsd*)
12868         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12869         ;;
12870 (osf[45]*)
12871         cf_xopen_source="-D_OSF_SOURCE"
12872         ;;
12873 (nto-qnx*)
12874         cf_xopen_source="-D_QNX_SOURCE"
12875         ;;
12876 (sco*)
12877         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12878         ;;
12879 (solaris2.*)
12880         cf_xopen_source="-D__EXTENSIONS__"
12881         cf_cv_xopen_source=broken
12882         ;;
12883 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12884         cf_XOPEN_SOURCE=
12885         cf_POSIX_C_SOURCE=
12886         ;;
12887 (*)
12888
12889 echo "$as_me:12889: checking if we should define _XOPEN_SOURCE" >&5
12890 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12891 if test "${cf_cv_xopen_source+set}" = set; then
12892   echo $ECHO_N "(cached) $ECHO_C" >&6
12893 else
12894
12895         cat >"conftest.$ac_ext" <<_ACEOF
12896 #line 12896 "configure"
12897 #include "confdefs.h"
12898
12899 #include <stdlib.h>
12900 #include <string.h>
12901 #include <sys/types.h>
12902
12903 int
12904 main (void)
12905 {
12906
12907 #ifndef _XOPEN_SOURCE
12908 make an error
12909 #endif
12910   ;
12911   return 0;
12912 }
12913 _ACEOF
12914 rm -f "conftest.$ac_objext"
12915 if { (eval echo "$as_me:12915: \"$ac_compile\"") >&5
12916   (eval $ac_compile) 2>&5
12917   ac_status=$?
12918   echo "$as_me:12918: \$? = $ac_status" >&5
12919   (exit "$ac_status"); } &&
12920          { ac_try='test -s "conftest.$ac_objext"'
12921   { (eval echo "$as_me:12921: \"$ac_try\"") >&5
12922   (eval $ac_try) 2>&5
12923   ac_status=$?
12924   echo "$as_me:12924: \$? = $ac_status" >&5
12925   (exit "$ac_status"); }; }; then
12926   cf_cv_xopen_source=no
12927 else
12928   echo "$as_me: failed program was:" >&5
12929 cat "conftest.$ac_ext" >&5
12930 cf_save="$CPPFLAGS"
12931
12932         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12933         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12934
12935          cat >"conftest.$ac_ext" <<_ACEOF
12936 #line 12936 "configure"
12937 #include "confdefs.h"
12938
12939 #include <stdlib.h>
12940 #include <string.h>
12941 #include <sys/types.h>
12942
12943 int
12944 main (void)
12945 {
12946
12947 #ifdef _XOPEN_SOURCE
12948 make an error
12949 #endif
12950   ;
12951   return 0;
12952 }
12953 _ACEOF
12954 rm -f "conftest.$ac_objext"
12955 if { (eval echo "$as_me:12955: \"$ac_compile\"") >&5
12956   (eval $ac_compile) 2>&5
12957   ac_status=$?
12958   echo "$as_me:12958: \$? = $ac_status" >&5
12959   (exit "$ac_status"); } &&
12960          { ac_try='test -s "conftest.$ac_objext"'
12961   { (eval echo "$as_me:12961: \"$ac_try\"") >&5
12962   (eval $ac_try) 2>&5
12963   ac_status=$?
12964   echo "$as_me:12964: \$? = $ac_status" >&5
12965   (exit "$ac_status"); }; }; then
12966   cf_cv_xopen_source=no
12967 else
12968   echo "$as_me: failed program was:" >&5
12969 cat "conftest.$ac_ext" >&5
12970 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12971 fi
12972 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12973         CPPFLAGS="$cf_save"
12974
12975 fi
12976 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12977
12978 fi
12979 echo "$as_me:12979: result: $cf_cv_xopen_source" >&5
12980 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12981
12982 if test "$cf_cv_xopen_source" != no ; then
12983
12984 CFLAGS=`echo "$CFLAGS" | \
12985         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12986                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12987
12988 CPPFLAGS=`echo "$CPPFLAGS" | \
12989         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12990                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12991
12992         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12993
12994 cf_fix_cppflags=no
12995 cf_new_cflags=
12996 cf_new_cppflags=
12997 cf_new_extra_cppflags=
12998
12999 for cf_add_cflags in $cf_temp_xopen_source
13000 do
13001 case "$cf_fix_cppflags" in
13002 (no)
13003         case "$cf_add_cflags" in
13004         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13005                 case "$cf_add_cflags" in
13006                 (-D*)
13007                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13008
13009                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13010                                 && test -z "${cf_tst_cflags}" \
13011                                 && cf_fix_cppflags=yes
13012
13013                         if test "$cf_fix_cppflags" = yes ; then
13014
13015         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13016         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13017
13018                                 continue
13019                         elif test "${cf_tst_cflags}" = "\"'" ; then
13020
13021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13023
13024                                 continue
13025                         fi
13026                         ;;
13027                 esac
13028                 case "$CPPFLAGS" in
13029                 (*$cf_add_cflags)
13030                         ;;
13031                 (*)
13032                         case "$cf_add_cflags" in
13033                         (-D*)
13034                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13035
13036 CPPFLAGS=`echo "$CPPFLAGS" | \
13037         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13038                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13039
13040                                 ;;
13041                         esac
13042
13043         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13044         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13045
13046                         ;;
13047                 esac
13048                 ;;
13049         (*)
13050
13051         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13052         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13053
13054                 ;;
13055         esac
13056         ;;
13057 (yes)
13058
13059         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13060         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13061
13062         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13063
13064         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13065                 && test -z "${cf_tst_cflags}" \
13066                 && cf_fix_cppflags=no
13067         ;;
13068 esac
13069 done
13070
13071 if test -n "$cf_new_cflags" ; then
13072
13073         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13074         CFLAGS="${CFLAGS}$cf_new_cflags"
13075
13076 fi
13077
13078 if test -n "$cf_new_cppflags" ; then
13079
13080         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13081         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13082
13083 fi
13084
13085 if test -n "$cf_new_extra_cppflags" ; then
13086
13087         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13088         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13089
13090 fi
13091
13092 fi
13093
13094 if test "$cf_cv_posix_visible" = no; then
13095
13096 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13097
13098 cf_save_CFLAGS="$CFLAGS"
13099 cf_save_CPPFLAGS="$CPPFLAGS"
13100
13101 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13102         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13103                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13104
13105 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13106         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13107                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13108
13109 echo "$as_me:13109: checking if we should define _POSIX_C_SOURCE" >&5
13110 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13111 if test "${cf_cv_posix_c_source+set}" = set; then
13112   echo $ECHO_N "(cached) $ECHO_C" >&6
13113 else
13114
13115 echo "${as_me:-configure}:13115: testing if the symbol is already defined go no further ..." 1>&5
13116
13117         cat >"conftest.$ac_ext" <<_ACEOF
13118 #line 13118 "configure"
13119 #include "confdefs.h"
13120 #include <sys/types.h>
13121 int
13122 main (void)
13123 {
13124
13125 #ifndef _POSIX_C_SOURCE
13126 make an error
13127 #endif
13128   ;
13129   return 0;
13130 }
13131 _ACEOF
13132 rm -f "conftest.$ac_objext"
13133 if { (eval echo "$as_me:13133: \"$ac_compile\"") >&5
13134   (eval $ac_compile) 2>&5
13135   ac_status=$?
13136   echo "$as_me:13136: \$? = $ac_status" >&5
13137   (exit "$ac_status"); } &&
13138          { ac_try='test -s "conftest.$ac_objext"'
13139   { (eval echo "$as_me:13139: \"$ac_try\"") >&5
13140   (eval $ac_try) 2>&5
13141   ac_status=$?
13142   echo "$as_me:13142: \$? = $ac_status" >&5
13143   (exit "$ac_status"); }; }; then
13144   cf_cv_posix_c_source=no
13145 else
13146   echo "$as_me: failed program was:" >&5
13147 cat "conftest.$ac_ext" >&5
13148 cf_want_posix_source=no
13149          case .$cf_POSIX_C_SOURCE in
13150          (.[12]??*)
13151                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13152                 ;;
13153          (.2)
13154                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13155                 cf_want_posix_source=yes
13156                 ;;
13157          (.*)
13158                 cf_want_posix_source=yes
13159                 ;;
13160          esac
13161          if test "$cf_want_posix_source" = yes ; then
13162                 cat >"conftest.$ac_ext" <<_ACEOF
13163 #line 13163 "configure"
13164 #include "confdefs.h"
13165 #include <sys/types.h>
13166 int
13167 main (void)
13168 {
13169
13170 #ifdef _POSIX_SOURCE
13171 make an error
13172 #endif
13173   ;
13174   return 0;
13175 }
13176 _ACEOF
13177 rm -f "conftest.$ac_objext"
13178 if { (eval echo "$as_me:13178: \"$ac_compile\"") >&5
13179   (eval $ac_compile) 2>&5
13180   ac_status=$?
13181   echo "$as_me:13181: \$? = $ac_status" >&5
13182   (exit "$ac_status"); } &&
13183          { ac_try='test -s "conftest.$ac_objext"'
13184   { (eval echo "$as_me:13184: \"$ac_try\"") >&5
13185   (eval $ac_try) 2>&5
13186   ac_status=$?
13187   echo "$as_me:13187: \$? = $ac_status" >&5
13188   (exit "$ac_status"); }; }; then
13189   :
13190 else
13191   echo "$as_me: failed program was:" >&5
13192 cat "conftest.$ac_ext" >&5
13193 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13194 fi
13195 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13196          fi
13197
13198 echo "${as_me:-configure}:13198: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13199
13200          CFLAGS="$cf_trim_CFLAGS"
13201          CPPFLAGS="$cf_trim_CPPFLAGS"
13202
13203         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13204         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13205
13206 echo "${as_me:-configure}:13206: testing if the second compile does not leave our definition intact error ..." 1>&5
13207
13208          cat >"conftest.$ac_ext" <<_ACEOF
13209 #line 13209 "configure"
13210 #include "confdefs.h"
13211 #include <sys/types.h>
13212 int
13213 main (void)
13214 {
13215
13216 #ifndef _POSIX_C_SOURCE
13217 make an error
13218 #endif
13219   ;
13220   return 0;
13221 }
13222 _ACEOF
13223 rm -f "conftest.$ac_objext"
13224 if { (eval echo "$as_me:13224: \"$ac_compile\"") >&5
13225   (eval $ac_compile) 2>&5
13226   ac_status=$?
13227   echo "$as_me:13227: \$? = $ac_status" >&5
13228   (exit "$ac_status"); } &&
13229          { ac_try='test -s "conftest.$ac_objext"'
13230   { (eval echo "$as_me:13230: \"$ac_try\"") >&5
13231   (eval $ac_try) 2>&5
13232   ac_status=$?
13233   echo "$as_me:13233: \$? = $ac_status" >&5
13234   (exit "$ac_status"); }; }; then
13235   :
13236 else
13237   echo "$as_me: failed program was:" >&5
13238 cat "conftest.$ac_ext" >&5
13239 cf_cv_posix_c_source=no
13240 fi
13241 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13242          CFLAGS="$cf_save_CFLAGS"
13243          CPPFLAGS="$cf_save_CPPFLAGS"
13244
13245 fi
13246 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13247
13248 fi
13249 echo "$as_me:13249: result: $cf_cv_posix_c_source" >&5
13250 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13251
13252 if test "$cf_cv_posix_c_source" != no ; then
13253         CFLAGS="$cf_trim_CFLAGS"
13254         CPPFLAGS="$cf_trim_CPPFLAGS"
13255
13256 cf_fix_cppflags=no
13257 cf_new_cflags=
13258 cf_new_cppflags=
13259 cf_new_extra_cppflags=
13260
13261 for cf_add_cflags in $cf_cv_posix_c_source
13262 do
13263 case "$cf_fix_cppflags" in
13264 (no)
13265         case "$cf_add_cflags" in
13266         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13267                 case "$cf_add_cflags" in
13268                 (-D*)
13269                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13270
13271                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13272                                 && test -z "${cf_tst_cflags}" \
13273                                 && cf_fix_cppflags=yes
13274
13275                         if test "$cf_fix_cppflags" = yes ; then
13276
13277         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13278         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13279
13280                                 continue
13281                         elif test "${cf_tst_cflags}" = "\"'" ; then
13282
13283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13285
13286                                 continue
13287                         fi
13288                         ;;
13289                 esac
13290                 case "$CPPFLAGS" in
13291                 (*$cf_add_cflags)
13292                         ;;
13293                 (*)
13294                         case "$cf_add_cflags" in
13295                         (-D*)
13296                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13297
13298 CPPFLAGS=`echo "$CPPFLAGS" | \
13299         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13300                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13301
13302                                 ;;
13303                         esac
13304
13305         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13306         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13307
13308                         ;;
13309                 esac
13310                 ;;
13311         (*)
13312
13313         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13314         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13315
13316                 ;;
13317         esac
13318         ;;
13319 (yes)
13320
13321         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13322         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13323
13324         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13325
13326         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13327                 && test -z "${cf_tst_cflags}" \
13328                 && cf_fix_cppflags=no
13329         ;;
13330 esac
13331 done
13332
13333 if test -n "$cf_new_cflags" ; then
13334
13335         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13336         CFLAGS="${CFLAGS}$cf_new_cflags"
13337
13338 fi
13339
13340 if test -n "$cf_new_cppflags" ; then
13341
13342         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13343         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13344
13345 fi
13346
13347 if test -n "$cf_new_extra_cppflags" ; then
13348
13349         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13350         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13351
13352 fi
13353
13354 fi
13355
13356 fi # cf_cv_posix_visible
13357
13358         ;;
13359 esac
13360
13361 if test -n "$cf_xopen_source" ; then
13362
13363 cf_fix_cppflags=no
13364 cf_new_cflags=
13365 cf_new_cppflags=
13366 cf_new_extra_cppflags=
13367
13368 for cf_add_cflags in $cf_xopen_source
13369 do
13370 case "$cf_fix_cppflags" in
13371 (no)
13372         case "$cf_add_cflags" in
13373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13374                 case "$cf_add_cflags" in
13375                 (-D*)
13376                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13377
13378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13379                                 && test -z "${cf_tst_cflags}" \
13380                                 && cf_fix_cppflags=yes
13381
13382                         if test "$cf_fix_cppflags" = yes ; then
13383
13384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13386
13387                                 continue
13388                         elif test "${cf_tst_cflags}" = "\"'" ; then
13389
13390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13392
13393                                 continue
13394                         fi
13395                         ;;
13396                 esac
13397                 case "$CPPFLAGS" in
13398                 (*$cf_add_cflags)
13399                         ;;
13400                 (*)
13401                         case "$cf_add_cflags" in
13402                         (-D*)
13403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13404
13405 CPPFLAGS=`echo "$CPPFLAGS" | \
13406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13408
13409                                 ;;
13410                         esac
13411
13412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13414
13415                         ;;
13416                 esac
13417                 ;;
13418         (*)
13419
13420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13422
13423                 ;;
13424         esac
13425         ;;
13426 (yes)
13427
13428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13430
13431         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13432
13433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13434                 && test -z "${cf_tst_cflags}" \
13435                 && cf_fix_cppflags=no
13436         ;;
13437 esac
13438 done
13439
13440 if test -n "$cf_new_cflags" ; then
13441         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13442
13443 echo "${as_me:-configure}:13443: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13444
13445         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13446         CFLAGS="${CFLAGS}$cf_new_cflags"
13447
13448 fi
13449
13450 if test -n "$cf_new_cppflags" ; then
13451         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13452
13453 echo "${as_me:-configure}:13453: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13454
13455         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13456         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13457
13458 fi
13459
13460 if test -n "$cf_new_extra_cppflags" ; then
13461         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13462
13463 echo "${as_me:-configure}:13463: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13464
13465         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13466         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13467
13468 fi
13469
13470 fi
13471
13472 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13473         echo "$as_me:13473: checking if _XOPEN_SOURCE really is set" >&5
13474 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13475         cat >"conftest.$ac_ext" <<_ACEOF
13476 #line 13476 "configure"
13477 #include "confdefs.h"
13478 #include <stdlib.h>
13479 int
13480 main (void)
13481 {
13482
13483 #ifndef _XOPEN_SOURCE
13484 make an error
13485 #endif
13486   ;
13487   return 0;
13488 }
13489 _ACEOF
13490 rm -f "conftest.$ac_objext"
13491 if { (eval echo "$as_me:13491: \"$ac_compile\"") >&5
13492   (eval $ac_compile) 2>&5
13493   ac_status=$?
13494   echo "$as_me:13494: \$? = $ac_status" >&5
13495   (exit "$ac_status"); } &&
13496          { ac_try='test -s "conftest.$ac_objext"'
13497   { (eval echo "$as_me:13497: \"$ac_try\"") >&5
13498   (eval $ac_try) 2>&5
13499   ac_status=$?
13500   echo "$as_me:13500: \$? = $ac_status" >&5
13501   (exit "$ac_status"); }; }; then
13502   cf_XOPEN_SOURCE_set=yes
13503 else
13504   echo "$as_me: failed program was:" >&5
13505 cat "conftest.$ac_ext" >&5
13506 cf_XOPEN_SOURCE_set=no
13507 fi
13508 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13509         echo "$as_me:13509: result: $cf_XOPEN_SOURCE_set" >&5
13510 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13511         if test "$cf_XOPEN_SOURCE_set" = yes
13512         then
13513                 cat >"conftest.$ac_ext" <<_ACEOF
13514 #line 13514 "configure"
13515 #include "confdefs.h"
13516 #include <stdlib.h>
13517 int
13518 main (void)
13519 {
13520
13521 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13522 make an error
13523 #endif
13524   ;
13525   return 0;
13526 }
13527 _ACEOF
13528 rm -f "conftest.$ac_objext"
13529 if { (eval echo "$as_me:13529: \"$ac_compile\"") >&5
13530   (eval $ac_compile) 2>&5
13531   ac_status=$?
13532   echo "$as_me:13532: \$? = $ac_status" >&5
13533   (exit "$ac_status"); } &&
13534          { ac_try='test -s "conftest.$ac_objext"'
13535   { (eval echo "$as_me:13535: \"$ac_try\"") >&5
13536   (eval $ac_try) 2>&5
13537   ac_status=$?
13538   echo "$as_me:13538: \$? = $ac_status" >&5
13539   (exit "$ac_status"); }; }; then
13540   cf_XOPEN_SOURCE_set_ok=yes
13541 else
13542   echo "$as_me: failed program was:" >&5
13543 cat "conftest.$ac_ext" >&5
13544 cf_XOPEN_SOURCE_set_ok=no
13545 fi
13546 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13547                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13548                 then
13549                         { echo "$as_me:13549: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13550 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13551                 fi
13552         else
13553
13554 echo "$as_me:13554: checking if we should define _XOPEN_SOURCE" >&5
13555 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13556 if test "${cf_cv_xopen_source+set}" = set; then
13557   echo $ECHO_N "(cached) $ECHO_C" >&6
13558 else
13559
13560         cat >"conftest.$ac_ext" <<_ACEOF
13561 #line 13561 "configure"
13562 #include "confdefs.h"
13563
13564 #include <stdlib.h>
13565 #include <string.h>
13566 #include <sys/types.h>
13567
13568 int
13569 main (void)
13570 {
13571
13572 #ifndef _XOPEN_SOURCE
13573 make an error
13574 #endif
13575   ;
13576   return 0;
13577 }
13578 _ACEOF
13579 rm -f "conftest.$ac_objext"
13580 if { (eval echo "$as_me:13580: \"$ac_compile\"") >&5
13581   (eval $ac_compile) 2>&5
13582   ac_status=$?
13583   echo "$as_me:13583: \$? = $ac_status" >&5
13584   (exit "$ac_status"); } &&
13585          { ac_try='test -s "conftest.$ac_objext"'
13586   { (eval echo "$as_me:13586: \"$ac_try\"") >&5
13587   (eval $ac_try) 2>&5
13588   ac_status=$?
13589   echo "$as_me:13589: \$? = $ac_status" >&5
13590   (exit "$ac_status"); }; }; then
13591   cf_cv_xopen_source=no
13592 else
13593   echo "$as_me: failed program was:" >&5
13594 cat "conftest.$ac_ext" >&5
13595 cf_save="$CPPFLAGS"
13596
13597         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13598         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13599
13600          cat >"conftest.$ac_ext" <<_ACEOF
13601 #line 13601 "configure"
13602 #include "confdefs.h"
13603
13604 #include <stdlib.h>
13605 #include <string.h>
13606 #include <sys/types.h>
13607
13608 int
13609 main (void)
13610 {
13611
13612 #ifdef _XOPEN_SOURCE
13613 make an error
13614 #endif
13615   ;
13616   return 0;
13617 }
13618 _ACEOF
13619 rm -f "conftest.$ac_objext"
13620 if { (eval echo "$as_me:13620: \"$ac_compile\"") >&5
13621   (eval $ac_compile) 2>&5
13622   ac_status=$?
13623   echo "$as_me:13623: \$? = $ac_status" >&5
13624   (exit "$ac_status"); } &&
13625          { ac_try='test -s "conftest.$ac_objext"'
13626   { (eval echo "$as_me:13626: \"$ac_try\"") >&5
13627   (eval $ac_try) 2>&5
13628   ac_status=$?
13629   echo "$as_me:13629: \$? = $ac_status" >&5
13630   (exit "$ac_status"); }; }; then
13631   cf_cv_xopen_source=no
13632 else
13633   echo "$as_me: failed program was:" >&5
13634 cat "conftest.$ac_ext" >&5
13635 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13636 fi
13637 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13638         CPPFLAGS="$cf_save"
13639
13640 fi
13641 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13642
13643 fi
13644 echo "$as_me:13644: result: $cf_cv_xopen_source" >&5
13645 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13646
13647 if test "$cf_cv_xopen_source" != no ; then
13648
13649 CFLAGS=`echo "$CFLAGS" | \
13650         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13651                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13652
13653 CPPFLAGS=`echo "$CPPFLAGS" | \
13654         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13655                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13656
13657         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13658
13659 cf_fix_cppflags=no
13660 cf_new_cflags=
13661 cf_new_cppflags=
13662 cf_new_extra_cppflags=
13663
13664 for cf_add_cflags in $cf_temp_xopen_source
13665 do
13666 case "$cf_fix_cppflags" in
13667 (no)
13668         case "$cf_add_cflags" in
13669         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13670                 case "$cf_add_cflags" in
13671                 (-D*)
13672                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13673
13674                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13675                                 && test -z "${cf_tst_cflags}" \
13676                                 && cf_fix_cppflags=yes
13677
13678                         if test "$cf_fix_cppflags" = yes ; then
13679
13680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13682
13683                                 continue
13684                         elif test "${cf_tst_cflags}" = "\"'" ; then
13685
13686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13688
13689                                 continue
13690                         fi
13691                         ;;
13692                 esac
13693                 case "$CPPFLAGS" in
13694                 (*$cf_add_cflags)
13695                         ;;
13696                 (*)
13697                         case "$cf_add_cflags" in
13698                         (-D*)
13699                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13700
13701 CPPFLAGS=`echo "$CPPFLAGS" | \
13702         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13703                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13704
13705                                 ;;
13706                         esac
13707
13708         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13709         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13710
13711                         ;;
13712                 esac
13713                 ;;
13714         (*)
13715
13716         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13717         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13718
13719                 ;;
13720         esac
13721         ;;
13722 (yes)
13723
13724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13726
13727         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13728
13729         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13730                 && test -z "${cf_tst_cflags}" \
13731                 && cf_fix_cppflags=no
13732         ;;
13733 esac
13734 done
13735
13736 if test -n "$cf_new_cflags" ; then
13737
13738         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13739         CFLAGS="${CFLAGS}$cf_new_cflags"
13740
13741 fi
13742
13743 if test -n "$cf_new_cppflags" ; then
13744
13745         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13746         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13747
13748 fi
13749
13750 if test -n "$cf_new_extra_cppflags" ; then
13751
13752         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13753         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13754
13755 fi
13756
13757 fi
13758
13759         fi
13760 fi
13761 fi # cf_cv_posix_visible
13762
13763 # Check whether --enable-largefile or --disable-largefile was given.
13764 if test "${enable_largefile+set}" = set; then
13765   enableval="$enable_largefile"
13766
13767 fi;
13768 if test "$enable_largefile" != no; then
13769
13770   echo "$as_me:13770: checking for special C compiler options needed for large files" >&5
13771 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13772 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13773   echo $ECHO_N "(cached) $ECHO_C" >&6
13774 else
13775   ac_cv_sys_largefile_CC=no
13776      if test "$GCC" != yes; then
13777        ac_save_CC=$CC
13778        while :; do
13779          # IRIX 6.2 and later do not support large files by default,
13780          # so use the C compiler's -n32 option if that helps.
13781          cat >"conftest.$ac_ext" <<_ACEOF
13782 #line 13782 "configure"
13783 #include "confdefs.h"
13784 #include <sys/types.h>
13785  /* Check that off_t can represent 2**63 - 1 correctly.
13786     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13787     since some C++ compilers masquerading as C compilers
13788     incorrectly reject 9223372036854775807.  */
13789 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13790   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13791                        && LARGE_OFF_T % 2147483647 == 1)
13792                       ? 1 : -1];
13793 int
13794 main (void)
13795 {
13796
13797   ;
13798   return 0;
13799 }
13800 _ACEOF
13801          rm -f "conftest.$ac_objext"
13802 if { (eval echo "$as_me:13802: \"$ac_compile\"") >&5
13803   (eval $ac_compile) 2>&5
13804   ac_status=$?
13805   echo "$as_me:13805: \$? = $ac_status" >&5
13806   (exit "$ac_status"); } &&
13807          { ac_try='test -s "conftest.$ac_objext"'
13808   { (eval echo "$as_me:13808: \"$ac_try\"") >&5
13809   (eval $ac_try) 2>&5
13810   ac_status=$?
13811   echo "$as_me:13811: \$? = $ac_status" >&5
13812   (exit "$ac_status"); }; }; then
13813   break
13814 else
13815   echo "$as_me: failed program was:" >&5
13816 cat "conftest.$ac_ext" >&5
13817 fi
13818 rm -f "conftest.$ac_objext"
13819          CC="$CC -n32"
13820          rm -f "conftest.$ac_objext"
13821 if { (eval echo "$as_me:13821: \"$ac_compile\"") >&5
13822   (eval $ac_compile) 2>&5
13823   ac_status=$?
13824   echo "$as_me:13824: \$? = $ac_status" >&5
13825   (exit "$ac_status"); } &&
13826          { ac_try='test -s "conftest.$ac_objext"'
13827   { (eval echo "$as_me:13827: \"$ac_try\"") >&5
13828   (eval $ac_try) 2>&5
13829   ac_status=$?
13830   echo "$as_me:13830: \$? = $ac_status" >&5
13831   (exit "$ac_status"); }; }; then
13832   ac_cv_sys_largefile_CC=' -n32'; break
13833 else
13834   echo "$as_me: failed program was:" >&5
13835 cat "conftest.$ac_ext" >&5
13836 fi
13837 rm -f "conftest.$ac_objext"
13838          break
13839        done
13840        CC=$ac_save_CC
13841        rm -f "conftest.$ac_ext"
13842     fi
13843 fi
13844 echo "$as_me:13844: result: $ac_cv_sys_largefile_CC" >&5
13845 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13846   if test "$ac_cv_sys_largefile_CC" != no; then
13847     CC=$CC$ac_cv_sys_largefile_CC
13848   fi
13849
13850   echo "$as_me:13850: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13851 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13852 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13853   echo $ECHO_N "(cached) $ECHO_C" >&6
13854 else
13855   while :; do
13856   ac_cv_sys_file_offset_bits=no
13857   cat >"conftest.$ac_ext" <<_ACEOF
13858 #line 13858 "configure"
13859 #include "confdefs.h"
13860 #include <sys/types.h>
13861  /* Check that off_t can represent 2**63 - 1 correctly.
13862     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13863     since some C++ compilers masquerading as C compilers
13864     incorrectly reject 9223372036854775807.  */
13865 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13866   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13867                        && LARGE_OFF_T % 2147483647 == 1)
13868                       ? 1 : -1];
13869 int
13870 main (void)
13871 {
13872
13873   ;
13874   return 0;
13875 }
13876 _ACEOF
13877 rm -f "conftest.$ac_objext"
13878 if { (eval echo "$as_me:13878: \"$ac_compile\"") >&5
13879   (eval $ac_compile) 2>&5
13880   ac_status=$?
13881   echo "$as_me:13881: \$? = $ac_status" >&5
13882   (exit "$ac_status"); } &&
13883          { ac_try='test -s "conftest.$ac_objext"'
13884   { (eval echo "$as_me:13884: \"$ac_try\"") >&5
13885   (eval $ac_try) 2>&5
13886   ac_status=$?
13887   echo "$as_me:13887: \$? = $ac_status" >&5
13888   (exit "$ac_status"); }; }; then
13889   break
13890 else
13891   echo "$as_me: failed program was:" >&5
13892 cat "conftest.$ac_ext" >&5
13893 fi
13894 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13895   cat >"conftest.$ac_ext" <<_ACEOF
13896 #line 13896 "configure"
13897 #include "confdefs.h"
13898 #define _FILE_OFFSET_BITS 64
13899 #include <sys/types.h>
13900  /* Check that off_t can represent 2**63 - 1 correctly.
13901     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13902     since some C++ compilers masquerading as C compilers
13903     incorrectly reject 9223372036854775807.  */
13904 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13905   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13906                        && LARGE_OFF_T % 2147483647 == 1)
13907                       ? 1 : -1];
13908 int
13909 main (void)
13910 {
13911
13912   ;
13913   return 0;
13914 }
13915 _ACEOF
13916 rm -f "conftest.$ac_objext"
13917 if { (eval echo "$as_me:13917: \"$ac_compile\"") >&5
13918   (eval $ac_compile) 2>&5
13919   ac_status=$?
13920   echo "$as_me:13920: \$? = $ac_status" >&5
13921   (exit "$ac_status"); } &&
13922          { ac_try='test -s "conftest.$ac_objext"'
13923   { (eval echo "$as_me:13923: \"$ac_try\"") >&5
13924   (eval $ac_try) 2>&5
13925   ac_status=$?
13926   echo "$as_me:13926: \$? = $ac_status" >&5
13927   (exit "$ac_status"); }; }; then
13928   ac_cv_sys_file_offset_bits=64; break
13929 else
13930   echo "$as_me: failed program was:" >&5
13931 cat "conftest.$ac_ext" >&5
13932 fi
13933 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13934   break
13935 done
13936 fi
13937 echo "$as_me:13937: result: $ac_cv_sys_file_offset_bits" >&5
13938 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13939 if test "$ac_cv_sys_file_offset_bits" != no; then
13940
13941 cat >>confdefs.h <<EOF
13942 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13943 EOF
13944
13945 fi
13946 rm -rf conftest*
13947   echo "$as_me:13947: checking for _LARGE_FILES value needed for large files" >&5
13948 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13949 if test "${ac_cv_sys_large_files+set}" = set; then
13950   echo $ECHO_N "(cached) $ECHO_C" >&6
13951 else
13952   while :; do
13953   ac_cv_sys_large_files=no
13954   cat >"conftest.$ac_ext" <<_ACEOF
13955 #line 13955 "configure"
13956 #include "confdefs.h"
13957 #include <sys/types.h>
13958  /* Check that off_t can represent 2**63 - 1 correctly.
13959     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13960     since some C++ compilers masquerading as C compilers
13961     incorrectly reject 9223372036854775807.  */
13962 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13963   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13964                        && LARGE_OFF_T % 2147483647 == 1)
13965                       ? 1 : -1];
13966 int
13967 main (void)
13968 {
13969
13970   ;
13971   return 0;
13972 }
13973 _ACEOF
13974 rm -f "conftest.$ac_objext"
13975 if { (eval echo "$as_me:13975: \"$ac_compile\"") >&5
13976   (eval $ac_compile) 2>&5
13977   ac_status=$?
13978   echo "$as_me:13978: \$? = $ac_status" >&5
13979   (exit "$ac_status"); } &&
13980          { ac_try='test -s "conftest.$ac_objext"'
13981   { (eval echo "$as_me:13981: \"$ac_try\"") >&5
13982   (eval $ac_try) 2>&5
13983   ac_status=$?
13984   echo "$as_me:13984: \$? = $ac_status" >&5
13985   (exit "$ac_status"); }; }; then
13986   break
13987 else
13988   echo "$as_me: failed program was:" >&5
13989 cat "conftest.$ac_ext" >&5
13990 fi
13991 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13992   cat >"conftest.$ac_ext" <<_ACEOF
13993 #line 13993 "configure"
13994 #include "confdefs.h"
13995 #define _LARGE_FILES 1
13996 #include <sys/types.h>
13997  /* Check that off_t can represent 2**63 - 1 correctly.
13998     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13999     since some C++ compilers masquerading as C compilers
14000     incorrectly reject 9223372036854775807.  */
14001 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14002   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14003                        && LARGE_OFF_T % 2147483647 == 1)
14004                       ? 1 : -1];
14005 int
14006 main (void)
14007 {
14008
14009   ;
14010   return 0;
14011 }
14012 _ACEOF
14013 rm -f "conftest.$ac_objext"
14014 if { (eval echo "$as_me:14014: \"$ac_compile\"") >&5
14015   (eval $ac_compile) 2>&5
14016   ac_status=$?
14017   echo "$as_me:14017: \$? = $ac_status" >&5
14018   (exit "$ac_status"); } &&
14019          { ac_try='test -s "conftest.$ac_objext"'
14020   { (eval echo "$as_me:14020: \"$ac_try\"") >&5
14021   (eval $ac_try) 2>&5
14022   ac_status=$?
14023   echo "$as_me:14023: \$? = $ac_status" >&5
14024   (exit "$ac_status"); }; }; then
14025   ac_cv_sys_large_files=1; break
14026 else
14027   echo "$as_me: failed program was:" >&5
14028 cat "conftest.$ac_ext" >&5
14029 fi
14030 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14031   break
14032 done
14033 fi
14034 echo "$as_me:14034: result: $ac_cv_sys_large_files" >&5
14035 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14036 if test "$ac_cv_sys_large_files" != no; then
14037
14038 cat >>confdefs.h <<EOF
14039 #define _LARGE_FILES $ac_cv_sys_large_files
14040 EOF
14041
14042 fi
14043 rm -rf conftest*
14044 fi
14045
14046         if test "$enable_largefile" != no ; then
14047         echo "$as_me:14047: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14048 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14049 if test "${ac_cv_sys_largefile_source+set}" = set; then
14050   echo $ECHO_N "(cached) $ECHO_C" >&6
14051 else
14052   while :; do
14053   ac_cv_sys_largefile_source=no
14054   cat >"conftest.$ac_ext" <<_ACEOF
14055 #line 14055 "configure"
14056 #include "confdefs.h"
14057 #include <stdio.h>
14058 int
14059 main (void)
14060 {
14061 return !fseeko;
14062   ;
14063   return 0;
14064 }
14065 _ACEOF
14066 rm -f "conftest.$ac_objext"
14067 if { (eval echo "$as_me:14067: \"$ac_compile\"") >&5
14068   (eval $ac_compile) 2>&5
14069   ac_status=$?
14070   echo "$as_me:14070: \$? = $ac_status" >&5
14071   (exit "$ac_status"); } &&
14072          { ac_try='test -s "conftest.$ac_objext"'
14073   { (eval echo "$as_me:14073: \"$ac_try\"") >&5
14074   (eval $ac_try) 2>&5
14075   ac_status=$?
14076   echo "$as_me:14076: \$? = $ac_status" >&5
14077   (exit "$ac_status"); }; }; then
14078   break
14079 else
14080   echo "$as_me: failed program was:" >&5
14081 cat "conftest.$ac_ext" >&5
14082 fi
14083 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14084   cat >"conftest.$ac_ext" <<_ACEOF
14085 #line 14085 "configure"
14086 #include "confdefs.h"
14087 #define _LARGEFILE_SOURCE 1
14088 #include <stdio.h>
14089 int
14090 main (void)
14091 {
14092 return !fseeko;
14093   ;
14094   return 0;
14095 }
14096 _ACEOF
14097 rm -f "conftest.$ac_objext"
14098 if { (eval echo "$as_me:14098: \"$ac_compile\"") >&5
14099   (eval $ac_compile) 2>&5
14100   ac_status=$?
14101   echo "$as_me:14101: \$? = $ac_status" >&5
14102   (exit "$ac_status"); } &&
14103          { ac_try='test -s "conftest.$ac_objext"'
14104   { (eval echo "$as_me:14104: \"$ac_try\"") >&5
14105   (eval $ac_try) 2>&5
14106   ac_status=$?
14107   echo "$as_me:14107: \$? = $ac_status" >&5
14108   (exit "$ac_status"); }; }; then
14109   ac_cv_sys_largefile_source=1; break
14110 else
14111   echo "$as_me: failed program was:" >&5
14112 cat "conftest.$ac_ext" >&5
14113 fi
14114 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14115   break
14116 done
14117 fi
14118 echo "$as_me:14118: result: $ac_cv_sys_largefile_source" >&5
14119 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14120 if test "$ac_cv_sys_largefile_source" != no; then
14121
14122 cat >>confdefs.h <<EOF
14123 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14124 EOF
14125
14126 fi
14127 rm -rf conftest*
14128
14129 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14130 # in glibc 2.1.3, but that breaks too many other things.
14131 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14132 echo "$as_me:14132: checking for fseeko" >&5
14133 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14134 if test "${ac_cv_func_fseeko+set}" = set; then
14135   echo $ECHO_N "(cached) $ECHO_C" >&6
14136 else
14137   cat >"conftest.$ac_ext" <<_ACEOF
14138 #line 14138 "configure"
14139 #include "confdefs.h"
14140 #include <stdio.h>
14141 int
14142 main (void)
14143 {
14144 return fseeko && fseeko (stdin, 0, 0);
14145   ;
14146   return 0;
14147 }
14148 _ACEOF
14149 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14150 if { (eval echo "$as_me:14150: \"$ac_link\"") >&5
14151   (eval $ac_link) 2>&5
14152   ac_status=$?
14153   echo "$as_me:14153: \$? = $ac_status" >&5
14154   (exit "$ac_status"); } &&
14155          { ac_try='test -s "conftest$ac_exeext"'
14156   { (eval echo "$as_me:14156: \"$ac_try\"") >&5
14157   (eval $ac_try) 2>&5
14158   ac_status=$?
14159   echo "$as_me:14159: \$? = $ac_status" >&5
14160   (exit "$ac_status"); }; }; then
14161   ac_cv_func_fseeko=yes
14162 else
14163   echo "$as_me: failed program was:" >&5
14164 cat "conftest.$ac_ext" >&5
14165 ac_cv_func_fseeko=no
14166 fi
14167 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14168 fi
14169 echo "$as_me:14169: result: $ac_cv_func_fseeko" >&5
14170 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14171 if test $ac_cv_func_fseeko = yes; then
14172
14173 cat >>confdefs.h <<\EOF
14174 #define HAVE_FSEEKO 1
14175 EOF
14176
14177 fi
14178
14179         # Normally we would collect these definitions in the config.h,
14180         # but (like _XOPEN_SOURCE), some environments rely on having these
14181         # defined before any of the system headers are included.  Another
14182         # case comes up with C++, e.g., on AIX the compiler compiles the
14183         # header files by themselves before looking at the body files it is
14184         # told to compile.  For ncurses, those header files do not include
14185         # the config.h
14186         if test "$ac_cv_sys_large_files" != no
14187         then
14188
14189         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14190         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14191
14192         fi
14193         if test "$ac_cv_sys_largefile_source" != no
14194         then
14195
14196         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14197         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14198
14199         fi
14200         if test "$ac_cv_sys_file_offset_bits" != no
14201         then
14202
14203         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14204         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14205
14206         fi
14207
14208         echo "$as_me:14208: checking whether to use struct dirent64" >&5
14209 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14210 if test "${cf_cv_struct_dirent64+set}" = set; then
14211   echo $ECHO_N "(cached) $ECHO_C" >&6
14212 else
14213
14214                 cat >"conftest.$ac_ext" <<_ACEOF
14215 #line 14215 "configure"
14216 #include "confdefs.h"
14217
14218 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14219 #include <sys/types.h>
14220 #include <dirent.h>
14221
14222 int
14223 main (void)
14224 {
14225
14226                 /* if transitional largefile support is setup, this is true */
14227                 extern struct dirent64 * readdir(DIR *);
14228                 struct dirent64 *x = readdir((DIR *)0);
14229                 struct dirent *y = readdir((DIR *)0);
14230                 int z = x - y;
14231                 (void)z;
14232
14233   ;
14234   return 0;
14235 }
14236 _ACEOF
14237 rm -f "conftest.$ac_objext"
14238 if { (eval echo "$as_me:14238: \"$ac_compile\"") >&5
14239   (eval $ac_compile) 2>&5
14240   ac_status=$?
14241   echo "$as_me:14241: \$? = $ac_status" >&5
14242   (exit "$ac_status"); } &&
14243          { ac_try='test -s "conftest.$ac_objext"'
14244   { (eval echo "$as_me:14244: \"$ac_try\"") >&5
14245   (eval $ac_try) 2>&5
14246   ac_status=$?
14247   echo "$as_me:14247: \$? = $ac_status" >&5
14248   (exit "$ac_status"); }; }; then
14249   cf_cv_struct_dirent64=yes
14250 else
14251   echo "$as_me: failed program was:" >&5
14252 cat "conftest.$ac_ext" >&5
14253 cf_cv_struct_dirent64=no
14254 fi
14255 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14256
14257 fi
14258 echo "$as_me:14258: result: $cf_cv_struct_dirent64" >&5
14259 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14260         test "$cf_cv_struct_dirent64" = yes &&
14261 cat >>confdefs.h <<\EOF
14262 #define HAVE_STRUCT_DIRENT64 1
14263 EOF
14264
14265         fi
14266
14267 ### Enable compiling-in rcs id's
14268 echo "$as_me:14268: checking if RCS identifiers should be compiled-in" >&5
14269 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14270
14271 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14272 if test "${with_rcs_ids+set}" = set; then
14273   withval="$with_rcs_ids"
14274   with_rcs_ids=$withval
14275 else
14276   with_rcs_ids=no
14277 fi;
14278 echo "$as_me:14278: result: $with_rcs_ids" >&5
14279 echo "${ECHO_T}$with_rcs_ids" >&6
14280 test "$with_rcs_ids" = yes &&
14281 cat >>confdefs.h <<\EOF
14282 #define USE_RCS_IDS 1
14283 EOF
14284
14285 ###############################################################################
14286
14287 ### Note that some functions (such as const) are normally disabled anyway.
14288 echo "$as_me:14288: checking if you want to build with function extensions" >&5
14289 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14290
14291 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14292 if test "${enable_ext_funcs+set}" = set; then
14293   enableval="$enable_ext_funcs"
14294   with_ext_funcs=$enableval
14295 else
14296   with_ext_funcs=yes
14297 fi;
14298 echo "$as_me:14298: result: $with_ext_funcs" >&5
14299 echo "${ECHO_T}$with_ext_funcs" >&6
14300 if test "$with_ext_funcs" = yes ; then
14301         NCURSES_EXT_FUNCS=1
14302
14303 cat >>confdefs.h <<\EOF
14304 #define HAVE_USE_DEFAULT_COLORS 1
14305 EOF
14306
14307 cat >>confdefs.h <<\EOF
14308 #define NCURSES_EXT_FUNCS 1
14309 EOF
14310
14311 else
14312         NCURSES_EXT_FUNCS=0
14313 fi
14314
14315 ###   use option --enable-const to turn on use of const beyond that in XSI.
14316 echo "$as_me:14316: checking for extended use of const keyword" >&5
14317 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14318
14319 # Check whether --enable-const or --disable-const was given.
14320 if test "${enable_const+set}" = set; then
14321   enableval="$enable_const"
14322   with_ext_const=$enableval
14323 else
14324   with_ext_const=no
14325 fi;
14326 echo "$as_me:14326: result: $with_ext_const" >&5
14327 echo "${ECHO_T}$with_ext_const" >&6
14328 NCURSES_CONST='/*nothing*/'
14329 if test "$with_ext_const" = yes ; then
14330         NCURSES_CONST=const
14331 fi
14332
14333 ###############################################################################
14334 # These options are relatively safe to experiment with.
14335
14336 echo "$as_me:14336: checking if you want all development code" >&5
14337 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14338
14339 # Check whether --with-develop or --without-develop was given.
14340 if test "${with_develop+set}" = set; then
14341   withval="$with_develop"
14342   with_develop=$withval
14343 else
14344   with_develop=no
14345 fi;
14346 echo "$as_me:14346: result: $with_develop" >&5
14347 echo "${ECHO_T}$with_develop" >&6
14348
14349 ###############################################################################
14350 # These are just experimental, probably should not be in a package:
14351
14352 # This is still experimental (20080329), but should ultimately be moved to
14353 # the script-block --with-normal, etc.
14354
14355 echo "$as_me:14355: checking if you want to link with the pthread library" >&5
14356 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14357
14358 # Check whether --with-pthread or --without-pthread was given.
14359 if test "${with_pthread+set}" = set; then
14360   withval="$with_pthread"
14361   with_pthread=$withval
14362 else
14363   with_pthread=no
14364 fi;
14365 echo "$as_me:14365: result: $with_pthread" >&5
14366 echo "${ECHO_T}$with_pthread" >&6
14367
14368 if test "$with_pthread" != no ; then
14369         echo "$as_me:14369: checking for pthread.h" >&5
14370 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14371 if test "${ac_cv_header_pthread_h+set}" = set; then
14372   echo $ECHO_N "(cached) $ECHO_C" >&6
14373 else
14374   cat >"conftest.$ac_ext" <<_ACEOF
14375 #line 14375 "configure"
14376 #include "confdefs.h"
14377 #include <pthread.h>
14378 _ACEOF
14379 if { (eval echo "$as_me:14379: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14380   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14381   ac_status=$?
14382   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14383   rm -f conftest.er1
14384   cat conftest.err >&5
14385   echo "$as_me:14385: \$? = $ac_status" >&5
14386   (exit "$ac_status"); } >/dev/null; then
14387   if test -s conftest.err; then
14388     ac_cpp_err=$ac_c_preproc_warn_flag
14389   else
14390     ac_cpp_err=
14391   fi
14392 else
14393   ac_cpp_err=yes
14394 fi
14395 if test -z "$ac_cpp_err"; then
14396   ac_cv_header_pthread_h=yes
14397 else
14398   echo "$as_me: failed program was:" >&5
14399   cat "conftest.$ac_ext" >&5
14400   ac_cv_header_pthread_h=no
14401 fi
14402 rm -f conftest.err "conftest.$ac_ext"
14403 fi
14404 echo "$as_me:14404: result: $ac_cv_header_pthread_h" >&5
14405 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14406 if test "$ac_cv_header_pthread_h" = yes; then
14407
14408 cat >>confdefs.h <<\EOF
14409 #define HAVE_PTHREADS_H 1
14410 EOF
14411
14412         for cf_lib_pthread in pthread c_r
14413         do
14414             echo "$as_me:14414: checking if we can link with the $cf_lib_pthread library" >&5
14415 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14416             cf_save_LIBS="$LIBS"
14417
14418 cf_add_libs="$LIBS"
14419 # reverse order
14420 cf_add_0lib=
14421 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14422 # filter duplicates
14423 for cf_add_1lib in $cf_add_0lib; do
14424         for cf_add_2lib in $cf_add_libs; do
14425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14426                         cf_add_1lib=
14427                         break
14428                 fi
14429         done
14430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14431 done
14432 LIBS="$cf_add_libs"
14433
14434             cat >"conftest.$ac_ext" <<_ACEOF
14435 #line 14435 "configure"
14436 #include "confdefs.h"
14437
14438 #include <pthread.h>
14439
14440 int
14441 main (void)
14442 {
14443
14444                 int rc = pthread_create(0,0,0,0);
14445                 int r2 = pthread_mutexattr_settype(0, 0);
14446
14447   ;
14448   return 0;
14449 }
14450 _ACEOF
14451 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14452 if { (eval echo "$as_me:14452: \"$ac_link\"") >&5
14453   (eval $ac_link) 2>&5
14454   ac_status=$?
14455   echo "$as_me:14455: \$? = $ac_status" >&5
14456   (exit "$ac_status"); } &&
14457          { ac_try='test -s "conftest$ac_exeext"'
14458   { (eval echo "$as_me:14458: \"$ac_try\"") >&5
14459   (eval $ac_try) 2>&5
14460   ac_status=$?
14461   echo "$as_me:14461: \$? = $ac_status" >&5
14462   (exit "$ac_status"); }; }; then
14463   with_pthread=yes
14464 else
14465   echo "$as_me: failed program was:" >&5
14466 cat "conftest.$ac_ext" >&5
14467 with_pthread=no
14468 fi
14469 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14470             LIBS="$cf_save_LIBS"
14471             echo "$as_me:14471: result: $with_pthread" >&5
14472 echo "${ECHO_T}$with_pthread" >&6
14473             test "$with_pthread" = yes && break
14474         done
14475
14476         if test "$with_pthread" = yes ; then
14477
14478 cf_add_libs="$LIBS"
14479 # reverse order
14480 cf_add_0lib=
14481 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14482 # filter duplicates
14483 for cf_add_1lib in $cf_add_0lib; do
14484         for cf_add_2lib in $cf_add_libs; do
14485                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14486                         cf_add_1lib=
14487                         break
14488                 fi
14489         done
14490         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14491 done
14492 LIBS="$cf_add_libs"
14493
14494 cat >>confdefs.h <<\EOF
14495 #define HAVE_LIBPTHREADS 1
14496 EOF
14497
14498         else
14499             { { echo "$as_me:14499: error: Cannot link with pthread library" >&5
14500 echo "$as_me: error: Cannot link with pthread library" >&2;}
14501    { (exit 1); exit 1; }; }
14502         fi
14503
14504 fi
14505
14506 fi
14507
14508 echo "$as_me:14508: checking if you want to use weak-symbols for pthreads" >&5
14509 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14510
14511 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14512 if test "${enable_weak_symbols+set}" = set; then
14513   enableval="$enable_weak_symbols"
14514   use_weak_symbols=$withval
14515 else
14516   use_weak_symbols=no
14517 fi;
14518 echo "$as_me:14518: result: $use_weak_symbols" >&5
14519 echo "${ECHO_T}$use_weak_symbols" >&6
14520 if test "$use_weak_symbols" = yes ; then
14521
14522 echo "$as_me:14522: checking if $CC supports weak symbols" >&5
14523 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14524 if test "${cf_cv_weak_symbols+set}" = set; then
14525   echo $ECHO_N "(cached) $ECHO_C" >&6
14526 else
14527
14528 cat >"conftest.$ac_ext" <<_ACEOF
14529 #line 14529 "configure"
14530 #include "confdefs.h"
14531
14532 #include <stdio.h>
14533 int
14534 main (void)
14535 {
14536
14537 #if defined(__GNUC__)
14538 #  if defined __USE_ISOC99
14539 #    define _cat_pragma(exp)    _Pragma(#exp)
14540 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14541 #  else
14542 #    define _weak_pragma(exp)
14543 #  endif
14544 #  define _declare(name)        __extension__ extern __typeof__(name) name
14545 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14546 #endif
14547
14548 weak_symbol(fopen);
14549
14550   ;
14551   return 0;
14552 }
14553 _ACEOF
14554 rm -f "conftest.$ac_objext"
14555 if { (eval echo "$as_me:14555: \"$ac_compile\"") >&5
14556   (eval $ac_compile) 2>&5
14557   ac_status=$?
14558   echo "$as_me:14558: \$? = $ac_status" >&5
14559   (exit "$ac_status"); } &&
14560          { ac_try='test -s "conftest.$ac_objext"'
14561   { (eval echo "$as_me:14561: \"$ac_try\"") >&5
14562   (eval $ac_try) 2>&5
14563   ac_status=$?
14564   echo "$as_me:14564: \$? = $ac_status" >&5
14565   (exit "$ac_status"); }; }; then
14566   cf_cv_weak_symbols=yes
14567 else
14568   echo "$as_me: failed program was:" >&5
14569 cat "conftest.$ac_ext" >&5
14570 cf_cv_weak_symbols=no
14571 fi
14572 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14573
14574 fi
14575 echo "$as_me:14575: result: $cf_cv_weak_symbols" >&5
14576 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14577
14578 else
14579         cf_cv_weak_symbols=no
14580 fi
14581
14582 if test $cf_cv_weak_symbols = yes ; then
14583
14584 cat >>confdefs.h <<\EOF
14585 #define USE_WEAK_SYMBOLS 1
14586 EOF
14587
14588 fi
14589
14590 PTHREAD=
14591 if test "$with_pthread" = "yes" ; then
14592
14593 cat >>confdefs.h <<\EOF
14594 #define USE_PTHREADS 1
14595 EOF
14596
14597         enable_reentrant=yes
14598         if test $cf_cv_weak_symbols = yes ; then
14599                 PTHREAD=-lpthread
14600         fi
14601 fi
14602
14603 # OpenSUSE is installing ncurses6, using reentrant option.
14604 echo "$as_me:14604: checking for _nc_TABSIZE" >&5
14605 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14606 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14607   echo $ECHO_N "(cached) $ECHO_C" >&6
14608 else
14609   cat >"conftest.$ac_ext" <<_ACEOF
14610 #line 14610 "configure"
14611 #include "confdefs.h"
14612 #define _nc_TABSIZE autoconf_temporary
14613 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14614 #undef _nc_TABSIZE
14615
14616 #ifdef __cplusplus
14617 extern "C"
14618 #endif
14619
14620 /* We use char because int might match the return type of a gcc2
14621    builtin and then its argument prototype would still apply.  */
14622 char _nc_TABSIZE (void);
14623
14624 int
14625 main (void)
14626 {
14627
14628 /* The GNU C library defines stubs for functions which it implements
14629     to always fail with ENOSYS.  Some functions are actually named
14630     something starting with __ and the normal name is an alias.  */
14631 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14632 #error found stub for _nc_TABSIZE
14633 #endif
14634
14635         return _nc_TABSIZE ();
14636   ;
14637   return 0;
14638 }
14639 _ACEOF
14640 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14641 if { (eval echo "$as_me:14641: \"$ac_link\"") >&5
14642   (eval $ac_link) 2>&5
14643   ac_status=$?
14644   echo "$as_me:14644: \$? = $ac_status" >&5
14645   (exit "$ac_status"); } &&
14646          { ac_try='test -s "conftest$ac_exeext"'
14647   { (eval echo "$as_me:14647: \"$ac_try\"") >&5
14648   (eval $ac_try) 2>&5
14649   ac_status=$?
14650   echo "$as_me:14650: \$? = $ac_status" >&5
14651   (exit "$ac_status"); }; }; then
14652   ac_cv_func__nc_TABSIZE=yes
14653 else
14654   echo "$as_me: failed program was:" >&5
14655 cat "conftest.$ac_ext" >&5
14656 ac_cv_func__nc_TABSIZE=no
14657 fi
14658 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14659 fi
14660 echo "$as_me:14660: result: $ac_cv_func__nc_TABSIZE" >&5
14661 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14662 if test "$ac_cv_func__nc_TABSIZE" = yes; then
14663   assume_reentrant=yes
14664 else
14665   assume_reentrant=no
14666 fi
14667
14668 # Reentrant code has to be opaque; there's little advantage to making ncurses
14669 # opaque outside of that, so there is no --enable-opaque option.  We can use
14670 # this option without --with-pthreads, but this will be always set for
14671 # pthreads.
14672 echo "$as_me:14672: checking if you want experimental reentrant code" >&5
14673 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14674
14675 # Check whether --enable-reentrant or --disable-reentrant was given.
14676 if test "${enable_reentrant+set}" = set; then
14677   enableval="$enable_reentrant"
14678   with_reentrant=$enableval
14679 else
14680   with_reentrant=$assume_reentrant
14681 fi;
14682 echo "$as_me:14682: result: $with_reentrant" >&5
14683 echo "${ECHO_T}$with_reentrant" >&6
14684 if test "$with_reentrant" = yes ; then
14685         cf_cv_enable_reentrant=1
14686         if test $cf_cv_weak_symbols = yes ; then
14687
14688 # remove pthread library from $LIBS
14689 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14690
14691         elif test "$assume_reentrant" = no ; then
14692                 LIB_SUFFIX="t${LIB_SUFFIX}"
14693         fi
14694
14695 cat >>confdefs.h <<\EOF
14696 #define USE_REENTRANT 1
14697 EOF
14698
14699 else
14700         cf_cv_enable_reentrant=0
14701 fi
14702
14703 ### Allow using a different wrap-prefix
14704 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14705         echo "$as_me:14705: checking for prefix used to wrap public variables" >&5
14706 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14707
14708 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14709 if test "${with_wrap_prefix+set}" = set; then
14710   withval="$with_wrap_prefix"
14711   NCURSES_WRAP_PREFIX=$withval
14712 else
14713   NCURSES_WRAP_PREFIX=_nc_
14714 fi;
14715         echo "$as_me:14715: result: $NCURSES_WRAP_PREFIX" >&5
14716 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14717 else
14718         NCURSES_WRAP_PREFIX=_nc_
14719 fi
14720
14721 cat >>confdefs.h <<EOF
14722 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14723 EOF
14724
14725 ###############################################################################
14726
14727 ###     use option --disable-echo to suppress full display compiling commands
14728
14729 echo "$as_me:14729: checking if you want to see long compiling messages" >&5
14730 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14731
14732 # Check whether --enable-echo or --disable-echo was given.
14733 if test "${enable_echo+set}" = set; then
14734   enableval="$enable_echo"
14735   test "$enableval" != no && enableval=yes
14736         if test "$enableval" != "yes" ; then
14737
14738         ECHO_LT='--silent'
14739         ECHO_LD='@echo linking $@;'
14740         RULE_CC='@echo compiling $<'
14741         SHOW_CC='@echo compiling $@'
14742         ECHO_CC='@'
14743
14744         else
14745
14746         ECHO_LT=''
14747         ECHO_LD=''
14748         RULE_CC=''
14749         SHOW_CC=''
14750         ECHO_CC=''
14751
14752         fi
14753 else
14754   enableval=yes
14755
14756         ECHO_LT=''
14757         ECHO_LD=''
14758         RULE_CC=''
14759         SHOW_CC=''
14760         ECHO_CC=''
14761
14762 fi;
14763 echo "$as_me:14763: result: $enableval" >&5
14764 echo "${ECHO_T}$enableval" >&6
14765
14766 if test "$GCC" = yes || test "$GXX" = yes
14767 then
14768
14769 if test "$GCC" = yes || test "$GXX" = yes
14770 then
14771         case $CFLAGS in
14772         (*-Werror=*)
14773                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14774
14775 echo "${as_me:-configure}:14775: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14776
14777                 cf_temp_flags=
14778                 for cf_temp_scan in $CFLAGS
14779                 do
14780                         case "x$cf_temp_scan" in
14781                         (x-Werror=*)
14782
14783         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14784         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14785
14786                                 ;;
14787                         (*)
14788
14789         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14790         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14791
14792                                 ;;
14793                         esac
14794                 done
14795                 CFLAGS="$cf_temp_flags"
14796                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14797
14798 echo "${as_me:-configure}:14798: testing ... fixed $CFLAGS ..." 1>&5
14799
14800                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14801
14802 echo "${as_me:-configure}:14802: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14803
14804                 ;;
14805         esac
14806 fi
14807
14808 if test "$GCC" = yes || test "$GXX" = yes
14809 then
14810         case $CPPFLAGS in
14811         (*-Werror=*)
14812                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14813
14814 echo "${as_me:-configure}:14814: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14815
14816                 cf_temp_flags=
14817                 for cf_temp_scan in $CPPFLAGS
14818                 do
14819                         case "x$cf_temp_scan" in
14820                         (x-Werror=*)
14821
14822         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14823         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14824
14825                                 ;;
14826                         (*)
14827
14828         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14829         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14830
14831                                 ;;
14832                         esac
14833                 done
14834                 CPPFLAGS="$cf_temp_flags"
14835                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14836
14837 echo "${as_me:-configure}:14837: testing ... fixed $CPPFLAGS ..." 1>&5
14838
14839                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14840
14841 echo "${as_me:-configure}:14841: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14842
14843                 ;;
14844         esac
14845 fi
14846
14847 if test "$GCC" = yes || test "$GXX" = yes
14848 then
14849         case $LDFLAGS in
14850         (*-Werror=*)
14851                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14852
14853 echo "${as_me:-configure}:14853: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14854
14855                 cf_temp_flags=
14856                 for cf_temp_scan in $LDFLAGS
14857                 do
14858                         case "x$cf_temp_scan" in
14859                         (x-Werror=*)
14860
14861         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14862         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14863
14864                                 ;;
14865                         (*)
14866
14867         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14868         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14869
14870                                 ;;
14871                         esac
14872                 done
14873                 LDFLAGS="$cf_temp_flags"
14874                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14875
14876 echo "${as_me:-configure}:14876: testing ... fixed $LDFLAGS ..." 1>&5
14877
14878                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14879
14880 echo "${as_me:-configure}:14880: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14881
14882                 ;;
14883         esac
14884 fi
14885
14886 echo "$as_me:14886: checking if you want to turn on gcc warnings" >&5
14887 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14888
14889 # Check whether --enable-warnings or --disable-warnings was given.
14890 if test "${enable_warnings+set}" = set; then
14891   enableval="$enable_warnings"
14892   test "$enableval" != yes && enableval=no
14893         if test "$enableval" != "no" ; then
14894     enable_warnings=yes
14895         else
14896                 enable_warnings=no
14897         fi
14898 else
14899   enableval=no
14900         enable_warnings=no
14901
14902 fi;
14903 echo "$as_me:14903: result: $enable_warnings" >&5
14904 echo "${ECHO_T}$enable_warnings" >&6
14905 if test "$enable_warnings" = "yes"
14906 then
14907
14908 if test "x$have_x" = xyes; then
14909
14910 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14911 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14912 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14913 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14914 for cf_X_CFLAGS in $X_CFLAGS
14915 do
14916         case "x$cf_X_CFLAGS" in
14917         x-[IUD]*)
14918                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
14919                 ;;
14920         *)
14921                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
14922                 ;;
14923         esac
14924 done
14925
14926 cat >"conftest.$ac_ext" <<_ACEOF
14927 #line 14927 "configure"
14928 #include "confdefs.h"
14929
14930 #include <stdlib.h>
14931 #include <X11/Intrinsic.h>
14932
14933 int
14934 main (void)
14935 {
14936 String foo = malloc(1); (void)foo
14937   ;
14938   return 0;
14939 }
14940 _ACEOF
14941 rm -f "conftest.$ac_objext"
14942 if { (eval echo "$as_me:14942: \"$ac_compile\"") >&5
14943   (eval $ac_compile) 2>&5
14944   ac_status=$?
14945   echo "$as_me:14945: \$? = $ac_status" >&5
14946   (exit "$ac_status"); } &&
14947          { ac_try='test -s "conftest.$ac_objext"'
14948   { (eval echo "$as_me:14948: \"$ac_try\"") >&5
14949   (eval $ac_try) 2>&5
14950   ac_status=$?
14951   echo "$as_me:14951: \$? = $ac_status" >&5
14952   (exit "$ac_status"); }; }; then
14953
14954 echo "$as_me:14954: checking for X11/Xt const-feature" >&5
14955 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
14956 if test "${cf_cv_const_x_string+set}" = set; then
14957   echo $ECHO_N "(cached) $ECHO_C" >&6
14958 else
14959
14960         cat >"conftest.$ac_ext" <<_ACEOF
14961 #line 14961 "configure"
14962 #include "confdefs.h"
14963
14964 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
14965 #undef  XTSTRINGDEFINES /* X11R5 and later */
14966 #include <stdlib.h>
14967 #include <X11/Intrinsic.h>
14968
14969 int
14970 main (void)
14971 {
14972 String foo = malloc(1); *foo = 0
14973   ;
14974   return 0;
14975 }
14976 _ACEOF
14977 rm -f "conftest.$ac_objext"
14978 if { (eval echo "$as_me:14978: \"$ac_compile\"") >&5
14979   (eval $ac_compile) 2>&5
14980   ac_status=$?
14981   echo "$as_me:14981: \$? = $ac_status" >&5
14982   (exit "$ac_status"); } &&
14983          { ac_try='test -s "conftest.$ac_objext"'
14984   { (eval echo "$as_me:14984: \"$ac_try\"") >&5
14985   (eval $ac_try) 2>&5
14986   ac_status=$?
14987   echo "$as_me:14987: \$? = $ac_status" >&5
14988   (exit "$ac_status"); }; }; then
14989
14990                         cf_cv_const_x_string=no
14991
14992 else
14993   echo "$as_me: failed program was:" >&5
14994 cat "conftest.$ac_ext" >&5
14995
14996                         cf_cv_const_x_string=yes
14997
14998 fi
14999 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15000
15001 fi
15002 echo "$as_me:15002: result: $cf_cv_const_x_string" >&5
15003 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15004
15005 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15006 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15007 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15008
15009 case "$cf_cv_const_x_string" in
15010 (no)
15011
15012         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15013         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15014
15015         ;;
15016 (*)
15017
15018         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15019         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15020
15021         ;;
15022 esac
15023
15024 else
15025   echo "$as_me: failed program was:" >&5
15026 cat "conftest.$ac_ext" >&5
15027 fi
15028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15029  fi
15030 cat > "conftest.$ac_ext" <<EOF
15031 #line 15031 "${as_me:-configure}"
15032 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15033 EOF
15034 if test "$INTEL_COMPILER" = yes
15035 then
15036 # The "-wdXXX" options suppress warnings:
15037 # remark #1419: external declaration in primary source file
15038 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15039 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15040 # remark #193: zero used for undefined preprocessing identifier
15041 # remark #593: variable "curs_sb_left_arrow" was set but never used
15042 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15043 # remark #869: parameter "tw" was never referenced
15044 # remark #981: operands are evaluated in unspecified order
15045 # warning #279: controlling expression is constant
15046
15047         { echo "$as_me:15047: checking for $CC warning options..." >&5
15048 echo "$as_me: checking for $CC warning options..." >&6;}
15049         cf_save_CFLAGS="$CFLAGS"
15050         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15051         for cf_opt in \
15052                 wd1419 \
15053                 wd1683 \
15054                 wd1684 \
15055                 wd193 \
15056                 wd593 \
15057                 wd279 \
15058                 wd810 \
15059                 wd869 \
15060                 wd981
15061         do
15062                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15063                 if { (eval echo "$as_me:15063: \"$ac_compile\"") >&5
15064   (eval $ac_compile) 2>&5
15065   ac_status=$?
15066   echo "$as_me:15066: \$? = $ac_status" >&5
15067   (exit "$ac_status"); }; then
15068                         test -n "$verbose" && echo "$as_me:15068: result: ... -$cf_opt" >&5
15069 echo "${ECHO_T}... -$cf_opt" >&6
15070                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15071                 fi
15072         done
15073         CFLAGS="$cf_save_CFLAGS"
15074 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15075 then
15076         { echo "$as_me:15076: checking for $CC warning options..." >&5
15077 echo "$as_me: checking for $CC warning options..." >&6;}
15078         cf_save_CFLAGS="$CFLAGS"
15079         cf_warn_CONST=""
15080         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15081         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15082         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15083         for cf_opt in W Wall \
15084                 Wbad-function-cast \
15085                 Wcast-align \
15086                 Wcast-qual \
15087                 Wdeclaration-after-statement \
15088                 Wextra \
15089                 Winline \
15090                 Wmissing-declarations \
15091                 Wmissing-prototypes \
15092                 Wnested-externs \
15093                 Wpointer-arith \
15094                 Wshadow \
15095                 Wstrict-prototypes \
15096                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15097         do
15098                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15099                 if { (eval echo "$as_me:15099: \"$ac_compile\"") >&5
15100   (eval $ac_compile) 2>&5
15101   ac_status=$?
15102   echo "$as_me:15102: \$? = $ac_status" >&5
15103   (exit "$ac_status"); }; then
15104                         test -n "$verbose" && echo "$as_me:15104: result: ... -$cf_opt" >&5
15105 echo "${ECHO_T}... -$cf_opt" >&6
15106                         case "$cf_opt" in
15107                         (Winline)
15108                                 case "$GCC_VERSION" in
15109                                 ([34].*)
15110                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15111
15112 echo "${as_me:-configure}:15112: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15113
15114                                         continue;;
15115                                 esac
15116                                 ;;
15117                         (Wpointer-arith)
15118                                 case "$GCC_VERSION" in
15119                                 ([12].*)
15120                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15121
15122 echo "${as_me:-configure}:15122: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15123
15124                                         continue;;
15125                                 esac
15126                                 ;;
15127                         esac
15128                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15129                 fi
15130         done
15131         CFLAGS="$cf_save_CFLAGS"
15132 fi
15133 rm -rf ./conftest*
15134
15135 fi
15136
15137 if test "$GCC" = yes || test "$GXX" = yes
15138 then
15139 cat > conftest.i <<EOF
15140 #ifndef GCC_PRINTF
15141 #define GCC_PRINTF 0
15142 #endif
15143 #ifndef GCC_SCANF
15144 #define GCC_SCANF 0
15145 #endif
15146 #ifndef GCC_NORETURN
15147 #define GCC_NORETURN /* nothing */
15148 #endif
15149 #ifndef GCC_UNUSED
15150 #define GCC_UNUSED /* nothing */
15151 #endif
15152 EOF
15153 if test "$GCC" = yes
15154 then
15155         { echo "$as_me:15155: checking for $CC __attribute__ directives..." >&5
15156 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15157 cat > "conftest.$ac_ext" <<EOF
15158 #line 15158 "${as_me:-configure}"
15159 #include "confdefs.h"
15160 #include "conftest.h"
15161 #include "conftest.i"
15162 #if     GCC_PRINTF
15163 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15164 #else
15165 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15166 #endif
15167 #if     GCC_SCANF
15168 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15169 #else
15170 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15171 #endif
15172 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15173 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
15174 extern void foo(void) GCC_NORETURN;
15175 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15176 EOF
15177         cf_printf_attribute=no
15178         cf_scanf_attribute=no
15179         for cf_attribute in scanf printf unused noreturn
15180         do
15181
15182 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15183
15184                 cf_directive="__attribute__(($cf_attribute))"
15185                 echo "checking for $CC $cf_directive" 1>&5
15186
15187                 case "$cf_attribute" in
15188                 (printf)
15189                         cf_printf_attribute=yes
15190                         cat >conftest.h <<EOF
15191 #define GCC_$cf_ATTRIBUTE 1
15192 EOF
15193                         ;;
15194                 (scanf)
15195                         cf_scanf_attribute=yes
15196                         cat >conftest.h <<EOF
15197 #define GCC_$cf_ATTRIBUTE 1
15198 EOF
15199                         ;;
15200                 (*)
15201                         cat >conftest.h <<EOF
15202 #define GCC_$cf_ATTRIBUTE $cf_directive
15203 EOF
15204                         ;;
15205                 esac
15206
15207                 if { (eval echo "$as_me:15207: \"$ac_compile\"") >&5
15208   (eval $ac_compile) 2>&5
15209   ac_status=$?
15210   echo "$as_me:15210: \$? = $ac_status" >&5
15211   (exit "$ac_status"); }; then
15212                         test -n "$verbose" && echo "$as_me:15212: result: ... $cf_attribute" >&5
15213 echo "${ECHO_T}... $cf_attribute" >&6
15214                         cat conftest.h >>confdefs.h
15215                         case "$cf_attribute" in
15216                         (noreturn)
15217
15218 cat >>confdefs.h <<EOF
15219 #define GCC_NORETURN $cf_directive
15220 EOF
15221
15222                                 ;;
15223                         (printf)
15224                                 cf_value='/* nothing */'
15225                                 if test "$cf_printf_attribute" != no ; then
15226                                         cf_value='__attribute__((format(printf,fmt,var)))'
15227
15228 cat >>confdefs.h <<\EOF
15229 #define GCC_PRINTF 1
15230 EOF
15231
15232                                 fi
15233
15234 cat >>confdefs.h <<EOF
15235 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15236 EOF
15237
15238                                 ;;
15239                         (scanf)
15240                                 cf_value='/* nothing */'
15241                                 if test "$cf_scanf_attribute" != no ; then
15242                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15243
15244 cat >>confdefs.h <<\EOF
15245 #define GCC_SCANF 1
15246 EOF
15247
15248                                 fi
15249
15250 cat >>confdefs.h <<EOF
15251 #define GCC_SCANFLIKE(fmt,var) $cf_value
15252 EOF
15253
15254                                 ;;
15255                         (unused)
15256
15257 cat >>confdefs.h <<EOF
15258 #define GCC_UNUSED $cf_directive
15259 EOF
15260
15261                                 ;;
15262                         esac
15263                 fi
15264         done
15265 else
15266         ${FGREP-fgrep} define conftest.i >>confdefs.h
15267 fi
15268 rm -rf ./conftest*
15269 fi
15270
15271 fi
15272
15273 if test "x$enable_warnings" = "xyes"; then
15274
15275         ADAFLAGS="$ADAFLAGS -gnatg"
15276
15277 fi
15278
15279 ###     use option --enable-assertions to turn on generation of assertion code
15280 echo "$as_me:15280: checking if you want to enable runtime assertions" >&5
15281 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15282
15283 # Check whether --enable-assertions or --disable-assertions was given.
15284 if test "${enable_assertions+set}" = set; then
15285   enableval="$enable_assertions"
15286   with_assertions=$enableval
15287 else
15288   with_assertions=no
15289 fi;
15290 echo "$as_me:15290: result: $with_assertions" >&5
15291 echo "${ECHO_T}$with_assertions" >&6
15292 if test -n "$GCC"
15293 then
15294         if test "$with_assertions" = no
15295         then
15296                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15297         else
15298
15299         ADAFLAGS="$ADAFLAGS -gnata"
15300
15301         fi
15302 fi
15303
15304 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15305
15306 cat >>confdefs.h <<\EOF
15307 #define HAVE_NC_ALLOC_H 1
15308 EOF
15309
15310 ###     use option --enable-expanded to generate certain macros as functions
15311
15312 # Check whether --enable-expanded or --disable-expanded was given.
15313 if test "${enable_expanded+set}" = set; then
15314   enableval="$enable_expanded"
15315   test "$enableval" = yes &&
15316 cat >>confdefs.h <<\EOF
15317 #define NCURSES_EXPANDED 1
15318 EOF
15319
15320 fi;
15321
15322 ###     use option --disable-macros to suppress macros in favor of functions
15323
15324 # Check whether --enable-macros or --disable-macros was given.
15325 if test "${enable_macros+set}" = set; then
15326   enableval="$enable_macros"
15327   test "$enableval" = no &&
15328 cat >>confdefs.h <<\EOF
15329 #define NCURSES_NOMACROS 1
15330 EOF
15331
15332 fi;
15333
15334 # Normally we only add trace() to the debug-library.  Allow this to be
15335 # extended to all models of the ncurses library:
15336 cf_all_traces=no
15337 case "$CFLAGS $CPPFLAGS" in
15338 (*-DTRACE*)
15339         cf_all_traces=yes
15340         ;;
15341 esac
15342
15343 echo "$as_me:15343: checking whether to add trace feature to all models" >&5
15344 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15345
15346 # Check whether --with-trace or --without-trace was given.
15347 if test "${with_trace+set}" = set; then
15348   withval="$with_trace"
15349   cf_with_trace=$withval
15350 else
15351   cf_with_trace=$cf_all_traces
15352 fi;
15353 echo "$as_me:15353: result: $cf_with_trace" >&5
15354 echo "${ECHO_T}$cf_with_trace" >&6
15355
15356 if test "$cf_with_trace" = yes ; then
15357         ADA_TRACE=TRUE
15358
15359 cf_fix_cppflags=no
15360 cf_new_cflags=
15361 cf_new_cppflags=
15362 cf_new_extra_cppflags=
15363
15364 for cf_add_cflags in -DTRACE
15365 do
15366 case "$cf_fix_cppflags" in
15367 (no)
15368         case "$cf_add_cflags" in
15369         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15370                 case "$cf_add_cflags" in
15371                 (-D*)
15372                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15373
15374                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15375                                 && test -z "${cf_tst_cflags}" \
15376                                 && cf_fix_cppflags=yes
15377
15378                         if test "$cf_fix_cppflags" = yes ; then
15379
15380         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15381         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15382
15383                                 continue
15384                         elif test "${cf_tst_cflags}" = "\"'" ; then
15385
15386         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15387         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15388
15389                                 continue
15390                         fi
15391                         ;;
15392                 esac
15393                 case "$CPPFLAGS" in
15394                 (*$cf_add_cflags)
15395                         ;;
15396                 (*)
15397                         case "$cf_add_cflags" in
15398                         (-D*)
15399                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15400
15401 CPPFLAGS=`echo "$CPPFLAGS" | \
15402         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15403                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15404
15405                                 ;;
15406                         esac
15407
15408         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15409         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15410
15411                         ;;
15412                 esac
15413                 ;;
15414         (*)
15415
15416         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15417         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15418
15419                 ;;
15420         esac
15421         ;;
15422 (yes)
15423
15424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15426
15427         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15428
15429         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15430                 && test -z "${cf_tst_cflags}" \
15431                 && cf_fix_cppflags=no
15432         ;;
15433 esac
15434 done
15435
15436 if test -n "$cf_new_cflags" ; then
15437
15438         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15439         CFLAGS="${CFLAGS}$cf_new_cflags"
15440
15441 fi
15442
15443 if test -n "$cf_new_cppflags" ; then
15444
15445         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15446         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15447
15448 fi
15449
15450 if test -n "$cf_new_extra_cppflags" ; then
15451
15452         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15453         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15454
15455 fi
15456
15457 else
15458         ADA_TRACE=FALSE
15459 fi
15460
15461 echo "$as_me:15461: checking if we want to use GNAT projects" >&5
15462 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15463
15464 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15465 if test "${enable_gnat_projects+set}" = set; then
15466   enableval="$enable_gnat_projects"
15467   test "$enableval" != no && enableval=yes
15468         if test "$enableval" != "yes" ; then
15469     enable_gnat_projects=no
15470         else
15471                 enable_gnat_projects=yes
15472         fi
15473 else
15474   enableval=yes
15475         enable_gnat_projects=yes
15476
15477 fi;
15478 echo "$as_me:15478: result: $enable_gnat_projects" >&5
15479 echo "${ECHO_T}$enable_gnat_projects" >&6
15480
15481 ###     Checks for libraries.
15482 case $cf_cv_system_name in
15483 (*mingw32*)
15484         ;;
15485 (*)
15486 echo "$as_me:15486: checking for gettimeofday" >&5
15487 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15488 if test "${ac_cv_func_gettimeofday+set}" = set; then
15489   echo $ECHO_N "(cached) $ECHO_C" >&6
15490 else
15491   cat >"conftest.$ac_ext" <<_ACEOF
15492 #line 15492 "configure"
15493 #include "confdefs.h"
15494 #define gettimeofday autoconf_temporary
15495 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15496 #undef gettimeofday
15497
15498 #ifdef __cplusplus
15499 extern "C"
15500 #endif
15501
15502 /* We use char because int might match the return type of a gcc2
15503    builtin and then its argument prototype would still apply.  */
15504 char gettimeofday (void);
15505
15506 int
15507 main (void)
15508 {
15509
15510 /* The GNU C library defines stubs for functions which it implements
15511     to always fail with ENOSYS.  Some functions are actually named
15512     something starting with __ and the normal name is an alias.  */
15513 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15514 #error found stub for gettimeofday
15515 #endif
15516
15517         return gettimeofday ();
15518   ;
15519   return 0;
15520 }
15521 _ACEOF
15522 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15523 if { (eval echo "$as_me:15523: \"$ac_link\"") >&5
15524   (eval $ac_link) 2>&5
15525   ac_status=$?
15526   echo "$as_me:15526: \$? = $ac_status" >&5
15527   (exit "$ac_status"); } &&
15528          { ac_try='test -s "conftest$ac_exeext"'
15529   { (eval echo "$as_me:15529: \"$ac_try\"") >&5
15530   (eval $ac_try) 2>&5
15531   ac_status=$?
15532   echo "$as_me:15532: \$? = $ac_status" >&5
15533   (exit "$ac_status"); }; }; then
15534   ac_cv_func_gettimeofday=yes
15535 else
15536   echo "$as_me: failed program was:" >&5
15537 cat "conftest.$ac_ext" >&5
15538 ac_cv_func_gettimeofday=no
15539 fi
15540 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15541 fi
15542 echo "$as_me:15542: result: $ac_cv_func_gettimeofday" >&5
15543 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15544 if test "$ac_cv_func_gettimeofday" = yes; then
15545   cat >>confdefs.h <<\EOF
15546 #define HAVE_GETTIMEOFDAY 1
15547 EOF
15548
15549 else
15550
15551 echo "$as_me:15551: checking for gettimeofday in -lbsd" >&5
15552 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15553 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15554   echo $ECHO_N "(cached) $ECHO_C" >&6
15555 else
15556   ac_check_lib_save_LIBS=$LIBS
15557 LIBS="-lbsd  $LIBS"
15558 cat >"conftest.$ac_ext" <<_ACEOF
15559 #line 15559 "configure"
15560 #include "confdefs.h"
15561
15562 /* Override any gcc2 internal prototype to avoid an error.  */
15563 #ifdef __cplusplus
15564 extern "C"
15565 #endif
15566 /* We use char because int might match the return type of a gcc2
15567    builtin and then its argument prototype would still apply.  */
15568 char gettimeofday ();
15569 int
15570 main (void)
15571 {
15572 gettimeofday ();
15573   ;
15574   return 0;
15575 }
15576 _ACEOF
15577 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15578 if { (eval echo "$as_me:15578: \"$ac_link\"") >&5
15579   (eval $ac_link) 2>&5
15580   ac_status=$?
15581   echo "$as_me:15581: \$? = $ac_status" >&5
15582   (exit "$ac_status"); } &&
15583          { ac_try='test -s "conftest$ac_exeext"'
15584   { (eval echo "$as_me:15584: \"$ac_try\"") >&5
15585   (eval $ac_try) 2>&5
15586   ac_status=$?
15587   echo "$as_me:15587: \$? = $ac_status" >&5
15588   (exit "$ac_status"); }; }; then
15589   ac_cv_lib_bsd_gettimeofday=yes
15590 else
15591   echo "$as_me: failed program was:" >&5
15592 cat "conftest.$ac_ext" >&5
15593 ac_cv_lib_bsd_gettimeofday=no
15594 fi
15595 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15596 LIBS=$ac_check_lib_save_LIBS
15597 fi
15598 echo "$as_me:15598: result: $ac_cv_lib_bsd_gettimeofday" >&5
15599 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15600 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
15601
15602 cat >>confdefs.h <<\EOF
15603 #define HAVE_GETTIMEOFDAY 1
15604 EOF
15605
15606         LIBS="$LIBS -lbsd"
15607 fi
15608
15609 fi
15610         ;;
15611 esac
15612
15613 ###     Checks for header files.
15614 echo "$as_me:15614: checking for ANSI C header files" >&5
15615 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15616 if test "${ac_cv_header_stdc+set}" = set; then
15617   echo $ECHO_N "(cached) $ECHO_C" >&6
15618 else
15619   cat >"conftest.$ac_ext" <<_ACEOF
15620 #line 15620 "configure"
15621 #include "confdefs.h"
15622 #include <stdlib.h>
15623 #include <stdarg.h>
15624 #include <string.h>
15625 #include <float.h>
15626
15627 _ACEOF
15628 if { (eval echo "$as_me:15628: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15629   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15630   ac_status=$?
15631   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15632   rm -f conftest.er1
15633   cat conftest.err >&5
15634   echo "$as_me:15634: \$? = $ac_status" >&5
15635   (exit "$ac_status"); } >/dev/null; then
15636   if test -s conftest.err; then
15637     ac_cpp_err=$ac_c_preproc_warn_flag
15638   else
15639     ac_cpp_err=
15640   fi
15641 else
15642   ac_cpp_err=yes
15643 fi
15644 if test -z "$ac_cpp_err"; then
15645   ac_cv_header_stdc=yes
15646 else
15647   echo "$as_me: failed program was:" >&5
15648   cat "conftest.$ac_ext" >&5
15649   ac_cv_header_stdc=no
15650 fi
15651 rm -f conftest.err "conftest.$ac_ext"
15652
15653 if test $ac_cv_header_stdc = yes; then
15654   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15655   cat >"conftest.$ac_ext" <<_ACEOF
15656 #line 15656 "configure"
15657 #include "confdefs.h"
15658 #include <string.h>
15659
15660 _ACEOF
15661 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15662   $EGREP "memchr" >/dev/null 2>&1; then
15663   :
15664 else
15665   ac_cv_header_stdc=no
15666 fi
15667 rm -rf conftest*
15668
15669 fi
15670
15671 if test $ac_cv_header_stdc = yes; then
15672   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15673   cat >"conftest.$ac_ext" <<_ACEOF
15674 #line 15674 "configure"
15675 #include "confdefs.h"
15676 #include <stdlib.h>
15677
15678 _ACEOF
15679 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15680   $EGREP "free" >/dev/null 2>&1; then
15681   :
15682 else
15683   ac_cv_header_stdc=no
15684 fi
15685 rm -rf conftest*
15686
15687 fi
15688
15689 if test $ac_cv_header_stdc = yes; then
15690   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15691   if test "$cross_compiling" = yes; then
15692   :
15693 else
15694   cat >"conftest.$ac_ext" <<_ACEOF
15695 #line 15695 "configure"
15696 #include "confdefs.h"
15697 #include <ctype.h>
15698 #if ((' ' & 0x0FF) == 0x020)
15699 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15700 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15701 #else
15702 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15703                      || ('j' <= (c) && (c) <= 'r') \
15704                      || ('s' <= (c) && (c) <= 'z'))
15705 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15706 #endif
15707
15708 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15709 int
15710 main (void)
15711 {
15712   int i;
15713   for (i = 0; i < 256; i++)
15714     if (XOR (islower (i), ISLOWER (i))
15715         || toupper (i) != TOUPPER (i))
15716       $ac_main_return(2);
15717   $ac_main_return (0);
15718 }
15719 _ACEOF
15720 rm -f "conftest$ac_exeext"
15721 if { (eval echo "$as_me:15721: \"$ac_link\"") >&5
15722   (eval $ac_link) 2>&5
15723   ac_status=$?
15724   echo "$as_me:15724: \$? = $ac_status" >&5
15725   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
15726   { (eval echo "$as_me:15726: \"$ac_try\"") >&5
15727   (eval $ac_try) 2>&5
15728   ac_status=$?
15729   echo "$as_me:15729: \$? = $ac_status" >&5
15730   (exit "$ac_status"); }; }; then
15731   :
15732 else
15733   echo "$as_me: program exited with status $ac_status" >&5
15734 echo "$as_me: failed program was:" >&5
15735 cat "conftest.$ac_ext" >&5
15736 ac_cv_header_stdc=no
15737 fi
15738 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
15739 fi
15740 fi
15741 fi
15742 echo "$as_me:15742: result: $ac_cv_header_stdc" >&5
15743 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15744 if test $ac_cv_header_stdc = yes; then
15745
15746 cat >>confdefs.h <<\EOF
15747 #define STDC_HEADERS 1
15748 EOF
15749
15750 fi
15751
15752 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15753
15754 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15755                   inttypes.h stdint.h unistd.h
15756 do
15757 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15758 echo "$as_me:15758: checking for $ac_header" >&5
15759 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15760 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15761   echo $ECHO_N "(cached) $ECHO_C" >&6
15762 else
15763   cat >"conftest.$ac_ext" <<_ACEOF
15764 #line 15764 "configure"
15765 #include "confdefs.h"
15766 $ac_includes_default
15767 #include <$ac_header>
15768 _ACEOF
15769 rm -f "conftest.$ac_objext"
15770 if { (eval echo "$as_me:15770: \"$ac_compile\"") >&5
15771   (eval $ac_compile) 2>&5
15772   ac_status=$?
15773   echo "$as_me:15773: \$? = $ac_status" >&5
15774   (exit "$ac_status"); } &&
15775          { ac_try='test -s "conftest.$ac_objext"'
15776   { (eval echo "$as_me:15776: \"$ac_try\"") >&5
15777   (eval $ac_try) 2>&5
15778   ac_status=$?
15779   echo "$as_me:15779: \$? = $ac_status" >&5
15780   (exit "$ac_status"); }; }; then
15781   eval "$as_ac_Header=yes"
15782 else
15783   echo "$as_me: failed program was:" >&5
15784 cat "conftest.$ac_ext" >&5
15785 eval "$as_ac_Header=no"
15786 fi
15787 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15788 fi
15789 echo "$as_me:15789: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
15790 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
15791 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
15792   cat >>confdefs.h <<EOF
15793 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15794 EOF
15795
15796 fi
15797 done
15798
15799 echo "$as_me:15799: checking for signed char" >&5
15800 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15801 if test "${ac_cv_type_signed_char+set}" = set; then
15802   echo $ECHO_N "(cached) $ECHO_C" >&6
15803 else
15804   cat >"conftest.$ac_ext" <<_ACEOF
15805 #line 15805 "configure"
15806 #include "confdefs.h"
15807 $ac_includes_default
15808 int
15809 main (void)
15810 {
15811 if ((signed char *) 0)
15812   return 0;
15813 if (sizeof (signed char))
15814   return 0;
15815   ;
15816   return 0;
15817 }
15818 _ACEOF
15819 rm -f "conftest.$ac_objext"
15820 if { (eval echo "$as_me:15820: \"$ac_compile\"") >&5
15821   (eval $ac_compile) 2>&5
15822   ac_status=$?
15823   echo "$as_me:15823: \$? = $ac_status" >&5
15824   (exit "$ac_status"); } &&
15825          { ac_try='test -s "conftest.$ac_objext"'
15826   { (eval echo "$as_me:15826: \"$ac_try\"") >&5
15827   (eval $ac_try) 2>&5
15828   ac_status=$?
15829   echo "$as_me:15829: \$? = $ac_status" >&5
15830   (exit "$ac_status"); }; }; then
15831   ac_cv_type_signed_char=yes
15832 else
15833   echo "$as_me: failed program was:" >&5
15834 cat "conftest.$ac_ext" >&5
15835 ac_cv_type_signed_char=no
15836 fi
15837 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15838 fi
15839 echo "$as_me:15839: result: $ac_cv_type_signed_char" >&5
15840 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15841
15842 echo "$as_me:15842: checking size of signed char" >&5
15843 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15844 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15845   echo $ECHO_N "(cached) $ECHO_C" >&6
15846 else
15847   if test "$ac_cv_type_signed_char" = yes; then
15848   if test "$cross_compiling" = yes; then
15849   # Depending upon the size, compute the lo and hi bounds.
15850 cat >"conftest.$ac_ext" <<_ACEOF
15851 #line 15851 "configure"
15852 #include "confdefs.h"
15853 $ac_includes_default
15854 int
15855 main (void)
15856 {
15857 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15858   ;
15859   return 0;
15860 }
15861 _ACEOF
15862 rm -f "conftest.$ac_objext"
15863 if { (eval echo "$as_me:15863: \"$ac_compile\"") >&5
15864   (eval $ac_compile) 2>&5
15865   ac_status=$?
15866   echo "$as_me:15866: \$? = $ac_status" >&5
15867   (exit "$ac_status"); } &&
15868          { ac_try='test -s "conftest.$ac_objext"'
15869   { (eval echo "$as_me:15869: \"$ac_try\"") >&5
15870   (eval $ac_try) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit "$ac_status"); }; }; then
15874   ac_lo=0 ac_mid=0
15875   while :; do
15876     cat >"conftest.$ac_ext" <<_ACEOF
15877 #line 15877 "configure"
15878 #include "confdefs.h"
15879 $ac_includes_default
15880 int
15881 main (void)
15882 {
15883 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15884   ;
15885   return 0;
15886 }
15887 _ACEOF
15888 rm -f "conftest.$ac_objext"
15889 if { (eval echo "$as_me:15889: \"$ac_compile\"") >&5
15890   (eval $ac_compile) 2>&5
15891   ac_status=$?
15892   echo "$as_me:15892: \$? = $ac_status" >&5
15893   (exit "$ac_status"); } &&
15894          { ac_try='test -s "conftest.$ac_objext"'
15895   { (eval echo "$as_me:15895: \"$ac_try\"") >&5
15896   (eval $ac_try) 2>&5
15897   ac_status=$?
15898   echo "$as_me:15898: \$? = $ac_status" >&5
15899   (exit "$ac_status"); }; }; then
15900   ac_hi=$ac_mid; break
15901 else
15902   echo "$as_me: failed program was:" >&5
15903 cat "conftest.$ac_ext" >&5
15904 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
15905 fi
15906 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15907   done
15908 else
15909   echo "$as_me: failed program was:" >&5
15910 cat "conftest.$ac_ext" >&5
15911 ac_hi=-1 ac_mid=-1
15912   while :; do
15913     cat >"conftest.$ac_ext" <<_ACEOF
15914 #line 15914 "configure"
15915 #include "confdefs.h"
15916 $ac_includes_default
15917 int
15918 main (void)
15919 {
15920 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
15921   ;
15922   return 0;
15923 }
15924 _ACEOF
15925 rm -f "conftest.$ac_objext"
15926 if { (eval echo "$as_me:15926: \"$ac_compile\"") >&5
15927   (eval $ac_compile) 2>&5
15928   ac_status=$?
15929   echo "$as_me:15929: \$? = $ac_status" >&5
15930   (exit "$ac_status"); } &&
15931          { ac_try='test -s "conftest.$ac_objext"'
15932   { (eval echo "$as_me:15932: \"$ac_try\"") >&5
15933   (eval $ac_try) 2>&5
15934   ac_status=$?
15935   echo "$as_me:15935: \$? = $ac_status" >&5
15936   (exit "$ac_status"); }; }; then
15937   ac_lo=$ac_mid; break
15938 else
15939   echo "$as_me: failed program was:" >&5
15940 cat "conftest.$ac_ext" >&5
15941 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
15942 fi
15943 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15944   done
15945 fi
15946 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15947 # Binary search between lo and hi bounds.
15948 while test "x$ac_lo" != "x$ac_hi"; do
15949   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
15950   cat >"conftest.$ac_ext" <<_ACEOF
15951 #line 15951 "configure"
15952 #include "confdefs.h"
15953 $ac_includes_default
15954 int
15955 main (void)
15956 {
15957 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15958   ;
15959   return 0;
15960 }
15961 _ACEOF
15962 rm -f "conftest.$ac_objext"
15963 if { (eval echo "$as_me:15963: \"$ac_compile\"") >&5
15964   (eval $ac_compile) 2>&5
15965   ac_status=$?
15966   echo "$as_me:15966: \$? = $ac_status" >&5
15967   (exit "$ac_status"); } &&
15968          { ac_try='test -s "conftest.$ac_objext"'
15969   { (eval echo "$as_me:15969: \"$ac_try\"") >&5
15970   (eval $ac_try) 2>&5
15971   ac_status=$?
15972   echo "$as_me:15972: \$? = $ac_status" >&5
15973   (exit "$ac_status"); }; }; then
15974   ac_hi=$ac_mid
15975 else
15976   echo "$as_me: failed program was:" >&5
15977 cat "conftest.$ac_ext" >&5
15978 ac_lo=`expr "$ac_mid" + 1`
15979 fi
15980 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15981 done
15982 ac_cv_sizeof_signed_char=$ac_lo
15983 else
15984   if test "$cross_compiling" = yes; then
15985   { { echo "$as_me:15985: error: cannot run test program while cross compiling" >&5
15986 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15987    { (exit 1); exit 1; }; }
15988 else
15989   cat >"conftest.$ac_ext" <<_ACEOF
15990 #line 15990 "configure"
15991 #include "confdefs.h"
15992 $ac_includes_default
15993 int
15994 main (void)
15995 {
15996 FILE *f = fopen ("conftest.val", "w");
15997 if (!f)
15998   $ac_main_return (1);
15999 fprintf (f, "%d", (sizeof (signed char)));
16000 fclose (f);
16001   ;
16002   return 0;
16003 }
16004 _ACEOF
16005 rm -f "conftest$ac_exeext"
16006 if { (eval echo "$as_me:16006: \"$ac_link\"") >&5
16007   (eval $ac_link) 2>&5
16008   ac_status=$?
16009   echo "$as_me:16009: \$? = $ac_status" >&5
16010   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16011   { (eval echo "$as_me:16011: \"$ac_try\"") >&5
16012   (eval $ac_try) 2>&5
16013   ac_status=$?
16014   echo "$as_me:16014: \$? = $ac_status" >&5
16015   (exit "$ac_status"); }; }; then
16016   ac_cv_sizeof_signed_char=`cat conftest.val`
16017 else
16018   echo "$as_me: program exited with status $ac_status" >&5
16019 echo "$as_me: failed program was:" >&5
16020 cat "conftest.$ac_ext" >&5
16021 fi
16022 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16023 fi
16024 fi
16025 rm -f conftest.val
16026 else
16027   ac_cv_sizeof_signed_char=0
16028 fi
16029 fi
16030 echo "$as_me:16030: result: $ac_cv_sizeof_signed_char" >&5
16031 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16032 cat >>confdefs.h <<EOF
16033 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16034 EOF
16035
16036 echo "$as_me:16036: checking for ANSI C header files" >&5
16037 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16038 if test "${ac_cv_header_stdc+set}" = set; then
16039   echo $ECHO_N "(cached) $ECHO_C" >&6
16040 else
16041   cat >"conftest.$ac_ext" <<_ACEOF
16042 #line 16042 "configure"
16043 #include "confdefs.h"
16044 #include <stdlib.h>
16045 #include <stdarg.h>
16046 #include <string.h>
16047 #include <float.h>
16048
16049 _ACEOF
16050 if { (eval echo "$as_me:16050: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16051   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16052   ac_status=$?
16053   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16054   rm -f conftest.er1
16055   cat conftest.err >&5
16056   echo "$as_me:16056: \$? = $ac_status" >&5
16057   (exit "$ac_status"); } >/dev/null; then
16058   if test -s conftest.err; then
16059     ac_cpp_err=$ac_c_preproc_warn_flag
16060   else
16061     ac_cpp_err=
16062   fi
16063 else
16064   ac_cpp_err=yes
16065 fi
16066 if test -z "$ac_cpp_err"; then
16067   ac_cv_header_stdc=yes
16068 else
16069   echo "$as_me: failed program was:" >&5
16070   cat "conftest.$ac_ext" >&5
16071   ac_cv_header_stdc=no
16072 fi
16073 rm -f conftest.err "conftest.$ac_ext"
16074
16075 if test $ac_cv_header_stdc = yes; then
16076   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16077   cat >"conftest.$ac_ext" <<_ACEOF
16078 #line 16078 "configure"
16079 #include "confdefs.h"
16080 #include <string.h>
16081
16082 _ACEOF
16083 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16084   $EGREP "memchr" >/dev/null 2>&1; then
16085   :
16086 else
16087   ac_cv_header_stdc=no
16088 fi
16089 rm -rf conftest*
16090
16091 fi
16092
16093 if test $ac_cv_header_stdc = yes; then
16094   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16095   cat >"conftest.$ac_ext" <<_ACEOF
16096 #line 16096 "configure"
16097 #include "confdefs.h"
16098 #include <stdlib.h>
16099
16100 _ACEOF
16101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16102   $EGREP "free" >/dev/null 2>&1; then
16103   :
16104 else
16105   ac_cv_header_stdc=no
16106 fi
16107 rm -rf conftest*
16108
16109 fi
16110
16111 if test $ac_cv_header_stdc = yes; then
16112   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16113   if test "$cross_compiling" = yes; then
16114   :
16115 else
16116   cat >"conftest.$ac_ext" <<_ACEOF
16117 #line 16117 "configure"
16118 #include "confdefs.h"
16119 #include <ctype.h>
16120 #if ((' ' & 0x0FF) == 0x020)
16121 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16122 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16123 #else
16124 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16125                      || ('j' <= (c) && (c) <= 'r') \
16126                      || ('s' <= (c) && (c) <= 'z'))
16127 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16128 #endif
16129
16130 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16131 int
16132 main (void)
16133 {
16134   int i;
16135   for (i = 0; i < 256; i++)
16136     if (XOR (islower (i), ISLOWER (i))
16137         || toupper (i) != TOUPPER (i))
16138       $ac_main_return(2);
16139   $ac_main_return (0);
16140 }
16141 _ACEOF
16142 rm -f "conftest$ac_exeext"
16143 if { (eval echo "$as_me:16143: \"$ac_link\"") >&5
16144   (eval $ac_link) 2>&5
16145   ac_status=$?
16146   echo "$as_me:16146: \$? = $ac_status" >&5
16147   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16148   { (eval echo "$as_me:16148: \"$ac_try\"") >&5
16149   (eval $ac_try) 2>&5
16150   ac_status=$?
16151   echo "$as_me:16151: \$? = $ac_status" >&5
16152   (exit "$ac_status"); }; }; then
16153   :
16154 else
16155   echo "$as_me: program exited with status $ac_status" >&5
16156 echo "$as_me: failed program was:" >&5
16157 cat "conftest.$ac_ext" >&5
16158 ac_cv_header_stdc=no
16159 fi
16160 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16161 fi
16162 fi
16163 fi
16164 echo "$as_me:16164: result: $ac_cv_header_stdc" >&5
16165 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16166 if test $ac_cv_header_stdc = yes; then
16167
16168 cat >>confdefs.h <<\EOF
16169 #define STDC_HEADERS 1
16170 EOF
16171
16172 fi
16173
16174 ac_header_dirent=no
16175 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16176   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16177 echo "$as_me:16177: checking for $ac_hdr that defines DIR" >&5
16178 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16179 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16180   echo $ECHO_N "(cached) $ECHO_C" >&6
16181 else
16182   cat >"conftest.$ac_ext" <<_ACEOF
16183 #line 16183 "configure"
16184 #include "confdefs.h"
16185 #include <sys/types.h>
16186 #include <$ac_hdr>
16187
16188 int
16189 main (void)
16190 {
16191 if ((DIR *) 0)
16192 return 0;
16193   ;
16194   return 0;
16195 }
16196 _ACEOF
16197 rm -f "conftest.$ac_objext"
16198 if { (eval echo "$as_me:16198: \"$ac_compile\"") >&5
16199   (eval $ac_compile) 2>&5
16200   ac_status=$?
16201   echo "$as_me:16201: \$? = $ac_status" >&5
16202   (exit "$ac_status"); } &&
16203          { ac_try='test -s "conftest.$ac_objext"'
16204   { (eval echo "$as_me:16204: \"$ac_try\"") >&5
16205   (eval $ac_try) 2>&5
16206   ac_status=$?
16207   echo "$as_me:16207: \$? = $ac_status" >&5
16208   (exit "$ac_status"); }; }; then
16209   eval "$as_ac_Header=yes"
16210 else
16211   echo "$as_me: failed program was:" >&5
16212 cat "conftest.$ac_ext" >&5
16213 eval "$as_ac_Header=no"
16214 fi
16215 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16216 fi
16217 echo "$as_me:16217: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16218 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16219 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16220   cat >>confdefs.h <<EOF
16221 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16222 EOF
16223
16224 ac_header_dirent=$ac_hdr; break
16225 fi
16226
16227 done
16228 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16229 if test $ac_header_dirent = dirent.h; then
16230   echo "$as_me:16230: checking for opendir in -ldir" >&5
16231 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16232 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16233   echo $ECHO_N "(cached) $ECHO_C" >&6
16234 else
16235   ac_check_lib_save_LIBS=$LIBS
16236 LIBS="-ldir  $LIBS"
16237 cat >"conftest.$ac_ext" <<_ACEOF
16238 #line 16238 "configure"
16239 #include "confdefs.h"
16240
16241 /* Override any gcc2 internal prototype to avoid an error.  */
16242 #ifdef __cplusplus
16243 extern "C"
16244 #endif
16245 /* We use char because int might match the return type of a gcc2
16246    builtin and then its argument prototype would still apply.  */
16247 char opendir ();
16248 int
16249 main (void)
16250 {
16251 opendir ();
16252   ;
16253   return 0;
16254 }
16255 _ACEOF
16256 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16257 if { (eval echo "$as_me:16257: \"$ac_link\"") >&5
16258   (eval $ac_link) 2>&5
16259   ac_status=$?
16260   echo "$as_me:16260: \$? = $ac_status" >&5
16261   (exit "$ac_status"); } &&
16262          { ac_try='test -s "conftest$ac_exeext"'
16263   { (eval echo "$as_me:16263: \"$ac_try\"") >&5
16264   (eval $ac_try) 2>&5
16265   ac_status=$?
16266   echo "$as_me:16266: \$? = $ac_status" >&5
16267   (exit "$ac_status"); }; }; then
16268   ac_cv_lib_dir_opendir=yes
16269 else
16270   echo "$as_me: failed program was:" >&5
16271 cat "conftest.$ac_ext" >&5
16272 ac_cv_lib_dir_opendir=no
16273 fi
16274 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16275 LIBS=$ac_check_lib_save_LIBS
16276 fi
16277 echo "$as_me:16277: result: $ac_cv_lib_dir_opendir" >&5
16278 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16279 if test "$ac_cv_lib_dir_opendir" = yes; then
16280   LIBS="$LIBS -ldir"
16281 fi
16282
16283 else
16284   echo "$as_me:16284: checking for opendir in -lx" >&5
16285 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16286 if test "${ac_cv_lib_x_opendir+set}" = set; then
16287   echo $ECHO_N "(cached) $ECHO_C" >&6
16288 else
16289   ac_check_lib_save_LIBS=$LIBS
16290 LIBS="-lx  $LIBS"
16291 cat >"conftest.$ac_ext" <<_ACEOF
16292 #line 16292 "configure"
16293 #include "confdefs.h"
16294
16295 /* Override any gcc2 internal prototype to avoid an error.  */
16296 #ifdef __cplusplus
16297 extern "C"
16298 #endif
16299 /* We use char because int might match the return type of a gcc2
16300    builtin and then its argument prototype would still apply.  */
16301 char opendir ();
16302 int
16303 main (void)
16304 {
16305 opendir ();
16306   ;
16307   return 0;
16308 }
16309 _ACEOF
16310 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16311 if { (eval echo "$as_me:16311: \"$ac_link\"") >&5
16312   (eval $ac_link) 2>&5
16313   ac_status=$?
16314   echo "$as_me:16314: \$? = $ac_status" >&5
16315   (exit "$ac_status"); } &&
16316          { ac_try='test -s "conftest$ac_exeext"'
16317   { (eval echo "$as_me:16317: \"$ac_try\"") >&5
16318   (eval $ac_try) 2>&5
16319   ac_status=$?
16320   echo "$as_me:16320: \$? = $ac_status" >&5
16321   (exit "$ac_status"); }; }; then
16322   ac_cv_lib_x_opendir=yes
16323 else
16324   echo "$as_me: failed program was:" >&5
16325 cat "conftest.$ac_ext" >&5
16326 ac_cv_lib_x_opendir=no
16327 fi
16328 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16329 LIBS=$ac_check_lib_save_LIBS
16330 fi
16331 echo "$as_me:16331: result: $ac_cv_lib_x_opendir" >&5
16332 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16333 if test "$ac_cv_lib_x_opendir" = yes; then
16334   LIBS="$LIBS -lx"
16335 fi
16336
16337 fi
16338
16339 echo "$as_me:16339: checking whether time.h and sys/time.h may both be included" >&5
16340 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16341 if test "${ac_cv_header_time+set}" = set; then
16342   echo $ECHO_N "(cached) $ECHO_C" >&6
16343 else
16344   cat >"conftest.$ac_ext" <<_ACEOF
16345 #line 16345 "configure"
16346 #include "confdefs.h"
16347 #include <sys/types.h>
16348 #include <sys/time.h>
16349 #include <time.h>
16350
16351 int
16352 main (void)
16353 {
16354 if ((struct tm *) 0)
16355 return 0;
16356   ;
16357   return 0;
16358 }
16359 _ACEOF
16360 rm -f "conftest.$ac_objext"
16361 if { (eval echo "$as_me:16361: \"$ac_compile\"") >&5
16362   (eval $ac_compile) 2>&5
16363   ac_status=$?
16364   echo "$as_me:16364: \$? = $ac_status" >&5
16365   (exit "$ac_status"); } &&
16366          { ac_try='test -s "conftest.$ac_objext"'
16367   { (eval echo "$as_me:16367: \"$ac_try\"") >&5
16368   (eval $ac_try) 2>&5
16369   ac_status=$?
16370   echo "$as_me:16370: \$? = $ac_status" >&5
16371   (exit "$ac_status"); }; }; then
16372   ac_cv_header_time=yes
16373 else
16374   echo "$as_me: failed program was:" >&5
16375 cat "conftest.$ac_ext" >&5
16376 ac_cv_header_time=no
16377 fi
16378 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16379 fi
16380 echo "$as_me:16380: result: $ac_cv_header_time" >&5
16381 echo "${ECHO_T}$ac_cv_header_time" >&6
16382 if test $ac_cv_header_time = yes; then
16383
16384 cat >>confdefs.h <<\EOF
16385 #define TIME_WITH_SYS_TIME 1
16386 EOF
16387
16388 fi
16389
16390 ###     checks for compiler characteristics
16391 ac_ext=c
16392 ac_cpp='$CPP $CPPFLAGS'
16393 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16394 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16395 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16396 ac_main_return="return"
16397
16398 echo "$as_me:16398: checking for an ANSI C-conforming const" >&5
16399 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16400 if test "${ac_cv_c_const+set}" = set; then
16401   echo $ECHO_N "(cached) $ECHO_C" >&6
16402 else
16403   cat >"conftest.$ac_ext" <<_ACEOF
16404 #line 16404 "configure"
16405 #include "confdefs.h"
16406
16407 int
16408 main (void)
16409 {
16410 /* FIXME: Include the comments suggested by Paul. */
16411 #ifndef __cplusplus
16412   /* Ultrix mips cc rejects this.  */
16413   typedef int charset[2];
16414   const charset x;
16415   /* SunOS 4.1.1 cc rejects this.  */
16416   char const *const *ccp;
16417   char **p;
16418   /* NEC SVR4.0.2 mips cc rejects this.  */
16419   struct point {int x, y;};
16420   static struct point const zero = {0,0};
16421   /* AIX XL C 1.02.0.0 rejects this.
16422      It does not let you subtract one const X* pointer from another in
16423      an arm of an if-expression whose if-part is not a constant
16424      expression */
16425   const char *g = "string";
16426   ccp = &g + (g ? g-g : 0);
16427   /* HPUX 7.0 cc rejects these. */
16428   ++ccp;
16429   p = (char**) ccp;
16430   ccp = (char const *const *) p;
16431   { /* SCO 3.2v4 cc rejects this.  */
16432     char *t;
16433     char const *s = 0 ? (char *) 0 : (char const *) 0;
16434
16435     *t++ = 0;
16436   }
16437   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16438     int x[] = {25, 17};
16439     const int *foo = &x[0];
16440     ++foo;
16441   }
16442   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16443     typedef const int *iptr;
16444     iptr p = 0;
16445     ++p;
16446   }
16447   { /* AIX XL C 1.02.0.0 rejects this saying
16448        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16449     struct s { int j; const int *ap[3]; };
16450     struct s *b; b->j = 5;
16451   }
16452   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16453     const int foo = 10;
16454   }
16455 #endif
16456
16457   ;
16458   return 0;
16459 }
16460 _ACEOF
16461 rm -f "conftest.$ac_objext"
16462 if { (eval echo "$as_me:16462: \"$ac_compile\"") >&5
16463   (eval $ac_compile) 2>&5
16464   ac_status=$?
16465   echo "$as_me:16465: \$? = $ac_status" >&5
16466   (exit "$ac_status"); } &&
16467          { ac_try='test -s "conftest.$ac_objext"'
16468   { (eval echo "$as_me:16468: \"$ac_try\"") >&5
16469   (eval $ac_try) 2>&5
16470   ac_status=$?
16471   echo "$as_me:16471: \$? = $ac_status" >&5
16472   (exit "$ac_status"); }; }; then
16473   ac_cv_c_const=yes
16474 else
16475   echo "$as_me: failed program was:" >&5
16476 cat "conftest.$ac_ext" >&5
16477 ac_cv_c_const=no
16478 fi
16479 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16480 fi
16481 echo "$as_me:16481: result: $ac_cv_c_const" >&5
16482 echo "${ECHO_T}$ac_cv_c_const" >&6
16483 if test $ac_cv_c_const = no; then
16484
16485 cat >>confdefs.h <<\EOF
16486 #define const
16487 EOF
16488
16489 fi
16490
16491 ###     Checks for external-data
16492
16493 echo "$as_me:16493: checking if data-only library module links" >&5
16494 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16495 if test "${cf_cv_link_dataonly+set}" = set; then
16496   echo $ECHO_N "(cached) $ECHO_C" >&6
16497 else
16498
16499         rm -f conftest.a
16500         cat >conftest.$ac_ext <<EOF
16501 #line 16501 "configure"
16502 int     testdata[3] = { 123, 456, 789 };
16503 EOF
16504         if { (eval echo "$as_me:16504: \"$ac_compile\"") >&5
16505   (eval $ac_compile) 2>&5
16506   ac_status=$?
16507   echo "$as_me:16507: \$? = $ac_status" >&5
16508   (exit "$ac_status"); } ; then
16509                 mv conftest.o data.o && \
16510                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16511         fi
16512         rm -f conftest.$ac_ext data.o
16513         cat >conftest.$ac_ext <<EOF
16514 #line 16514 "configure"
16515 int     testfunc(void)
16516 {
16517 #if defined(NeXT)
16518         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16519 #else
16520         extern int testdata[3];
16521         return testdata[0] == 123
16522            &&  testdata[1] == 456
16523            &&  testdata[2] == 789;
16524 #endif
16525 }
16526 EOF
16527         if { (eval echo "$as_me:16527: \"$ac_compile\"") >&5
16528   (eval $ac_compile) 2>&5
16529   ac_status=$?
16530   echo "$as_me:16530: \$? = $ac_status" >&5
16531   (exit "$ac_status"); }; then
16532                 mv conftest.o func.o && \
16533                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16534         fi
16535         rm -f conftest.$ac_ext func.o
16536         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16537         cf_saveLIBS="$LIBS"
16538         LIBS="conftest.a $LIBS"
16539         if test "$cross_compiling" = yes; then
16540   cf_cv_link_dataonly=unknown
16541 else
16542   cat >"conftest.$ac_ext" <<_ACEOF
16543 #line 16543 "configure"
16544 #include "confdefs.h"
16545
16546         int main(void)
16547         {
16548                 extern int testfunc();
16549                 ${cf_cv_main_return:-return} (!testfunc());
16550         }
16551
16552 _ACEOF
16553 rm -f "conftest$ac_exeext"
16554 if { (eval echo "$as_me:16554: \"$ac_link\"") >&5
16555   (eval $ac_link) 2>&5
16556   ac_status=$?
16557   echo "$as_me:16557: \$? = $ac_status" >&5
16558   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16559   { (eval echo "$as_me:16559: \"$ac_try\"") >&5
16560   (eval $ac_try) 2>&5
16561   ac_status=$?
16562   echo "$as_me:16562: \$? = $ac_status" >&5
16563   (exit "$ac_status"); }; }; then
16564   cf_cv_link_dataonly=yes
16565 else
16566   echo "$as_me: program exited with status $ac_status" >&5
16567 echo "$as_me: failed program was:" >&5
16568 cat "conftest.$ac_ext" >&5
16569 cf_cv_link_dataonly=no
16570 fi
16571 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16572 fi
16573         LIBS="$cf_saveLIBS"
16574
16575 fi
16576
16577 echo "$as_me:16577: result: $cf_cv_link_dataonly" >&5
16578 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16579
16580 if test "$cf_cv_link_dataonly" = no ; then
16581
16582 cat >>confdefs.h <<\EOF
16583 #define BROKEN_LINKER 1
16584 EOF
16585
16586         BROKEN_LINKER=1
16587 fi
16588
16589 ###     Checks for library functions.
16590
16591 for ac_header in \
16592 unistd.h \
16593
16594 do
16595 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16596 echo "$as_me:16596: checking for $ac_header" >&5
16597 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16598 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16599   echo $ECHO_N "(cached) $ECHO_C" >&6
16600 else
16601   cat >"conftest.$ac_ext" <<_ACEOF
16602 #line 16602 "configure"
16603 #include "confdefs.h"
16604 #include <$ac_header>
16605 _ACEOF
16606 if { (eval echo "$as_me:16606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16608   ac_status=$?
16609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16610   rm -f conftest.er1
16611   cat conftest.err >&5
16612   echo "$as_me:16612: \$? = $ac_status" >&5
16613   (exit "$ac_status"); } >/dev/null; then
16614   if test -s conftest.err; then
16615     ac_cpp_err=$ac_c_preproc_warn_flag
16616   else
16617     ac_cpp_err=
16618   fi
16619 else
16620   ac_cpp_err=yes
16621 fi
16622 if test -z "$ac_cpp_err"; then
16623   eval "$as_ac_Header=yes"
16624 else
16625   echo "$as_me: failed program was:" >&5
16626   cat "conftest.$ac_ext" >&5
16627   eval "$as_ac_Header=no"
16628 fi
16629 rm -f conftest.err "conftest.$ac_ext"
16630 fi
16631 echo "$as_me:16631: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16632 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16633 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16634   cat >>confdefs.h <<EOF
16635 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16636 EOF
16637
16638 fi
16639 done
16640
16641 echo "$as_me:16641: checking for working mkstemp" >&5
16642 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16643 if test "${cf_cv_func_mkstemp+set}" = set; then
16644   echo $ECHO_N "(cached) $ECHO_C" >&6
16645 else
16646
16647 rm -rf ./conftest*
16648 if test "$cross_compiling" = yes; then
16649   cf_cv_func_mkstemp=maybe
16650 else
16651   cat >"conftest.$ac_ext" <<_ACEOF
16652 #line 16652 "configure"
16653 #include "confdefs.h"
16654
16655 #include <sys/types.h>
16656 #ifdef HAVE_UNISTD_H
16657 #include <unistd.h>
16658 #endif
16659 #include <stdlib.h>
16660 #include <stdio.h>
16661 #include <string.h>
16662 #include <sys/stat.h>
16663 int main(void)
16664 {
16665         char *tmpl = "conftestXXXXXX";
16666         char name[2][80];
16667         int n;
16668         int result = 0;
16669         int fd;
16670         struct stat sb;
16671
16672         umask(077);
16673         for (n = 0; n < 2; ++n) {
16674                 strcpy(name[n], tmpl);
16675                 if ((fd = mkstemp(name[n])) >= 0) {
16676                         if (!strcmp(name[n], tmpl)
16677                          || stat(name[n], &sb) != 0
16678                          || (sb.st_mode & S_IFMT) != S_IFREG
16679                          || (sb.st_mode & 077) != 0) {
16680                                 result = 1;
16681                         }
16682                         close(fd);
16683                 }
16684         }
16685         if (result == 0
16686          && !strcmp(name[0], name[1]))
16687                 result = 1;
16688         ${cf_cv_main_return:-return}(result);
16689 }
16690
16691 _ACEOF
16692 rm -f "conftest$ac_exeext"
16693 if { (eval echo "$as_me:16693: \"$ac_link\"") >&5
16694   (eval $ac_link) 2>&5
16695   ac_status=$?
16696   echo "$as_me:16696: \$? = $ac_status" >&5
16697   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16698   { (eval echo "$as_me:16698: \"$ac_try\"") >&5
16699   (eval $ac_try) 2>&5
16700   ac_status=$?
16701   echo "$as_me:16701: \$? = $ac_status" >&5
16702   (exit "$ac_status"); }; }; then
16703   cf_cv_func_mkstemp=yes
16704
16705 else
16706   echo "$as_me: program exited with status $ac_status" >&5
16707 echo "$as_me: failed program was:" >&5
16708 cat "conftest.$ac_ext" >&5
16709 cf_cv_func_mkstemp=no
16710
16711 fi
16712 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16713 fi
16714
16715 fi
16716 echo "$as_me:16716: result: $cf_cv_func_mkstemp" >&5
16717 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16718 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16719         echo "$as_me:16719: checking for mkstemp" >&5
16720 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16721 if test "${ac_cv_func_mkstemp+set}" = set; then
16722   echo $ECHO_N "(cached) $ECHO_C" >&6
16723 else
16724   cat >"conftest.$ac_ext" <<_ACEOF
16725 #line 16725 "configure"
16726 #include "confdefs.h"
16727 #define mkstemp autoconf_temporary
16728 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16729 #undef mkstemp
16730
16731 #ifdef __cplusplus
16732 extern "C"
16733 #endif
16734
16735 /* We use char because int might match the return type of a gcc2
16736    builtin and then its argument prototype would still apply.  */
16737 char mkstemp (void);
16738
16739 int
16740 main (void)
16741 {
16742
16743 /* The GNU C library defines stubs for functions which it implements
16744     to always fail with ENOSYS.  Some functions are actually named
16745     something starting with __ and the normal name is an alias.  */
16746 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16747 #error found stub for mkstemp
16748 #endif
16749
16750         return mkstemp ();
16751   ;
16752   return 0;
16753 }
16754 _ACEOF
16755 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16756 if { (eval echo "$as_me:16756: \"$ac_link\"") >&5
16757   (eval $ac_link) 2>&5
16758   ac_status=$?
16759   echo "$as_me:16759: \$? = $ac_status" >&5
16760   (exit "$ac_status"); } &&
16761          { ac_try='test -s "conftest$ac_exeext"'
16762   { (eval echo "$as_me:16762: \"$ac_try\"") >&5
16763   (eval $ac_try) 2>&5
16764   ac_status=$?
16765   echo "$as_me:16765: \$? = $ac_status" >&5
16766   (exit "$ac_status"); }; }; then
16767   ac_cv_func_mkstemp=yes
16768 else
16769   echo "$as_me: failed program was:" >&5
16770 cat "conftest.$ac_ext" >&5
16771 ac_cv_func_mkstemp=no
16772 fi
16773 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16774 fi
16775 echo "$as_me:16775: result: $ac_cv_func_mkstemp" >&5
16776 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16777
16778 fi
16779 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16780
16781 cat >>confdefs.h <<\EOF
16782 #define HAVE_MKSTEMP 1
16783 EOF
16784
16785 fi
16786
16787 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16788         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16789         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16790 fi
16791
16792 cf_with_ada=yes
16793 if test "$cf_with_ada" != "no" ; then
16794
16795 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16796 do
16797
16798 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16799
16800         unset ac_cv_path_cf_TEMP_gnat
16801         unset cf_TEMP_gnat
16802         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16803 set dummy $cf_prog_gnat; ac_word=$2
16804 echo "$as_me:16804: checking for $ac_word" >&5
16805 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16806 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16807   echo $ECHO_N "(cached) $ECHO_C" >&6
16808 else
16809   case $cf_TEMP_gnat in
16810   [\\/]* | ?:[\\/]*)
16811   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16812   ;;
16813   *)
16814   ac_save_IFS=$IFS; IFS=$ac_path_separator
16815 ac_dummy="$PATH"
16816 for ac_dir in $ac_dummy; do
16817   IFS=$ac_save_IFS
16818   test -z "$ac_dir" && ac_dir=.
16819   if $as_executable_p "$ac_dir/$ac_word"; then
16820    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16821    echo "$as_me:16821: found $ac_dir/$ac_word" >&5
16822    break
16823 fi
16824 done
16825
16826   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16827   ;;
16828 esac
16829 fi
16830 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16831
16832 if test -n "$cf_TEMP_gnat"; then
16833   echo "$as_me:16833: result: $cf_TEMP_gnat" >&5
16834 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16835 else
16836   echo "$as_me:16836: result: no" >&5
16837 echo "${ECHO_T}no" >&6
16838 fi
16839
16840         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
16841
16842         if test "x$cf_TEMP_gnat" != xno; then
16843                 unset cf_cv_gnat_version
16844                 unset cf_TEMP_gnat
16845
16846 echo "$as_me:16846: checking for $cf_prog_gnat version" >&5
16847 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16848 if test "${cf_cv_gnat_version+set}" = set; then
16849   echo $ECHO_N "(cached) $ECHO_C" >&6
16850 else
16851
16852 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16853         grep '[0-9].[0-9][0-9]*' |\
16854         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16855
16856 fi
16857 echo "$as_me:16857: result: $cf_cv_gnat_version" >&5
16858 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16859 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16860 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16861
16862         fi
16863         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
16864
16865         unset cf_TEMP_gnat
16866         unset cf_cv_gnat_version
16867         unset ac_cv_path_cf_TEMP_gnat
16868 done
16869
16870 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16871         cf_ada_make=
16872         cf_cv_prog_gnat_correct=no
16873 else
16874         cf_ada_make=gnatmake
16875         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16876                 # gprconfig is newer than gnatmake; we can continue...
16877                 cf_ada_config="##"
16878         else
16879                 rm -rf ./conftest* ./*~conftest*
16880                 if mkdir conftest.src
16881                 then
16882                         cf_ada_config=""
16883                         cd conftest.src
16884                         for cf_gprconfig in Ada C
16885                         do
16886                                 echo "$as_me:16886: checking for gprconfig name for $cf_gprconfig" >&5
16887 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16888                                 if test "$cf_gprconfig" = C
16889                                 then
16890                                         for cf_gprconfig_param in \
16891                                                 "$cf_gprconfig,,,,GNATGCC" \
16892                                                 "$cf_gprconfig,,,,GCC" \
16893                                                 "$cf_gprconfig"
16894                                         do
16895                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16896                                                 test -n "$cf_gprconfig_value" && break
16897                                         done
16898                                 else
16899                                         cf_gprconfig_param=$cf_gprconfig
16900                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16901                                 fi
16902                                 if test -n "$cf_gprconfig_value"
16903                                 then
16904                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
16905                                         echo "$as_me:16905: result: $cf_gprconfig_value" >&5
16906 echo "${ECHO_T}$cf_gprconfig_value" >&6
16907                                 else
16908                                         echo "$as_me:16908: result: missing" >&5
16909 echo "${ECHO_T}missing" >&6
16910                                         cf_ada_config="#"
16911                                         break
16912                                 fi
16913                         done
16914                         cd ..
16915                         rm -rf ./conftest* ./*~conftest*
16916                 fi
16917         fi
16918         if test "x$cf_ada_config" != "x#"
16919         then
16920
16921 echo "$as_me:16921: checking for gnat version" >&5
16922 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
16923 if test "${cf_cv_gnat_version+set}" = set; then
16924   echo $ECHO_N "(cached) $ECHO_C" >&6
16925 else
16926
16927 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
16928         grep '[0-9].[0-9][0-9]*' |\
16929         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16930
16931 fi
16932 echo "$as_me:16932: result: $cf_cv_gnat_version" >&5
16933 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16934 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16935
16936 case "$cf_cv_gnat_version" in
16937 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
16938         cf_cv_prog_gnat_correct=yes
16939         ;;
16940 (*)
16941         { echo "$as_me:16941: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
16942 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
16943         cf_cv_prog_gnat_correct=no
16944         ;;
16945 esac
16946
16947                 # Extract the first word of "m4", so it can be a program name with args.
16948 set dummy m4; ac_word=$2
16949 echo "$as_me:16949: checking for $ac_word" >&5
16950 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16951 if test "${ac_cv_prog_M4_exists+set}" = set; then
16952   echo $ECHO_N "(cached) $ECHO_C" >&6
16953 else
16954   if test -n "$M4_exists"; then
16955   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
16956 else
16957   ac_save_IFS=$IFS; IFS=$ac_path_separator
16958 ac_dummy="$PATH"
16959 for ac_dir in $ac_dummy; do
16960   IFS=$ac_save_IFS
16961   test -z "$ac_dir" && ac_dir=.
16962   $as_executable_p "$ac_dir/$ac_word" || continue
16963 ac_cv_prog_M4_exists="yes"
16964 echo "$as_me:16964: found $ac_dir/$ac_word" >&5
16965 break
16966 done
16967
16968   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
16969 fi
16970 fi
16971 M4_exists=$ac_cv_prog_M4_exists
16972 if test -n "$M4_exists"; then
16973   echo "$as_me:16973: result: $M4_exists" >&5
16974 echo "${ECHO_T}$M4_exists" >&6
16975 else
16976   echo "$as_me:16976: result: no" >&5
16977 echo "${ECHO_T}no" >&6
16978 fi
16979
16980                 if test "$ac_cv_prog_M4_exists" = no; then
16981                         cf_cv_prog_gnat_correct=no
16982                         { echo "$as_me:16982: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
16983 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
16984                 fi
16985                 if test "$cf_cv_prog_gnat_correct" = yes; then
16986                         echo "$as_me:16986: checking if GNAT works" >&5
16987 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
16988
16989 rm -rf ./conftest* ./*~conftest*
16990 cat >>conftest.ads <<CF_EOF
16991 procedure conftest;
16992 CF_EOF
16993 cat >>conftest.adb <<CF_EOF
16994 with Text_IO;
16995 with GNAT.OS_Lib;
16996 procedure conftest is
16997 begin
16998    Text_IO.Put ("Hello World");
16999    Text_IO.New_Line;
17000    GNAT.OS_Lib.OS_Exit (0);
17001 end conftest;
17002 CF_EOF
17003 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17004    if ( ./conftest 1>&5 2>&1 ) ; then
17005       cf_cv_prog_gnat_correct=yes
17006    else
17007       cf_cv_prog_gnat_correct=no
17008    fi
17009 else
17010    cf_cv_prog_gnat_correct=no
17011 fi
17012 rm -rf ./conftest* ./*~conftest*
17013
17014                         echo "$as_me:17014: result: $cf_cv_prog_gnat_correct" >&5
17015 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17016                 fi
17017         else
17018                 cf_cv_prog_gnat_correct=no
17019         fi
17020 fi
17021
17022         if test "$cf_cv_prog_gnat_correct" = yes; then
17023
17024         echo "$as_me:17024: checking optimization options for ADAFLAGS" >&5
17025 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17026         case "$CFLAGS" in
17027         (*-g*)
17028
17029         ADAFLAGS="$ADAFLAGS -g"
17030
17031                 ;;
17032         esac
17033         case "$CFLAGS" in
17034         (*-O*)
17035                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17036
17037         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17038
17039                 ;;
17040         esac
17041         echo "$as_me:17041: result: $ADAFLAGS" >&5
17042 echo "${ECHO_T}$ADAFLAGS" >&6
17043
17044 echo "$as_me:17044: checking if GNATPREP supports -T option" >&5
17045 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17046 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17047   echo $ECHO_N "(cached) $ECHO_C" >&6
17048 else
17049
17050 cf_cv_gnatprep_opt_t=no
17051 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17052
17053 fi
17054 echo "$as_me:17054: result: $cf_cv_gnatprep_opt_t" >&5
17055 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17056 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17057
17058 echo "$as_me:17058: checking if GNAT supports generics" >&5
17059 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17060 case "$cf_cv_gnat_version" in
17061 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17062         cf_gnat_generics=yes
17063         ;;
17064 (*)
17065         cf_gnat_generics=no
17066         ;;
17067 esac
17068 echo "$as_me:17068: result: $cf_gnat_generics" >&5
17069 echo "${ECHO_T}$cf_gnat_generics" >&6
17070
17071 if test "$cf_gnat_generics" = yes
17072 then
17073         cf_compile_generics=generics
17074         cf_generic_objects="\${GENOBJS}"
17075 else
17076         cf_compile_generics=
17077         cf_generic_objects=
17078 fi
17079
17080 echo "$as_me:17080: checking if GNAT supports SIGINT" >&5
17081 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17082 if test "${cf_cv_gnat_sigint+set}" = set; then
17083   echo $ECHO_N "(cached) $ECHO_C" >&6
17084 else
17085
17086 rm -rf ./conftest* ./*~conftest*
17087 cat >>conftest.ads <<CF_EOF
17088 with Ada.Interrupts.Names;
17089
17090 package ConfTest is
17091
17092    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17093    pragma Unreserve_All_Interrupts;
17094    pragma Warnings (On);
17095
17096    protected Process is
17097       procedure Stop;
17098       function Continue return Boolean;
17099       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17100    private
17101       Done : Boolean := False;
17102    end Process;
17103
17104 end ConfTest;
17105 CF_EOF
17106 cat >>conftest.adb <<CF_EOF
17107 package body ConfTest is
17108    protected body Process is
17109       procedure Stop is
17110       begin
17111          Done := True;
17112       end Stop;
17113       function Continue return Boolean is
17114       begin
17115          return not Done;
17116       end Continue;
17117    end Process;
17118 end ConfTest;
17119 CF_EOF
17120 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17121       cf_cv_gnat_sigint=yes
17122 else
17123    cf_cv_gnat_sigint=no
17124 fi
17125 rm -rf ./conftest* ./*~conftest*
17126
17127 fi
17128 echo "$as_me:17128: result: $cf_cv_gnat_sigint" >&5
17129 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17130
17131 if test "$cf_cv_gnat_sigint" = yes ; then
17132         USE_GNAT_SIGINT=""
17133 else
17134         USE_GNAT_SIGINT="#"
17135 fi
17136
17137 cf_gnat_libraries=no
17138 cf_gnat_projects=no
17139
17140 if test "$enable_gnat_projects" != no ; then
17141 echo "$as_me:17141: checking if GNAT supports project files" >&5
17142 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17143 case "$cf_cv_gnat_version" in
17144 (3.[0-9]*)
17145         ;;
17146 (*)
17147         case "$cf_cv_system_name" in
17148         (cygwin*|msys*)
17149                 ;;
17150         (*)
17151                 rm -rf ./conftest* ./*~conftest*
17152                 if mkdir conftest.src conftest.bin conftest.lib
17153                 then
17154                         cd conftest.src
17155                         rm -rf ./conftest* ./*~conftest*
17156                         cat >>library.gpr <<CF_EOF
17157 project Library is
17158   Kind := External ("LIB_KIND");
17159   for Library_Name use "ConfTest";
17160   for Object_Dir use ".";
17161   for Library_ALI_Dir use External("LIBRARY_DIR");
17162   for Library_Version use External ("SONAME");
17163   for Library_Kind use Kind;
17164   for Library_Dir use External("BUILD_DIR");
17165   Source_Dir := External ("SOURCE_DIR");
17166   for Source_Dirs use (Source_Dir);
17167 end Library;
17168 CF_EOF
17169                         cat >>confpackage.ads <<CF_EOF
17170 package ConfPackage is
17171    procedure conftest;
17172 end ConfPackage;
17173 CF_EOF
17174                         cat >>confpackage.adb <<CF_EOF
17175 with Text_IO;
17176 package body ConfPackage is
17177    procedure conftest is
17178    begin
17179       Text_IO.Put ("Hello World");
17180       Text_IO.New_Line;
17181    end conftest;
17182 end ConfPackage;
17183 CF_EOF
17184                         if ( "$cf_ada_make" $ADAFLAGS \
17185                                         -Plibrary.gpr \
17186                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17187                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17188                                         -XSOURCE_DIR="`pwd`" \
17189                                         -XSONAME=libConfTest.so.1 \
17190                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17191                                 cf_gnat_projects=yes
17192                         fi
17193                         cd ..
17194                 fi
17195                 if test -f conftest.lib/confpackage.ali
17196                 then
17197                         cf_gnat_libraries=yes
17198                 fi
17199                 rm -rf ./conftest* ./*~conftest*
17200                 ;;
17201         esac
17202         ;;
17203 esac
17204 echo "$as_me:17204: result: $cf_gnat_projects" >&5
17205 echo "${ECHO_T}$cf_gnat_projects" >&6
17206 fi # enable_gnat_projects
17207
17208 if test "$cf_gnat_projects" = yes
17209 then
17210         echo "$as_me:17210: checking if GNAT supports libraries" >&5
17211 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17212         echo "$as_me:17212: result: $cf_gnat_libraries" >&5
17213 echo "${ECHO_T}$cf_gnat_libraries" >&6
17214 fi
17215
17216 USE_OLD_MAKERULES=""
17217 USE_GNAT_PROJECTS="#"
17218 USE_GNAT_MAKE_GPR="#"
17219 USE_GNAT_GPRBUILD="#"
17220
17221 if test "$cf_gnat_projects" = yes
17222 then
17223         USE_OLD_MAKERULES="#"
17224         USE_GNAT_PROJECTS=""
17225         if test "$cf_cv_VERSION_GPRBUILD" != no
17226         then
17227                 USE_GNAT_GPRBUILD=""
17228         elif test "$cf_cv_VERSION_GNATMAKE" != no
17229         then
17230                 USE_GNAT_MAKE_GPR=""
17231         else
17232                 { echo "$as_me:17232: WARNING: use old makefile rules since tools are missing" >&5
17233 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17234         fi
17235 fi
17236
17237 if test "$cf_gnat_libraries" = yes
17238 then
17239         USE_GNAT_LIBRARIES=""
17240 else
17241         USE_GNAT_LIBRARIES="#"
17242 fi
17243
17244 echo "$as_me:17244: checking for ada-compiler" >&5
17245 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17246
17247 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17248 if test "${with_ada_compiler+set}" = set; then
17249   withval="$with_ada_compiler"
17250   cf_ada_compiler=$withval
17251 else
17252   cf_ada_compiler=gnatmake
17253 fi;
17254
17255 echo "$as_me:17255: result: $cf_ada_compiler" >&5
17256 echo "${ECHO_T}$cf_ada_compiler" >&6
17257
17258                 cf_ada_package=terminal_interface
17259
17260 echo "$as_me:17260: checking for ada-include" >&5
17261 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17262
17263 # Check whether --with-ada-include or --without-ada-include was given.
17264 if test "${with_ada_include+set}" = set; then
17265   withval="$with_ada_include"
17266
17267 else
17268   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17269 fi; if test -n "$prefix/share/ada/adainclude" ; then
17270
17271 if test "x$prefix" != xNONE; then
17272         cf_path_syntax="$prefix"
17273 else
17274         cf_path_syntax="$ac_default_prefix"
17275 fi
17276
17277 case ".$withval" in
17278 (.\$\(*\)*|.\'*\'*)
17279         ;;
17280 (..|./*|.\\*)
17281         ;;
17282 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17283         ;;
17284 (.\$\{*prefix\}*|.\$\{*dir\}*)
17285         eval withval="$withval"
17286         case ".$withval" in
17287         (.NONE/*)
17288                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17289                 ;;
17290         esac
17291         ;;
17292 (.no|.NONE/*)
17293         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17294         ;;
17295 (*)
17296         { { echo "$as_me:17296: error: expected a pathname, not \"$withval\"" >&5
17297 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17298    { (exit 1); exit 1; }; }
17299         ;;
17300 esac
17301
17302 fi
17303 eval ADA_INCLUDE="$withval"
17304
17305 echo "$as_me:17305: result: $ADA_INCLUDE" >&5
17306 echo "${ECHO_T}$ADA_INCLUDE" >&6
17307
17308 echo "$as_me:17308: checking for ada-objects" >&5
17309 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17310
17311 # Check whether --with-ada-objects or --without-ada-objects was given.
17312 if test "${with_ada_objects+set}" = set; then
17313   withval="$with_ada_objects"
17314
17315 else
17316   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17317 fi; if test -n "$prefix/lib/ada/adalib" ; then
17318
17319 if test "x$prefix" != xNONE; then
17320         cf_path_syntax="$prefix"
17321 else
17322         cf_path_syntax="$ac_default_prefix"
17323 fi
17324
17325 case ".$withval" in
17326 (.\$\(*\)*|.\'*\'*)
17327         ;;
17328 (..|./*|.\\*)
17329         ;;
17330 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17331         ;;
17332 (.\$\{*prefix\}*|.\$\{*dir\}*)
17333         eval withval="$withval"
17334         case ".$withval" in
17335         (.NONE/*)
17336                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17337                 ;;
17338         esac
17339         ;;
17340 (.no|.NONE/*)
17341         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17342         ;;
17343 (*)
17344         { { echo "$as_me:17344: error: expected a pathname, not \"$withval\"" >&5
17345 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17346    { (exit 1); exit 1; }; }
17347         ;;
17348 esac
17349
17350 fi
17351 eval ADA_OBJECTS="$withval"
17352
17353 echo "$as_me:17353: result: $ADA_OBJECTS" >&5
17354 echo "${ECHO_T}$ADA_OBJECTS" >&6
17355
17356 echo "$as_me:17356: checking if an Ada95 shared-library should be built" >&5
17357 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17358
17359 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17360 if test "${with_ada_sharedlib+set}" = set; then
17361   withval="$with_ada_sharedlib"
17362   with_ada_sharedlib=$withval
17363 else
17364   with_ada_sharedlib=no
17365 fi;
17366 echo "$as_me:17366: result: $with_ada_sharedlib" >&5
17367 echo "${ECHO_T}$with_ada_sharedlib" >&6
17368
17369 if test "x$with_ada_sharedlib" != xno
17370 then
17371         if test "x$cf_gnat_projects" != xyes
17372         then
17373                 { echo "$as_me:17373: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17374 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17375                 with_ada_sharedlib=no
17376         fi
17377 fi
17378
17379 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17380 MAKE_ADA_SHAREDLIB="#"
17381
17382 if test "x$with_ada_sharedlib" != xno
17383 then
17384         MAKE_ADA_SHAREDLIB=
17385         if test "x$with_ada_sharedlib" != xyes
17386         then
17387                 ADA_SHAREDLIB="$with_ada_sharedlib"
17388         fi
17389 fi
17390
17391                 # allow the Ada binding to be renamed
17392
17393 echo "$as_me:17393: checking for ada-libname" >&5
17394 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17395
17396 # Check whether --with-ada-libname or --without-ada-libname was given.
17397 if test "${with_ada_libname+set}" = set; then
17398   withval="$with_ada_libname"
17399   ADA_LIBNAME=$withval
17400 else
17401   ADA_LIBNAME=AdaCurses
17402 fi;
17403 case "x$ADA_LIBNAME" in
17404 (x|xyes|xno)
17405         ADA_LIBNAME=AdaCurses
17406         ;;
17407 esac
17408
17409 echo "$as_me:17409: result: $ADA_LIBNAME" >&5
17410 echo "${ECHO_T}$ADA_LIBNAME" >&6
17411
17412         else
17413                 { { echo "$as_me:17413: error: No usable Ada compiler found" >&5
17414 echo "$as_me: error: No usable Ada compiler found" >&2;}
17415    { (exit 1); exit 1; }; }
17416         fi
17417 else
17418         { { echo "$as_me:17418: error: The Ada compiler is needed for this package" >&5
17419 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17420    { (exit 1); exit 1; }; }
17421 fi
17422
17423 ################################################################################
17424
17425 # not needed
17426 TINFO_LDFLAGS2=
17427
17428 TINFO_LIBS=
17429
17430 ### Construct the list of include-directories to be generated
17431
17432 if test "$srcdir" != "."; then
17433         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17434 fi
17435 CPPFLAGS="-I../include $CPPFLAGS"
17436 if test "$srcdir" != "."; then
17437         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17438 fi
17439 CPPFLAGS="-I. $CPPFLAGS"
17440
17441 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17442 if test "$srcdir" != "."; then
17443         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17444 fi
17445 if test "$GCC" != yes; then
17446         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17447 elif test "$includedir" != "/usr/include"; then
17448         if test "$includedir" = '${prefix}/include' ; then
17449                 if test x$prefix != x/usr ; then
17450                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17451                 fi
17452         else
17453                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17454         fi
17455 fi
17456
17457 ### Build up pieces for makefile rules
17458 echo "$as_me:17458: checking default library suffix" >&5
17459 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17460
17461         case $DFT_LWR_MODEL in
17462         (libtool) DFT_ARG_SUFFIX=''   ;;
17463         (normal)  DFT_ARG_SUFFIX=''   ;;
17464         (debug)   DFT_ARG_SUFFIX='_g' ;;
17465         (profile) DFT_ARG_SUFFIX='_p' ;;
17466         (shared)  DFT_ARG_SUFFIX=''   ;;
17467         esac
17468         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17469 echo "$as_me:17469: result: $DFT_ARG_SUFFIX" >&5
17470 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17471
17472 echo "$as_me:17472: checking default library-dependency suffix" >&5
17473 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17474
17475         case X$DFT_LWR_MODEL in
17476         (Xlibtool)
17477                 DFT_LIB_SUFFIX='.la'
17478                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17479                 ;;
17480         (Xdebug)
17481                 case "$cf_cv_system_name" in
17482                 (*-msvc*)
17483                         DFT_LIB_SUFFIX='_g.lib'
17484                         ;;
17485                 (*)
17486                         DFT_LIB_SUFFIX='_g.a'
17487                         ;;
17488                 esac
17489                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17490                 ;;
17491         (Xprofile)
17492                 case "$cf_cv_system_name" in
17493                 (*-msvc*)
17494                         DFT_LIB_SUFFIX='_p.lib'
17495                         ;;
17496                 (*)
17497                         DFT_LIB_SUFFIX='_p.a'
17498                         ;;
17499                 esac
17500                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17501                 ;;
17502         (Xshared)
17503                 case "$cf_cv_system_name" in
17504                 (aix[5-7]*)
17505                         DFT_LIB_SUFFIX='.so'
17506                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17507                         ;;
17508                 (*-msvc*)
17509                         DFT_LIB_SUFFIX='.dll'
17510                         DFT_DEP_SUFFIX='.dll.lib'
17511                         ;;
17512                 (cygwin*|msys*|mingw*)
17513                         DFT_LIB_SUFFIX='.dll'
17514                         DFT_DEP_SUFFIX='.dll.a'
17515                         ;;
17516                 (darwin*)
17517                         DFT_LIB_SUFFIX='.dylib'
17518                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17519                         ;;
17520                 (hpux*)
17521                         case "$target" in
17522                         (ia64*)
17523                                 DFT_LIB_SUFFIX='.so'
17524                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17525                                 ;;
17526                         (*)
17527                                 DFT_LIB_SUFFIX='.sl'
17528                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17529                                 ;;
17530                         esac
17531                         ;;
17532                 (*)
17533                         DFT_LIB_SUFFIX='.so'
17534                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17535                         ;;
17536                 esac
17537                 ;;
17538         (*)
17539                 case "$target" in
17540                 (*-msvc*)
17541                         DFT_LIB_SUFFIX='.lib'
17542                         ;;
17543                 (*)
17544                         DFT_LIB_SUFFIX='.a'
17545                         ;;
17546                 esac
17547                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17548                 ;;
17549         esac
17550         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17551         then
17552                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17553                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17554         fi
17555 echo "$as_me:17555: result: $DFT_DEP_SUFFIX" >&5
17556 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17557
17558 echo "$as_me:17558: checking default object directory" >&5
17559 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17560
17561         case $DFT_LWR_MODEL in
17562         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17563         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17564         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17565         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17566         (shared)
17567                 case "$cf_cv_system_name" in
17568                 (cygwin|msys)
17569                         DFT_OBJ_SUBDIR='objects' ;;
17570                 (*)
17571                         DFT_OBJ_SUBDIR='obj_s' ;;
17572                 esac
17573         esac
17574 echo "$as_me:17574: result: $DFT_OBJ_SUBDIR" >&5
17575 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17576
17577 ### Set up low-level terminfo dependencies for makefiles.
17578
17579 if test "$DFT_LWR_MODEL" = shared ; then
17580         case $cf_cv_system_name in
17581         (cygwin*)
17582                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17583                 ;;
17584         (msys*)
17585                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17586                 ;;
17587         esac
17588 fi
17589
17590 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17591
17592 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17593
17594 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17595
17596 ### Construct the list of subdirectories for which we'll customize makefiles
17597 ### with the appropriate compile-rules.
17598
17599 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17600
17601 cat >>confdefs.h <<EOF
17602 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17603 EOF
17604
17605 ################################################################################
17606
17607 TEST_ARG2=
17608
17609 TEST_LIBS2=
17610
17611 NCURSES_SHLIB2="sh -c"
17612
17613 ADA_SUBDIRS="include gen src doc"
17614 if test "x$cf_with_tests" != "xno" ; then
17615         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17616 fi
17617 for cf_dir in $ADA_SUBDIRS
17618 do
17619         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17620 done
17621
17622 NCURSES_TREE="#"
17623
17624 EXTERNAL_TREE=
17625
17626 # match layout used by make-tar.sh
17627 ADAHTML_DIR=../doc/ada
17628
17629 if test "x$cross_compiling" = xyes ; then
17630         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17631 else
17632         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17633 fi
17634
17635 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"
17636 ac_config_commands="$ac_config_commands default"
17637 cat >confcache <<\_ACEOF
17638 # This file is a shell script that caches the results of configure
17639 # tests run on this system so they can be shared between configure
17640 # scripts and configure runs, see configure's option --config-cache.
17641 # It is not useful on other systems.  If it contains results you don't
17642 # want to keep, you may remove or edit it.
17643 #
17644 # config.status only pays attention to the cache file if you give it
17645 # the --recheck option to rerun configure.
17646 #
17647 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17648 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17649 # following values.
17650
17651 _ACEOF
17652
17653 # The following way of writing the cache mishandles newlines in values,
17654 # but we know of no workaround that is simple, portable, and efficient.
17655 # So, don't put newlines in cache variables' values.
17656 # Ultrix sh set writes to stderr and can't be redirected directly,
17657 # and sets the high bit in the cache file unless we assign to the vars.
17658 {
17659   (set) 2>&1 |
17660     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17661     *ac_space=\ *)
17662       # `set' does not quote correctly, so add quotes (double-quote
17663       # substitution turns \\\\ into \\, and sed turns \\ into \).
17664       sed -n \
17665         "s/'/'\\\\''/g;
17666           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17667       ;;
17668     *)
17669       # `set' quotes correctly as required by POSIX, so do not add quotes.
17670       sed -n \
17671         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17672       ;;
17673     esac;
17674 } |
17675   sed '
17676      t clear
17677      : clear
17678      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17679      t end
17680      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17681      : end' >>confcache
17682 if cmp -s $cache_file confcache; then :; else
17683   if test -w $cache_file; then
17684     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17685     cat confcache >$cache_file
17686   else
17687     echo "not updating unwritable cache $cache_file"
17688   fi
17689 fi
17690 rm -f confcache
17691
17692 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17693 # Let make expand exec_prefix.
17694 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17695
17696 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17697 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17698 # trailing colons and then remove the whole line if VPATH becomes empty
17699 # (actually we leave an empty line to preserve line numbers).
17700 if test "x$srcdir" = x.; then
17701   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17702 s/:*\$(srcdir):*/:/;
17703 s/:*\${srcdir}:*/:/;
17704 s/:*@srcdir@:*/:/;
17705 s/^\([^=]*=[    ]*\):*/\1/;
17706 s/:*$//;
17707 s/^[^=]*=[      ]*$//;
17708 }'
17709 fi
17710
17711 DEFS=-DHAVE_CONFIG_H
17712
17713 : "${CONFIG_STATUS=./config.status}"
17714 ac_clean_files_save=$ac_clean_files
17715 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17716 { echo "$as_me:17716: creating $CONFIG_STATUS" >&5
17717 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17718 cat >"$CONFIG_STATUS" <<_ACEOF
17719 #! $SHELL
17720 # Generated automatically by configure.
17721 # Run this file to recreate the current configuration.
17722 # Compiler output produced by configure, useful for debugging
17723 # configure, is in config.log if it exists.
17724
17725 debug=false
17726 SHELL=\${CONFIG_SHELL-$SHELL}
17727 ac_cs_invocation="\$0 \$@"
17728
17729 CLICOLOR_FORCE= GREP_OPTIONS=
17730 unset CLICOLOR_FORCE GREP_OPTIONS
17731 _ACEOF
17732
17733 cat >>"$CONFIG_STATUS" <<\_ACEOF
17734 # Be Bourne compatible
17735 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17736   emulate sh
17737   NULLCMD=:
17738 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17739   set -o posix
17740 fi
17741
17742 # Name of the executable.
17743 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17744
17745 if expr a : '\(a\)' >/dev/null 2>&1; then
17746   as_expr=expr
17747 else
17748   as_expr=false
17749 fi
17750
17751 rm -f conf$$ conf$$.exe conf$$.file
17752 echo >conf$$.file
17753 if ln -s conf$$.file conf$$ 2>/dev/null; then
17754   # We could just check for DJGPP; but this test a) works b) is more generic
17755   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17756   if test -f conf$$.exe; then
17757     # Don't use ln at all; we don't have any links
17758     as_ln_s='cp -p'
17759   else
17760     as_ln_s='ln -s'
17761   fi
17762 elif ln conf$$.file conf$$ 2>/dev/null; then
17763   as_ln_s=ln
17764 else
17765   as_ln_s='cp -p'
17766 fi
17767 rm -f conf$$ conf$$.exe conf$$.file
17768
17769 as_executable_p="test -f"
17770
17771 # Support unset when possible.
17772 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17773   as_unset="unset"
17774 else
17775   as_unset="false"
17776 fi
17777
17778 # NLS nuisances.
17779 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17780 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17781 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17782 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17783 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17784 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17785 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17786 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17787
17788 # IFS
17789 # We need space, tab and new line, in precisely that order.
17790 as_nl='
17791 '
17792 IFS="   $as_nl"
17793
17794 # CDPATH.
17795 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17796
17797 exec 6>&1
17798
17799 _ACEOF
17800
17801 # Files that config.status was made for.
17802 if test -n "$ac_config_files"; then
17803   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
17804 fi
17805
17806 if test -n "$ac_config_headers"; then
17807   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
17808 fi
17809
17810 if test -n "$ac_config_links"; then
17811   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
17812 fi
17813
17814 if test -n "$ac_config_commands"; then
17815   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
17816 fi
17817
17818 cat >>"$CONFIG_STATUS" <<\EOF
17819
17820 ac_cs_usage="\
17821 \`$as_me' instantiates files from templates according to the
17822 current configuration.
17823
17824 Usage: $0 [OPTIONS] [FILE]...
17825
17826   -h, --help       print this help, then exit
17827   -V, --version    print version number, then exit
17828   -d, --debug      don't remove temporary files
17829       --recheck    update $as_me by reconfiguring in the same conditions
17830   --file=FILE[:TEMPLATE]
17831                    instantiate the configuration file FILE
17832   --header=FILE[:TEMPLATE]
17833                    instantiate the configuration header FILE
17834
17835 Configuration files:
17836 $config_files
17837
17838 Configuration headers:
17839 $config_headers
17840
17841 Configuration commands:
17842 $config_commands
17843
17844 Report bugs to <dickey@invisible-island.net>."
17845 EOF
17846
17847 cat >>"$CONFIG_STATUS" <<EOF
17848 ac_cs_version="\\
17849 config.status
17850 configured by $0, generated by GNU Autoconf 2.52.20210105,
17851   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17852
17853 Copyright 2003-2020,2021        Thomas E. Dickey
17854 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17855 Free Software Foundation, Inc.
17856 This config.status script is free software; the Free Software Foundation
17857 gives unlimited permission to copy, distribute and modify it."
17858 srcdir="$srcdir"
17859 INSTALL="$INSTALL"
17860 EOF
17861
17862 cat >>"$CONFIG_STATUS" <<\EOF
17863 # If no file are specified by the user, then we need to provide default
17864 # value.  By we need to know if files were specified by the user.
17865 ac_need_defaults=:
17866 while test $# != 0
17867 do
17868   case $1 in
17869   --*=*)
17870     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17871     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17872     shift
17873     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17874     shift
17875     ;;
17876   -*);;
17877   *) # This is not an option, so the user has probably given explicit
17878      # arguments.
17879      ac_need_defaults=false;;
17880   esac
17881
17882   case $1 in
17883   # Handling of the options.
17884 EOF
17885 cat >>"$CONFIG_STATUS" <<EOF
17886   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17887     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17888     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17889 EOF
17890 cat >>"$CONFIG_STATUS" <<\EOF
17891   --version | --vers* | -V )
17892     echo "$ac_cs_version"; exit 0 ;;
17893   --he | --h)
17894     # Conflict between --help and --header
17895     { { echo "$as_me:17895: error: ambiguous option: $1
17896 Try \`$0 --help' for more information." >&5
17897 echo "$as_me: error: ambiguous option: $1
17898 Try \`$0 --help' for more information." >&2;}
17899    { (exit 1); exit 1; }; };;
17900   --help | --hel | -h )
17901     echo "$ac_cs_usage"; exit 0 ;;
17902   --debug | --d* | -d )
17903     debug=: ;;
17904   --file | --fil | --fi | --f )
17905     shift
17906     CONFIG_FILES="$CONFIG_FILES $1"
17907     ac_need_defaults=false;;
17908   --header | --heade | --head | --hea )
17909     shift
17910     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17911     ac_need_defaults=false;;
17912
17913   # This is an error.
17914   -*) { { echo "$as_me:17914: error: unrecognized option: $1
17915 Try \`$0 --help' for more information." >&5
17916 echo "$as_me: error: unrecognized option: $1
17917 Try \`$0 --help' for more information." >&2;}
17918    { (exit 1); exit 1; }; } ;;
17919
17920   *) ac_config_targets="$ac_config_targets $1" ;;
17921
17922   esac
17923   shift
17924 done
17925
17926 exec 5>>config.log
17927 cat >&5 << _ACEOF
17928
17929 ## ----------------------- ##
17930 ## Running config.status.  ##
17931 ## ----------------------- ##
17932
17933 This file was extended by $as_me 2.52.20210105, executed with
17934   CONFIG_FILES    = $CONFIG_FILES
17935   CONFIG_HEADERS  = $CONFIG_HEADERS
17936   CONFIG_LINKS    = $CONFIG_LINKS
17937   CONFIG_COMMANDS = $CONFIG_COMMANDS
17938   > "$ac_cs_invocation"
17939 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17940
17941 _ACEOF
17942 EOF
17943
17944 cat >>"$CONFIG_STATUS" <<EOF
17945 #
17946 # INIT-COMMANDS section.
17947 #
17948
17949 ### Special initialization commands, used to pass information from the
17950 ### configuration-run into config.status
17951
17952 AWK="$AWK"
17953 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
17954 DFT_LWR_MODEL="$DFT_LWR_MODEL"
17955 LIB_NAME="$LIB_NAME"
17956 LIB_PREFIX="$LIB_PREFIX"
17957 LIB_SUFFIX="$LIB_SUFFIX"
17958 LN_S="$LN_S"
17959 NCURSES_MAJOR="$NCURSES_MAJOR"
17960 NCURSES_MINOR="$NCURSES_MINOR"
17961 NCURSES_PATCH="$NCURSES_PATCH"
17962 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
17963 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
17964 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
17965 cf_cv_abi_version="$cf_cv_abi_version"
17966 cf_cv_rel_version="$cf_cv_rel_version"
17967 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
17968 cf_cv_shared_soname='$cf_cv_shared_soname'
17969 cf_cv_shlib_version="$cf_cv_shlib_version"
17970 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
17971 cf_cv_system_name="$cf_cv_system_name"
17972 host="$host"
17973 target="$target"
17974
17975 EOF
17976
17977 cat >>"$CONFIG_STATUS" <<\EOF
17978 for ac_config_target in $ac_config_targets
17979 do
17980   case "$ac_config_target" in
17981   # Handling of arguments.
17982   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
17983   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
17984   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
17985   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17986   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17987   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
17988   *) { { echo "$as_me:17988: error: invalid argument: $ac_config_target" >&5
17989 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17990    { (exit 1); exit 1; }; };;
17991   esac
17992 done
17993
17994 # If the user did not use the arguments to specify the items to instantiate,
17995 # then the envvar interface is used.  Set only those that are not.
17996 # We use the long form for the default assignment because of an extremely
17997 # bizarre bug on SunOS 4.1.3.
17998 if "$ac_need_defaults"; then
17999   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18000   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18001   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18002 fi
18003
18004 # Create a temporary directory, and hook for its removal unless debugging.
18005 $debug ||
18006 {
18007   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18008   trap '{ (exit 1); exit 1; }' 1 2 13 15
18009 }
18010
18011 # Create a (secure) tmp directory for tmp files.
18012 : ${TMPDIR=/tmp}
18013 {
18014   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18015   test -n "$tmp" && test -d "$tmp"
18016 }  ||
18017 {
18018   tmp=$TMPDIR/cs$$-$RANDOM
18019   (umask 077 && mkdir $tmp)
18020 } ||
18021 {
18022    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18023    { (exit 1); exit 1; }
18024 }
18025
18026 EOF
18027
18028 cat >>"$CONFIG_STATUS" <<EOF
18029
18030 #
18031 # CONFIG_FILES section.
18032 #
18033
18034 # No need to generate the scripts if there are no CONFIG_FILES.
18035 # This happens for instance when ./config.status config.h
18036 if test -n "\$CONFIG_FILES"; then
18037   # Protect against being on the right side of a sed subst in config.status.
18038   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18039    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18040 s,@SHELL@,$SHELL,;t t
18041 s,@exec_prefix@,$exec_prefix,;t t
18042 s,@prefix@,$prefix,;t t
18043 s,@program_transform_name@,$program_transform_name,;t t
18044 s,@bindir@,$bindir,;t t
18045 s,@sbindir@,$sbindir,;t t
18046 s,@libexecdir@,$libexecdir,;t t
18047 s,@datarootdir@,$datarootdir,;t t
18048 s,@datadir@,$datadir,;t t
18049 s,@sysconfdir@,$sysconfdir,;t t
18050 s,@sharedstatedir@,$sharedstatedir,;t t
18051 s,@localstatedir@,$localstatedir,;t t
18052 s,@runstatedir@,$runstatedir,;t t
18053 s,@libdir@,$libdir,;t t
18054 s,@includedir@,$includedir,;t t
18055 s,@oldincludedir@,$oldincludedir,;t t
18056 s,@infodir@,$infodir,;t t
18057 s,@mandir@,$mandir,;t t
18058 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18059 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18060 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18061 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18062 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18063 s,@build_alias@,$build_alias,;t t
18064 s,@host_alias@,$host_alias,;t t
18065 s,@target_alias@,$target_alias,;t t
18066 s,@ECHO_C@,$ECHO_C,;t t
18067 s,@ECHO_N@,$ECHO_N,;t t
18068 s,@ECHO_T@,$ECHO_T,;t t
18069 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18070 s,@DEFS@,$DEFS,;t t
18071 s,@LIBS@,$LIBS,;t t
18072 s,@top_builddir@,$top_builddir,;t t
18073 s,@build@,$build,;t t
18074 s,@build_cpu@,$build_cpu,;t t
18075 s,@build_vendor@,$build_vendor,;t t
18076 s,@build_os@,$build_os,;t t
18077 s,@host@,$host,;t t
18078 s,@host_cpu@,$host_cpu,;t t
18079 s,@host_vendor@,$host_vendor,;t t
18080 s,@host_os@,$host_os,;t t
18081 s,@target@,$target,;t t
18082 s,@target_cpu@,$target_cpu,;t t
18083 s,@target_vendor@,$target_vendor,;t t
18084 s,@target_os@,$target_os,;t t
18085 s,@GREP@,$GREP,;t t
18086 s,@FGREP@,$FGREP,;t t
18087 s,@CC@,$CC,;t t
18088 s,@CFLAGS@,$CFLAGS,;t t
18089 s,@LDFLAGS@,$LDFLAGS,;t t
18090 s,@CPPFLAGS@,$CPPFLAGS,;t t
18091 s,@ac_ct_CC@,$ac_ct_CC,;t t
18092 s,@EXEEXT@,$EXEEXT,;t t
18093 s,@OBJEXT@,$OBJEXT,;t t
18094 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18095 s,@CPP@,$CPP,;t t
18096 s,@EGREP@,$EGREP,;t t
18097 s,@AWK@,$AWK,;t t
18098 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18099 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18100 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18101 s,@LN_S@,$LN_S,;t t
18102 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18103 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18104 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18105 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18106 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18107 s,@SET_MAKE@,$SET_MAKE,;t t
18108 s,@CTAGS@,$CTAGS,;t t
18109 s,@ETAGS@,$ETAGS,;t t
18110 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18111 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18112 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18113 s,@RANLIB@,$RANLIB,;t t
18114 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18115 s,@LD@,$LD,;t t
18116 s,@ac_ct_LD@,$ac_ct_LD,;t t
18117 s,@AR@,$AR,;t t
18118 s,@ac_ct_AR@,$ac_ct_AR,;t t
18119 s,@ARFLAGS@,$ARFLAGS,;t t
18120 s,@DESTDIR@,$DESTDIR,;t t
18121 s,@BUILD_CC@,$BUILD_CC,;t t
18122 s,@BUILD_CPP@,$BUILD_CPP,;t t
18123 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18124 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18125 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18126 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18127 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18128 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18129 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18130 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18131 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18132 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18133 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18134 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18135 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18136 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18137 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18138 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18139 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18140 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18141 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18142 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18143 s,@CC_G_OPT@,$CC_G_OPT,;t t
18144 s,@LD_MODEL@,$LD_MODEL,;t t
18145 s,@shlibdir@,$shlibdir,;t t
18146 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18147 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18148 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18149 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18150 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18151 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18152 s,@LINK_PROGS@,$LINK_PROGS,;t t
18153 s,@LINK_TESTS@,$LINK_TESTS,;t t
18154 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18155 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18156 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18157 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18158 s,@RPATH_LIST@,$RPATH_LIST,;t t
18159 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18160 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18161 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18162 s,@PTHREAD@,$PTHREAD,;t t
18163 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18164 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18165 s,@ECHO_LT@,$ECHO_LT,;t t
18166 s,@ECHO_LD@,$ECHO_LD,;t t
18167 s,@RULE_CC@,$RULE_CC,;t t
18168 s,@SHOW_CC@,$SHOW_CC,;t t
18169 s,@ECHO_CC@,$ECHO_CC,;t t
18170 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18171 s,@ADAFLAGS@,$ADAFLAGS,;t t
18172 s,@ADA_TRACE@,$ADA_TRACE,;t t
18173 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18174 s,@M4_exists@,$M4_exists,;t t
18175 s,@cf_ada_make@,$cf_ada_make,;t t
18176 s,@cf_ada_config@,$cf_ada_config,;t t
18177 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18178 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18179 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18180 s,@cf_compile_generics@,$cf_compile_generics,;t t
18181 s,@cf_generic_objects@,$cf_generic_objects,;t t
18182 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18183 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18184 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18185 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18186 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18187 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18188 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18189 s,@cf_ada_package@,$cf_ada_package,;t t
18190 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18191 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18192 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18193 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18194 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18195 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18196 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18197 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18198 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18199 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18200 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18201 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18202 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18203 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18204 s,@TEST_ARG2@,$TEST_ARG2,;t t
18205 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18206 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18207 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18208 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18209 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18210 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18211 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18212 CEOF
18213
18214 EOF
18215
18216   cat >>"$CONFIG_STATUS" <<\EOF
18217   # Split the substitutions into bite-sized pieces for seds with
18218   # small command number limits, like on Digital OSF/1 and HP-UX.
18219   ac_max_sed_lines=48
18220   ac_sed_frag=1 # Number of current file.
18221   ac_beg=1 # First line for current file.
18222   ac_end=$ac_max_sed_lines # Line after last line for current file.
18223   ac_more_lines=:
18224   ac_sed_cmds=
18225   while "$ac_more_lines"; do
18226     if test "$ac_beg" -gt 1; then
18227       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18228     else
18229       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18230     fi
18231     if test ! -s $tmp/subs.frag; then
18232       ac_more_lines=false
18233     else
18234       # The purpose of the label and of the branching condition is to
18235       # speed up the sed processing (if there are no `@' at all, there
18236       # is no need to browse any of the substitutions).
18237       # These are the two extra sed commands mentioned above.
18238       (echo ':t
18239   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18240       # It is possible to make a multiline substitution using escaped newlines.
18241       # Ensure that we do not split the substitution between script fragments.
18242       ac_BEG=$ac_end
18243       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18244       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18245       if test -s $tmp/subs.next; then
18246         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18247         if test ! -s $tmp/subs.edit; then
18248           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18249           if test ! -s $tmp/subs.edit; then
18250             if test "$ac_beg" -gt 1; then
18251               ac_end=`expr "$ac_end" - 1`
18252               continue
18253             fi
18254           fi
18255         fi
18256       fi
18257
18258       if test -z "$ac_sed_cmds"; then
18259         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18260       else
18261         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18262       fi
18263       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18264       ac_beg=$ac_end
18265       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18266     fi
18267   done
18268   if test -z "$ac_sed_cmds"; then
18269     ac_sed_cmds=cat
18270   fi
18271 fi # test -n "$CONFIG_FILES"
18272
18273 EOF
18274 cat >>"$CONFIG_STATUS" <<\EOF
18275 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18276   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18277   case "$ac_file" in
18278   - | *:- | *:-:* ) # input from stdin
18279         cat >$tmp/stdin
18280         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18281         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18282   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18283         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18284   * )   ac_file_in=$ac_file.in ;;
18285   esac
18286
18287   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18288   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18289          X"$ac_file" : 'X\(//\)[^/]' \| \
18290          X"$ac_file" : 'X\(//\)$' \| \
18291          X"$ac_file" : 'X\(/\)' \| \
18292          .     : '\(.\)' 2>/dev/null ||
18293 echo X"$ac_file" |
18294     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18295           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18296           /^X\(\/\/\)$/{ s//\1/; q; }
18297           /^X\(\/\).*/{ s//\1/; q; }
18298           s/.*/./; q'`
18299   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18300     { case "$ac_dir" in
18301   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18302   *)                      as_incr_dir=.;;
18303 esac
18304 as_dummy="$ac_dir"
18305 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18306   case $as_mkdir_dir in
18307     # Skip DOS drivespec
18308     ?:) as_incr_dir=$as_mkdir_dir ;;
18309     *)
18310       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18311       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18312     ;;
18313   esac
18314 done; }
18315
18316     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18317     # A "../" for each directory in $ac_dir_suffix.
18318     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18319   else
18320     ac_dir_suffix= ac_dots=
18321   fi
18322
18323   case "$srcdir" in
18324   .)  ac_srcdir=.
18325       if test -z "$ac_dots"; then
18326          ac_top_srcdir=.
18327       else
18328          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18329       fi ;;
18330   [\\/]* | ?:[\\/]* )
18331       ac_srcdir="$srcdir$ac_dir_suffix";
18332       ac_top_srcdir="$srcdir" ;;
18333   *) # Relative path.
18334     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18335     ac_top_srcdir="$ac_dots$srcdir" ;;
18336   esac
18337
18338   case $INSTALL in
18339   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18340   *) ac_INSTALL=$ac_dots$INSTALL ;;
18341   esac
18342
18343   if test x"$ac_file" != x-; then
18344     { echo "$as_me:18344: creating $ac_file" >&5
18345 echo "$as_me: creating $ac_file" >&6;}
18346     rm -f "$ac_file"
18347   fi
18348   # Let's still pretend it is `configure' which instantiates (i.e., don't
18349   # use $as_me), people would be surprised to read:
18350   #    /* config.h.  Generated automatically by config.status.  */
18351   configure_input="Generated automatically from `echo $ac_file_in |
18352                                                  sed 's,.*/,,'` by configure."
18353
18354   # First look for the input files in the build tree, otherwise in the
18355   # src tree.
18356   ac_file_inputs=`IFS=:
18357     for f in $ac_file_in; do
18358       case $f in
18359       -) echo $tmp/stdin ;;
18360       [\\/$]*)
18361          # Absolute (can't be DOS-style, as IFS=:)
18362          test -f "$f" || { { echo "$as_me:18362: error: cannot find input file: $f" >&5
18363 echo "$as_me: error: cannot find input file: $f" >&2;}
18364    { (exit 1); exit 1; }; }
18365          echo $f;;
18366       *) # Relative
18367          if test -f "$f"; then
18368            # Build tree
18369            echo $f
18370          elif test -f "$srcdir/$f"; then
18371            # Source tree
18372            echo "$srcdir/$f"
18373          else
18374            # /dev/null tree
18375            { { echo "$as_me:18375: error: cannot find input file: $f" >&5
18376 echo "$as_me: error: cannot find input file: $f" >&2;}
18377    { (exit 1); exit 1; }; }
18378          fi;;
18379       esac
18380     done` || { (exit 1); exit 1; }
18381 EOF
18382 cat >>"$CONFIG_STATUS" <<\EOF
18383   ac_warn_datarootdir=no
18384   if test x"$ac_file" != x-; then
18385     for ac_item in $ac_file_inputs
18386     do
18387       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18388       if test -n "$ac_seen"; then
18389         ac_used=`grep '@datarootdir@' "$ac_item"`
18390         if test -z "$ac_used"; then
18391           { echo "$as_me:18391: WARNING: datarootdir was used implicitly but not set:
18392 $ac_seen" >&5
18393 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18394 $ac_seen" >&2;}
18395           ac_warn_datarootdir=yes
18396         fi
18397       fi
18398       ac_seen=`grep '${datarootdir}' "$ac_item"`
18399       if test -n "$ac_seen"; then
18400         { echo "$as_me:18400: WARNING: datarootdir was used explicitly but not set:
18401 $ac_seen" >&5
18402 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18403 $ac_seen" >&2;}
18404         ac_warn_datarootdir=yes
18405       fi
18406     done
18407   fi
18408
18409 if test "x$ac_warn_datarootdir" = xyes; then
18410   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18411 fi
18412
18413 EOF
18414 cat >>"$CONFIG_STATUS" <<EOF
18415   sed "$ac_vpsub
18416 $extrasub
18417 EOF
18418 cat >>"$CONFIG_STATUS" <<\EOF
18419 :t
18420 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18421 s,@configure_input@,$configure_input,;t t
18422 s,@srcdir@,$ac_srcdir,;t t
18423 s,@top_srcdir@,$ac_top_srcdir,;t t
18424 s,@INSTALL@,$ac_INSTALL,;t t
18425 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18426   rm -f $tmp/stdin
18427   if test x"$ac_file" != x-; then
18428     cp "$tmp/out" "$ac_file"
18429
18430     for ac_name in prefix exec_prefix datarootdir
18431     do
18432         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18433         if test -n "$ac_seen"; then
18434             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18435             if test -z "$ac_init"; then
18436               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18437               { echo "$as_me:18437: WARNING: Variable $ac_name is used but was not set:
18438 $ac_seen" >&5
18439 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18440 $ac_seen" >&2;}
18441             fi
18442         fi
18443     done
18444     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18445     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18446     if test -s $tmp/out; then
18447       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18448       { echo "$as_me:18448: WARNING: Some variables may not be substituted:
18449 $ac_seen" >&5
18450 echo "$as_me: WARNING: Some variables may not be substituted:
18451 $ac_seen" >&2;}
18452     fi
18453   else
18454     cat $tmp/out
18455   fi
18456   rm -f $tmp/out
18457
18458 done
18459 EOF
18460 cat >>"$CONFIG_STATUS" <<\EOF
18461
18462 #
18463 # CONFIG_HEADER section.
18464 #
18465
18466 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18467 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18468 #
18469 # ac_d sets the value in "#define NAME VALUE" lines.
18470 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18471 ac_dB='[        ].*$,\1#\2'
18472 ac_dC=' '
18473 ac_dD=',;t'
18474 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18475 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18476 ac_iB='\([      ]\),\1#\2define\3'
18477 ac_iC=' '
18478 ac_iD='\4,;t'
18479 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18480 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18481 ac_uB='$,\1#\2define\3'
18482 ac_uC=' '
18483 ac_uD=',;t'
18484
18485 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18486   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18487   case "$ac_file" in
18488   - | *:- | *:-:* ) # input from stdin
18489         cat >$tmp/stdin
18490         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18491         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18492   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18493         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18494   * )   ac_file_in=$ac_file.in ;;
18495   esac
18496
18497   test x"$ac_file" != x- && { echo "$as_me:18497: creating $ac_file" >&5
18498 echo "$as_me: creating $ac_file" >&6;}
18499
18500   # First look for the input files in the build tree, otherwise in the
18501   # src tree.
18502   ac_file_inputs=`IFS=:
18503     for f in $ac_file_in; do
18504       case $f in
18505       -) echo $tmp/stdin ;;
18506       [\\/$]*)
18507          # Absolute (can't be DOS-style, as IFS=:)
18508          test -f "$f" || { { echo "$as_me:18508: error: cannot find input file: $f" >&5
18509 echo "$as_me: error: cannot find input file: $f" >&2;}
18510    { (exit 1); exit 1; }; }
18511          echo $f;;
18512       *) # Relative
18513          if test -f "$f"; then
18514            # Build tree
18515            echo $f
18516          elif test -f "$srcdir/$f"; then
18517            # Source tree
18518            echo "$srcdir/$f"
18519          else
18520            # /dev/null tree
18521            { { echo "$as_me:18521: error: cannot find input file: $f" >&5
18522 echo "$as_me: error: cannot find input file: $f" >&2;}
18523    { (exit 1); exit 1; }; }
18524          fi;;
18525       esac
18526     done` || { (exit 1); exit 1; }
18527   # Remove the trailing spaces.
18528   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18529
18530 EOF
18531
18532 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18533 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18534 # be either 'cat' or 'sort'.
18535 cat confdefs.h | uniq >conftest.vals
18536
18537 # Break up conftest.vals because some shells have a limit on
18538 # the size of here documents, and old seds have small limits too.
18539
18540 rm -f conftest.tail
18541 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
18542 while grep . conftest.vals >/dev/null
18543 do
18544   # Write chunks of a limited-size here document to conftest.frag.
18545   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
18546   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
18547   echo 'CEOF' >> "$CONFIG_STATUS"
18548   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
18549   rm -f conftest.vals
18550   mv conftest.tail conftest.vals
18551 done
18552 rm -f conftest.vals
18553
18554 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18555 # marker @DEFS@.
18556 echo '  cat >> conftest.edit <<CEOF
18557 /@DEFS@/r conftest.frag
18558 /@DEFS@/d
18559 CEOF
18560 sed -f conftest.edit $tmp/in > $tmp/out
18561 rm -f $tmp/in
18562 mv $tmp/out $tmp/in
18563 rm -f conftest.edit conftest.frag
18564 ' >> "$CONFIG_STATUS"
18565
18566 cat >>"$CONFIG_STATUS" <<\EOF
18567   # Let's still pretend it is `configure' which instantiates (i.e., don't
18568   # use $as_me), people would be surprised to read:
18569   #    /* config.h.  Generated automatically by config.status.  */
18570   if test x"$ac_file" = x-; then
18571     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18572   else
18573     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18574   fi
18575   cat $tmp/in >>$tmp/config.h
18576   rm -f $tmp/in
18577   if test x"$ac_file" != x-; then
18578     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
18579       { echo "$as_me:18579: $ac_file is unchanged" >&5
18580 echo "$as_me: $ac_file is unchanged" >&6;}
18581     else
18582       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18583          X"$ac_file" : 'X\(//\)[^/]' \| \
18584          X"$ac_file" : 'X\(//\)$' \| \
18585          X"$ac_file" : 'X\(/\)' \| \
18586          .     : '\(.\)' 2>/dev/null ||
18587 echo X"$ac_file" |
18588     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18589           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18590           /^X\(\/\/\)$/{ s//\1/; q; }
18591           /^X\(\/\).*/{ s//\1/; q; }
18592           s/.*/./; q'`
18593       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18594         { case "$ac_dir" in
18595   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18596   *)                      as_incr_dir=.;;
18597 esac
18598 as_dummy="$ac_dir"
18599 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18600   case $as_mkdir_dir in
18601     # Skip DOS drivespec
18602     ?:) as_incr_dir=$as_mkdir_dir ;;
18603     *)
18604       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18605       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18606     ;;
18607   esac
18608 done; }
18609
18610       fi
18611       rm -f "$ac_file"
18612       mv "$tmp/config.h" "$ac_file"
18613     fi
18614   else
18615     cat $tmp/config.h
18616     rm -f $tmp/config.h
18617   fi
18618 done
18619 EOF
18620 cat >>"$CONFIG_STATUS" <<\EOF
18621 #
18622 # CONFIG_COMMANDS section.
18623 #
18624 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18625   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18626   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18627
18628   case "$ac_dest" in
18629     default )
18630 if test -z "$USE_OLD_MAKERULES" ; then
18631         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18632 fi
18633  ;;
18634   esac
18635 done
18636 EOF
18637
18638 cat >>"$CONFIG_STATUS" <<\EOF
18639
18640 { (exit 0); exit 0; }
18641 EOF
18642 chmod +x "$CONFIG_STATUS"
18643 ac_clean_files=$ac_clean_files_save
18644
18645 # configure is writing to config.log, and then calls config.status.
18646 # config.status does its own redirection, appending to config.log.
18647 # Unfortunately, on DOS this fails, as config.log is still kept open
18648 # by configure, so config.status won't be able to write to it; its
18649 # output is simply discarded.  So we exec the FD to /dev/null,
18650 # effectively closing config.log, so it can be properly (re)opened and
18651 # appended to by config.status.  When coming back to configure, we
18652 # need to make the FD available again.
18653 if test "$no_create" != yes; then
18654   ac_cs_success=:
18655   exec 5>/dev/null
18656   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
18657   exec 5>>config.log
18658   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18659   # would make configure fail if this is the last instruction.
18660   "$ac_cs_success" || { (exit 1); exit 1; }
18661 fi
18662 ${MAKE:-make} preinstall