]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
47c41749b896a6cdaf9e05317c8ac9a0166e1edc
[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-stdnoreturn    enable C11 _Noreturn feature for diagnostics
744   --enable-assertions     test: turn on generation of assertion code
745   --enable-expanded       test: generate functions for certain macros
746   --disable-macros        test: use functions rather than macros
747   --with-trace            test: add trace() function to all models of ncurses
748   --disable-gnat-projects test: disable GNAT projects even if usable
749 Ada95 Binding Options:
750   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
751   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
752   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
753   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
754   --with-ada-libname=XXX  override default Ada library-name
755
756 Some influential environment variables:
757   CC          C compiler command
758   CFLAGS      C compiler flags
759   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
760               nonstandard directory <lib dir>
761   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
762               headers in a nonstandard directory <include dir>
763   CPP         C preprocessor
764
765 Use these variables to override the choices made by `configure' or to help
766 it to find libraries and programs with nonstandard names/locations.
767
768 EOF
769 fi
770
771 if test "$ac_init_help" = "recursive"; then
772   # If there are subdirs, report their specific --help.
773   ac_popdir=`pwd`
774   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
775     cd "$ac_subdir"
776     # A "../" for each directory in /$ac_subdir.
777     ac_dots=`echo "$ac_subdir" |
778              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
779
780     case "$srcdir" in
781     .) # No --srcdir option.  We are building in place.
782       ac_sub_srcdir="$srcdir" ;;
783     [\\/]* | ?:[\\/]* ) # Absolute path.
784       ac_sub_srcdir="$srcdir/$ac_subdir" ;;
785     *) # Relative path.
786       ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;;
787     esac
788
789     # Check for guested configure; otherwise get Cygnus style configure.
790     if test -f "$ac_sub_srcdir/configure.gnu"; then
791       echo
792       $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive
793     elif test -f "$ac_sub_srcdir/configure"; then
794       echo
795       $SHELL "$ac_sub_srcdir/configure" --help=recursive
796     elif test -f "$ac_sub_srcdir/configure.ac" ||
797            test -f "$ac_sub_srcdir/configure.in"; then
798       echo
799       "$ac_configure" --help
800     else
801       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
802     fi
803     cd "$ac_popdir"
804   done
805 fi
806
807 test -n "$ac_init_help" && exit 0
808 if "$ac_init_version"; then
809   cat <<\EOF
810
811 Copyright 2003-2020,2021        Thomas E. Dickey
812 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
813 Free Software Foundation, Inc.
814 This configure script is free software; the Free Software Foundation
815 gives unlimited permission to copy, distribute and modify it.
816 EOF
817   exit 0
818 fi
819 exec 5>config.log
820 cat >&5 <<EOF
821 This file contains any messages produced by compilers while
822 running configure, to aid debugging if configure makes a mistake.
823
824 It was created by $as_me, which was
825 generated by GNU Autoconf 2.52.20210105.  Invocation command line was
826
827   $ $0 $@
828
829 EOF
830 {
831 cat <<_ASUNAME
832 ## ---------- ##
833 ## Platform.  ##
834 ## ---------- ##
835
836 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
837 uname -m = `(uname -m) 2>/dev/null || echo unknown`
838 uname -r = `(uname -r) 2>/dev/null || echo unknown`
839 uname -s = `(uname -s) 2>/dev/null || echo unknown`
840 uname -v = `(uname -v) 2>/dev/null || echo unknown`
841
842 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
843 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
844
845 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
846 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
847 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
848 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
849 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
850 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
851 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
852
853 PATH = $PATH
854
855 _ASUNAME
856 } >&5
857
858 cat >&5 <<EOF
859 ## ------------ ##
860 ## Core tests.  ##
861 ## ------------ ##
862
863 EOF
864
865 # Keep a trace of the command line.
866 # Strip out --no-create and --no-recursion so they do not pile up.
867 # Also quote any args containing shell meta-characters.
868 ac_configure_args=
869 ac_sep=
870 for ac_arg
871 do
872   case "$ac_arg" in
873   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
874   | --no-cr | --no-c) ;;
875   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
876   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
877   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
878     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
879     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
880     ac_sep=" " ;;
881   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
882      ac_sep=" " ;;
883   esac
884   # Get rid of the leading space.
885 done
886
887 # When interrupted or exit'd, cleanup temporary files, and complete
888 # config.log.  We remove comments because anyway the quotes in there
889 # would cause problems or look ugly.
890 trap 'exit_status=$?
891   # Save into config.log some information that might help in debugging.
892   echo >&5
893   echo "## ----------------- ##" >&5
894   echo "## Cache variables.  ##" >&5
895   echo "## ----------------- ##" >&5
896   echo >&5
897   # The following way of writing the cache mishandles newlines in values,
898 {
899   (set) 2>&1 |
900     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
901     *ac_space=\ *)
902       sed -n \
903         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
904           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
905       ;;
906     *)
907       sed -n \
908         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
909       ;;
910     esac;
911 } >&5
912   sed "/^$/d" confdefs.h >conftest.log
913   if test -s conftest.log; then
914     echo >&5
915     echo "## ------------ ##" >&5
916     echo "## confdefs.h.  ##" >&5
917     echo "## ------------ ##" >&5
918     echo >&5
919     cat conftest.log >&5
920   fi
921   (echo; echo) >&5
922   test "$ac_signal" != 0 &&
923     echo "$as_me: caught signal $ac_signal" >&5
924   echo "$as_me: exit $exit_status" >&5
925   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
926     exit $exit_status
927      ' 0
928 for ac_signal in 1 2 13 15; do
929   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' "$ac_signal"
930 done
931 ac_signal=0
932
933 # confdefs.h avoids OS command line length limits that DEFS can exceed.
934 rm -rf conftest* confdefs.h
935 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
936 echo >confdefs.h
937
938 # Let the site file select an alternate cache file if it wants to.
939 # Prefer explicitly selected file to automatically selected ones.
940 if test -z "$CONFIG_SITE"; then
941   if test "x$prefix" != xNONE; then
942     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
943   else
944     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
945   fi
946 fi
947 for ac_site_file in $CONFIG_SITE; do
948   if test -r "$ac_site_file"; then
949     { echo "$as_me:949: loading site script $ac_site_file" >&5
950 echo "$as_me: loading site script $ac_site_file" >&6;}
951     cat "$ac_site_file" >&5
952     . "$ac_site_file"
953   fi
954 done
955
956 if test -r "$cache_file"; then
957   # Some versions of bash will fail to source /dev/null (special
958   # files actually), so we avoid doing that.
959   if test -f "$cache_file"; then
960     { echo "$as_me:960: loading cache $cache_file" >&5
961 echo "$as_me: loading cache $cache_file" >&6;}
962     case $cache_file in
963       [\\/]* | ?:[\\/]* ) . $cache_file;;
964       *)                      . ./$cache_file;;
965     esac
966   fi
967 else
968   { echo "$as_me:968: creating cache $cache_file" >&5
969 echo "$as_me: creating cache $cache_file" >&6;}
970   >$cache_file
971 fi
972
973 # Check that the precious variables saved in the cache have kept the same
974 # value.
975 ac_cache_corrupted=false
976 for ac_var in `(set) 2>&1 |
977                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
978   eval ac_old_set=\$ac_cv_env_${ac_var}_set
979   eval ac_new_set=\$ac_env_${ac_var}_set
980   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
981   eval ac_new_val="\$ac_env_${ac_var}_value"
982   case "$ac_old_set,$ac_new_set" in
983     set,)
984       { echo "$as_me:984: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
985 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
986       ac_cache_corrupted=: ;;
987     ,set)
988       { echo "$as_me:988: error: \`$ac_var' was not set in the previous run" >&5
989 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
990       ac_cache_corrupted=: ;;
991     ,);;
992     *)
993       if test "x$ac_old_val" != "x$ac_new_val"; then
994         { echo "$as_me:994: error: \`$ac_var' has changed since the previous run:" >&5
995 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
996         { echo "$as_me:996:   former value:  $ac_old_val" >&5
997 echo "$as_me:   former value:  $ac_old_val" >&2;}
998         { echo "$as_me:998:   current value: $ac_new_val" >&5
999 echo "$as_me:   current value: $ac_new_val" >&2;}
1000         ac_cache_corrupted=:
1001       fi;;
1002   esac
1003   # Pass precious variables to config.status.  It doesn't matter if
1004   # we pass some twice (in addition to the command line arguments).
1005   if test "$ac_new_set" = set; then
1006     case "$ac_new_val" in
1007     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1008       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1009       ac_configure_args="$ac_configure_args '$ac_arg'"
1010       ;;
1011     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1012        ;;
1013     esac
1014   fi
1015 done
1016 if "$ac_cache_corrupted"; then
1017   { echo "$as_me:1017: error: changes in the environment can compromise the build" >&5
1018 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1019   { { echo "$as_me:1019: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1020 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1021    { (exit 1); exit 1; }; }
1022 fi
1023
1024 ac_ext=c
1025 ac_cpp='$CPP $CPPFLAGS'
1026 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1027 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1028 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1029 ac_main_return="return"
1030
1031 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1032   *c*,-n*) ECHO_N=
1033            ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1034            ECHO_T='     '
1035            ;;
1036   *c*,*  ) ECHO_N=-n
1037            ECHO_C=
1038            ECHO_T=
1039            ;;
1040   *)       ECHO_N=
1041            ECHO_C='\c'
1042            ECHO_T=
1043            ;;
1044 esac
1045 echo "#! $SHELL" >conftest.sh
1046 echo  "exit 0"   >>conftest.sh
1047 chmod +x conftest.sh
1048 if { (echo "$as_me:1048: PATH=\".;.\"; conftest.sh") >&5
1049   (PATH=".;."; conftest.sh) 2>&5
1050   ac_status=$?
1051   echo "$as_me:1051: \$? = $ac_status" >&5
1052   (exit "$ac_status"); }; then
1053   ac_path_separator=';'
1054 else
1055   ac_path_separator=:
1056 fi
1057 PATH_SEPARATOR="$ac_path_separator"
1058 rm -f conftest.sh
1059
1060 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1061
1062 top_builddir=`pwd`
1063
1064 ac_aux_dir=
1065 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1066   if test -f "$ac_dir/install-sh"; then
1067     ac_aux_dir=$ac_dir
1068     ac_install_sh="$ac_aux_dir/install-sh -c"
1069     break
1070   elif test -f "$ac_dir/install.sh"; then
1071     ac_aux_dir=$ac_dir
1072     ac_install_sh="$ac_aux_dir/install.sh -c"
1073     break
1074   elif test -f "$ac_dir/shtool"; then
1075     ac_aux_dir=$ac_dir
1076     ac_install_sh="$ac_aux_dir/shtool install -c"
1077     break
1078   fi
1079 done
1080 if test -z "$ac_aux_dir"; then
1081   { { echo "$as_me:1081: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1082 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1083    { (exit 1); exit 1; }; }
1084 fi
1085 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1086 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1087 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1088
1089 # Make sure we can run config.sub.
1090 $ac_config_sub sun4 >/dev/null 2>&1 ||
1091   { { echo "$as_me:1091: error: cannot run $ac_config_sub" >&5
1092 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1093    { (exit 1); exit 1; }; }
1094
1095 echo "$as_me:1095: checking build system type" >&5
1096 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1097 if test "${ac_cv_build+set}" = set; then
1098   echo $ECHO_N "(cached) $ECHO_C" >&6
1099 else
1100   ac_cv_build_alias=$build_alias
1101 test -z "$ac_cv_build_alias" &&
1102   ac_cv_build_alias=`$ac_config_guess`
1103 test -z "$ac_cv_build_alias" &&
1104   { { echo "$as_me:1104: error: cannot guess build type; you must specify one" >&5
1105 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1106    { (exit 1); exit 1; }; }
1107 ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` ||
1108   { { echo "$as_me:1108: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1109 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1110    { (exit 1); exit 1; }; }
1111
1112 fi
1113 echo "$as_me:1113: result: $ac_cv_build" >&5
1114 echo "${ECHO_T}$ac_cv_build" >&6
1115 build=$ac_cv_build
1116 build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1117 build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1118 build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1119
1120 echo "$as_me:1120: checking host system type" >&5
1121 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1122 if test "${ac_cv_host+set}" = set; then
1123   echo $ECHO_N "(cached) $ECHO_C" >&6
1124 else
1125   ac_cv_host_alias=$host_alias
1126 test -z "$ac_cv_host_alias" &&
1127   ac_cv_host_alias=$ac_cv_build_alias
1128 ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` ||
1129   { { echo "$as_me:1129: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1130 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1131    { (exit 1); exit 1; }; }
1132
1133 fi
1134 echo "$as_me:1134: result: $ac_cv_host" >&5
1135 echo "${ECHO_T}$ac_cv_host" >&6
1136 host=$ac_cv_host
1137 host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1138 host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1139 host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1140
1141 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
1142         echo "$as_me:1142: checking target system type" >&5
1143 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1144 if test "${ac_cv_target+set}" = set; then
1145   echo $ECHO_N "(cached) $ECHO_C" >&6
1146 else
1147   ac_cv_target_alias=$target_alias
1148 test "x$ac_cv_target_alias" = "x" &&
1149   ac_cv_target_alias=$ac_cv_host_alias
1150 ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` ||
1151   { { echo "$as_me:1151: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1152 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1153    { (exit 1); exit 1; }; }
1154
1155 fi
1156 echo "$as_me:1156: result: $ac_cv_target" >&5
1157 echo "${ECHO_T}$ac_cv_target" >&6
1158 target=$ac_cv_target
1159 target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1160 target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1161 target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1162
1163 # The aliases save the names the user supplied, while $host etc.
1164 # will get canonicalized.
1165 test -n "$target_alias" &&
1166   test "$program_prefix$program_suffix$program_transform_name" = \
1167     NONENONEs,x,x, &&
1168   program_prefix=${target_alias}-
1169         system_name="$host_os"
1170 else
1171         system_name="`(uname -s -r) 2>/dev/null`"
1172         if test -z "$system_name" ; then
1173                 system_name="`(hostname) 2>/dev/null`"
1174         fi
1175 fi
1176 test -n "$system_name" &&
1177 cat >>confdefs.h <<EOF
1178 #define SYSTEM_NAME "$system_name"
1179 EOF
1180
1181 if test "${cf_cv_system_name+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   cf_cv_system_name="$system_name"
1185 fi
1186
1187 test -z "$system_name" && system_name="$cf_cv_system_name"
1188 test -n "$cf_cv_system_name" && echo "$as_me:1188: result: Configuring for $cf_cv_system_name" >&5
1189 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1190
1191 if test ".$system_name" != ".$cf_cv_system_name" ; then
1192         echo "$as_me:1192: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1193 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1194         { { echo "$as_me:1194: error: \"Please remove config.cache and try again.\"" >&5
1195 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1196    { (exit 1); exit 1; }; }
1197 fi
1198
1199 # Check whether --with-system-type or --without-system-type was given.
1200 if test "${with_system_type+set}" = set; then
1201   withval="$with_system_type"
1202   { echo "$as_me:1202: WARNING: overriding system type to $withval" >&5
1203 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1204         cf_cv_system_name=$withval
1205         host_os=$withval
1206
1207 fi;
1208
1209 ###     Save the given $CFLAGS to allow user-override.
1210 cf_user_CFLAGS="$CFLAGS"
1211
1212 ###     Default install-location
1213 for ac_prog in ggrep grep
1214 do
1215   # Extract the first word of "$ac_prog", so it can be a program name with args.
1216 set dummy $ac_prog; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_GREP+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$GREP"; then
1223   ac_cv_prog_GREP="$GREP" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_GREP="$ac_prog"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 GREP=$ac_cv_prog_GREP
1239 if test -n "$GREP"; then
1240   echo "$as_me:1240: result: $GREP" >&5
1241 echo "${ECHO_T}$GREP" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247   test -n "$GREP" && break
1248 done
1249 test -n "$GREP" || GREP=": "
1250
1251 echo "$as_me:1251: checking for fgrep" >&5
1252 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6
1253 if test "${ac_cv_path_FGREP+set}" = set; then
1254   echo $ECHO_N "(cached) $ECHO_C" >&6
1255 else
1256   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
1257    then ac_cv_path_FGREP="$GREP -F"
1258    else
1259      for ac_prog in gfgrep fgrep
1260 do
1261   # Extract the first word of "$ac_prog", so it can be a program name with args.
1262 set dummy $ac_prog; ac_word=$2
1263 echo "$as_me:1263: checking for $ac_word" >&5
1264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1265 if test "${ac_cv_path_FGREP+set}" = set; then
1266   echo $ECHO_N "(cached) $ECHO_C" >&6
1267 else
1268   case $FGREP in
1269   [\\/]* | ?:[\\/]*)
1270   ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path.
1271   ;;
1272   *)
1273   ac_save_IFS=$IFS; IFS=$ac_path_separator
1274 ac_dummy="$PATH"
1275 for ac_dir in $ac_dummy; do
1276   IFS=$ac_save_IFS
1277   test -z "$ac_dir" && ac_dir=.
1278   if $as_executable_p "$ac_dir/$ac_word"; then
1279    ac_cv_path_FGREP="$ac_dir/$ac_word"
1280    echo "$as_me:1280: found $ac_dir/$ac_word" >&5
1281    break
1282 fi
1283 done
1284
1285   ;;
1286 esac
1287 fi
1288 FGREP=$ac_cv_path_FGREP
1289
1290 if test -n "$FGREP"; then
1291   echo "$as_me:1291: result: $FGREP" >&5
1292 echo "${ECHO_T}$FGREP" >&6
1293 else
1294   echo "$as_me:1294: result: no" >&5
1295 echo "${ECHO_T}no" >&6
1296 fi
1297
1298   test -n "$FGREP" && break
1299 done
1300 test -n "$FGREP" || FGREP=": "
1301
1302      test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:1302: error: cannot find workable fgrep" >&5
1303 echo "$as_me: error: cannot find workable fgrep" >&2;}
1304    { (exit 1); exit 1; }; }
1305    fi
1306 fi
1307 echo "$as_me:1307: result: $ac_cv_path_FGREP" >&5
1308 echo "${ECHO_T}$ac_cv_path_FGREP" >&6
1309  FGREP="$ac_cv_path_FGREP"
1310
1311 echo "$as_me:1311: checking for prefix" >&5
1312 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1313 if test "x$prefix" = "xNONE" ; then
1314         case "$cf_cv_system_name" in
1315                 # non-vendor systems don't have a conflict
1316         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1317                 prefix=/usr
1318                 ;;
1319         (*)     prefix=$ac_default_prefix
1320                 ;;
1321         esac
1322 fi
1323 echo "$as_me:1323: result: $prefix" >&5
1324 echo "${ECHO_T}$prefix" >&6
1325
1326 if test "x$prefix" = "xNONE" ; then
1327 echo "$as_me:1327: checking for default include-directory" >&5
1328 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1329 test -n "$verbose" && echo 1>&6
1330 for cf_symbol in \
1331         "$includedir" \
1332         "$includedir/ncurses" \
1333         "$prefix/include" \
1334         "$prefix/include/ncurses" \
1335         /usr/local/include \
1336         /usr/local/include/ncurses \
1337         /usr/include \
1338         /usr/include/ncurses
1339 do
1340         cf_dir=`eval echo "$cf_symbol"`
1341         if test -f "$cf_dir/curses.h" ; then
1342         if ( ${FGREP-fgrep} NCURSES_VERSION "$cf_dir/curses.h" >/dev/null 2>&1 ) ; then
1343                 includedir="$cf_symbol"
1344                 test -n "$verbose"  && echo $ECHO_N "   found " 1>&6
1345                 break
1346         fi
1347         fi
1348         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1349 done
1350 echo "$as_me:1350: result: $includedir" >&5
1351 echo "${ECHO_T}$includedir" >&6
1352 fi
1353
1354 ###     Checks for programs.
1355
1356 ac_ext=c
1357 ac_cpp='$CPP $CPPFLAGS'
1358 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1359 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1360 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1361 ac_main_return="return"
1362 if test -n "$ac_tool_prefix"; then
1363   for ac_prog in gnatgcc gcc cc
1364   do
1365     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1366 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1367 echo "$as_me:1367: checking for $ac_word" >&5
1368 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1369 if test "${ac_cv_prog_CC+set}" = set; then
1370   echo $ECHO_N "(cached) $ECHO_C" >&6
1371 else
1372   if test -n "$CC"; then
1373   ac_cv_prog_CC="$CC" # Let the user override the test.
1374 else
1375   ac_save_IFS=$IFS; IFS=$ac_path_separator
1376 ac_dummy="$PATH"
1377 for ac_dir in $ac_dummy; do
1378   IFS=$ac_save_IFS
1379   test -z "$ac_dir" && ac_dir=.
1380   $as_executable_p "$ac_dir/$ac_word" || continue
1381 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1382 echo "$as_me:1382: found $ac_dir/$ac_word" >&5
1383 break
1384 done
1385
1386 fi
1387 fi
1388 CC=$ac_cv_prog_CC
1389 if test -n "$CC"; then
1390   echo "$as_me:1390: result: $CC" >&5
1391 echo "${ECHO_T}$CC" >&6
1392 else
1393   echo "$as_me:1393: result: no" >&5
1394 echo "${ECHO_T}no" >&6
1395 fi
1396
1397     test -n "$CC" && break
1398   done
1399 fi
1400 if test -z "$CC"; then
1401   ac_ct_CC=$CC
1402   for ac_prog in gnatgcc gcc cc
1403 do
1404   # Extract the first word of "$ac_prog", so it can be a program name with args.
1405 set dummy $ac_prog; ac_word=$2
1406 echo "$as_me:1406: checking for $ac_word" >&5
1407 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1408 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1409   echo $ECHO_N "(cached) $ECHO_C" >&6
1410 else
1411   if test -n "$ac_ct_CC"; then
1412   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1413 else
1414   ac_save_IFS=$IFS; IFS=$ac_path_separator
1415 ac_dummy="$PATH"
1416 for ac_dir in $ac_dummy; do
1417   IFS=$ac_save_IFS
1418   test -z "$ac_dir" && ac_dir=.
1419   $as_executable_p "$ac_dir/$ac_word" || continue
1420 ac_cv_prog_ac_ct_CC="$ac_prog"
1421 echo "$as_me:1421: found $ac_dir/$ac_word" >&5
1422 break
1423 done
1424
1425 fi
1426 fi
1427 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1428 if test -n "$ac_ct_CC"; then
1429   echo "$as_me:1429: result: $ac_ct_CC" >&5
1430 echo "${ECHO_T}$ac_ct_CC" >&6
1431 else
1432   echo "$as_me:1432: result: no" >&5
1433 echo "${ECHO_T}no" >&6
1434 fi
1435
1436   test -n "$ac_ct_CC" && break
1437 done
1438
1439   CC=$ac_ct_CC
1440 fi
1441
1442 test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
1443 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1444    { (exit 1); exit 1; }; }
1445
1446 # Provide some information about the compiler.
1447 echo "$as_me:1447:" \
1448      "checking for C compiler version" >&5
1449 ac_compiler=`set X $ac_compile; echo "$2"`
1450 { (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
1451   (eval $ac_compiler --version </dev/null >&5) 2>&5
1452   ac_status=$?
1453   echo "$as_me:1453: \$? = $ac_status" >&5
1454   (exit "$ac_status"); }
1455 { (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
1456   (eval $ac_compiler -v </dev/null >&5) 2>&5
1457   ac_status=$?
1458   echo "$as_me:1458: \$? = $ac_status" >&5
1459   (exit "$ac_status"); }
1460 { (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
1461   (eval $ac_compiler -V </dev/null >&5) 2>&5
1462   ac_status=$?
1463   echo "$as_me:1463: \$? = $ac_status" >&5
1464   (exit "$ac_status"); }
1465
1466 cat >"conftest.$ac_ext" <<_ACEOF
1467 #line 1467 "configure"
1468 #include "confdefs.h"
1469
1470 int
1471 main (void)
1472 {
1473
1474   ;
1475   return 0;
1476 }
1477 _ACEOF
1478 ac_clean_files_save=$ac_clean_files
1479 ac_clean_files="$ac_clean_files a.out a.exe"
1480 # Try to create an executable without -o first, disregard a.out.
1481 # It will help us diagnose broken compilers, and finding out an intuition
1482 # of exeext.
1483 echo "$as_me:1483: checking for C compiler default output" >&5
1484 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1485 ac_link_default=`echo "$ac_link" | sed 's/ -o *"conftest[^"]*"//'`
1486 if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
1487   (eval $ac_link_default) 2>&5
1488   ac_status=$?
1489   echo "$as_me:1489: \$? = $ac_status" >&5
1490   (exit "$ac_status"); }; then
1491   # Find the output, starting from the most likely.  This scheme is
1492 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1493 # resort.
1494 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1495                 ls a.out conftest 2>/dev/null;
1496                 ls a.* conftest.* 2>/dev/null`; do
1497   case $ac_file in
1498     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1499     a.out ) # We found the default executable, but exeext='' is most
1500             # certainly right.
1501             break;;
1502     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1503           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1504           export ac_cv_exeext
1505           break;;
1506     * ) break;;
1507   esac
1508 done
1509 else
1510   echo "$as_me: failed program was:" >&5
1511 cat "conftest.$ac_ext" >&5
1512 { { echo "$as_me:1512: error: C compiler cannot create executables" >&5
1513 echo "$as_me: error: C compiler cannot create executables" >&2;}
1514    { (exit 77); exit 77; }; }
1515 fi
1516
1517 ac_exeext=$ac_cv_exeext
1518 echo "$as_me:1518: result: $ac_file" >&5
1519 echo "${ECHO_T}$ac_file" >&6
1520
1521 # Check the compiler produces executables we can run.  If not, either
1522 # the compiler is broken, or we cross compile.
1523 echo "$as_me:1523: checking whether the C compiler works" >&5
1524 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1525 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1526 # If not cross compiling, check that we can run a simple program.
1527 if test "$cross_compiling" != yes; then
1528   if { ac_try='./$ac_file'
1529   { (eval echo "$as_me:1529: \"$ac_try\"") >&5
1530   (eval $ac_try) 2>&5
1531   ac_status=$?
1532   echo "$as_me:1532: \$? = $ac_status" >&5
1533   (exit "$ac_status"); }; }; then
1534     cross_compiling=no
1535   else
1536     if test "$cross_compiling" = maybe; then
1537         cross_compiling=yes
1538     else
1539         { { echo "$as_me:1539: error: cannot run C compiled programs.
1540 If you meant to cross compile, use \`--host'." >&5
1541 echo "$as_me: error: cannot run C compiled programs.
1542 If you meant to cross compile, use \`--host'." >&2;}
1543    { (exit 1); exit 1; }; }
1544     fi
1545   fi
1546 fi
1547 echo "$as_me:1547: result: yes" >&5
1548 echo "${ECHO_T}yes" >&6
1549
1550 rm -f a.out a.exe "conftest$ac_cv_exeext"
1551 ac_clean_files=$ac_clean_files_save
1552 # Check the compiler produces executables we can run.  If not, either
1553 # the compiler is broken, or we cross compile.
1554 echo "$as_me:1554: checking whether we are cross compiling" >&5
1555 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1556 echo "$as_me:1556: result: $cross_compiling" >&5
1557 echo "${ECHO_T}$cross_compiling" >&6
1558
1559 echo "$as_me:1559: checking for executable suffix" >&5
1560 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1561 if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
1562   (eval $ac_link) 2>&5
1563   ac_status=$?
1564   echo "$as_me:1564: \$? = $ac_status" >&5
1565   (exit "$ac_status"); }; then
1566   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1567 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1568 # work properly (i.e., refer to `conftest.exe'), while it won't with
1569 # `rm'.
1570 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1571   case $ac_file in
1572     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1573     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1574           export ac_cv_exeext
1575           break;;
1576     * ) break;;
1577   esac
1578 done
1579 else
1580   { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
1581 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1582    { (exit 1); exit 1; }; }
1583 fi
1584
1585 rm -f "conftest$ac_cv_exeext"
1586 echo "$as_me:1586: result: $ac_cv_exeext" >&5
1587 echo "${ECHO_T}$ac_cv_exeext" >&6
1588
1589 rm -f "conftest.$ac_ext"
1590 EXEEXT=$ac_cv_exeext
1591 ac_exeext=$EXEEXT
1592 echo "$as_me:1592: checking for object suffix" >&5
1593 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1594 if test "${ac_cv_objext+set}" = set; then
1595   echo $ECHO_N "(cached) $ECHO_C" >&6
1596 else
1597   cat >"conftest.$ac_ext" <<_ACEOF
1598 #line 1598 "configure"
1599 #include "confdefs.h"
1600
1601 int
1602 main (void)
1603 {
1604
1605   ;
1606   return 0;
1607 }
1608 _ACEOF
1609 rm -f conftest.o conftest.obj
1610 if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
1611   (eval $ac_compile) 2>&5
1612   ac_status=$?
1613   echo "$as_me:1613: \$? = $ac_status" >&5
1614   (exit "$ac_status"); }; then
1615   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1616   case $ac_file in
1617     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1618     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1619        break;;
1620   esac
1621 done
1622 else
1623   echo "$as_me: failed program was:" >&5
1624 cat "conftest.$ac_ext" >&5
1625 { { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
1626 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1627    { (exit 1); exit 1; }; }
1628 fi
1629
1630 rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext"
1631 fi
1632 echo "$as_me:1632: result: $ac_cv_objext" >&5
1633 echo "${ECHO_T}$ac_cv_objext" >&6
1634 OBJEXT=$ac_cv_objext
1635 ac_objext=$OBJEXT
1636 echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
1637 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1638 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1639   echo $ECHO_N "(cached) $ECHO_C" >&6
1640 else
1641   cat >"conftest.$ac_ext" <<_ACEOF
1642 #line 1642 "configure"
1643 #include "confdefs.h"
1644
1645 int
1646 main (void)
1647 {
1648 #ifndef __GNUC__
1649        choke me
1650 #endif
1651
1652   ;
1653   return 0;
1654 }
1655 _ACEOF
1656 rm -f "conftest.$ac_objext"
1657 if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
1658   (eval $ac_compile) 2>&5
1659   ac_status=$?
1660   echo "$as_me:1660: \$? = $ac_status" >&5
1661   (exit "$ac_status"); } &&
1662          { ac_try='test -s "conftest.$ac_objext"'
1663   { (eval echo "$as_me:1663: \"$ac_try\"") >&5
1664   (eval $ac_try) 2>&5
1665   ac_status=$?
1666   echo "$as_me:1666: \$? = $ac_status" >&5
1667   (exit "$ac_status"); }; }; then
1668   ac_compiler_gnu=yes
1669 else
1670   echo "$as_me: failed program was:" >&5
1671 cat "conftest.$ac_ext" >&5
1672 ac_compiler_gnu=no
1673 fi
1674 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1675 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1676
1677 fi
1678 echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
1679 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1680 GCC=`test $ac_compiler_gnu = yes && echo yes`
1681 ac_test_CFLAGS=${CFLAGS+set}
1682 ac_save_CFLAGS=$CFLAGS
1683 CFLAGS="-g"
1684 echo "$as_me:1684: checking whether $CC accepts -g" >&5
1685 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1686 if test "${ac_cv_prog_cc_g+set}" = set; then
1687   echo $ECHO_N "(cached) $ECHO_C" >&6
1688 else
1689   cat >"conftest.$ac_ext" <<_ACEOF
1690 #line 1690 "configure"
1691 #include "confdefs.h"
1692
1693 int
1694 main (void)
1695 {
1696
1697   ;
1698   return 0;
1699 }
1700 _ACEOF
1701 rm -f "conftest.$ac_objext"
1702 if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
1703   (eval $ac_compile) 2>&5
1704   ac_status=$?
1705   echo "$as_me:1705: \$? = $ac_status" >&5
1706   (exit "$ac_status"); } &&
1707          { ac_try='test -s "conftest.$ac_objext"'
1708   { (eval echo "$as_me:1708: \"$ac_try\"") >&5
1709   (eval $ac_try) 2>&5
1710   ac_status=$?
1711   echo "$as_me:1711: \$? = $ac_status" >&5
1712   (exit "$ac_status"); }; }; then
1713   ac_cv_prog_cc_g=yes
1714 else
1715   echo "$as_me: failed program was:" >&5
1716 cat "conftest.$ac_ext" >&5
1717 ac_cv_prog_cc_g=no
1718 fi
1719 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1720 fi
1721 echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
1722 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1723 if test "$ac_test_CFLAGS" = set; then
1724   CFLAGS=$ac_save_CFLAGS
1725 elif test $ac_cv_prog_cc_g = yes; then
1726   if test "$GCC" = yes; then
1727     CFLAGS="-g -O2"
1728   else
1729     CFLAGS="-g"
1730   fi
1731 else
1732   if test "$GCC" = yes; then
1733     CFLAGS="-O2"
1734   else
1735     CFLAGS=
1736   fi
1737 fi
1738 # Some people use a C++ compiler to compile C.  Since we use `exit',
1739 # in C++ we need to declare it.  In case someone uses the same compiler
1740 # for both compiling C and C++ we need to have the C++ compiler decide
1741 # the declaration of exit, since it's the most demanding environment.
1742 cat >"conftest.$ac_ext" <<_ACEOF
1743 #ifndef __cplusplus
1744   choke me
1745 #endif
1746 _ACEOF
1747 rm -f "conftest.$ac_objext"
1748 if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
1749   (eval $ac_compile) 2>&5
1750   ac_status=$?
1751   echo "$as_me:1751: \$? = $ac_status" >&5
1752   (exit "$ac_status"); } &&
1753          { ac_try='test -s "conftest.$ac_objext"'
1754   { (eval echo "$as_me:1754: \"$ac_try\"") >&5
1755   (eval $ac_try) 2>&5
1756   ac_status=$?
1757   echo "$as_me:1757: \$? = $ac_status" >&5
1758   (exit "$ac_status"); }; }; then
1759   for ac_declaration in \
1760    ''\
1761    '#include <stdlib.h>' \
1762    'extern "C" void std::exit (int) throw (); using std::exit;' \
1763    'extern "C" void std::exit (int); using std::exit;' \
1764    'extern "C" void exit (int) throw ();' \
1765    'extern "C" void exit (int);' \
1766    'void exit (int);'
1767 do
1768   cat >"conftest.$ac_ext" <<_ACEOF
1769 #line 1769 "configure"
1770 #include "confdefs.h"
1771 #include <stdlib.h>
1772 $ac_declaration
1773 int
1774 main (void)
1775 {
1776 exit (42);
1777   ;
1778   return 0;
1779 }
1780 _ACEOF
1781 rm -f "conftest.$ac_objext"
1782 if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
1783   (eval $ac_compile) 2>&5
1784   ac_status=$?
1785   echo "$as_me:1785: \$? = $ac_status" >&5
1786   (exit "$ac_status"); } &&
1787          { ac_try='test -s "conftest.$ac_objext"'
1788   { (eval echo "$as_me:1788: \"$ac_try\"") >&5
1789   (eval $ac_try) 2>&5
1790   ac_status=$?
1791   echo "$as_me:1791: \$? = $ac_status" >&5
1792   (exit "$ac_status"); }; }; then
1793   :
1794 else
1795   echo "$as_me: failed program was:" >&5
1796 cat "conftest.$ac_ext" >&5
1797 continue
1798 fi
1799 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1800   cat >"conftest.$ac_ext" <<_ACEOF
1801 #line 1801 "configure"
1802 #include "confdefs.h"
1803 $ac_declaration
1804 int
1805 main (void)
1806 {
1807 exit (42);
1808   ;
1809   return 0;
1810 }
1811 _ACEOF
1812 rm -f "conftest.$ac_objext"
1813 if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
1814   (eval $ac_compile) 2>&5
1815   ac_status=$?
1816   echo "$as_me:1816: \$? = $ac_status" >&5
1817   (exit "$ac_status"); } &&
1818          { ac_try='test -s "conftest.$ac_objext"'
1819   { (eval echo "$as_me:1819: \"$ac_try\"") >&5
1820   (eval $ac_try) 2>&5
1821   ac_status=$?
1822   echo "$as_me:1822: \$? = $ac_status" >&5
1823   (exit "$ac_status"); }; }; then
1824   break
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat "conftest.$ac_ext" >&5
1828 fi
1829 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1830 done
1831 rm -rf conftest*
1832 if test -n "$ac_declaration"; then
1833   echo '#ifdef __cplusplus' >>confdefs.h
1834   echo "$ac_declaration"    >>confdefs.h
1835   echo '#endif'             >>confdefs.h
1836 fi
1837
1838 else
1839   echo "$as_me: failed program was:" >&5
1840 cat "conftest.$ac_ext" >&5
1841 fi
1842 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1843 ac_ext=c
1844 ac_cpp='$CPP $CPPFLAGS'
1845 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
1846 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
1847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1848 ac_main_return="return"
1849
1850 GCC_VERSION=none
1851 if test "$GCC" = yes ; then
1852         echo "$as_me:1852: checking version of $CC" >&5
1853 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1854         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1855         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1856         echo "$as_me:1856: result: $GCC_VERSION" >&5
1857 echo "${ECHO_T}$GCC_VERSION" >&6
1858 fi
1859
1860 INTEL_COMPILER=no
1861
1862 if test "$GCC" = yes ; then
1863         case "$host_os" in
1864         (linux*|gnu*)
1865                 echo "$as_me:1865: checking if this is really Intel C compiler" >&5
1866 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
1867                 cf_save_CFLAGS="$CFLAGS"
1868                 CFLAGS="$CFLAGS -no-gcc"
1869                 cat >"conftest.$ac_ext" <<_ACEOF
1870 #line 1870 "configure"
1871 #include "confdefs.h"
1872
1873 int
1874 main (void)
1875 {
1876
1877 #ifdef __INTEL_COMPILER
1878 #else
1879 make an error
1880 #endif
1881
1882   ;
1883   return 0;
1884 }
1885 _ACEOF
1886 rm -f "conftest.$ac_objext"
1887 if { (eval echo "$as_me:1887: \"$ac_compile\"") >&5
1888   (eval $ac_compile) 2>&5
1889   ac_status=$?
1890   echo "$as_me:1890: \$? = $ac_status" >&5
1891   (exit "$ac_status"); } &&
1892          { ac_try='test -s "conftest.$ac_objext"'
1893   { (eval echo "$as_me:1893: \"$ac_try\"") >&5
1894   (eval $ac_try) 2>&5
1895   ac_status=$?
1896   echo "$as_me:1896: \$? = $ac_status" >&5
1897   (exit "$ac_status"); }; }; then
1898   INTEL_COMPILER=yes
1899 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
1900
1901 else
1902   echo "$as_me: failed program was:" >&5
1903 cat "conftest.$ac_ext" >&5
1904 fi
1905 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1906                 CFLAGS="$cf_save_CFLAGS"
1907                 echo "$as_me:1907: result: $INTEL_COMPILER" >&5
1908 echo "${ECHO_T}$INTEL_COMPILER" >&6
1909                 ;;
1910         esac
1911 fi
1912
1913 CLANG_COMPILER=no
1914
1915 if test "$GCC" = yes ; then
1916         echo "$as_me:1916: checking if this is really Clang C compiler" >&5
1917 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
1918         cf_save_CFLAGS="$CFLAGS"
1919         cat >"conftest.$ac_ext" <<_ACEOF
1920 #line 1920 "configure"
1921 #include "confdefs.h"
1922
1923 int
1924 main (void)
1925 {
1926
1927 #ifdef __clang__
1928 #else
1929 make an error
1930 #endif
1931
1932   ;
1933   return 0;
1934 }
1935 _ACEOF
1936 rm -f "conftest.$ac_objext"
1937 if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
1938   (eval $ac_compile) 2>&5
1939   ac_status=$?
1940   echo "$as_me:1940: \$? = $ac_status" >&5
1941   (exit "$ac_status"); } &&
1942          { ac_try='test -s "conftest.$ac_objext"'
1943   { (eval echo "$as_me:1943: \"$ac_try\"") >&5
1944   (eval $ac_try) 2>&5
1945   ac_status=$?
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit "$ac_status"); }; }; then
1948   CLANG_COMPILER=yes
1949
1950 else
1951   echo "$as_me: failed program was:" >&5
1952 cat "conftest.$ac_ext" >&5
1953 fi
1954 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
1955         CFLAGS="$cf_save_CFLAGS"
1956         echo "$as_me:1956: result: $CLANG_COMPILER" >&5
1957 echo "${ECHO_T}$CLANG_COMPILER" >&6
1958 fi
1959
1960 CLANG_VERSION=none
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         case "$CC" in
1964         (c[1-9][0-9]|*/c[1-9][0-9])
1965                 { echo "$as_me:1965: WARNING: replacing broken compiler alias $CC" >&5
1966 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;}
1967                 CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
1968                 CC=clang
1969                 ;;
1970         esac
1971
1972         echo "$as_me:1972: checking version of $CC" >&5
1973 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1974         CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1975         test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
1976         echo "$as_me:1976: result: $CLANG_VERSION" >&5
1977 echo "${ECHO_T}$CLANG_VERSION" >&6
1978
1979         for cf_clang_opt in \
1980                 -Qunused-arguments \
1981                 -Wno-error=implicit-function-declaration
1982         do
1983                 echo "$as_me:1983: checking if option $cf_clang_opt works" >&5
1984 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1985                 cf_save_CFLAGS="$CFLAGS"
1986                 CFLAGS="$CFLAGS $cf_clang_opt"
1987                 cat >"conftest.$ac_ext" <<_ACEOF
1988 #line 1988 "configure"
1989 #include "confdefs.h"
1990
1991                         #include <stdio.h>
1992 int
1993 main (void)
1994 {
1995
1996                         printf("hello!\\n");
1997   ;
1998   return 0;
1999 }
2000 _ACEOF
2001 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
2002 if { (eval echo "$as_me:2002: \"$ac_link\"") >&5
2003   (eval $ac_link) 2>&5
2004   ac_status=$?
2005   echo "$as_me:2005: \$? = $ac_status" >&5
2006   (exit "$ac_status"); } &&
2007          { ac_try='test -s "conftest$ac_exeext"'
2008   { (eval echo "$as_me:2008: \"$ac_try\"") >&5
2009   (eval $ac_try) 2>&5
2010   ac_status=$?
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit "$ac_status"); }; }; then
2013
2014                         cf_clang_optok=yes
2015 else
2016   echo "$as_me: failed program was:" >&5
2017 cat "conftest.$ac_ext" >&5
2018
2019                         cf_clang_optok=no
2020 fi
2021 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
2022                 echo "$as_me:2022: result: $cf_clang_optok" >&5
2023 echo "${ECHO_T}$cf_clang_optok" >&6
2024                 CFLAGS="$cf_save_CFLAGS"
2025                 if test "$cf_clang_optok" = yes; then
2026                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing adding option $cf_clang_opt ..." 1>&5
2029
2030         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2031         CFLAGS="${CFLAGS}$cf_clang_opt"
2032
2033                 fi
2034         done
2035 fi
2036
2037 echo "$as_me:2037: checking for $CC option to accept ANSI C" >&5
2038 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2039 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2040   echo $ECHO_N "(cached) $ECHO_C" >&6
2041 else
2042   ac_cv_prog_cc_stdc=no
2043 ac_save_CC=$CC
2044 cat >"conftest.$ac_ext" <<_ACEOF
2045 #line 2045 "configure"
2046 #include "confdefs.h"
2047 #include <stdarg.h>
2048 #include <stdio.h>
2049 #include <sys/types.h>
2050 #include <sys/stat.h>
2051 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2052 struct buf { int x; };
2053 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2054 static char *e (p, i)
2055      char **p;
2056      int i;
2057 {
2058   return p[i];
2059 }
2060 static char *f (char * (*g) (char **, int), char **p, ...)
2061 {
2062   char *s;
2063   va_list v;
2064   va_start (v,p);
2065   s = g (p, va_arg (v,int));
2066   va_end (v);
2067   return s;
2068 }
2069 int test (int i, double x);
2070 struct s1 {int (*f) (int a);};
2071 struct s2 {int (*f) (double a);};
2072 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2073 int argc;
2074 char **argv;
2075 int
2076 main (void)
2077 {
2078 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2079   ;
2080   return 0;
2081 }
2082 _ACEOF
2083 # Don't try gcc -ansi; that turns off useful extensions and
2084 # breaks some systems' header files.
2085 # AIX                   -qlanglvl=ansi
2086 # Ultrix and OSF/1      -std1
2087 # HP-UX 10.20 and later -Ae
2088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2089 # SVR4                  -Xc -D__EXTENSIONS__
2090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2091 do
2092   CC="$ac_save_CC $ac_arg"
2093   rm -f "conftest.$ac_objext"
2094 if { (eval echo "$as_me:2094: \"$ac_compile\"") >&5
2095   (eval $ac_compile) 2>&5
2096   ac_status=$?
2097   echo "$as_me:2097: \$? = $ac_status" >&5
2098   (exit "$ac_status"); } &&
2099          { ac_try='test -s "conftest.$ac_objext"'
2100   { (eval echo "$as_me:2100: \"$ac_try\"") >&5
2101   (eval $ac_try) 2>&5
2102   ac_status=$?
2103   echo "$as_me:2103: \$? = $ac_status" >&5
2104   (exit "$ac_status"); }; }; then
2105   ac_cv_prog_cc_stdc=$ac_arg
2106 break
2107 else
2108   echo "$as_me: failed program was:" >&5
2109 cat "conftest.$ac_ext" >&5
2110 fi
2111 rm -f "conftest.$ac_objext"
2112 done
2113 rm -f "conftest.$ac_ext" "conftest.$ac_objext"
2114 CC=$ac_save_CC
2115
2116 fi
2117
2118 case "x$ac_cv_prog_cc_stdc" in
2119   x|xno)
2120     echo "$as_me:2120: result: none needed" >&5
2121 echo "${ECHO_T}none needed" >&6 ;;
2122   *)
2123     echo "$as_me:2123: result: $ac_cv_prog_cc_stdc" >&5
2124 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2125     CC="$CC $ac_cv_prog_cc_stdc" ;;
2126 esac
2127
2128 # This should have been defined by AC_PROG_CC
2129 : "${CC:=cc}"
2130
2131 echo "$as_me:2131: checking \$CFLAGS variable" >&5
2132 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2133 case "x$CFLAGS" in
2134 (*-[IUD]*)
2135         echo "$as_me:2135: result: broken" >&5
2136 echo "${ECHO_T}broken" >&6
2137         { echo "$as_me:2137: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2138 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2139         cf_flags="$CFLAGS"
2140         CFLAGS=
2141         for cf_arg in $cf_flags
2142         do
2143
2144 cf_fix_cppflags=no
2145 cf_new_cflags=
2146 cf_new_cppflags=
2147 cf_new_extra_cppflags=
2148
2149 for cf_add_cflags in $cf_arg
2150 do
2151 case "$cf_fix_cppflags" in
2152 (no)
2153         case "$cf_add_cflags" in
2154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2155                 case "$cf_add_cflags" in
2156                 (-D*)
2157                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2158
2159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                                 && test -z "${cf_tst_cflags}" \
2161                                 && cf_fix_cppflags=yes
2162
2163                         if test "$cf_fix_cppflags" = yes ; then
2164
2165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2167
2168                                 continue
2169                         elif test "${cf_tst_cflags}" = "\"'" ; then
2170
2171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2173
2174                                 continue
2175                         fi
2176                         ;;
2177                 esac
2178                 case "$CPPFLAGS" in
2179                 (*$cf_add_cflags)
2180                         ;;
2181                 (*)
2182                         case "$cf_add_cflags" in
2183                         (-D*)
2184                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2185
2186 CPPFLAGS=`echo "$CPPFLAGS" | \
2187         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2188                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2189
2190                                 ;;
2191                         esac
2192
2193         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2194         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2195
2196                         ;;
2197                 esac
2198                 ;;
2199         (*)
2200
2201         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2202         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2203
2204                 ;;
2205         esac
2206         ;;
2207 (yes)
2208
2209         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2210         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2211
2212         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2213
2214         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2215                 && test -z "${cf_tst_cflags}" \
2216                 && cf_fix_cppflags=no
2217         ;;
2218 esac
2219 done
2220
2221 if test -n "$cf_new_cflags" ; then
2222
2223         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2224         CFLAGS="${CFLAGS}$cf_new_cflags"
2225
2226 fi
2227
2228 if test -n "$cf_new_cppflags" ; then
2229
2230         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2231         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2232
2233 fi
2234
2235 if test -n "$cf_new_extra_cppflags" ; then
2236
2237         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2238         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2239
2240 fi
2241
2242         done
2243         ;;
2244 (*)
2245         echo "$as_me:2245: result: ok" >&5
2246 echo "${ECHO_T}ok" >&6
2247         ;;
2248 esac
2249
2250 echo "$as_me:2250: checking \$CC variable" >&5
2251 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2252 case "$CC" in
2253 (*[\ \  ]-*)
2254         echo "$as_me:2254: result: broken" >&5
2255 echo "${ECHO_T}broken" >&6
2256         { echo "$as_me:2256: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2257 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2258         # humor him...
2259         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2260         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2261         CC="$cf_prog"
2262         for cf_arg in $cf_flags
2263         do
2264                 case "x$cf_arg" in
2265                 (x-[IUDfgOW]*)
2266
2267 cf_fix_cppflags=no
2268 cf_new_cflags=
2269 cf_new_cppflags=
2270 cf_new_extra_cppflags=
2271
2272 for cf_add_cflags in $cf_arg
2273 do
2274 case "$cf_fix_cppflags" in
2275 (no)
2276         case "$cf_add_cflags" in
2277         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2278                 case "$cf_add_cflags" in
2279                 (-D*)
2280                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2281
2282                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2283                                 && test -z "${cf_tst_cflags}" \
2284                                 && cf_fix_cppflags=yes
2285
2286                         if test "$cf_fix_cppflags" = yes ; then
2287
2288         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2289         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2290
2291                                 continue
2292                         elif test "${cf_tst_cflags}" = "\"'" ; then
2293
2294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2296
2297                                 continue
2298                         fi
2299                         ;;
2300                 esac
2301                 case "$CPPFLAGS" in
2302                 (*$cf_add_cflags)
2303                         ;;
2304                 (*)
2305                         case "$cf_add_cflags" in
2306                         (-D*)
2307                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2308
2309 CPPFLAGS=`echo "$CPPFLAGS" | \
2310         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2311                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2312
2313                                 ;;
2314                         esac
2315
2316         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2317         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2318
2319                         ;;
2320                 esac
2321                 ;;
2322         (*)
2323
2324         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2325         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2326
2327                 ;;
2328         esac
2329         ;;
2330 (yes)
2331
2332         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2333         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2334
2335         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
2336
2337         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2338                 && test -z "${cf_tst_cflags}" \
2339                 && cf_fix_cppflags=no
2340         ;;
2341 esac
2342 done
2343
2344 if test -n "$cf_new_cflags" ; then
2345
2346         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2347         CFLAGS="${CFLAGS}$cf_new_cflags"
2348
2349 fi
2350
2351 if test -n "$cf_new_cppflags" ; then
2352
2353         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2354         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2355
2356 fi
2357
2358 if test -n "$cf_new_extra_cppflags" ; then
2359
2360         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2361         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2362
2363 fi
2364
2365                         ;;
2366                 (*)
2367                         CC="$CC $cf_arg"
2368                         ;;
2369                 esac
2370         done
2371         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2372
2373 echo "${as_me:-configure}:2373: testing resulting CC: '$CC' ..." 1>&5
2374
2375         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2376
2377 echo "${as_me:-configure}:2377: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2378
2379         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2380
2381 echo "${as_me:-configure}:2381: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2382
2383         ;;
2384 (*)
2385         echo "$as_me:2385: result: ok" >&5
2386 echo "${ECHO_T}ok" >&6
2387         ;;
2388 esac
2389
2390 echo "$as_me:2390: checking for egrep" >&5
2391 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2392 if test "${ac_cv_path_EGREP+set}" = set; then
2393   echo $ECHO_N "(cached) $ECHO_C" >&6
2394 else
2395   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
2396    then ac_cv_path_EGREP="$GREP -E"
2397    else
2398      for ac_prog in gegrep egrep
2399 do
2400   # Extract the first word of "$ac_prog", so it can be a program name with args.
2401 set dummy $ac_prog; ac_word=$2
2402 echo "$as_me:2402: checking for $ac_word" >&5
2403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2404 if test "${ac_cv_path_EGREP+set}" = set; then
2405   echo $ECHO_N "(cached) $ECHO_C" >&6
2406 else
2407   case $EGREP in
2408   [\\/]* | ?:[\\/]*)
2409   ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
2410   ;;
2411   *)
2412   ac_save_IFS=$IFS; IFS=$ac_path_separator
2413 ac_dummy="$PATH"
2414 for ac_dir in $ac_dummy; do
2415   IFS=$ac_save_IFS
2416   test -z "$ac_dir" && ac_dir=.
2417   if $as_executable_p "$ac_dir/$ac_word"; then
2418    ac_cv_path_EGREP="$ac_dir/$ac_word"
2419    echo "$as_me:2419: found $ac_dir/$ac_word" >&5
2420    break
2421 fi
2422 done
2423
2424   ;;
2425 esac
2426 fi
2427 EGREP=$ac_cv_path_EGREP
2428
2429 if test -n "$EGREP"; then
2430   echo "$as_me:2430: result: $EGREP" >&5
2431 echo "${ECHO_T}$EGREP" >&6
2432 else
2433   echo "$as_me:2433: result: no" >&5
2434 echo "${ECHO_T}no" >&6
2435 fi
2436
2437   test -n "$EGREP" && break
2438 done
2439 test -n "$EGREP" || EGREP=": "
2440
2441      test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2441: error: cannot find workable egrep" >&5
2442 echo "$as_me: error: cannot find workable egrep" >&2;}
2443    { (exit 1); exit 1; }; }
2444    fi
2445 fi
2446 echo "$as_me:2446: result: $ac_cv_path_EGREP" >&5
2447 echo "${ECHO_T}$ac_cv_path_EGREP" >&6
2448  EGREP="$ac_cv_path_EGREP"
2449
2450 ac_ext=c
2451 ac_cpp='$CPP $CPPFLAGS'
2452 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2453 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2454 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2455 ac_main_return="return"
2456 echo "$as_me:2456: checking how to run the C preprocessor" >&5
2457 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2458 # On Suns, sometimes $CPP names a directory.
2459 if test -n "$CPP" && test -d "$CPP"; then
2460   CPP=
2461 fi
2462 if test -z "$CPP"; then
2463   if test "${ac_cv_prog_CPP+set}" = set; then
2464   echo $ECHO_N "(cached) $ECHO_C" >&6
2465 else
2466       # Double quotes because CPP needs to be expanded
2467     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2468     do
2469       ac_preproc_ok=false
2470 for ac_c_preproc_warn_flag in '' yes
2471 do
2472   # Use a header file that comes with gcc, so configuring glibc
2473   # with a fresh cross-compiler works.
2474   # On the NeXT, cc -E runs the code through the compiler's parser,
2475   # not just through cpp. "Syntax error" is here to catch this case.
2476   cat >"conftest.$ac_ext" <<_ACEOF
2477 #line 2477 "configure"
2478 #include "confdefs.h"
2479 #include <assert.h>
2480                      Syntax error
2481 _ACEOF
2482 if { (eval echo "$as_me:2482: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2483   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2484   ac_status=$?
2485   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2486   rm -f conftest.er1
2487   cat conftest.err >&5
2488   echo "$as_me:2488: \$? = $ac_status" >&5
2489   (exit "$ac_status"); } >/dev/null; then
2490   if test -s conftest.err; then
2491     ac_cpp_err=$ac_c_preproc_warn_flag
2492   else
2493     ac_cpp_err=
2494   fi
2495 else
2496   ac_cpp_err=yes
2497 fi
2498 if test -z "$ac_cpp_err"; then
2499   :
2500 else
2501   echo "$as_me: failed program was:" >&5
2502   cat "conftest.$ac_ext" >&5
2503   # Broken: fails on valid input.
2504 continue
2505 fi
2506 rm -f conftest.err "conftest.$ac_ext"
2507
2508   # OK, works on sane cases.  Now check whether non-existent headers
2509   # can be detected and how.
2510   cat >"conftest.$ac_ext" <<_ACEOF
2511 #line 2511 "configure"
2512 #include "confdefs.h"
2513 #include <ac_nonexistent.h>
2514 _ACEOF
2515 if { (eval echo "$as_me:2515: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2516   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2517   ac_status=$?
2518   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2519   rm -f conftest.er1
2520   cat conftest.err >&5
2521   echo "$as_me:2521: \$? = $ac_status" >&5
2522   (exit "$ac_status"); } >/dev/null; then
2523   if test -s conftest.err; then
2524     ac_cpp_err=$ac_c_preproc_warn_flag
2525   else
2526     ac_cpp_err=
2527   fi
2528 else
2529   ac_cpp_err=yes
2530 fi
2531 if test -z "$ac_cpp_err"; then
2532   # Broken: success on invalid input.
2533 continue
2534 else
2535   echo "$as_me: failed program was:" >&5
2536   cat "conftest.$ac_ext" >&5
2537   # Passes both tests.
2538 ac_preproc_ok=:
2539 break
2540 fi
2541 rm -f conftest.err "conftest.$ac_ext"
2542
2543 done
2544 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2545 rm -f conftest.err "conftest.$ac_ext"
2546 if $ac_preproc_ok; then
2547   break
2548 fi
2549
2550     done
2551     ac_cv_prog_CPP=$CPP
2552
2553 fi
2554   CPP=$ac_cv_prog_CPP
2555 else
2556   ac_cv_prog_CPP=$CPP
2557 fi
2558 echo "$as_me:2558: result: $CPP" >&5
2559 echo "${ECHO_T}$CPP" >&6
2560 ac_preproc_ok=false
2561 for ac_c_preproc_warn_flag in '' yes
2562 do
2563   # Use a header file that comes with gcc, so configuring glibc
2564   # with a fresh cross-compiler works.
2565   # On the NeXT, cc -E runs the code through the compiler's parser,
2566   # not just through cpp. "Syntax error" is here to catch this case.
2567   cat >"conftest.$ac_ext" <<_ACEOF
2568 #line 2568 "configure"
2569 #include "confdefs.h"
2570 #include <assert.h>
2571                      Syntax error
2572 _ACEOF
2573 if { (eval echo "$as_me:2573: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2574   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2575   ac_status=$?
2576   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2577   rm -f conftest.er1
2578   cat conftest.err >&5
2579   echo "$as_me:2579: \$? = $ac_status" >&5
2580   (exit "$ac_status"); } >/dev/null; then
2581   if test -s conftest.err; then
2582     ac_cpp_err=$ac_c_preproc_warn_flag
2583   else
2584     ac_cpp_err=
2585   fi
2586 else
2587   ac_cpp_err=yes
2588 fi
2589 if test -z "$ac_cpp_err"; then
2590   :
2591 else
2592   echo "$as_me: failed program was:" >&5
2593   cat "conftest.$ac_ext" >&5
2594   # Broken: fails on valid input.
2595 continue
2596 fi
2597 rm -f conftest.err "conftest.$ac_ext"
2598
2599   # OK, works on sane cases.  Now check whether non-existent headers
2600   # can be detected and how.
2601   cat >"conftest.$ac_ext" <<_ACEOF
2602 #line 2602 "configure"
2603 #include "confdefs.h"
2604 #include <ac_nonexistent.h>
2605 _ACEOF
2606 if { (eval echo "$as_me:2606: \"$ac_cpp "conftest.$ac_ext"\"") >&5
2607   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
2608   ac_status=$?
2609   $EGREP -v '^ *\+' conftest.er1 >conftest.err
2610   rm -f conftest.er1
2611   cat conftest.err >&5
2612   echo "$as_me:2612: \$? = $ac_status" >&5
2613   (exit "$ac_status"); } >/dev/null; then
2614   if test -s conftest.err; then
2615     ac_cpp_err=$ac_c_preproc_warn_flag
2616   else
2617     ac_cpp_err=
2618   fi
2619 else
2620   ac_cpp_err=yes
2621 fi
2622 if test -z "$ac_cpp_err"; then
2623   # Broken: success on invalid input.
2624 continue
2625 else
2626   echo "$as_me: failed program was:" >&5
2627   cat "conftest.$ac_ext" >&5
2628   # Passes both tests.
2629 ac_preproc_ok=:
2630 break
2631 fi
2632 rm -f conftest.err "conftest.$ac_ext"
2633
2634 done
2635 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2636 rm -f conftest.err "conftest.$ac_ext"
2637 if $ac_preproc_ok; then
2638   :
2639 else
2640   { { echo "$as_me:2640: error: C preprocessor \"$CPP\" fails sanity check" >&5
2641 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2642    { (exit 1); exit 1; }; }
2643 fi
2644
2645 ac_ext=c
2646 ac_cpp='$CPP $CPPFLAGS'
2647 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
2648 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
2649 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2650 ac_main_return="return"
2651
2652 if test $ac_cv_c_compiler_gnu = yes; then
2653     echo "$as_me:2653: checking whether $CC needs -traditional" >&5
2654 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2655 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2656   echo $ECHO_N "(cached) $ECHO_C" >&6
2657 else
2658     ac_pattern="Autoconf.*'x'"
2659   cat >"conftest.$ac_ext" <<_ACEOF
2660 #line 2660 "configure"
2661 #include "confdefs.h"
2662 #include <sgtty.h>
2663 int Autoconf = TIOCGETP;
2664 _ACEOF
2665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2666   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2667   ac_cv_prog_gcc_traditional=yes
2668 else
2669   ac_cv_prog_gcc_traditional=no
2670 fi
2671 rm -rf conftest*
2672
2673   if test $ac_cv_prog_gcc_traditional = no; then
2674     cat >"conftest.$ac_ext" <<_ACEOF
2675 #line 2675 "configure"
2676 #include "confdefs.h"
2677 #include <termio.h>
2678 int Autoconf = TCGETA;
2679 _ACEOF
2680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2681   $EGREP "$ac_pattern" >/dev/null 2>&1; then
2682   ac_cv_prog_gcc_traditional=yes
2683 fi
2684 rm -rf conftest*
2685
2686   fi
2687 fi
2688 echo "$as_me:2688: result: $ac_cv_prog_gcc_traditional" >&5
2689 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2690   if test $ac_cv_prog_gcc_traditional = yes; then
2691     CC="$CC -traditional"
2692   fi
2693 fi
2694
2695 echo "$as_me:2695: checking whether $CC understands -c and -o together" >&5
2696 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2697 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2698   echo $ECHO_N "(cached) $ECHO_C" >&6
2699 else
2700
2701 cat > conftest.$ac_ext <<CF_EOF
2702 int main(void)
2703 {
2704         ${cf_cv_main_return:-return}(0);
2705 }
2706 CF_EOF
2707 # We do the test twice because some compilers refuse to overwrite an
2708 # existing .o file with -o, though they will create one.
2709 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2710 if { (eval echo "$as_me:2710: \"$ac_try\"") >&5
2711   (eval $ac_try) 2>&5
2712   ac_status=$?
2713   echo "$as_me:2713: \$? = $ac_status" >&5
2714   (exit "$ac_status"); } &&
2715   test -f conftest2.$ac_objext && { (eval echo "$as_me:2715: \"$ac_try\"") >&5
2716   (eval $ac_try) 2>&5
2717   ac_status=$?
2718   echo "$as_me:2718: \$? = $ac_status" >&5
2719   (exit "$ac_status"); };
2720 then
2721   eval cf_cv_prog_CC_c_o=yes
2722 else
2723   eval cf_cv_prog_CC_c_o=no
2724 fi
2725 rm -rf ./conftest*
2726
2727 fi
2728 if test "$cf_cv_prog_CC_c_o" = yes; then
2729   echo "$as_me:2729: result: yes" >&5
2730 echo "${ECHO_T}yes" >&6
2731 else
2732   echo "$as_me:2732: result: no" >&5
2733 echo "${ECHO_T}no" >&6
2734 fi
2735
2736 test "$program_prefix" != NONE &&
2737   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2738 # Use a double $ so make ignores it.
2739 test "$program_suffix" != NONE &&
2740   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2741 # Double any \ or $.  echo might interpret backslashes.
2742 # By default was `s,x,x', remove it if useless.
2743 cat <<\_ACEOF >conftest.sed
2744 s/[\\$]/&&/g;s/;s,x,x,$//
2745 _ACEOF
2746 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2747 rm conftest.sed
2748
2749 for ac_prog in mawk gawk nawk awk
2750 do
2751   # Extract the first word of "$ac_prog", so it can be a program name with args.
2752 set dummy $ac_prog; ac_word=$2
2753 echo "$as_me:2753: checking for $ac_word" >&5
2754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2755 if test "${ac_cv_prog_AWK+set}" = set; then
2756   echo $ECHO_N "(cached) $ECHO_C" >&6
2757 else
2758   if test -n "$AWK"; then
2759   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2760 else
2761   ac_save_IFS=$IFS; IFS=$ac_path_separator
2762 ac_dummy="$PATH"
2763 for ac_dir in $ac_dummy; do
2764   IFS=$ac_save_IFS
2765   test -z "$ac_dir" && ac_dir=.
2766   $as_executable_p "$ac_dir/$ac_word" || continue
2767 ac_cv_prog_AWK="$ac_prog"
2768 echo "$as_me:2768: found $ac_dir/$ac_word" >&5
2769 break
2770 done
2771
2772 fi
2773 fi
2774 AWK=$ac_cv_prog_AWK
2775 if test -n "$AWK"; then
2776   echo "$as_me:2776: result: $AWK" >&5
2777 echo "${ECHO_T}$AWK" >&6
2778 else
2779   echo "$as_me:2779: result: no" >&5
2780 echo "${ECHO_T}no" >&6
2781 fi
2782
2783   test -n "$AWK" && break
2784 done
2785
2786 test -z "$AWK" && { { echo "$as_me:2786: error: No awk program found" >&5
2787 echo "$as_me: error: No awk program found" >&2;}
2788    { (exit 1); exit 1; }; }
2789
2790 echo "$as_me:2790: checking for egrep" >&5
2791 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2792 if test "${ac_cv_prog_egrep+set}" = set; then
2793   echo $ECHO_N "(cached) $ECHO_C" >&6
2794 else
2795   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2796                 then ac_cv_prog_egrep='grep -E'
2797                 else ac_cv_prog_egrep='egrep'
2798         fi
2799 fi
2800 echo "$as_me:2800: result: $ac_cv_prog_egrep" >&5
2801 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2802         EGREP=$ac_cv_prog_egrep
2803
2804         test -z "$EGREP" && { { echo "$as_me:2804: error: No egrep program found" >&5
2805 echo "$as_me: error: No egrep program found" >&2;}
2806    { (exit 1); exit 1; }; }
2807
2808 # Find a good install program.  We prefer a C program (faster),
2809 # so one script is as good as another.  But avoid the broken or
2810 # incompatible versions:
2811 # SysV /etc/install, /usr/sbin/install
2812 # SunOS /usr/etc/install
2813 # IRIX /sbin/install
2814 # AIX /bin/install
2815 # AmigaOS /C/install, which installs bootblocks on floppy discs
2816 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2817 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2818 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2819 # ./install, which can be erroneously created by make from ./install.sh.
2820 echo "$as_me:2820: checking for a BSD compatible install" >&5
2821 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2822 if test -z "$INSTALL"; then
2823 if test "${ac_cv_path_install+set}" = set; then
2824   echo $ECHO_N "(cached) $ECHO_C" >&6
2825 else
2826     ac_save_IFS=$IFS; IFS=$ac_path_separator
2827   for ac_dir in $PATH; do
2828     IFS=$ac_save_IFS
2829     # Account for people who put trailing slashes in PATH elements.
2830     case $ac_dir/ in
2831     / | ./ | .// | /cC/* \
2832     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2833     | /usr/ucb/* ) ;;
2834     *)
2835       # OSF1 and SCO ODT 3.0 have their own names for install.
2836       # Don't use installbsd from OSF since it installs stuff as root
2837       # by default.
2838       for ac_prog in ginstall scoinst install; do
2839         if $as_executable_p "$ac_dir/$ac_prog"; then
2840           if test $ac_prog = install &&
2841             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2842             # AIX install.  It has an incompatible calling convention.
2843             :
2844           elif test $ac_prog = install &&
2845             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2846             # program-specific install script used by HP pwplus--don't use.
2847             :
2848           else
2849             ac_cv_path_install="$ac_dir/$ac_prog -c"
2850             break 2
2851           fi
2852         fi
2853       done
2854       ;;
2855     esac
2856   done
2857
2858 fi
2859   if test "${ac_cv_path_install+set}" = set; then
2860     INSTALL=$ac_cv_path_install
2861   else
2862     # As a last resort, use the slow shell script.  We don't cache a
2863     # path for INSTALL within a source directory, because that will
2864     # break other packages using the cache if that directory is
2865     # removed, or if the path is relative.
2866     INSTALL=$ac_install_sh
2867   fi
2868 fi
2869 echo "$as_me:2869: result: $INSTALL" >&5
2870 echo "${ECHO_T}$INSTALL" >&6
2871
2872 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2873 # It thinks the first close brace ends the variable substitution.
2874 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2875
2876 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2877
2878 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2879
2880 echo "$as_me:2880: checking whether ln -s works" >&5
2881 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2882 LN_S=$as_ln_s
2883 if test "$LN_S" = "ln -s"; then
2884   echo "$as_me:2884: result: yes" >&5
2885 echo "${ECHO_T}yes" >&6
2886 else
2887   echo "$as_me:2887: result: no, using $LN_S" >&5
2888 echo "${ECHO_T}no, using $LN_S" >&6
2889 fi
2890
2891 echo "$as_me:2891: checking if $LN_S -f options work" >&5
2892 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2893
2894 rm -f conf$$.src conf$$dst
2895 echo >conf$$.dst
2896 echo first >conf$$.src
2897 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2898         cf_prog_ln_sf=yes
2899 else
2900         cf_prog_ln_sf=no
2901 fi
2902 rm -f conf$$.dst conf$$src
2903 echo "$as_me:2903: result: $cf_prog_ln_sf" >&5
2904 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2905
2906 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2907
2908 # Find a good install program.  We prefer a C program (faster),
2909 # so one script is as good as another.  But avoid the broken or
2910 # incompatible versions:
2911 # SysV /etc/install, /usr/sbin/install
2912 # SunOS /usr/etc/install
2913 # IRIX /sbin/install
2914 # AIX /bin/install
2915 # AmigaOS /C/install, which installs bootblocks on floppy discs
2916 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2917 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2918 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2919 # ./install, which can be erroneously created by make from ./install.sh.
2920 echo "$as_me:2920: checking for a BSD compatible install" >&5
2921 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2922 if test -z "$INSTALL"; then
2923 if test "${ac_cv_path_install+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" >&6
2925 else
2926     ac_save_IFS=$IFS; IFS=$ac_path_separator
2927   for ac_dir in $PATH; do
2928     IFS=$ac_save_IFS
2929     # Account for people who put trailing slashes in PATH elements.
2930     case $ac_dir/ in
2931     / | ./ | .// | /cC/* \
2932     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2933     | /usr/ucb/* ) ;;
2934     *)
2935       # OSF1 and SCO ODT 3.0 have their own names for install.
2936       # Don't use installbsd from OSF since it installs stuff as root
2937       # by default.
2938       for ac_prog in ginstall scoinst install; do
2939         if $as_executable_p "$ac_dir/$ac_prog"; then
2940           if test $ac_prog = install &&
2941             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2942             # AIX install.  It has an incompatible calling convention.
2943             :
2944           elif test $ac_prog = install &&
2945             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2946             # program-specific install script used by HP pwplus--don't use.
2947             :
2948           else
2949             ac_cv_path_install="$ac_dir/$ac_prog -c"
2950             break 2
2951           fi
2952         fi
2953       done
2954       ;;
2955     esac
2956   done
2957
2958 fi
2959   if test "${ac_cv_path_install+set}" = set; then
2960     INSTALL=$ac_cv_path_install
2961   else
2962     # As a last resort, use the slow shell script.  We don't cache a
2963     # path for INSTALL within a source directory, because that will
2964     # break other packages using the cache if that directory is
2965     # removed, or if the path is relative.
2966     INSTALL=$ac_install_sh
2967   fi
2968 fi
2969 echo "$as_me:2969: result: $INSTALL" >&5
2970 echo "${ECHO_T}$INSTALL" >&6
2971
2972 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2973 # It thinks the first close brace ends the variable substitution.
2974 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2975
2976 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2977
2978 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2979
2980 case $INSTALL in
2981 (/*)
2982         ;;
2983 (*)
2984         cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'`
2985         test -z "$cf_dir" && cf_dir=.
2986         INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`"
2987         ;;
2988 esac
2989
2990 echo "$as_me:2990: checking if you want to install stripped executables" >&5
2991 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2992
2993 # Check whether --enable-stripping or --disable-stripping was given.
2994 if test "${enable_stripping+set}" = set; then
2995   enableval="$enable_stripping"
2996   test "$enableval" != no && enableval=yes
2997         if test "$enableval" != "yes" ; then
2998     enable_stripping=no
2999         else
3000                 enable_stripping=yes
3001         fi
3002 else
3003   enableval=yes
3004         enable_stripping=yes
3005
3006 fi;
3007 echo "$as_me:3007: result: $enable_stripping" >&5
3008 echo "${ECHO_T}$enable_stripping" >&6
3009
3010 if test "$enable_stripping" = yes
3011 then
3012         INSTALL_OPT_S="-s"
3013 else
3014         INSTALL_OPT_S=
3015 fi
3016
3017 : "${INSTALL:=install}"
3018 echo "$as_me:3018: checking if install accepts -p option" >&5
3019 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
3020 if test "${cf_cv_install_p+set}" = set; then
3021   echo $ECHO_N "(cached) $ECHO_C" >&6
3022 else
3023
3024         rm -rf ./conftest*
3025         date >conftest.in
3026         mkdir conftest.out
3027         sleep 3
3028         if $INSTALL -p conftest.in conftest.out 2>/dev/null
3029         then
3030                 if test -f conftest.out/conftest.in
3031                 then
3032                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
3033                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
3034                         if test -s conftest.err
3035                         then
3036                                 cf_cv_install_p=no
3037                         else
3038                                 cf_cv_install_p=yes
3039                         fi
3040                 else
3041                         cf_cv_install_p=no
3042                 fi
3043         else
3044                 cf_cv_install_p=no
3045         fi
3046         rm -rf ./conftest*
3047
3048 fi
3049 echo "$as_me:3049: result: $cf_cv_install_p" >&5
3050 echo "${ECHO_T}$cf_cv_install_p" >&6
3051
3052 echo "$as_me:3052: checking if install needs to be told about ownership" >&5
3053 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
3054 case `$ac_config_guess` in
3055 (*minix)
3056         with_install_o=yes
3057         ;;
3058 (*)
3059         with_install_o=no
3060         ;;
3061 esac
3062
3063 echo "$as_me:3063: result: $with_install_o" >&5
3064 echo "${ECHO_T}$with_install_o" >&6
3065 if test "x$with_install_o" = xyes
3066 then
3067         INSTALL_OPT_O="`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`"
3068 else
3069         INSTALL_OPT_O=
3070 fi
3071
3072 echo "$as_me:3072: checking for long file names" >&5
3073 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
3074 if test "${ac_cv_sys_long_file_names+set}" = set; then
3075   echo $ECHO_N "(cached) $ECHO_C" >&6
3076 else
3077   ac_cv_sys_long_file_names=yes
3078 # Test for long file names in all the places we know might matter:
3079 #      .                the current directory, where building will happen
3080 #      $prefix/lib      where we will be installing things
3081 #      $exec_prefix/lib likewise
3082 # eval it to expand exec_prefix.
3083 #      $TMPDIR          if set, where it might want to write temporary files
3084 # if $TMPDIR is not set:
3085 #      /tmp             where it might want to write temporary files
3086 #      /var/tmp         likewise
3087 #      /usr/tmp         likewise
3088 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
3089   ac_tmpdirs=$TMPDIR
3090 else
3091   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
3092 fi
3093 for ac_dir in  . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do
3094   test -d "$ac_dir" || continue
3095   test -w "$ac_dir" || continue # It is less confusing to not echo anything here.
3096   ac_xdir=$ac_dir/cf$$
3097   (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
3098   ac_tf1=$ac_xdir/conftest9012345
3099   ac_tf2=$ac_xdir/conftest9012346
3100   (echo 1 >"$ac_tf1") 2>/dev/null
3101   (echo 2 >"$ac_tf2") 2>/dev/null
3102   ac_val=`cat "$ac_tf1" 2>/dev/null`
3103   if test ! -f "$ac_tf1" || test "$ac_val" != 1; then
3104     ac_cv_sys_long_file_names=no
3105     rm -rf "$ac_xdir" 2>/dev/null
3106     break
3107   fi
3108   rm -rf "$ac_xdir" 2>/dev/null
3109 done
3110 fi
3111 echo "$as_me:3111: result: $ac_cv_sys_long_file_names" >&5
3112 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
3113 if test "$ac_cv_sys_long_file_names" = yes; then
3114
3115 cat >>confdefs.h <<\EOF
3116 #define HAVE_LONG_FILE_NAMES 1
3117 EOF
3118
3119 fi
3120
3121 # if we find pkg-config, check if we should install the ".pc" files.
3122
3123 echo "$as_me:3123: checking if you want to use pkg-config" >&5
3124 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
3125
3126 # Check whether --with-pkg-config or --without-pkg-config was given.
3127 if test "${with_pkg_config+set}" = set; then
3128   withval="$with_pkg_config"
3129   cf_pkg_config=$withval
3130 else
3131   cf_pkg_config=yes
3132 fi;
3133 echo "$as_me:3133: result: $cf_pkg_config" >&5
3134 echo "${ECHO_T}$cf_pkg_config" >&6
3135
3136 case "$cf_pkg_config" in
3137 (no)
3138         PKG_CONFIG=none
3139         ;;
3140 (yes)
3141
3142 if test -n "$ac_tool_prefix"; then
3143   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3144 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3145 echo "$as_me:3145: checking for $ac_word" >&5
3146 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3147 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
3148   echo $ECHO_N "(cached) $ECHO_C" >&6
3149 else
3150   case $PKG_CONFIG in
3151   [\\/]* | ?:[\\/]*)
3152   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3153   ;;
3154   *)
3155   ac_save_IFS=$IFS; IFS=$ac_path_separator
3156 ac_dummy="$PATH"
3157 for ac_dir in $ac_dummy; do
3158   IFS=$ac_save_IFS
3159   test -z "$ac_dir" && ac_dir=.
3160   if $as_executable_p "$ac_dir/$ac_word"; then
3161    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
3162    echo "$as_me:3162: found $ac_dir/$ac_word" >&5
3163    break
3164 fi
3165 done
3166
3167   ;;
3168 esac
3169 fi
3170 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3171
3172 if test -n "$PKG_CONFIG"; then
3173   echo "$as_me:3173: result: $PKG_CONFIG" >&5
3174 echo "${ECHO_T}$PKG_CONFIG" >&6
3175 else
3176   echo "$as_me:3176: result: no" >&5
3177 echo "${ECHO_T}no" >&6
3178 fi
3179
3180 fi
3181 if test -z "$ac_cv_path_PKG_CONFIG"; then
3182   ac_pt_PKG_CONFIG=$PKG_CONFIG
3183   # Extract the first word of "pkg-config", so it can be a program name with args.
3184 set dummy pkg-config; ac_word=$2
3185 echo "$as_me:3185: checking for $ac_word" >&5
3186 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3187 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
3188   echo $ECHO_N "(cached) $ECHO_C" >&6
3189 else
3190   case $ac_pt_PKG_CONFIG in
3191   [\\/]* | ?:[\\/]*)
3192   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3193   ;;
3194   *)
3195   ac_save_IFS=$IFS; IFS=$ac_path_separator
3196 ac_dummy="$PATH"
3197 for ac_dir in $ac_dummy; do
3198   IFS=$ac_save_IFS
3199   test -z "$ac_dir" && ac_dir=.
3200   if $as_executable_p "$ac_dir/$ac_word"; then
3201    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
3202    echo "$as_me:3202: found $ac_dir/$ac_word" >&5
3203    break
3204 fi
3205 done
3206
3207   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
3208   ;;
3209 esac
3210 fi
3211 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3212
3213 if test -n "$ac_pt_PKG_CONFIG"; then
3214   echo "$as_me:3214: result: $ac_pt_PKG_CONFIG" >&5
3215 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
3216 else
3217   echo "$as_me:3217: result: no" >&5
3218 echo "${ECHO_T}no" >&6
3219 fi
3220
3221   PKG_CONFIG=$ac_pt_PKG_CONFIG
3222 else
3223   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3224 fi
3225
3226         ;;
3227 (*)
3228         PKG_CONFIG=$withval
3229         ;;
3230 esac
3231
3232 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3233 if test "$PKG_CONFIG" != none ; then
3234
3235 if test "x$prefix" != xNONE; then
3236         cf_path_syntax="$prefix"
3237 else
3238         cf_path_syntax="$ac_default_prefix"
3239 fi
3240
3241 case ".$PKG_CONFIG" in
3242 (.\$\(*\)*|.\'*\'*)
3243         ;;
3244 (..|./*|.\\*)
3245         ;;
3246 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3247         ;;
3248 (.\$\{*prefix\}*|.\$\{*dir\}*)
3249         eval PKG_CONFIG="$PKG_CONFIG"
3250         case ".$PKG_CONFIG" in
3251         (.NONE/*)
3252                 PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3253                 ;;
3254         esac
3255         ;;
3256 (.no|.NONE/*)
3257         PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%`
3258         ;;
3259 (*)
3260         { { echo "$as_me:3260: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
3261 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
3262    { (exit 1); exit 1; }; }
3263         ;;
3264 esac
3265
3266 elif test "x$cf_pkg_config" != xno ; then
3267         { echo "$as_me:3267: WARNING: pkg-config is not installed" >&5
3268 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
3269 fi
3270
3271 case "$PKG_CONFIG" in
3272 (no|none|yes)
3273         echo "$as_me:3273: checking for pkg-config library directory" >&5
3274 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
3275         ;;
3276 (*)
3277         echo "$as_me:3277: checking for $PKG_CONFIG library directory" >&5
3278 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
3279         ;;
3280 esac
3281
3282 PKG_CONFIG_LIBDIR=no
3283
3284 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
3285 if test "${with_pkg_config_libdir+set}" = set; then
3286   withval="$with_pkg_config_libdir"
3287   PKG_CONFIG_LIBDIR=$withval
3288 else
3289   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
3290 fi;
3291
3292 case x$PKG_CONFIG_LIBDIR in
3293 (x/*)
3294         ;;
3295 (xyes)
3296         # Look for the library directory using the same prefix as the executable
3297         if test "x$PKG_CONFIG" = xnone
3298         then
3299                 cf_path=$prefix
3300         else
3301                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
3302         fi
3303
3304         # If you don't like using the default architecture, you have to specify the
3305         # intended library directory and corresponding compiler/linker options.
3306         #
3307         # This case allows for Debian's 2014-flavor of multiarch, along with the
3308         # most common variations before that point.  Some other variants spell the
3309         # directory differently, e.g., "pkg-config", and put it in unusual places.
3310         # pkg-config has always been poorly standardized, which is ironic...
3311         case x`(arch) 2>/dev/null` in
3312         (*64)
3313                 cf_search_path="\
3314                         $cf_path/lib/*64-linux-gnu \
3315                         $cf_path/share \
3316                         $cf_path/lib64 \
3317                         $cf_path/lib32 \
3318                         $cf_path/lib"
3319                 ;;
3320         (*)
3321                 cf_search_path="\
3322                         $cf_path/lib/*-linux-gnu \
3323                         $cf_path/share \
3324                         $cf_path/lib32 \
3325                         $cf_path/lib \
3326                         $cf_path/libdata"
3327                 ;;
3328         esac
3329
3330         test -n "$verbose" && echo "    list..." 1>&6
3331
3332 echo "${as_me:-configure}:3332: testing list... ..." 1>&5
3333
3334         for cf_config in $cf_search_path
3335         do
3336                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
3337
3338 echo "${as_me:-configure}:3338: testing checking $cf_config/pkgconfig ..." 1>&5
3339
3340                 if test -d "$cf_config/pkgconfig"
3341                 then
3342                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
3343                         echo "$as_me:3343: checking done" >&5
3344 echo $ECHO_N "checking done... $ECHO_C" >&6
3345                         break
3346                 fi
3347         done
3348         ;;
3349 (*)
3350         ;;
3351 esac
3352
3353 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
3354         echo "$as_me:3354: result: $PKG_CONFIG_LIBDIR" >&5
3355 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
3356 fi
3357
3358 echo "$as_me:3358: checking if you want to build test-programs" >&5
3359 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3360
3361 # Check whether --with-tests or --without-tests was given.
3362 if test "${with_tests+set}" = set; then
3363   withval="$with_tests"
3364   cf_with_tests=$withval
3365 else
3366   cf_with_tests=yes
3367 fi;
3368 echo "$as_me:3368: result: $cf_with_tests" >&5
3369 echo "${ECHO_T}$cf_with_tests" >&6
3370
3371 echo "$as_me:3371: checking if we should assume mixed-case filenames" >&5
3372 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3373
3374 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3375 if test "${enable_mixed_case+set}" = set; then
3376   enableval="$enable_mixed_case"
3377   enable_mixedcase=$enableval
3378 else
3379   enable_mixedcase=auto
3380 fi;
3381 echo "$as_me:3381: result: $enable_mixedcase" >&5
3382 echo "${ECHO_T}$enable_mixedcase" >&6
3383 if test "$enable_mixedcase" = "auto" ; then
3384
3385 echo "$as_me:3385: checking if filesystem supports mixed-case filenames" >&5
3386 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3387 if test "${cf_cv_mixedcase+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390
3391 if test "$cross_compiling" = yes ; then
3392         case "$target_alias" in
3393         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
3394                 cf_cv_mixedcase=no
3395                 ;;
3396         (*)
3397                 cf_cv_mixedcase=yes
3398                 ;;
3399         esac
3400 else
3401         rm -f conftest CONFTEST
3402         echo test >conftest
3403         if test -f CONFTEST ; then
3404                 cf_cv_mixedcase=no
3405         else
3406                 cf_cv_mixedcase=yes
3407         fi
3408         rm -f conftest CONFTEST
3409 fi
3410
3411 fi
3412 echo "$as_me:3412: result: $cf_cv_mixedcase" >&5
3413 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3414 test "$cf_cv_mixedcase" = yes &&
3415 cat >>confdefs.h <<\EOF
3416 #define MIXEDCASE_FILENAMES 1
3417 EOF
3418
3419 else
3420         cf_cv_mixedcase=$enable_mixedcase
3421         if test "$enable_mixedcase" = "yes" ; then
3422                 cat >>confdefs.h <<\EOF
3423 #define MIXEDCASE_FILENAMES 1
3424 EOF
3425
3426         fi
3427 fi
3428
3429 # do this after mixed-case option (tags/TAGS is not as important as tic).
3430 echo "$as_me:3430: checking whether ${MAKE-make} sets \${MAKE}" >&5
3431 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3432 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3433 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3434   echo $ECHO_N "(cached) $ECHO_C" >&6
3435 else
3436   cat >conftest.make <<\EOF
3437 all:
3438         @echo 'ac_maketemp="${MAKE}"'
3439 EOF
3440 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3441 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3442 if test -n "$ac_maketemp"; then
3443   eval ac_cv_prog_make_${ac_make}_set=yes
3444 else
3445   eval ac_cv_prog_make_${ac_make}_set=no
3446 fi
3447 rm -f conftest.make
3448 fi
3449 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3450   echo "$as_me:3450: result: yes" >&5
3451 echo "${ECHO_T}yes" >&6
3452   SET_MAKE=
3453 else
3454   echo "$as_me:3454: result: no" >&5
3455 echo "${ECHO_T}no" >&6
3456   SET_MAKE="MAKE=${MAKE-make}"
3457 fi
3458
3459 for ac_prog in exctags ctags
3460 do
3461   # Extract the first word of "$ac_prog", so it can be a program name with args.
3462 set dummy $ac_prog; ac_word=$2
3463 echo "$as_me:3463: checking for $ac_word" >&5
3464 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3465 if test "${ac_cv_prog_CTAGS+set}" = set; then
3466   echo $ECHO_N "(cached) $ECHO_C" >&6
3467 else
3468   if test -n "$CTAGS"; then
3469   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3470 else
3471   ac_save_IFS=$IFS; IFS=$ac_path_separator
3472 ac_dummy="$PATH"
3473 for ac_dir in $ac_dummy; do
3474   IFS=$ac_save_IFS
3475   test -z "$ac_dir" && ac_dir=.
3476   $as_executable_p "$ac_dir/$ac_word" || continue
3477 ac_cv_prog_CTAGS="$ac_prog"
3478 echo "$as_me:3478: found $ac_dir/$ac_word" >&5
3479 break
3480 done
3481
3482 fi
3483 fi
3484 CTAGS=$ac_cv_prog_CTAGS
3485 if test -n "$CTAGS"; then
3486   echo "$as_me:3486: result: $CTAGS" >&5
3487 echo "${ECHO_T}$CTAGS" >&6
3488 else
3489   echo "$as_me:3489: result: no" >&5
3490 echo "${ECHO_T}no" >&6
3491 fi
3492
3493   test -n "$CTAGS" && break
3494 done
3495
3496 for ac_prog in exetags etags
3497 do
3498   # Extract the first word of "$ac_prog", so it can be a program name with args.
3499 set dummy $ac_prog; ac_word=$2
3500 echo "$as_me:3500: checking for $ac_word" >&5
3501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3502 if test "${ac_cv_prog_ETAGS+set}" = set; then
3503   echo $ECHO_N "(cached) $ECHO_C" >&6
3504 else
3505   if test -n "$ETAGS"; then
3506   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3507 else
3508   ac_save_IFS=$IFS; IFS=$ac_path_separator
3509 ac_dummy="$PATH"
3510 for ac_dir in $ac_dummy; do
3511   IFS=$ac_save_IFS
3512   test -z "$ac_dir" && ac_dir=.
3513   $as_executable_p "$ac_dir/$ac_word" || continue
3514 ac_cv_prog_ETAGS="$ac_prog"
3515 echo "$as_me:3515: found $ac_dir/$ac_word" >&5
3516 break
3517 done
3518
3519 fi
3520 fi
3521 ETAGS=$ac_cv_prog_ETAGS
3522 if test -n "$ETAGS"; then
3523   echo "$as_me:3523: result: $ETAGS" >&5
3524 echo "${ECHO_T}$ETAGS" >&6
3525 else
3526   echo "$as_me:3526: result: no" >&5
3527 echo "${ECHO_T}no" >&6
3528 fi
3529
3530   test -n "$ETAGS" && break
3531 done
3532
3533 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3534 set dummy ${CTAGS:-ctags}; ac_word=$2
3535 echo "$as_me:3535: checking for $ac_word" >&5
3536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3537 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3538   echo $ECHO_N "(cached) $ECHO_C" >&6
3539 else
3540   if test -n "$MAKE_LOWER_TAGS"; then
3541   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3542 else
3543   ac_save_IFS=$IFS; IFS=$ac_path_separator
3544 ac_dummy="$PATH"
3545 for ac_dir in $ac_dummy; do
3546   IFS=$ac_save_IFS
3547   test -z "$ac_dir" && ac_dir=.
3548   $as_executable_p "$ac_dir/$ac_word" || continue
3549 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3550 echo "$as_me:3550: found $ac_dir/$ac_word" >&5
3551 break
3552 done
3553
3554   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3555 fi
3556 fi
3557 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3558 if test -n "$MAKE_LOWER_TAGS"; then
3559   echo "$as_me:3559: result: $MAKE_LOWER_TAGS" >&5
3560 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3561 else
3562   echo "$as_me:3562: result: no" >&5
3563 echo "${ECHO_T}no" >&6
3564 fi
3565
3566 if test "$cf_cv_mixedcase" = yes ; then
3567         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3568 set dummy ${ETAGS:-etags}; ac_word=$2
3569 echo "$as_me:3569: checking for $ac_word" >&5
3570 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3571 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3572   echo $ECHO_N "(cached) $ECHO_C" >&6
3573 else
3574   if test -n "$MAKE_UPPER_TAGS"; then
3575   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3576 else
3577   ac_save_IFS=$IFS; IFS=$ac_path_separator
3578 ac_dummy="$PATH"
3579 for ac_dir in $ac_dummy; do
3580   IFS=$ac_save_IFS
3581   test -z "$ac_dir" && ac_dir=.
3582   $as_executable_p "$ac_dir/$ac_word" || continue
3583 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3584 echo "$as_me:3584: found $ac_dir/$ac_word" >&5
3585 break
3586 done
3587
3588   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3589 fi
3590 fi
3591 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3592 if test -n "$MAKE_UPPER_TAGS"; then
3593   echo "$as_me:3593: result: $MAKE_UPPER_TAGS" >&5
3594 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3595 else
3596   echo "$as_me:3596: result: no" >&5
3597 echo "${ECHO_T}no" >&6
3598 fi
3599
3600 else
3601         MAKE_UPPER_TAGS=no
3602 fi
3603
3604 if test "$MAKE_UPPER_TAGS" = yes ; then
3605         MAKE_UPPER_TAGS=
3606 else
3607         MAKE_UPPER_TAGS="#"
3608 fi
3609
3610 if test "$MAKE_LOWER_TAGS" = yes ; then
3611         MAKE_LOWER_TAGS=
3612 else
3613         MAKE_LOWER_TAGS="#"
3614 fi
3615
3616 echo "$as_me:3616: checking for makeflags variable" >&5
3617 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3618 if test "${cf_cv_makeflags+set}" = set; then
3619   echo $ECHO_N "(cached) $ECHO_C" >&6
3620 else
3621
3622         cf_cv_makeflags=''
3623         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3624         do
3625                 cat >cf_makeflags.tmp <<CF_EOF
3626 SHELL = $SHELL
3627 all :
3628         @ echo '.$cf_option'
3629 CF_EOF
3630                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[   ]*$,,'`
3631                 case "$cf_result" in
3632                 (.*k|.*kw)
3633                         cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
3634                         case "$cf_result" in
3635                         (.*CC=*)        cf_cv_makeflags=
3636                                 ;;
3637                         (*)     cf_cv_makeflags=$cf_option
3638                                 ;;
3639                         esac
3640                         break
3641                         ;;
3642                 (.-)
3643                         ;;
3644                 (*)
3645
3646 echo "${as_me:-configure}:3646: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3647
3648                         ;;
3649                 esac
3650         done
3651         rm -f cf_makeflags.tmp
3652
3653 fi
3654 echo "$as_me:3654: result: $cf_cv_makeflags" >&5
3655 echo "${ECHO_T}$cf_cv_makeflags" >&6
3656
3657 if test -n "$ac_tool_prefix"; then
3658   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3659 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3660 echo "$as_me:3660: checking for $ac_word" >&5
3661 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3662 if test "${ac_cv_prog_RANLIB+set}" = set; then
3663   echo $ECHO_N "(cached) $ECHO_C" >&6
3664 else
3665   if test -n "$RANLIB"; then
3666   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3667 else
3668   ac_save_IFS=$IFS; IFS=$ac_path_separator
3669 ac_dummy="$PATH"
3670 for ac_dir in $ac_dummy; do
3671   IFS=$ac_save_IFS
3672   test -z "$ac_dir" && ac_dir=.
3673   $as_executable_p "$ac_dir/$ac_word" || continue
3674 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3675 echo "$as_me:3675: found $ac_dir/$ac_word" >&5
3676 break
3677 done
3678
3679 fi
3680 fi
3681 RANLIB=$ac_cv_prog_RANLIB
3682 if test -n "$RANLIB"; then
3683   echo "$as_me:3683: result: $RANLIB" >&5
3684 echo "${ECHO_T}$RANLIB" >&6
3685 else
3686   echo "$as_me:3686: result: no" >&5
3687 echo "${ECHO_T}no" >&6
3688 fi
3689
3690 fi
3691 if test -z "$ac_cv_prog_RANLIB"; then
3692   ac_ct_RANLIB=$RANLIB
3693   # Extract the first word of "ranlib", so it can be a program name with args.
3694 set dummy ranlib; ac_word=$2
3695 echo "$as_me:3695: checking for $ac_word" >&5
3696 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3697 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3698   echo $ECHO_N "(cached) $ECHO_C" >&6
3699 else
3700   if test -n "$ac_ct_RANLIB"; then
3701   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3702 else
3703   ac_save_IFS=$IFS; IFS=$ac_path_separator
3704 ac_dummy="$PATH"
3705 for ac_dir in $ac_dummy; do
3706   IFS=$ac_save_IFS
3707   test -z "$ac_dir" && ac_dir=.
3708   $as_executable_p "$ac_dir/$ac_word" || continue
3709 ac_cv_prog_ac_ct_RANLIB="ranlib"
3710 echo "$as_me:3710: found $ac_dir/$ac_word" >&5
3711 break
3712 done
3713
3714   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3715 fi
3716 fi
3717 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3718 if test -n "$ac_ct_RANLIB"; then
3719   echo "$as_me:3719: result: $ac_ct_RANLIB" >&5
3720 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3721 else
3722   echo "$as_me:3722: result: no" >&5
3723 echo "${ECHO_T}no" >&6
3724 fi
3725
3726   RANLIB=$ac_ct_RANLIB
3727 else
3728   RANLIB="$ac_cv_prog_RANLIB"
3729 fi
3730
3731 if test -n "$ac_tool_prefix"; then
3732   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3733 set dummy ${ac_tool_prefix}ld; ac_word=$2
3734 echo "$as_me:3734: checking for $ac_word" >&5
3735 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3736 if test "${ac_cv_prog_LD+set}" = set; then
3737   echo $ECHO_N "(cached) $ECHO_C" >&6
3738 else
3739   if test -n "$LD"; then
3740   ac_cv_prog_LD="$LD" # Let the user override the test.
3741 else
3742   ac_save_IFS=$IFS; IFS=$ac_path_separator
3743 ac_dummy="$PATH"
3744 for ac_dir in $ac_dummy; do
3745   IFS=$ac_save_IFS
3746   test -z "$ac_dir" && ac_dir=.
3747   $as_executable_p "$ac_dir/$ac_word" || continue
3748 ac_cv_prog_LD="${ac_tool_prefix}ld"
3749 echo "$as_me:3749: found $ac_dir/$ac_word" >&5
3750 break
3751 done
3752
3753 fi
3754 fi
3755 LD=$ac_cv_prog_LD
3756 if test -n "$LD"; then
3757   echo "$as_me:3757: result: $LD" >&5
3758 echo "${ECHO_T}$LD" >&6
3759 else
3760   echo "$as_me:3760: result: no" >&5
3761 echo "${ECHO_T}no" >&6
3762 fi
3763
3764 fi
3765 if test -z "$ac_cv_prog_LD"; then
3766   ac_ct_LD=$LD
3767   # Extract the first word of "ld", so it can be a program name with args.
3768 set dummy ld; ac_word=$2
3769 echo "$as_me:3769: checking for $ac_word" >&5
3770 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3771 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3772   echo $ECHO_N "(cached) $ECHO_C" >&6
3773 else
3774   if test -n "$ac_ct_LD"; then
3775   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3776 else
3777   ac_save_IFS=$IFS; IFS=$ac_path_separator
3778 ac_dummy="$PATH"
3779 for ac_dir in $ac_dummy; do
3780   IFS=$ac_save_IFS
3781   test -z "$ac_dir" && ac_dir=.
3782   $as_executable_p "$ac_dir/$ac_word" || continue
3783 ac_cv_prog_ac_ct_LD="ld"
3784 echo "$as_me:3784: found $ac_dir/$ac_word" >&5
3785 break
3786 done
3787
3788   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3789 fi
3790 fi
3791 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3792 if test -n "$ac_ct_LD"; then
3793   echo "$as_me:3793: result: $ac_ct_LD" >&5
3794 echo "${ECHO_T}$ac_ct_LD" >&6
3795 else
3796   echo "$as_me:3796: result: no" >&5
3797 echo "${ECHO_T}no" >&6
3798 fi
3799
3800   LD=$ac_ct_LD
3801 else
3802   LD="$ac_cv_prog_LD"
3803 fi
3804
3805 if test -n "$ac_tool_prefix"; then
3806   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3807 set dummy ${ac_tool_prefix}ar; ac_word=$2
3808 echo "$as_me:3808: checking for $ac_word" >&5
3809 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3810 if test "${ac_cv_prog_AR+set}" = set; then
3811   echo $ECHO_N "(cached) $ECHO_C" >&6
3812 else
3813   if test -n "$AR"; then
3814   ac_cv_prog_AR="$AR" # Let the user override the test.
3815 else
3816   ac_save_IFS=$IFS; IFS=$ac_path_separator
3817 ac_dummy="$PATH"
3818 for ac_dir in $ac_dummy; do
3819   IFS=$ac_save_IFS
3820   test -z "$ac_dir" && ac_dir=.
3821   $as_executable_p "$ac_dir/$ac_word" || continue
3822 ac_cv_prog_AR="${ac_tool_prefix}ar"
3823 echo "$as_me:3823: found $ac_dir/$ac_word" >&5
3824 break
3825 done
3826
3827 fi
3828 fi
3829 AR=$ac_cv_prog_AR
3830 if test -n "$AR"; then
3831   echo "$as_me:3831: result: $AR" >&5
3832 echo "${ECHO_T}$AR" >&6
3833 else
3834   echo "$as_me:3834: result: no" >&5
3835 echo "${ECHO_T}no" >&6
3836 fi
3837
3838 fi
3839 if test -z "$ac_cv_prog_AR"; then
3840   ac_ct_AR=$AR
3841   # Extract the first word of "ar", so it can be a program name with args.
3842 set dummy ar; ac_word=$2
3843 echo "$as_me:3843: checking for $ac_word" >&5
3844 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3845 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3846   echo $ECHO_N "(cached) $ECHO_C" >&6
3847 else
3848   if test -n "$ac_ct_AR"; then
3849   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3850 else
3851   ac_save_IFS=$IFS; IFS=$ac_path_separator
3852 ac_dummy="$PATH"
3853 for ac_dir in $ac_dummy; do
3854   IFS=$ac_save_IFS
3855   test -z "$ac_dir" && ac_dir=.
3856   $as_executable_p "$ac_dir/$ac_word" || continue
3857 ac_cv_prog_ac_ct_AR="ar"
3858 echo "$as_me:3858: found $ac_dir/$ac_word" >&5
3859 break
3860 done
3861
3862   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3863 fi
3864 fi
3865 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3866 if test -n "$ac_ct_AR"; then
3867   echo "$as_me:3867: result: $ac_ct_AR" >&5
3868 echo "${ECHO_T}$ac_ct_AR" >&6
3869 else
3870   echo "$as_me:3870: result: no" >&5
3871 echo "${ECHO_T}no" >&6
3872 fi
3873
3874   AR=$ac_ct_AR
3875 else
3876   AR="$ac_cv_prog_AR"
3877 fi
3878
3879 if test -n "$ac_tool_prefix"; then
3880   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3881 set dummy ${ac_tool_prefix}ar; ac_word=$2
3882 echo "$as_me:3882: checking for $ac_word" >&5
3883 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3884 if test "${ac_cv_prog_AR+set}" = set; then
3885   echo $ECHO_N "(cached) $ECHO_C" >&6
3886 else
3887   if test -n "$AR"; then
3888   ac_cv_prog_AR="$AR" # Let the user override the test.
3889 else
3890   ac_save_IFS=$IFS; IFS=$ac_path_separator
3891 ac_dummy="$PATH"
3892 for ac_dir in $ac_dummy; do
3893   IFS=$ac_save_IFS
3894   test -z "$ac_dir" && ac_dir=.
3895   $as_executable_p "$ac_dir/$ac_word" || continue
3896 ac_cv_prog_AR="${ac_tool_prefix}ar"
3897 echo "$as_me:3897: found $ac_dir/$ac_word" >&5
3898 break
3899 done
3900
3901 fi
3902 fi
3903 AR=$ac_cv_prog_AR
3904 if test -n "$AR"; then
3905   echo "$as_me:3905: result: $AR" >&5
3906 echo "${ECHO_T}$AR" >&6
3907 else
3908   echo "$as_me:3908: result: no" >&5
3909 echo "${ECHO_T}no" >&6
3910 fi
3911
3912 fi
3913 if test -z "$ac_cv_prog_AR"; then
3914   ac_ct_AR=$AR
3915   # Extract the first word of "ar", so it can be a program name with args.
3916 set dummy ar; ac_word=$2
3917 echo "$as_me:3917: checking for $ac_word" >&5
3918 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3919 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3920   echo $ECHO_N "(cached) $ECHO_C" >&6
3921 else
3922   if test -n "$ac_ct_AR"; then
3923   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3924 else
3925   ac_save_IFS=$IFS; IFS=$ac_path_separator
3926 ac_dummy="$PATH"
3927 for ac_dir in $ac_dummy; do
3928   IFS=$ac_save_IFS
3929   test -z "$ac_dir" && ac_dir=.
3930   $as_executable_p "$ac_dir/$ac_word" || continue
3931 ac_cv_prog_ac_ct_AR="ar"
3932 echo "$as_me:3932: found $ac_dir/$ac_word" >&5
3933 break
3934 done
3935
3936   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3937 fi
3938 fi
3939 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3940 if test -n "$ac_ct_AR"; then
3941   echo "$as_me:3941: result: $ac_ct_AR" >&5
3942 echo "${ECHO_T}$ac_ct_AR" >&6
3943 else
3944   echo "$as_me:3944: result: no" >&5
3945 echo "${ECHO_T}no" >&6
3946 fi
3947
3948   AR=$ac_ct_AR
3949 else
3950   AR="$ac_cv_prog_AR"
3951 fi
3952
3953 echo "$as_me:3953: checking for options to update archives" >&5
3954 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3955 if test "${cf_cv_ar_flags+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958
3959         case "$cf_cv_system_name" in
3960         (*-msvc*)
3961                 cf_cv_ar_flags=''
3962                 cat >mk_static_lib.sh <<-EOF
3963                 #!$SHELL
3964                 MSVC_BIN="$AR"
3965                 out="\$1"
3966                 shift
3967                 exec \$MSVC_BIN -out:"\$out" \$@
3968                 EOF
3969                 chmod +x mk_static_lib.sh
3970                 AR=`pwd`/mk_static_lib.sh
3971                 ;;
3972         (*)
3973                 cf_cv_ar_flags=unknown
3974                 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3975                 do
3976
3977                         # check if $ARFLAGS already contains this choice
3978                         if test "x$ARFLAGS" != "x" ; then
3979                                 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3980                                 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3981                                         cf_cv_ar_flags=
3982                                         break
3983                                 fi
3984                         fi
3985
3986                         rm -f "conftest.$ac_cv_objext"
3987                         rm -f conftest.a
3988
3989                         cat >"conftest.$ac_ext" <<EOF
3990 #line 3990 "configure"
3991 int     testdata[3] = { 123, 456, 789 };
3992 EOF
3993                         if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5
3994   (eval $ac_compile) 2>&5
3995   ac_status=$?
3996   echo "$as_me:3996: \$? = $ac_status" >&5
3997   (exit "$ac_status"); } ; then
3998                                 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3999                                 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null
4000                                 if test -f conftest.a ; then
4001                                         cf_cv_ar_flags="$cf_ar_flags"
4002                                         break
4003                                 fi
4004                         else
4005                                 test -n "$verbose" && echo "    cannot compile test-program" 1>&6
4006
4007 echo "${as_me:-configure}:4007: testing cannot compile test-program ..." 1>&5
4008
4009                                 break
4010                         fi
4011                 done
4012                 rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
4013                 ;;
4014         esac
4015
4016 fi
4017 echo "$as_me:4017: result: $cf_cv_ar_flags" >&5
4018 echo "${ECHO_T}$cf_cv_ar_flags" >&6
4019
4020 if test -n "$ARFLAGS" ; then
4021         if test -n "$cf_cv_ar_flags" ; then
4022                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
4023         fi
4024 else
4025         ARFLAGS=$cf_cv_ar_flags
4026 fi
4027
4028         echo "$as_me:4028: checking for PATH separator" >&5
4029 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
4030         case "$cf_cv_system_name" in
4031         (os2*)  PATH_SEPARATOR=';'  ;;
4032         (*)     ${PATH_SEPARATOR:=':'}  ;;
4033         esac
4034
4035         echo "$as_me:4035: result: $PATH_SEPARATOR" >&5
4036 echo "${ECHO_T}$PATH_SEPARATOR" >&6
4037
4038 echo "$as_me:4038: checking if you have specified an install-prefix" >&5
4039 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
4040
4041 # Check whether --with-install-prefix or --without-install-prefix was given.
4042 if test "${with_install_prefix+set}" = set; then
4043   withval="$with_install_prefix"
4044   case "$withval" in
4045         (yes|no)
4046                 ;;
4047         (*)     DESTDIR="$withval"
4048                 ;;
4049         esac
4050 fi;
4051 echo "$as_me:4051: result: $DESTDIR" >&5
4052 echo "${ECHO_T}$DESTDIR" >&6
4053
4054 ###############################################################################
4055
4056 # If we're cross-compiling, allow the user to override the tools and their
4057 # options.  The configure script is oriented toward identifying the host
4058 # compiler, etc., but we need a build compiler to generate parts of the source.
4059
4060 if test "$cross_compiling" = yes ; then
4061
4062         # defaults that we might want to override
4063         : ${BUILD_CFLAGS:=''}
4064         : ${BUILD_CPPFLAGS:=''}
4065         : ${BUILD_LDFLAGS:=''}
4066         : ${BUILD_LIBS:=''}
4067         : ${BUILD_EXEEXT:='$x'}
4068         : ${BUILD_OBJEXT:='o'}
4069
4070 # Check whether --with-build-cc or --without-build-cc was given.
4071 if test "${with_build_cc+set}" = set; then
4072   withval="$with_build_cc"
4073   BUILD_CC="$withval"
4074 else
4075   for ac_prog in gcc clang c99 c89 cc cl
4076 do
4077   # Extract the first word of "$ac_prog", so it can be a program name with args.
4078 set dummy $ac_prog; ac_word=$2
4079 echo "$as_me:4079: checking for $ac_word" >&5
4080 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4081 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
4082   echo $ECHO_N "(cached) $ECHO_C" >&6
4083 else
4084   if test -n "$BUILD_CC"; then
4085   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
4086 else
4087   ac_save_IFS=$IFS; IFS=$ac_path_separator
4088 ac_dummy="$PATH"
4089 for ac_dir in $ac_dummy; do
4090   IFS=$ac_save_IFS
4091   test -z "$ac_dir" && ac_dir=.
4092   $as_executable_p "$ac_dir/$ac_word" || continue
4093 ac_cv_prog_BUILD_CC="$ac_prog"
4094 echo "$as_me:4094: found $ac_dir/$ac_word" >&5
4095 break
4096 done
4097
4098 fi
4099 fi
4100 BUILD_CC=$ac_cv_prog_BUILD_CC
4101 if test -n "$BUILD_CC"; then
4102   echo "$as_me:4102: result: $BUILD_CC" >&5
4103 echo "${ECHO_T}$BUILD_CC" >&6
4104 else
4105   echo "$as_me:4105: result: no" >&5
4106 echo "${ECHO_T}no" >&6
4107 fi
4108
4109   test -n "$BUILD_CC" && break
4110 done
4111 test -n "$BUILD_CC" || BUILD_CC="none"
4112
4113 fi;
4114         echo "$as_me:4114: checking for native build C compiler" >&5
4115 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
4116         echo "$as_me:4116: result: $BUILD_CC" >&5
4117 echo "${ECHO_T}$BUILD_CC" >&6
4118
4119         echo "$as_me:4119: checking for native build C preprocessor" >&5
4120 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
4121
4122 # Check whether --with-build-cpp or --without-build-cpp was given.
4123 if test "${with_build_cpp+set}" = set; then
4124   withval="$with_build_cpp"
4125   BUILD_CPP="$withval"
4126 else
4127   BUILD_CPP='${BUILD_CC} -E'
4128 fi;
4129         echo "$as_me:4129: result: $BUILD_CPP" >&5
4130 echo "${ECHO_T}$BUILD_CPP" >&6
4131
4132         echo "$as_me:4132: checking for native build C flags" >&5
4133 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
4134
4135 # Check whether --with-build-cflags or --without-build-cflags was given.
4136 if test "${with_build_cflags+set}" = set; then
4137   withval="$with_build_cflags"
4138   BUILD_CFLAGS="$withval"
4139 fi;
4140         echo "$as_me:4140: result: $BUILD_CFLAGS" >&5
4141 echo "${ECHO_T}$BUILD_CFLAGS" >&6
4142
4143         echo "$as_me:4143: checking for native build C preprocessor-flags" >&5
4144 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
4145
4146 # Check whether --with-build-cppflags or --without-build-cppflags was given.
4147 if test "${with_build_cppflags+set}" = set; then
4148   withval="$with_build_cppflags"
4149   BUILD_CPPFLAGS="$withval"
4150 fi;
4151         echo "$as_me:4151: result: $BUILD_CPPFLAGS" >&5
4152 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
4153
4154         echo "$as_me:4154: checking for native build linker-flags" >&5
4155 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
4156
4157 # Check whether --with-build-ldflags or --without-build-ldflags was given.
4158 if test "${with_build_ldflags+set}" = set; then
4159   withval="$with_build_ldflags"
4160   BUILD_LDFLAGS="$withval"
4161 fi;
4162         echo "$as_me:4162: result: $BUILD_LDFLAGS" >&5
4163 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
4164
4165         echo "$as_me:4165: checking for native build linker-libraries" >&5
4166 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
4167
4168 # Check whether --with-build-libs or --without-build-libs was given.
4169 if test "${with_build_libs+set}" = set; then
4170   withval="$with_build_libs"
4171   BUILD_LIBS="$withval"
4172 fi;
4173         echo "$as_me:4173: result: $BUILD_LIBS" >&5
4174 echo "${ECHO_T}$BUILD_LIBS" >&6
4175
4176         # this assumes we're on Unix.
4177         BUILD_EXEEXT=
4178         BUILD_OBJEXT=o
4179
4180         : ${BUILD_CC:='${CC}'}
4181
4182         if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
4183                 { { echo "$as_me:4183: error: Cross-build requires two compilers.
4184 Use --with-build-cc to specify the native compiler." >&5
4185 echo "$as_me: error: Cross-build requires two compilers.
4186 Use --with-build-cc to specify the native compiler." >&2;}
4187    { (exit 1); exit 1; }; }
4188         fi
4189
4190 else
4191         : ${BUILD_CC:='${CC}'}
4192         : ${BUILD_CPP:='${CPP}'}
4193         : ${BUILD_CFLAGS:='${CFLAGS}'}
4194         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
4195         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
4196         : ${BUILD_LIBS:='${LIBS}'}
4197         : ${BUILD_EXEEXT:='$x'}
4198         : ${BUILD_OBJEXT:='o'}
4199 fi
4200
4201 ###############################################################################
4202
4203 ### Options to allow the user to specify the set of libraries which are used.
4204 ### Use "--without-normal --with-shared" to allow the default model to be
4205 ### shared, for example.
4206 cf_list_models=""
4207
4208 echo "$as_me:4208: checking if you want to build shared C-objects" >&5
4209 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
4210
4211 # Check whether --with-shared or --without-shared was given.
4212 if test "${with_shared+set}" = set; then
4213   withval="$with_shared"
4214   with_shared=$withval
4215 else
4216   with_shared=no
4217 fi;
4218 echo "$as_me:4218: result: $with_shared" >&5
4219 echo "${ECHO_T}$with_shared" >&6
4220 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
4221
4222 echo "$as_me:4222: checking for specified models" >&5
4223 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
4224 test -z "$cf_list_models" && cf_list_models=normal
4225 echo "$as_me:4225: result: $cf_list_models" >&5
4226 echo "${ECHO_T}$cf_list_models" >&6
4227
4228 ### Use the first model as the default, and save its suffix for use in building
4229 ### up test-applications.
4230 echo "$as_me:4230: checking for default model" >&5
4231 echo $ECHO_N "checking for default model... $ECHO_C" >&6
4232 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
4233 echo "$as_me:4233: result: $DFT_LWR_MODEL" >&5
4234 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
4235
4236 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4237
4238 echo "$as_me:4238: checking for specific curses-directory" >&5
4239 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4240
4241 # Check whether --with-curses-dir or --without-curses-dir was given.
4242 if test "${with_curses_dir+set}" = set; then
4243   withval="$with_curses_dir"
4244   cf_cv_curses_dir=$withval
4245 else
4246   cf_cv_curses_dir=no
4247 fi;
4248 echo "$as_me:4248: result: $cf_cv_curses_dir" >&5
4249 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4250
4251 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
4252 then
4253
4254 if test "x$prefix" != xNONE; then
4255         cf_path_syntax="$prefix"
4256 else
4257         cf_path_syntax="$ac_default_prefix"
4258 fi
4259
4260 case ".$withval" in
4261 (.\$\(*\)*|.\'*\'*)
4262         ;;
4263 (..|./*|.\\*)
4264         ;;
4265 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4266         ;;
4267 (.\$\{*prefix\}*|.\$\{*dir\}*)
4268         eval withval="$withval"
4269         case ".$withval" in
4270         (.NONE/*)
4271                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4272                 ;;
4273         esac
4274         ;;
4275 (.no|.NONE/*)
4276         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
4277         ;;
4278 (*)
4279         { { echo "$as_me:4279: error: expected a pathname, not \"$withval\"" >&5
4280 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4281    { (exit 1); exit 1; }; }
4282         ;;
4283 esac
4284
4285         if test -d "$cf_cv_curses_dir"
4286         then
4287
4288 if test -n "$cf_cv_curses_dir/include" ; then
4289   for cf_add_incdir in $cf_cv_curses_dir/include
4290   do
4291         while test "$cf_add_incdir" != /usr/include
4292         do
4293           if test -d "$cf_add_incdir"
4294           then
4295                 cf_have_incdir=no
4296                 if test -n "$CFLAGS$CPPFLAGS" ; then
4297                   # a loop is needed to ensure we can add subdirs of existing dirs
4298                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4299                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4300                           cf_have_incdir=yes; break
4301                         fi
4302                   done
4303                 fi
4304
4305                 if test "$cf_have_incdir" = no ; then
4306                   if test "$cf_add_incdir" = /usr/local/include ; then
4307                         if test "$GCC" = yes
4308                         then
4309                           cf_save_CPPFLAGS=$CPPFLAGS
4310
4311         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4312         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4313
4314                           cat >"conftest.$ac_ext" <<_ACEOF
4315 #line 4315 "configure"
4316 #include "confdefs.h"
4317 #include <stdio.h>
4318 int
4319 main (void)
4320 {
4321 printf("Hello")
4322   ;
4323   return 0;
4324 }
4325 _ACEOF
4326 rm -f "conftest.$ac_objext"
4327 if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5
4328   (eval $ac_compile) 2>&5
4329   ac_status=$?
4330   echo "$as_me:4330: \$? = $ac_status" >&5
4331   (exit "$ac_status"); } &&
4332          { ac_try='test -s "conftest.$ac_objext"'
4333   { (eval echo "$as_me:4333: \"$ac_try\"") >&5
4334   (eval $ac_try) 2>&5
4335   ac_status=$?
4336   echo "$as_me:4336: \$? = $ac_status" >&5
4337   (exit "$ac_status"); }; }; then
4338   :
4339 else
4340   echo "$as_me: failed program was:" >&5
4341 cat "conftest.$ac_ext" >&5
4342 cf_have_incdir=yes
4343 fi
4344 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4345                           CPPFLAGS=$cf_save_CPPFLAGS
4346                         fi
4347                   fi
4348                 fi
4349
4350                 if test "$cf_have_incdir" = no ; then
4351                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4352
4353 echo "${as_me:-configure}:4353: testing adding $cf_add_incdir to include-path ..." 1>&5
4354
4355                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4356
4357                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
4358                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4359                   cf_add_incdir="$cf_top_incdir"
4360                 else
4361                   break
4362                 fi
4363           else
4364                 break
4365           fi
4366         done
4367   done
4368 fi
4369
4370 if test -n "$cf_cv_curses_dir/lib" ; then
4371         for cf_add_libdir in $cf_cv_curses_dir/lib
4372         do
4373                 if test "$cf_add_libdir" = /usr/lib ; then
4374                         :
4375                 elif test -d "$cf_add_libdir"
4376                 then
4377                         cf_have_libdir=no
4378                         if test -n "$LDFLAGS$LIBS" ; then
4379                                 # a loop is needed to ensure we can add subdirs of existing dirs
4380                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4381                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4382                                                 cf_have_libdir=yes; break
4383                                         fi
4384                                 done
4385                         fi
4386                         if test "$cf_have_libdir" = no ; then
4387                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4388
4389 echo "${as_me:-configure}:4389: testing adding $cf_add_libdir to library-path ..." 1>&5
4390
4391                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4392                         fi
4393                 fi
4394         done
4395 fi
4396
4397         fi
4398 fi
4399
4400 cf_ncuconfig_root=ncurses
4401 cf_have_ncuconfig=no
4402
4403 if test "x${PKG_CONFIG:=none}" != xnone; then
4404         echo "$as_me:4404: checking pkg-config for $cf_ncuconfig_root" >&5
4405 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4406         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4407                 echo "$as_me:4407: result: yes" >&5
4408 echo "${ECHO_T}yes" >&6
4409
4410                 echo "$as_me:4410: checking if the $cf_ncuconfig_root package files work" >&5
4411 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4412                 cf_have_ncuconfig=unknown
4413
4414                 cf_save_CFLAGS="$CFLAGS"
4415                 cf_save_CPPFLAGS="$CPPFLAGS"
4416                 cf_save_LIBS="$LIBS"
4417
4418                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
4419                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4420
4421                 # while -W for passing linker flags is prevalent, it is not "standard".
4422                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
4423                 # incompatible _and_ non-standard -W option which gives an error.  Work
4424                 # around that pitfall.
4425                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
4426                 (x*c[89]9@@*-W*)
4427
4428 cf_fix_cppflags=no
4429 cf_new_cflags=
4430 cf_new_cppflags=
4431 cf_new_extra_cppflags=
4432
4433 for cf_add_cflags in $cf_pkg_cflags
4434 do
4435 case "$cf_fix_cppflags" in
4436 (no)
4437         case "$cf_add_cflags" in
4438         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4439                 case "$cf_add_cflags" in
4440                 (-D*)
4441                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4442
4443                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4444                                 && test -z "${cf_tst_cflags}" \
4445                                 && cf_fix_cppflags=yes
4446
4447                         if test "$cf_fix_cppflags" = yes ; then
4448
4449         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4450         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4451
4452                                 continue
4453                         elif test "${cf_tst_cflags}" = "\"'" ; then
4454
4455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4457
4458                                 continue
4459                         fi
4460                         ;;
4461                 esac
4462                 case "$CPPFLAGS" in
4463                 (*$cf_add_cflags)
4464                         ;;
4465                 (*)
4466                         case "$cf_add_cflags" in
4467                         (-D*)
4468                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4469
4470 CPPFLAGS=`echo "$CPPFLAGS" | \
4471         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4472                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4473
4474                                 ;;
4475                         esac
4476
4477         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4478         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4479
4480                         ;;
4481                 esac
4482                 ;;
4483         (*)
4484
4485         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4486         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4487
4488                 ;;
4489         esac
4490         ;;
4491 (yes)
4492
4493         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4494         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4495
4496         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4497
4498         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4499                 && test -z "${cf_tst_cflags}" \
4500                 && cf_fix_cppflags=no
4501         ;;
4502 esac
4503 done
4504
4505 if test -n "$cf_new_cflags" ; then
4506
4507         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4508         CFLAGS="${CFLAGS}$cf_new_cflags"
4509
4510 fi
4511
4512 if test -n "$cf_new_cppflags" ; then
4513
4514         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4515         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4516
4517 fi
4518
4519 if test -n "$cf_new_extra_cppflags" ; then
4520
4521         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4522         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4523
4524 fi
4525
4526 cf_add_libs="$LIBS"
4527 # reverse order
4528 cf_add_0lib=
4529 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4530 # filter duplicates
4531 for cf_add_1lib in $cf_add_0lib; do
4532         for cf_add_2lib in $cf_add_libs; do
4533                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4534                         cf_add_1lib=
4535                         break
4536                 fi
4537         done
4538         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4539 done
4540 LIBS="$cf_add_libs"
4541
4542                         cat >"conftest.$ac_ext" <<_ACEOF
4543 #line 4543 "configure"
4544 #include "confdefs.h"
4545 #include <${cf_cv_ncurses_header:-curses.h}>
4546 int
4547 main (void)
4548 {
4549 initscr(); mousemask(0,0); tigetstr((char *)0);
4550   ;
4551   return 0;
4552 }
4553 _ACEOF
4554 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4555 if { (eval echo "$as_me:4555: \"$ac_link\"") >&5
4556   (eval $ac_link) 2>&5
4557   ac_status=$?
4558   echo "$as_me:4558: \$? = $ac_status" >&5
4559   (exit "$ac_status"); } &&
4560          { ac_try='test -s "conftest$ac_exeext"'
4561   { (eval echo "$as_me:4561: \"$ac_try\"") >&5
4562   (eval $ac_try) 2>&5
4563   ac_status=$?
4564   echo "$as_me:4564: \$? = $ac_status" >&5
4565   (exit "$ac_status"); }; }; then
4566   if test "$cross_compiling" = yes; then
4567   cf_test_ncuconfig=maybe
4568 else
4569   cat >"conftest.$ac_ext" <<_ACEOF
4570 #line 4570 "configure"
4571 #include "confdefs.h"
4572 #include <${cf_cv_ncurses_header:-curses.h}>
4573                                         int main(void)
4574                                         { char *xx = curses_version(); return (xx == 0); }
4575 _ACEOF
4576 rm -f "conftest$ac_exeext"
4577 if { (eval echo "$as_me:4577: \"$ac_link\"") >&5
4578   (eval $ac_link) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4582   { (eval echo "$as_me:4582: \"$ac_try\"") >&5
4583   (eval $ac_try) 2>&5
4584   ac_status=$?
4585   echo "$as_me:4585: \$? = $ac_status" >&5
4586   (exit "$ac_status"); }; }; then
4587   cf_test_ncuconfig=yes
4588 else
4589   echo "$as_me: program exited with status $ac_status" >&5
4590 echo "$as_me: failed program was:" >&5
4591 cat "conftest.$ac_ext" >&5
4592 cf_test_ncuconfig=no
4593 fi
4594 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4595 fi
4596 else
4597   echo "$as_me: failed program was:" >&5
4598 cat "conftest.$ac_ext" >&5
4599 cf_test_ncuconfig=no
4600 fi
4601 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4602
4603                         CFLAGS="$cf_save_CFLAGS"
4604                         CPPFLAGS="$cf_save_CPPFLAGS"
4605                         LIBS="$cf_save_LIBS"
4606
4607                         if test "x$cf_test_ncuconfig" != xyes; then
4608                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
4609                                 cf_pkg_cflags="$cf_temp"
4610                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
4611                                 cf_pkg_libs="$cf_temp"
4612                         fi
4613                         ;;
4614                 esac
4615
4616 cf_fix_cppflags=no
4617 cf_new_cflags=
4618 cf_new_cppflags=
4619 cf_new_extra_cppflags=
4620
4621 for cf_add_cflags in $cf_pkg_cflags
4622 do
4623 case "$cf_fix_cppflags" in
4624 (no)
4625         case "$cf_add_cflags" in
4626         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4627                 case "$cf_add_cflags" in
4628                 (-D*)
4629                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4630
4631                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4632                                 && test -z "${cf_tst_cflags}" \
4633                                 && cf_fix_cppflags=yes
4634
4635                         if test "$cf_fix_cppflags" = yes ; then
4636
4637         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4638         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4639
4640                                 continue
4641                         elif test "${cf_tst_cflags}" = "\"'" ; then
4642
4643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4645
4646                                 continue
4647                         fi
4648                         ;;
4649                 esac
4650                 case "$CPPFLAGS" in
4651                 (*$cf_add_cflags)
4652                         ;;
4653                 (*)
4654                         case "$cf_add_cflags" in
4655                         (-D*)
4656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4657
4658 CPPFLAGS=`echo "$CPPFLAGS" | \
4659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4661
4662                                 ;;
4663                         esac
4664
4665         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4666         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4667
4668                         ;;
4669                 esac
4670                 ;;
4671         (*)
4672
4673         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4674         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4675
4676                 ;;
4677         esac
4678         ;;
4679 (yes)
4680
4681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4683
4684         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
4685
4686         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4687                 && test -z "${cf_tst_cflags}" \
4688                 && cf_fix_cppflags=no
4689         ;;
4690 esac
4691 done
4692
4693 if test -n "$cf_new_cflags" ; then
4694
4695         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4696         CFLAGS="${CFLAGS}$cf_new_cflags"
4697
4698 fi
4699
4700 if test -n "$cf_new_cppflags" ; then
4701
4702         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4703         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4704
4705 fi
4706
4707 if test -n "$cf_new_extra_cppflags" ; then
4708
4709         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4710         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4711
4712 fi
4713
4714 cf_add_libs="$LIBS"
4715 # reverse order
4716 cf_add_0lib=
4717 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
4718 # filter duplicates
4719 for cf_add_1lib in $cf_add_0lib; do
4720         for cf_add_2lib in $cf_add_libs; do
4721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
4722                         cf_add_1lib=
4723                         break
4724                 fi
4725         done
4726         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
4727 done
4728 LIBS="$cf_add_libs"
4729
4730                 cat >"conftest.$ac_ext" <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733 #include <${cf_cv_ncurses_header:-curses.h}>
4734 int
4735 main (void)
4736 {
4737 initscr(); mousemask(0,0); tigetstr((char *)0);
4738   ;
4739   return 0;
4740 }
4741 _ACEOF
4742 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
4743 if { (eval echo "$as_me:4743: \"$ac_link\"") >&5
4744   (eval $ac_link) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit "$ac_status"); } &&
4748          { ac_try='test -s "conftest$ac_exeext"'
4749   { (eval echo "$as_me:4749: \"$ac_try\"") >&5
4750   (eval $ac_try) 2>&5
4751   ac_status=$?
4752   echo "$as_me:4752: \$? = $ac_status" >&5
4753   (exit "$ac_status"); }; }; then
4754   if test "$cross_compiling" = yes; then
4755   cf_have_ncuconfig=maybe
4756 else
4757   cat >"conftest.$ac_ext" <<_ACEOF
4758 #line 4758 "configure"
4759 #include "confdefs.h"
4760 #include <${cf_cv_ncurses_header:-curses.h}>
4761                                 int main(void)
4762                                 { char *xx = curses_version(); return (xx == 0); }
4763 _ACEOF
4764 rm -f "conftest$ac_exeext"
4765 if { (eval echo "$as_me:4765: \"$ac_link\"") >&5
4766   (eval $ac_link) 2>&5
4767   ac_status=$?
4768   echo "$as_me:4768: \$? = $ac_status" >&5
4769   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
4770   { (eval echo "$as_me:4770: \"$ac_try\"") >&5
4771   (eval $ac_try) 2>&5
4772   ac_status=$?
4773   echo "$as_me:4773: \$? = $ac_status" >&5
4774   (exit "$ac_status"); }; }; then
4775   cf_have_ncuconfig=yes
4776 else
4777   echo "$as_me: program exited with status $ac_status" >&5
4778 echo "$as_me: failed program was:" >&5
4779 cat "conftest.$ac_ext" >&5
4780 cf_have_ncuconfig=no
4781 fi
4782 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
4783 fi
4784 else
4785   echo "$as_me: failed program was:" >&5
4786 cat "conftest.$ac_ext" >&5
4787 cf_have_ncuconfig=no
4788 fi
4789 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
4790                 echo "$as_me:4790: result: $cf_have_ncuconfig" >&5
4791 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4792                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4793                 if test "$cf_have_ncuconfig" != "yes"
4794                 then
4795                         CPPFLAGS="$cf_save_CPPFLAGS"
4796                         LIBS="$cf_save_LIBS"
4797                         NCURSES_CONFIG_PKG=none
4798                 else
4799
4800 cat >>confdefs.h <<\EOF
4801 #define NCURSES 1
4802 EOF
4803
4804                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4805
4806 echo "$as_me:4806: checking for terminfo header" >&5
4807 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4808 if test "${cf_cv_term_header+set}" = set; then
4809   echo $ECHO_N "(cached) $ECHO_C" >&6
4810 else
4811
4812 case "${cf_cv_ncurses_header}" in
4813 (*/ncurses.h|*/ncursesw.h)
4814         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4815         ;;
4816 (*)
4817         cf_term_header=term.h
4818         ;;
4819 esac
4820
4821 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4822 do
4823 cat >"conftest.$ac_ext" <<_ACEOF
4824 #line 4824 "configure"
4825 #include "confdefs.h"
4826 #include <stdio.h>
4827 #include <${cf_cv_ncurses_header:-curses.h}>
4828 #include <$cf_test>
4829
4830 int
4831 main (void)
4832 {
4833 int x = auto_left_margin; (void)x
4834   ;
4835   return 0;
4836 }
4837 _ACEOF
4838 rm -f "conftest.$ac_objext"
4839 if { (eval echo "$as_me:4839: \"$ac_compile\"") >&5
4840   (eval $ac_compile) 2>&5
4841   ac_status=$?
4842   echo "$as_me:4842: \$? = $ac_status" >&5
4843   (exit "$ac_status"); } &&
4844          { ac_try='test -s "conftest.$ac_objext"'
4845   { (eval echo "$as_me:4845: \"$ac_try\"") >&5
4846   (eval $ac_try) 2>&5
4847   ac_status=$?
4848   echo "$as_me:4848: \$? = $ac_status" >&5
4849   (exit "$ac_status"); }; }; then
4850
4851         cf_cv_term_header="$cf_test"
4852 else
4853   echo "$as_me: failed program was:" >&5
4854 cat "conftest.$ac_ext" >&5
4855
4856         cf_cv_term_header=unknown
4857
4858 fi
4859 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
4860         test "$cf_cv_term_header" != unknown && break
4861 done
4862
4863 fi
4864 echo "$as_me:4864: result: $cf_cv_term_header" >&5
4865 echo "${ECHO_T}$cf_cv_term_header" >&6
4866
4867 # Set definitions to allow ifdef'ing to accommodate subdirectories
4868
4869 case "$cf_cv_term_header" in
4870 (*term.h)
4871
4872 cat >>confdefs.h <<\EOF
4873 #define HAVE_TERM_H 1
4874 EOF
4875
4876         ;;
4877 esac
4878
4879 case "$cf_cv_term_header" in
4880 (ncurses/term.h)
4881
4882 cat >>confdefs.h <<\EOF
4883 #define HAVE_NCURSES_TERM_H 1
4884 EOF
4885
4886         ;;
4887 (ncursesw/term.h)
4888
4889 cat >>confdefs.h <<\EOF
4890 #define HAVE_NCURSESW_TERM_H 1
4891 EOF
4892
4893         ;;
4894 esac
4895
4896                 fi
4897
4898         else
4899                 echo "$as_me:4899: result: no" >&5
4900 echo "${ECHO_T}no" >&6
4901                 NCURSES_CONFIG_PKG=none
4902         fi
4903 else
4904         NCURSES_CONFIG_PKG=none
4905 fi
4906
4907 if test "x$cf_have_ncuconfig" = "xno"; then
4908         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4909
4910 if test -n "$ac_tool_prefix"; then
4911   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4912   do
4913     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4914 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4915 echo "$as_me:4915: checking for $ac_word" >&5
4916 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4917 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4918   echo $ECHO_N "(cached) $ECHO_C" >&6
4919 else
4920   if test -n "$NCURSES_CONFIG"; then
4921   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4922 else
4923   ac_save_IFS=$IFS; IFS=$ac_path_separator
4924 ac_dummy="$PATH"
4925 for ac_dir in $ac_dummy; do
4926   IFS=$ac_save_IFS
4927   test -z "$ac_dir" && ac_dir=.
4928   $as_executable_p "$ac_dir/$ac_word" || continue
4929 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4930 echo "$as_me:4930: found $ac_dir/$ac_word" >&5
4931 break
4932 done
4933
4934 fi
4935 fi
4936 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4937 if test -n "$NCURSES_CONFIG"; then
4938   echo "$as_me:4938: result: $NCURSES_CONFIG" >&5
4939 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4940 else
4941   echo "$as_me:4941: result: no" >&5
4942 echo "${ECHO_T}no" >&6
4943 fi
4944
4945     test -n "$NCURSES_CONFIG" && break
4946   done
4947 fi
4948 if test -z "$NCURSES_CONFIG"; then
4949   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4950   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4951 do
4952   # Extract the first word of "$ac_prog", so it can be a program name with args.
4953 set dummy $ac_prog; ac_word=$2
4954 echo "$as_me:4954: checking for $ac_word" >&5
4955 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4956 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4957   echo $ECHO_N "(cached) $ECHO_C" >&6
4958 else
4959   if test -n "$ac_ct_NCURSES_CONFIG"; then
4960   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4961 else
4962   ac_save_IFS=$IFS; IFS=$ac_path_separator
4963 ac_dummy="$PATH"
4964 for ac_dir in $ac_dummy; do
4965   IFS=$ac_save_IFS
4966   test -z "$ac_dir" && ac_dir=.
4967   $as_executable_p "$ac_dir/$ac_word" || continue
4968 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4969 echo "$as_me:4969: found $ac_dir/$ac_word" >&5
4970 break
4971 done
4972
4973 fi
4974 fi
4975 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4976 if test -n "$ac_ct_NCURSES_CONFIG"; then
4977   echo "$as_me:4977: result: $ac_ct_NCURSES_CONFIG" >&5
4978 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4979 else
4980   echo "$as_me:4980: result: no" >&5
4981 echo "${ECHO_T}no" >&6
4982 fi
4983
4984   test -n "$ac_ct_NCURSES_CONFIG" && break
4985 done
4986 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4987
4988   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4989 fi
4990
4991         if test "$NCURSES_CONFIG" != none ; then
4992
4993 cf_fix_cppflags=no
4994 cf_new_cflags=
4995 cf_new_cppflags=
4996 cf_new_extra_cppflags=
4997
4998 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4999 do
5000 case "$cf_fix_cppflags" in
5001 (no)
5002         case "$cf_add_cflags" in
5003         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5004                 case "$cf_add_cflags" in
5005                 (-D*)
5006                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5007
5008                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5009                                 && test -z "${cf_tst_cflags}" \
5010                                 && cf_fix_cppflags=yes
5011
5012                         if test "$cf_fix_cppflags" = yes ; then
5013
5014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5016
5017                                 continue
5018                         elif test "${cf_tst_cflags}" = "\"'" ; then
5019
5020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5022
5023                                 continue
5024                         fi
5025                         ;;
5026                 esac
5027                 case "$CPPFLAGS" in
5028                 (*$cf_add_cflags)
5029                         ;;
5030                 (*)
5031                         case "$cf_add_cflags" in
5032                         (-D*)
5033                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5034
5035 CPPFLAGS=`echo "$CPPFLAGS" | \
5036         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5037                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5038
5039                                 ;;
5040                         esac
5041
5042         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5043         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5044
5045                         ;;
5046                 esac
5047                 ;;
5048         (*)
5049
5050         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5051         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5052
5053                 ;;
5054         esac
5055         ;;
5056 (yes)
5057
5058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5060
5061         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
5062
5063         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5064                 && test -z "${cf_tst_cflags}" \
5065                 && cf_fix_cppflags=no
5066         ;;
5067 esac
5068 done
5069
5070 if test -n "$cf_new_cflags" ; then
5071
5072         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5073         CFLAGS="${CFLAGS}$cf_new_cflags"
5074
5075 fi
5076
5077 if test -n "$cf_new_cppflags" ; then
5078
5079         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5080         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5081
5082 fi
5083
5084 if test -n "$cf_new_extra_cppflags" ; then
5085
5086         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5087         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5088
5089 fi
5090
5091 cf_add_libs="$LIBS"
5092 # reverse order
5093 cf_add_0lib=
5094 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
5095 # filter duplicates
5096 for cf_add_1lib in $cf_add_0lib; do
5097         for cf_add_2lib in $cf_add_libs; do
5098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
5099                         cf_add_1lib=
5100                         break
5101                 fi
5102         done
5103         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
5104 done
5105 LIBS="$cf_add_libs"
5106
5107                 # even with config script, some packages use no-override for curses.h
5108
5109 echo "$as_me:5109: checking if we have identified curses headers" >&5
5110 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5111 if test "${cf_cv_ncurses_header+set}" = set; then
5112   echo $ECHO_N "(cached) $ECHO_C" >&6
5113 else
5114
5115 cf_cv_ncurses_header=none
5116 for cf_header in \
5117         ncurses.h ncurses/ncurses.h \
5118         curses.h ncurses/curses.h
5119 do
5120 cat >"conftest.$ac_ext" <<_ACEOF
5121 #line 5121 "configure"
5122 #include "confdefs.h"
5123 #include <${cf_header}>
5124 int
5125 main (void)
5126 {
5127 initscr(); tgoto("?", 0,0)
5128   ;
5129   return 0;
5130 }
5131 _ACEOF
5132 rm -f "conftest.$ac_objext"
5133 if { (eval echo "$as_me:5133: \"$ac_compile\"") >&5
5134   (eval $ac_compile) 2>&5
5135   ac_status=$?
5136   echo "$as_me:5136: \$? = $ac_status" >&5
5137   (exit "$ac_status"); } &&
5138          { ac_try='test -s "conftest.$ac_objext"'
5139   { (eval echo "$as_me:5139: \"$ac_try\"") >&5
5140   (eval $ac_try) 2>&5
5141   ac_status=$?
5142   echo "$as_me:5142: \$? = $ac_status" >&5
5143   (exit "$ac_status"); }; }; then
5144   cf_cv_ncurses_header=$cf_header; break
5145 else
5146   echo "$as_me: failed program was:" >&5
5147 cat "conftest.$ac_ext" >&5
5148 fi
5149 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5150 done
5151
5152 fi
5153 echo "$as_me:5153: result: $cf_cv_ncurses_header" >&5
5154 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5155
5156 if test "$cf_cv_ncurses_header" = none ; then
5157         { { echo "$as_me:5157: error: No curses header-files found" >&5
5158 echo "$as_me: error: No curses header-files found" >&2;}
5159    { (exit 1); exit 1; }; }
5160 fi
5161
5162 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5163
5164 for ac_header in $cf_cv_ncurses_header
5165 do
5166 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5167 echo "$as_me:5167: checking for $ac_header" >&5
5168 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5169 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5170   echo $ECHO_N "(cached) $ECHO_C" >&6
5171 else
5172   cat >"conftest.$ac_ext" <<_ACEOF
5173 #line 5173 "configure"
5174 #include "confdefs.h"
5175 #include <$ac_header>
5176 _ACEOF
5177 if { (eval echo "$as_me:5177: \"$ac_cpp "conftest.$ac_ext"\"") >&5
5178   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
5179   ac_status=$?
5180   $EGREP -v '^ *\+' conftest.er1 >conftest.err
5181   rm -f conftest.er1
5182   cat conftest.err >&5
5183   echo "$as_me:5183: \$? = $ac_status" >&5
5184   (exit "$ac_status"); } >/dev/null; then
5185   if test -s conftest.err; then
5186     ac_cpp_err=$ac_c_preproc_warn_flag
5187   else
5188     ac_cpp_err=
5189   fi
5190 else
5191   ac_cpp_err=yes
5192 fi
5193 if test -z "$ac_cpp_err"; then
5194   eval "$as_ac_Header=yes"
5195 else
5196   echo "$as_me: failed program was:" >&5
5197   cat "conftest.$ac_ext" >&5
5198   eval "$as_ac_Header=no"
5199 fi
5200 rm -f conftest.err "conftest.$ac_ext"
5201 fi
5202 echo "$as_me:5202: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
5203 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
5204 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
5205   cat >>confdefs.h <<EOF
5206 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5207 EOF
5208
5209 fi
5210 done
5211
5212 cat >>confdefs.h <<\EOF
5213 #define NCURSES 1
5214 EOF
5215
5216 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5217
5218                 cat >>confdefs.h <<EOF
5219 #define $cf_nculib_ROOT 1
5220 EOF
5221
5222                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
5223
5224         else
5225
5226 cf_ncuhdr_root=ncurses
5227
5228 test -n "$cf_cv_curses_dir" && \
5229 test "$cf_cv_curses_dir" != "no" && { \
5230
5231 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
5232   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
5233   do
5234         while test "$cf_add_incdir" != /usr/include
5235         do
5236           if test -d "$cf_add_incdir"
5237           then
5238                 cf_have_incdir=no
5239                 if test -n "$CFLAGS$CPPFLAGS" ; then
5240                   # a loop is needed to ensure we can add subdirs of existing dirs
5241                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5242                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5243                           cf_have_incdir=yes; break
5244                         fi
5245                   done
5246                 fi
5247
5248                 if test "$cf_have_incdir" = no ; then
5249                   if test "$cf_add_incdir" = /usr/local/include ; then
5250                         if test "$GCC" = yes
5251                         then
5252                           cf_save_CPPFLAGS=$CPPFLAGS
5253
5254         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5255         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5256
5257                           cat >"conftest.$ac_ext" <<_ACEOF
5258 #line 5258 "configure"
5259 #include "confdefs.h"
5260 #include <stdio.h>
5261 int
5262 main (void)
5263 {
5264 printf("Hello")
5265   ;
5266   return 0;
5267 }
5268 _ACEOF
5269 rm -f "conftest.$ac_objext"
5270 if { (eval echo "$as_me:5270: \"$ac_compile\"") >&5
5271   (eval $ac_compile) 2>&5
5272   ac_status=$?
5273   echo "$as_me:5273: \$? = $ac_status" >&5
5274   (exit "$ac_status"); } &&
5275          { ac_try='test -s "conftest.$ac_objext"'
5276   { (eval echo "$as_me:5276: \"$ac_try\"") >&5
5277   (eval $ac_try) 2>&5
5278   ac_status=$?
5279   echo "$as_me:5279: \$? = $ac_status" >&5
5280   (exit "$ac_status"); }; }; then
5281   :
5282 else
5283   echo "$as_me: failed program was:" >&5
5284 cat "conftest.$ac_ext" >&5
5285 cf_have_incdir=yes
5286 fi
5287 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5288                           CPPFLAGS=$cf_save_CPPFLAGS
5289                         fi
5290                   fi
5291                 fi
5292
5293                 if test "$cf_have_incdir" = no ; then
5294                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5295
5296 echo "${as_me:-configure}:5296: testing adding $cf_add_incdir to include-path ..." 1>&5
5297
5298                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5299
5300                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5301                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5302                   cf_add_incdir="$cf_top_incdir"
5303                 else
5304                   break
5305                 fi
5306           else
5307                 break
5308           fi
5309         done
5310   done
5311 fi
5312
5313 }
5314
5315 echo "$as_me:5315: checking for $cf_ncuhdr_root header in include-path" >&5
5316 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
5317 if test "${cf_cv_ncurses_h+set}" = set; then
5318   echo $ECHO_N "(cached) $ECHO_C" >&6
5319 else
5320
5321         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
5322         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
5323         for cf_header in $cf_header_list
5324         do
5325
5326         cat >"conftest.$ac_ext" <<_ACEOF
5327 #line 5327 "configure"
5328 #include "confdefs.h"
5329
5330 #include <$cf_header>
5331 int
5332 main (void)
5333 {
5334
5335 #ifdef NCURSES_VERSION
5336
5337 printf("%s\\n", NCURSES_VERSION);
5338 #else
5339 #ifdef __NCURSES_H
5340 printf("old\\n");
5341 #else
5342         make an error
5343 #endif
5344 #endif
5345
5346   ;
5347   return 0;
5348 }
5349 _ACEOF
5350 rm -f "conftest.$ac_objext"
5351 if { (eval echo "$as_me:5351: \"$ac_compile\"") >&5
5352   (eval $ac_compile) 2>&5
5353   ac_status=$?
5354   echo "$as_me:5354: \$? = $ac_status" >&5
5355   (exit "$ac_status"); } &&
5356          { ac_try='test -s "conftest.$ac_objext"'
5357   { (eval echo "$as_me:5357: \"$ac_try\"") >&5
5358   (eval $ac_try) 2>&5
5359   ac_status=$?
5360   echo "$as_me:5360: \$? = $ac_status" >&5
5361   (exit "$ac_status"); }; }; then
5362   cf_cv_ncurses_h=$cf_header
5363
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat "conftest.$ac_ext" >&5
5367 cf_cv_ncurses_h=no
5368 fi
5369 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5370
5371                 test "$cf_cv_ncurses_h" != no && break
5372         done
5373
5374 fi
5375 echo "$as_me:5375: result: $cf_cv_ncurses_h" >&5
5376 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
5377
5378 if test "$cf_cv_ncurses_h" != no ; then
5379         cf_cv_ncurses_header=$cf_cv_ncurses_h
5380 else
5381
5382 echo "$as_me:5382: checking for $cf_ncuhdr_root include-path" >&5
5383 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
5384 if test "${cf_cv_ncurses_h2+set}" = set; then
5385   echo $ECHO_N "(cached) $ECHO_C" >&6
5386 else
5387
5388         test -n "$verbose" && echo
5389
5390 cf_search=
5391
5392 # collect the current set of include-directories from compiler flags
5393 cf_header_path_list=""
5394 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5395         for cf_header_path in $CPPFLAGS $CFLAGS
5396         do
5397                 case "$cf_header_path" in
5398                 (-I*)
5399                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5400
5401 test "x$cf_header_path" != "xNONE" && \
5402 test -d "$cf_header_path" && \
5403  {
5404         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5405         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
5406         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
5407         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
5408         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
5409         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"
5410 }
5411
5412                         cf_header_path_list="$cf_header_path_list $cf_search"
5413                         ;;
5414                 esac
5415         done
5416 fi
5417
5418 # add the variations for the package we are looking for
5419
5420 cf_search=
5421
5422 test "x$prefix" != "xNONE" && \
5423 test -d "$prefix" && \
5424  {
5425         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5426         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
5427         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
5428         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
5429         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
5430         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
5431 }
5432
5433 for cf_subdir_prefix in \
5434         /usr \
5435         /usr/local \
5436         /usr/pkg \
5437         /opt \
5438         /opt/local \
5439         $HOME
5440 do
5441
5442 test "x$cf_subdir_prefix" != "x$prefix" && \
5443 test -d "$cf_subdir_prefix" && \
5444 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
5445         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5446         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
5447         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
5448         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
5449         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
5450         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"
5451 }
5452
5453 done
5454
5455 test "$includedir" != NONE && \
5456 test "$includedir" != "/usr/include" && \
5457 test -d "$includedir" && {
5458         test -d "$includedir" &&    cf_search="$cf_search $includedir"
5459         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
5460 }
5461
5462 test "$oldincludedir" != NONE && \
5463 test "$oldincludedir" != "/usr/include" && \
5464 test -d "$oldincludedir" && {
5465         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
5466         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
5467 }
5468
5469 cf_search="$cf_search $cf_header_path_list"
5470
5471         test -n "$verbose" && echo "search path $cf_search"
5472         cf_save2_CPPFLAGS="$CPPFLAGS"
5473         for cf_incdir in $cf_search
5474         do
5475
5476 if test -n "$cf_incdir" ; then
5477   for cf_add_incdir in $cf_incdir
5478   do
5479         while test "$cf_add_incdir" != /usr/include
5480         do
5481           if test -d "$cf_add_incdir"
5482           then
5483                 cf_have_incdir=no
5484                 if test -n "$CFLAGS$CPPFLAGS" ; then
5485                   # a loop is needed to ensure we can add subdirs of existing dirs
5486                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5487                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5488                           cf_have_incdir=yes; break
5489                         fi
5490                   done
5491                 fi
5492
5493                 if test "$cf_have_incdir" = no ; then
5494                   if test "$cf_add_incdir" = /usr/local/include ; then
5495                         if test "$GCC" = yes
5496                         then
5497                           cf_save_CPPFLAGS=$CPPFLAGS
5498
5499         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5500         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5501
5502                           cat >"conftest.$ac_ext" <<_ACEOF
5503 #line 5503 "configure"
5504 #include "confdefs.h"
5505 #include <stdio.h>
5506 int
5507 main (void)
5508 {
5509 printf("Hello")
5510   ;
5511   return 0;
5512 }
5513 _ACEOF
5514 rm -f "conftest.$ac_objext"
5515 if { (eval echo "$as_me:5515: \"$ac_compile\"") >&5
5516   (eval $ac_compile) 2>&5
5517   ac_status=$?
5518   echo "$as_me:5518: \$? = $ac_status" >&5
5519   (exit "$ac_status"); } &&
5520          { ac_try='test -s "conftest.$ac_objext"'
5521   { (eval echo "$as_me:5521: \"$ac_try\"") >&5
5522   (eval $ac_try) 2>&5
5523   ac_status=$?
5524   echo "$as_me:5524: \$? = $ac_status" >&5
5525   (exit "$ac_status"); }; }; then
5526   :
5527 else
5528   echo "$as_me: failed program was:" >&5
5529 cat "conftest.$ac_ext" >&5
5530 cf_have_incdir=yes
5531 fi
5532 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5533                           CPPFLAGS=$cf_save_CPPFLAGS
5534                         fi
5535                   fi
5536                 fi
5537
5538                 if test "$cf_have_incdir" = no ; then
5539                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5540
5541 echo "${as_me:-configure}:5541: testing adding $cf_add_incdir to include-path ..." 1>&5
5542
5543                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5544
5545                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5546                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5547                   cf_add_incdir="$cf_top_incdir"
5548                 else
5549                   break
5550                 fi
5551           else
5552                 break
5553           fi
5554         done
5555   done
5556 fi
5557
5558                 for cf_header in \
5559                         ncurses.h \
5560                         curses.h
5561                 do
5562
5563         cat >"conftest.$ac_ext" <<_ACEOF
5564 #line 5564 "configure"
5565 #include "confdefs.h"
5566
5567 #include <$cf_header>
5568 int
5569 main (void)
5570 {
5571
5572 #ifdef NCURSES_VERSION
5573
5574 printf("%s\\n", NCURSES_VERSION);
5575 #else
5576 #ifdef __NCURSES_H
5577 printf("old\\n");
5578 #else
5579         make an error
5580 #endif
5581 #endif
5582
5583   ;
5584   return 0;
5585 }
5586 _ACEOF
5587 rm -f "conftest.$ac_objext"
5588 if { (eval echo "$as_me:5588: \"$ac_compile\"") >&5
5589   (eval $ac_compile) 2>&5
5590   ac_status=$?
5591   echo "$as_me:5591: \$? = $ac_status" >&5
5592   (exit "$ac_status"); } &&
5593          { ac_try='test -s "conftest.$ac_objext"'
5594   { (eval echo "$as_me:5594: \"$ac_try\"") >&5
5595   (eval $ac_try) 2>&5
5596   ac_status=$?
5597   echo "$as_me:5597: \$? = $ac_status" >&5
5598   (exit "$ac_status"); }; }; then
5599   cf_cv_ncurses_h2=$cf_header
5600
5601 else
5602   echo "$as_me: failed program was:" >&5
5603 cat "conftest.$ac_ext" >&5
5604 cf_cv_ncurses_h2=no
5605 fi
5606 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5607
5608                         if test "$cf_cv_ncurses_h2" != no ; then
5609                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5610                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
5611                                 break
5612                         fi
5613                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5614                 done
5615                 CPPFLAGS="$cf_save2_CPPFLAGS"
5616                 test "$cf_cv_ncurses_h2" != no && break
5617         done
5618         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5618: error: not found" >&5
5619 echo "$as_me: error: not found" >&2;}
5620    { (exit 1); exit 1; }; }
5621
5622 fi
5623 echo "$as_me:5623: result: $cf_cv_ncurses_h2" >&5
5624 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5625
5626         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
5627         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
5628         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
5629                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
5630         fi
5631
5632 if test -n "$cf_1st_incdir" ; then
5633   for cf_add_incdir in $cf_1st_incdir
5634   do
5635         while test "$cf_add_incdir" != /usr/include
5636         do
5637           if test -d "$cf_add_incdir"
5638           then
5639                 cf_have_incdir=no
5640                 if test -n "$CFLAGS$CPPFLAGS" ; then
5641                   # a loop is needed to ensure we can add subdirs of existing dirs
5642                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5643                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5644                           cf_have_incdir=yes; break
5645                         fi
5646                   done
5647                 fi
5648
5649                 if test "$cf_have_incdir" = no ; then
5650                   if test "$cf_add_incdir" = /usr/local/include ; then
5651                         if test "$GCC" = yes
5652                         then
5653                           cf_save_CPPFLAGS=$CPPFLAGS
5654
5655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5656         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5657
5658                           cat >"conftest.$ac_ext" <<_ACEOF
5659 #line 5659 "configure"
5660 #include "confdefs.h"
5661 #include <stdio.h>
5662 int
5663 main (void)
5664 {
5665 printf("Hello")
5666   ;
5667   return 0;
5668 }
5669 _ACEOF
5670 rm -f "conftest.$ac_objext"
5671 if { (eval echo "$as_me:5671: \"$ac_compile\"") >&5
5672   (eval $ac_compile) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit "$ac_status"); } &&
5676          { ac_try='test -s "conftest.$ac_objext"'
5677   { (eval echo "$as_me:5677: \"$ac_try\"") >&5
5678   (eval $ac_try) 2>&5
5679   ac_status=$?
5680   echo "$as_me:5680: \$? = $ac_status" >&5
5681   (exit "$ac_status"); }; }; then
5682   :
5683 else
5684   echo "$as_me: failed program was:" >&5
5685 cat "conftest.$ac_ext" >&5
5686 cf_have_incdir=yes
5687 fi
5688 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5689                           CPPFLAGS=$cf_save_CPPFLAGS
5690                         fi
5691                   fi
5692                 fi
5693
5694                 if test "$cf_have_incdir" = no ; then
5695                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5696
5697 echo "${as_me:-configure}:5697: testing adding $cf_add_incdir to include-path ..." 1>&5
5698
5699                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5700
5701                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
5702                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5703                   cf_add_incdir="$cf_top_incdir"
5704                 else
5705                   break
5706                 fi
5707           else
5708                 break
5709           fi
5710         done
5711   done
5712 fi
5713
5714 fi
5715
5716 # Set definitions to allow ifdef'ing for ncurses.h
5717
5718 case "$cf_cv_ncurses_header" in
5719 (*ncurses.h)
5720
5721 cat >>confdefs.h <<\EOF
5722 #define HAVE_NCURSES_H 1
5723 EOF
5724
5725         ;;
5726 esac
5727
5728 case "$cf_cv_ncurses_header" in
5729 (ncurses/curses.h|ncurses/ncurses.h)
5730
5731 cat >>confdefs.h <<\EOF
5732 #define HAVE_NCURSES_NCURSES_H 1
5733 EOF
5734
5735         ;;
5736 (ncursesw/curses.h|ncursesw/ncurses.h)
5737
5738 cat >>confdefs.h <<\EOF
5739 #define HAVE_NCURSESW_NCURSES_H 1
5740 EOF
5741
5742         ;;
5743 esac
5744
5745 echo "$as_me:5745: checking for terminfo header" >&5
5746 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5747 if test "${cf_cv_term_header+set}" = set; then
5748   echo $ECHO_N "(cached) $ECHO_C" >&6
5749 else
5750
5751 case "${cf_cv_ncurses_header}" in
5752 (*/ncurses.h|*/ncursesw.h)
5753         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5754         ;;
5755 (*)
5756         cf_term_header=term.h
5757         ;;
5758 esac
5759
5760 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5761 do
5762 cat >"conftest.$ac_ext" <<_ACEOF
5763 #line 5763 "configure"
5764 #include "confdefs.h"
5765 #include <stdio.h>
5766 #include <${cf_cv_ncurses_header:-curses.h}>
5767 #include <$cf_test>
5768
5769 int
5770 main (void)
5771 {
5772 int x = auto_left_margin; (void)x
5773   ;
5774   return 0;
5775 }
5776 _ACEOF
5777 rm -f "conftest.$ac_objext"
5778 if { (eval echo "$as_me:5778: \"$ac_compile\"") >&5
5779   (eval $ac_compile) 2>&5
5780   ac_status=$?
5781   echo "$as_me:5781: \$? = $ac_status" >&5
5782   (exit "$ac_status"); } &&
5783          { ac_try='test -s "conftest.$ac_objext"'
5784   { (eval echo "$as_me:5784: \"$ac_try\"") >&5
5785   (eval $ac_try) 2>&5
5786   ac_status=$?
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit "$ac_status"); }; }; then
5789
5790         cf_cv_term_header="$cf_test"
5791 else
5792   echo "$as_me: failed program was:" >&5
5793 cat "conftest.$ac_ext" >&5
5794
5795         cf_cv_term_header=unknown
5796
5797 fi
5798 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
5799         test "$cf_cv_term_header" != unknown && break
5800 done
5801
5802 fi
5803 echo "$as_me:5803: result: $cf_cv_term_header" >&5
5804 echo "${ECHO_T}$cf_cv_term_header" >&6
5805
5806 # Set definitions to allow ifdef'ing to accommodate subdirectories
5807
5808 case "$cf_cv_term_header" in
5809 (*term.h)
5810
5811 cat >>confdefs.h <<\EOF
5812 #define HAVE_TERM_H 1
5813 EOF
5814
5815         ;;
5816 esac
5817
5818 case "$cf_cv_term_header" in
5819 (ncurses/term.h)
5820
5821 cat >>confdefs.h <<\EOF
5822 #define HAVE_NCURSES_TERM_H 1
5823 EOF
5824
5825         ;;
5826 (ncursesw/term.h)
5827
5828 cat >>confdefs.h <<\EOF
5829 #define HAVE_NCURSESW_TERM_H 1
5830 EOF
5831
5832         ;;
5833 esac
5834
5835 # some applications need this, but should check for NCURSES_VERSION
5836
5837 cat >>confdefs.h <<\EOF
5838 #define NCURSES 1
5839 EOF
5840
5841 echo "$as_me:5841: checking for ncurses version" >&5
5842 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5843 if test "${cf_cv_ncurses_version+set}" = set; then
5844   echo $ECHO_N "(cached) $ECHO_C" >&6
5845 else
5846
5847         cf_cv_ncurses_version=no
5848         cf_tempfile=out$$
5849         rm -f "$cf_tempfile"
5850         if test "$cross_compiling" = yes; then
5851
5852         # This will not work if the preprocessor splits the line after the
5853         # Autoconf token.  The 'unproto' program does that.
5854         cat > "conftest.$ac_ext" <<EOF
5855 #include <${cf_cv_ncurses_header:-curses.h}>
5856 #undef Autoconf
5857 #ifdef NCURSES_VERSION
5858 Autoconf NCURSES_VERSION
5859 #else
5860 #ifdef __NCURSES_H
5861 Autoconf "old"
5862 #endif
5863 ;
5864 #endif
5865 EOF
5866         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5867         { (eval echo "$as_me:5867: \"$cf_try\"") >&5
5868   (eval $cf_try) 2>&5
5869   ac_status=$?
5870   echo "$as_me:5870: \$? = $ac_status" >&5
5871   (exit "$ac_status"); }
5872         if test -f conftest.out ; then
5873                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
5874                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5875                 rm -f conftest.out
5876         fi
5877
5878 else
5879   cat >"conftest.$ac_ext" <<_ACEOF
5880 #line 5880 "configure"
5881 #include "confdefs.h"
5882
5883 #include <${cf_cv_ncurses_header:-curses.h}>
5884 #include <stdio.h>
5885 int main(void)
5886 {
5887         FILE *fp = fopen("$cf_tempfile", "w");
5888 #ifdef NCURSES_VERSION
5889 # ifdef NCURSES_VERSION_PATCH
5890         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5891 # else
5892         fprintf(fp, "%s\\n", NCURSES_VERSION);
5893 # endif
5894 #else
5895 # ifdef __NCURSES_H
5896         fprintf(fp, "old\\n");
5897 # else
5898         make an error
5899 # endif
5900 #endif
5901         ${cf_cv_main_return:-return}(0);
5902 }
5903 _ACEOF
5904 rm -f "conftest$ac_exeext"
5905 if { (eval echo "$as_me:5905: \"$ac_link\"") >&5
5906   (eval $ac_link) 2>&5
5907   ac_status=$?
5908   echo "$as_me:5908: \$? = $ac_status" >&5
5909   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
5910   { (eval echo "$as_me:5910: \"$ac_try\"") >&5
5911   (eval $ac_try) 2>&5
5912   ac_status=$?
5913   echo "$as_me:5913: \$? = $ac_status" >&5
5914   (exit "$ac_status"); }; }; then
5915
5916         cf_cv_ncurses_version=`cat $cf_tempfile`
5917 else
5918   echo "$as_me: program exited with status $ac_status" >&5
5919 echo "$as_me: failed program was:" >&5
5920 cat "conftest.$ac_ext" >&5
5921 fi
5922 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
5923 fi
5924         rm -f "$cf_tempfile"
5925
5926 fi
5927 echo "$as_me:5927: result: $cf_cv_ncurses_version" >&5
5928 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5929 test "$cf_cv_ncurses_version" = no ||
5930 cat >>confdefs.h <<\EOF
5931 #define NCURSES 1
5932 EOF
5933
5934 cf_nculib_root=ncurses
5935         # This works, except for the special case where we find gpm, but
5936         # ncurses is in a nonstandard location via $LIBS, and we really want
5937         # to link gpm.
5938 cf_ncurses_LIBS=""
5939 cf_ncurses_SAVE="$LIBS"
5940 echo "$as_me:5940: checking for Gpm_Open in -lgpm" >&5
5941 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5942 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5943   echo $ECHO_N "(cached) $ECHO_C" >&6
5944 else
5945   ac_check_lib_save_LIBS=$LIBS
5946 LIBS="-lgpm  $LIBS"
5947 cat >"conftest.$ac_ext" <<_ACEOF
5948 #line 5948 "configure"
5949 #include "confdefs.h"
5950
5951 /* Override any gcc2 internal prototype to avoid an error.  */
5952 #ifdef __cplusplus
5953 extern "C"
5954 #endif
5955 /* We use char because int might match the return type of a gcc2
5956    builtin and then its argument prototype would still apply.  */
5957 char Gpm_Open ();
5958 int
5959 main (void)
5960 {
5961 Gpm_Open ();
5962   ;
5963   return 0;
5964 }
5965 _ACEOF
5966 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
5967 if { (eval echo "$as_me:5967: \"$ac_link\"") >&5
5968   (eval $ac_link) 2>&5
5969   ac_status=$?
5970   echo "$as_me:5970: \$? = $ac_status" >&5
5971   (exit "$ac_status"); } &&
5972          { ac_try='test -s "conftest$ac_exeext"'
5973   { (eval echo "$as_me:5973: \"$ac_try\"") >&5
5974   (eval $ac_try) 2>&5
5975   ac_status=$?
5976   echo "$as_me:5976: \$? = $ac_status" >&5
5977   (exit "$ac_status"); }; }; then
5978   ac_cv_lib_gpm_Gpm_Open=yes
5979 else
5980   echo "$as_me: failed program was:" >&5
5981 cat "conftest.$ac_ext" >&5
5982 ac_cv_lib_gpm_Gpm_Open=no
5983 fi
5984 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
5985 LIBS=$ac_check_lib_save_LIBS
5986 fi
5987 echo "$as_me:5987: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5988 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5989 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
5990   echo "$as_me:5990: checking for initscr in -lgpm" >&5
5991 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5992 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5993   echo $ECHO_N "(cached) $ECHO_C" >&6
5994 else
5995   ac_check_lib_save_LIBS=$LIBS
5996 LIBS="-lgpm  $LIBS"
5997 cat >"conftest.$ac_ext" <<_ACEOF
5998 #line 5998 "configure"
5999 #include "confdefs.h"
6000
6001 /* Override any gcc2 internal prototype to avoid an error.  */
6002 #ifdef __cplusplus
6003 extern "C"
6004 #endif
6005 /* We use char because int might match the return type of a gcc2
6006    builtin and then its argument prototype would still apply.  */
6007 char initscr ();
6008 int
6009 main (void)
6010 {
6011 initscr ();
6012   ;
6013   return 0;
6014 }
6015 _ACEOF
6016 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6017 if { (eval echo "$as_me:6017: \"$ac_link\"") >&5
6018   (eval $ac_link) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit "$ac_status"); } &&
6022          { ac_try='test -s "conftest$ac_exeext"'
6023   { (eval echo "$as_me:6023: \"$ac_try\"") >&5
6024   (eval $ac_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit "$ac_status"); }; }; then
6028   ac_cv_lib_gpm_initscr=yes
6029 else
6030   echo "$as_me: failed program was:" >&5
6031 cat "conftest.$ac_ext" >&5
6032 ac_cv_lib_gpm_initscr=no
6033 fi
6034 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6035 LIBS=$ac_check_lib_save_LIBS
6036 fi
6037 echo "$as_me:6037: result: $ac_cv_lib_gpm_initscr" >&5
6038 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6039 if test "$ac_cv_lib_gpm_initscr" = yes; then
6040   LIBS="$cf_ncurses_SAVE"
6041 else
6042   cf_ncurses_LIBS="-lgpm"
6043 fi
6044
6045 fi
6046
6047 case "$host_os" in
6048 (freebsd*)
6049         # This is only necessary if you are linking against an obsolete
6050         # version of ncurses (but it should do no harm, since it's static).
6051         if test "$cf_nculib_root" = ncurses ; then
6052                 echo "$as_me:6052: checking for tgoto in -lmytinfo" >&5
6053 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6054 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6055   echo $ECHO_N "(cached) $ECHO_C" >&6
6056 else
6057   ac_check_lib_save_LIBS=$LIBS
6058 LIBS="-lmytinfo  $LIBS"
6059 cat >"conftest.$ac_ext" <<_ACEOF
6060 #line 6060 "configure"
6061 #include "confdefs.h"
6062
6063 /* Override any gcc2 internal prototype to avoid an error.  */
6064 #ifdef __cplusplus
6065 extern "C"
6066 #endif
6067 /* We use char because int might match the return type of a gcc2
6068    builtin and then its argument prototype would still apply.  */
6069 char tgoto ();
6070 int
6071 main (void)
6072 {
6073 tgoto ();
6074   ;
6075   return 0;
6076 }
6077 _ACEOF
6078 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6079 if { (eval echo "$as_me:6079: \"$ac_link\"") >&5
6080   (eval $ac_link) 2>&5
6081   ac_status=$?
6082   echo "$as_me:6082: \$? = $ac_status" >&5
6083   (exit "$ac_status"); } &&
6084          { ac_try='test -s "conftest$ac_exeext"'
6085   { (eval echo "$as_me:6085: \"$ac_try\"") >&5
6086   (eval $ac_try) 2>&5
6087   ac_status=$?
6088   echo "$as_me:6088: \$? = $ac_status" >&5
6089   (exit "$ac_status"); }; }; then
6090   ac_cv_lib_mytinfo_tgoto=yes
6091 else
6092   echo "$as_me: failed program was:" >&5
6093 cat "conftest.$ac_ext" >&5
6094 ac_cv_lib_mytinfo_tgoto=no
6095 fi
6096 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6097 LIBS=$ac_check_lib_save_LIBS
6098 fi
6099 echo "$as_me:6099: result: $ac_cv_lib_mytinfo_tgoto" >&5
6100 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6101 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
6102   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
6103 fi
6104
6105         fi
6106         ;;
6107 esac
6108
6109 cf_add_libs="$LIBS"
6110 # reverse order
6111 cf_add_0lib=
6112 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6113 # filter duplicates
6114 for cf_add_1lib in $cf_add_0lib; do
6115         for cf_add_2lib in $cf_add_libs; do
6116                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6117                         cf_add_1lib=
6118                         break
6119                 fi
6120         done
6121         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6122 done
6123 LIBS="$cf_add_libs"
6124
6125 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
6126 then
6127
6128 cf_add_libs="$LIBS"
6129 # reverse order
6130 cf_add_0lib=
6131 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6132 # filter duplicates
6133 for cf_add_1lib in $cf_add_0lib; do
6134         for cf_add_2lib in $cf_add_libs; do
6135                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6136                         cf_add_1lib=
6137                         break
6138                 fi
6139         done
6140         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6141 done
6142 LIBS="$cf_add_libs"
6143
6144 else
6145
6146         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
6147         cf_libdir=""
6148         echo "$as_me:6148: checking for initscr" >&5
6149 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
6150 if test "${ac_cv_func_initscr+set}" = set; then
6151   echo $ECHO_N "(cached) $ECHO_C" >&6
6152 else
6153   cat >"conftest.$ac_ext" <<_ACEOF
6154 #line 6154 "configure"
6155 #include "confdefs.h"
6156 #define initscr autoconf_temporary
6157 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6158 #undef initscr
6159
6160 #ifdef __cplusplus
6161 extern "C"
6162 #endif
6163
6164 /* We use char because int might match the return type of a gcc2
6165    builtin and then its argument prototype would still apply.  */
6166 char initscr (void);
6167
6168 int
6169 main (void)
6170 {
6171
6172 /* The GNU C library defines stubs for functions which it implements
6173     to always fail with ENOSYS.  Some functions are actually named
6174     something starting with __ and the normal name is an alias.  */
6175 #if defined (__stub_initscr) || defined (__stub___initscr)
6176 #error found stub for initscr
6177 #endif
6178
6179         return initscr ();
6180   ;
6181   return 0;
6182 }
6183 _ACEOF
6184 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6185 if { (eval echo "$as_me:6185: \"$ac_link\"") >&5
6186   (eval $ac_link) 2>&5
6187   ac_status=$?
6188   echo "$as_me:6188: \$? = $ac_status" >&5
6189   (exit "$ac_status"); } &&
6190          { ac_try='test -s "conftest$ac_exeext"'
6191   { (eval echo "$as_me:6191: \"$ac_try\"") >&5
6192   (eval $ac_try) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit "$ac_status"); }; }; then
6196   ac_cv_func_initscr=yes
6197 else
6198   echo "$as_me: failed program was:" >&5
6199 cat "conftest.$ac_ext" >&5
6200 ac_cv_func_initscr=no
6201 fi
6202 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6203 fi
6204 echo "$as_me:6204: result: $ac_cv_func_initscr" >&5
6205 echo "${ECHO_T}$ac_cv_func_initscr" >&6
6206 if test "$ac_cv_func_initscr" = yes; then
6207   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6208 else
6209
6210                 cf_save_LIBS="$LIBS"
6211                 echo "$as_me:6211: checking for initscr in -l$cf_nculib_root" >&5
6212 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
6213                 LIBS="-l$cf_nculib_root $LIBS"
6214                 cat >"conftest.$ac_ext" <<_ACEOF
6215 #line 6215 "configure"
6216 #include "confdefs.h"
6217 #include <${cf_cv_ncurses_header:-curses.h}>
6218 int
6219 main (void)
6220 {
6221 initscr()
6222   ;
6223   return 0;
6224 }
6225 _ACEOF
6226 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6227 if { (eval echo "$as_me:6227: \"$ac_link\"") >&5
6228   (eval $ac_link) 2>&5
6229   ac_status=$?
6230   echo "$as_me:6230: \$? = $ac_status" >&5
6231   (exit "$ac_status"); } &&
6232          { ac_try='test -s "conftest$ac_exeext"'
6233   { (eval echo "$as_me:6233: \"$ac_try\"") >&5
6234   (eval $ac_try) 2>&5
6235   ac_status=$?
6236   echo "$as_me:6236: \$? = $ac_status" >&5
6237   (exit "$ac_status"); }; }; then
6238   echo "$as_me:6238: result: yes" >&5
6239 echo "${ECHO_T}yes" >&6
6240                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6241
6242 else
6243   echo "$as_me: failed program was:" >&5
6244 cat "conftest.$ac_ext" >&5
6245 echo "$as_me:6245: result: no" >&5
6246 echo "${ECHO_T}no" >&6
6247
6248 cf_search=
6249 cf_library_path_list=""
6250 if test -n "${LDFLAGS}${LIBS}" ; then
6251         for cf_library_path in $LDFLAGS $LIBS
6252         do
6253                 case "$cf_library_path" in
6254                 (-L*)
6255                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6256
6257 test "x$cf_library_path" != "xNONE" && \
6258 test -d "$cf_library_path" && \
6259  {
6260         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6261         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6262         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
6263         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
6264         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
6265         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"
6266 }
6267
6268                         cf_library_path_list="$cf_library_path_list $cf_search"
6269                         ;;
6270                 esac
6271         done
6272 fi
6273
6274 cf_search=
6275
6276 test "x$prefix" != "xNONE" && \
6277 test -d "$prefix" && \
6278  {
6279         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6280         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6281         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
6282         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
6283         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
6284         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
6285 }
6286
6287 for cf_subdir_prefix in \
6288         /usr \
6289         /usr/local \
6290         /usr/pkg \
6291         /opt \
6292         /opt/local \
6293         $HOME
6294 do
6295
6296 test "x$cf_subdir_prefix" != "x$prefix" && \
6297 test -d "$cf_subdir_prefix" && \
6298 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6299         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6300         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6301         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
6302         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
6303         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
6304         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"
6305 }
6306
6307 done
6308
6309 cf_search="$cf_library_path_list $cf_search"
6310
6311                         for cf_libdir in $cf_search
6312                         do
6313                                 echo "$as_me:6313: checking for -l$cf_nculib_root in $cf_libdir" >&5
6314 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
6315                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
6316                                 cat >"conftest.$ac_ext" <<_ACEOF
6317 #line 6317 "configure"
6318 #include "confdefs.h"
6319 #include <${cf_cv_ncurses_header:-curses.h}>
6320 int
6321 main (void)
6322 {
6323 initscr()
6324   ;
6325   return 0;
6326 }
6327 _ACEOF
6328 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6329 if { (eval echo "$as_me:6329: \"$ac_link\"") >&5
6330   (eval $ac_link) 2>&5
6331   ac_status=$?
6332   echo "$as_me:6332: \$? = $ac_status" >&5
6333   (exit "$ac_status"); } &&
6334          { ac_try='test -s "conftest$ac_exeext"'
6335   { (eval echo "$as_me:6335: \"$ac_try\"") >&5
6336   (eval $ac_try) 2>&5
6337   ac_status=$?
6338   echo "$as_me:6338: \$? = $ac_status" >&5
6339   (exit "$ac_status"); }; }; then
6340   echo "$as_me:6340: result: yes" >&5
6341 echo "${ECHO_T}yes" >&6
6342                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
6343                                          break
6344 else
6345   echo "$as_me: failed program was:" >&5
6346 cat "conftest.$ac_ext" >&5
6347 echo "$as_me:6347: result: no" >&5
6348 echo "${ECHO_T}no" >&6
6349                                          LIBS="$cf_save_LIBS"
6350 fi
6351 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6352                         done
6353
6354 fi
6355 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6356
6357 fi
6358
6359 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
6360
6361 if test "$cf_found_library" = no ; then
6362         { { echo "$as_me:6362: error: Cannot link $cf_nculib_root library" >&5
6363 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
6364    { (exit 1); exit 1; }; }
6365 fi
6366
6367 fi
6368
6369 if test -n "$cf_ncurses_LIBS" ; then
6370         echo "$as_me:6370: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
6371 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
6372         cf_ncurses_SAVE="$LIBS"
6373         for p in $cf_ncurses_LIBS ; do
6374                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
6375                 if test "$q" != "$LIBS" ; then
6376                         LIBS="$q"
6377                 fi
6378         done
6379         cat >"conftest.$ac_ext" <<_ACEOF
6380 #line 6380 "configure"
6381 #include "confdefs.h"
6382 #include <${cf_cv_ncurses_header:-curses.h}>
6383 int
6384 main (void)
6385 {
6386 initscr(); mousemask(0,0); tigetstr((char *)0);
6387   ;
6388   return 0;
6389 }
6390 _ACEOF
6391 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6392 if { (eval echo "$as_me:6392: \"$ac_link\"") >&5
6393   (eval $ac_link) 2>&5
6394   ac_status=$?
6395   echo "$as_me:6395: \$? = $ac_status" >&5
6396   (exit "$ac_status"); } &&
6397          { ac_try='test -s "conftest$ac_exeext"'
6398   { (eval echo "$as_me:6398: \"$ac_try\"") >&5
6399   (eval $ac_try) 2>&5
6400   ac_status=$?
6401   echo "$as_me:6401: \$? = $ac_status" >&5
6402   (exit "$ac_status"); }; }; then
6403   echo "$as_me:6403: result: yes" >&5
6404 echo "${ECHO_T}yes" >&6
6405 else
6406   echo "$as_me: failed program was:" >&5
6407 cat "conftest.$ac_ext" >&5
6408 echo "$as_me:6408: result: no" >&5
6409 echo "${ECHO_T}no" >&6
6410                  LIBS="$cf_ncurses_SAVE"
6411 fi
6412 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6413 fi
6414
6415 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6416
6417 cat >>confdefs.h <<EOF
6418 #define $cf_nculib_ROOT 1
6419 EOF
6420
6421         fi
6422 else
6423         NCURSES_CONFIG=none
6424 fi
6425
6426 echo "$as_me:6426: checking if you want wide-character code" >&5
6427 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
6428
6429 # Check whether --enable-widec or --disable-widec was given.
6430 if test "${enable_widec+set}" = set; then
6431   enableval="$enable_widec"
6432   with_widec=$enableval
6433 else
6434   with_widec=no
6435 fi;
6436 echo "$as_me:6436: result: $with_widec" >&5
6437 echo "${ECHO_T}$with_widec" >&6
6438 if test "$with_widec" = yes ; then
6439
6440 echo "$as_me:6440: checking for multibyte character support" >&5
6441 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6442 if test "${cf_cv_utf8_lib+set}" = set; then
6443   echo $ECHO_N "(cached) $ECHO_C" >&6
6444 else
6445
6446         cf_save_LIBS="$LIBS"
6447         cat >"conftest.$ac_ext" <<_ACEOF
6448 #line 6448 "configure"
6449 #include "confdefs.h"
6450
6451 #include <stdlib.h>
6452 int
6453 main (void)
6454 {
6455 putwc(0,0);
6456   ;
6457   return 0;
6458 }
6459 _ACEOF
6460 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6461 if { (eval echo "$as_me:6461: \"$ac_link\"") >&5
6462   (eval $ac_link) 2>&5
6463   ac_status=$?
6464   echo "$as_me:6464: \$? = $ac_status" >&5
6465   (exit "$ac_status"); } &&
6466          { ac_try='test -s "conftest$ac_exeext"'
6467   { (eval echo "$as_me:6467: \"$ac_try\"") >&5
6468   (eval $ac_try) 2>&5
6469   ac_status=$?
6470   echo "$as_me:6470: \$? = $ac_status" >&5
6471   (exit "$ac_status"); }; }; then
6472   cf_cv_utf8_lib=yes
6473 else
6474   echo "$as_me: failed program was:" >&5
6475 cat "conftest.$ac_ext" >&5
6476
6477 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6478 # will be set on completion of the AC_TRY_LINK below.
6479 cf_cv_header_path_utf8=
6480 cf_cv_library_path_utf8=
6481
6482 echo "${as_me:-configure}:6482: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6483
6484 cf_save_LIBS="$LIBS"
6485
6486 cat >"conftest.$ac_ext" <<_ACEOF
6487 #line 6487 "configure"
6488 #include "confdefs.h"
6489
6490 #include <libutf8.h>
6491 int
6492 main (void)
6493 {
6494 putwc(0,0);
6495   ;
6496   return 0;
6497 }
6498 _ACEOF
6499 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6500 if { (eval echo "$as_me:6500: \"$ac_link\"") >&5
6501   (eval $ac_link) 2>&5
6502   ac_status=$?
6503   echo "$as_me:6503: \$? = $ac_status" >&5
6504   (exit "$ac_status"); } &&
6505          { ac_try='test -s "conftest$ac_exeext"'
6506   { (eval echo "$as_me:6506: \"$ac_try\"") >&5
6507   (eval $ac_try) 2>&5
6508   ac_status=$?
6509   echo "$as_me:6509: \$? = $ac_status" >&5
6510   (exit "$ac_status"); }; }; then
6511
6512         cf_cv_find_linkage_utf8=yes
6513         cf_cv_header_path_utf8=/usr/include
6514         cf_cv_library_path_utf8=/usr/lib
6515
6516 else
6517   echo "$as_me: failed program was:" >&5
6518 cat "conftest.$ac_ext" >&5
6519
6520 LIBS="-lutf8  $cf_save_LIBS"
6521
6522 cat >"conftest.$ac_ext" <<_ACEOF
6523 #line 6523 "configure"
6524 #include "confdefs.h"
6525
6526 #include <libutf8.h>
6527 int
6528 main (void)
6529 {
6530 putwc(0,0);
6531   ;
6532   return 0;
6533 }
6534 _ACEOF
6535 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6536 if { (eval echo "$as_me:6536: \"$ac_link\"") >&5
6537   (eval $ac_link) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit "$ac_status"); } &&
6541          { ac_try='test -s "conftest$ac_exeext"'
6542   { (eval echo "$as_me:6542: \"$ac_try\"") >&5
6543   (eval $ac_try) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit "$ac_status"); }; }; then
6547
6548         cf_cv_find_linkage_utf8=yes
6549         cf_cv_header_path_utf8=/usr/include
6550         cf_cv_library_path_utf8=/usr/lib
6551         cf_cv_library_file_utf8="-lutf8"
6552
6553 else
6554   echo "$as_me: failed program was:" >&5
6555 cat "conftest.$ac_ext" >&5
6556
6557         cf_cv_find_linkage_utf8=no
6558         LIBS="$cf_save_LIBS"
6559
6560         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6561
6562 echo "${as_me:-configure}:6562: testing find linkage for utf8 library ..." 1>&5
6563
6564 echo "${as_me:-configure}:6564: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6565
6566         cf_save_CPPFLAGS="$CPPFLAGS"
6567         cf_test_CPPFLAGS="$CPPFLAGS"
6568
6569 cf_search=
6570
6571 # collect the current set of include-directories from compiler flags
6572 cf_header_path_list=""
6573 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6574         for cf_header_path in $CPPFLAGS $CFLAGS
6575         do
6576                 case "$cf_header_path" in
6577                 (-I*)
6578                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6579
6580 test "x$cf_header_path" != "xNONE" && \
6581 test -d "$cf_header_path" && \
6582  {
6583         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6584         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
6585         test -d "$cf_header_path/include/utf8" &&       cf_search="$cf_search $cf_header_path/include/utf8"
6586         test -d "$cf_header_path/include/utf8/include" &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6587         test -d "$cf_header_path/utf8/include" &&       cf_search="$cf_search $cf_header_path/utf8/include"
6588         test -d "$cf_header_path/utf8/include/utf8" &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6589 }
6590
6591                         cf_header_path_list="$cf_header_path_list $cf_search"
6592                         ;;
6593                 esac
6594         done
6595 fi
6596
6597 # add the variations for the package we are looking for
6598
6599 cf_search=
6600
6601 test "x$prefix" != "xNONE" && \
6602 test -d "$prefix" && \
6603  {
6604         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6605         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
6606         test -d "$prefix/include/utf8" &&       cf_search="$cf_search $prefix/include/utf8"
6607         test -d "$prefix/include/utf8/include" &&    cf_search="$cf_search $prefix/include/utf8/include"
6608         test -d "$prefix/utf8/include" &&       cf_search="$cf_search $prefix/utf8/include"
6609         test -d "$prefix/utf8/include/utf8" &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6610 }
6611
6612 for cf_subdir_prefix in \
6613         /usr \
6614         /usr/local \
6615         /usr/pkg \
6616         /opt \
6617         /opt/local \
6618         $HOME
6619 do
6620
6621 test "x$cf_subdir_prefix" != "x$prefix" && \
6622 test -d "$cf_subdir_prefix" && \
6623 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6624         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6625         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
6626         test -d "$cf_subdir_prefix/include/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6627         test -d "$cf_subdir_prefix/include/utf8/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6628         test -d "$cf_subdir_prefix/utf8/include" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6629         test -d "$cf_subdir_prefix/utf8/include/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6630 }
6631
6632 done
6633
6634 test "$includedir" != NONE && \
6635 test "$includedir" != "/usr/include" && \
6636 test -d "$includedir" && {
6637         test -d "$includedir" &&    cf_search="$cf_search $includedir"
6638         test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8"
6639 }
6640
6641 test "$oldincludedir" != NONE && \
6642 test "$oldincludedir" != "/usr/include" && \
6643 test -d "$oldincludedir" && {
6644         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
6645         test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8"
6646 }
6647
6648 cf_search="$cf_search $cf_header_path_list"
6649
6650         for cf_cv_header_path_utf8 in $cf_search
6651         do
6652                 if test -d "$cf_cv_header_path_utf8" ; then
6653                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6654
6655 echo "${as_me:-configure}:6655: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6656
6657                         CPPFLAGS="$cf_save_CPPFLAGS"
6658
6659         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6660         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6661
6662                         cat >"conftest.$ac_ext" <<_ACEOF
6663 #line 6663 "configure"
6664 #include "confdefs.h"
6665
6666 #include <libutf8.h>
6667 int
6668 main (void)
6669 {
6670 putwc(0,0);
6671   ;
6672   return 0;
6673 }
6674 _ACEOF
6675 rm -f "conftest.$ac_objext"
6676 if { (eval echo "$as_me:6676: \"$ac_compile\"") >&5
6677   (eval $ac_compile) 2>&5
6678   ac_status=$?
6679   echo "$as_me:6679: \$? = $ac_status" >&5
6680   (exit "$ac_status"); } &&
6681          { ac_try='test -s "conftest.$ac_objext"'
6682   { (eval echo "$as_me:6682: \"$ac_try\"") >&5
6683   (eval $ac_try) 2>&5
6684   ac_status=$?
6685   echo "$as_me:6685: \$? = $ac_status" >&5
6686   (exit "$ac_status"); }; }; then
6687
6688                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6689
6690 echo "${as_me:-configure}:6690: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6691
6692                                 cf_cv_find_linkage_utf8=maybe
6693                                 cf_test_CPPFLAGS="$CPPFLAGS"
6694                                 break
6695 else
6696   echo "$as_me: failed program was:" >&5
6697 cat "conftest.$ac_ext" >&5
6698
6699                                 CPPFLAGS="$cf_save_CPPFLAGS"
6700
6701 fi
6702 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6703                 fi
6704         done
6705
6706         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6707
6708 echo "${as_me:-configure}:6708: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6709
6710                 cf_save_LIBS="$LIBS"
6711                 cf_save_LDFLAGS="$LDFLAGS"
6712
6713                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6714
6715 cf_search=
6716 cf_library_path_list=""
6717 if test -n "${LDFLAGS}${LIBS}" ; then
6718         for cf_library_path in $LDFLAGS $LIBS
6719         do
6720                 case "$cf_library_path" in
6721                 (-L*)
6722                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6723
6724 test "x$cf_library_path" != "xNONE" && \
6725 test -d "$cf_library_path" && \
6726  {
6727         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6728         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
6729         test -d "$cf_library_path/lib/utf8" &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6730         test -d "$cf_library_path/lib/utf8/lib" &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6731         test -d "$cf_library_path/utf8/lib" &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6732         test -d "$cf_library_path/utf8/lib/utf8" &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6733 }
6734
6735                         cf_library_path_list="$cf_library_path_list $cf_search"
6736                         ;;
6737                 esac
6738         done
6739 fi
6740
6741 cf_search=
6742
6743 test "x$prefix" != "xNONE" && \
6744 test -d "$prefix" && \
6745  {
6746         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6747         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
6748         test -d "$prefix/lib/utf8" &&       cf_search="$cf_search $prefix/lib/utf8"
6749         test -d "$prefix/lib/utf8/lib" &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6750         test -d "$prefix/utf8/lib" &&       cf_search="$cf_search $prefix/utf8/lib"
6751         test -d "$prefix/utf8/lib/utf8" &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6752 }
6753
6754 for cf_subdir_prefix in \
6755         /usr \
6756         /usr/local \
6757         /usr/pkg \
6758         /opt \
6759         /opt/local \
6760         $HOME
6761 do
6762
6763 test "x$cf_subdir_prefix" != "x$prefix" && \
6764 test -d "$cf_subdir_prefix" && \
6765 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
6766         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6767         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6768         test -d "$cf_subdir_prefix/lib/utf8" &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6769         test -d "$cf_subdir_prefix/lib/utf8/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6770         test -d "$cf_subdir_prefix/utf8/lib" &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6771         test -d "$cf_subdir_prefix/utf8/lib/utf8" &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6772 }
6773
6774 done
6775
6776 cf_search="$cf_library_path_list $cf_search"
6777
6778                         for cf_cv_library_path_utf8 in $cf_search
6779                         do
6780                                 if test -d "$cf_cv_library_path_utf8" ; then
6781                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6782
6783 echo "${as_me:-configure}:6783: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6784
6785                                         CPPFLAGS="$cf_test_CPPFLAGS"
6786                                         LIBS="-lutf8  $cf_save_LIBS"
6787                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6788                                         cat >"conftest.$ac_ext" <<_ACEOF
6789 #line 6789 "configure"
6790 #include "confdefs.h"
6791
6792 #include <libutf8.h>
6793 int
6794 main (void)
6795 {
6796 putwc(0,0);
6797   ;
6798   return 0;
6799 }
6800 _ACEOF
6801 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
6802 if { (eval echo "$as_me:6802: \"$ac_link\"") >&5
6803   (eval $ac_link) 2>&5
6804   ac_status=$?
6805   echo "$as_me:6805: \$? = $ac_status" >&5
6806   (exit "$ac_status"); } &&
6807          { ac_try='test -s "conftest$ac_exeext"'
6808   { (eval echo "$as_me:6808: \"$ac_try\"") >&5
6809   (eval $ac_try) 2>&5
6810   ac_status=$?
6811   echo "$as_me:6811: \$? = $ac_status" >&5
6812   (exit "$ac_status"); }; }; then
6813
6814                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6815
6816 echo "${as_me:-configure}:6816: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6817
6818                                         cf_cv_find_linkage_utf8=yes
6819                                         cf_cv_library_file_utf8="-lutf8"
6820                                         break
6821 else
6822   echo "$as_me: failed program was:" >&5
6823 cat "conftest.$ac_ext" >&5
6824
6825                                         CPPFLAGS="$cf_save_CPPFLAGS"
6826                                         LIBS="$cf_save_LIBS"
6827                                         LDFLAGS="$cf_save_LDFLAGS"
6828
6829 fi
6830 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6831                                 fi
6832                         done
6833                         CPPFLAGS="$cf_save_CPPFLAGS"
6834                         LDFLAGS="$cf_save_LDFLAGS"
6835                 fi
6836
6837         else
6838                 cf_cv_find_linkage_utf8=no
6839         fi
6840
6841 fi
6842 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6843
6844 fi
6845 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6846
6847 LIBS="$cf_save_LIBS"
6848
6849 if test "$cf_cv_find_linkage_utf8" = yes ; then
6850 cf_cv_utf8_lib=add-on
6851 else
6852 cf_cv_utf8_lib=no
6853 fi
6854
6855 fi
6856 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
6857 fi
6858 echo "$as_me:6858: result: $cf_cv_utf8_lib" >&5
6859 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6860
6861 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6862 # ncurses/ncursesw:
6863 if test "$cf_cv_utf8_lib" = "add-on" ; then
6864
6865 cat >>confdefs.h <<\EOF
6866 #define HAVE_LIBUTF8_H 1
6867 EOF
6868
6869 if test -n "$cf_cv_header_path_utf8" ; then
6870   for cf_add_incdir in $cf_cv_header_path_utf8
6871   do
6872         while test "$cf_add_incdir" != /usr/include
6873         do
6874           if test -d "$cf_add_incdir"
6875           then
6876                 cf_have_incdir=no
6877                 if test -n "$CFLAGS$CPPFLAGS" ; then
6878                   # a loop is needed to ensure we can add subdirs of existing dirs
6879                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6880                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6881                           cf_have_incdir=yes; break
6882                         fi
6883                   done
6884                 fi
6885
6886                 if test "$cf_have_incdir" = no ; then
6887                   if test "$cf_add_incdir" = /usr/local/include ; then
6888                         if test "$GCC" = yes
6889                         then
6890                           cf_save_CPPFLAGS=$CPPFLAGS
6891
6892         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6893         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6894
6895                           cat >"conftest.$ac_ext" <<_ACEOF
6896 #line 6896 "configure"
6897 #include "confdefs.h"
6898 #include <stdio.h>
6899 int
6900 main (void)
6901 {
6902 printf("Hello")
6903   ;
6904   return 0;
6905 }
6906 _ACEOF
6907 rm -f "conftest.$ac_objext"
6908 if { (eval echo "$as_me:6908: \"$ac_compile\"") >&5
6909   (eval $ac_compile) 2>&5
6910   ac_status=$?
6911   echo "$as_me:6911: \$? = $ac_status" >&5
6912   (exit "$ac_status"); } &&
6913          { ac_try='test -s "conftest.$ac_objext"'
6914   { (eval echo "$as_me:6914: \"$ac_try\"") >&5
6915   (eval $ac_try) 2>&5
6916   ac_status=$?
6917   echo "$as_me:6917: \$? = $ac_status" >&5
6918   (exit "$ac_status"); }; }; then
6919   :
6920 else
6921   echo "$as_me: failed program was:" >&5
6922 cat "conftest.$ac_ext" >&5
6923 cf_have_incdir=yes
6924 fi
6925 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
6926                           CPPFLAGS=$cf_save_CPPFLAGS
6927                         fi
6928                   fi
6929                 fi
6930
6931                 if test "$cf_have_incdir" = no ; then
6932                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6933
6934 echo "${as_me:-configure}:6934: testing adding $cf_add_incdir to include-path ..." 1>&5
6935
6936                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6937
6938                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
6939                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6940                   cf_add_incdir="$cf_top_incdir"
6941                 else
6942                   break
6943                 fi
6944           else
6945                 break
6946           fi
6947         done
6948   done
6949 fi
6950
6951 if test -n "$cf_cv_library_path_utf8" ; then
6952         for cf_add_libdir in $cf_cv_library_path_utf8
6953         do
6954                 if test "$cf_add_libdir" = /usr/lib ; then
6955                         :
6956                 elif test -d "$cf_add_libdir"
6957                 then
6958                         cf_have_libdir=no
6959                         if test -n "$LDFLAGS$LIBS" ; then
6960                                 # a loop is needed to ensure we can add subdirs of existing dirs
6961                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6962                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6963                                                 cf_have_libdir=yes; break
6964                                         fi
6965                                 done
6966                         fi
6967                         if test "$cf_have_libdir" = no ; then
6968                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6969
6970 echo "${as_me:-configure}:6970: testing adding $cf_add_libdir to library-path ..." 1>&5
6971
6972                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6973                         fi
6974                 fi
6975         done
6976 fi
6977
6978 cf_add_libs="$LIBS"
6979 # reverse order
6980 cf_add_0lib=
6981 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6982 # filter duplicates
6983 for cf_add_1lib in $cf_add_0lib; do
6984         for cf_add_2lib in $cf_add_libs; do
6985                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6986                         cf_add_1lib=
6987                         break
6988                 fi
6989         done
6990         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6991 done
6992 LIBS="$cf_add_libs"
6993
6994 fi
6995
6996 cf_ncuconfig_root=ncursesw
6997 cf_have_ncuconfig=no
6998
6999 if test "x${PKG_CONFIG:=none}" != xnone; then
7000         echo "$as_me:7000: checking pkg-config for $cf_ncuconfig_root" >&5
7001 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7002         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7003                 echo "$as_me:7003: result: yes" >&5
7004 echo "${ECHO_T}yes" >&6
7005
7006                 echo "$as_me:7006: checking if the $cf_ncuconfig_root package files work" >&5
7007 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7008                 cf_have_ncuconfig=unknown
7009
7010                 cf_save_CFLAGS="$CFLAGS"
7011                 cf_save_CPPFLAGS="$CPPFLAGS"
7012                 cf_save_LIBS="$LIBS"
7013
7014                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7015                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7016
7017                 # while -W for passing linker flags is prevalent, it is not "standard".
7018                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7019                 # incompatible _and_ non-standard -W option which gives an error.  Work
7020                 # around that pitfall.
7021                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7022                 (x*c[89]9@@*-W*)
7023
7024 cf_fix_cppflags=no
7025 cf_new_cflags=
7026 cf_new_cppflags=
7027 cf_new_extra_cppflags=
7028
7029 for cf_add_cflags in $cf_pkg_cflags
7030 do
7031 case "$cf_fix_cppflags" in
7032 (no)
7033         case "$cf_add_cflags" in
7034         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7035                 case "$cf_add_cflags" in
7036                 (-D*)
7037                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7038
7039                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7040                                 && test -z "${cf_tst_cflags}" \
7041                                 && cf_fix_cppflags=yes
7042
7043                         if test "$cf_fix_cppflags" = yes ; then
7044
7045         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7046         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7047
7048                                 continue
7049                         elif test "${cf_tst_cflags}" = "\"'" ; then
7050
7051         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7052         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7053
7054                                 continue
7055                         fi
7056                         ;;
7057                 esac
7058                 case "$CPPFLAGS" in
7059                 (*$cf_add_cflags)
7060                         ;;
7061                 (*)
7062                         case "$cf_add_cflags" in
7063                         (-D*)
7064                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7065
7066 CPPFLAGS=`echo "$CPPFLAGS" | \
7067         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7068                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7069
7070                                 ;;
7071                         esac
7072
7073         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7074         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7075
7076                         ;;
7077                 esac
7078                 ;;
7079         (*)
7080
7081         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7082         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7083
7084                 ;;
7085         esac
7086         ;;
7087 (yes)
7088
7089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7091
7092         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7093
7094         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7095                 && test -z "${cf_tst_cflags}" \
7096                 && cf_fix_cppflags=no
7097         ;;
7098 esac
7099 done
7100
7101 if test -n "$cf_new_cflags" ; then
7102
7103         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7104         CFLAGS="${CFLAGS}$cf_new_cflags"
7105
7106 fi
7107
7108 if test -n "$cf_new_cppflags" ; then
7109
7110         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7111         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7112
7113 fi
7114
7115 if test -n "$cf_new_extra_cppflags" ; then
7116
7117         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7118         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7119
7120 fi
7121
7122 cf_add_libs="$LIBS"
7123 # reverse order
7124 cf_add_0lib=
7125 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7126 # filter duplicates
7127 for cf_add_1lib in $cf_add_0lib; do
7128         for cf_add_2lib in $cf_add_libs; do
7129                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7130                         cf_add_1lib=
7131                         break
7132                 fi
7133         done
7134         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7135 done
7136 LIBS="$cf_add_libs"
7137
7138                         cat >"conftest.$ac_ext" <<_ACEOF
7139 #line 7139 "configure"
7140 #include "confdefs.h"
7141 #include <${cf_cv_ncurses_header:-curses.h}>
7142 int
7143 main (void)
7144 {
7145 initscr(); mousemask(0,0); tigetstr((char *)0);
7146   ;
7147   return 0;
7148 }
7149 _ACEOF
7150 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7151 if { (eval echo "$as_me:7151: \"$ac_link\"") >&5
7152   (eval $ac_link) 2>&5
7153   ac_status=$?
7154   echo "$as_me:7154: \$? = $ac_status" >&5
7155   (exit "$ac_status"); } &&
7156          { ac_try='test -s "conftest$ac_exeext"'
7157   { (eval echo "$as_me:7157: \"$ac_try\"") >&5
7158   (eval $ac_try) 2>&5
7159   ac_status=$?
7160   echo "$as_me:7160: \$? = $ac_status" >&5
7161   (exit "$ac_status"); }; }; then
7162   if test "$cross_compiling" = yes; then
7163   cf_test_ncuconfig=maybe
7164 else
7165   cat >"conftest.$ac_ext" <<_ACEOF
7166 #line 7166 "configure"
7167 #include "confdefs.h"
7168 #include <${cf_cv_ncurses_header:-curses.h}>
7169                                         int main(void)
7170                                         { char *xx = curses_version(); return (xx == 0); }
7171 _ACEOF
7172 rm -f "conftest$ac_exeext"
7173 if { (eval echo "$as_me:7173: \"$ac_link\"") >&5
7174   (eval $ac_link) 2>&5
7175   ac_status=$?
7176   echo "$as_me:7176: \$? = $ac_status" >&5
7177   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7178   { (eval echo "$as_me:7178: \"$ac_try\"") >&5
7179   (eval $ac_try) 2>&5
7180   ac_status=$?
7181   echo "$as_me:7181: \$? = $ac_status" >&5
7182   (exit "$ac_status"); }; }; then
7183   cf_test_ncuconfig=yes
7184 else
7185   echo "$as_me: program exited with status $ac_status" >&5
7186 echo "$as_me: failed program was:" >&5
7187 cat "conftest.$ac_ext" >&5
7188 cf_test_ncuconfig=no
7189 fi
7190 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7191 fi
7192 else
7193   echo "$as_me: failed program was:" >&5
7194 cat "conftest.$ac_ext" >&5
7195 cf_test_ncuconfig=no
7196 fi
7197 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7198
7199                         CFLAGS="$cf_save_CFLAGS"
7200                         CPPFLAGS="$cf_save_CPPFLAGS"
7201                         LIBS="$cf_save_LIBS"
7202
7203                         if test "x$cf_test_ncuconfig" != xyes; then
7204                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7205                                 cf_pkg_cflags="$cf_temp"
7206                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7207                                 cf_pkg_libs="$cf_temp"
7208                         fi
7209                         ;;
7210                 esac
7211
7212 cf_fix_cppflags=no
7213 cf_new_cflags=
7214 cf_new_cppflags=
7215 cf_new_extra_cppflags=
7216
7217 for cf_add_cflags in $cf_pkg_cflags
7218 do
7219 case "$cf_fix_cppflags" in
7220 (no)
7221         case "$cf_add_cflags" in
7222         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7223                 case "$cf_add_cflags" in
7224                 (-D*)
7225                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7226
7227                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7228                                 && test -z "${cf_tst_cflags}" \
7229                                 && cf_fix_cppflags=yes
7230
7231                         if test "$cf_fix_cppflags" = yes ; then
7232
7233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7235
7236                                 continue
7237                         elif test "${cf_tst_cflags}" = "\"'" ; then
7238
7239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7241
7242                                 continue
7243                         fi
7244                         ;;
7245                 esac
7246                 case "$CPPFLAGS" in
7247                 (*$cf_add_cflags)
7248                         ;;
7249                 (*)
7250                         case "$cf_add_cflags" in
7251                         (-D*)
7252                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7253
7254 CPPFLAGS=`echo "$CPPFLAGS" | \
7255         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7256                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7257
7258                                 ;;
7259                         esac
7260
7261         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7262         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7263
7264                         ;;
7265                 esac
7266                 ;;
7267         (*)
7268
7269         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7270         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7271
7272                 ;;
7273         esac
7274         ;;
7275 (yes)
7276
7277         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7278         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7279
7280         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7281
7282         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7283                 && test -z "${cf_tst_cflags}" \
7284                 && cf_fix_cppflags=no
7285         ;;
7286 esac
7287 done
7288
7289 if test -n "$cf_new_cflags" ; then
7290
7291         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7292         CFLAGS="${CFLAGS}$cf_new_cflags"
7293
7294 fi
7295
7296 if test -n "$cf_new_cppflags" ; then
7297
7298         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7299         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7300
7301 fi
7302
7303 if test -n "$cf_new_extra_cppflags" ; then
7304
7305         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7306         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7307
7308 fi
7309
7310 cf_add_libs="$LIBS"
7311 # reverse order
7312 cf_add_0lib=
7313 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7314 # filter duplicates
7315 for cf_add_1lib in $cf_add_0lib; do
7316         for cf_add_2lib in $cf_add_libs; do
7317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7318                         cf_add_1lib=
7319                         break
7320                 fi
7321         done
7322         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7323 done
7324 LIBS="$cf_add_libs"
7325
7326                 cat >"conftest.$ac_ext" <<_ACEOF
7327 #line 7327 "configure"
7328 #include "confdefs.h"
7329 #include <${cf_cv_ncurses_header:-curses.h}>
7330 int
7331 main (void)
7332 {
7333 initscr(); mousemask(0,0); tigetstr((char *)0);
7334   ;
7335   return 0;
7336 }
7337 _ACEOF
7338 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
7339 if { (eval echo "$as_me:7339: \"$ac_link\"") >&5
7340   (eval $ac_link) 2>&5
7341   ac_status=$?
7342   echo "$as_me:7342: \$? = $ac_status" >&5
7343   (exit "$ac_status"); } &&
7344          { ac_try='test -s "conftest$ac_exeext"'
7345   { (eval echo "$as_me:7345: \"$ac_try\"") >&5
7346   (eval $ac_try) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit "$ac_status"); }; }; then
7350   if test "$cross_compiling" = yes; then
7351   cf_have_ncuconfig=maybe
7352 else
7353   cat >"conftest.$ac_ext" <<_ACEOF
7354 #line 7354 "configure"
7355 #include "confdefs.h"
7356 #include <${cf_cv_ncurses_header:-curses.h}>
7357                                 int main(void)
7358                                 { char *xx = curses_version(); return (xx == 0); }
7359 _ACEOF
7360 rm -f "conftest$ac_exeext"
7361 if { (eval echo "$as_me:7361: \"$ac_link\"") >&5
7362   (eval $ac_link) 2>&5
7363   ac_status=$?
7364   echo "$as_me:7364: \$? = $ac_status" >&5
7365   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
7366   { (eval echo "$as_me:7366: \"$ac_try\"") >&5
7367   (eval $ac_try) 2>&5
7368   ac_status=$?
7369   echo "$as_me:7369: \$? = $ac_status" >&5
7370   (exit "$ac_status"); }; }; then
7371   cf_have_ncuconfig=yes
7372 else
7373   echo "$as_me: program exited with status $ac_status" >&5
7374 echo "$as_me: failed program was:" >&5
7375 cat "conftest.$ac_ext" >&5
7376 cf_have_ncuconfig=no
7377 fi
7378 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
7379 fi
7380 else
7381   echo "$as_me: failed program was:" >&5
7382 cat "conftest.$ac_ext" >&5
7383 cf_have_ncuconfig=no
7384 fi
7385 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
7386                 echo "$as_me:7386: result: $cf_have_ncuconfig" >&5
7387 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7388                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7389                 if test "$cf_have_ncuconfig" != "yes"
7390                 then
7391                         CPPFLAGS="$cf_save_CPPFLAGS"
7392                         LIBS="$cf_save_LIBS"
7393                         NCURSES_CONFIG_PKG=none
7394                 else
7395
7396 cat >>confdefs.h <<\EOF
7397 #define NCURSES 1
7398 EOF
7399
7400                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7401
7402 echo "$as_me:7402: checking for terminfo header" >&5
7403 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7404 if test "${cf_cv_term_header+set}" = set; then
7405   echo $ECHO_N "(cached) $ECHO_C" >&6
7406 else
7407
7408 case "${cf_cv_ncurses_header}" in
7409 (*/ncurses.h|*/ncursesw.h)
7410         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7411         ;;
7412 (*)
7413         cf_term_header=term.h
7414         ;;
7415 esac
7416
7417 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7418 do
7419 cat >"conftest.$ac_ext" <<_ACEOF
7420 #line 7420 "configure"
7421 #include "confdefs.h"
7422 #include <stdio.h>
7423 #include <${cf_cv_ncurses_header:-curses.h}>
7424 #include <$cf_test>
7425
7426 int
7427 main (void)
7428 {
7429 int x = auto_left_margin; (void)x
7430   ;
7431   return 0;
7432 }
7433 _ACEOF
7434 rm -f "conftest.$ac_objext"
7435 if { (eval echo "$as_me:7435: \"$ac_compile\"") >&5
7436   (eval $ac_compile) 2>&5
7437   ac_status=$?
7438   echo "$as_me:7438: \$? = $ac_status" >&5
7439   (exit "$ac_status"); } &&
7440          { ac_try='test -s "conftest.$ac_objext"'
7441   { (eval echo "$as_me:7441: \"$ac_try\"") >&5
7442   (eval $ac_try) 2>&5
7443   ac_status=$?
7444   echo "$as_me:7444: \$? = $ac_status" >&5
7445   (exit "$ac_status"); }; }; then
7446
7447         cf_cv_term_header="$cf_test"
7448 else
7449   echo "$as_me: failed program was:" >&5
7450 cat "conftest.$ac_ext" >&5
7451
7452         cf_cv_term_header=unknown
7453
7454 fi
7455 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7456         test "$cf_cv_term_header" != unknown && break
7457 done
7458
7459 fi
7460 echo "$as_me:7460: result: $cf_cv_term_header" >&5
7461 echo "${ECHO_T}$cf_cv_term_header" >&6
7462
7463 # Set definitions to allow ifdef'ing to accommodate subdirectories
7464
7465 case "$cf_cv_term_header" in
7466 (*term.h)
7467
7468 cat >>confdefs.h <<\EOF
7469 #define HAVE_TERM_H 1
7470 EOF
7471
7472         ;;
7473 esac
7474
7475 case "$cf_cv_term_header" in
7476 (ncurses/term.h)
7477
7478 cat >>confdefs.h <<\EOF
7479 #define HAVE_NCURSES_TERM_H 1
7480 EOF
7481
7482         ;;
7483 (ncursesw/term.h)
7484
7485 cat >>confdefs.h <<\EOF
7486 #define HAVE_NCURSESW_TERM_H 1
7487 EOF
7488
7489         ;;
7490 esac
7491
7492                 fi
7493
7494         else
7495                 echo "$as_me:7495: result: no" >&5
7496 echo "${ECHO_T}no" >&6
7497                 NCURSES_CONFIG_PKG=none
7498         fi
7499 else
7500         NCURSES_CONFIG_PKG=none
7501 fi
7502
7503 if test "x$cf_have_ncuconfig" = "xno"; then
7504         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7505
7506 if test -n "$ac_tool_prefix"; then
7507   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7508   do
7509     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7510 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7511 echo "$as_me:7511: checking for $ac_word" >&5
7512 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7513 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7514   echo $ECHO_N "(cached) $ECHO_C" >&6
7515 else
7516   if test -n "$NCURSES_CONFIG"; then
7517   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7518 else
7519   ac_save_IFS=$IFS; IFS=$ac_path_separator
7520 ac_dummy="$PATH"
7521 for ac_dir in $ac_dummy; do
7522   IFS=$ac_save_IFS
7523   test -z "$ac_dir" && ac_dir=.
7524   $as_executable_p "$ac_dir/$ac_word" || continue
7525 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7526 echo "$as_me:7526: found $ac_dir/$ac_word" >&5
7527 break
7528 done
7529
7530 fi
7531 fi
7532 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7533 if test -n "$NCURSES_CONFIG"; then
7534   echo "$as_me:7534: result: $NCURSES_CONFIG" >&5
7535 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7536 else
7537   echo "$as_me:7537: result: no" >&5
7538 echo "${ECHO_T}no" >&6
7539 fi
7540
7541     test -n "$NCURSES_CONFIG" && break
7542   done
7543 fi
7544 if test -z "$NCURSES_CONFIG"; then
7545   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7546   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7547 do
7548   # Extract the first word of "$ac_prog", so it can be a program name with args.
7549 set dummy $ac_prog; ac_word=$2
7550 echo "$as_me:7550: checking for $ac_word" >&5
7551 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7552 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7553   echo $ECHO_N "(cached) $ECHO_C" >&6
7554 else
7555   if test -n "$ac_ct_NCURSES_CONFIG"; then
7556   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7557 else
7558   ac_save_IFS=$IFS; IFS=$ac_path_separator
7559 ac_dummy="$PATH"
7560 for ac_dir in $ac_dummy; do
7561   IFS=$ac_save_IFS
7562   test -z "$ac_dir" && ac_dir=.
7563   $as_executable_p "$ac_dir/$ac_word" || continue
7564 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7565 echo "$as_me:7565: found $ac_dir/$ac_word" >&5
7566 break
7567 done
7568
7569 fi
7570 fi
7571 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7572 if test -n "$ac_ct_NCURSES_CONFIG"; then
7573   echo "$as_me:7573: result: $ac_ct_NCURSES_CONFIG" >&5
7574 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7575 else
7576   echo "$as_me:7576: result: no" >&5
7577 echo "${ECHO_T}no" >&6
7578 fi
7579
7580   test -n "$ac_ct_NCURSES_CONFIG" && break
7581 done
7582 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7583
7584   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7585 fi
7586
7587         if test "$NCURSES_CONFIG" != none ; then
7588
7589 cf_fix_cppflags=no
7590 cf_new_cflags=
7591 cf_new_cppflags=
7592 cf_new_extra_cppflags=
7593
7594 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7595 do
7596 case "$cf_fix_cppflags" in
7597 (no)
7598         case "$cf_add_cflags" in
7599         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7600                 case "$cf_add_cflags" in
7601                 (-D*)
7602                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7603
7604                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7605                                 && test -z "${cf_tst_cflags}" \
7606                                 && cf_fix_cppflags=yes
7607
7608                         if test "$cf_fix_cppflags" = yes ; then
7609
7610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7612
7613                                 continue
7614                         elif test "${cf_tst_cflags}" = "\"'" ; then
7615
7616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7618
7619                                 continue
7620                         fi
7621                         ;;
7622                 esac
7623                 case "$CPPFLAGS" in
7624                 (*$cf_add_cflags)
7625                         ;;
7626                 (*)
7627                         case "$cf_add_cflags" in
7628                         (-D*)
7629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7630
7631 CPPFLAGS=`echo "$CPPFLAGS" | \
7632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7634
7635                                 ;;
7636                         esac
7637
7638         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7639         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7640
7641                         ;;
7642                 esac
7643                 ;;
7644         (*)
7645
7646         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7647         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7648
7649                 ;;
7650         esac
7651         ;;
7652 (yes)
7653
7654         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7655         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7656
7657         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
7658
7659         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7660                 && test -z "${cf_tst_cflags}" \
7661                 && cf_fix_cppflags=no
7662         ;;
7663 esac
7664 done
7665
7666 if test -n "$cf_new_cflags" ; then
7667
7668         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7669         CFLAGS="${CFLAGS}$cf_new_cflags"
7670
7671 fi
7672
7673 if test -n "$cf_new_cppflags" ; then
7674
7675         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7676         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7677
7678 fi
7679
7680 if test -n "$cf_new_extra_cppflags" ; then
7681
7682         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7683         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7684
7685 fi
7686
7687 cf_add_libs="$LIBS"
7688 # reverse order
7689 cf_add_0lib=
7690 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7691 # filter duplicates
7692 for cf_add_1lib in $cf_add_0lib; do
7693         for cf_add_2lib in $cf_add_libs; do
7694                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7695                         cf_add_1lib=
7696                         break
7697                 fi
7698         done
7699         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7700 done
7701 LIBS="$cf_add_libs"
7702
7703                 # even with config script, some packages use no-override for curses.h
7704
7705 echo "$as_me:7705: checking if we have identified curses headers" >&5
7706 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7707 if test "${cf_cv_ncurses_header+set}" = set; then
7708   echo $ECHO_N "(cached) $ECHO_C" >&6
7709 else
7710
7711 cf_cv_ncurses_header=none
7712 for cf_header in \
7713         ncurses.h ncursesw/ncurses.h \
7714         curses.h ncursesw/curses.h
7715 do
7716 cat >"conftest.$ac_ext" <<_ACEOF
7717 #line 7717 "configure"
7718 #include "confdefs.h"
7719 #include <${cf_header}>
7720 int
7721 main (void)
7722 {
7723 initscr(); tgoto("?", 0,0)
7724   ;
7725   return 0;
7726 }
7727 _ACEOF
7728 rm -f "conftest.$ac_objext"
7729 if { (eval echo "$as_me:7729: \"$ac_compile\"") >&5
7730   (eval $ac_compile) 2>&5
7731   ac_status=$?
7732   echo "$as_me:7732: \$? = $ac_status" >&5
7733   (exit "$ac_status"); } &&
7734          { ac_try='test -s "conftest.$ac_objext"'
7735   { (eval echo "$as_me:7735: \"$ac_try\"") >&5
7736   (eval $ac_try) 2>&5
7737   ac_status=$?
7738   echo "$as_me:7738: \$? = $ac_status" >&5
7739   (exit "$ac_status"); }; }; then
7740   cf_cv_ncurses_header=$cf_header; break
7741 else
7742   echo "$as_me: failed program was:" >&5
7743 cat "conftest.$ac_ext" >&5
7744 fi
7745 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7746 done
7747
7748 fi
7749 echo "$as_me:7749: result: $cf_cv_ncurses_header" >&5
7750 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7751
7752 if test "$cf_cv_ncurses_header" = none ; then
7753         { { echo "$as_me:7753: error: No curses header-files found" >&5
7754 echo "$as_me: error: No curses header-files found" >&2;}
7755    { (exit 1); exit 1; }; }
7756 fi
7757
7758 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7759
7760 for ac_header in $cf_cv_ncurses_header
7761 do
7762 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7763 echo "$as_me:7763: checking for $ac_header" >&5
7764 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7765 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7766   echo $ECHO_N "(cached) $ECHO_C" >&6
7767 else
7768   cat >"conftest.$ac_ext" <<_ACEOF
7769 #line 7769 "configure"
7770 #include "confdefs.h"
7771 #include <$ac_header>
7772 _ACEOF
7773 if { (eval echo "$as_me:7773: \"$ac_cpp "conftest.$ac_ext"\"") >&5
7774   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
7775   ac_status=$?
7776   $EGREP -v '^ *\+' conftest.er1 >conftest.err
7777   rm -f conftest.er1
7778   cat conftest.err >&5
7779   echo "$as_me:7779: \$? = $ac_status" >&5
7780   (exit "$ac_status"); } >/dev/null; then
7781   if test -s conftest.err; then
7782     ac_cpp_err=$ac_c_preproc_warn_flag
7783   else
7784     ac_cpp_err=
7785   fi
7786 else
7787   ac_cpp_err=yes
7788 fi
7789 if test -z "$ac_cpp_err"; then
7790   eval "$as_ac_Header=yes"
7791 else
7792   echo "$as_me: failed program was:" >&5
7793   cat "conftest.$ac_ext" >&5
7794   eval "$as_ac_Header=no"
7795 fi
7796 rm -f conftest.err "conftest.$ac_ext"
7797 fi
7798 echo "$as_me:7798: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
7799 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
7800 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
7801   cat >>confdefs.h <<EOF
7802 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7803 EOF
7804
7805 fi
7806 done
7807
7808 cat >>confdefs.h <<\EOF
7809 #define NCURSES 1
7810 EOF
7811
7812 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7813
7814                 cat >>confdefs.h <<EOF
7815 #define $cf_nculib_ROOT 1
7816 EOF
7817
7818                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
7819
7820         else
7821
7822 cf_ncuhdr_root=ncursesw
7823
7824 test -n "$cf_cv_curses_dir" && \
7825 test "$cf_cv_curses_dir" != "no" && { \
7826
7827 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7828   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7829   do
7830         while test "$cf_add_incdir" != /usr/include
7831         do
7832           if test -d "$cf_add_incdir"
7833           then
7834                 cf_have_incdir=no
7835                 if test -n "$CFLAGS$CPPFLAGS" ; then
7836                   # a loop is needed to ensure we can add subdirs of existing dirs
7837                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7838                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7839                           cf_have_incdir=yes; break
7840                         fi
7841                   done
7842                 fi
7843
7844                 if test "$cf_have_incdir" = no ; then
7845                   if test "$cf_add_incdir" = /usr/local/include ; then
7846                         if test "$GCC" = yes
7847                         then
7848                           cf_save_CPPFLAGS=$CPPFLAGS
7849
7850         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7851         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7852
7853                           cat >"conftest.$ac_ext" <<_ACEOF
7854 #line 7854 "configure"
7855 #include "confdefs.h"
7856 #include <stdio.h>
7857 int
7858 main (void)
7859 {
7860 printf("Hello")
7861   ;
7862   return 0;
7863 }
7864 _ACEOF
7865 rm -f "conftest.$ac_objext"
7866 if { (eval echo "$as_me:7866: \"$ac_compile\"") >&5
7867   (eval $ac_compile) 2>&5
7868   ac_status=$?
7869   echo "$as_me:7869: \$? = $ac_status" >&5
7870   (exit "$ac_status"); } &&
7871          { ac_try='test -s "conftest.$ac_objext"'
7872   { (eval echo "$as_me:7872: \"$ac_try\"") >&5
7873   (eval $ac_try) 2>&5
7874   ac_status=$?
7875   echo "$as_me:7875: \$? = $ac_status" >&5
7876   (exit "$ac_status"); }; }; then
7877   :
7878 else
7879   echo "$as_me: failed program was:" >&5
7880 cat "conftest.$ac_ext" >&5
7881 cf_have_incdir=yes
7882 fi
7883 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7884                           CPPFLAGS=$cf_save_CPPFLAGS
7885                         fi
7886                   fi
7887                 fi
7888
7889                 if test "$cf_have_incdir" = no ; then
7890                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7891
7892 echo "${as_me:-configure}:7892: testing adding $cf_add_incdir to include-path ..." 1>&5
7893
7894                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7895
7896                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
7897                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7898                   cf_add_incdir="$cf_top_incdir"
7899                 else
7900                   break
7901                 fi
7902           else
7903                 break
7904           fi
7905         done
7906   done
7907 fi
7908
7909 }
7910
7911 echo "$as_me:7911: checking for $cf_ncuhdr_root header in include-path" >&5
7912 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7913 if test "${cf_cv_ncurses_h+set}" = set; then
7914   echo $ECHO_N "(cached) $ECHO_C" >&6
7915 else
7916
7917         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7918         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
7919         for cf_header in $cf_header_list
7920         do
7921
7922         cat >"conftest.$ac_ext" <<_ACEOF
7923 #line 7923 "configure"
7924 #include "confdefs.h"
7925
7926 #define _XOPEN_SOURCE_EXTENDED
7927 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7928 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7929
7930 #include <$cf_header>
7931 int
7932 main (void)
7933 {
7934
7935 #ifdef NCURSES_VERSION
7936
7937 #ifndef WACS_BSSB
7938         make an error
7939 #endif
7940
7941 printf("%s\\n", NCURSES_VERSION);
7942 #else
7943 #ifdef __NCURSES_H
7944 printf("old\\n");
7945 #else
7946         make an error
7947 #endif
7948 #endif
7949
7950   ;
7951   return 0;
7952 }
7953 _ACEOF
7954 rm -f "conftest.$ac_objext"
7955 if { (eval echo "$as_me:7955: \"$ac_compile\"") >&5
7956   (eval $ac_compile) 2>&5
7957   ac_status=$?
7958   echo "$as_me:7958: \$? = $ac_status" >&5
7959   (exit "$ac_status"); } &&
7960          { ac_try='test -s "conftest.$ac_objext"'
7961   { (eval echo "$as_me:7961: \"$ac_try\"") >&5
7962   (eval $ac_try) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit "$ac_status"); }; }; then
7966   cf_cv_ncurses_h=$cf_header
7967
7968 else
7969   echo "$as_me: failed program was:" >&5
7970 cat "conftest.$ac_ext" >&5
7971 cf_cv_ncurses_h=no
7972 fi
7973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
7974
7975                 test "$cf_cv_ncurses_h" != no && break
7976         done
7977
7978 fi
7979 echo "$as_me:7979: result: $cf_cv_ncurses_h" >&5
7980 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7981
7982 if test "$cf_cv_ncurses_h" != no ; then
7983         cf_cv_ncurses_header=$cf_cv_ncurses_h
7984 else
7985
7986 echo "$as_me:7986: checking for $cf_ncuhdr_root include-path" >&5
7987 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7988 if test "${cf_cv_ncurses_h2+set}" = set; then
7989   echo $ECHO_N "(cached) $ECHO_C" >&6
7990 else
7991
7992         test -n "$verbose" && echo
7993
7994 cf_search=
7995
7996 # collect the current set of include-directories from compiler flags
7997 cf_header_path_list=""
7998 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7999         for cf_header_path in $CPPFLAGS $CFLAGS
8000         do
8001                 case "$cf_header_path" in
8002                 (-I*)
8003                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8004
8005 test "x$cf_header_path" != "xNONE" && \
8006 test -d "$cf_header_path" && \
8007  {
8008         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8009         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
8010         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8011         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8012         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8013         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"
8014 }
8015
8016                         cf_header_path_list="$cf_header_path_list $cf_search"
8017                         ;;
8018                 esac
8019         done
8020 fi
8021
8022 # add the variations for the package we are looking for
8023
8024 cf_search=
8025
8026 test "x$prefix" != "xNONE" && \
8027 test -d "$prefix" && \
8028  {
8029         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8030         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
8031         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8032         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8033         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8034         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8035 }
8036
8037 for cf_subdir_prefix in \
8038         /usr \
8039         /usr/local \
8040         /usr/pkg \
8041         /opt \
8042         /opt/local \
8043         $HOME
8044 do
8045
8046 test "x$cf_subdir_prefix" != "x$prefix" && \
8047 test -d "$cf_subdir_prefix" && \
8048 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8049         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8050         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
8051         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8052         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8053         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8054         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"
8055 }
8056
8057 done
8058
8059 test "$includedir" != NONE && \
8060 test "$includedir" != "/usr/include" && \
8061 test -d "$includedir" && {
8062         test -d "$includedir" &&    cf_search="$cf_search $includedir"
8063         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8064 }
8065
8066 test "$oldincludedir" != NONE && \
8067 test "$oldincludedir" != "/usr/include" && \
8068 test -d "$oldincludedir" && {
8069         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
8070         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8071 }
8072
8073 cf_search="$cf_search $cf_header_path_list"
8074
8075         test -n "$verbose" && echo "search path $cf_search"
8076         cf_save2_CPPFLAGS="$CPPFLAGS"
8077         for cf_incdir in $cf_search
8078         do
8079
8080 if test -n "$cf_incdir" ; then
8081   for cf_add_incdir in $cf_incdir
8082   do
8083         while test "$cf_add_incdir" != /usr/include
8084         do
8085           if test -d "$cf_add_incdir"
8086           then
8087                 cf_have_incdir=no
8088                 if test -n "$CFLAGS$CPPFLAGS" ; then
8089                   # a loop is needed to ensure we can add subdirs of existing dirs
8090                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8091                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8092                           cf_have_incdir=yes; break
8093                         fi
8094                   done
8095                 fi
8096
8097                 if test "$cf_have_incdir" = no ; then
8098                   if test "$cf_add_incdir" = /usr/local/include ; then
8099                         if test "$GCC" = yes
8100                         then
8101                           cf_save_CPPFLAGS=$CPPFLAGS
8102
8103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8104         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8105
8106                           cat >"conftest.$ac_ext" <<_ACEOF
8107 #line 8107 "configure"
8108 #include "confdefs.h"
8109 #include <stdio.h>
8110 int
8111 main (void)
8112 {
8113 printf("Hello")
8114   ;
8115   return 0;
8116 }
8117 _ACEOF
8118 rm -f "conftest.$ac_objext"
8119 if { (eval echo "$as_me:8119: \"$ac_compile\"") >&5
8120   (eval $ac_compile) 2>&5
8121   ac_status=$?
8122   echo "$as_me:8122: \$? = $ac_status" >&5
8123   (exit "$ac_status"); } &&
8124          { ac_try='test -s "conftest.$ac_objext"'
8125   { (eval echo "$as_me:8125: \"$ac_try\"") >&5
8126   (eval $ac_try) 2>&5
8127   ac_status=$?
8128   echo "$as_me:8128: \$? = $ac_status" >&5
8129   (exit "$ac_status"); }; }; then
8130   :
8131 else
8132   echo "$as_me: failed program was:" >&5
8133 cat "conftest.$ac_ext" >&5
8134 cf_have_incdir=yes
8135 fi
8136 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8137                           CPPFLAGS=$cf_save_CPPFLAGS
8138                         fi
8139                   fi
8140                 fi
8141
8142                 if test "$cf_have_incdir" = no ; then
8143                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8144
8145 echo "${as_me:-configure}:8145: testing adding $cf_add_incdir to include-path ..." 1>&5
8146
8147                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8148
8149                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8150                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8151                   cf_add_incdir="$cf_top_incdir"
8152                 else
8153                   break
8154                 fi
8155           else
8156                 break
8157           fi
8158         done
8159   done
8160 fi
8161
8162                 for cf_header in \
8163                         ncurses.h \
8164                         curses.h
8165                 do
8166
8167         cat >"conftest.$ac_ext" <<_ACEOF
8168 #line 8168 "configure"
8169 #include "confdefs.h"
8170
8171 #include <$cf_header>
8172 int
8173 main (void)
8174 {
8175
8176 #ifdef NCURSES_VERSION
8177
8178 printf("%s\\n", NCURSES_VERSION);
8179 #else
8180 #ifdef __NCURSES_H
8181 printf("old\\n");
8182 #else
8183         make an error
8184 #endif
8185 #endif
8186
8187   ;
8188   return 0;
8189 }
8190 _ACEOF
8191 rm -f "conftest.$ac_objext"
8192 if { (eval echo "$as_me:8192: \"$ac_compile\"") >&5
8193   (eval $ac_compile) 2>&5
8194   ac_status=$?
8195   echo "$as_me:8195: \$? = $ac_status" >&5
8196   (exit "$ac_status"); } &&
8197          { ac_try='test -s "conftest.$ac_objext"'
8198   { (eval echo "$as_me:8198: \"$ac_try\"") >&5
8199   (eval $ac_try) 2>&5
8200   ac_status=$?
8201   echo "$as_me:8201: \$? = $ac_status" >&5
8202   (exit "$ac_status"); }; }; then
8203   cf_cv_ncurses_h2=$cf_header
8204
8205 else
8206   echo "$as_me: failed program was:" >&5
8207 cat "conftest.$ac_ext" >&5
8208 cf_cv_ncurses_h2=no
8209 fi
8210 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8211
8212                         if test "$cf_cv_ncurses_h2" != no ; then
8213                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8214                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
8215                                 break
8216                         fi
8217                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8218                 done
8219                 CPPFLAGS="$cf_save2_CPPFLAGS"
8220                 test "$cf_cv_ncurses_h2" != no && break
8221         done
8222         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8222: error: not found" >&5
8223 echo "$as_me: error: not found" >&2;}
8224    { (exit 1); exit 1; }; }
8225
8226 fi
8227 echo "$as_me:8227: result: $cf_cv_ncurses_h2" >&5
8228 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8229
8230         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
8231         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
8232         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
8233                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
8234         fi
8235
8236 if test -n "$cf_1st_incdir" ; then
8237   for cf_add_incdir in $cf_1st_incdir
8238   do
8239         while test "$cf_add_incdir" != /usr/include
8240         do
8241           if test -d "$cf_add_incdir"
8242           then
8243                 cf_have_incdir=no
8244                 if test -n "$CFLAGS$CPPFLAGS" ; then
8245                   # a loop is needed to ensure we can add subdirs of existing dirs
8246                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8247                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8248                           cf_have_incdir=yes; break
8249                         fi
8250                   done
8251                 fi
8252
8253                 if test "$cf_have_incdir" = no ; then
8254                   if test "$cf_add_incdir" = /usr/local/include ; then
8255                         if test "$GCC" = yes
8256                         then
8257                           cf_save_CPPFLAGS=$CPPFLAGS
8258
8259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8260         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8261
8262                           cat >"conftest.$ac_ext" <<_ACEOF
8263 #line 8263 "configure"
8264 #include "confdefs.h"
8265 #include <stdio.h>
8266 int
8267 main (void)
8268 {
8269 printf("Hello")
8270   ;
8271   return 0;
8272 }
8273 _ACEOF
8274 rm -f "conftest.$ac_objext"
8275 if { (eval echo "$as_me:8275: \"$ac_compile\"") >&5
8276   (eval $ac_compile) 2>&5
8277   ac_status=$?
8278   echo "$as_me:8278: \$? = $ac_status" >&5
8279   (exit "$ac_status"); } &&
8280          { ac_try='test -s "conftest.$ac_objext"'
8281   { (eval echo "$as_me:8281: \"$ac_try\"") >&5
8282   (eval $ac_try) 2>&5
8283   ac_status=$?
8284   echo "$as_me:8284: \$? = $ac_status" >&5
8285   (exit "$ac_status"); }; }; then
8286   :
8287 else
8288   echo "$as_me: failed program was:" >&5
8289 cat "conftest.$ac_ext" >&5
8290 cf_have_incdir=yes
8291 fi
8292 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8293                           CPPFLAGS=$cf_save_CPPFLAGS
8294                         fi
8295                   fi
8296                 fi
8297
8298                 if test "$cf_have_incdir" = no ; then
8299                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8300
8301 echo "${as_me:-configure}:8301: testing adding $cf_add_incdir to include-path ..." 1>&5
8302
8303                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8304
8305                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
8306                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8307                   cf_add_incdir="$cf_top_incdir"
8308                 else
8309                   break
8310                 fi
8311           else
8312                 break
8313           fi
8314         done
8315   done
8316 fi
8317
8318 fi
8319
8320 # Set definitions to allow ifdef'ing for ncurses.h
8321
8322 case "$cf_cv_ncurses_header" in
8323 (*ncurses.h)
8324
8325 cat >>confdefs.h <<\EOF
8326 #define HAVE_NCURSES_H 1
8327 EOF
8328
8329         ;;
8330 esac
8331
8332 case "$cf_cv_ncurses_header" in
8333 (ncurses/curses.h|ncurses/ncurses.h)
8334
8335 cat >>confdefs.h <<\EOF
8336 #define HAVE_NCURSES_NCURSES_H 1
8337 EOF
8338
8339         ;;
8340 (ncursesw/curses.h|ncursesw/ncurses.h)
8341
8342 cat >>confdefs.h <<\EOF
8343 #define HAVE_NCURSESW_NCURSES_H 1
8344 EOF
8345
8346         ;;
8347 esac
8348
8349 echo "$as_me:8349: checking for terminfo header" >&5
8350 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8351 if test "${cf_cv_term_header+set}" = set; then
8352   echo $ECHO_N "(cached) $ECHO_C" >&6
8353 else
8354
8355 case "${cf_cv_ncurses_header}" in
8356 (*/ncurses.h|*/ncursesw.h)
8357         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8358         ;;
8359 (*)
8360         cf_term_header=term.h
8361         ;;
8362 esac
8363
8364 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8365 do
8366 cat >"conftest.$ac_ext" <<_ACEOF
8367 #line 8367 "configure"
8368 #include "confdefs.h"
8369 #include <stdio.h>
8370 #include <${cf_cv_ncurses_header:-curses.h}>
8371 #include <$cf_test>
8372
8373 int
8374 main (void)
8375 {
8376 int x = auto_left_margin; (void)x
8377   ;
8378   return 0;
8379 }
8380 _ACEOF
8381 rm -f "conftest.$ac_objext"
8382 if { (eval echo "$as_me:8382: \"$ac_compile\"") >&5
8383   (eval $ac_compile) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit "$ac_status"); } &&
8387          { ac_try='test -s "conftest.$ac_objext"'
8388   { (eval echo "$as_me:8388: \"$ac_try\"") >&5
8389   (eval $ac_try) 2>&5
8390   ac_status=$?
8391   echo "$as_me:8391: \$? = $ac_status" >&5
8392   (exit "$ac_status"); }; }; then
8393
8394         cf_cv_term_header="$cf_test"
8395 else
8396   echo "$as_me: failed program was:" >&5
8397 cat "conftest.$ac_ext" >&5
8398
8399         cf_cv_term_header=unknown
8400
8401 fi
8402 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
8403         test "$cf_cv_term_header" != unknown && break
8404 done
8405
8406 fi
8407 echo "$as_me:8407: result: $cf_cv_term_header" >&5
8408 echo "${ECHO_T}$cf_cv_term_header" >&6
8409
8410 # Set definitions to allow ifdef'ing to accommodate subdirectories
8411
8412 case "$cf_cv_term_header" in
8413 (*term.h)
8414
8415 cat >>confdefs.h <<\EOF
8416 #define HAVE_TERM_H 1
8417 EOF
8418
8419         ;;
8420 esac
8421
8422 case "$cf_cv_term_header" in
8423 (ncurses/term.h)
8424
8425 cat >>confdefs.h <<\EOF
8426 #define HAVE_NCURSES_TERM_H 1
8427 EOF
8428
8429         ;;
8430 (ncursesw/term.h)
8431
8432 cat >>confdefs.h <<\EOF
8433 #define HAVE_NCURSESW_TERM_H 1
8434 EOF
8435
8436         ;;
8437 esac
8438
8439 # some applications need this, but should check for NCURSES_VERSION
8440
8441 cat >>confdefs.h <<\EOF
8442 #define NCURSES 1
8443 EOF
8444
8445 echo "$as_me:8445: checking for ncurses version" >&5
8446 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8447 if test "${cf_cv_ncurses_version+set}" = set; then
8448   echo $ECHO_N "(cached) $ECHO_C" >&6
8449 else
8450
8451         cf_cv_ncurses_version=no
8452         cf_tempfile=out$$
8453         rm -f "$cf_tempfile"
8454         if test "$cross_compiling" = yes; then
8455
8456         # This will not work if the preprocessor splits the line after the
8457         # Autoconf token.  The 'unproto' program does that.
8458         cat > "conftest.$ac_ext" <<EOF
8459 #include <${cf_cv_ncurses_header:-curses.h}>
8460 #undef Autoconf
8461 #ifdef NCURSES_VERSION
8462 Autoconf NCURSES_VERSION
8463 #else
8464 #ifdef __NCURSES_H
8465 Autoconf "old"
8466 #endif
8467 ;
8468 #endif
8469 EOF
8470         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8471         { (eval echo "$as_me:8471: \"$cf_try\"") >&5
8472   (eval $cf_try) 2>&5
8473   ac_status=$?
8474   echo "$as_me:8474: \$? = $ac_status" >&5
8475   (exit "$ac_status"); }
8476         if test -f conftest.out ; then
8477                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
8478                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8479                 rm -f conftest.out
8480         fi
8481
8482 else
8483   cat >"conftest.$ac_ext" <<_ACEOF
8484 #line 8484 "configure"
8485 #include "confdefs.h"
8486
8487 #include <${cf_cv_ncurses_header:-curses.h}>
8488 #include <stdio.h>
8489 int main(void)
8490 {
8491         FILE *fp = fopen("$cf_tempfile", "w");
8492 #ifdef NCURSES_VERSION
8493 # ifdef NCURSES_VERSION_PATCH
8494         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8495 # else
8496         fprintf(fp, "%s\\n", NCURSES_VERSION);
8497 # endif
8498 #else
8499 # ifdef __NCURSES_H
8500         fprintf(fp, "old\\n");
8501 # else
8502         make an error
8503 # endif
8504 #endif
8505         ${cf_cv_main_return:-return}(0);
8506 }
8507 _ACEOF
8508 rm -f "conftest$ac_exeext"
8509 if { (eval echo "$as_me:8509: \"$ac_link\"") >&5
8510   (eval $ac_link) 2>&5
8511   ac_status=$?
8512   echo "$as_me:8512: \$? = $ac_status" >&5
8513   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
8514   { (eval echo "$as_me:8514: \"$ac_try\"") >&5
8515   (eval $ac_try) 2>&5
8516   ac_status=$?
8517   echo "$as_me:8517: \$? = $ac_status" >&5
8518   (exit "$ac_status"); }; }; then
8519
8520         cf_cv_ncurses_version=`cat $cf_tempfile`
8521 else
8522   echo "$as_me: program exited with status $ac_status" >&5
8523 echo "$as_me: failed program was:" >&5
8524 cat "conftest.$ac_ext" >&5
8525 fi
8526 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
8527 fi
8528         rm -f "$cf_tempfile"
8529
8530 fi
8531 echo "$as_me:8531: result: $cf_cv_ncurses_version" >&5
8532 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8533 test "$cf_cv_ncurses_version" = no ||
8534 cat >>confdefs.h <<\EOF
8535 #define NCURSES 1
8536 EOF
8537
8538 cf_nculib_root=ncursesw
8539         # This works, except for the special case where we find gpm, but
8540         # ncurses is in a nonstandard location via $LIBS, and we really want
8541         # to link gpm.
8542 cf_ncurses_LIBS=""
8543 cf_ncurses_SAVE="$LIBS"
8544 echo "$as_me:8544: checking for Gpm_Open in -lgpm" >&5
8545 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8546 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8547   echo $ECHO_N "(cached) $ECHO_C" >&6
8548 else
8549   ac_check_lib_save_LIBS=$LIBS
8550 LIBS="-lgpm  $LIBS"
8551 cat >"conftest.$ac_ext" <<_ACEOF
8552 #line 8552 "configure"
8553 #include "confdefs.h"
8554
8555 /* Override any gcc2 internal prototype to avoid an error.  */
8556 #ifdef __cplusplus
8557 extern "C"
8558 #endif
8559 /* We use char because int might match the return type of a gcc2
8560    builtin and then its argument prototype would still apply.  */
8561 char Gpm_Open ();
8562 int
8563 main (void)
8564 {
8565 Gpm_Open ();
8566   ;
8567   return 0;
8568 }
8569 _ACEOF
8570 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8571 if { (eval echo "$as_me:8571: \"$ac_link\"") >&5
8572   (eval $ac_link) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit "$ac_status"); } &&
8576          { ac_try='test -s "conftest$ac_exeext"'
8577   { (eval echo "$as_me:8577: \"$ac_try\"") >&5
8578   (eval $ac_try) 2>&5
8579   ac_status=$?
8580   echo "$as_me:8580: \$? = $ac_status" >&5
8581   (exit "$ac_status"); }; }; then
8582   ac_cv_lib_gpm_Gpm_Open=yes
8583 else
8584   echo "$as_me: failed program was:" >&5
8585 cat "conftest.$ac_ext" >&5
8586 ac_cv_lib_gpm_Gpm_Open=no
8587 fi
8588 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8589 LIBS=$ac_check_lib_save_LIBS
8590 fi
8591 echo "$as_me:8591: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8592 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8593 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
8594   echo "$as_me:8594: checking for initscr in -lgpm" >&5
8595 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8596 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8597   echo $ECHO_N "(cached) $ECHO_C" >&6
8598 else
8599   ac_check_lib_save_LIBS=$LIBS
8600 LIBS="-lgpm  $LIBS"
8601 cat >"conftest.$ac_ext" <<_ACEOF
8602 #line 8602 "configure"
8603 #include "confdefs.h"
8604
8605 /* Override any gcc2 internal prototype to avoid an error.  */
8606 #ifdef __cplusplus
8607 extern "C"
8608 #endif
8609 /* We use char because int might match the return type of a gcc2
8610    builtin and then its argument prototype would still apply.  */
8611 char initscr ();
8612 int
8613 main (void)
8614 {
8615 initscr ();
8616   ;
8617   return 0;
8618 }
8619 _ACEOF
8620 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8621 if { (eval echo "$as_me:8621: \"$ac_link\"") >&5
8622   (eval $ac_link) 2>&5
8623   ac_status=$?
8624   echo "$as_me:8624: \$? = $ac_status" >&5
8625   (exit "$ac_status"); } &&
8626          { ac_try='test -s "conftest$ac_exeext"'
8627   { (eval echo "$as_me:8627: \"$ac_try\"") >&5
8628   (eval $ac_try) 2>&5
8629   ac_status=$?
8630   echo "$as_me:8630: \$? = $ac_status" >&5
8631   (exit "$ac_status"); }; }; then
8632   ac_cv_lib_gpm_initscr=yes
8633 else
8634   echo "$as_me: failed program was:" >&5
8635 cat "conftest.$ac_ext" >&5
8636 ac_cv_lib_gpm_initscr=no
8637 fi
8638 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8639 LIBS=$ac_check_lib_save_LIBS
8640 fi
8641 echo "$as_me:8641: result: $ac_cv_lib_gpm_initscr" >&5
8642 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8643 if test "$ac_cv_lib_gpm_initscr" = yes; then
8644   LIBS="$cf_ncurses_SAVE"
8645 else
8646   cf_ncurses_LIBS="-lgpm"
8647 fi
8648
8649 fi
8650
8651 case "$host_os" in
8652 (freebsd*)
8653         # This is only necessary if you are linking against an obsolete
8654         # version of ncurses (but it should do no harm, since it's static).
8655         if test "$cf_nculib_root" = ncurses ; then
8656                 echo "$as_me:8656: checking for tgoto in -lmytinfo" >&5
8657 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8658 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8659   echo $ECHO_N "(cached) $ECHO_C" >&6
8660 else
8661   ac_check_lib_save_LIBS=$LIBS
8662 LIBS="-lmytinfo  $LIBS"
8663 cat >"conftest.$ac_ext" <<_ACEOF
8664 #line 8664 "configure"
8665 #include "confdefs.h"
8666
8667 /* Override any gcc2 internal prototype to avoid an error.  */
8668 #ifdef __cplusplus
8669 extern "C"
8670 #endif
8671 /* We use char because int might match the return type of a gcc2
8672    builtin and then its argument prototype would still apply.  */
8673 char tgoto ();
8674 int
8675 main (void)
8676 {
8677 tgoto ();
8678   ;
8679   return 0;
8680 }
8681 _ACEOF
8682 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8683 if { (eval echo "$as_me:8683: \"$ac_link\"") >&5
8684   (eval $ac_link) 2>&5
8685   ac_status=$?
8686   echo "$as_me:8686: \$? = $ac_status" >&5
8687   (exit "$ac_status"); } &&
8688          { ac_try='test -s "conftest$ac_exeext"'
8689   { (eval echo "$as_me:8689: \"$ac_try\"") >&5
8690   (eval $ac_try) 2>&5
8691   ac_status=$?
8692   echo "$as_me:8692: \$? = $ac_status" >&5
8693   (exit "$ac_status"); }; }; then
8694   ac_cv_lib_mytinfo_tgoto=yes
8695 else
8696   echo "$as_me: failed program was:" >&5
8697 cat "conftest.$ac_ext" >&5
8698 ac_cv_lib_mytinfo_tgoto=no
8699 fi
8700 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8701 LIBS=$ac_check_lib_save_LIBS
8702 fi
8703 echo "$as_me:8703: result: $ac_cv_lib_mytinfo_tgoto" >&5
8704 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8705 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
8706   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8707 fi
8708
8709         fi
8710         ;;
8711 esac
8712
8713 cf_add_libs="$LIBS"
8714 # reverse order
8715 cf_add_0lib=
8716 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8717 # filter duplicates
8718 for cf_add_1lib in $cf_add_0lib; do
8719         for cf_add_2lib in $cf_add_libs; do
8720                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8721                         cf_add_1lib=
8722                         break
8723                 fi
8724         done
8725         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8726 done
8727 LIBS="$cf_add_libs"
8728
8729 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
8730 then
8731
8732 cf_add_libs="$LIBS"
8733 # reverse order
8734 cf_add_0lib=
8735 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8736 # filter duplicates
8737 for cf_add_1lib in $cf_add_0lib; do
8738         for cf_add_2lib in $cf_add_libs; do
8739                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8740                         cf_add_1lib=
8741                         break
8742                 fi
8743         done
8744         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8745 done
8746 LIBS="$cf_add_libs"
8747
8748 else
8749
8750         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
8751         cf_libdir=""
8752         echo "$as_me:8752: checking for initscr" >&5
8753 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8754 if test "${ac_cv_func_initscr+set}" = set; then
8755   echo $ECHO_N "(cached) $ECHO_C" >&6
8756 else
8757   cat >"conftest.$ac_ext" <<_ACEOF
8758 #line 8758 "configure"
8759 #include "confdefs.h"
8760 #define initscr autoconf_temporary
8761 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
8762 #undef initscr
8763
8764 #ifdef __cplusplus
8765 extern "C"
8766 #endif
8767
8768 /* We use char because int might match the return type of a gcc2
8769    builtin and then its argument prototype would still apply.  */
8770 char initscr (void);
8771
8772 int
8773 main (void)
8774 {
8775
8776 /* The GNU C library defines stubs for functions which it implements
8777     to always fail with ENOSYS.  Some functions are actually named
8778     something starting with __ and the normal name is an alias.  */
8779 #if defined (__stub_initscr) || defined (__stub___initscr)
8780 #error found stub for initscr
8781 #endif
8782
8783         return initscr ();
8784   ;
8785   return 0;
8786 }
8787 _ACEOF
8788 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8789 if { (eval echo "$as_me:8789: \"$ac_link\"") >&5
8790   (eval $ac_link) 2>&5
8791   ac_status=$?
8792   echo "$as_me:8792: \$? = $ac_status" >&5
8793   (exit "$ac_status"); } &&
8794          { ac_try='test -s "conftest$ac_exeext"'
8795   { (eval echo "$as_me:8795: \"$ac_try\"") >&5
8796   (eval $ac_try) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit "$ac_status"); }; }; then
8800   ac_cv_func_initscr=yes
8801 else
8802   echo "$as_me: failed program was:" >&5
8803 cat "conftest.$ac_ext" >&5
8804 ac_cv_func_initscr=no
8805 fi
8806 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8807 fi
8808 echo "$as_me:8808: result: $ac_cv_func_initscr" >&5
8809 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8810 if test "$ac_cv_func_initscr" = yes; then
8811   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8812 else
8813
8814                 cf_save_LIBS="$LIBS"
8815                 echo "$as_me:8815: checking for initscr in -l$cf_nculib_root" >&5
8816 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8817                 LIBS="-l$cf_nculib_root $LIBS"
8818                 cat >"conftest.$ac_ext" <<_ACEOF
8819 #line 8819 "configure"
8820 #include "confdefs.h"
8821 #include <${cf_cv_ncurses_header:-curses.h}>
8822 int
8823 main (void)
8824 {
8825 initscr()
8826   ;
8827   return 0;
8828 }
8829 _ACEOF
8830 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8831 if { (eval echo "$as_me:8831: \"$ac_link\"") >&5
8832   (eval $ac_link) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit "$ac_status"); } &&
8836          { ac_try='test -s "conftest$ac_exeext"'
8837   { (eval echo "$as_me:8837: \"$ac_try\"") >&5
8838   (eval $ac_try) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit "$ac_status"); }; }; then
8842   echo "$as_me:8842: result: yes" >&5
8843 echo "${ECHO_T}yes" >&6
8844                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8845
8846 else
8847   echo "$as_me: failed program was:" >&5
8848 cat "conftest.$ac_ext" >&5
8849 echo "$as_me:8849: result: no" >&5
8850 echo "${ECHO_T}no" >&6
8851
8852 cf_search=
8853 cf_library_path_list=""
8854 if test -n "${LDFLAGS}${LIBS}" ; then
8855         for cf_library_path in $LDFLAGS $LIBS
8856         do
8857                 case "$cf_library_path" in
8858                 (-L*)
8859                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8860
8861 test "x$cf_library_path" != "xNONE" && \
8862 test -d "$cf_library_path" && \
8863  {
8864         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8865         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
8866         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8867         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8868         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8869         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"
8870 }
8871
8872                         cf_library_path_list="$cf_library_path_list $cf_search"
8873                         ;;
8874                 esac
8875         done
8876 fi
8877
8878 cf_search=
8879
8880 test "x$prefix" != "xNONE" && \
8881 test -d "$prefix" && \
8882  {
8883         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8884         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
8885         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8886         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8887         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8888         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8889 }
8890
8891 for cf_subdir_prefix in \
8892         /usr \
8893         /usr/local \
8894         /usr/pkg \
8895         /opt \
8896         /opt/local \
8897         $HOME
8898 do
8899
8900 test "x$cf_subdir_prefix" != "x$prefix" && \
8901 test -d "$cf_subdir_prefix" && \
8902 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
8903         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8904         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8905         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8906         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8907         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8908         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"
8909 }
8910
8911 done
8912
8913 cf_search="$cf_library_path_list $cf_search"
8914
8915                         for cf_libdir in $cf_search
8916                         do
8917                                 echo "$as_me:8917: checking for -l$cf_nculib_root in $cf_libdir" >&5
8918 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8919                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8920                                 cat >"conftest.$ac_ext" <<_ACEOF
8921 #line 8921 "configure"
8922 #include "confdefs.h"
8923 #include <${cf_cv_ncurses_header:-curses.h}>
8924 int
8925 main (void)
8926 {
8927 initscr()
8928   ;
8929   return 0;
8930 }
8931 _ACEOF
8932 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8933 if { (eval echo "$as_me:8933: \"$ac_link\"") >&5
8934   (eval $ac_link) 2>&5
8935   ac_status=$?
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit "$ac_status"); } &&
8938          { ac_try='test -s "conftest$ac_exeext"'
8939   { (eval echo "$as_me:8939: \"$ac_try\"") >&5
8940   (eval $ac_try) 2>&5
8941   ac_status=$?
8942   echo "$as_me:8942: \$? = $ac_status" >&5
8943   (exit "$ac_status"); }; }; then
8944   echo "$as_me:8944: result: yes" >&5
8945 echo "${ECHO_T}yes" >&6
8946                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
8947                                          break
8948 else
8949   echo "$as_me: failed program was:" >&5
8950 cat "conftest.$ac_ext" >&5
8951 echo "$as_me:8951: result: no" >&5
8952 echo "${ECHO_T}no" >&6
8953                                          LIBS="$cf_save_LIBS"
8954 fi
8955 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8956                         done
8957
8958 fi
8959 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
8960
8961 fi
8962
8963 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
8964
8965 if test "$cf_found_library" = no ; then
8966         { { echo "$as_me:8966: error: Cannot link $cf_nculib_root library" >&5
8967 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8968    { (exit 1); exit 1; }; }
8969 fi
8970
8971 fi
8972
8973 if test -n "$cf_ncurses_LIBS" ; then
8974         echo "$as_me:8974: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8975 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8976         cf_ncurses_SAVE="$LIBS"
8977         for p in $cf_ncurses_LIBS ; do
8978                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
8979                 if test "$q" != "$LIBS" ; then
8980                         LIBS="$q"
8981                 fi
8982         done
8983         cat >"conftest.$ac_ext" <<_ACEOF
8984 #line 8984 "configure"
8985 #include "confdefs.h"
8986 #include <${cf_cv_ncurses_header:-curses.h}>
8987 int
8988 main (void)
8989 {
8990 initscr(); mousemask(0,0); tigetstr((char *)0);
8991   ;
8992   return 0;
8993 }
8994 _ACEOF
8995 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
8996 if { (eval echo "$as_me:8996: \"$ac_link\"") >&5
8997   (eval $ac_link) 2>&5
8998   ac_status=$?
8999   echo "$as_me:8999: \$? = $ac_status" >&5
9000   (exit "$ac_status"); } &&
9001          { ac_try='test -s "conftest$ac_exeext"'
9002   { (eval echo "$as_me:9002: \"$ac_try\"") >&5
9003   (eval $ac_try) 2>&5
9004   ac_status=$?
9005   echo "$as_me:9005: \$? = $ac_status" >&5
9006   (exit "$ac_status"); }; }; then
9007   echo "$as_me:9007: result: yes" >&5
9008 echo "${ECHO_T}yes" >&6
9009 else
9010   echo "$as_me: failed program was:" >&5
9011 cat "conftest.$ac_ext" >&5
9012 echo "$as_me:9012: result: no" >&5
9013 echo "${ECHO_T}no" >&6
9014                  LIBS="$cf_ncurses_SAVE"
9015 fi
9016 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9017 fi
9018
9019 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9020
9021 cat >>confdefs.h <<EOF
9022 #define $cf_nculib_ROOT 1
9023 EOF
9024
9025         fi
9026 else
9027         NCURSES_CONFIG=none
9028 fi
9029
9030 else
9031
9032 cf_ncuconfig_root=ncurses
9033 cf_have_ncuconfig=no
9034
9035 if test "x${PKG_CONFIG:=none}" != xnone; then
9036         echo "$as_me:9036: checking pkg-config for $cf_ncuconfig_root" >&5
9037 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9038         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9039                 echo "$as_me:9039: result: yes" >&5
9040 echo "${ECHO_T}yes" >&6
9041
9042                 echo "$as_me:9042: checking if the $cf_ncuconfig_root package files work" >&5
9043 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9044                 cf_have_ncuconfig=unknown
9045
9046                 cf_save_CFLAGS="$CFLAGS"
9047                 cf_save_CPPFLAGS="$CPPFLAGS"
9048                 cf_save_LIBS="$LIBS"
9049
9050                 cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
9051                 cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9052
9053                 # while -W for passing linker flags is prevalent, it is not "standard".
9054                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9055                 # incompatible _and_ non-standard -W option which gives an error.  Work
9056                 # around that pitfall.
9057                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9058                 (x*c[89]9@@*-W*)
9059
9060 cf_fix_cppflags=no
9061 cf_new_cflags=
9062 cf_new_cppflags=
9063 cf_new_extra_cppflags=
9064
9065 for cf_add_cflags in $cf_pkg_cflags
9066 do
9067 case "$cf_fix_cppflags" in
9068 (no)
9069         case "$cf_add_cflags" in
9070         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9071                 case "$cf_add_cflags" in
9072                 (-D*)
9073                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9074
9075                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9076                                 && test -z "${cf_tst_cflags}" \
9077                                 && cf_fix_cppflags=yes
9078
9079                         if test "$cf_fix_cppflags" = yes ; then
9080
9081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9083
9084                                 continue
9085                         elif test "${cf_tst_cflags}" = "\"'" ; then
9086
9087         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9088         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9089
9090                                 continue
9091                         fi
9092                         ;;
9093                 esac
9094                 case "$CPPFLAGS" in
9095                 (*$cf_add_cflags)
9096                         ;;
9097                 (*)
9098                         case "$cf_add_cflags" in
9099                         (-D*)
9100                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9101
9102 CPPFLAGS=`echo "$CPPFLAGS" | \
9103         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9104                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9105
9106                                 ;;
9107                         esac
9108
9109         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9110         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9111
9112                         ;;
9113                 esac
9114                 ;;
9115         (*)
9116
9117         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9118         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9119
9120                 ;;
9121         esac
9122         ;;
9123 (yes)
9124
9125         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9126         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9127
9128         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9129
9130         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9131                 && test -z "${cf_tst_cflags}" \
9132                 && cf_fix_cppflags=no
9133         ;;
9134 esac
9135 done
9136
9137 if test -n "$cf_new_cflags" ; then
9138
9139         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9140         CFLAGS="${CFLAGS}$cf_new_cflags"
9141
9142 fi
9143
9144 if test -n "$cf_new_cppflags" ; then
9145
9146         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9147         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9148
9149 fi
9150
9151 if test -n "$cf_new_extra_cppflags" ; then
9152
9153         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9154         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9155
9156 fi
9157
9158 cf_add_libs="$LIBS"
9159 # reverse order
9160 cf_add_0lib=
9161 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9162 # filter duplicates
9163 for cf_add_1lib in $cf_add_0lib; do
9164         for cf_add_2lib in $cf_add_libs; do
9165                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9166                         cf_add_1lib=
9167                         break
9168                 fi
9169         done
9170         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9171 done
9172 LIBS="$cf_add_libs"
9173
9174                         cat >"conftest.$ac_ext" <<_ACEOF
9175 #line 9175 "configure"
9176 #include "confdefs.h"
9177 #include <${cf_cv_ncurses_header:-curses.h}>
9178 int
9179 main (void)
9180 {
9181 initscr(); mousemask(0,0); tigetstr((char *)0);
9182   ;
9183   return 0;
9184 }
9185 _ACEOF
9186 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9187 if { (eval echo "$as_me:9187: \"$ac_link\"") >&5
9188   (eval $ac_link) 2>&5
9189   ac_status=$?
9190   echo "$as_me:9190: \$? = $ac_status" >&5
9191   (exit "$ac_status"); } &&
9192          { ac_try='test -s "conftest$ac_exeext"'
9193   { (eval echo "$as_me:9193: \"$ac_try\"") >&5
9194   (eval $ac_try) 2>&5
9195   ac_status=$?
9196   echo "$as_me:9196: \$? = $ac_status" >&5
9197   (exit "$ac_status"); }; }; then
9198   if test "$cross_compiling" = yes; then
9199   cf_test_ncuconfig=maybe
9200 else
9201   cat >"conftest.$ac_ext" <<_ACEOF
9202 #line 9202 "configure"
9203 #include "confdefs.h"
9204 #include <${cf_cv_ncurses_header:-curses.h}>
9205                                         int main(void)
9206                                         { char *xx = curses_version(); return (xx == 0); }
9207 _ACEOF
9208 rm -f "conftest$ac_exeext"
9209 if { (eval echo "$as_me:9209: \"$ac_link\"") >&5
9210   (eval $ac_link) 2>&5
9211   ac_status=$?
9212   echo "$as_me:9212: \$? = $ac_status" >&5
9213   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9214   { (eval echo "$as_me:9214: \"$ac_try\"") >&5
9215   (eval $ac_try) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit "$ac_status"); }; }; then
9219   cf_test_ncuconfig=yes
9220 else
9221   echo "$as_me: program exited with status $ac_status" >&5
9222 echo "$as_me: failed program was:" >&5
9223 cat "conftest.$ac_ext" >&5
9224 cf_test_ncuconfig=no
9225 fi
9226 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9227 fi
9228 else
9229   echo "$as_me: failed program was:" >&5
9230 cat "conftest.$ac_ext" >&5
9231 cf_test_ncuconfig=no
9232 fi
9233 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9234
9235                         CFLAGS="$cf_save_CFLAGS"
9236                         CPPFLAGS="$cf_save_CPPFLAGS"
9237                         LIBS="$cf_save_LIBS"
9238
9239                         if test "x$cf_test_ncuconfig" != xyes; then
9240                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9241                                 cf_pkg_cflags="$cf_temp"
9242                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9243                                 cf_pkg_libs="$cf_temp"
9244                         fi
9245                         ;;
9246                 esac
9247
9248 cf_fix_cppflags=no
9249 cf_new_cflags=
9250 cf_new_cppflags=
9251 cf_new_extra_cppflags=
9252
9253 for cf_add_cflags in $cf_pkg_cflags
9254 do
9255 case "$cf_fix_cppflags" in
9256 (no)
9257         case "$cf_add_cflags" in
9258         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9259                 case "$cf_add_cflags" in
9260                 (-D*)
9261                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9262
9263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9264                                 && test -z "${cf_tst_cflags}" \
9265                                 && cf_fix_cppflags=yes
9266
9267                         if test "$cf_fix_cppflags" = yes ; then
9268
9269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9271
9272                                 continue
9273                         elif test "${cf_tst_cflags}" = "\"'" ; then
9274
9275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9277
9278                                 continue
9279                         fi
9280                         ;;
9281                 esac
9282                 case "$CPPFLAGS" in
9283                 (*$cf_add_cflags)
9284                         ;;
9285                 (*)
9286                         case "$cf_add_cflags" in
9287                         (-D*)
9288                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9289
9290 CPPFLAGS=`echo "$CPPFLAGS" | \
9291         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9292                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9293
9294                                 ;;
9295                         esac
9296
9297         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9298         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9299
9300                         ;;
9301                 esac
9302                 ;;
9303         (*)
9304
9305         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9306         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9307
9308                 ;;
9309         esac
9310         ;;
9311 (yes)
9312
9313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9315
9316         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9317
9318         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9319                 && test -z "${cf_tst_cflags}" \
9320                 && cf_fix_cppflags=no
9321         ;;
9322 esac
9323 done
9324
9325 if test -n "$cf_new_cflags" ; then
9326
9327         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9328         CFLAGS="${CFLAGS}$cf_new_cflags"
9329
9330 fi
9331
9332 if test -n "$cf_new_cppflags" ; then
9333
9334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9335         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9336
9337 fi
9338
9339 if test -n "$cf_new_extra_cppflags" ; then
9340
9341         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9342         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9343
9344 fi
9345
9346 cf_add_libs="$LIBS"
9347 # reverse order
9348 cf_add_0lib=
9349 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9350 # filter duplicates
9351 for cf_add_1lib in $cf_add_0lib; do
9352         for cf_add_2lib in $cf_add_libs; do
9353                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9354                         cf_add_1lib=
9355                         break
9356                 fi
9357         done
9358         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9359 done
9360 LIBS="$cf_add_libs"
9361
9362                 cat >"conftest.$ac_ext" <<_ACEOF
9363 #line 9363 "configure"
9364 #include "confdefs.h"
9365 #include <${cf_cv_ncurses_header:-curses.h}>
9366 int
9367 main (void)
9368 {
9369 initscr(); mousemask(0,0); tigetstr((char *)0);
9370   ;
9371   return 0;
9372 }
9373 _ACEOF
9374 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
9375 if { (eval echo "$as_me:9375: \"$ac_link\"") >&5
9376   (eval $ac_link) 2>&5
9377   ac_status=$?
9378   echo "$as_me:9378: \$? = $ac_status" >&5
9379   (exit "$ac_status"); } &&
9380          { ac_try='test -s "conftest$ac_exeext"'
9381   { (eval echo "$as_me:9381: \"$ac_try\"") >&5
9382   (eval $ac_try) 2>&5
9383   ac_status=$?
9384   echo "$as_me:9384: \$? = $ac_status" >&5
9385   (exit "$ac_status"); }; }; then
9386   if test "$cross_compiling" = yes; then
9387   cf_have_ncuconfig=maybe
9388 else
9389   cat >"conftest.$ac_ext" <<_ACEOF
9390 #line 9390 "configure"
9391 #include "confdefs.h"
9392 #include <${cf_cv_ncurses_header:-curses.h}>
9393                                 int main(void)
9394                                 { char *xx = curses_version(); return (xx == 0); }
9395 _ACEOF
9396 rm -f "conftest$ac_exeext"
9397 if { (eval echo "$as_me:9397: \"$ac_link\"") >&5
9398   (eval $ac_link) 2>&5
9399   ac_status=$?
9400   echo "$as_me:9400: \$? = $ac_status" >&5
9401   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
9402   { (eval echo "$as_me:9402: \"$ac_try\"") >&5
9403   (eval $ac_try) 2>&5
9404   ac_status=$?
9405   echo "$as_me:9405: \$? = $ac_status" >&5
9406   (exit "$ac_status"); }; }; then
9407   cf_have_ncuconfig=yes
9408 else
9409   echo "$as_me: program exited with status $ac_status" >&5
9410 echo "$as_me: failed program was:" >&5
9411 cat "conftest.$ac_ext" >&5
9412 cf_have_ncuconfig=no
9413 fi
9414 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
9415 fi
9416 else
9417   echo "$as_me: failed program was:" >&5
9418 cat "conftest.$ac_ext" >&5
9419 cf_have_ncuconfig=no
9420 fi
9421 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
9422                 echo "$as_me:9422: result: $cf_have_ncuconfig" >&5
9423 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9424                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9425                 if test "$cf_have_ncuconfig" != "yes"
9426                 then
9427                         CPPFLAGS="$cf_save_CPPFLAGS"
9428                         LIBS="$cf_save_LIBS"
9429                         NCURSES_CONFIG_PKG=none
9430                 else
9431
9432 cat >>confdefs.h <<\EOF
9433 #define NCURSES 1
9434 EOF
9435
9436                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9437
9438 echo "$as_me:9438: checking for terminfo header" >&5
9439 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9440 if test "${cf_cv_term_header+set}" = set; then
9441   echo $ECHO_N "(cached) $ECHO_C" >&6
9442 else
9443
9444 case "${cf_cv_ncurses_header}" in
9445 (*/ncurses.h|*/ncursesw.h)
9446         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9447         ;;
9448 (*)
9449         cf_term_header=term.h
9450         ;;
9451 esac
9452
9453 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9454 do
9455 cat >"conftest.$ac_ext" <<_ACEOF
9456 #line 9456 "configure"
9457 #include "confdefs.h"
9458 #include <stdio.h>
9459 #include <${cf_cv_ncurses_header:-curses.h}>
9460 #include <$cf_test>
9461
9462 int
9463 main (void)
9464 {
9465 int x = auto_left_margin; (void)x
9466   ;
9467   return 0;
9468 }
9469 _ACEOF
9470 rm -f "conftest.$ac_objext"
9471 if { (eval echo "$as_me:9471: \"$ac_compile\"") >&5
9472   (eval $ac_compile) 2>&5
9473   ac_status=$?
9474   echo "$as_me:9474: \$? = $ac_status" >&5
9475   (exit "$ac_status"); } &&
9476          { ac_try='test -s "conftest.$ac_objext"'
9477   { (eval echo "$as_me:9477: \"$ac_try\"") >&5
9478   (eval $ac_try) 2>&5
9479   ac_status=$?
9480   echo "$as_me:9480: \$? = $ac_status" >&5
9481   (exit "$ac_status"); }; }; then
9482
9483         cf_cv_term_header="$cf_test"
9484 else
9485   echo "$as_me: failed program was:" >&5
9486 cat "conftest.$ac_ext" >&5
9487
9488         cf_cv_term_header=unknown
9489
9490 fi
9491 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9492         test "$cf_cv_term_header" != unknown && break
9493 done
9494
9495 fi
9496 echo "$as_me:9496: result: $cf_cv_term_header" >&5
9497 echo "${ECHO_T}$cf_cv_term_header" >&6
9498
9499 # Set definitions to allow ifdef'ing to accommodate subdirectories
9500
9501 case "$cf_cv_term_header" in
9502 (*term.h)
9503
9504 cat >>confdefs.h <<\EOF
9505 #define HAVE_TERM_H 1
9506 EOF
9507
9508         ;;
9509 esac
9510
9511 case "$cf_cv_term_header" in
9512 (ncurses/term.h)
9513
9514 cat >>confdefs.h <<\EOF
9515 #define HAVE_NCURSES_TERM_H 1
9516 EOF
9517
9518         ;;
9519 (ncursesw/term.h)
9520
9521 cat >>confdefs.h <<\EOF
9522 #define HAVE_NCURSESW_TERM_H 1
9523 EOF
9524
9525         ;;
9526 esac
9527
9528                 fi
9529
9530         else
9531                 echo "$as_me:9531: result: no" >&5
9532 echo "${ECHO_T}no" >&6
9533                 NCURSES_CONFIG_PKG=none
9534         fi
9535 else
9536         NCURSES_CONFIG_PKG=none
9537 fi
9538
9539 if test "x$cf_have_ncuconfig" = "xno"; then
9540         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9541
9542 if test -n "$ac_tool_prefix"; then
9543   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9544   do
9545     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9546 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9547 echo "$as_me:9547: checking for $ac_word" >&5
9548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9549 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9550   echo $ECHO_N "(cached) $ECHO_C" >&6
9551 else
9552   if test -n "$NCURSES_CONFIG"; then
9553   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9554 else
9555   ac_save_IFS=$IFS; IFS=$ac_path_separator
9556 ac_dummy="$PATH"
9557 for ac_dir in $ac_dummy; do
9558   IFS=$ac_save_IFS
9559   test -z "$ac_dir" && ac_dir=.
9560   $as_executable_p "$ac_dir/$ac_word" || continue
9561 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9562 echo "$as_me:9562: found $ac_dir/$ac_word" >&5
9563 break
9564 done
9565
9566 fi
9567 fi
9568 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9569 if test -n "$NCURSES_CONFIG"; then
9570   echo "$as_me:9570: result: $NCURSES_CONFIG" >&5
9571 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9572 else
9573   echo "$as_me:9573: result: no" >&5
9574 echo "${ECHO_T}no" >&6
9575 fi
9576
9577     test -n "$NCURSES_CONFIG" && break
9578   done
9579 fi
9580 if test -z "$NCURSES_CONFIG"; then
9581   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9582   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9583 do
9584   # Extract the first word of "$ac_prog", so it can be a program name with args.
9585 set dummy $ac_prog; ac_word=$2
9586 echo "$as_me:9586: checking for $ac_word" >&5
9587 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9588 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9589   echo $ECHO_N "(cached) $ECHO_C" >&6
9590 else
9591   if test -n "$ac_ct_NCURSES_CONFIG"; then
9592   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9593 else
9594   ac_save_IFS=$IFS; IFS=$ac_path_separator
9595 ac_dummy="$PATH"
9596 for ac_dir in $ac_dummy; do
9597   IFS=$ac_save_IFS
9598   test -z "$ac_dir" && ac_dir=.
9599   $as_executable_p "$ac_dir/$ac_word" || continue
9600 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9601 echo "$as_me:9601: found $ac_dir/$ac_word" >&5
9602 break
9603 done
9604
9605 fi
9606 fi
9607 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9608 if test -n "$ac_ct_NCURSES_CONFIG"; then
9609   echo "$as_me:9609: result: $ac_ct_NCURSES_CONFIG" >&5
9610 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9611 else
9612   echo "$as_me:9612: result: no" >&5
9613 echo "${ECHO_T}no" >&6
9614 fi
9615
9616   test -n "$ac_ct_NCURSES_CONFIG" && break
9617 done
9618 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9619
9620   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9621 fi
9622
9623         if test "$NCURSES_CONFIG" != none ; then
9624
9625 cf_fix_cppflags=no
9626 cf_new_cflags=
9627 cf_new_cppflags=
9628 cf_new_extra_cppflags=
9629
9630 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9631 do
9632 case "$cf_fix_cppflags" in
9633 (no)
9634         case "$cf_add_cflags" in
9635         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9636                 case "$cf_add_cflags" in
9637                 (-D*)
9638                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9639
9640                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9641                                 && test -z "${cf_tst_cflags}" \
9642                                 && cf_fix_cppflags=yes
9643
9644                         if test "$cf_fix_cppflags" = yes ; then
9645
9646         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9647         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9648
9649                                 continue
9650                         elif test "${cf_tst_cflags}" = "\"'" ; then
9651
9652         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9653         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9654
9655                                 continue
9656                         fi
9657                         ;;
9658                 esac
9659                 case "$CPPFLAGS" in
9660                 (*$cf_add_cflags)
9661                         ;;
9662                 (*)
9663                         case "$cf_add_cflags" in
9664                         (-D*)
9665                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9666
9667 CPPFLAGS=`echo "$CPPFLAGS" | \
9668         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9669                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9670
9671                                 ;;
9672                         esac
9673
9674         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9675         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9676
9677                         ;;
9678                 esac
9679                 ;;
9680         (*)
9681
9682         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9683         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9684
9685                 ;;
9686         esac
9687         ;;
9688 (yes)
9689
9690         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9691         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9692
9693         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
9694
9695         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9696                 && test -z "${cf_tst_cflags}" \
9697                 && cf_fix_cppflags=no
9698         ;;
9699 esac
9700 done
9701
9702 if test -n "$cf_new_cflags" ; then
9703
9704         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9705         CFLAGS="${CFLAGS}$cf_new_cflags"
9706
9707 fi
9708
9709 if test -n "$cf_new_cppflags" ; then
9710
9711         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9712         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9713
9714 fi
9715
9716 if test -n "$cf_new_extra_cppflags" ; then
9717
9718         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9719         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9720
9721 fi
9722
9723 cf_add_libs="$LIBS"
9724 # reverse order
9725 cf_add_0lib=
9726 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9727 # filter duplicates
9728 for cf_add_1lib in $cf_add_0lib; do
9729         for cf_add_2lib in $cf_add_libs; do
9730                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9731                         cf_add_1lib=
9732                         break
9733                 fi
9734         done
9735         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9736 done
9737 LIBS="$cf_add_libs"
9738
9739                 # even with config script, some packages use no-override for curses.h
9740
9741 echo "$as_me:9741: checking if we have identified curses headers" >&5
9742 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9743 if test "${cf_cv_ncurses_header+set}" = set; then
9744   echo $ECHO_N "(cached) $ECHO_C" >&6
9745 else
9746
9747 cf_cv_ncurses_header=none
9748 for cf_header in \
9749         ncurses.h ncurses/ncurses.h \
9750         curses.h ncurses/curses.h
9751 do
9752 cat >"conftest.$ac_ext" <<_ACEOF
9753 #line 9753 "configure"
9754 #include "confdefs.h"
9755 #include <${cf_header}>
9756 int
9757 main (void)
9758 {
9759 initscr(); tgoto("?", 0,0)
9760   ;
9761   return 0;
9762 }
9763 _ACEOF
9764 rm -f "conftest.$ac_objext"
9765 if { (eval echo "$as_me:9765: \"$ac_compile\"") >&5
9766   (eval $ac_compile) 2>&5
9767   ac_status=$?
9768   echo "$as_me:9768: \$? = $ac_status" >&5
9769   (exit "$ac_status"); } &&
9770          { ac_try='test -s "conftest.$ac_objext"'
9771   { (eval echo "$as_me:9771: \"$ac_try\"") >&5
9772   (eval $ac_try) 2>&5
9773   ac_status=$?
9774   echo "$as_me:9774: \$? = $ac_status" >&5
9775   (exit "$ac_status"); }; }; then
9776   cf_cv_ncurses_header=$cf_header; break
9777 else
9778   echo "$as_me: failed program was:" >&5
9779 cat "conftest.$ac_ext" >&5
9780 fi
9781 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9782 done
9783
9784 fi
9785 echo "$as_me:9785: result: $cf_cv_ncurses_header" >&5
9786 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9787
9788 if test "$cf_cv_ncurses_header" = none ; then
9789         { { echo "$as_me:9789: error: No curses header-files found" >&5
9790 echo "$as_me: error: No curses header-files found" >&2;}
9791    { (exit 1); exit 1; }; }
9792 fi
9793
9794 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9795
9796 for ac_header in $cf_cv_ncurses_header
9797 do
9798 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9799 echo "$as_me:9799: checking for $ac_header" >&5
9800 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9801 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9802   echo $ECHO_N "(cached) $ECHO_C" >&6
9803 else
9804   cat >"conftest.$ac_ext" <<_ACEOF
9805 #line 9805 "configure"
9806 #include "confdefs.h"
9807 #include <$ac_header>
9808 _ACEOF
9809 if { (eval echo "$as_me:9809: \"$ac_cpp "conftest.$ac_ext"\"") >&5
9810   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
9811   ac_status=$?
9812   $EGREP -v '^ *\+' conftest.er1 >conftest.err
9813   rm -f conftest.er1
9814   cat conftest.err >&5
9815   echo "$as_me:9815: \$? = $ac_status" >&5
9816   (exit "$ac_status"); } >/dev/null; then
9817   if test -s conftest.err; then
9818     ac_cpp_err=$ac_c_preproc_warn_flag
9819   else
9820     ac_cpp_err=
9821   fi
9822 else
9823   ac_cpp_err=yes
9824 fi
9825 if test -z "$ac_cpp_err"; then
9826   eval "$as_ac_Header=yes"
9827 else
9828   echo "$as_me: failed program was:" >&5
9829   cat "conftest.$ac_ext" >&5
9830   eval "$as_ac_Header=no"
9831 fi
9832 rm -f conftest.err "conftest.$ac_ext"
9833 fi
9834 echo "$as_me:9834: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
9835 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
9836 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
9837   cat >>confdefs.h <<EOF
9838 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9839 EOF
9840
9841 fi
9842 done
9843
9844 cat >>confdefs.h <<\EOF
9845 #define NCURSES 1
9846 EOF
9847
9848 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9849
9850                 cat >>confdefs.h <<EOF
9851 #define $cf_nculib_ROOT 1
9852 EOF
9853
9854                                 cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
9855
9856         else
9857
9858 cf_ncuhdr_root=ncurses
9859
9860 test -n "$cf_cv_curses_dir" && \
9861 test "$cf_cv_curses_dir" != "no" && { \
9862
9863 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9864   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9865   do
9866         while test "$cf_add_incdir" != /usr/include
9867         do
9868           if test -d "$cf_add_incdir"
9869           then
9870                 cf_have_incdir=no
9871                 if test -n "$CFLAGS$CPPFLAGS" ; then
9872                   # a loop is needed to ensure we can add subdirs of existing dirs
9873                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9874                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9875                           cf_have_incdir=yes; break
9876                         fi
9877                   done
9878                 fi
9879
9880                 if test "$cf_have_incdir" = no ; then
9881                   if test "$cf_add_incdir" = /usr/local/include ; then
9882                         if test "$GCC" = yes
9883                         then
9884                           cf_save_CPPFLAGS=$CPPFLAGS
9885
9886         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9887         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9888
9889                           cat >"conftest.$ac_ext" <<_ACEOF
9890 #line 9890 "configure"
9891 #include "confdefs.h"
9892 #include <stdio.h>
9893 int
9894 main (void)
9895 {
9896 printf("Hello")
9897   ;
9898   return 0;
9899 }
9900 _ACEOF
9901 rm -f "conftest.$ac_objext"
9902 if { (eval echo "$as_me:9902: \"$ac_compile\"") >&5
9903   (eval $ac_compile) 2>&5
9904   ac_status=$?
9905   echo "$as_me:9905: \$? = $ac_status" >&5
9906   (exit "$ac_status"); } &&
9907          { ac_try='test -s "conftest.$ac_objext"'
9908   { (eval echo "$as_me:9908: \"$ac_try\"") >&5
9909   (eval $ac_try) 2>&5
9910   ac_status=$?
9911   echo "$as_me:9911: \$? = $ac_status" >&5
9912   (exit "$ac_status"); }; }; then
9913   :
9914 else
9915   echo "$as_me: failed program was:" >&5
9916 cat "conftest.$ac_ext" >&5
9917 cf_have_incdir=yes
9918 fi
9919 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
9920                           CPPFLAGS=$cf_save_CPPFLAGS
9921                         fi
9922                   fi
9923                 fi
9924
9925                 if test "$cf_have_incdir" = no ; then
9926                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9927
9928 echo "${as_me:-configure}:9928: testing adding $cf_add_incdir to include-path ..." 1>&5
9929
9930                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9931
9932                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
9933                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9934                   cf_add_incdir="$cf_top_incdir"
9935                 else
9936                   break
9937                 fi
9938           else
9939                 break
9940           fi
9941         done
9942   done
9943 fi
9944
9945 }
9946
9947 echo "$as_me:9947: checking for $cf_ncuhdr_root header in include-path" >&5
9948 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9949 if test "${cf_cv_ncurses_h+set}" = set; then
9950   echo $ECHO_N "(cached) $ECHO_C" >&6
9951 else
9952
9953         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9954         { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
9955         for cf_header in $cf_header_list
9956         do
9957
9958         cat >"conftest.$ac_ext" <<_ACEOF
9959 #line 9959 "configure"
9960 #include "confdefs.h"
9961
9962 #include <$cf_header>
9963 int
9964 main (void)
9965 {
9966
9967 #ifdef NCURSES_VERSION
9968
9969 printf("%s\\n", NCURSES_VERSION);
9970 #else
9971 #ifdef __NCURSES_H
9972 printf("old\\n");
9973 #else
9974         make an error
9975 #endif
9976 #endif
9977
9978   ;
9979   return 0;
9980 }
9981 _ACEOF
9982 rm -f "conftest.$ac_objext"
9983 if { (eval echo "$as_me:9983: \"$ac_compile\"") >&5
9984   (eval $ac_compile) 2>&5
9985   ac_status=$?
9986   echo "$as_me:9986: \$? = $ac_status" >&5
9987   (exit "$ac_status"); } &&
9988          { ac_try='test -s "conftest.$ac_objext"'
9989   { (eval echo "$as_me:9989: \"$ac_try\"") >&5
9990   (eval $ac_try) 2>&5
9991   ac_status=$?
9992   echo "$as_me:9992: \$? = $ac_status" >&5
9993   (exit "$ac_status"); }; }; then
9994   cf_cv_ncurses_h=$cf_header
9995
9996 else
9997   echo "$as_me: failed program was:" >&5
9998 cat "conftest.$ac_ext" >&5
9999 cf_cv_ncurses_h=no
10000 fi
10001 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10002
10003                 test "$cf_cv_ncurses_h" != no && break
10004         done
10005
10006 fi
10007 echo "$as_me:10007: result: $cf_cv_ncurses_h" >&5
10008 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10009
10010 if test "$cf_cv_ncurses_h" != no ; then
10011         cf_cv_ncurses_header=$cf_cv_ncurses_h
10012 else
10013
10014 echo "$as_me:10014: checking for $cf_ncuhdr_root include-path" >&5
10015 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10016 if test "${cf_cv_ncurses_h2+set}" = set; then
10017   echo $ECHO_N "(cached) $ECHO_C" >&6
10018 else
10019
10020         test -n "$verbose" && echo
10021
10022 cf_search=
10023
10024 # collect the current set of include-directories from compiler flags
10025 cf_header_path_list=""
10026 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10027         for cf_header_path in $CPPFLAGS $CFLAGS
10028         do
10029                 case "$cf_header_path" in
10030                 (-I*)
10031                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10032
10033 test "x$cf_header_path" != "xNONE" && \
10034 test -d "$cf_header_path" && \
10035  {
10036         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10037         test -d "$cf_header_path/include" &&          cf_search="$cf_search $cf_header_path/include"
10038         test -d "$cf_header_path/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10039         test -d "$cf_header_path/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10040         test -d "$cf_header_path/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10041         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"
10042 }
10043
10044                         cf_header_path_list="$cf_header_path_list $cf_search"
10045                         ;;
10046                 esac
10047         done
10048 fi
10049
10050 # add the variations for the package we are looking for
10051
10052 cf_search=
10053
10054 test "x$prefix" != "xNONE" && \
10055 test -d "$prefix" && \
10056  {
10057         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10058         test -d "$prefix/include" &&          cf_search="$cf_search $prefix/include"
10059         test -d "$prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10060         test -d "$prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10061         test -d "$prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10062         test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10063 }
10064
10065 for cf_subdir_prefix in \
10066         /usr \
10067         /usr/local \
10068         /usr/pkg \
10069         /opt \
10070         /opt/local \
10071         $HOME
10072 do
10073
10074 test "x$cf_subdir_prefix" != "x$prefix" && \
10075 test -d "$cf_subdir_prefix" && \
10076 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10077         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10078         test -d "$cf_subdir_prefix/include" &&          cf_search="$cf_search $cf_subdir_prefix/include"
10079         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root" &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10080         test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10081         test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10082         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"
10083 }
10084
10085 done
10086
10087 test "$includedir" != NONE && \
10088 test "$includedir" != "/usr/include" && \
10089 test -d "$includedir" && {
10090         test -d "$includedir" &&    cf_search="$cf_search $includedir"
10091         test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10092 }
10093
10094 test "$oldincludedir" != NONE && \
10095 test "$oldincludedir" != "/usr/include" && \
10096 test -d "$oldincludedir" && {
10097         test -d "$oldincludedir"    && cf_search="$cf_search $oldincludedir"
10098         test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10099 }
10100
10101 cf_search="$cf_search $cf_header_path_list"
10102
10103         test -n "$verbose" && echo "search path $cf_search"
10104         cf_save2_CPPFLAGS="$CPPFLAGS"
10105         for cf_incdir in $cf_search
10106         do
10107
10108 if test -n "$cf_incdir" ; then
10109   for cf_add_incdir in $cf_incdir
10110   do
10111         while test "$cf_add_incdir" != /usr/include
10112         do
10113           if test -d "$cf_add_incdir"
10114           then
10115                 cf_have_incdir=no
10116                 if test -n "$CFLAGS$CPPFLAGS" ; then
10117                   # a loop is needed to ensure we can add subdirs of existing dirs
10118                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10119                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10120                           cf_have_incdir=yes; break
10121                         fi
10122                   done
10123                 fi
10124
10125                 if test "$cf_have_incdir" = no ; then
10126                   if test "$cf_add_incdir" = /usr/local/include ; then
10127                         if test "$GCC" = yes
10128                         then
10129                           cf_save_CPPFLAGS=$CPPFLAGS
10130
10131         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10132         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10133
10134                           cat >"conftest.$ac_ext" <<_ACEOF
10135 #line 10135 "configure"
10136 #include "confdefs.h"
10137 #include <stdio.h>
10138 int
10139 main (void)
10140 {
10141 printf("Hello")
10142   ;
10143   return 0;
10144 }
10145 _ACEOF
10146 rm -f "conftest.$ac_objext"
10147 if { (eval echo "$as_me:10147: \"$ac_compile\"") >&5
10148   (eval $ac_compile) 2>&5
10149   ac_status=$?
10150   echo "$as_me:10150: \$? = $ac_status" >&5
10151   (exit "$ac_status"); } &&
10152          { ac_try='test -s "conftest.$ac_objext"'
10153   { (eval echo "$as_me:10153: \"$ac_try\"") >&5
10154   (eval $ac_try) 2>&5
10155   ac_status=$?
10156   echo "$as_me:10156: \$? = $ac_status" >&5
10157   (exit "$ac_status"); }; }; then
10158   :
10159 else
10160   echo "$as_me: failed program was:" >&5
10161 cat "conftest.$ac_ext" >&5
10162 cf_have_incdir=yes
10163 fi
10164 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10165                           CPPFLAGS=$cf_save_CPPFLAGS
10166                         fi
10167                   fi
10168                 fi
10169
10170                 if test "$cf_have_incdir" = no ; then
10171                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10172
10173 echo "${as_me:-configure}:10173: testing adding $cf_add_incdir to include-path ..." 1>&5
10174
10175                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10176
10177                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10178                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10179                   cf_add_incdir="$cf_top_incdir"
10180                 else
10181                   break
10182                 fi
10183           else
10184                 break
10185           fi
10186         done
10187   done
10188 fi
10189
10190                 for cf_header in \
10191                         ncurses.h \
10192                         curses.h
10193                 do
10194
10195         cat >"conftest.$ac_ext" <<_ACEOF
10196 #line 10196 "configure"
10197 #include "confdefs.h"
10198
10199 #include <$cf_header>
10200 int
10201 main (void)
10202 {
10203
10204 #ifdef NCURSES_VERSION
10205
10206 printf("%s\\n", NCURSES_VERSION);
10207 #else
10208 #ifdef __NCURSES_H
10209 printf("old\\n");
10210 #else
10211         make an error
10212 #endif
10213 #endif
10214
10215   ;
10216   return 0;
10217 }
10218 _ACEOF
10219 rm -f "conftest.$ac_objext"
10220 if { (eval echo "$as_me:10220: \"$ac_compile\"") >&5
10221   (eval $ac_compile) 2>&5
10222   ac_status=$?
10223   echo "$as_me:10223: \$? = $ac_status" >&5
10224   (exit "$ac_status"); } &&
10225          { ac_try='test -s "conftest.$ac_objext"'
10226   { (eval echo "$as_me:10226: \"$ac_try\"") >&5
10227   (eval $ac_try) 2>&5
10228   ac_status=$?
10229   echo "$as_me:10229: \$? = $ac_status" >&5
10230   (exit "$ac_status"); }; }; then
10231   cf_cv_ncurses_h2=$cf_header
10232
10233 else
10234   echo "$as_me: failed program was:" >&5
10235 cat "conftest.$ac_ext" >&5
10236 cf_cv_ncurses_h2=no
10237 fi
10238 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10239
10240                         if test "$cf_cv_ncurses_h2" != no ; then
10241                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10242                                 test -n "$verbose" && echo $ECHO_N "    ... found $ECHO_C" 1>&6
10243                                 break
10244                         fi
10245                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10246                 done
10247                 CPPFLAGS="$cf_save2_CPPFLAGS"
10248                 test "$cf_cv_ncurses_h2" != no && break
10249         done
10250         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10250: error: not found" >&5
10251 echo "$as_me: error: not found" >&2;}
10252    { (exit 1); exit 1; }; }
10253
10254 fi
10255 echo "$as_me:10255: result: $cf_cv_ncurses_h2" >&5
10256 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10257
10258         cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'`
10259         cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
10260         if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
10261                 cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
10262         fi
10263
10264 if test -n "$cf_1st_incdir" ; then
10265   for cf_add_incdir in $cf_1st_incdir
10266   do
10267         while test "$cf_add_incdir" != /usr/include
10268         do
10269           if test -d "$cf_add_incdir"
10270           then
10271                 cf_have_incdir=no
10272                 if test -n "$CFLAGS$CPPFLAGS" ; then
10273                   # a loop is needed to ensure we can add subdirs of existing dirs
10274                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10275                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10276                           cf_have_incdir=yes; break
10277                         fi
10278                   done
10279                 fi
10280
10281                 if test "$cf_have_incdir" = no ; then
10282                   if test "$cf_add_incdir" = /usr/local/include ; then
10283                         if test "$GCC" = yes
10284                         then
10285                           cf_save_CPPFLAGS=$CPPFLAGS
10286
10287         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10288         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10289
10290                           cat >"conftest.$ac_ext" <<_ACEOF
10291 #line 10291 "configure"
10292 #include "confdefs.h"
10293 #include <stdio.h>
10294 int
10295 main (void)
10296 {
10297 printf("Hello")
10298   ;
10299   return 0;
10300 }
10301 _ACEOF
10302 rm -f "conftest.$ac_objext"
10303 if { (eval echo "$as_me:10303: \"$ac_compile\"") >&5
10304   (eval $ac_compile) 2>&5
10305   ac_status=$?
10306   echo "$as_me:10306: \$? = $ac_status" >&5
10307   (exit "$ac_status"); } &&
10308          { ac_try='test -s "conftest.$ac_objext"'
10309   { (eval echo "$as_me:10309: \"$ac_try\"") >&5
10310   (eval $ac_try) 2>&5
10311   ac_status=$?
10312   echo "$as_me:10312: \$? = $ac_status" >&5
10313   (exit "$ac_status"); }; }; then
10314   :
10315 else
10316   echo "$as_me: failed program was:" >&5
10317 cat "conftest.$ac_ext" >&5
10318 cf_have_incdir=yes
10319 fi
10320 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10321                           CPPFLAGS=$cf_save_CPPFLAGS
10322                         fi
10323                   fi
10324                 fi
10325
10326                 if test "$cf_have_incdir" = no ; then
10327                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10328
10329 echo "${as_me:-configure}:10329: testing adding $cf_add_incdir to include-path ..." 1>&5
10330
10331                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10332
10333                   cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
10334                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10335                   cf_add_incdir="$cf_top_incdir"
10336                 else
10337                   break
10338                 fi
10339           else
10340                 break
10341           fi
10342         done
10343   done
10344 fi
10345
10346 fi
10347
10348 # Set definitions to allow ifdef'ing for ncurses.h
10349
10350 case "$cf_cv_ncurses_header" in
10351 (*ncurses.h)
10352
10353 cat >>confdefs.h <<\EOF
10354 #define HAVE_NCURSES_H 1
10355 EOF
10356
10357         ;;
10358 esac
10359
10360 case "$cf_cv_ncurses_header" in
10361 (ncurses/curses.h|ncurses/ncurses.h)
10362
10363 cat >>confdefs.h <<\EOF
10364 #define HAVE_NCURSES_NCURSES_H 1
10365 EOF
10366
10367         ;;
10368 (ncursesw/curses.h|ncursesw/ncurses.h)
10369
10370 cat >>confdefs.h <<\EOF
10371 #define HAVE_NCURSESW_NCURSES_H 1
10372 EOF
10373
10374         ;;
10375 esac
10376
10377 echo "$as_me:10377: checking for terminfo header" >&5
10378 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10379 if test "${cf_cv_term_header+set}" = set; then
10380   echo $ECHO_N "(cached) $ECHO_C" >&6
10381 else
10382
10383 case "${cf_cv_ncurses_header}" in
10384 (*/ncurses.h|*/ncursesw.h)
10385         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10386         ;;
10387 (*)
10388         cf_term_header=term.h
10389         ;;
10390 esac
10391
10392 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10393 do
10394 cat >"conftest.$ac_ext" <<_ACEOF
10395 #line 10395 "configure"
10396 #include "confdefs.h"
10397 #include <stdio.h>
10398 #include <${cf_cv_ncurses_header:-curses.h}>
10399 #include <$cf_test>
10400
10401 int
10402 main (void)
10403 {
10404 int x = auto_left_margin; (void)x
10405   ;
10406   return 0;
10407 }
10408 _ACEOF
10409 rm -f "conftest.$ac_objext"
10410 if { (eval echo "$as_me:10410: \"$ac_compile\"") >&5
10411   (eval $ac_compile) 2>&5
10412   ac_status=$?
10413   echo "$as_me:10413: \$? = $ac_status" >&5
10414   (exit "$ac_status"); } &&
10415          { ac_try='test -s "conftest.$ac_objext"'
10416   { (eval echo "$as_me:10416: \"$ac_try\"") >&5
10417   (eval $ac_try) 2>&5
10418   ac_status=$?
10419   echo "$as_me:10419: \$? = $ac_status" >&5
10420   (exit "$ac_status"); }; }; then
10421
10422         cf_cv_term_header="$cf_test"
10423 else
10424   echo "$as_me: failed program was:" >&5
10425 cat "conftest.$ac_ext" >&5
10426
10427         cf_cv_term_header=unknown
10428
10429 fi
10430 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
10431         test "$cf_cv_term_header" != unknown && break
10432 done
10433
10434 fi
10435 echo "$as_me:10435: result: $cf_cv_term_header" >&5
10436 echo "${ECHO_T}$cf_cv_term_header" >&6
10437
10438 # Set definitions to allow ifdef'ing to accommodate subdirectories
10439
10440 case "$cf_cv_term_header" in
10441 (*term.h)
10442
10443 cat >>confdefs.h <<\EOF
10444 #define HAVE_TERM_H 1
10445 EOF
10446
10447         ;;
10448 esac
10449
10450 case "$cf_cv_term_header" in
10451 (ncurses/term.h)
10452
10453 cat >>confdefs.h <<\EOF
10454 #define HAVE_NCURSES_TERM_H 1
10455 EOF
10456
10457         ;;
10458 (ncursesw/term.h)
10459
10460 cat >>confdefs.h <<\EOF
10461 #define HAVE_NCURSESW_TERM_H 1
10462 EOF
10463
10464         ;;
10465 esac
10466
10467 # some applications need this, but should check for NCURSES_VERSION
10468
10469 cat >>confdefs.h <<\EOF
10470 #define NCURSES 1
10471 EOF
10472
10473 echo "$as_me:10473: checking for ncurses version" >&5
10474 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10475 if test "${cf_cv_ncurses_version+set}" = set; then
10476   echo $ECHO_N "(cached) $ECHO_C" >&6
10477 else
10478
10479         cf_cv_ncurses_version=no
10480         cf_tempfile=out$$
10481         rm -f "$cf_tempfile"
10482         if test "$cross_compiling" = yes; then
10483
10484         # This will not work if the preprocessor splits the line after the
10485         # Autoconf token.  The 'unproto' program does that.
10486         cat > "conftest.$ac_ext" <<EOF
10487 #include <${cf_cv_ncurses_header:-curses.h}>
10488 #undef Autoconf
10489 #ifdef NCURSES_VERSION
10490 Autoconf NCURSES_VERSION
10491 #else
10492 #ifdef __NCURSES_H
10493 Autoconf "old"
10494 #endif
10495 ;
10496 #endif
10497 EOF
10498         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10499         { (eval echo "$as_me:10499: \"$cf_try\"") >&5
10500   (eval $cf_try) 2>&5
10501   ac_status=$?
10502   echo "$as_me:10502: \$? = $ac_status" >&5
10503   (exit "$ac_status"); }
10504         if test -f conftest.out ; then
10505                 cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out`
10506                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10507                 rm -f conftest.out
10508         fi
10509
10510 else
10511   cat >"conftest.$ac_ext" <<_ACEOF
10512 #line 10512 "configure"
10513 #include "confdefs.h"
10514
10515 #include <${cf_cv_ncurses_header:-curses.h}>
10516 #include <stdio.h>
10517 int main(void)
10518 {
10519         FILE *fp = fopen("$cf_tempfile", "w");
10520 #ifdef NCURSES_VERSION
10521 # ifdef NCURSES_VERSION_PATCH
10522         fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10523 # else
10524         fprintf(fp, "%s\\n", NCURSES_VERSION);
10525 # endif
10526 #else
10527 # ifdef __NCURSES_H
10528         fprintf(fp, "old\\n");
10529 # else
10530         make an error
10531 # endif
10532 #endif
10533         ${cf_cv_main_return:-return}(0);
10534 }
10535 _ACEOF
10536 rm -f "conftest$ac_exeext"
10537 if { (eval echo "$as_me:10537: \"$ac_link\"") >&5
10538   (eval $ac_link) 2>&5
10539   ac_status=$?
10540   echo "$as_me:10540: \$? = $ac_status" >&5
10541   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
10542   { (eval echo "$as_me:10542: \"$ac_try\"") >&5
10543   (eval $ac_try) 2>&5
10544   ac_status=$?
10545   echo "$as_me:10545: \$? = $ac_status" >&5
10546   (exit "$ac_status"); }; }; then
10547
10548         cf_cv_ncurses_version=`cat $cf_tempfile`
10549 else
10550   echo "$as_me: program exited with status $ac_status" >&5
10551 echo "$as_me: failed program was:" >&5
10552 cat "conftest.$ac_ext" >&5
10553 fi
10554 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
10555 fi
10556         rm -f "$cf_tempfile"
10557
10558 fi
10559 echo "$as_me:10559: result: $cf_cv_ncurses_version" >&5
10560 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10561 test "$cf_cv_ncurses_version" = no ||
10562 cat >>confdefs.h <<\EOF
10563 #define NCURSES 1
10564 EOF
10565
10566 cf_nculib_root=ncurses
10567         # This works, except for the special case where we find gpm, but
10568         # ncurses is in a nonstandard location via $LIBS, and we really want
10569         # to link gpm.
10570 cf_ncurses_LIBS=""
10571 cf_ncurses_SAVE="$LIBS"
10572 echo "$as_me:10572: checking for Gpm_Open in -lgpm" >&5
10573 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10574 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10575   echo $ECHO_N "(cached) $ECHO_C" >&6
10576 else
10577   ac_check_lib_save_LIBS=$LIBS
10578 LIBS="-lgpm  $LIBS"
10579 cat >"conftest.$ac_ext" <<_ACEOF
10580 #line 10580 "configure"
10581 #include "confdefs.h"
10582
10583 /* Override any gcc2 internal prototype to avoid an error.  */
10584 #ifdef __cplusplus
10585 extern "C"
10586 #endif
10587 /* We use char because int might match the return type of a gcc2
10588    builtin and then its argument prototype would still apply.  */
10589 char Gpm_Open ();
10590 int
10591 main (void)
10592 {
10593 Gpm_Open ();
10594   ;
10595   return 0;
10596 }
10597 _ACEOF
10598 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10599 if { (eval echo "$as_me:10599: \"$ac_link\"") >&5
10600   (eval $ac_link) 2>&5
10601   ac_status=$?
10602   echo "$as_me:10602: \$? = $ac_status" >&5
10603   (exit "$ac_status"); } &&
10604          { ac_try='test -s "conftest$ac_exeext"'
10605   { (eval echo "$as_me:10605: \"$ac_try\"") >&5
10606   (eval $ac_try) 2>&5
10607   ac_status=$?
10608   echo "$as_me:10608: \$? = $ac_status" >&5
10609   (exit "$ac_status"); }; }; then
10610   ac_cv_lib_gpm_Gpm_Open=yes
10611 else
10612   echo "$as_me: failed program was:" >&5
10613 cat "conftest.$ac_ext" >&5
10614 ac_cv_lib_gpm_Gpm_Open=no
10615 fi
10616 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10617 LIBS=$ac_check_lib_save_LIBS
10618 fi
10619 echo "$as_me:10619: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10620 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10621 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then
10622   echo "$as_me:10622: checking for initscr in -lgpm" >&5
10623 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10624 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10625   echo $ECHO_N "(cached) $ECHO_C" >&6
10626 else
10627   ac_check_lib_save_LIBS=$LIBS
10628 LIBS="-lgpm  $LIBS"
10629 cat >"conftest.$ac_ext" <<_ACEOF
10630 #line 10630 "configure"
10631 #include "confdefs.h"
10632
10633 /* Override any gcc2 internal prototype to avoid an error.  */
10634 #ifdef __cplusplus
10635 extern "C"
10636 #endif
10637 /* We use char because int might match the return type of a gcc2
10638    builtin and then its argument prototype would still apply.  */
10639 char initscr ();
10640 int
10641 main (void)
10642 {
10643 initscr ();
10644   ;
10645   return 0;
10646 }
10647 _ACEOF
10648 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10649 if { (eval echo "$as_me:10649: \"$ac_link\"") >&5
10650   (eval $ac_link) 2>&5
10651   ac_status=$?
10652   echo "$as_me:10652: \$? = $ac_status" >&5
10653   (exit "$ac_status"); } &&
10654          { ac_try='test -s "conftest$ac_exeext"'
10655   { (eval echo "$as_me:10655: \"$ac_try\"") >&5
10656   (eval $ac_try) 2>&5
10657   ac_status=$?
10658   echo "$as_me:10658: \$? = $ac_status" >&5
10659   (exit "$ac_status"); }; }; then
10660   ac_cv_lib_gpm_initscr=yes
10661 else
10662   echo "$as_me: failed program was:" >&5
10663 cat "conftest.$ac_ext" >&5
10664 ac_cv_lib_gpm_initscr=no
10665 fi
10666 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10667 LIBS=$ac_check_lib_save_LIBS
10668 fi
10669 echo "$as_me:10669: result: $ac_cv_lib_gpm_initscr" >&5
10670 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10671 if test "$ac_cv_lib_gpm_initscr" = yes; then
10672   LIBS="$cf_ncurses_SAVE"
10673 else
10674   cf_ncurses_LIBS="-lgpm"
10675 fi
10676
10677 fi
10678
10679 case "$host_os" in
10680 (freebsd*)
10681         # This is only necessary if you are linking against an obsolete
10682         # version of ncurses (but it should do no harm, since it's static).
10683         if test "$cf_nculib_root" = ncurses ; then
10684                 echo "$as_me:10684: checking for tgoto in -lmytinfo" >&5
10685 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10686 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10687   echo $ECHO_N "(cached) $ECHO_C" >&6
10688 else
10689   ac_check_lib_save_LIBS=$LIBS
10690 LIBS="-lmytinfo  $LIBS"
10691 cat >"conftest.$ac_ext" <<_ACEOF
10692 #line 10692 "configure"
10693 #include "confdefs.h"
10694
10695 /* Override any gcc2 internal prototype to avoid an error.  */
10696 #ifdef __cplusplus
10697 extern "C"
10698 #endif
10699 /* We use char because int might match the return type of a gcc2
10700    builtin and then its argument prototype would still apply.  */
10701 char tgoto ();
10702 int
10703 main (void)
10704 {
10705 tgoto ();
10706   ;
10707   return 0;
10708 }
10709 _ACEOF
10710 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10711 if { (eval echo "$as_me:10711: \"$ac_link\"") >&5
10712   (eval $ac_link) 2>&5
10713   ac_status=$?
10714   echo "$as_me:10714: \$? = $ac_status" >&5
10715   (exit "$ac_status"); } &&
10716          { ac_try='test -s "conftest$ac_exeext"'
10717   { (eval echo "$as_me:10717: \"$ac_try\"") >&5
10718   (eval $ac_try) 2>&5
10719   ac_status=$?
10720   echo "$as_me:10720: \$? = $ac_status" >&5
10721   (exit "$ac_status"); }; }; then
10722   ac_cv_lib_mytinfo_tgoto=yes
10723 else
10724   echo "$as_me: failed program was:" >&5
10725 cat "conftest.$ac_ext" >&5
10726 ac_cv_lib_mytinfo_tgoto=no
10727 fi
10728 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10729 LIBS=$ac_check_lib_save_LIBS
10730 fi
10731 echo "$as_me:10731: result: $ac_cv_lib_mytinfo_tgoto" >&5
10732 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10733 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then
10734   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10735 fi
10736
10737         fi
10738         ;;
10739 esac
10740
10741 cf_add_libs="$LIBS"
10742 # reverse order
10743 cf_add_0lib=
10744 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10745 # filter duplicates
10746 for cf_add_1lib in $cf_add_0lib; do
10747         for cf_add_2lib in $cf_add_libs; do
10748                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10749                         cf_add_1lib=
10750                         break
10751                 fi
10752         done
10753         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10754 done
10755 LIBS="$cf_add_libs"
10756
10757 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
10758 then
10759
10760 cf_add_libs="$LIBS"
10761 # reverse order
10762 cf_add_0lib=
10763 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10764 # filter duplicates
10765 for cf_add_1lib in $cf_add_0lib; do
10766         for cf_add_2lib in $cf_add_libs; do
10767                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10768                         cf_add_1lib=
10769                         break
10770                 fi
10771         done
10772         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10773 done
10774 LIBS="$cf_add_libs"
10775
10776 else
10777
10778         eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no'
10779         cf_libdir=""
10780         echo "$as_me:10780: checking for initscr" >&5
10781 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10782 if test "${ac_cv_func_initscr+set}" = set; then
10783   echo $ECHO_N "(cached) $ECHO_C" >&6
10784 else
10785   cat >"conftest.$ac_ext" <<_ACEOF
10786 #line 10786 "configure"
10787 #include "confdefs.h"
10788 #define initscr autoconf_temporary
10789 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
10790 #undef initscr
10791
10792 #ifdef __cplusplus
10793 extern "C"
10794 #endif
10795
10796 /* We use char because int might match the return type of a gcc2
10797    builtin and then its argument prototype would still apply.  */
10798 char initscr (void);
10799
10800 int
10801 main (void)
10802 {
10803
10804 /* The GNU C library defines stubs for functions which it implements
10805     to always fail with ENOSYS.  Some functions are actually named
10806     something starting with __ and the normal name is an alias.  */
10807 #if defined (__stub_initscr) || defined (__stub___initscr)
10808 #error found stub for initscr
10809 #endif
10810
10811         return initscr ();
10812   ;
10813   return 0;
10814 }
10815 _ACEOF
10816 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10817 if { (eval echo "$as_me:10817: \"$ac_link\"") >&5
10818   (eval $ac_link) 2>&5
10819   ac_status=$?
10820   echo "$as_me:10820: \$? = $ac_status" >&5
10821   (exit "$ac_status"); } &&
10822          { ac_try='test -s "conftest$ac_exeext"'
10823   { (eval echo "$as_me:10823: \"$ac_try\"") >&5
10824   (eval $ac_try) 2>&5
10825   ac_status=$?
10826   echo "$as_me:10826: \$? = $ac_status" >&5
10827   (exit "$ac_status"); }; }; then
10828   ac_cv_func_initscr=yes
10829 else
10830   echo "$as_me: failed program was:" >&5
10831 cat "conftest.$ac_ext" >&5
10832 ac_cv_func_initscr=no
10833 fi
10834 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10835 fi
10836 echo "$as_me:10836: result: $ac_cv_func_initscr" >&5
10837 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10838 if test "$ac_cv_func_initscr" = yes; then
10839   eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10840 else
10841
10842                 cf_save_LIBS="$LIBS"
10843                 echo "$as_me:10843: checking for initscr in -l$cf_nculib_root" >&5
10844 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10845                 LIBS="-l$cf_nculib_root $LIBS"
10846                 cat >"conftest.$ac_ext" <<_ACEOF
10847 #line 10847 "configure"
10848 #include "confdefs.h"
10849 #include <${cf_cv_ncurses_header:-curses.h}>
10850 int
10851 main (void)
10852 {
10853 initscr()
10854   ;
10855   return 0;
10856 }
10857 _ACEOF
10858 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10859 if { (eval echo "$as_me:10859: \"$ac_link\"") >&5
10860   (eval $ac_link) 2>&5
10861   ac_status=$?
10862   echo "$as_me:10862: \$? = $ac_status" >&5
10863   (exit "$ac_status"); } &&
10864          { ac_try='test -s "conftest$ac_exeext"'
10865   { (eval echo "$as_me:10865: \"$ac_try\"") >&5
10866   (eval $ac_try) 2>&5
10867   ac_status=$?
10868   echo "$as_me:10868: \$? = $ac_status" >&5
10869   (exit "$ac_status"); }; }; then
10870   echo "$as_me:10870: result: yes" >&5
10871 echo "${ECHO_T}yes" >&6
10872                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10873
10874 else
10875   echo "$as_me: failed program was:" >&5
10876 cat "conftest.$ac_ext" >&5
10877 echo "$as_me:10877: result: no" >&5
10878 echo "${ECHO_T}no" >&6
10879
10880 cf_search=
10881 cf_library_path_list=""
10882 if test -n "${LDFLAGS}${LIBS}" ; then
10883         for cf_library_path in $LDFLAGS $LIBS
10884         do
10885                 case "$cf_library_path" in
10886                 (-L*)
10887                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10888
10889 test "x$cf_library_path" != "xNONE" && \
10890 test -d "$cf_library_path" && \
10891  {
10892         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10893         test -d "$cf_library_path/lib" &&          cf_search="$cf_search $cf_library_path/lib"
10894         test -d "$cf_library_path/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10895         test -d "$cf_library_path/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10896         test -d "$cf_library_path/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10897         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"
10898 }
10899
10900                         cf_library_path_list="$cf_library_path_list $cf_search"
10901                         ;;
10902                 esac
10903         done
10904 fi
10905
10906 cf_search=
10907
10908 test "x$prefix" != "xNONE" && \
10909 test -d "$prefix" && \
10910  {
10911         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10912         test -d "$prefix/lib" &&          cf_search="$cf_search $prefix/lib"
10913         test -d "$prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10914         test -d "$prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10915         test -d "$prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10916         test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10917 }
10918
10919 for cf_subdir_prefix in \
10920         /usr \
10921         /usr/local \
10922         /usr/pkg \
10923         /opt \
10924         /opt/local \
10925         $HOME
10926 do
10927
10928 test "x$cf_subdir_prefix" != "x$prefix" && \
10929 test -d "$cf_subdir_prefix" && \
10930 { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && {
10931         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10932         test -d "$cf_subdir_prefix/lib" &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10933         test -d "$cf_subdir_prefix/lib/$cf_nculib_root" &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10934         test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10935         test -d "$cf_subdir_prefix/$cf_nculib_root/lib" &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10936         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"
10937 }
10938
10939 done
10940
10941 cf_search="$cf_library_path_list $cf_search"
10942
10943                         for cf_libdir in $cf_search
10944                         do
10945                                 echo "$as_me:10945: checking for -l$cf_nculib_root in $cf_libdir" >&5
10946 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10947                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10948                                 cat >"conftest.$ac_ext" <<_ACEOF
10949 #line 10949 "configure"
10950 #include "confdefs.h"
10951 #include <${cf_cv_ncurses_header:-curses.h}>
10952 int
10953 main (void)
10954 {
10955 initscr()
10956   ;
10957   return 0;
10958 }
10959 _ACEOF
10960 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
10961 if { (eval echo "$as_me:10961: \"$ac_link\"") >&5
10962   (eval $ac_link) 2>&5
10963   ac_status=$?
10964   echo "$as_me:10964: \$? = $ac_status" >&5
10965   (exit "$ac_status"); } &&
10966          { ac_try='test -s "conftest$ac_exeext"'
10967   { (eval echo "$as_me:10967: \"$ac_try\"") >&5
10968   (eval $ac_try) 2>&5
10969   ac_status=$?
10970   echo "$as_me:10970: \$? = $ac_status" >&5
10971   (exit "$ac_status"); }; }; then
10972   echo "$as_me:10972: result: yes" >&5
10973 echo "${ECHO_T}yes" >&6
10974                                          eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes'
10975                                          break
10976 else
10977   echo "$as_me: failed program was:" >&5
10978 cat "conftest.$ac_ext" >&5
10979 echo "$as_me:10979: result: no" >&5
10980 echo "${ECHO_T}no" >&6
10981                                          LIBS="$cf_save_LIBS"
10982 fi
10983 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10984                         done
10985
10986 fi
10987 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
10988
10989 fi
10990
10991 eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\"
10992
10993 if test "$cf_found_library" = no ; then
10994         { { echo "$as_me:10994: error: Cannot link $cf_nculib_root library" >&5
10995 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10996    { (exit 1); exit 1; }; }
10997 fi
10998
10999 fi
11000
11001 if test -n "$cf_ncurses_LIBS" ; then
11002         echo "$as_me:11002: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11003 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11004         cf_ncurses_SAVE="$LIBS"
11005         for p in $cf_ncurses_LIBS ; do
11006                 q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
11007                 if test "$q" != "$LIBS" ; then
11008                         LIBS="$q"
11009                 fi
11010         done
11011         cat >"conftest.$ac_ext" <<_ACEOF
11012 #line 11012 "configure"
11013 #include "confdefs.h"
11014 #include <${cf_cv_ncurses_header:-curses.h}>
11015 int
11016 main (void)
11017 {
11018 initscr(); mousemask(0,0); tigetstr((char *)0);
11019   ;
11020   return 0;
11021 }
11022 _ACEOF
11023 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11024 if { (eval echo "$as_me:11024: \"$ac_link\"") >&5
11025   (eval $ac_link) 2>&5
11026   ac_status=$?
11027   echo "$as_me:11027: \$? = $ac_status" >&5
11028   (exit "$ac_status"); } &&
11029          { ac_try='test -s "conftest$ac_exeext"'
11030   { (eval echo "$as_me:11030: \"$ac_try\"") >&5
11031   (eval $ac_try) 2>&5
11032   ac_status=$?
11033   echo "$as_me:11033: \$? = $ac_status" >&5
11034   (exit "$ac_status"); }; }; then
11035   echo "$as_me:11035: result: yes" >&5
11036 echo "${ECHO_T}yes" >&6
11037 else
11038   echo "$as_me: failed program was:" >&5
11039 cat "conftest.$ac_ext" >&5
11040 echo "$as_me:11040: result: no" >&5
11041 echo "${ECHO_T}no" >&6
11042                  LIBS="$cf_ncurses_SAVE"
11043 fi
11044 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11045 fi
11046
11047 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11048
11049 cat >>confdefs.h <<EOF
11050 #define $cf_nculib_ROOT 1
11051 EOF
11052
11053         fi
11054 else
11055         NCURSES_CONFIG=none
11056 fi
11057
11058 fi
11059
11060 if test "$NCURSES_CONFIG_PKG" != none ; then
11061         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
11062
11063         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11064         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11065         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11066
11067         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
11068         if test -z "$cf_cv_abi_version"
11069         then
11070                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
11071         fi
11072
11073 elif test "$NCURSES_CONFIG" != none ; then
11074
11075         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
11076
11077         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
11078         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
11079         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
11080
11081         # ABI version is not available from headers
11082         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
11083
11084 else
11085
11086         for cf_name in MAJOR MINOR PATCH
11087         do
11088         cat >conftest.$ac_ext <<CF_EOF
11089         #include <${cf_cv_ncurses_header:-curses.h}>
11090         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
11091 CF_EOF
11092                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
11093                 { (eval echo "$as_me:11093: \"$cf_try\"") >&5
11094   (eval $cf_try) 2>&5
11095   ac_status=$?
11096   echo "$as_me:11096: \$? = $ac_status" >&5
11097   (exit "$ac_status"); }
11098                 if test -f conftest.out ; then
11099                         cf_result=`sed -e "s/^.*AUTOCONF_${cf_name}[    ][      ]*//" conftest.out`
11100                         eval NCURSES_$cf_name=\"$cf_result\"
11101                         # cat conftest.$ac_ext
11102                         # cat conftest.out
11103                 fi
11104         done
11105
11106         cf_cv_abi_version=${NCURSES_MAJOR}
11107
11108 fi
11109
11110 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
11111
11112 cf_cv_timestamp=`date`
11113
11114 echo "$as_me:11114: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
11115 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
11116
11117 echo "$as_me:11117: checking if you want to have a library-prefix" >&5
11118 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
11119
11120 # Check whether --with-lib-prefix or --without-lib-prefix was given.
11121 if test "${with_lib_prefix+set}" = set; then
11122   withval="$with_lib_prefix"
11123   with_lib_prefix=$withval
11124 else
11125   with_lib_prefix=auto
11126 fi;
11127 echo "$as_me:11127: result: $with_lib_prefix" >&5
11128 echo "${ECHO_T}$with_lib_prefix" >&6
11129
11130 if test "$with_lib_prefix" = auto
11131 then
11132
11133         case "$cf_cv_system_name" in
11134         (OS/2*|os2*)
11135                 if test "$DFT_LWR_MODEL" = libtool; then
11136                         LIB_PREFIX='lib'
11137                 else
11138                         LIB_PREFIX=''
11139                 fi
11140                 ;;
11141         (*-msvc*)
11142                 LIB_PREFIX=''
11143                 ;;
11144         (*)     LIB_PREFIX='lib'
11145                 ;;
11146         esac
11147 cf_prefix=$LIB_PREFIX
11148
11149 elif test "$with_lib_prefix" = no
11150 then
11151         LIB_PREFIX=
11152 else
11153         LIB_PREFIX=$with_lib_prefix
11154 fi
11155
11156 LIB_SUFFIX=
11157
11158 ###############################################################################
11159
11160 if test X"$CC_G_OPT" = X"" ; then
11161         CC_G_OPT='-g'
11162         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
11163 fi
11164
11165 echo "$as_me:11165: checking for default loader flags" >&5
11166 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
11167 case $DFT_LWR_MODEL in
11168 (normal)  LD_MODEL=''   ;;
11169 (debug)   LD_MODEL=$CC_G_OPT ;;
11170 (profile) LD_MODEL='-pg';;
11171 (shared)  LD_MODEL=''   ;;
11172 esac
11173 echo "$as_me:11173: result: $LD_MODEL" >&5
11174 echo "${ECHO_T}$LD_MODEL" >&6
11175
11176 LD_RPATH_OPT=
11177 if test "x$cf_cv_enable_rpath" != xno
11178 then
11179         echo "$as_me:11179: checking for an rpath option" >&5
11180 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
11181         case "$cf_cv_system_name" in
11182         (irix*)
11183                 if test "$GCC" = yes; then
11184                         LD_RPATH_OPT="-Wl,-rpath,"
11185                 else
11186                         LD_RPATH_OPT="-rpath "
11187                 fi
11188                 ;;
11189         (linux*|gnu*|k*bsd*-gnu|freebsd*)
11190                 LD_RPATH_OPT="-Wl,-rpath,"
11191                 ;;
11192         (openbsd[2-9].*|mirbsd*)
11193                 LD_RPATH_OPT="-Wl,-rpath,"
11194                 ;;
11195         (dragonfly*)
11196                 LD_RPATH_OPT="-rpath "
11197                 ;;
11198         (netbsd*)
11199                 LD_RPATH_OPT="-Wl,-rpath,"
11200                 ;;
11201         (osf*|mls+*)
11202                 LD_RPATH_OPT="-rpath "
11203                 ;;
11204         (solaris2*)
11205                 LD_RPATH_OPT="-R"
11206                 ;;
11207         (*)
11208                 ;;
11209         esac
11210         echo "$as_me:11210: result: $LD_RPATH_OPT" >&5
11211 echo "${ECHO_T}$LD_RPATH_OPT" >&6
11212
11213         case "x$LD_RPATH_OPT" in
11214         (x-R*)
11215                 echo "$as_me:11215: checking if we need a space after rpath option" >&5
11216 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
11217                 cf_save_LIBS="$LIBS"
11218
11219 cf_add_libs="$LIBS"
11220 # reverse order
11221 cf_add_0lib=
11222 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11223 # filter duplicates
11224 for cf_add_1lib in $cf_add_0lib; do
11225         for cf_add_2lib in $cf_add_libs; do
11226                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11227                         cf_add_1lib=
11228                         break
11229                 fi
11230         done
11231         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11232 done
11233 LIBS="$cf_add_libs"
11234
11235                 cat >"conftest.$ac_ext" <<_ACEOF
11236 #line 11236 "configure"
11237 #include "confdefs.h"
11238
11239 int
11240 main (void)
11241 {
11242
11243   ;
11244   return 0;
11245 }
11246 _ACEOF
11247 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11248 if { (eval echo "$as_me:11248: \"$ac_link\"") >&5
11249   (eval $ac_link) 2>&5
11250   ac_status=$?
11251   echo "$as_me:11251: \$? = $ac_status" >&5
11252   (exit "$ac_status"); } &&
11253          { ac_try='test -s "conftest$ac_exeext"'
11254   { (eval echo "$as_me:11254: \"$ac_try\"") >&5
11255   (eval $ac_try) 2>&5
11256   ac_status=$?
11257   echo "$as_me:11257: \$? = $ac_status" >&5
11258   (exit "$ac_status"); }; }; then
11259   cf_rpath_space=no
11260 else
11261   echo "$as_me: failed program was:" >&5
11262 cat "conftest.$ac_ext" >&5
11263 cf_rpath_space=yes
11264 fi
11265 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11266                 LIBS="$cf_save_LIBS"
11267                 echo "$as_me:11267: result: $cf_rpath_space" >&5
11268 echo "${ECHO_T}$cf_rpath_space" >&6
11269                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
11270                 ;;
11271         esac
11272 fi
11273
11274         RM_SHARED_OPTS=
11275         LOCAL_LDFLAGS=
11276         LOCAL_LDFLAGS2=
11277         LD_SHARED_OPTS=
11278         INSTALL_LIB="-m 644"
11279         : ${rel_builddir:=.}
11280
11281         shlibdir=$libdir
11282
11283         MAKE_DLLS="#"
11284
11285         cf_cv_do_symlinks=no
11286         cf_ld_rpath_opt=
11287         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
11288
11289         echo "$as_me:11289: checking if release/abi version should be used for shared libs" >&5
11290 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
11291
11292 # Check whether --with-shlib-version or --without-shlib-version was given.
11293 if test "${with_shlib_version+set}" = set; then
11294   withval="$with_shlib_version"
11295   test -z "$withval" && withval=auto
11296         case "$withval" in
11297         (yes)
11298                 cf_cv_shlib_version=auto
11299                 ;;
11300         (rel|abi|auto)
11301                 cf_cv_shlib_version=$withval
11302                 ;;
11303         (*)
11304                 echo "$as_me:11304: result: $withval" >&5
11305 echo "${ECHO_T}$withval" >&6
11306                 { { echo "$as_me:11306: error: option value must be one of: rel, abi, or auto" >&5
11307 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
11308    { (exit 1); exit 1; }; }
11309                 ;;
11310         esac
11311
11312 else
11313   cf_cv_shlib_version=auto
11314 fi;
11315         echo "$as_me:11315: result: $cf_cv_shlib_version" >&5
11316 echo "${ECHO_T}$cf_cv_shlib_version" >&6
11317
11318         cf_cv_rm_so_locs=no
11319         cf_try_cflags=
11320
11321         # Some less-capable ports of gcc support only -fpic
11322         CC_SHARED_OPTS=
11323
11324         cf_try_fPIC=no
11325         if test "$GCC" = yes
11326         then
11327                 cf_try_fPIC=yes
11328         else
11329                 case "$cf_cv_system_name" in
11330                 (*linux*)       # e.g., PGI compiler
11331                         cf_try_fPIC=yes
11332                         ;;
11333                 esac
11334         fi
11335
11336         if test "$cf_try_fPIC" = yes
11337         then
11338                 echo "$as_me:11338: checking which $CC option to use" >&5
11339 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
11340                 cf_save_CFLAGS="$CFLAGS"
11341                 for CC_SHARED_OPTS in -fPIC -fpic ''
11342                 do
11343                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
11344                         cat >"conftest.$ac_ext" <<_ACEOF
11345 #line 11345 "configure"
11346 #include "confdefs.h"
11347 #include <stdio.h>
11348 int
11349 main (void)
11350 {
11351 int x = 1
11352   ;
11353   return 0;
11354 }
11355 _ACEOF
11356 rm -f "conftest.$ac_objext"
11357 if { (eval echo "$as_me:11357: \"$ac_compile\"") >&5
11358   (eval $ac_compile) 2>&5
11359   ac_status=$?
11360   echo "$as_me:11360: \$? = $ac_status" >&5
11361   (exit "$ac_status"); } &&
11362          { ac_try='test -s "conftest.$ac_objext"'
11363   { (eval echo "$as_me:11363: \"$ac_try\"") >&5
11364   (eval $ac_try) 2>&5
11365   ac_status=$?
11366   echo "$as_me:11366: \$? = $ac_status" >&5
11367   (exit "$ac_status"); }; }; then
11368   break
11369 else
11370   echo "$as_me: failed program was:" >&5
11371 cat "conftest.$ac_ext" >&5
11372 fi
11373 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11374                 done
11375                 echo "$as_me:11375: result: $CC_SHARED_OPTS" >&5
11376 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
11377                 CFLAGS="$cf_save_CFLAGS"
11378         fi
11379
11380         cf_cv_shlib_version_infix=no
11381
11382         case "$cf_cv_system_name" in
11383         (aix4.3-9*|aix[5-7]*)
11384                 if test "$GCC" = yes; then
11385                         CC_SHARED_OPTS='-Wl,-brtl'
11386                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11387                 else
11388                         CC_SHARED_OPTS='-brtl'
11389                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
11390                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
11391                 fi
11392                 ;;
11393         (beos*)
11394                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
11395                 ;;
11396         (cygwin*)
11397                 CC_SHARED_OPTS=
11398                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11399                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11400                 cf_cv_shlib_version=cygdll
11401                 cf_cv_shlib_version_infix=cygdll
11402                 shlibdir=$bindir
11403                 MAKE_DLLS=
11404                 cat >mk_shared_lib.sh <<-CF_EOF
11405                 #!$SHELL
11406                 SHARED_LIB=\$1
11407                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11408                 shift
11409                 cat <<-EOF
11410                 Linking shared library
11411                 ** SHARED_LIB \$SHARED_LIB
11412                 ** IMPORT_LIB \$IMPORT_LIB
11413 EOF
11414                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11415 CF_EOF
11416                 chmod +x mk_shared_lib.sh
11417                 ;;
11418         (msys*)
11419                 CC_SHARED_OPTS=
11420                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11421                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11422                 cf_cv_shlib_version=msysdll
11423                 cf_cv_shlib_version_infix=msysdll
11424                 shlibdir=$bindir
11425                 MAKE_DLLS=
11426                 cat >mk_shared_lib.sh <<-CF_EOF
11427                 #!$SHELL
11428                 SHARED_LIB=\$1
11429                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
11430                 shift
11431                 cat <<-EOF
11432                 Linking shared library
11433                 ** SHARED_LIB \$SHARED_LIB
11434                 ** IMPORT_LIB \$IMPORT_LIB
11435 EOF
11436                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11437 CF_EOF
11438                 chmod +x mk_shared_lib.sh
11439                 ;;
11440         (darwin*)
11441                 cf_try_cflags="no-cpp-precomp"
11442                 CC_SHARED_OPTS="-dynamic"
11443                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
11444                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
11445                 cf_cv_shlib_version_infix=yes
11446                 echo "$as_me:11446: checking if ld -search_paths_first works" >&5
11447 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
11448 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
11449   echo $ECHO_N "(cached) $ECHO_C" >&6
11450 else
11451
11452                         cf_save_LDFLAGS=$LDFLAGS
11453                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11454                         cat >"conftest.$ac_ext" <<_ACEOF
11455 #line 11455 "configure"
11456 #include "confdefs.h"
11457
11458 int
11459 main (void)
11460 {
11461 int i;
11462   ;
11463   return 0;
11464 }
11465 _ACEOF
11466 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
11467 if { (eval echo "$as_me:11467: \"$ac_link\"") >&5
11468   (eval $ac_link) 2>&5
11469   ac_status=$?
11470   echo "$as_me:11470: \$? = $ac_status" >&5
11471   (exit "$ac_status"); } &&
11472          { ac_try='test -s "conftest$ac_exeext"'
11473   { (eval echo "$as_me:11473: \"$ac_try\"") >&5
11474   (eval $ac_try) 2>&5
11475   ac_status=$?
11476   echo "$as_me:11476: \$? = $ac_status" >&5
11477   (exit "$ac_status"); }; }; then
11478   cf_cv_ldflags_search_paths_first=yes
11479 else
11480   echo "$as_me: failed program was:" >&5
11481 cat "conftest.$ac_ext" >&5
11482 cf_cv_ldflags_search_paths_first=no
11483 fi
11484 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
11485                                 LDFLAGS=$cf_save_LDFLAGS
11486 fi
11487 echo "$as_me:11487: result: $cf_cv_ldflags_search_paths_first" >&5
11488 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
11489                 if test "$cf_cv_ldflags_search_paths_first" = yes; then
11490                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
11491                 fi
11492                 ;;
11493         (hpux[7-8]*)
11494                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
11495                 if test "$GCC" != yes; then
11496                         CC_SHARED_OPTS='+Z'
11497                 fi
11498                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
11499                 INSTALL_LIB="-m 555"
11500                 ;;
11501         (hpux*)
11502                 # (tested with gcc 2.7.2 -- I don't have c89)
11503                 if test "$GCC" = yes; then
11504                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
11505                 else
11506                         CC_SHARED_OPTS='+Z'
11507                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
11508                 fi
11509                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
11510                 # HP-UX shared libraries must be executable, and should be
11511                 # readonly to exploit a quirk in the memory manager.
11512                 INSTALL_LIB="-m 555"
11513                 ;;
11514         (interix*)
11515                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11516                 if test "$cf_cv_shlib_version" = rel; then
11517                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11518                 else
11519                         cf_shared_soname='`basename $@`'
11520                 fi
11521                 CC_SHARED_OPTS=
11522                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
11523                 ;;
11524         (irix*)
11525                 if test "$cf_cv_enable_rpath" = yes ; then
11526                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11527                 fi
11528                 # tested with IRIX 5.2 and 'cc'.
11529                 if test "$GCC" != yes; then
11530                         CC_SHARED_OPTS='-KPIC'
11531                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
11532                 else
11533                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
11534                 fi
11535                 cf_cv_rm_so_locs=yes
11536                 ;;
11537         (linux*|gnu*|k*bsd*-gnu)
11538                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11539                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11540                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11541                 fi
11542                 if test "$cf_cv_enable_rpath" = yes ; then
11543                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11544                 fi
11545
11546         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11547         if test "$cf_cv_shlib_version" = rel; then
11548                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11549         else
11550                 cf_cv_shared_soname='`basename $@`'
11551         fi
11552
11553                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11554                 ;;
11555         (mingw*msvc*)
11556                 cf_cv_shlib_version=msvcdll
11557                 cf_cv_shlib_version_infix=msvcdll
11558                 shlibdir=$bindir
11559                 MAKE_DLLS=
11560                 if test "$DFT_LWR_MODEL" = "shared" ; then
11561                         LOCAL_LDFLAGS="-link -dll"
11562                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11563                         EXTRA_LDFLAGS="-link -dll $EXTRA_LDFLAGS"
11564                 fi
11565                 CC_SHARED_OPTS=
11566                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${LD} ${CFLAGS}'
11567                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.lib"
11568                 cat >mk_shared_lib.sh <<-CF_EOF
11569                 #!$SHELL
11570                 SHARED_LIB=\$1
11571                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.lib/'\`
11572                 shift
11573                 my_ld=\$1
11574                 shift
11575                 cat <<-EOF
11576                 Linking shared library
11577                 ** SHARED LIB \$SHARED_LIB
11578                 ** IMPORT_LIB \$IMPORT_LIB
11579 EOF
11580                 args=\$(echo \$* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g")
11581                 exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args
11582                 mv "\${IMPORT_LIB}" "\${IMPORT_LIB}"
11583 CF_EOF
11584                 chmod +x mk_shared_lib.sh
11585                 cat >mk_prog.sh <<-CF_EOF
11586                 #!$SHELL
11587                 shift
11588                 # Ignore first argument (compiler) and use LD (link.exe) unconditionally
11589                 LD="$LD"
11590                 clopts=()
11591                 ldopts=("/subsystem:console")
11592                 libs=()
11593                 isdll=0
11594                 while test \$# -gt 0; do
11595                         case "\$1" in
11596                                 -link)
11597                                         # ignore -link argument
11598                                         ;;
11599                                 -M[TD] | -M[TD]d)
11600                                         # ignore runtime-library option
11601                                         ;;
11602                                 -dll)
11603                                         isdll=1
11604                                         ;;
11605                                 -W* | -w*)
11606                                         # ignore warnings
11607                                         ;;
11608                                 -D*)
11609                                         clopts+=("\$1")
11610                                         ;;
11611                                 -I*)
11612                                         clopts+=("\$1")
11613                                         ;;
11614                                 -l*)
11615                                         libs+=("\`echo \"\$1\" | sed \"s/^-l//\"\`")
11616                                         ;;
11617                                 -L*)
11618                                         ldopts+=("\`echo \"\$1\" | sed \"s/^-L/-LIBPATH:/\"\`")
11619                                         ;;
11620                                 *.obj | *.o)
11621                                         ldopts+=("\$1")
11622                                         ;;
11623                                 -Wl,*)
11624                                         for linkarg in \`echo '\$1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do
11625                                                 ldopts+=("\${linkarg}")
11626                                         done
11627                                         ;;
11628                                 *.lib)
11629                                         ldopts+=("\$1")
11630                                         ;;
11631                                 -o)
11632                                         shift
11633                                         ldopts+=("-out:\$1")
11634                                         ;;
11635                                 *)
11636                                         clopts+=("\$1")
11637                                         ldopts+=("\$1")
11638                                         ;;
11639                         esac
11640                         shift
11641                 done
11642                 if [ "\$isdll" -ne 0 ]; then
11643                         for lib in \${libs[*]}; do
11644                                 ldopts+=("\$lib.dll.lib")
11645                         done
11646                 else
11647                         for lib in \${libs[*]}; do
11648                                 ldopts+=("\$lib.lib")
11649                         done
11650                 fi
11651                 cat <<-EOF
11652                 Creating program
11653                 ** ld options:   "\${ldopts[@]}"
11654 EOF
11655                 exec \$LD \${ldopts[@]}
11656 CF_EOF
11657                 chmod +x mk_prog.sh
11658                 LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh"
11659                 LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh"
11660                 ;;
11661         (mingw*)
11662                 cf_cv_shlib_version=mingw
11663                 cf_cv_shlib_version_infix=mingw
11664                 shlibdir=$bindir
11665                 MAKE_DLLS=
11666                 if test "$DFT_LWR_MODEL" = "shared" ; then
11667                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
11668                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11669                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
11670                 fi
11671                 CC_SHARED_OPTS=
11672                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
11673                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
11674                 cat >mk_shared_lib.sh <<-CF_EOF
11675                 #!$SHELL
11676                 SHARED_LIB=\$1
11677                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
11678                 shift
11679                 cat <<-EOF
11680                 Linking shared library
11681                 ** SHARED_LIB \$SHARED_LIB
11682                 ** IMPORT_LIB \$IMPORT_LIB
11683 EOF
11684                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
11685 CF_EOF
11686                 chmod +x mk_shared_lib.sh
11687                 ;;
11688         (openbsd[2-9].*|mirbsd*)
11689                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11690                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11691                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11692                 fi
11693                 if test "$cf_cv_enable_rpath" = yes ; then
11694                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11695                 fi
11696                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11697
11698         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11699         if test "$cf_cv_shlib_version" = rel; then
11700                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11701         else
11702                 cf_cv_shared_soname='`basename $@`'
11703         fi
11704
11705                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11706                 ;;
11707         (nskJ*)
11708                 CC_SHARED_OPTS=
11709                 MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $@'
11710                 ;;
11711         (nskL*)
11712                 CC_SHARED_OPTS=
11713                 MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $@'
11714                 ;;
11715         (nto-qnx*|openbsd*|freebsd[12].*)
11716                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11717                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
11718                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11719                 ;;
11720         (dragonfly*|freebsd*)
11721                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11722                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11723                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11724                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
11725                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11726                 fi
11727
11728         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11729         if test "$cf_cv_shlib_version" = rel; then
11730                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11731         else
11732                 cf_cv_shared_soname='`basename $@`'
11733         fi
11734
11735                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
11736                 ;;
11737         (netbsd*)
11738                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
11739                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
11740                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
11741                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11742                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
11743                         if test "$cf_cv_shlib_version" = auto; then
11744                         if test -f /usr/libexec/ld.elf_so; then
11745                                 cf_cv_shlib_version=abi
11746                         else
11747                                 cf_cv_shlib_version=rel
11748                         fi
11749                         fi
11750
11751         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11752         if test "$cf_cv_shlib_version" = rel; then
11753                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11754         else
11755                 cf_cv_shared_soname='`basename $@`'
11756         fi
11757
11758                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
11759                 else
11760                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $@'
11761                 fi
11762                 ;;
11763         (osf*|mls+*)
11764                 # tested with OSF/1 V3.2 and 'cc'
11765                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
11766                 # link with shared libs).
11767                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
11768                 case "$host_os" in
11769                 (osf4*)
11770                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
11771                         ;;
11772                 esac
11773                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
11774                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
11775                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
11776                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11777                 fi
11778                 cf_cv_rm_so_locs=yes
11779                 ;;
11780         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
11781                 # tested with osr5.0.5
11782                 if test "$GCC" != yes; then
11783                         CC_SHARED_OPTS='-belf -KPIC'
11784                 fi
11785                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
11786                 if test "$cf_cv_enable_rpath" = yes ; then
11787                         # only way is to set LD_RUN_PATH but no switch for it
11788                         RUN_PATH=$libdir
11789                 fi
11790                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11791                 LINK_PROGS='LD_RUN_PATH=${libdir}'
11792                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
11793                 ;;
11794         (sunos4*)
11795                 # tested with SunOS 4.1.1 and gcc 2.7.0
11796                 if test "$GCC" != yes; then
11797                         CC_SHARED_OPTS='-KPIC'
11798                 fi
11799                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
11800                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11801                 ;;
11802         (solaris2*)
11803                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
11804                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
11805                 if test "$DFT_LWR_MODEL" = "shared" ; then
11806                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
11807                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
11808                 fi
11809                 if test "$cf_cv_enable_rpath" = yes ; then
11810                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
11811                 fi
11812
11813         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
11814         if test "$cf_cv_shlib_version" = rel; then
11815                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
11816         else
11817                 cf_cv_shared_soname='`basename $@`'
11818         fi
11819
11820                 if test "$GCC" != yes; then
11821                         cf_save_CFLAGS="$CFLAGS"
11822                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
11823                         do
11824                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
11825                                 cat >"conftest.$ac_ext" <<_ACEOF
11826 #line 11826 "configure"
11827 #include "confdefs.h"
11828 #include <stdio.h>
11829 int
11830 main (void)
11831 {
11832 printf("Hello\\n");
11833   ;
11834   return 0;
11835 }
11836 _ACEOF
11837 rm -f "conftest.$ac_objext"
11838 if { (eval echo "$as_me:11838: \"$ac_compile\"") >&5
11839   (eval $ac_compile) 2>&5
11840   ac_status=$?
11841   echo "$as_me:11841: \$? = $ac_status" >&5
11842   (exit "$ac_status"); } &&
11843          { ac_try='test -s "conftest.$ac_objext"'
11844   { (eval echo "$as_me:11844: \"$ac_try\"") >&5
11845   (eval $ac_try) 2>&5
11846   ac_status=$?
11847   echo "$as_me:11847: \$? = $ac_status" >&5
11848   (exit "$ac_status"); }; }; then
11849   break
11850 else
11851   echo "$as_me: failed program was:" >&5
11852 cat "conftest.$ac_ext" >&5
11853 fi
11854 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
11855                         done
11856                         CFLAGS="$cf_save_CFLAGS"
11857                         CC_SHARED_OPTS=$cf_shared_opts
11858                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
11859                 else
11860                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
11861                 fi
11862                 ;;
11863         (sysv5uw7*|unix_sv*)
11864                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
11865                 if test "$GCC" != yes; then
11866                         CC_SHARED_OPTS='-KPIC'
11867                 fi
11868                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
11869                 ;;
11870         (*)
11871                 CC_SHARED_OPTS='unknown'
11872                 MK_SHARED_LIB='echo unknown'
11873                 ;;
11874         esac
11875
11876         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
11877         case "$cf_cv_shlib_version" in
11878         (rel|abi)
11879                 case "$MK_SHARED_LIB" in
11880                 (*'-o $@')
11881                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
11882                         ;;
11883                 (*)
11884                         { echo "$as_me:11884: WARNING: ignored --with-shlib-version" >&5
11885 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
11886                         ;;
11887                 esac
11888                 ;;
11889         esac
11890
11891         if test -n "$cf_try_cflags"
11892         then
11893 cat > conftest.$ac_ext <<EOF
11894 #line 11894 "${as_me:-configure}"
11895 #include <stdio.h>
11896 int main(int argc, char *argv[])
11897 {
11898         printf("hello\\n");
11899         return (argv[argc-1] == 0) ;
11900 }
11901 EOF
11902                 cf_save_CFLAGS="$CFLAGS"
11903                 for cf_opt in $cf_try_cflags
11904                 do
11905                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
11906                         echo "$as_me:11906: checking if CFLAGS option -$cf_opt works" >&5
11907 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
11908                         if { (eval echo "$as_me:11908: \"$ac_compile\"") >&5
11909   (eval $ac_compile) 2>&5
11910   ac_status=$?
11911   echo "$as_me:11911: \$? = $ac_status" >&5
11912   (exit "$ac_status"); }; then
11913                                 echo "$as_me:11913: result: yes" >&5
11914 echo "${ECHO_T}yes" >&6
11915                                 cf_save_CFLAGS="$CFLAGS"
11916                         else
11917                                 echo "$as_me:11917: result: no" >&5
11918 echo "${ECHO_T}no" >&6
11919                         fi
11920                 done
11921                 CFLAGS="$cf_save_CFLAGS"
11922         fi
11923
11924         # RPATH_LIST is a colon-separated list of directories
11925         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
11926         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
11927
11928         test "$cf_cv_rm_so_locs" = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
11929
11930         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
11931
11932 echo "${as_me:-configure}:11932: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
11933
11934         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
11935
11936 echo "${as_me:-configure}:11936: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
11937
11938 # The test/sample programs in the original tree link using rpath option.
11939 # Make it optional for packagers.
11940 if test -n "$LOCAL_LDFLAGS"
11941 then
11942         echo "$as_me:11942: checking if you want to link sample programs with rpath option" >&5
11943 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
11944
11945 # Check whether --enable-rpath-link or --disable-rpath-link was given.
11946 if test "${enable_rpath_link+set}" = set; then
11947   enableval="$enable_rpath_link"
11948   with_rpath_link=$enableval
11949 else
11950   with_rpath_link=yes
11951 fi;
11952         echo "$as_me:11952: result: $with_rpath_link" >&5
11953 echo "${ECHO_T}$with_rpath_link" >&6
11954         if test "$with_rpath_link" = no
11955         then
11956                 LOCAL_LDFLAGS=
11957                 LOCAL_LDFLAGS2=
11958         fi
11959 fi
11960
11961 ###############################################################################
11962
11963 ###   use option --enable-broken-linker to force on use of broken-linker support
11964
11965 echo "$as_me:11965: checking if you want broken-linker support code" >&5
11966 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
11967
11968 # Check whether --enable-broken_linker or --disable-broken_linker was given.
11969 if test "${enable_broken_linker+set}" = set; then
11970   enableval="$enable_broken_linker"
11971   with_broken_linker=$enableval
11972 else
11973   with_broken_linker=no
11974 fi;
11975 echo "$as_me:11975: result: $with_broken_linker" >&5
11976 echo "${ECHO_T}$with_broken_linker" >&6
11977
11978 : "${BROKEN_LINKER:=0}"
11979 if test "x$with_broken_linker" = xyes ; then
11980
11981 cat >>confdefs.h <<\EOF
11982 #define BROKEN_LINKER 1
11983 EOF
11984
11985         BROKEN_LINKER=1
11986 fi
11987
11988 # Check to define _XOPEN_SOURCE "automatically"
11989
11990 echo "$as_me:11990: checking if the POSIX test-macros are already defined" >&5
11991 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
11992 if test "${cf_cv_posix_visible+set}" = set; then
11993   echo $ECHO_N "(cached) $ECHO_C" >&6
11994 else
11995
11996 cat >"conftest.$ac_ext" <<_ACEOF
11997 #line 11997 "configure"
11998 #include "confdefs.h"
11999 #include <stdio.h>
12000 int
12001 main (void)
12002 {
12003
12004 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
12005         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
12006         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
12007         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
12008 #error conflicting symbols found
12009 #endif
12010
12011   ;
12012   return 0;
12013 }
12014 _ACEOF
12015 rm -f "conftest.$ac_objext"
12016 if { (eval echo "$as_me:12016: \"$ac_compile\"") >&5
12017   (eval $ac_compile) 2>&5
12018   ac_status=$?
12019   echo "$as_me:12019: \$? = $ac_status" >&5
12020   (exit "$ac_status"); } &&
12021          { ac_try='test -s "conftest.$ac_objext"'
12022   { (eval echo "$as_me:12022: \"$ac_try\"") >&5
12023   (eval $ac_try) 2>&5
12024   ac_status=$?
12025   echo "$as_me:12025: \$? = $ac_status" >&5
12026   (exit "$ac_status"); }; }; then
12027   cf_cv_posix_visible=no
12028 else
12029   echo "$as_me: failed program was:" >&5
12030 cat "conftest.$ac_ext" >&5
12031 cf_cv_posix_visible=yes
12032 fi
12033 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12034
12035 fi
12036 echo "$as_me:12036: result: $cf_cv_posix_visible" >&5
12037 echo "${ECHO_T}$cf_cv_posix_visible" >&6
12038
12039 if test "$cf_cv_posix_visible" = no; then
12040
12041 cf_XOPEN_SOURCE=600
12042 cf_POSIX_C_SOURCE=199506L
12043 cf_xopen_source=
12044
12045 case "$host_os" in
12046 (aix[4-7]*)
12047         cf_xopen_source="-D_ALL_SOURCE"
12048         ;;
12049 (msys)
12050         cf_XOPEN_SOURCE=600
12051         ;;
12052 (darwin[0-8].*)
12053         cf_xopen_source="-D_APPLE_C_SOURCE"
12054         ;;
12055 (darwin*)
12056         cf_xopen_source="-D_DARWIN_C_SOURCE"
12057         cf_XOPEN_SOURCE=
12058         ;;
12059 (freebsd*|dragonfly*|midnightbsd*)
12060         # 5.x headers associate
12061         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
12062         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
12063         cf_POSIX_C_SOURCE=200112L
12064         cf_XOPEN_SOURCE=600
12065         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12066         ;;
12067 (hpux11*)
12068         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
12069         ;;
12070 (hpux*)
12071         cf_xopen_source="-D_HPUX_SOURCE"
12072         ;;
12073 (irix[56].*)
12074         cf_xopen_source="-D_SGI_SOURCE"
12075         cf_XOPEN_SOURCE=
12076         ;;
12077 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
12078
12079 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
12080
12081 echo "$as_me:12081: checking if this is the GNU C library" >&5
12082 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
12083 if test "${cf_cv_gnu_library+set}" = set; then
12084   echo $ECHO_N "(cached) $ECHO_C" >&6
12085 else
12086
12087 cat >"conftest.$ac_ext" <<_ACEOF
12088 #line 12088 "configure"
12089 #include "confdefs.h"
12090 #include <sys/types.h>
12091 int
12092 main (void)
12093 {
12094
12095         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
12096                 return 0;
12097         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
12098                 return 0;
12099         #else
12100         #       error not GNU C library
12101         #endif
12102   ;
12103   return 0;
12104 }
12105 _ACEOF
12106 rm -f "conftest.$ac_objext"
12107 if { (eval echo "$as_me:12107: \"$ac_compile\"") >&5
12108   (eval $ac_compile) 2>&5
12109   ac_status=$?
12110   echo "$as_me:12110: \$? = $ac_status" >&5
12111   (exit "$ac_status"); } &&
12112          { ac_try='test -s "conftest.$ac_objext"'
12113   { (eval echo "$as_me:12113: \"$ac_try\"") >&5
12114   (eval $ac_try) 2>&5
12115   ac_status=$?
12116   echo "$as_me:12116: \$? = $ac_status" >&5
12117   (exit "$ac_status"); }; }; then
12118   cf_cv_gnu_library=yes
12119 else
12120   echo "$as_me: failed program was:" >&5
12121 cat "conftest.$ac_ext" >&5
12122 cf_cv_gnu_library=no
12123 fi
12124 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12125
12126 fi
12127 echo "$as_me:12127: result: $cf_cv_gnu_library" >&5
12128 echo "${ECHO_T}$cf_cv_gnu_library" >&6
12129
12130 if test x$cf_cv_gnu_library = xyes; then
12131
12132         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
12133         # was changed to help a little.  newlib incorporated the change about 4
12134         # years later.
12135         echo "$as_me:12135: checking if _DEFAULT_SOURCE can be used as a basis" >&5
12136 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
12137 if test "${cf_cv_gnu_library_219+set}" = set; then
12138   echo $ECHO_N "(cached) $ECHO_C" >&6
12139 else
12140
12141                 cf_save="$CPPFLAGS"
12142
12143         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12144         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12145
12146                 cat >"conftest.$ac_ext" <<_ACEOF
12147 #line 12147 "configure"
12148 #include "confdefs.h"
12149 #include <sys/types.h>
12150 int
12151 main (void)
12152 {
12153
12154                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
12155                                 return 0;
12156                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
12157                                 return 0;
12158                         #else
12159                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
12160                         #endif
12161   ;
12162   return 0;
12163 }
12164 _ACEOF
12165 rm -f "conftest.$ac_objext"
12166 if { (eval echo "$as_me:12166: \"$ac_compile\"") >&5
12167   (eval $ac_compile) 2>&5
12168   ac_status=$?
12169   echo "$as_me:12169: \$? = $ac_status" >&5
12170   (exit "$ac_status"); } &&
12171          { ac_try='test -s "conftest.$ac_objext"'
12172   { (eval echo "$as_me:12172: \"$ac_try\"") >&5
12173   (eval $ac_try) 2>&5
12174   ac_status=$?
12175   echo "$as_me:12175: \$? = $ac_status" >&5
12176   (exit "$ac_status"); }; }; then
12177   cf_cv_gnu_library_219=yes
12178 else
12179   echo "$as_me: failed program was:" >&5
12180 cat "conftest.$ac_ext" >&5
12181 cf_cv_gnu_library_219=no
12182 fi
12183 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12184                 CPPFLAGS="$cf_save"
12185
12186 fi
12187 echo "$as_me:12187: result: $cf_cv_gnu_library_219" >&5
12188 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
12189
12190         if test "x$cf_cv_gnu_library_219" = xyes; then
12191                 cf_save="$CPPFLAGS"
12192                 echo "$as_me:12192: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
12193 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
12194 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
12195   echo $ECHO_N "(cached) $ECHO_C" >&6
12196 else
12197
12198 cf_fix_cppflags=no
12199 cf_new_cflags=
12200 cf_new_cppflags=
12201 cf_new_extra_cppflags=
12202
12203 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
12204 do
12205 case "$cf_fix_cppflags" in
12206 (no)
12207         case "$cf_add_cflags" in
12208         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12209                 case "$cf_add_cflags" in
12210                 (-D*)
12211                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12212
12213                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12214                                 && test -z "${cf_tst_cflags}" \
12215                                 && cf_fix_cppflags=yes
12216
12217                         if test "$cf_fix_cppflags" = yes ; then
12218
12219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12221
12222                                 continue
12223                         elif test "${cf_tst_cflags}" = "\"'" ; then
12224
12225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12227
12228                                 continue
12229                         fi
12230                         ;;
12231                 esac
12232                 case "$CPPFLAGS" in
12233                 (*$cf_add_cflags)
12234                         ;;
12235                 (*)
12236                         case "$cf_add_cflags" in
12237                         (-D*)
12238                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12239
12240 CPPFLAGS=`echo "$CPPFLAGS" | \
12241         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12242                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12243
12244                                 ;;
12245                         esac
12246
12247         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12248         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12249
12250                         ;;
12251                 esac
12252                 ;;
12253         (*)
12254
12255         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12256         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12257
12258                 ;;
12259         esac
12260         ;;
12261 (yes)
12262
12263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12265
12266         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12267
12268         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12269                 && test -z "${cf_tst_cflags}" \
12270                 && cf_fix_cppflags=no
12271         ;;
12272 esac
12273 done
12274
12275 if test -n "$cf_new_cflags" ; then
12276
12277         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12278         CFLAGS="${CFLAGS}$cf_new_cflags"
12279
12280 fi
12281
12282 if test -n "$cf_new_cppflags" ; then
12283
12284         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12285         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12286
12287 fi
12288
12289 if test -n "$cf_new_extra_cppflags" ; then
12290
12291         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12292         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12293
12294 fi
12295
12296                         cat >"conftest.$ac_ext" <<_ACEOF
12297 #line 12297 "configure"
12298 #include "confdefs.h"
12299
12300                                 #include <limits.h>
12301                                 #include <sys/types.h>
12302
12303 int
12304 main (void)
12305 {
12306
12307                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
12308                                         return 0;
12309                                 #else
12310                                 #       error GNU C library is too old
12311                                 #endif
12312   ;
12313   return 0;
12314 }
12315 _ACEOF
12316 rm -f "conftest.$ac_objext"
12317 if { (eval echo "$as_me:12317: \"$ac_compile\"") >&5
12318   (eval $ac_compile) 2>&5
12319   ac_status=$?
12320   echo "$as_me:12320: \$? = $ac_status" >&5
12321   (exit "$ac_status"); } &&
12322          { ac_try='test -s "conftest.$ac_objext"'
12323   { (eval echo "$as_me:12323: \"$ac_try\"") >&5
12324   (eval $ac_try) 2>&5
12325   ac_status=$?
12326   echo "$as_me:12326: \$? = $ac_status" >&5
12327   (exit "$ac_status"); }; }; then
12328   cf_cv_gnu_dftsrc_219=yes
12329 else
12330   echo "$as_me: failed program was:" >&5
12331 cat "conftest.$ac_ext" >&5
12332 cf_cv_gnu_dftsrc_219=no
12333 fi
12334 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12335
12336 fi
12337 echo "$as_me:12337: result: $cf_cv_gnu_dftsrc_219" >&5
12338 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
12339                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
12340         else
12341                 cf_cv_gnu_dftsrc_219=maybe
12342         fi
12343
12344         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
12345
12346                 echo "$as_me:12346: checking if we must define _GNU_SOURCE" >&5
12347 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
12348 if test "${cf_cv_gnu_source+set}" = set; then
12349   echo $ECHO_N "(cached) $ECHO_C" >&6
12350 else
12351
12352                 cat >"conftest.$ac_ext" <<_ACEOF
12353 #line 12353 "configure"
12354 #include "confdefs.h"
12355 #include <sys/types.h>
12356 int
12357 main (void)
12358 {
12359
12360                         #ifndef _XOPEN_SOURCE
12361                         #error  expected _XOPEN_SOURCE to be defined
12362                         #endif
12363   ;
12364   return 0;
12365 }
12366 _ACEOF
12367 rm -f "conftest.$ac_objext"
12368 if { (eval echo "$as_me:12368: \"$ac_compile\"") >&5
12369   (eval $ac_compile) 2>&5
12370   ac_status=$?
12371   echo "$as_me:12371: \$? = $ac_status" >&5
12372   (exit "$ac_status"); } &&
12373          { ac_try='test -s "conftest.$ac_objext"'
12374   { (eval echo "$as_me:12374: \"$ac_try\"") >&5
12375   (eval $ac_try) 2>&5
12376   ac_status=$?
12377   echo "$as_me:12377: \$? = $ac_status" >&5
12378   (exit "$ac_status"); }; }; then
12379   cf_cv_gnu_source=no
12380 else
12381   echo "$as_me: failed program was:" >&5
12382 cat "conftest.$ac_ext" >&5
12383 cf_save="$CPPFLAGS"
12384
12385 cf_fix_cppflags=no
12386 cf_new_cflags=
12387 cf_new_cppflags=
12388 cf_new_extra_cppflags=
12389
12390 for cf_add_cflags in -D_GNU_SOURCE
12391 do
12392 case "$cf_fix_cppflags" in
12393 (no)
12394         case "$cf_add_cflags" in
12395         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12396                 case "$cf_add_cflags" in
12397                 (-D*)
12398                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12399
12400                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12401                                 && test -z "${cf_tst_cflags}" \
12402                                 && cf_fix_cppflags=yes
12403
12404                         if test "$cf_fix_cppflags" = yes ; then
12405
12406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12408
12409                                 continue
12410                         elif test "${cf_tst_cflags}" = "\"'" ; then
12411
12412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12414
12415                                 continue
12416                         fi
12417                         ;;
12418                 esac
12419                 case "$CPPFLAGS" in
12420                 (*$cf_add_cflags)
12421                         ;;
12422                 (*)
12423                         case "$cf_add_cflags" in
12424                         (-D*)
12425                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12426
12427 CPPFLAGS=`echo "$CPPFLAGS" | \
12428         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12429                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12430
12431                                 ;;
12432                         esac
12433
12434         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12435         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12436
12437                         ;;
12438                 esac
12439                 ;;
12440         (*)
12441
12442         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12443         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12444
12445                 ;;
12446         esac
12447         ;;
12448 (yes)
12449
12450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12452
12453         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12454
12455         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12456                 && test -z "${cf_tst_cflags}" \
12457                 && cf_fix_cppflags=no
12458         ;;
12459 esac
12460 done
12461
12462 if test -n "$cf_new_cflags" ; then
12463
12464         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12465         CFLAGS="${CFLAGS}$cf_new_cflags"
12466
12467 fi
12468
12469 if test -n "$cf_new_cppflags" ; then
12470
12471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12472         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12473
12474 fi
12475
12476 if test -n "$cf_new_extra_cppflags" ; then
12477
12478         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12479         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12480
12481 fi
12482
12483                          cat >"conftest.$ac_ext" <<_ACEOF
12484 #line 12484 "configure"
12485 #include "confdefs.h"
12486 #include <sys/types.h>
12487 int
12488 main (void)
12489 {
12490
12491                                 #ifdef _XOPEN_SOURCE
12492                                 #error  expected _XOPEN_SOURCE to be undefined
12493                                 #endif
12494   ;
12495   return 0;
12496 }
12497 _ACEOF
12498 rm -f "conftest.$ac_objext"
12499 if { (eval echo "$as_me:12499: \"$ac_compile\"") >&5
12500   (eval $ac_compile) 2>&5
12501   ac_status=$?
12502   echo "$as_me:12502: \$? = $ac_status" >&5
12503   (exit "$ac_status"); } &&
12504          { ac_try='test -s "conftest.$ac_objext"'
12505   { (eval echo "$as_me:12505: \"$ac_try\"") >&5
12506   (eval $ac_try) 2>&5
12507   ac_status=$?
12508   echo "$as_me:12508: \$? = $ac_status" >&5
12509   (exit "$ac_status"); }; }; then
12510   cf_cv_gnu_source=no
12511 else
12512   echo "$as_me: failed program was:" >&5
12513 cat "conftest.$ac_ext" >&5
12514 cf_cv_gnu_source=yes
12515 fi
12516 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12517                         CPPFLAGS="$cf_save"
12518
12519 fi
12520 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12521
12522 fi
12523 echo "$as_me:12523: result: $cf_cv_gnu_source" >&5
12524 echo "${ECHO_T}$cf_cv_gnu_source" >&6
12525
12526                 if test "$cf_cv_gnu_source" = yes
12527                 then
12528                 echo "$as_me:12528: checking if we should also define _DEFAULT_SOURCE" >&5
12529 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
12530 if test "${cf_cv_default_source+set}" = set; then
12531   echo $ECHO_N "(cached) $ECHO_C" >&6
12532 else
12533
12534         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12535         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
12536
12537                         cat >"conftest.$ac_ext" <<_ACEOF
12538 #line 12538 "configure"
12539 #include "confdefs.h"
12540 #include <sys/types.h>
12541 int
12542 main (void)
12543 {
12544
12545                                 #ifdef _DEFAULT_SOURCE
12546                                 #error  expected _DEFAULT_SOURCE to be undefined
12547                                 #endif
12548   ;
12549   return 0;
12550 }
12551 _ACEOF
12552 rm -f "conftest.$ac_objext"
12553 if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5
12554   (eval $ac_compile) 2>&5
12555   ac_status=$?
12556   echo "$as_me:12556: \$? = $ac_status" >&5
12557   (exit "$ac_status"); } &&
12558          { ac_try='test -s "conftest.$ac_objext"'
12559   { (eval echo "$as_me:12559: \"$ac_try\"") >&5
12560   (eval $ac_try) 2>&5
12561   ac_status=$?
12562   echo "$as_me:12562: \$? = $ac_status" >&5
12563   (exit "$ac_status"); }; }; then
12564   cf_cv_default_source=no
12565 else
12566   echo "$as_me: failed program was:" >&5
12567 cat "conftest.$ac_ext" >&5
12568 cf_cv_default_source=yes
12569 fi
12570 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12571
12572 fi
12573 echo "$as_me:12573: result: $cf_cv_default_source" >&5
12574 echo "${ECHO_T}$cf_cv_default_source" >&6
12575                         if test "$cf_cv_default_source" = yes
12576                         then
12577
12578         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12579         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
12580
12581                         fi
12582                 fi
12583         fi
12584
12585 fi
12586
12587         ;;
12588 (minix*)
12589         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
12590         ;;
12591 (mirbsd*)
12592         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
12593         cf_XOPEN_SOURCE=
12594
12595 if test "$cf_cv_posix_visible" = no; then
12596
12597 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
12598
12599 cf_save_CFLAGS="$CFLAGS"
12600 cf_save_CPPFLAGS="$CPPFLAGS"
12601
12602 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
12603         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12604                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12605
12606 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
12607         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
12608                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
12609
12610 echo "$as_me:12610: checking if we should define _POSIX_C_SOURCE" >&5
12611 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
12612 if test "${cf_cv_posix_c_source+set}" = set; then
12613   echo $ECHO_N "(cached) $ECHO_C" >&6
12614 else
12615
12616 echo "${as_me:-configure}:12616: testing if the symbol is already defined go no further ..." 1>&5
12617
12618         cat >"conftest.$ac_ext" <<_ACEOF
12619 #line 12619 "configure"
12620 #include "confdefs.h"
12621 #include <sys/types.h>
12622 int
12623 main (void)
12624 {
12625
12626 #ifndef _POSIX_C_SOURCE
12627 make an error
12628 #endif
12629   ;
12630   return 0;
12631 }
12632 _ACEOF
12633 rm -f "conftest.$ac_objext"
12634 if { (eval echo "$as_me:12634: \"$ac_compile\"") >&5
12635   (eval $ac_compile) 2>&5
12636   ac_status=$?
12637   echo "$as_me:12637: \$? = $ac_status" >&5
12638   (exit "$ac_status"); } &&
12639          { ac_try='test -s "conftest.$ac_objext"'
12640   { (eval echo "$as_me:12640: \"$ac_try\"") >&5
12641   (eval $ac_try) 2>&5
12642   ac_status=$?
12643   echo "$as_me:12643: \$? = $ac_status" >&5
12644   (exit "$ac_status"); }; }; then
12645   cf_cv_posix_c_source=no
12646 else
12647   echo "$as_me: failed program was:" >&5
12648 cat "conftest.$ac_ext" >&5
12649 cf_want_posix_source=no
12650          case .$cf_POSIX_C_SOURCE in
12651          (.[12]??*)
12652                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12653                 ;;
12654          (.2)
12655                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12656                 cf_want_posix_source=yes
12657                 ;;
12658          (.*)
12659                 cf_want_posix_source=yes
12660                 ;;
12661          esac
12662          if test "$cf_want_posix_source" = yes ; then
12663                 cat >"conftest.$ac_ext" <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666 #include <sys/types.h>
12667 int
12668 main (void)
12669 {
12670
12671 #ifdef _POSIX_SOURCE
12672 make an error
12673 #endif
12674   ;
12675   return 0;
12676 }
12677 _ACEOF
12678 rm -f "conftest.$ac_objext"
12679 if { (eval echo "$as_me:12679: \"$ac_compile\"") >&5
12680   (eval $ac_compile) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit "$ac_status"); } &&
12684          { ac_try='test -s "conftest.$ac_objext"'
12685   { (eval echo "$as_me:12685: \"$ac_try\"") >&5
12686   (eval $ac_try) 2>&5
12687   ac_status=$?
12688   echo "$as_me:12688: \$? = $ac_status" >&5
12689   (exit "$ac_status"); }; }; then
12690   :
12691 else
12692   echo "$as_me: failed program was:" >&5
12693 cat "conftest.$ac_ext" >&5
12694 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12695 fi
12696 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12697          fi
12698
12699 echo "${as_me:-configure}:12699: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12700
12701          CFLAGS="$cf_trim_CFLAGS"
12702          CPPFLAGS="$cf_trim_CPPFLAGS"
12703
12704         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12705         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12706
12707 echo "${as_me:-configure}:12707: testing if the second compile does not leave our definition intact error ..." 1>&5
12708
12709          cat >"conftest.$ac_ext" <<_ACEOF
12710 #line 12710 "configure"
12711 #include "confdefs.h"
12712 #include <sys/types.h>
12713 int
12714 main (void)
12715 {
12716
12717 #ifndef _POSIX_C_SOURCE
12718 make an error
12719 #endif
12720   ;
12721   return 0;
12722 }
12723 _ACEOF
12724 rm -f "conftest.$ac_objext"
12725 if { (eval echo "$as_me:12725: \"$ac_compile\"") >&5
12726   (eval $ac_compile) 2>&5
12727   ac_status=$?
12728   echo "$as_me:12728: \$? = $ac_status" >&5
12729   (exit "$ac_status"); } &&
12730          { ac_try='test -s "conftest.$ac_objext"'
12731   { (eval echo "$as_me:12731: \"$ac_try\"") >&5
12732   (eval $ac_try) 2>&5
12733   ac_status=$?
12734   echo "$as_me:12734: \$? = $ac_status" >&5
12735   (exit "$ac_status"); }; }; then
12736   :
12737 else
12738   echo "$as_me: failed program was:" >&5
12739 cat "conftest.$ac_ext" >&5
12740 cf_cv_posix_c_source=no
12741 fi
12742 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12743          CFLAGS="$cf_save_CFLAGS"
12744          CPPFLAGS="$cf_save_CPPFLAGS"
12745
12746 fi
12747 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12748
12749 fi
12750 echo "$as_me:12750: result: $cf_cv_posix_c_source" >&5
12751 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12752
12753 if test "$cf_cv_posix_c_source" != no ; then
12754         CFLAGS="$cf_trim_CFLAGS"
12755         CPPFLAGS="$cf_trim_CPPFLAGS"
12756
12757 cf_fix_cppflags=no
12758 cf_new_cflags=
12759 cf_new_cppflags=
12760 cf_new_extra_cppflags=
12761
12762 for cf_add_cflags in $cf_cv_posix_c_source
12763 do
12764 case "$cf_fix_cppflags" in
12765 (no)
12766         case "$cf_add_cflags" in
12767         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12768                 case "$cf_add_cflags" in
12769                 (-D*)
12770                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12771
12772                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12773                                 && test -z "${cf_tst_cflags}" \
12774                                 && cf_fix_cppflags=yes
12775
12776                         if test "$cf_fix_cppflags" = yes ; then
12777
12778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12780
12781                                 continue
12782                         elif test "${cf_tst_cflags}" = "\"'" ; then
12783
12784         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12785         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12786
12787                                 continue
12788                         fi
12789                         ;;
12790                 esac
12791                 case "$CPPFLAGS" in
12792                 (*$cf_add_cflags)
12793                         ;;
12794                 (*)
12795                         case "$cf_add_cflags" in
12796                         (-D*)
12797                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12798
12799 CPPFLAGS=`echo "$CPPFLAGS" | \
12800         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12801                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12802
12803                                 ;;
12804                         esac
12805
12806         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12807         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12808
12809                         ;;
12810                 esac
12811                 ;;
12812         (*)
12813
12814         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12815         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12816
12817                 ;;
12818         esac
12819         ;;
12820 (yes)
12821
12822         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12823         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12824
12825         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
12826
12827         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12828                 && test -z "${cf_tst_cflags}" \
12829                 && cf_fix_cppflags=no
12830         ;;
12831 esac
12832 done
12833
12834 if test -n "$cf_new_cflags" ; then
12835
12836         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12837         CFLAGS="${CFLAGS}$cf_new_cflags"
12838
12839 fi
12840
12841 if test -n "$cf_new_cppflags" ; then
12842
12843         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12844         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12845
12846 fi
12847
12848 if test -n "$cf_new_extra_cppflags" ; then
12849
12850         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12851         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12852
12853 fi
12854
12855 fi
12856
12857 fi # cf_cv_posix_visible
12858
12859         ;;
12860 (netbsd*)
12861         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
12862         ;;
12863 (openbsd[4-9]*)
12864         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
12865         cf_xopen_source="-D_BSD_SOURCE"
12866         cf_XOPEN_SOURCE=600
12867         ;;
12868 (openbsd*)
12869         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
12870         ;;
12871 (osf[45]*)
12872         cf_xopen_source="-D_OSF_SOURCE"
12873         ;;
12874 (nto-qnx*)
12875         cf_xopen_source="-D_QNX_SOURCE"
12876         ;;
12877 (sco*)
12878         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
12879         ;;
12880 (solaris2.*)
12881         cf_xopen_source="-D__EXTENSIONS__"
12882         cf_cv_xopen_source=broken
12883         ;;
12884 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
12885         cf_XOPEN_SOURCE=
12886         cf_POSIX_C_SOURCE=
12887         ;;
12888 (*)
12889
12890 echo "$as_me:12890: checking if we should define _XOPEN_SOURCE" >&5
12891 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12892 if test "${cf_cv_xopen_source+set}" = set; then
12893   echo $ECHO_N "(cached) $ECHO_C" >&6
12894 else
12895
12896         cat >"conftest.$ac_ext" <<_ACEOF
12897 #line 12897 "configure"
12898 #include "confdefs.h"
12899
12900 #include <stdlib.h>
12901 #include <string.h>
12902 #include <sys/types.h>
12903
12904 int
12905 main (void)
12906 {
12907
12908 #ifndef _XOPEN_SOURCE
12909 make an error
12910 #endif
12911   ;
12912   return 0;
12913 }
12914 _ACEOF
12915 rm -f "conftest.$ac_objext"
12916 if { (eval echo "$as_me:12916: \"$ac_compile\"") >&5
12917   (eval $ac_compile) 2>&5
12918   ac_status=$?
12919   echo "$as_me:12919: \$? = $ac_status" >&5
12920   (exit "$ac_status"); } &&
12921          { ac_try='test -s "conftest.$ac_objext"'
12922   { (eval echo "$as_me:12922: \"$ac_try\"") >&5
12923   (eval $ac_try) 2>&5
12924   ac_status=$?
12925   echo "$as_me:12925: \$? = $ac_status" >&5
12926   (exit "$ac_status"); }; }; then
12927   cf_cv_xopen_source=no
12928 else
12929   echo "$as_me: failed program was:" >&5
12930 cat "conftest.$ac_ext" >&5
12931 cf_save="$CPPFLAGS"
12932
12933         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12934         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12935
12936          cat >"conftest.$ac_ext" <<_ACEOF
12937 #line 12937 "configure"
12938 #include "confdefs.h"
12939
12940 #include <stdlib.h>
12941 #include <string.h>
12942 #include <sys/types.h>
12943
12944 int
12945 main (void)
12946 {
12947
12948 #ifdef _XOPEN_SOURCE
12949 make an error
12950 #endif
12951   ;
12952   return 0;
12953 }
12954 _ACEOF
12955 rm -f "conftest.$ac_objext"
12956 if { (eval echo "$as_me:12956: \"$ac_compile\"") >&5
12957   (eval $ac_compile) 2>&5
12958   ac_status=$?
12959   echo "$as_me:12959: \$? = $ac_status" >&5
12960   (exit "$ac_status"); } &&
12961          { ac_try='test -s "conftest.$ac_objext"'
12962   { (eval echo "$as_me:12962: \"$ac_try\"") >&5
12963   (eval $ac_try) 2>&5
12964   ac_status=$?
12965   echo "$as_me:12965: \$? = $ac_status" >&5
12966   (exit "$ac_status"); }; }; then
12967   cf_cv_xopen_source=no
12968 else
12969   echo "$as_me: failed program was:" >&5
12970 cat "conftest.$ac_ext" >&5
12971 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12972 fi
12973 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12974         CPPFLAGS="$cf_save"
12975
12976 fi
12977 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
12978
12979 fi
12980 echo "$as_me:12980: result: $cf_cv_xopen_source" >&5
12981 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12982
12983 if test "$cf_cv_xopen_source" != no ; then
12984
12985 CFLAGS=`echo "$CFLAGS" | \
12986         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12987                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12988
12989 CPPFLAGS=`echo "$CPPFLAGS" | \
12990         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12991                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12992
12993         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12994
12995 cf_fix_cppflags=no
12996 cf_new_cflags=
12997 cf_new_cppflags=
12998 cf_new_extra_cppflags=
12999
13000 for cf_add_cflags in $cf_temp_xopen_source
13001 do
13002 case "$cf_fix_cppflags" in
13003 (no)
13004         case "$cf_add_cflags" in
13005         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13006                 case "$cf_add_cflags" in
13007                 (-D*)
13008                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13009
13010                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13011                                 && test -z "${cf_tst_cflags}" \
13012                                 && cf_fix_cppflags=yes
13013
13014                         if test "$cf_fix_cppflags" = yes ; then
13015
13016         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13017         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13018
13019                                 continue
13020                         elif test "${cf_tst_cflags}" = "\"'" ; then
13021
13022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13024
13025                                 continue
13026                         fi
13027                         ;;
13028                 esac
13029                 case "$CPPFLAGS" in
13030                 (*$cf_add_cflags)
13031                         ;;
13032                 (*)
13033                         case "$cf_add_cflags" in
13034                         (-D*)
13035                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13036
13037 CPPFLAGS=`echo "$CPPFLAGS" | \
13038         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13039                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13040
13041                                 ;;
13042                         esac
13043
13044         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13045         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13046
13047                         ;;
13048                 esac
13049                 ;;
13050         (*)
13051
13052         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13053         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13054
13055                 ;;
13056         esac
13057         ;;
13058 (yes)
13059
13060         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13061         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13062
13063         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13064
13065         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13066                 && test -z "${cf_tst_cflags}" \
13067                 && cf_fix_cppflags=no
13068         ;;
13069 esac
13070 done
13071
13072 if test -n "$cf_new_cflags" ; then
13073
13074         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13075         CFLAGS="${CFLAGS}$cf_new_cflags"
13076
13077 fi
13078
13079 if test -n "$cf_new_cppflags" ; then
13080
13081         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13082         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13083
13084 fi
13085
13086 if test -n "$cf_new_extra_cppflags" ; then
13087
13088         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13089         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13090
13091 fi
13092
13093 fi
13094
13095 if test "$cf_cv_posix_visible" = no; then
13096
13097 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
13098
13099 cf_save_CFLAGS="$CFLAGS"
13100 cf_save_CPPFLAGS="$CPPFLAGS"
13101
13102 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
13103         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13104                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13105
13106 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
13107         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
13108                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
13109
13110 echo "$as_me:13110: checking if we should define _POSIX_C_SOURCE" >&5
13111 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
13112 if test "${cf_cv_posix_c_source+set}" = set; then
13113   echo $ECHO_N "(cached) $ECHO_C" >&6
13114 else
13115
13116 echo "${as_me:-configure}:13116: testing if the symbol is already defined go no further ..." 1>&5
13117
13118         cat >"conftest.$ac_ext" <<_ACEOF
13119 #line 13119 "configure"
13120 #include "confdefs.h"
13121 #include <sys/types.h>
13122 int
13123 main (void)
13124 {
13125
13126 #ifndef _POSIX_C_SOURCE
13127 make an error
13128 #endif
13129   ;
13130   return 0;
13131 }
13132 _ACEOF
13133 rm -f "conftest.$ac_objext"
13134 if { (eval echo "$as_me:13134: \"$ac_compile\"") >&5
13135   (eval $ac_compile) 2>&5
13136   ac_status=$?
13137   echo "$as_me:13137: \$? = $ac_status" >&5
13138   (exit "$ac_status"); } &&
13139          { ac_try='test -s "conftest.$ac_objext"'
13140   { (eval echo "$as_me:13140: \"$ac_try\"") >&5
13141   (eval $ac_try) 2>&5
13142   ac_status=$?
13143   echo "$as_me:13143: \$? = $ac_status" >&5
13144   (exit "$ac_status"); }; }; then
13145   cf_cv_posix_c_source=no
13146 else
13147   echo "$as_me: failed program was:" >&5
13148 cat "conftest.$ac_ext" >&5
13149 cf_want_posix_source=no
13150          case .$cf_POSIX_C_SOURCE in
13151          (.[12]??*)
13152                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13153                 ;;
13154          (.2)
13155                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
13156                 cf_want_posix_source=yes
13157                 ;;
13158          (.*)
13159                 cf_want_posix_source=yes
13160                 ;;
13161          esac
13162          if test "$cf_want_posix_source" = yes ; then
13163                 cat >"conftest.$ac_ext" <<_ACEOF
13164 #line 13164 "configure"
13165 #include "confdefs.h"
13166 #include <sys/types.h>
13167 int
13168 main (void)
13169 {
13170
13171 #ifdef _POSIX_SOURCE
13172 make an error
13173 #endif
13174   ;
13175   return 0;
13176 }
13177 _ACEOF
13178 rm -f "conftest.$ac_objext"
13179 if { (eval echo "$as_me:13179: \"$ac_compile\"") >&5
13180   (eval $ac_compile) 2>&5
13181   ac_status=$?
13182   echo "$as_me:13182: \$? = $ac_status" >&5
13183   (exit "$ac_status"); } &&
13184          { ac_try='test -s "conftest.$ac_objext"'
13185   { (eval echo "$as_me:13185: \"$ac_try\"") >&5
13186   (eval $ac_try) 2>&5
13187   ac_status=$?
13188   echo "$as_me:13188: \$? = $ac_status" >&5
13189   (exit "$ac_status"); }; }; then
13190   :
13191 else
13192   echo "$as_me: failed program was:" >&5
13193 cat "conftest.$ac_ext" >&5
13194 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
13195 fi
13196 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13197          fi
13198
13199 echo "${as_me:-configure}:13199: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
13200
13201          CFLAGS="$cf_trim_CFLAGS"
13202          CPPFLAGS="$cf_trim_CPPFLAGS"
13203
13204         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13205         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
13206
13207 echo "${as_me:-configure}:13207: testing if the second compile does not leave our definition intact error ..." 1>&5
13208
13209          cat >"conftest.$ac_ext" <<_ACEOF
13210 #line 13210 "configure"
13211 #include "confdefs.h"
13212 #include <sys/types.h>
13213 int
13214 main (void)
13215 {
13216
13217 #ifndef _POSIX_C_SOURCE
13218 make an error
13219 #endif
13220   ;
13221   return 0;
13222 }
13223 _ACEOF
13224 rm -f "conftest.$ac_objext"
13225 if { (eval echo "$as_me:13225: \"$ac_compile\"") >&5
13226   (eval $ac_compile) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit "$ac_status"); } &&
13230          { ac_try='test -s "conftest.$ac_objext"'
13231   { (eval echo "$as_me:13231: \"$ac_try\"") >&5
13232   (eval $ac_try) 2>&5
13233   ac_status=$?
13234   echo "$as_me:13234: \$? = $ac_status" >&5
13235   (exit "$ac_status"); }; }; then
13236   :
13237 else
13238   echo "$as_me: failed program was:" >&5
13239 cat "conftest.$ac_ext" >&5
13240 cf_cv_posix_c_source=no
13241 fi
13242 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13243          CFLAGS="$cf_save_CFLAGS"
13244          CPPFLAGS="$cf_save_CPPFLAGS"
13245
13246 fi
13247 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13248
13249 fi
13250 echo "$as_me:13250: result: $cf_cv_posix_c_source" >&5
13251 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
13252
13253 if test "$cf_cv_posix_c_source" != no ; then
13254         CFLAGS="$cf_trim_CFLAGS"
13255         CPPFLAGS="$cf_trim_CPPFLAGS"
13256
13257 cf_fix_cppflags=no
13258 cf_new_cflags=
13259 cf_new_cppflags=
13260 cf_new_extra_cppflags=
13261
13262 for cf_add_cflags in $cf_cv_posix_c_source
13263 do
13264 case "$cf_fix_cppflags" in
13265 (no)
13266         case "$cf_add_cflags" in
13267         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13268                 case "$cf_add_cflags" in
13269                 (-D*)
13270                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13271
13272                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13273                                 && test -z "${cf_tst_cflags}" \
13274                                 && cf_fix_cppflags=yes
13275
13276                         if test "$cf_fix_cppflags" = yes ; then
13277
13278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13280
13281                                 continue
13282                         elif test "${cf_tst_cflags}" = "\"'" ; then
13283
13284         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13285         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13286
13287                                 continue
13288                         fi
13289                         ;;
13290                 esac
13291                 case "$CPPFLAGS" in
13292                 (*$cf_add_cflags)
13293                         ;;
13294                 (*)
13295                         case "$cf_add_cflags" in
13296                         (-D*)
13297                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13298
13299 CPPFLAGS=`echo "$CPPFLAGS" | \
13300         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13301                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13302
13303                                 ;;
13304                         esac
13305
13306         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13307         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13308
13309                         ;;
13310                 esac
13311                 ;;
13312         (*)
13313
13314         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13315         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13316
13317                 ;;
13318         esac
13319         ;;
13320 (yes)
13321
13322         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13323         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13324
13325         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13326
13327         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13328                 && test -z "${cf_tst_cflags}" \
13329                 && cf_fix_cppflags=no
13330         ;;
13331 esac
13332 done
13333
13334 if test -n "$cf_new_cflags" ; then
13335
13336         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13337         CFLAGS="${CFLAGS}$cf_new_cflags"
13338
13339 fi
13340
13341 if test -n "$cf_new_cppflags" ; then
13342
13343         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13344         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13345
13346 fi
13347
13348 if test -n "$cf_new_extra_cppflags" ; then
13349
13350         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13351         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13352
13353 fi
13354
13355 fi
13356
13357 fi # cf_cv_posix_visible
13358
13359         ;;
13360 esac
13361
13362 if test -n "$cf_xopen_source" ; then
13363
13364 cf_fix_cppflags=no
13365 cf_new_cflags=
13366 cf_new_cppflags=
13367 cf_new_extra_cppflags=
13368
13369 for cf_add_cflags in $cf_xopen_source
13370 do
13371 case "$cf_fix_cppflags" in
13372 (no)
13373         case "$cf_add_cflags" in
13374         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13375                 case "$cf_add_cflags" in
13376                 (-D*)
13377                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13378
13379                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13380                                 && test -z "${cf_tst_cflags}" \
13381                                 && cf_fix_cppflags=yes
13382
13383                         if test "$cf_fix_cppflags" = yes ; then
13384
13385         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13386         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13387
13388                                 continue
13389                         elif test "${cf_tst_cflags}" = "\"'" ; then
13390
13391         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13392         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13393
13394                                 continue
13395                         fi
13396                         ;;
13397                 esac
13398                 case "$CPPFLAGS" in
13399                 (*$cf_add_cflags)
13400                         ;;
13401                 (*)
13402                         case "$cf_add_cflags" in
13403                         (-D*)
13404                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13405
13406 CPPFLAGS=`echo "$CPPFLAGS" | \
13407         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13408                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13409
13410                                 ;;
13411                         esac
13412
13413         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13414         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13415
13416                         ;;
13417                 esac
13418                 ;;
13419         (*)
13420
13421         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13422         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13423
13424                 ;;
13425         esac
13426         ;;
13427 (yes)
13428
13429         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13430         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13431
13432         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13433
13434         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13435                 && test -z "${cf_tst_cflags}" \
13436                 && cf_fix_cppflags=no
13437         ;;
13438 esac
13439 done
13440
13441 if test -n "$cf_new_cflags" ; then
13442         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13443
13444 echo "${as_me:-configure}:13444: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13445
13446         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13447         CFLAGS="${CFLAGS}$cf_new_cflags"
13448
13449 fi
13450
13451 if test -n "$cf_new_cppflags" ; then
13452         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13453
13454 echo "${as_me:-configure}:13454: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13455
13456         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13457         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13458
13459 fi
13460
13461 if test -n "$cf_new_extra_cppflags" ; then
13462         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13463
13464 echo "${as_me:-configure}:13464: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13465
13466         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13467         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13468
13469 fi
13470
13471 fi
13472
13473 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
13474         echo "$as_me:13474: checking if _XOPEN_SOURCE really is set" >&5
13475 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
13476         cat >"conftest.$ac_ext" <<_ACEOF
13477 #line 13477 "configure"
13478 #include "confdefs.h"
13479 #include <stdlib.h>
13480 int
13481 main (void)
13482 {
13483
13484 #ifndef _XOPEN_SOURCE
13485 make an error
13486 #endif
13487   ;
13488   return 0;
13489 }
13490 _ACEOF
13491 rm -f "conftest.$ac_objext"
13492 if { (eval echo "$as_me:13492: \"$ac_compile\"") >&5
13493   (eval $ac_compile) 2>&5
13494   ac_status=$?
13495   echo "$as_me:13495: \$? = $ac_status" >&5
13496   (exit "$ac_status"); } &&
13497          { ac_try='test -s "conftest.$ac_objext"'
13498   { (eval echo "$as_me:13498: \"$ac_try\"") >&5
13499   (eval $ac_try) 2>&5
13500   ac_status=$?
13501   echo "$as_me:13501: \$? = $ac_status" >&5
13502   (exit "$ac_status"); }; }; then
13503   cf_XOPEN_SOURCE_set=yes
13504 else
13505   echo "$as_me: failed program was:" >&5
13506 cat "conftest.$ac_ext" >&5
13507 cf_XOPEN_SOURCE_set=no
13508 fi
13509 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13510         echo "$as_me:13510: result: $cf_XOPEN_SOURCE_set" >&5
13511 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
13512         if test "$cf_XOPEN_SOURCE_set" = yes
13513         then
13514                 cat >"conftest.$ac_ext" <<_ACEOF
13515 #line 13515 "configure"
13516 #include "confdefs.h"
13517 #include <stdlib.h>
13518 int
13519 main (void)
13520 {
13521
13522 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
13523 make an error
13524 #endif
13525   ;
13526   return 0;
13527 }
13528 _ACEOF
13529 rm -f "conftest.$ac_objext"
13530 if { (eval echo "$as_me:13530: \"$ac_compile\"") >&5
13531   (eval $ac_compile) 2>&5
13532   ac_status=$?
13533   echo "$as_me:13533: \$? = $ac_status" >&5
13534   (exit "$ac_status"); } &&
13535          { ac_try='test -s "conftest.$ac_objext"'
13536   { (eval echo "$as_me:13536: \"$ac_try\"") >&5
13537   (eval $ac_try) 2>&5
13538   ac_status=$?
13539   echo "$as_me:13539: \$? = $ac_status" >&5
13540   (exit "$ac_status"); }; }; then
13541   cf_XOPEN_SOURCE_set_ok=yes
13542 else
13543   echo "$as_me: failed program was:" >&5
13544 cat "conftest.$ac_ext" >&5
13545 cf_XOPEN_SOURCE_set_ok=no
13546 fi
13547 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13548                 if test "$cf_XOPEN_SOURCE_set_ok" = no
13549                 then
13550                         { echo "$as_me:13550: WARNING: _XOPEN_SOURCE is lower than requested" >&5
13551 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
13552                 fi
13553         else
13554
13555 echo "$as_me:13555: checking if we should define _XOPEN_SOURCE" >&5
13556 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
13557 if test "${cf_cv_xopen_source+set}" = set; then
13558   echo $ECHO_N "(cached) $ECHO_C" >&6
13559 else
13560
13561         cat >"conftest.$ac_ext" <<_ACEOF
13562 #line 13562 "configure"
13563 #include "confdefs.h"
13564
13565 #include <stdlib.h>
13566 #include <string.h>
13567 #include <sys/types.h>
13568
13569 int
13570 main (void)
13571 {
13572
13573 #ifndef _XOPEN_SOURCE
13574 make an error
13575 #endif
13576   ;
13577   return 0;
13578 }
13579 _ACEOF
13580 rm -f "conftest.$ac_objext"
13581 if { (eval echo "$as_me:13581: \"$ac_compile\"") >&5
13582   (eval $ac_compile) 2>&5
13583   ac_status=$?
13584   echo "$as_me:13584: \$? = $ac_status" >&5
13585   (exit "$ac_status"); } &&
13586          { ac_try='test -s "conftest.$ac_objext"'
13587   { (eval echo "$as_me:13587: \"$ac_try\"") >&5
13588   (eval $ac_try) 2>&5
13589   ac_status=$?
13590   echo "$as_me:13590: \$? = $ac_status" >&5
13591   (exit "$ac_status"); }; }; then
13592   cf_cv_xopen_source=no
13593 else
13594   echo "$as_me: failed program was:" >&5
13595 cat "conftest.$ac_ext" >&5
13596 cf_save="$CPPFLAGS"
13597
13598         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13599         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
13600
13601          cat >"conftest.$ac_ext" <<_ACEOF
13602 #line 13602 "configure"
13603 #include "confdefs.h"
13604
13605 #include <stdlib.h>
13606 #include <string.h>
13607 #include <sys/types.h>
13608
13609 int
13610 main (void)
13611 {
13612
13613 #ifdef _XOPEN_SOURCE
13614 make an error
13615 #endif
13616   ;
13617   return 0;
13618 }
13619 _ACEOF
13620 rm -f "conftest.$ac_objext"
13621 if { (eval echo "$as_me:13621: \"$ac_compile\"") >&5
13622   (eval $ac_compile) 2>&5
13623   ac_status=$?
13624   echo "$as_me:13624: \$? = $ac_status" >&5
13625   (exit "$ac_status"); } &&
13626          { ac_try='test -s "conftest.$ac_objext"'
13627   { (eval echo "$as_me:13627: \"$ac_try\"") >&5
13628   (eval $ac_try) 2>&5
13629   ac_status=$?
13630   echo "$as_me:13630: \$? = $ac_status" >&5
13631   (exit "$ac_status"); }; }; then
13632   cf_cv_xopen_source=no
13633 else
13634   echo "$as_me: failed program was:" >&5
13635 cat "conftest.$ac_ext" >&5
13636 cf_cv_xopen_source=$cf_XOPEN_SOURCE
13637 fi
13638 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13639         CPPFLAGS="$cf_save"
13640
13641 fi
13642 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13643
13644 fi
13645 echo "$as_me:13645: result: $cf_cv_xopen_source" >&5
13646 echo "${ECHO_T}$cf_cv_xopen_source" >&6
13647
13648 if test "$cf_cv_xopen_source" != no ; then
13649
13650 CFLAGS=`echo "$CFLAGS" | \
13651         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13652                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13653
13654 CPPFLAGS=`echo "$CPPFLAGS" | \
13655         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
13656                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
13657
13658         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
13659
13660 cf_fix_cppflags=no
13661 cf_new_cflags=
13662 cf_new_cppflags=
13663 cf_new_extra_cppflags=
13664
13665 for cf_add_cflags in $cf_temp_xopen_source
13666 do
13667 case "$cf_fix_cppflags" in
13668 (no)
13669         case "$cf_add_cflags" in
13670         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13671                 case "$cf_add_cflags" in
13672                 (-D*)
13673                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13674
13675                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13676                                 && test -z "${cf_tst_cflags}" \
13677                                 && cf_fix_cppflags=yes
13678
13679                         if test "$cf_fix_cppflags" = yes ; then
13680
13681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13683
13684                                 continue
13685                         elif test "${cf_tst_cflags}" = "\"'" ; then
13686
13687         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13688         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13689
13690                                 continue
13691                         fi
13692                         ;;
13693                 esac
13694                 case "$CPPFLAGS" in
13695                 (*$cf_add_cflags)
13696                         ;;
13697                 (*)
13698                         case "$cf_add_cflags" in
13699                         (-D*)
13700                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13701
13702 CPPFLAGS=`echo "$CPPFLAGS" | \
13703         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13704                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13705
13706                                 ;;
13707                         esac
13708
13709         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13710         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13711
13712                         ;;
13713                 esac
13714                 ;;
13715         (*)
13716
13717         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13718         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13719
13720                 ;;
13721         esac
13722         ;;
13723 (yes)
13724
13725         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13726         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13727
13728         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
13729
13730         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13731                 && test -z "${cf_tst_cflags}" \
13732                 && cf_fix_cppflags=no
13733         ;;
13734 esac
13735 done
13736
13737 if test -n "$cf_new_cflags" ; then
13738
13739         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13740         CFLAGS="${CFLAGS}$cf_new_cflags"
13741
13742 fi
13743
13744 if test -n "$cf_new_cppflags" ; then
13745
13746         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13747         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13748
13749 fi
13750
13751 if test -n "$cf_new_extra_cppflags" ; then
13752
13753         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13754         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13755
13756 fi
13757
13758 fi
13759
13760         fi
13761 fi
13762 fi # cf_cv_posix_visible
13763
13764 # Check whether --enable-largefile or --disable-largefile was given.
13765 if test "${enable_largefile+set}" = set; then
13766   enableval="$enable_largefile"
13767
13768 fi;
13769 if test "$enable_largefile" != no; then
13770
13771   echo "$as_me:13771: checking for special C compiler options needed for large files" >&5
13772 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
13773 if test "${ac_cv_sys_largefile_CC+set}" = set; then
13774   echo $ECHO_N "(cached) $ECHO_C" >&6
13775 else
13776   ac_cv_sys_largefile_CC=no
13777      if test "$GCC" != yes; then
13778        ac_save_CC=$CC
13779        while :; do
13780          # IRIX 6.2 and later do not support large files by default,
13781          # so use the C compiler's -n32 option if that helps.
13782          cat >"conftest.$ac_ext" <<_ACEOF
13783 #line 13783 "configure"
13784 #include "confdefs.h"
13785 #include <sys/types.h>
13786  /* Check that off_t can represent 2**63 - 1 correctly.
13787     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13788     since some C++ compilers masquerading as C compilers
13789     incorrectly reject 9223372036854775807.  */
13790 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13791   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13792                        && LARGE_OFF_T % 2147483647 == 1)
13793                       ? 1 : -1];
13794 int
13795 main (void)
13796 {
13797
13798   ;
13799   return 0;
13800 }
13801 _ACEOF
13802          rm -f "conftest.$ac_objext"
13803 if { (eval echo "$as_me:13803: \"$ac_compile\"") >&5
13804   (eval $ac_compile) 2>&5
13805   ac_status=$?
13806   echo "$as_me:13806: \$? = $ac_status" >&5
13807   (exit "$ac_status"); } &&
13808          { ac_try='test -s "conftest.$ac_objext"'
13809   { (eval echo "$as_me:13809: \"$ac_try\"") >&5
13810   (eval $ac_try) 2>&5
13811   ac_status=$?
13812   echo "$as_me:13812: \$? = $ac_status" >&5
13813   (exit "$ac_status"); }; }; then
13814   break
13815 else
13816   echo "$as_me: failed program was:" >&5
13817 cat "conftest.$ac_ext" >&5
13818 fi
13819 rm -f "conftest.$ac_objext"
13820          CC="$CC -n32"
13821          rm -f "conftest.$ac_objext"
13822 if { (eval echo "$as_me:13822: \"$ac_compile\"") >&5
13823   (eval $ac_compile) 2>&5
13824   ac_status=$?
13825   echo "$as_me:13825: \$? = $ac_status" >&5
13826   (exit "$ac_status"); } &&
13827          { ac_try='test -s "conftest.$ac_objext"'
13828   { (eval echo "$as_me:13828: \"$ac_try\"") >&5
13829   (eval $ac_try) 2>&5
13830   ac_status=$?
13831   echo "$as_me:13831: \$? = $ac_status" >&5
13832   (exit "$ac_status"); }; }; then
13833   ac_cv_sys_largefile_CC=' -n32'; break
13834 else
13835   echo "$as_me: failed program was:" >&5
13836 cat "conftest.$ac_ext" >&5
13837 fi
13838 rm -f "conftest.$ac_objext"
13839          break
13840        done
13841        CC=$ac_save_CC
13842        rm -f "conftest.$ac_ext"
13843     fi
13844 fi
13845 echo "$as_me:13845: result: $ac_cv_sys_largefile_CC" >&5
13846 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
13847   if test "$ac_cv_sys_largefile_CC" != no; then
13848     CC=$CC$ac_cv_sys_largefile_CC
13849   fi
13850
13851   echo "$as_me:13851: checking for _FILE_OFFSET_BITS value needed for large files" >&5
13852 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
13853 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
13854   echo $ECHO_N "(cached) $ECHO_C" >&6
13855 else
13856   while :; do
13857   ac_cv_sys_file_offset_bits=no
13858   cat >"conftest.$ac_ext" <<_ACEOF
13859 #line 13859 "configure"
13860 #include "confdefs.h"
13861 #include <sys/types.h>
13862  /* Check that off_t can represent 2**63 - 1 correctly.
13863     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13864     since some C++ compilers masquerading as C compilers
13865     incorrectly reject 9223372036854775807.  */
13866 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13867   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13868                        && LARGE_OFF_T % 2147483647 == 1)
13869                       ? 1 : -1];
13870 int
13871 main (void)
13872 {
13873
13874   ;
13875   return 0;
13876 }
13877 _ACEOF
13878 rm -f "conftest.$ac_objext"
13879 if { (eval echo "$as_me:13879: \"$ac_compile\"") >&5
13880   (eval $ac_compile) 2>&5
13881   ac_status=$?
13882   echo "$as_me:13882: \$? = $ac_status" >&5
13883   (exit "$ac_status"); } &&
13884          { ac_try='test -s "conftest.$ac_objext"'
13885   { (eval echo "$as_me:13885: \"$ac_try\"") >&5
13886   (eval $ac_try) 2>&5
13887   ac_status=$?
13888   echo "$as_me:13888: \$? = $ac_status" >&5
13889   (exit "$ac_status"); }; }; then
13890   break
13891 else
13892   echo "$as_me: failed program was:" >&5
13893 cat "conftest.$ac_ext" >&5
13894 fi
13895 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13896   cat >"conftest.$ac_ext" <<_ACEOF
13897 #line 13897 "configure"
13898 #include "confdefs.h"
13899 #define _FILE_OFFSET_BITS 64
13900 #include <sys/types.h>
13901  /* Check that off_t can represent 2**63 - 1 correctly.
13902     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13903     since some C++ compilers masquerading as C compilers
13904     incorrectly reject 9223372036854775807.  */
13905 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13906   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13907                        && LARGE_OFF_T % 2147483647 == 1)
13908                       ? 1 : -1];
13909 int
13910 main (void)
13911 {
13912
13913   ;
13914   return 0;
13915 }
13916 _ACEOF
13917 rm -f "conftest.$ac_objext"
13918 if { (eval echo "$as_me:13918: \"$ac_compile\"") >&5
13919   (eval $ac_compile) 2>&5
13920   ac_status=$?
13921   echo "$as_me:13921: \$? = $ac_status" >&5
13922   (exit "$ac_status"); } &&
13923          { ac_try='test -s "conftest.$ac_objext"'
13924   { (eval echo "$as_me:13924: \"$ac_try\"") >&5
13925   (eval $ac_try) 2>&5
13926   ac_status=$?
13927   echo "$as_me:13927: \$? = $ac_status" >&5
13928   (exit "$ac_status"); }; }; then
13929   ac_cv_sys_file_offset_bits=64; break
13930 else
13931   echo "$as_me: failed program was:" >&5
13932 cat "conftest.$ac_ext" >&5
13933 fi
13934 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13935   break
13936 done
13937 fi
13938 echo "$as_me:13938: result: $ac_cv_sys_file_offset_bits" >&5
13939 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
13940 if test "$ac_cv_sys_file_offset_bits" != no; then
13941
13942 cat >>confdefs.h <<EOF
13943 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
13944 EOF
13945
13946 fi
13947 rm -rf conftest*
13948   echo "$as_me:13948: checking for _LARGE_FILES value needed for large files" >&5
13949 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
13950 if test "${ac_cv_sys_large_files+set}" = set; then
13951   echo $ECHO_N "(cached) $ECHO_C" >&6
13952 else
13953   while :; do
13954   ac_cv_sys_large_files=no
13955   cat >"conftest.$ac_ext" <<_ACEOF
13956 #line 13956 "configure"
13957 #include "confdefs.h"
13958 #include <sys/types.h>
13959  /* Check that off_t can represent 2**63 - 1 correctly.
13960     We can't simply define LARGE_OFF_T to be 9223372036854775807,
13961     since some C++ compilers masquerading as C compilers
13962     incorrectly reject 9223372036854775807.  */
13963 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
13964   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
13965                        && LARGE_OFF_T % 2147483647 == 1)
13966                       ? 1 : -1];
13967 int
13968 main (void)
13969 {
13970
13971   ;
13972   return 0;
13973 }
13974 _ACEOF
13975 rm -f "conftest.$ac_objext"
13976 if { (eval echo "$as_me:13976: \"$ac_compile\"") >&5
13977   (eval $ac_compile) 2>&5
13978   ac_status=$?
13979   echo "$as_me:13979: \$? = $ac_status" >&5
13980   (exit "$ac_status"); } &&
13981          { ac_try='test -s "conftest.$ac_objext"'
13982   { (eval echo "$as_me:13982: \"$ac_try\"") >&5
13983   (eval $ac_try) 2>&5
13984   ac_status=$?
13985   echo "$as_me:13985: \$? = $ac_status" >&5
13986   (exit "$ac_status"); }; }; then
13987   break
13988 else
13989   echo "$as_me: failed program was:" >&5
13990 cat "conftest.$ac_ext" >&5
13991 fi
13992 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
13993   cat >"conftest.$ac_ext" <<_ACEOF
13994 #line 13994 "configure"
13995 #include "confdefs.h"
13996 #define _LARGE_FILES 1
13997 #include <sys/types.h>
13998  /* Check that off_t can represent 2**63 - 1 correctly.
13999     We can't simply define LARGE_OFF_T to be 9223372036854775807,
14000     since some C++ compilers masquerading as C compilers
14001     incorrectly reject 9223372036854775807.  */
14002 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
14003   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
14004                        && LARGE_OFF_T % 2147483647 == 1)
14005                       ? 1 : -1];
14006 int
14007 main (void)
14008 {
14009
14010   ;
14011   return 0;
14012 }
14013 _ACEOF
14014 rm -f "conftest.$ac_objext"
14015 if { (eval echo "$as_me:14015: \"$ac_compile\"") >&5
14016   (eval $ac_compile) 2>&5
14017   ac_status=$?
14018   echo "$as_me:14018: \$? = $ac_status" >&5
14019   (exit "$ac_status"); } &&
14020          { ac_try='test -s "conftest.$ac_objext"'
14021   { (eval echo "$as_me:14021: \"$ac_try\"") >&5
14022   (eval $ac_try) 2>&5
14023   ac_status=$?
14024   echo "$as_me:14024: \$? = $ac_status" >&5
14025   (exit "$ac_status"); }; }; then
14026   ac_cv_sys_large_files=1; break
14027 else
14028   echo "$as_me: failed program was:" >&5
14029 cat "conftest.$ac_ext" >&5
14030 fi
14031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14032   break
14033 done
14034 fi
14035 echo "$as_me:14035: result: $ac_cv_sys_large_files" >&5
14036 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
14037 if test "$ac_cv_sys_large_files" != no; then
14038
14039 cat >>confdefs.h <<EOF
14040 #define _LARGE_FILES $ac_cv_sys_large_files
14041 EOF
14042
14043 fi
14044 rm -rf conftest*
14045 fi
14046
14047         if test "$enable_largefile" != no ; then
14048         echo "$as_me:14048: checking for _LARGEFILE_SOURCE value needed for large files" >&5
14049 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
14050 if test "${ac_cv_sys_largefile_source+set}" = set; then
14051   echo $ECHO_N "(cached) $ECHO_C" >&6
14052 else
14053   while :; do
14054   ac_cv_sys_largefile_source=no
14055   cat >"conftest.$ac_ext" <<_ACEOF
14056 #line 14056 "configure"
14057 #include "confdefs.h"
14058 #include <stdio.h>
14059 int
14060 main (void)
14061 {
14062 return !fseeko;
14063   ;
14064   return 0;
14065 }
14066 _ACEOF
14067 rm -f "conftest.$ac_objext"
14068 if { (eval echo "$as_me:14068: \"$ac_compile\"") >&5
14069   (eval $ac_compile) 2>&5
14070   ac_status=$?
14071   echo "$as_me:14071: \$? = $ac_status" >&5
14072   (exit "$ac_status"); } &&
14073          { ac_try='test -s "conftest.$ac_objext"'
14074   { (eval echo "$as_me:14074: \"$ac_try\"") >&5
14075   (eval $ac_try) 2>&5
14076   ac_status=$?
14077   echo "$as_me:14077: \$? = $ac_status" >&5
14078   (exit "$ac_status"); }; }; then
14079   break
14080 else
14081   echo "$as_me: failed program was:" >&5
14082 cat "conftest.$ac_ext" >&5
14083 fi
14084 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14085   cat >"conftest.$ac_ext" <<_ACEOF
14086 #line 14086 "configure"
14087 #include "confdefs.h"
14088 #define _LARGEFILE_SOURCE 1
14089 #include <stdio.h>
14090 int
14091 main (void)
14092 {
14093 return !fseeko;
14094   ;
14095   return 0;
14096 }
14097 _ACEOF
14098 rm -f "conftest.$ac_objext"
14099 if { (eval echo "$as_me:14099: \"$ac_compile\"") >&5
14100   (eval $ac_compile) 2>&5
14101   ac_status=$?
14102   echo "$as_me:14102: \$? = $ac_status" >&5
14103   (exit "$ac_status"); } &&
14104          { ac_try='test -s "conftest.$ac_objext"'
14105   { (eval echo "$as_me:14105: \"$ac_try\"") >&5
14106   (eval $ac_try) 2>&5
14107   ac_status=$?
14108   echo "$as_me:14108: \$? = $ac_status" >&5
14109   (exit "$ac_status"); }; }; then
14110   ac_cv_sys_largefile_source=1; break
14111 else
14112   echo "$as_me: failed program was:" >&5
14113 cat "conftest.$ac_ext" >&5
14114 fi
14115 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14116   break
14117 done
14118 fi
14119 echo "$as_me:14119: result: $ac_cv_sys_largefile_source" >&5
14120 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
14121 if test "$ac_cv_sys_largefile_source" != no; then
14122
14123 cat >>confdefs.h <<EOF
14124 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
14125 EOF
14126
14127 fi
14128 rm -rf conftest*
14129
14130 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
14131 # in glibc 2.1.3, but that breaks too many other things.
14132 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
14133 echo "$as_me:14133: checking for fseeko" >&5
14134 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
14135 if test "${ac_cv_func_fseeko+set}" = set; then
14136   echo $ECHO_N "(cached) $ECHO_C" >&6
14137 else
14138   cat >"conftest.$ac_ext" <<_ACEOF
14139 #line 14139 "configure"
14140 #include "confdefs.h"
14141 #include <stdio.h>
14142 int
14143 main (void)
14144 {
14145 return fseeko && fseeko (stdin, 0, 0);
14146   ;
14147   return 0;
14148 }
14149 _ACEOF
14150 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14151 if { (eval echo "$as_me:14151: \"$ac_link\"") >&5
14152   (eval $ac_link) 2>&5
14153   ac_status=$?
14154   echo "$as_me:14154: \$? = $ac_status" >&5
14155   (exit "$ac_status"); } &&
14156          { ac_try='test -s "conftest$ac_exeext"'
14157   { (eval echo "$as_me:14157: \"$ac_try\"") >&5
14158   (eval $ac_try) 2>&5
14159   ac_status=$?
14160   echo "$as_me:14160: \$? = $ac_status" >&5
14161   (exit "$ac_status"); }; }; then
14162   ac_cv_func_fseeko=yes
14163 else
14164   echo "$as_me: failed program was:" >&5
14165 cat "conftest.$ac_ext" >&5
14166 ac_cv_func_fseeko=no
14167 fi
14168 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14169 fi
14170 echo "$as_me:14170: result: $ac_cv_func_fseeko" >&5
14171 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
14172 if test $ac_cv_func_fseeko = yes; then
14173
14174 cat >>confdefs.h <<\EOF
14175 #define HAVE_FSEEKO 1
14176 EOF
14177
14178 fi
14179
14180         # Normally we would collect these definitions in the config.h,
14181         # but (like _XOPEN_SOURCE), some environments rely on having these
14182         # defined before any of the system headers are included.  Another
14183         # case comes up with C++, e.g., on AIX the compiler compiles the
14184         # header files by themselves before looking at the body files it is
14185         # told to compile.  For ncurses, those header files do not include
14186         # the config.h
14187         if test "$ac_cv_sys_large_files" != no
14188         then
14189
14190         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14191         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
14192
14193         fi
14194         if test "$ac_cv_sys_largefile_source" != no
14195         then
14196
14197         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14198         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
14199
14200         fi
14201         if test "$ac_cv_sys_file_offset_bits" != no
14202         then
14203
14204         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14205         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
14206
14207         fi
14208
14209         echo "$as_me:14209: checking whether to use struct dirent64" >&5
14210 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
14211 if test "${cf_cv_struct_dirent64+set}" = set; then
14212   echo $ECHO_N "(cached) $ECHO_C" >&6
14213 else
14214
14215                 cat >"conftest.$ac_ext" <<_ACEOF
14216 #line 14216 "configure"
14217 #include "confdefs.h"
14218
14219 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
14220 #include <sys/types.h>
14221 #include <dirent.h>
14222
14223 int
14224 main (void)
14225 {
14226
14227                 /* if transitional largefile support is setup, this is true */
14228                 extern struct dirent64 * readdir(DIR *);
14229                 struct dirent64 *x = readdir((DIR *)0);
14230                 struct dirent *y = readdir((DIR *)0);
14231                 int z = x - y;
14232                 (void)z;
14233
14234   ;
14235   return 0;
14236 }
14237 _ACEOF
14238 rm -f "conftest.$ac_objext"
14239 if { (eval echo "$as_me:14239: \"$ac_compile\"") >&5
14240   (eval $ac_compile) 2>&5
14241   ac_status=$?
14242   echo "$as_me:14242: \$? = $ac_status" >&5
14243   (exit "$ac_status"); } &&
14244          { ac_try='test -s "conftest.$ac_objext"'
14245   { (eval echo "$as_me:14245: \"$ac_try\"") >&5
14246   (eval $ac_try) 2>&5
14247   ac_status=$?
14248   echo "$as_me:14248: \$? = $ac_status" >&5
14249   (exit "$ac_status"); }; }; then
14250   cf_cv_struct_dirent64=yes
14251 else
14252   echo "$as_me: failed program was:" >&5
14253 cat "conftest.$ac_ext" >&5
14254 cf_cv_struct_dirent64=no
14255 fi
14256 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14257
14258 fi
14259 echo "$as_me:14259: result: $cf_cv_struct_dirent64" >&5
14260 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
14261         test "$cf_cv_struct_dirent64" = yes &&
14262 cat >>confdefs.h <<\EOF
14263 #define HAVE_STRUCT_DIRENT64 1
14264 EOF
14265
14266         fi
14267
14268 ### Enable compiling-in rcs id's
14269 echo "$as_me:14269: checking if RCS identifiers should be compiled-in" >&5
14270 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
14271
14272 # Check whether --with-rcs-ids or --without-rcs-ids was given.
14273 if test "${with_rcs_ids+set}" = set; then
14274   withval="$with_rcs_ids"
14275   with_rcs_ids=$withval
14276 else
14277   with_rcs_ids=no
14278 fi;
14279 echo "$as_me:14279: result: $with_rcs_ids" >&5
14280 echo "${ECHO_T}$with_rcs_ids" >&6
14281 test "$with_rcs_ids" = yes &&
14282 cat >>confdefs.h <<\EOF
14283 #define USE_RCS_IDS 1
14284 EOF
14285
14286 ###############################################################################
14287
14288 ### Note that some functions (such as const) are normally disabled anyway.
14289 echo "$as_me:14289: checking if you want to build with function extensions" >&5
14290 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
14291
14292 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
14293 if test "${enable_ext_funcs+set}" = set; then
14294   enableval="$enable_ext_funcs"
14295   with_ext_funcs=$enableval
14296 else
14297   with_ext_funcs=yes
14298 fi;
14299 echo "$as_me:14299: result: $with_ext_funcs" >&5
14300 echo "${ECHO_T}$with_ext_funcs" >&6
14301 if test "$with_ext_funcs" = yes ; then
14302         NCURSES_EXT_FUNCS=1
14303
14304 cat >>confdefs.h <<\EOF
14305 #define HAVE_USE_DEFAULT_COLORS 1
14306 EOF
14307
14308 cat >>confdefs.h <<\EOF
14309 #define NCURSES_EXT_FUNCS 1
14310 EOF
14311
14312 else
14313         NCURSES_EXT_FUNCS=0
14314 fi
14315
14316 ###   use option --enable-const to turn on use of const beyond that in XSI.
14317 echo "$as_me:14317: checking for extended use of const keyword" >&5
14318 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
14319
14320 # Check whether --enable-const or --disable-const was given.
14321 if test "${enable_const+set}" = set; then
14322   enableval="$enable_const"
14323   with_ext_const=$enableval
14324 else
14325   with_ext_const=no
14326 fi;
14327 echo "$as_me:14327: result: $with_ext_const" >&5
14328 echo "${ECHO_T}$with_ext_const" >&6
14329 NCURSES_CONST='/*nothing*/'
14330 if test "$with_ext_const" = yes ; then
14331         NCURSES_CONST=const
14332 fi
14333
14334 ###############################################################################
14335 # These options are relatively safe to experiment with.
14336
14337 echo "$as_me:14337: checking if you want all development code" >&5
14338 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
14339
14340 # Check whether --with-develop or --without-develop was given.
14341 if test "${with_develop+set}" = set; then
14342   withval="$with_develop"
14343   with_develop=$withval
14344 else
14345   with_develop=no
14346 fi;
14347 echo "$as_me:14347: result: $with_develop" >&5
14348 echo "${ECHO_T}$with_develop" >&6
14349
14350 ###############################################################################
14351 # These are just experimental, probably should not be in a package:
14352
14353 # This is still experimental (20080329), but should ultimately be moved to
14354 # the script-block --with-normal, etc.
14355
14356 echo "$as_me:14356: checking if you want to link with the pthread library" >&5
14357 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
14358
14359 # Check whether --with-pthread or --without-pthread was given.
14360 if test "${with_pthread+set}" = set; then
14361   withval="$with_pthread"
14362   with_pthread=$withval
14363 else
14364   with_pthread=no
14365 fi;
14366 echo "$as_me:14366: result: $with_pthread" >&5
14367 echo "${ECHO_T}$with_pthread" >&6
14368
14369 if test "$with_pthread" != no ; then
14370         echo "$as_me:14370: checking for pthread.h" >&5
14371 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
14372 if test "${ac_cv_header_pthread_h+set}" = set; then
14373   echo $ECHO_N "(cached) $ECHO_C" >&6
14374 else
14375   cat >"conftest.$ac_ext" <<_ACEOF
14376 #line 14376 "configure"
14377 #include "confdefs.h"
14378 #include <pthread.h>
14379 _ACEOF
14380 if { (eval echo "$as_me:14380: \"$ac_cpp "conftest.$ac_ext"\"") >&5
14381   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
14382   ac_status=$?
14383   $EGREP -v '^ *\+' conftest.er1 >conftest.err
14384   rm -f conftest.er1
14385   cat conftest.err >&5
14386   echo "$as_me:14386: \$? = $ac_status" >&5
14387   (exit "$ac_status"); } >/dev/null; then
14388   if test -s conftest.err; then
14389     ac_cpp_err=$ac_c_preproc_warn_flag
14390   else
14391     ac_cpp_err=
14392   fi
14393 else
14394   ac_cpp_err=yes
14395 fi
14396 if test -z "$ac_cpp_err"; then
14397   ac_cv_header_pthread_h=yes
14398 else
14399   echo "$as_me: failed program was:" >&5
14400   cat "conftest.$ac_ext" >&5
14401   ac_cv_header_pthread_h=no
14402 fi
14403 rm -f conftest.err "conftest.$ac_ext"
14404 fi
14405 echo "$as_me:14405: result: $ac_cv_header_pthread_h" >&5
14406 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
14407 if test "$ac_cv_header_pthread_h" = yes; then
14408
14409 cat >>confdefs.h <<\EOF
14410 #define HAVE_PTHREADS_H 1
14411 EOF
14412
14413         for cf_lib_pthread in pthread c_r
14414         do
14415             echo "$as_me:14415: checking if we can link with the $cf_lib_pthread library" >&5
14416 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
14417             cf_save_LIBS="$LIBS"
14418
14419 cf_add_libs="$LIBS"
14420 # reverse order
14421 cf_add_0lib=
14422 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14423 # filter duplicates
14424 for cf_add_1lib in $cf_add_0lib; do
14425         for cf_add_2lib in $cf_add_libs; do
14426                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14427                         cf_add_1lib=
14428                         break
14429                 fi
14430         done
14431         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14432 done
14433 LIBS="$cf_add_libs"
14434
14435             cat >"conftest.$ac_ext" <<_ACEOF
14436 #line 14436 "configure"
14437 #include "confdefs.h"
14438
14439 #include <pthread.h>
14440
14441 int
14442 main (void)
14443 {
14444
14445                 int rc = pthread_create(0,0,0,0);
14446                 int r2 = pthread_mutexattr_settype(0, 0);
14447
14448   ;
14449   return 0;
14450 }
14451 _ACEOF
14452 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14453 if { (eval echo "$as_me:14453: \"$ac_link\"") >&5
14454   (eval $ac_link) 2>&5
14455   ac_status=$?
14456   echo "$as_me:14456: \$? = $ac_status" >&5
14457   (exit "$ac_status"); } &&
14458          { ac_try='test -s "conftest$ac_exeext"'
14459   { (eval echo "$as_me:14459: \"$ac_try\"") >&5
14460   (eval $ac_try) 2>&5
14461   ac_status=$?
14462   echo "$as_me:14462: \$? = $ac_status" >&5
14463   (exit "$ac_status"); }; }; then
14464   with_pthread=yes
14465 else
14466   echo "$as_me: failed program was:" >&5
14467 cat "conftest.$ac_ext" >&5
14468 with_pthread=no
14469 fi
14470 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14471             LIBS="$cf_save_LIBS"
14472             echo "$as_me:14472: result: $with_pthread" >&5
14473 echo "${ECHO_T}$with_pthread" >&6
14474             test "$with_pthread" = yes && break
14475         done
14476
14477         if test "$with_pthread" = yes ; then
14478
14479 cf_add_libs="$LIBS"
14480 # reverse order
14481 cf_add_0lib=
14482 for cf_add_1lib in -l$cf_lib_pthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14483 # filter duplicates
14484 for cf_add_1lib in $cf_add_0lib; do
14485         for cf_add_2lib in $cf_add_libs; do
14486                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14487                         cf_add_1lib=
14488                         break
14489                 fi
14490         done
14491         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14492 done
14493 LIBS="$cf_add_libs"
14494
14495 cat >>confdefs.h <<\EOF
14496 #define HAVE_LIBPTHREADS 1
14497 EOF
14498
14499         else
14500             { { echo "$as_me:14500: error: Cannot link with pthread library" >&5
14501 echo "$as_me: error: Cannot link with pthread library" >&2;}
14502    { (exit 1); exit 1; }; }
14503         fi
14504
14505 fi
14506
14507 fi
14508
14509 echo "$as_me:14509: checking if you want to use weak-symbols for pthreads" >&5
14510 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
14511
14512 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
14513 if test "${enable_weak_symbols+set}" = set; then
14514   enableval="$enable_weak_symbols"
14515   use_weak_symbols=$withval
14516 else
14517   use_weak_symbols=no
14518 fi;
14519 echo "$as_me:14519: result: $use_weak_symbols" >&5
14520 echo "${ECHO_T}$use_weak_symbols" >&6
14521 if test "$use_weak_symbols" = yes ; then
14522
14523 echo "$as_me:14523: checking if $CC supports weak symbols" >&5
14524 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
14525 if test "${cf_cv_weak_symbols+set}" = set; then
14526   echo $ECHO_N "(cached) $ECHO_C" >&6
14527 else
14528
14529 cat >"conftest.$ac_ext" <<_ACEOF
14530 #line 14530 "configure"
14531 #include "confdefs.h"
14532
14533 #include <stdio.h>
14534 int
14535 main (void)
14536 {
14537
14538 #if defined(__GNUC__)
14539 #  if defined __USE_ISOC99
14540 #    define _cat_pragma(exp)    _Pragma(#exp)
14541 #    define _weak_pragma(exp)   _cat_pragma(weak name)
14542 #  else
14543 #    define _weak_pragma(exp)
14544 #  endif
14545 #  define _declare(name)        __extension__ extern __typeof__(name) name
14546 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
14547 #endif
14548
14549 weak_symbol(fopen);
14550
14551   ;
14552   return 0;
14553 }
14554 _ACEOF
14555 rm -f "conftest.$ac_objext"
14556 if { (eval echo "$as_me:14556: \"$ac_compile\"") >&5
14557   (eval $ac_compile) 2>&5
14558   ac_status=$?
14559   echo "$as_me:14559: \$? = $ac_status" >&5
14560   (exit "$ac_status"); } &&
14561          { ac_try='test -s "conftest.$ac_objext"'
14562   { (eval echo "$as_me:14562: \"$ac_try\"") >&5
14563   (eval $ac_try) 2>&5
14564   ac_status=$?
14565   echo "$as_me:14565: \$? = $ac_status" >&5
14566   (exit "$ac_status"); }; }; then
14567   cf_cv_weak_symbols=yes
14568 else
14569   echo "$as_me: failed program was:" >&5
14570 cat "conftest.$ac_ext" >&5
14571 cf_cv_weak_symbols=no
14572 fi
14573 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14574
14575 fi
14576 echo "$as_me:14576: result: $cf_cv_weak_symbols" >&5
14577 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
14578
14579 else
14580         cf_cv_weak_symbols=no
14581 fi
14582
14583 if test $cf_cv_weak_symbols = yes ; then
14584
14585 cat >>confdefs.h <<\EOF
14586 #define USE_WEAK_SYMBOLS 1
14587 EOF
14588
14589 fi
14590
14591 PTHREAD=
14592 if test "$with_pthread" = "yes" ; then
14593
14594 cat >>confdefs.h <<\EOF
14595 #define USE_PTHREADS 1
14596 EOF
14597
14598         enable_reentrant=yes
14599         if test $cf_cv_weak_symbols = yes ; then
14600                 PTHREAD=-lpthread
14601         fi
14602 fi
14603
14604 # OpenSUSE is installing ncurses6, using reentrant option.
14605 echo "$as_me:14605: checking for _nc_TABSIZE" >&5
14606 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
14607 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
14608   echo $ECHO_N "(cached) $ECHO_C" >&6
14609 else
14610   cat >"conftest.$ac_ext" <<_ACEOF
14611 #line 14611 "configure"
14612 #include "confdefs.h"
14613 #define _nc_TABSIZE autoconf_temporary
14614 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14615 #undef _nc_TABSIZE
14616
14617 #ifdef __cplusplus
14618 extern "C"
14619 #endif
14620
14621 /* We use char because int might match the return type of a gcc2
14622    builtin and then its argument prototype would still apply.  */
14623 char _nc_TABSIZE (void);
14624
14625 int
14626 main (void)
14627 {
14628
14629 /* The GNU C library defines stubs for functions which it implements
14630     to always fail with ENOSYS.  Some functions are actually named
14631     something starting with __ and the normal name is an alias.  */
14632 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
14633 #error found stub for _nc_TABSIZE
14634 #endif
14635
14636         return _nc_TABSIZE ();
14637   ;
14638   return 0;
14639 }
14640 _ACEOF
14641 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
14642 if { (eval echo "$as_me:14642: \"$ac_link\"") >&5
14643   (eval $ac_link) 2>&5
14644   ac_status=$?
14645   echo "$as_me:14645: \$? = $ac_status" >&5
14646   (exit "$ac_status"); } &&
14647          { ac_try='test -s "conftest$ac_exeext"'
14648   { (eval echo "$as_me:14648: \"$ac_try\"") >&5
14649   (eval $ac_try) 2>&5
14650   ac_status=$?
14651   echo "$as_me:14651: \$? = $ac_status" >&5
14652   (exit "$ac_status"); }; }; then
14653   ac_cv_func__nc_TABSIZE=yes
14654 else
14655   echo "$as_me: failed program was:" >&5
14656 cat "conftest.$ac_ext" >&5
14657 ac_cv_func__nc_TABSIZE=no
14658 fi
14659 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
14660 fi
14661 echo "$as_me:14661: result: $ac_cv_func__nc_TABSIZE" >&5
14662 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
14663 if test "$ac_cv_func__nc_TABSIZE" = yes; then
14664   assume_reentrant=yes
14665 else
14666   assume_reentrant=no
14667 fi
14668
14669 # Reentrant code has to be opaque; there's little advantage to making ncurses
14670 # opaque outside of that, so there is no --enable-opaque option.  We can use
14671 # this option without --with-pthreads, but this will be always set for
14672 # pthreads.
14673 echo "$as_me:14673: checking if you want experimental reentrant code" >&5
14674 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
14675
14676 # Check whether --enable-reentrant or --disable-reentrant was given.
14677 if test "${enable_reentrant+set}" = set; then
14678   enableval="$enable_reentrant"
14679   with_reentrant=$enableval
14680 else
14681   with_reentrant=$assume_reentrant
14682 fi;
14683 echo "$as_me:14683: result: $with_reentrant" >&5
14684 echo "${ECHO_T}$with_reentrant" >&6
14685 if test "$with_reentrant" = yes ; then
14686         cf_cv_enable_reentrant=1
14687         if test $cf_cv_weak_symbols = yes ; then
14688
14689 # remove pthread library from $LIBS
14690 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
14691
14692         elif test "$assume_reentrant" = no ; then
14693                 LIB_SUFFIX="t${LIB_SUFFIX}"
14694         fi
14695
14696 cat >>confdefs.h <<\EOF
14697 #define USE_REENTRANT 1
14698 EOF
14699
14700 else
14701         cf_cv_enable_reentrant=0
14702 fi
14703
14704 ### Allow using a different wrap-prefix
14705 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
14706         echo "$as_me:14706: checking for prefix used to wrap public variables" >&5
14707 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
14708
14709 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
14710 if test "${with_wrap_prefix+set}" = set; then
14711   withval="$with_wrap_prefix"
14712   NCURSES_WRAP_PREFIX=$withval
14713 else
14714   NCURSES_WRAP_PREFIX=_nc_
14715 fi;
14716         echo "$as_me:14716: result: $NCURSES_WRAP_PREFIX" >&5
14717 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14718 else
14719         NCURSES_WRAP_PREFIX=_nc_
14720 fi
14721
14722 cat >>confdefs.h <<EOF
14723 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
14724 EOF
14725
14726 ###############################################################################
14727
14728 ###     use option --disable-echo to suppress full display compiling commands
14729
14730 echo "$as_me:14730: checking if you want to see long compiling messages" >&5
14731 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
14732
14733 # Check whether --enable-echo or --disable-echo was given.
14734 if test "${enable_echo+set}" = set; then
14735   enableval="$enable_echo"
14736   test "$enableval" != no && enableval=yes
14737         if test "$enableval" != "yes" ; then
14738
14739         ECHO_LT='--silent'
14740         ECHO_LD='@echo linking $@;'
14741         RULE_CC='@echo compiling $<'
14742         SHOW_CC='@echo compiling $@'
14743         ECHO_CC='@'
14744
14745         else
14746
14747         ECHO_LT=''
14748         ECHO_LD=''
14749         RULE_CC=''
14750         SHOW_CC=''
14751         ECHO_CC=''
14752
14753         fi
14754 else
14755   enableval=yes
14756
14757         ECHO_LT=''
14758         ECHO_LD=''
14759         RULE_CC=''
14760         SHOW_CC=''
14761         ECHO_CC=''
14762
14763 fi;
14764 echo "$as_me:14764: result: $enableval" >&5
14765 echo "${ECHO_T}$enableval" >&6
14766
14767 echo "$as_me:14767: checking if you want to use C11 _Noreturn feature" >&5
14768 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6
14769
14770 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given.
14771 if test "${enable_stdnoreturn+set}" = set; then
14772   enableval="$enable_stdnoreturn"
14773   test "$enableval" != yes && enableval=no
14774         if test "$enableval" != "no" ; then
14775     enable_stdnoreturn=yes
14776         else
14777                 enable_stdnoreturn=no
14778         fi
14779 else
14780   enableval=no
14781         enable_stdnoreturn=no
14782
14783 fi;
14784 echo "$as_me:14784: result: $enable_stdnoreturn" >&5
14785 echo "${ECHO_T}$enable_stdnoreturn" >&6
14786
14787 if test $enable_stdnoreturn = yes; then
14788 echo "$as_me:14788: checking for C11 _Noreturn feature" >&5
14789 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6
14790 if test "${cf_cv_c11_noreturn+set}" = set; then
14791   echo $ECHO_N "(cached) $ECHO_C" >&6
14792 else
14793   cat >"conftest.$ac_ext" <<_ACEOF
14794 #line 14794 "configure"
14795 #include "confdefs.h"
14796
14797 #include <stdio.h>
14798 #include <stdlib.h>
14799 #include <stdnoreturn.h>
14800 static void giveup(void) { exit(0); }
14801
14802 int
14803 main (void)
14804 {
14805 if (feof(stdin)) giveup()
14806   ;
14807   return 0;
14808 }
14809 _ACEOF
14810 rm -f "conftest.$ac_objext"
14811 if { (eval echo "$as_me:14811: \"$ac_compile\"") >&5
14812   (eval $ac_compile) 2>&5
14813   ac_status=$?
14814   echo "$as_me:14814: \$? = $ac_status" >&5
14815   (exit "$ac_status"); } &&
14816          { ac_try='test -s "conftest.$ac_objext"'
14817   { (eval echo "$as_me:14817: \"$ac_try\"") >&5
14818   (eval $ac_try) 2>&5
14819   ac_status=$?
14820   echo "$as_me:14820: \$? = $ac_status" >&5
14821   (exit "$ac_status"); }; }; then
14822   cf_cv_c11_noreturn=yes
14823 else
14824   echo "$as_me: failed program was:" >&5
14825 cat "conftest.$ac_ext" >&5
14826 cf_cv_c11_noreturn=no
14827 fi
14828 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
14829
14830 fi
14831 echo "$as_me:14831: result: $cf_cv_c11_noreturn" >&5
14832 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6
14833 else
14834         cf_cv_c11_noreturn=no,
14835 fi
14836
14837 if test "$cf_cv_c11_noreturn" = yes; then
14838         cat >>confdefs.h <<\EOF
14839 #define HAVE_STDNORETURN_H 1
14840 EOF
14841
14842 cat >>confdefs.h <<EOF
14843 #define STDC_NORETURN _Noreturn
14844 EOF
14845
14846         HAVE_STDNORETURN_H=1
14847 else
14848         HAVE_STDNORETURN_H=0
14849 fi
14850
14851 if test "$GCC" = yes || test "$GXX" = yes
14852 then
14853
14854 if test "$GCC" = yes || test "$GXX" = yes
14855 then
14856         case $CFLAGS in
14857         (*-Werror=*)
14858                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
14859
14860 echo "${as_me:-configure}:14860: testing repairing CFLAGS: $CFLAGS ..." 1>&5
14861
14862                 cf_temp_flags=
14863                 for cf_temp_scan in $CFLAGS
14864                 do
14865                         case "x$cf_temp_scan" in
14866                         (x-Werror=*)
14867
14868         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14869         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14870
14871                                 ;;
14872                         (*)
14873
14874         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14875         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14876
14877                                 ;;
14878                         esac
14879                 done
14880                 CFLAGS="$cf_temp_flags"
14881                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
14882
14883 echo "${as_me:-configure}:14883: testing ... fixed $CFLAGS ..." 1>&5
14884
14885                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14886
14887 echo "${as_me:-configure}:14887: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14888
14889                 ;;
14890         esac
14891 fi
14892
14893 if test "$GCC" = yes || test "$GXX" = yes
14894 then
14895         case $CPPFLAGS in
14896         (*-Werror=*)
14897                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
14898
14899 echo "${as_me:-configure}:14899: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
14900
14901                 cf_temp_flags=
14902                 for cf_temp_scan in $CPPFLAGS
14903                 do
14904                         case "x$cf_temp_scan" in
14905                         (x-Werror=*)
14906
14907         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14908         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14909
14910                                 ;;
14911                         (*)
14912
14913         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14914         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14915
14916                                 ;;
14917                         esac
14918                 done
14919                 CPPFLAGS="$cf_temp_flags"
14920                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
14921
14922 echo "${as_me:-configure}:14922: testing ... fixed $CPPFLAGS ..." 1>&5
14923
14924                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14925
14926 echo "${as_me:-configure}:14926: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14927
14928                 ;;
14929         esac
14930 fi
14931
14932 if test "$GCC" = yes || test "$GXX" = yes
14933 then
14934         case $LDFLAGS in
14935         (*-Werror=*)
14936                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
14937
14938 echo "${as_me:-configure}:14938: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
14939
14940                 cf_temp_flags=
14941                 for cf_temp_scan in $LDFLAGS
14942                 do
14943                         case "x$cf_temp_scan" in
14944                         (x-Werror=*)
14945
14946         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
14947         EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan"
14948
14949                                 ;;
14950                         (*)
14951
14952         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
14953         cf_temp_flags="${cf_temp_flags}$cf_temp_scan"
14954
14955                                 ;;
14956                         esac
14957                 done
14958                 LDFLAGS="$cf_temp_flags"
14959                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
14960
14961 echo "${as_me:-configure}:14961: testing ... fixed $LDFLAGS ..." 1>&5
14962
14963                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
14964
14965 echo "${as_me:-configure}:14965: testing ... extra $EXTRA_CFLAGS ..." 1>&5
14966
14967                 ;;
14968         esac
14969 fi
14970
14971 echo "$as_me:14971: checking if you want to turn on gcc warnings" >&5
14972 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
14973
14974 # Check whether --enable-warnings or --disable-warnings was given.
14975 if test "${enable_warnings+set}" = set; then
14976   enableval="$enable_warnings"
14977   test "$enableval" != yes && enableval=no
14978         if test "$enableval" != "no" ; then
14979     enable_warnings=yes
14980         else
14981                 enable_warnings=no
14982         fi
14983 else
14984   enableval=no
14985         enable_warnings=no
14986
14987 fi;
14988 echo "$as_me:14988: result: $enable_warnings" >&5
14989 echo "${ECHO_T}$enable_warnings" >&6
14990 if test "$enable_warnings" = "yes"
14991 then
14992
14993 if test "x$have_x" = xyes; then
14994
14995 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
14996 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
14997 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
14998 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
14999 for cf_X_CFLAGS in $X_CFLAGS
15000 do
15001         case "x$cf_X_CFLAGS" in
15002         x-[IUD]*)
15003                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15004                 ;;
15005         *)
15006                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15007                 ;;
15008         esac
15009 done
15010
15011 cat >"conftest.$ac_ext" <<_ACEOF
15012 #line 15012 "configure"
15013 #include "confdefs.h"
15014
15015 #include <stdlib.h>
15016 #include <X11/Intrinsic.h>
15017
15018 int
15019 main (void)
15020 {
15021 String foo = malloc(1); (void)foo
15022   ;
15023   return 0;
15024 }
15025 _ACEOF
15026 rm -f "conftest.$ac_objext"
15027 if { (eval echo "$as_me:15027: \"$ac_compile\"") >&5
15028   (eval $ac_compile) 2>&5
15029   ac_status=$?
15030   echo "$as_me:15030: \$? = $ac_status" >&5
15031   (exit "$ac_status"); } &&
15032          { ac_try='test -s "conftest.$ac_objext"'
15033   { (eval echo "$as_me:15033: \"$ac_try\"") >&5
15034   (eval $ac_try) 2>&5
15035   ac_status=$?
15036   echo "$as_me:15036: \$? = $ac_status" >&5
15037   (exit "$ac_status"); }; }; then
15038
15039 echo "$as_me:15039: checking for X11/Xt const-feature" >&5
15040 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
15041 if test "${cf_cv_const_x_string+set}" = set; then
15042   echo $ECHO_N "(cached) $ECHO_C" >&6
15043 else
15044
15045         cat >"conftest.$ac_ext" <<_ACEOF
15046 #line 15046 "configure"
15047 #include "confdefs.h"
15048
15049 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
15050 #undef  XTSTRINGDEFINES /* X11R5 and later */
15051 #include <stdlib.h>
15052 #include <X11/Intrinsic.h>
15053
15054 int
15055 main (void)
15056 {
15057 String foo = malloc(1); *foo = 0
15058   ;
15059   return 0;
15060 }
15061 _ACEOF
15062 rm -f "conftest.$ac_objext"
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"); } &&
15068          { ac_try='test -s "conftest.$ac_objext"'
15069   { (eval echo "$as_me:15069: \"$ac_try\"") >&5
15070   (eval $ac_try) 2>&5
15071   ac_status=$?
15072   echo "$as_me:15072: \$? = $ac_status" >&5
15073   (exit "$ac_status"); }; }; then
15074
15075                         cf_cv_const_x_string=no
15076
15077 else
15078   echo "$as_me: failed program was:" >&5
15079 cat "conftest.$ac_ext" >&5
15080
15081                         cf_cv_const_x_string=yes
15082
15083 fi
15084 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15085
15086 fi
15087 echo "$as_me:15087: result: $cf_cv_const_x_string" >&5
15088 echo "${ECHO_T}$cf_cv_const_x_string" >&6
15089
15090 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
15091 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
15092 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
15093
15094 case "$cf_cv_const_x_string" in
15095 (no)
15096
15097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15098         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
15099
15100         ;;
15101 (*)
15102
15103         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15104         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
15105
15106         ;;
15107 esac
15108
15109 else
15110   echo "$as_me: failed program was:" >&5
15111 cat "conftest.$ac_ext" >&5
15112 fi
15113 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15114  fi
15115 cat > "conftest.$ac_ext" <<EOF
15116 #line 15116 "${as_me:-configure}"
15117 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
15118 EOF
15119 if test "$INTEL_COMPILER" = yes
15120 then
15121 # The "-wdXXX" options suppress warnings:
15122 # remark #1419: external declaration in primary source file
15123 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
15124 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
15125 # remark #193: zero used for undefined preprocessing identifier
15126 # remark #593: variable "curs_sb_left_arrow" was set but never used
15127 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
15128 # remark #869: parameter "tw" was never referenced
15129 # remark #981: operands are evaluated in unspecified order
15130 # warning #279: controlling expression is constant
15131
15132         { echo "$as_me:15132: checking for $CC warning options..." >&5
15133 echo "$as_me: checking for $CC warning options..." >&6;}
15134         cf_save_CFLAGS="$CFLAGS"
15135         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
15136         for cf_opt in \
15137                 wd1419 \
15138                 wd1683 \
15139                 wd1684 \
15140                 wd193 \
15141                 wd593 \
15142                 wd279 \
15143                 wd810 \
15144                 wd869 \
15145                 wd981
15146         do
15147                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15148                 if { (eval echo "$as_me:15148: \"$ac_compile\"") >&5
15149   (eval $ac_compile) 2>&5
15150   ac_status=$?
15151   echo "$as_me:15151: \$? = $ac_status" >&5
15152   (exit "$ac_status"); }; then
15153                         test -n "$verbose" && echo "$as_me:15153: result: ... -$cf_opt" >&5
15154 echo "${ECHO_T}... -$cf_opt" >&6
15155                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15156                 fi
15157         done
15158         CFLAGS="$cf_save_CFLAGS"
15159 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
15160 then
15161         { echo "$as_me:15161: checking for $CC warning options..." >&5
15162 echo "$as_me: checking for $CC warning options..." >&6;}
15163         cf_save_CFLAGS="$CFLAGS"
15164         cf_warn_CONST=""
15165         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
15166         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
15167         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
15168         for cf_opt in W Wall \
15169                 Wbad-function-cast \
15170                 Wcast-align \
15171                 Wcast-qual \
15172                 Wdeclaration-after-statement \
15173                 Wextra \
15174                 Winline \
15175                 Wmissing-declarations \
15176                 Wmissing-prototypes \
15177                 Wnested-externs \
15178                 Wpointer-arith \
15179                 Wshadow \
15180                 Wstrict-prototypes \
15181                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
15182         do
15183                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
15184                 if { (eval echo "$as_me:15184: \"$ac_compile\"") >&5
15185   (eval $ac_compile) 2>&5
15186   ac_status=$?
15187   echo "$as_me:15187: \$? = $ac_status" >&5
15188   (exit "$ac_status"); }; then
15189                         test -n "$verbose" && echo "$as_me:15189: result: ... -$cf_opt" >&5
15190 echo "${ECHO_T}... -$cf_opt" >&6
15191                         case "$cf_opt" in
15192                         (Winline)
15193                                 case "$GCC_VERSION" in
15194                                 ([34].*)
15195                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15196
15197 echo "${as_me:-configure}:15197: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15198
15199                                         continue;;
15200                                 esac
15201                                 ;;
15202                         (Wpointer-arith)
15203                                 case "$GCC_VERSION" in
15204                                 ([12].*)
15205                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
15206
15207 echo "${as_me:-configure}:15207: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
15208
15209                                         continue;;
15210                                 esac
15211                                 ;;
15212                         esac
15213                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
15214                 fi
15215         done
15216         CFLAGS="$cf_save_CFLAGS"
15217 fi
15218 rm -rf ./conftest*
15219
15220 fi
15221
15222 if test "$GCC" = yes || test "$GXX" = yes
15223 then
15224 cat > conftest.i <<EOF
15225 #ifndef GCC_PRINTF
15226 #define GCC_PRINTF 0
15227 #endif
15228 #ifndef GCC_SCANF
15229 #define GCC_SCANF 0
15230 #endif
15231 #ifndef GCC_NORETURN
15232 #define GCC_NORETURN /* nothing */
15233 #endif
15234 #ifndef GCC_UNUSED
15235 #define GCC_UNUSED /* nothing */
15236 #endif
15237 EOF
15238 if test "$GCC" = yes
15239 then
15240         { echo "$as_me:15240: checking for $CC __attribute__ directives..." >&5
15241 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15242 cat > "conftest.$ac_ext" <<EOF
15243 #line 15243 "${as_me:-configure}"
15244 #include "confdefs.h"
15245 #include "conftest.h"
15246 #include "conftest.i"
15247 #if     GCC_PRINTF
15248 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15249 #else
15250 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
15251 #endif
15252 #if     GCC_SCANF
15253 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
15254 #else
15255 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
15256 #endif
15257 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
15258 extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2);
15259 extern GCC_NORETURN void foo(void);
15260 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
15261 EOF
15262         cf_printf_attribute=no
15263         cf_scanf_attribute=no
15264         for cf_attribute in scanf printf unused noreturn
15265         do
15266
15267 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15268
15269                 cf_directive="__attribute__(($cf_attribute))"
15270                 echo "checking for $CC $cf_directive" 1>&5
15271
15272                 case "$cf_attribute" in
15273                 (printf)
15274                         cf_printf_attribute=yes
15275                         cat >conftest.h <<EOF
15276 #define GCC_$cf_ATTRIBUTE 1
15277 EOF
15278                         ;;
15279                 (scanf)
15280                         cf_scanf_attribute=yes
15281                         cat >conftest.h <<EOF
15282 #define GCC_$cf_ATTRIBUTE 1
15283 EOF
15284                         ;;
15285                 (*)
15286                         cat >conftest.h <<EOF
15287 #define GCC_$cf_ATTRIBUTE $cf_directive
15288 EOF
15289                         ;;
15290                 esac
15291
15292                 if { (eval echo "$as_me:15292: \"$ac_compile\"") >&5
15293   (eval $ac_compile) 2>&5
15294   ac_status=$?
15295   echo "$as_me:15295: \$? = $ac_status" >&5
15296   (exit "$ac_status"); }; then
15297                         test -n "$verbose" && echo "$as_me:15297: result: ... $cf_attribute" >&5
15298 echo "${ECHO_T}... $cf_attribute" >&6
15299                         cat conftest.h >>confdefs.h
15300                         case "$cf_attribute" in
15301                         (noreturn)
15302
15303 cat >>confdefs.h <<EOF
15304 #define GCC_NORETURN $cf_directive
15305 EOF
15306
15307                                 ;;
15308                         (printf)
15309                                 cf_value='/* nothing */'
15310                                 if test "$cf_printf_attribute" != no ; then
15311                                         cf_value='__attribute__((format(printf,fmt,var)))'
15312
15313 cat >>confdefs.h <<\EOF
15314 #define GCC_PRINTF 1
15315 EOF
15316
15317                                 fi
15318
15319 cat >>confdefs.h <<EOF
15320 #define GCC_PRINTFLIKE(fmt,var) $cf_value
15321 EOF
15322
15323                                 ;;
15324                         (scanf)
15325                                 cf_value='/* nothing */'
15326                                 if test "$cf_scanf_attribute" != no ; then
15327                                         cf_value='__attribute__((format(scanf,fmt,var)))'
15328
15329 cat >>confdefs.h <<\EOF
15330 #define GCC_SCANF 1
15331 EOF
15332
15333                                 fi
15334
15335 cat >>confdefs.h <<EOF
15336 #define GCC_SCANFLIKE(fmt,var) $cf_value
15337 EOF
15338
15339                                 ;;
15340                         (unused)
15341
15342 cat >>confdefs.h <<EOF
15343 #define GCC_UNUSED $cf_directive
15344 EOF
15345
15346                                 ;;
15347                         esac
15348                 fi
15349         done
15350 else
15351         ${FGREP-fgrep} define conftest.i >>confdefs.h
15352 fi
15353 rm -rf ./conftest*
15354 fi
15355
15356 fi
15357
15358 if test "x$enable_warnings" = "xyes"; then
15359
15360         ADAFLAGS="$ADAFLAGS -gnatg"
15361
15362 fi
15363
15364 ###     use option --enable-assertions to turn on generation of assertion code
15365 echo "$as_me:15365: checking if you want to enable runtime assertions" >&5
15366 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
15367
15368 # Check whether --enable-assertions or --disable-assertions was given.
15369 if test "${enable_assertions+set}" = set; then
15370   enableval="$enable_assertions"
15371   with_assertions=$enableval
15372 else
15373   with_assertions=no
15374 fi;
15375 echo "$as_me:15375: result: $with_assertions" >&5
15376 echo "${ECHO_T}$with_assertions" >&6
15377 if test -n "$GCC"
15378 then
15379         if test "$with_assertions" = no
15380         then
15381                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
15382         else
15383
15384         ADAFLAGS="$ADAFLAGS -gnata"
15385
15386         fi
15387 fi
15388
15389 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
15390
15391 cat >>confdefs.h <<\EOF
15392 #define HAVE_NC_ALLOC_H 1
15393 EOF
15394
15395 ###     use option --enable-expanded to generate certain macros as functions
15396
15397 # Check whether --enable-expanded or --disable-expanded was given.
15398 if test "${enable_expanded+set}" = set; then
15399   enableval="$enable_expanded"
15400   test "$enableval" = yes &&
15401 cat >>confdefs.h <<\EOF
15402 #define NCURSES_EXPANDED 1
15403 EOF
15404
15405 fi;
15406
15407 ###     use option --disable-macros to suppress macros in favor of functions
15408
15409 # Check whether --enable-macros or --disable-macros was given.
15410 if test "${enable_macros+set}" = set; then
15411   enableval="$enable_macros"
15412   test "$enableval" = no &&
15413 cat >>confdefs.h <<\EOF
15414 #define NCURSES_NOMACROS 1
15415 EOF
15416
15417 fi;
15418
15419 # Normally we only add trace() to the debug-library.  Allow this to be
15420 # extended to all models of the ncurses library:
15421 cf_all_traces=no
15422 case "$CFLAGS $CPPFLAGS" in
15423 (*-DTRACE*)
15424         cf_all_traces=yes
15425         ;;
15426 esac
15427
15428 echo "$as_me:15428: checking whether to add trace feature to all models" >&5
15429 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
15430
15431 # Check whether --with-trace or --without-trace was given.
15432 if test "${with_trace+set}" = set; then
15433   withval="$with_trace"
15434   cf_with_trace=$withval
15435 else
15436   cf_with_trace=$cf_all_traces
15437 fi;
15438 echo "$as_me:15438: result: $cf_with_trace" >&5
15439 echo "${ECHO_T}$cf_with_trace" >&6
15440
15441 if test "$cf_with_trace" = yes ; then
15442         ADA_TRACE=TRUE
15443
15444 cf_fix_cppflags=no
15445 cf_new_cflags=
15446 cf_new_cppflags=
15447 cf_new_extra_cppflags=
15448
15449 for cf_add_cflags in -DTRACE
15450 do
15451 case "$cf_fix_cppflags" in
15452 (no)
15453         case "$cf_add_cflags" in
15454         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15455                 case "$cf_add_cflags" in
15456                 (-D*)
15457                         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15458
15459                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15460                                 && test -z "${cf_tst_cflags}" \
15461                                 && cf_fix_cppflags=yes
15462
15463                         if test "$cf_fix_cppflags" = yes ; then
15464
15465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15467
15468                                 continue
15469                         elif test "${cf_tst_cflags}" = "\"'" ; then
15470
15471         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15472         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15473
15474                                 continue
15475                         fi
15476                         ;;
15477                 esac
15478                 case "$CPPFLAGS" in
15479                 (*$cf_add_cflags)
15480                         ;;
15481                 (*)
15482                         case "$cf_add_cflags" in
15483                         (-D*)
15484                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15485
15486 CPPFLAGS=`echo "$CPPFLAGS" | \
15487         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15488                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15489
15490                                 ;;
15491                         esac
15492
15493         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15494         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15495
15496                         ;;
15497                 esac
15498                 ;;
15499         (*)
15500
15501         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15502         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15503
15504                 ;;
15505         esac
15506         ;;
15507 (yes)
15508
15509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15511
15512         cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'`
15513
15514         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15515                 && test -z "${cf_tst_cflags}" \
15516                 && cf_fix_cppflags=no
15517         ;;
15518 esac
15519 done
15520
15521 if test -n "$cf_new_cflags" ; then
15522
15523         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15524         CFLAGS="${CFLAGS}$cf_new_cflags"
15525
15526 fi
15527
15528 if test -n "$cf_new_cppflags" ; then
15529
15530         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15531         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15532
15533 fi
15534
15535 if test -n "$cf_new_extra_cppflags" ; then
15536
15537         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15538         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15539
15540 fi
15541
15542 else
15543         ADA_TRACE=FALSE
15544 fi
15545
15546 echo "$as_me:15546: checking if we want to use GNAT projects" >&5
15547 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
15548
15549 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
15550 if test "${enable_gnat_projects+set}" = set; then
15551   enableval="$enable_gnat_projects"
15552   test "$enableval" != no && enableval=yes
15553         if test "$enableval" != "yes" ; then
15554     enable_gnat_projects=no
15555         else
15556                 enable_gnat_projects=yes
15557         fi
15558 else
15559   enableval=yes
15560         enable_gnat_projects=yes
15561
15562 fi;
15563 echo "$as_me:15563: result: $enable_gnat_projects" >&5
15564 echo "${ECHO_T}$enable_gnat_projects" >&6
15565
15566 ###     Checks for libraries.
15567 case $cf_cv_system_name in
15568 (*mingw32*)
15569         ;;
15570 (*)
15571 echo "$as_me:15571: checking for gettimeofday" >&5
15572 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
15573 if test "${ac_cv_func_gettimeofday+set}" = set; then
15574   echo $ECHO_N "(cached) $ECHO_C" >&6
15575 else
15576   cat >"conftest.$ac_ext" <<_ACEOF
15577 #line 15577 "configure"
15578 #include "confdefs.h"
15579 #define gettimeofday autoconf_temporary
15580 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
15581 #undef gettimeofday
15582
15583 #ifdef __cplusplus
15584 extern "C"
15585 #endif
15586
15587 /* We use char because int might match the return type of a gcc2
15588    builtin and then its argument prototype would still apply.  */
15589 char gettimeofday (void);
15590
15591 int
15592 main (void)
15593 {
15594
15595 /* The GNU C library defines stubs for functions which it implements
15596     to always fail with ENOSYS.  Some functions are actually named
15597     something starting with __ and the normal name is an alias.  */
15598 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
15599 #error found stub for gettimeofday
15600 #endif
15601
15602         return gettimeofday ();
15603   ;
15604   return 0;
15605 }
15606 _ACEOF
15607 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15608 if { (eval echo "$as_me:15608: \"$ac_link\"") >&5
15609   (eval $ac_link) 2>&5
15610   ac_status=$?
15611   echo "$as_me:15611: \$? = $ac_status" >&5
15612   (exit "$ac_status"); } &&
15613          { ac_try='test -s "conftest$ac_exeext"'
15614   { (eval echo "$as_me:15614: \"$ac_try\"") >&5
15615   (eval $ac_try) 2>&5
15616   ac_status=$?
15617   echo "$as_me:15617: \$? = $ac_status" >&5
15618   (exit "$ac_status"); }; }; then
15619   ac_cv_func_gettimeofday=yes
15620 else
15621   echo "$as_me: failed program was:" >&5
15622 cat "conftest.$ac_ext" >&5
15623 ac_cv_func_gettimeofday=no
15624 fi
15625 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15626 fi
15627 echo "$as_me:15627: result: $ac_cv_func_gettimeofday" >&5
15628 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
15629 if test "$ac_cv_func_gettimeofday" = yes; then
15630   cat >>confdefs.h <<\EOF
15631 #define HAVE_GETTIMEOFDAY 1
15632 EOF
15633
15634 else
15635
15636 echo "$as_me:15636: checking for gettimeofday in -lbsd" >&5
15637 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
15638 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
15639   echo $ECHO_N "(cached) $ECHO_C" >&6
15640 else
15641   ac_check_lib_save_LIBS=$LIBS
15642 LIBS="-lbsd  $LIBS"
15643 cat >"conftest.$ac_ext" <<_ACEOF
15644 #line 15644 "configure"
15645 #include "confdefs.h"
15646
15647 /* Override any gcc2 internal prototype to avoid an error.  */
15648 #ifdef __cplusplus
15649 extern "C"
15650 #endif
15651 /* We use char because int might match the return type of a gcc2
15652    builtin and then its argument prototype would still apply.  */
15653 char gettimeofday ();
15654 int
15655 main (void)
15656 {
15657 gettimeofday ();
15658   ;
15659   return 0;
15660 }
15661 _ACEOF
15662 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
15663 if { (eval echo "$as_me:15663: \"$ac_link\"") >&5
15664   (eval $ac_link) 2>&5
15665   ac_status=$?
15666   echo "$as_me:15666: \$? = $ac_status" >&5
15667   (exit "$ac_status"); } &&
15668          { ac_try='test -s "conftest$ac_exeext"'
15669   { (eval echo "$as_me:15669: \"$ac_try\"") >&5
15670   (eval $ac_try) 2>&5
15671   ac_status=$?
15672   echo "$as_me:15672: \$? = $ac_status" >&5
15673   (exit "$ac_status"); }; }; then
15674   ac_cv_lib_bsd_gettimeofday=yes
15675 else
15676   echo "$as_me: failed program was:" >&5
15677 cat "conftest.$ac_ext" >&5
15678 ac_cv_lib_bsd_gettimeofday=no
15679 fi
15680 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
15681 LIBS=$ac_check_lib_save_LIBS
15682 fi
15683 echo "$as_me:15683: result: $ac_cv_lib_bsd_gettimeofday" >&5
15684 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
15685 if test "$ac_cv_lib_bsd_gettimeofday" = yes; then
15686
15687 cat >>confdefs.h <<\EOF
15688 #define HAVE_GETTIMEOFDAY 1
15689 EOF
15690
15691         LIBS="$LIBS -lbsd"
15692 fi
15693
15694 fi
15695         ;;
15696 esac
15697
15698 ###     Checks for header files.
15699 echo "$as_me:15699: checking for ANSI C header files" >&5
15700 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15701 if test "${ac_cv_header_stdc+set}" = set; then
15702   echo $ECHO_N "(cached) $ECHO_C" >&6
15703 else
15704   cat >"conftest.$ac_ext" <<_ACEOF
15705 #line 15705 "configure"
15706 #include "confdefs.h"
15707 #include <stdlib.h>
15708 #include <stdarg.h>
15709 #include <string.h>
15710 #include <float.h>
15711
15712 _ACEOF
15713 if { (eval echo "$as_me:15713: \"$ac_cpp "conftest.$ac_ext"\"") >&5
15714   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
15715   ac_status=$?
15716   $EGREP -v '^ *\+' conftest.er1 >conftest.err
15717   rm -f conftest.er1
15718   cat conftest.err >&5
15719   echo "$as_me:15719: \$? = $ac_status" >&5
15720   (exit "$ac_status"); } >/dev/null; then
15721   if test -s conftest.err; then
15722     ac_cpp_err=$ac_c_preproc_warn_flag
15723   else
15724     ac_cpp_err=
15725   fi
15726 else
15727   ac_cpp_err=yes
15728 fi
15729 if test -z "$ac_cpp_err"; then
15730   ac_cv_header_stdc=yes
15731 else
15732   echo "$as_me: failed program was:" >&5
15733   cat "conftest.$ac_ext" >&5
15734   ac_cv_header_stdc=no
15735 fi
15736 rm -f conftest.err "conftest.$ac_ext"
15737
15738 if test $ac_cv_header_stdc = yes; then
15739   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15740   cat >"conftest.$ac_ext" <<_ACEOF
15741 #line 15741 "configure"
15742 #include "confdefs.h"
15743 #include <string.h>
15744
15745 _ACEOF
15746 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15747   $EGREP "memchr" >/dev/null 2>&1; then
15748   :
15749 else
15750   ac_cv_header_stdc=no
15751 fi
15752 rm -rf conftest*
15753
15754 fi
15755
15756 if test $ac_cv_header_stdc = yes; then
15757   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15758   cat >"conftest.$ac_ext" <<_ACEOF
15759 #line 15759 "configure"
15760 #include "confdefs.h"
15761 #include <stdlib.h>
15762
15763 _ACEOF
15764 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15765   $EGREP "free" >/dev/null 2>&1; then
15766   :
15767 else
15768   ac_cv_header_stdc=no
15769 fi
15770 rm -rf conftest*
15771
15772 fi
15773
15774 if test $ac_cv_header_stdc = yes; then
15775   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15776   if test "$cross_compiling" = yes; then
15777   :
15778 else
15779   cat >"conftest.$ac_ext" <<_ACEOF
15780 #line 15780 "configure"
15781 #include "confdefs.h"
15782 #include <ctype.h>
15783 #if ((' ' & 0x0FF) == 0x020)
15784 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15785 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15786 #else
15787 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15788                      || ('j' <= (c) && (c) <= 'r') \
15789                      || ('s' <= (c) && (c) <= 'z'))
15790 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15791 #endif
15792
15793 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15794 int
15795 main (void)
15796 {
15797   int i;
15798   for (i = 0; i < 256; i++)
15799     if (XOR (islower (i), ISLOWER (i))
15800         || toupper (i) != TOUPPER (i))
15801       $ac_main_return(2);
15802   $ac_main_return (0);
15803 }
15804 _ACEOF
15805 rm -f "conftest$ac_exeext"
15806 if { (eval echo "$as_me:15806: \"$ac_link\"") >&5
15807   (eval $ac_link) 2>&5
15808   ac_status=$?
15809   echo "$as_me:15809: \$? = $ac_status" >&5
15810   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
15811   { (eval echo "$as_me:15811: \"$ac_try\"") >&5
15812   (eval $ac_try) 2>&5
15813   ac_status=$?
15814   echo "$as_me:15814: \$? = $ac_status" >&5
15815   (exit "$ac_status"); }; }; then
15816   :
15817 else
15818   echo "$as_me: program exited with status $ac_status" >&5
15819 echo "$as_me: failed program was:" >&5
15820 cat "conftest.$ac_ext" >&5
15821 ac_cv_header_stdc=no
15822 fi
15823 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
15824 fi
15825 fi
15826 fi
15827 echo "$as_me:15827: result: $ac_cv_header_stdc" >&5
15828 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15829 if test $ac_cv_header_stdc = yes; then
15830
15831 cat >>confdefs.h <<\EOF
15832 #define STDC_HEADERS 1
15833 EOF
15834
15835 fi
15836
15837 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
15838
15839 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
15840                   inttypes.h stdint.h unistd.h
15841 do
15842 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15843 echo "$as_me:15843: checking for $ac_header" >&5
15844 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15845 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15846   echo $ECHO_N "(cached) $ECHO_C" >&6
15847 else
15848   cat >"conftest.$ac_ext" <<_ACEOF
15849 #line 15849 "configure"
15850 #include "confdefs.h"
15851 $ac_includes_default
15852 #include <$ac_header>
15853 _ACEOF
15854 rm -f "conftest.$ac_objext"
15855 if { (eval echo "$as_me:15855: \"$ac_compile\"") >&5
15856   (eval $ac_compile) 2>&5
15857   ac_status=$?
15858   echo "$as_me:15858: \$? = $ac_status" >&5
15859   (exit "$ac_status"); } &&
15860          { ac_try='test -s "conftest.$ac_objext"'
15861   { (eval echo "$as_me:15861: \"$ac_try\"") >&5
15862   (eval $ac_try) 2>&5
15863   ac_status=$?
15864   echo "$as_me:15864: \$? = $ac_status" >&5
15865   (exit "$ac_status"); }; }; then
15866   eval "$as_ac_Header=yes"
15867 else
15868   echo "$as_me: failed program was:" >&5
15869 cat "conftest.$ac_ext" >&5
15870 eval "$as_ac_Header=no"
15871 fi
15872 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15873 fi
15874 echo "$as_me:15874: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
15875 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
15876 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
15877   cat >>confdefs.h <<EOF
15878 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15879 EOF
15880
15881 fi
15882 done
15883
15884 echo "$as_me:15884: checking for signed char" >&5
15885 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
15886 if test "${ac_cv_type_signed_char+set}" = set; then
15887   echo $ECHO_N "(cached) $ECHO_C" >&6
15888 else
15889   cat >"conftest.$ac_ext" <<_ACEOF
15890 #line 15890 "configure"
15891 #include "confdefs.h"
15892 $ac_includes_default
15893 int
15894 main (void)
15895 {
15896 if ((signed char *) 0)
15897   return 0;
15898 if (sizeof (signed char))
15899   return 0;
15900   ;
15901   return 0;
15902 }
15903 _ACEOF
15904 rm -f "conftest.$ac_objext"
15905 if { (eval echo "$as_me:15905: \"$ac_compile\"") >&5
15906   (eval $ac_compile) 2>&5
15907   ac_status=$?
15908   echo "$as_me:15908: \$? = $ac_status" >&5
15909   (exit "$ac_status"); } &&
15910          { ac_try='test -s "conftest.$ac_objext"'
15911   { (eval echo "$as_me:15911: \"$ac_try\"") >&5
15912   (eval $ac_try) 2>&5
15913   ac_status=$?
15914   echo "$as_me:15914: \$? = $ac_status" >&5
15915   (exit "$ac_status"); }; }; then
15916   ac_cv_type_signed_char=yes
15917 else
15918   echo "$as_me: failed program was:" >&5
15919 cat "conftest.$ac_ext" >&5
15920 ac_cv_type_signed_char=no
15921 fi
15922 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15923 fi
15924 echo "$as_me:15924: result: $ac_cv_type_signed_char" >&5
15925 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
15926
15927 echo "$as_me:15927: checking size of signed char" >&5
15928 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
15929 if test "${ac_cv_sizeof_signed_char+set}" = set; then
15930   echo $ECHO_N "(cached) $ECHO_C" >&6
15931 else
15932   if test "$ac_cv_type_signed_char" = yes; then
15933   if test "$cross_compiling" = yes; then
15934   # Depending upon the size, compute the lo and hi bounds.
15935 cat >"conftest.$ac_ext" <<_ACEOF
15936 #line 15936 "configure"
15937 #include "confdefs.h"
15938 $ac_includes_default
15939 int
15940 main (void)
15941 {
15942 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
15943   ;
15944   return 0;
15945 }
15946 _ACEOF
15947 rm -f "conftest.$ac_objext"
15948 if { (eval echo "$as_me:15948: \"$ac_compile\"") >&5
15949   (eval $ac_compile) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit "$ac_status"); } &&
15953          { ac_try='test -s "conftest.$ac_objext"'
15954   { (eval echo "$as_me:15954: \"$ac_try\"") >&5
15955   (eval $ac_try) 2>&5
15956   ac_status=$?
15957   echo "$as_me:15957: \$? = $ac_status" >&5
15958   (exit "$ac_status"); }; }; then
15959   ac_lo=0 ac_mid=0
15960   while :; do
15961     cat >"conftest.$ac_ext" <<_ACEOF
15962 #line 15962 "configure"
15963 #include "confdefs.h"
15964 $ac_includes_default
15965 int
15966 main (void)
15967 {
15968 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
15969   ;
15970   return 0;
15971 }
15972 _ACEOF
15973 rm -f "conftest.$ac_objext"
15974 if { (eval echo "$as_me:15974: \"$ac_compile\"") >&5
15975   (eval $ac_compile) 2>&5
15976   ac_status=$?
15977   echo "$as_me:15977: \$? = $ac_status" >&5
15978   (exit "$ac_status"); } &&
15979          { ac_try='test -s "conftest.$ac_objext"'
15980   { (eval echo "$as_me:15980: \"$ac_try\"") >&5
15981   (eval $ac_try) 2>&5
15982   ac_status=$?
15983   echo "$as_me:15983: \$? = $ac_status" >&5
15984   (exit "$ac_status"); }; }; then
15985   ac_hi=$ac_mid; break
15986 else
15987   echo "$as_me: failed program was:" >&5
15988 cat "conftest.$ac_ext" >&5
15989 ac_lo=`expr "$ac_mid" + 1`; ac_mid=`expr 2 '*' "$ac_mid" + 1`
15990 fi
15991 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
15992   done
15993 else
15994   echo "$as_me: failed program was:" >&5
15995 cat "conftest.$ac_ext" >&5
15996 ac_hi=-1 ac_mid=-1
15997   while :; do
15998     cat >"conftest.$ac_ext" <<_ACEOF
15999 #line 15999 "configure"
16000 #include "confdefs.h"
16001 $ac_includes_default
16002 int
16003 main (void)
16004 {
16005 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
16006   ;
16007   return 0;
16008 }
16009 _ACEOF
16010 rm -f "conftest.$ac_objext"
16011 if { (eval echo "$as_me:16011: \"$ac_compile\"") >&5
16012   (eval $ac_compile) 2>&5
16013   ac_status=$?
16014   echo "$as_me:16014: \$? = $ac_status" >&5
16015   (exit "$ac_status"); } &&
16016          { ac_try='test -s "conftest.$ac_objext"'
16017   { (eval echo "$as_me:16017: \"$ac_try\"") >&5
16018   (eval $ac_try) 2>&5
16019   ac_status=$?
16020   echo "$as_me:16020: \$? = $ac_status" >&5
16021   (exit "$ac_status"); }; }; then
16022   ac_lo=$ac_mid; break
16023 else
16024   echo "$as_me: failed program was:" >&5
16025 cat "conftest.$ac_ext" >&5
16026 ac_hi=`expr "$ac_mid" - 1`; ac_mid=`expr 2 '*' "$ac_mid"`
16027 fi
16028 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16029   done
16030 fi
16031 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16032 # Binary search between lo and hi bounds.
16033 while test "x$ac_lo" != "x$ac_hi"; do
16034   ac_mid=`expr '(' "$ac_hi" - "$ac_lo" ')' / 2 + "$ac_lo"`
16035   cat >"conftest.$ac_ext" <<_ACEOF
16036 #line 16036 "configure"
16037 #include "confdefs.h"
16038 $ac_includes_default
16039 int
16040 main (void)
16041 {
16042 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
16043   ;
16044   return 0;
16045 }
16046 _ACEOF
16047 rm -f "conftest.$ac_objext"
16048 if { (eval echo "$as_me:16048: \"$ac_compile\"") >&5
16049   (eval $ac_compile) 2>&5
16050   ac_status=$?
16051   echo "$as_me:16051: \$? = $ac_status" >&5
16052   (exit "$ac_status"); } &&
16053          { ac_try='test -s "conftest.$ac_objext"'
16054   { (eval echo "$as_me:16054: \"$ac_try\"") >&5
16055   (eval $ac_try) 2>&5
16056   ac_status=$?
16057   echo "$as_me:16057: \$? = $ac_status" >&5
16058   (exit "$ac_status"); }; }; then
16059   ac_hi=$ac_mid
16060 else
16061   echo "$as_me: failed program was:" >&5
16062 cat "conftest.$ac_ext" >&5
16063 ac_lo=`expr "$ac_mid" + 1`
16064 fi
16065 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16066 done
16067 ac_cv_sizeof_signed_char=$ac_lo
16068 else
16069   if test "$cross_compiling" = yes; then
16070   { { echo "$as_me:16070: error: cannot run test program while cross compiling" >&5
16071 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
16072    { (exit 1); exit 1; }; }
16073 else
16074   cat >"conftest.$ac_ext" <<_ACEOF
16075 #line 16075 "configure"
16076 #include "confdefs.h"
16077 $ac_includes_default
16078 int
16079 main (void)
16080 {
16081 FILE *f = fopen ("conftest.val", "w");
16082 if (!f)
16083   $ac_main_return (1);
16084 fprintf (f, "%d", (sizeof (signed char)));
16085 fclose (f);
16086   ;
16087   return 0;
16088 }
16089 _ACEOF
16090 rm -f "conftest$ac_exeext"
16091 if { (eval echo "$as_me:16091: \"$ac_link\"") >&5
16092   (eval $ac_link) 2>&5
16093   ac_status=$?
16094   echo "$as_me:16094: \$? = $ac_status" >&5
16095   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16096   { (eval echo "$as_me:16096: \"$ac_try\"") >&5
16097   (eval $ac_try) 2>&5
16098   ac_status=$?
16099   echo "$as_me:16099: \$? = $ac_status" >&5
16100   (exit "$ac_status"); }; }; then
16101   ac_cv_sizeof_signed_char=`cat conftest.val`
16102 else
16103   echo "$as_me: program exited with status $ac_status" >&5
16104 echo "$as_me: failed program was:" >&5
16105 cat "conftest.$ac_ext" >&5
16106 fi
16107 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16108 fi
16109 fi
16110 rm -f conftest.val
16111 else
16112   ac_cv_sizeof_signed_char=0
16113 fi
16114 fi
16115 echo "$as_me:16115: result: $ac_cv_sizeof_signed_char" >&5
16116 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
16117 cat >>confdefs.h <<EOF
16118 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
16119 EOF
16120
16121 echo "$as_me:16121: checking for ANSI C header files" >&5
16122 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16123 if test "${ac_cv_header_stdc+set}" = set; then
16124   echo $ECHO_N "(cached) $ECHO_C" >&6
16125 else
16126   cat >"conftest.$ac_ext" <<_ACEOF
16127 #line 16127 "configure"
16128 #include "confdefs.h"
16129 #include <stdlib.h>
16130 #include <stdarg.h>
16131 #include <string.h>
16132 #include <float.h>
16133
16134 _ACEOF
16135 if { (eval echo "$as_me:16135: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16136   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16137   ac_status=$?
16138   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16139   rm -f conftest.er1
16140   cat conftest.err >&5
16141   echo "$as_me:16141: \$? = $ac_status" >&5
16142   (exit "$ac_status"); } >/dev/null; then
16143   if test -s conftest.err; then
16144     ac_cpp_err=$ac_c_preproc_warn_flag
16145   else
16146     ac_cpp_err=
16147   fi
16148 else
16149   ac_cpp_err=yes
16150 fi
16151 if test -z "$ac_cpp_err"; then
16152   ac_cv_header_stdc=yes
16153 else
16154   echo "$as_me: failed program was:" >&5
16155   cat "conftest.$ac_ext" >&5
16156   ac_cv_header_stdc=no
16157 fi
16158 rm -f conftest.err "conftest.$ac_ext"
16159
16160 if test $ac_cv_header_stdc = yes; then
16161   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16162   cat >"conftest.$ac_ext" <<_ACEOF
16163 #line 16163 "configure"
16164 #include "confdefs.h"
16165 #include <string.h>
16166
16167 _ACEOF
16168 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16169   $EGREP "memchr" >/dev/null 2>&1; then
16170   :
16171 else
16172   ac_cv_header_stdc=no
16173 fi
16174 rm -rf conftest*
16175
16176 fi
16177
16178 if test $ac_cv_header_stdc = yes; then
16179   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16180   cat >"conftest.$ac_ext" <<_ACEOF
16181 #line 16181 "configure"
16182 #include "confdefs.h"
16183 #include <stdlib.h>
16184
16185 _ACEOF
16186 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16187   $EGREP "free" >/dev/null 2>&1; then
16188   :
16189 else
16190   ac_cv_header_stdc=no
16191 fi
16192 rm -rf conftest*
16193
16194 fi
16195
16196 if test $ac_cv_header_stdc = yes; then
16197   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16198   if test "$cross_compiling" = yes; then
16199   :
16200 else
16201   cat >"conftest.$ac_ext" <<_ACEOF
16202 #line 16202 "configure"
16203 #include "confdefs.h"
16204 #include <ctype.h>
16205 #if ((' ' & 0x0FF) == 0x020)
16206 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16207 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16208 #else
16209 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16210                      || ('j' <= (c) && (c) <= 'r') \
16211                      || ('s' <= (c) && (c) <= 'z'))
16212 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16213 #endif
16214
16215 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16216 int
16217 main (void)
16218 {
16219   int i;
16220   for (i = 0; i < 256; i++)
16221     if (XOR (islower (i), ISLOWER (i))
16222         || toupper (i) != TOUPPER (i))
16223       $ac_main_return(2);
16224   $ac_main_return (0);
16225 }
16226 _ACEOF
16227 rm -f "conftest$ac_exeext"
16228 if { (eval echo "$as_me:16228: \"$ac_link\"") >&5
16229   (eval $ac_link) 2>&5
16230   ac_status=$?
16231   echo "$as_me:16231: \$? = $ac_status" >&5
16232   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16233   { (eval echo "$as_me:16233: \"$ac_try\"") >&5
16234   (eval $ac_try) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit "$ac_status"); }; }; then
16238   :
16239 else
16240   echo "$as_me: program exited with status $ac_status" >&5
16241 echo "$as_me: failed program was:" >&5
16242 cat "conftest.$ac_ext" >&5
16243 ac_cv_header_stdc=no
16244 fi
16245 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16246 fi
16247 fi
16248 fi
16249 echo "$as_me:16249: result: $ac_cv_header_stdc" >&5
16250 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16251 if test $ac_cv_header_stdc = yes; then
16252
16253 cat >>confdefs.h <<\EOF
16254 #define STDC_HEADERS 1
16255 EOF
16256
16257 fi
16258
16259 ac_header_dirent=no
16260 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
16261   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
16262 echo "$as_me:16262: checking for $ac_hdr that defines DIR" >&5
16263 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
16264 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16265   echo $ECHO_N "(cached) $ECHO_C" >&6
16266 else
16267   cat >"conftest.$ac_ext" <<_ACEOF
16268 #line 16268 "configure"
16269 #include "confdefs.h"
16270 #include <sys/types.h>
16271 #include <$ac_hdr>
16272
16273 int
16274 main (void)
16275 {
16276 if ((DIR *) 0)
16277 return 0;
16278   ;
16279   return 0;
16280 }
16281 _ACEOF
16282 rm -f "conftest.$ac_objext"
16283 if { (eval echo "$as_me:16283: \"$ac_compile\"") >&5
16284   (eval $ac_compile) 2>&5
16285   ac_status=$?
16286   echo "$as_me:16286: \$? = $ac_status" >&5
16287   (exit "$ac_status"); } &&
16288          { ac_try='test -s "conftest.$ac_objext"'
16289   { (eval echo "$as_me:16289: \"$ac_try\"") >&5
16290   (eval $ac_try) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit "$ac_status"); }; }; then
16294   eval "$as_ac_Header=yes"
16295 else
16296   echo "$as_me: failed program was:" >&5
16297 cat "conftest.$ac_ext" >&5
16298 eval "$as_ac_Header=no"
16299 fi
16300 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16301 fi
16302 echo "$as_me:16302: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16303 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16304 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16305   cat >>confdefs.h <<EOF
16306 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
16307 EOF
16308
16309 ac_header_dirent=$ac_hdr; break
16310 fi
16311
16312 done
16313 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
16314 if test $ac_header_dirent = dirent.h; then
16315   echo "$as_me:16315: checking for opendir in -ldir" >&5
16316 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
16317 if test "${ac_cv_lib_dir_opendir+set}" = set; then
16318   echo $ECHO_N "(cached) $ECHO_C" >&6
16319 else
16320   ac_check_lib_save_LIBS=$LIBS
16321 LIBS="-ldir  $LIBS"
16322 cat >"conftest.$ac_ext" <<_ACEOF
16323 #line 16323 "configure"
16324 #include "confdefs.h"
16325
16326 /* Override any gcc2 internal prototype to avoid an error.  */
16327 #ifdef __cplusplus
16328 extern "C"
16329 #endif
16330 /* We use char because int might match the return type of a gcc2
16331    builtin and then its argument prototype would still apply.  */
16332 char opendir ();
16333 int
16334 main (void)
16335 {
16336 opendir ();
16337   ;
16338   return 0;
16339 }
16340 _ACEOF
16341 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16342 if { (eval echo "$as_me:16342: \"$ac_link\"") >&5
16343   (eval $ac_link) 2>&5
16344   ac_status=$?
16345   echo "$as_me:16345: \$? = $ac_status" >&5
16346   (exit "$ac_status"); } &&
16347          { ac_try='test -s "conftest$ac_exeext"'
16348   { (eval echo "$as_me:16348: \"$ac_try\"") >&5
16349   (eval $ac_try) 2>&5
16350   ac_status=$?
16351   echo "$as_me:16351: \$? = $ac_status" >&5
16352   (exit "$ac_status"); }; }; then
16353   ac_cv_lib_dir_opendir=yes
16354 else
16355   echo "$as_me: failed program was:" >&5
16356 cat "conftest.$ac_ext" >&5
16357 ac_cv_lib_dir_opendir=no
16358 fi
16359 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16360 LIBS=$ac_check_lib_save_LIBS
16361 fi
16362 echo "$as_me:16362: result: $ac_cv_lib_dir_opendir" >&5
16363 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
16364 if test "$ac_cv_lib_dir_opendir" = yes; then
16365   LIBS="$LIBS -ldir"
16366 fi
16367
16368 else
16369   echo "$as_me:16369: checking for opendir in -lx" >&5
16370 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
16371 if test "${ac_cv_lib_x_opendir+set}" = set; then
16372   echo $ECHO_N "(cached) $ECHO_C" >&6
16373 else
16374   ac_check_lib_save_LIBS=$LIBS
16375 LIBS="-lx  $LIBS"
16376 cat >"conftest.$ac_ext" <<_ACEOF
16377 #line 16377 "configure"
16378 #include "confdefs.h"
16379
16380 /* Override any gcc2 internal prototype to avoid an error.  */
16381 #ifdef __cplusplus
16382 extern "C"
16383 #endif
16384 /* We use char because int might match the return type of a gcc2
16385    builtin and then its argument prototype would still apply.  */
16386 char opendir ();
16387 int
16388 main (void)
16389 {
16390 opendir ();
16391   ;
16392   return 0;
16393 }
16394 _ACEOF
16395 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16396 if { (eval echo "$as_me:16396: \"$ac_link\"") >&5
16397   (eval $ac_link) 2>&5
16398   ac_status=$?
16399   echo "$as_me:16399: \$? = $ac_status" >&5
16400   (exit "$ac_status"); } &&
16401          { ac_try='test -s "conftest$ac_exeext"'
16402   { (eval echo "$as_me:16402: \"$ac_try\"") >&5
16403   (eval $ac_try) 2>&5
16404   ac_status=$?
16405   echo "$as_me:16405: \$? = $ac_status" >&5
16406   (exit "$ac_status"); }; }; then
16407   ac_cv_lib_x_opendir=yes
16408 else
16409   echo "$as_me: failed program was:" >&5
16410 cat "conftest.$ac_ext" >&5
16411 ac_cv_lib_x_opendir=no
16412 fi
16413 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16414 LIBS=$ac_check_lib_save_LIBS
16415 fi
16416 echo "$as_me:16416: result: $ac_cv_lib_x_opendir" >&5
16417 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
16418 if test "$ac_cv_lib_x_opendir" = yes; then
16419   LIBS="$LIBS -lx"
16420 fi
16421
16422 fi
16423
16424 echo "$as_me:16424: checking whether time.h and sys/time.h may both be included" >&5
16425 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16426 if test "${ac_cv_header_time+set}" = set; then
16427   echo $ECHO_N "(cached) $ECHO_C" >&6
16428 else
16429   cat >"conftest.$ac_ext" <<_ACEOF
16430 #line 16430 "configure"
16431 #include "confdefs.h"
16432 #include <sys/types.h>
16433 #include <sys/time.h>
16434 #include <time.h>
16435
16436 int
16437 main (void)
16438 {
16439 if ((struct tm *) 0)
16440 return 0;
16441   ;
16442   return 0;
16443 }
16444 _ACEOF
16445 rm -f "conftest.$ac_objext"
16446 if { (eval echo "$as_me:16446: \"$ac_compile\"") >&5
16447   (eval $ac_compile) 2>&5
16448   ac_status=$?
16449   echo "$as_me:16449: \$? = $ac_status" >&5
16450   (exit "$ac_status"); } &&
16451          { ac_try='test -s "conftest.$ac_objext"'
16452   { (eval echo "$as_me:16452: \"$ac_try\"") >&5
16453   (eval $ac_try) 2>&5
16454   ac_status=$?
16455   echo "$as_me:16455: \$? = $ac_status" >&5
16456   (exit "$ac_status"); }; }; then
16457   ac_cv_header_time=yes
16458 else
16459   echo "$as_me: failed program was:" >&5
16460 cat "conftest.$ac_ext" >&5
16461 ac_cv_header_time=no
16462 fi
16463 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16464 fi
16465 echo "$as_me:16465: result: $ac_cv_header_time" >&5
16466 echo "${ECHO_T}$ac_cv_header_time" >&6
16467 if test $ac_cv_header_time = yes; then
16468
16469 cat >>confdefs.h <<\EOF
16470 #define TIME_WITH_SYS_TIME 1
16471 EOF
16472
16473 fi
16474
16475 ###     checks for compiler characteristics
16476 ac_ext=c
16477 ac_cpp='$CPP $CPPFLAGS'
16478 ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5'
16479 ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5'
16480 ac_compiler_gnu=$ac_cv_c_compiler_gnu
16481 ac_main_return="return"
16482
16483 echo "$as_me:16483: checking for an ANSI C-conforming const" >&5
16484 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
16485 if test "${ac_cv_c_const+set}" = set; then
16486   echo $ECHO_N "(cached) $ECHO_C" >&6
16487 else
16488   cat >"conftest.$ac_ext" <<_ACEOF
16489 #line 16489 "configure"
16490 #include "confdefs.h"
16491
16492 int
16493 main (void)
16494 {
16495 /* FIXME: Include the comments suggested by Paul. */
16496 #ifndef __cplusplus
16497   /* Ultrix mips cc rejects this.  */
16498   typedef int charset[2];
16499   const charset x;
16500   /* SunOS 4.1.1 cc rejects this.  */
16501   char const *const *ccp;
16502   char **p;
16503   /* NEC SVR4.0.2 mips cc rejects this.  */
16504   struct point {int x, y;};
16505   static struct point const zero = {0,0};
16506   /* AIX XL C 1.02.0.0 rejects this.
16507      It does not let you subtract one const X* pointer from another in
16508      an arm of an if-expression whose if-part is not a constant
16509      expression */
16510   const char *g = "string";
16511   ccp = &g + (g ? g-g : 0);
16512   /* HPUX 7.0 cc rejects these. */
16513   ++ccp;
16514   p = (char**) ccp;
16515   ccp = (char const *const *) p;
16516   { /* SCO 3.2v4 cc rejects this.  */
16517     char *t;
16518     char const *s = 0 ? (char *) 0 : (char const *) 0;
16519
16520     *t++ = 0;
16521   }
16522   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16523     int x[] = {25, 17};
16524     const int *foo = &x[0];
16525     ++foo;
16526   }
16527   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16528     typedef const int *iptr;
16529     iptr p = 0;
16530     ++p;
16531   }
16532   { /* AIX XL C 1.02.0.0 rejects this saying
16533        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16534     struct s { int j; const int *ap[3]; };
16535     struct s *b; b->j = 5;
16536   }
16537   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16538     const int foo = 10;
16539   }
16540 #endif
16541
16542   ;
16543   return 0;
16544 }
16545 _ACEOF
16546 rm -f "conftest.$ac_objext"
16547 if { (eval echo "$as_me:16547: \"$ac_compile\"") >&5
16548   (eval $ac_compile) 2>&5
16549   ac_status=$?
16550   echo "$as_me:16550: \$? = $ac_status" >&5
16551   (exit "$ac_status"); } &&
16552          { ac_try='test -s "conftest.$ac_objext"'
16553   { (eval echo "$as_me:16553: \"$ac_try\"") >&5
16554   (eval $ac_try) 2>&5
16555   ac_status=$?
16556   echo "$as_me:16556: \$? = $ac_status" >&5
16557   (exit "$ac_status"); }; }; then
16558   ac_cv_c_const=yes
16559 else
16560   echo "$as_me: failed program was:" >&5
16561 cat "conftest.$ac_ext" >&5
16562 ac_cv_c_const=no
16563 fi
16564 rm -f "conftest.$ac_objext" "conftest.$ac_ext"
16565 fi
16566 echo "$as_me:16566: result: $ac_cv_c_const" >&5
16567 echo "${ECHO_T}$ac_cv_c_const" >&6
16568 if test $ac_cv_c_const = no; then
16569
16570 cat >>confdefs.h <<\EOF
16571 #define const
16572 EOF
16573
16574 fi
16575
16576 ###     Checks for external-data
16577
16578 echo "$as_me:16578: checking if data-only library module links" >&5
16579 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
16580 if test "${cf_cv_link_dataonly+set}" = set; then
16581   echo $ECHO_N "(cached) $ECHO_C" >&6
16582 else
16583
16584         rm -f conftest.a
16585         cat >conftest.$ac_ext <<EOF
16586 #line 16586 "configure"
16587 int     testdata[3] = { 123, 456, 789 };
16588 EOF
16589         if { (eval echo "$as_me:16589: \"$ac_compile\"") >&5
16590   (eval $ac_compile) 2>&5
16591   ac_status=$?
16592   echo "$as_me:16592: \$? = $ac_status" >&5
16593   (exit "$ac_status"); } ; then
16594                 mv conftest.o data.o && \
16595                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
16596         fi
16597         rm -f conftest.$ac_ext data.o
16598         cat >conftest.$ac_ext <<EOF
16599 #line 16599 "configure"
16600 int     testfunc(void)
16601 {
16602 #if defined(NeXT)
16603         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
16604 #else
16605         extern int testdata[3];
16606         return testdata[0] == 123
16607            &&  testdata[1] == 456
16608            &&  testdata[2] == 789;
16609 #endif
16610 }
16611 EOF
16612         if { (eval echo "$as_me:16612: \"$ac_compile\"") >&5
16613   (eval $ac_compile) 2>&5
16614   ac_status=$?
16615   echo "$as_me:16615: \$? = $ac_status" >&5
16616   (exit "$ac_status"); }; then
16617                 mv conftest.o func.o && \
16618                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
16619         fi
16620         rm -f conftest.$ac_ext func.o
16621         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
16622         cf_saveLIBS="$LIBS"
16623         LIBS="conftest.a $LIBS"
16624         if test "$cross_compiling" = yes; then
16625   cf_cv_link_dataonly=unknown
16626 else
16627   cat >"conftest.$ac_ext" <<_ACEOF
16628 #line 16628 "configure"
16629 #include "confdefs.h"
16630
16631         int main(void)
16632         {
16633                 extern int testfunc();
16634                 ${cf_cv_main_return:-return} (!testfunc());
16635         }
16636
16637 _ACEOF
16638 rm -f "conftest$ac_exeext"
16639 if { (eval echo "$as_me:16639: \"$ac_link\"") >&5
16640   (eval $ac_link) 2>&5
16641   ac_status=$?
16642   echo "$as_me:16642: \$? = $ac_status" >&5
16643   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16644   { (eval echo "$as_me:16644: \"$ac_try\"") >&5
16645   (eval $ac_try) 2>&5
16646   ac_status=$?
16647   echo "$as_me:16647: \$? = $ac_status" >&5
16648   (exit "$ac_status"); }; }; then
16649   cf_cv_link_dataonly=yes
16650 else
16651   echo "$as_me: program exited with status $ac_status" >&5
16652 echo "$as_me: failed program was:" >&5
16653 cat "conftest.$ac_ext" >&5
16654 cf_cv_link_dataonly=no
16655 fi
16656 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16657 fi
16658         LIBS="$cf_saveLIBS"
16659
16660 fi
16661
16662 echo "$as_me:16662: result: $cf_cv_link_dataonly" >&5
16663 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
16664
16665 if test "$cf_cv_link_dataonly" = no ; then
16666
16667 cat >>confdefs.h <<\EOF
16668 #define BROKEN_LINKER 1
16669 EOF
16670
16671         BROKEN_LINKER=1
16672 fi
16673
16674 ###     Checks for library functions.
16675
16676 for ac_header in \
16677 unistd.h \
16678
16679 do
16680 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16681 echo "$as_me:16681: checking for $ac_header" >&5
16682 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16683 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16684   echo $ECHO_N "(cached) $ECHO_C" >&6
16685 else
16686   cat >"conftest.$ac_ext" <<_ACEOF
16687 #line 16687 "configure"
16688 #include "confdefs.h"
16689 #include <$ac_header>
16690 _ACEOF
16691 if { (eval echo "$as_me:16691: \"$ac_cpp "conftest.$ac_ext"\"") >&5
16692   (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1
16693   ac_status=$?
16694   $EGREP -v '^ *\+' conftest.er1 >conftest.err
16695   rm -f conftest.er1
16696   cat conftest.err >&5
16697   echo "$as_me:16697: \$? = $ac_status" >&5
16698   (exit "$ac_status"); } >/dev/null; then
16699   if test -s conftest.err; then
16700     ac_cpp_err=$ac_c_preproc_warn_flag
16701   else
16702     ac_cpp_err=
16703   fi
16704 else
16705   ac_cpp_err=yes
16706 fi
16707 if test -z "$ac_cpp_err"; then
16708   eval "$as_ac_Header=yes"
16709 else
16710   echo "$as_me: failed program was:" >&5
16711   cat "conftest.$ac_ext" >&5
16712   eval "$as_ac_Header=no"
16713 fi
16714 rm -f conftest.err "conftest.$ac_ext"
16715 fi
16716 echo "$as_me:16716: result: `eval echo '${'"$as_ac_Header"'}'`" >&5
16717 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6
16718 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then
16719   cat >>confdefs.h <<EOF
16720 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16721 EOF
16722
16723 fi
16724 done
16725
16726 echo "$as_me:16726: checking for working mkstemp" >&5
16727 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
16728 if test "${cf_cv_func_mkstemp+set}" = set; then
16729   echo $ECHO_N "(cached) $ECHO_C" >&6
16730 else
16731
16732 rm -rf ./conftest*
16733 if test "$cross_compiling" = yes; then
16734   cf_cv_func_mkstemp=maybe
16735 else
16736   cat >"conftest.$ac_ext" <<_ACEOF
16737 #line 16737 "configure"
16738 #include "confdefs.h"
16739
16740 #include <sys/types.h>
16741 #ifdef HAVE_UNISTD_H
16742 #include <unistd.h>
16743 #endif
16744 #include <stdlib.h>
16745 #include <stdio.h>
16746 #include <string.h>
16747 #include <sys/stat.h>
16748 int main(void)
16749 {
16750         char *tmpl = "conftestXXXXXX";
16751         char name[2][80];
16752         int n;
16753         int result = 0;
16754         int fd;
16755         struct stat sb;
16756
16757         umask(077);
16758         for (n = 0; n < 2; ++n) {
16759                 strcpy(name[n], tmpl);
16760                 if ((fd = mkstemp(name[n])) >= 0) {
16761                         if (!strcmp(name[n], tmpl)
16762                          || stat(name[n], &sb) != 0
16763                          || (sb.st_mode & S_IFMT) != S_IFREG
16764                          || (sb.st_mode & 077) != 0) {
16765                                 result = 1;
16766                         }
16767                         close(fd);
16768                 }
16769         }
16770         if (result == 0
16771          && !strcmp(name[0], name[1]))
16772                 result = 1;
16773         ${cf_cv_main_return:-return}(result);
16774 }
16775
16776 _ACEOF
16777 rm -f "conftest$ac_exeext"
16778 if { (eval echo "$as_me:16778: \"$ac_link\"") >&5
16779   (eval $ac_link) 2>&5
16780   ac_status=$?
16781   echo "$as_me:16781: \$? = $ac_status" >&5
16782   (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"'
16783   { (eval echo "$as_me:16783: \"$ac_try\"") >&5
16784   (eval $ac_try) 2>&5
16785   ac_status=$?
16786   echo "$as_me:16786: \$? = $ac_status" >&5
16787   (exit "$ac_status"); }; }; then
16788   cf_cv_func_mkstemp=yes
16789
16790 else
16791   echo "$as_me: program exited with status $ac_status" >&5
16792 echo "$as_me: failed program was:" >&5
16793 cat "conftest.$ac_ext" >&5
16794 cf_cv_func_mkstemp=no
16795
16796 fi
16797 rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
16798 fi
16799
16800 fi
16801 echo "$as_me:16801: result: $cf_cv_func_mkstemp" >&5
16802 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
16803 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
16804         echo "$as_me:16804: checking for mkstemp" >&5
16805 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
16806 if test "${ac_cv_func_mkstemp+set}" = set; then
16807   echo $ECHO_N "(cached) $ECHO_C" >&6
16808 else
16809   cat >"conftest.$ac_ext" <<_ACEOF
16810 #line 16810 "configure"
16811 #include "confdefs.h"
16812 #define mkstemp autoconf_temporary
16813 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
16814 #undef mkstemp
16815
16816 #ifdef __cplusplus
16817 extern "C"
16818 #endif
16819
16820 /* We use char because int might match the return type of a gcc2
16821    builtin and then its argument prototype would still apply.  */
16822 char mkstemp (void);
16823
16824 int
16825 main (void)
16826 {
16827
16828 /* The GNU C library defines stubs for functions which it implements
16829     to always fail with ENOSYS.  Some functions are actually named
16830     something starting with __ and the normal name is an alias.  */
16831 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
16832 #error found stub for mkstemp
16833 #endif
16834
16835         return mkstemp ();
16836   ;
16837   return 0;
16838 }
16839 _ACEOF
16840 rm -f "conftest.$ac_objext" "conftest$ac_exeext"
16841 if { (eval echo "$as_me:16841: \"$ac_link\"") >&5
16842   (eval $ac_link) 2>&5
16843   ac_status=$?
16844   echo "$as_me:16844: \$? = $ac_status" >&5
16845   (exit "$ac_status"); } &&
16846          { ac_try='test -s "conftest$ac_exeext"'
16847   { (eval echo "$as_me:16847: \"$ac_try\"") >&5
16848   (eval $ac_try) 2>&5
16849   ac_status=$?
16850   echo "$as_me:16850: \$? = $ac_status" >&5
16851   (exit "$ac_status"); }; }; then
16852   ac_cv_func_mkstemp=yes
16853 else
16854   echo "$as_me: failed program was:" >&5
16855 cat "conftest.$ac_ext" >&5
16856 ac_cv_func_mkstemp=no
16857 fi
16858 rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext"
16859 fi
16860 echo "$as_me:16860: result: $ac_cv_func_mkstemp" >&5
16861 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
16862
16863 fi
16864 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
16865
16866 cat >>confdefs.h <<\EOF
16867 #define HAVE_MKSTEMP 1
16868 EOF
16869
16870 fi
16871
16872 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
16873         CFLAGS=`echo "${CFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[        ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16874         CXXFLAGS=`echo "${CXXFLAGS}" | sed -e 's%-g %%' -e 's%-g$%%' -e 's%[    ]% %g' -e 's% [ ]*% %g' -e 's%^ %%' -e 's% $%%'`
16875 fi
16876
16877 cf_with_ada=yes
16878 if test "$cf_with_ada" != "no" ; then
16879
16880 for cf_prog_gnat in gnat gnatmake gprconfig gprbuild
16881 do
16882
16883 cf_upper_prog_gnat=`echo "${cf_prog_gnat}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16884
16885         unset ac_cv_path_cf_TEMP_gnat
16886         unset cf_TEMP_gnat
16887         # Extract the first word of "$cf_prog_gnat", so it can be a program name with args.
16888 set dummy $cf_prog_gnat; ac_word=$2
16889 echo "$as_me:16889: checking for $ac_word" >&5
16890 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16891 if test "${ac_cv_path_cf_TEMP_gnat+set}" = set; then
16892   echo $ECHO_N "(cached) $ECHO_C" >&6
16893 else
16894   case $cf_TEMP_gnat in
16895   [\\/]* | ?:[\\/]*)
16896   ac_cv_path_cf_TEMP_gnat="$cf_TEMP_gnat" # Let the user override the test with a path.
16897   ;;
16898   *)
16899   ac_save_IFS=$IFS; IFS=$ac_path_separator
16900 ac_dummy="$PATH"
16901 for ac_dir in $ac_dummy; do
16902   IFS=$ac_save_IFS
16903   test -z "$ac_dir" && ac_dir=.
16904   if $as_executable_p "$ac_dir/$ac_word"; then
16905    ac_cv_path_cf_TEMP_gnat="$ac_dir/$ac_word"
16906    echo "$as_me:16906: found $ac_dir/$ac_word" >&5
16907    break
16908 fi
16909 done
16910
16911   test -z "$ac_cv_path_cf_TEMP_gnat" && ac_cv_path_cf_TEMP_gnat="no"
16912   ;;
16913 esac
16914 fi
16915 cf_TEMP_gnat=$ac_cv_path_cf_TEMP_gnat
16916
16917 if test -n "$cf_TEMP_gnat"; then
16918   echo "$as_me:16918: result: $cf_TEMP_gnat" >&5
16919 echo "${ECHO_T}$cf_TEMP_gnat" >&6
16920 else
16921   echo "$as_me:16921: result: no" >&5
16922 echo "${ECHO_T}no" >&6
16923 fi
16924
16925         eval "cf_cv_PATH_$cf_upper_prog_gnat=$ac_cv_path_cf_TEMP_gnat"
16926
16927         if test "x$cf_TEMP_gnat" != xno; then
16928                 unset cf_cv_gnat_version
16929                 unset cf_TEMP_gnat
16930
16931 echo "$as_me:16931: checking for $cf_prog_gnat version" >&5
16932 echo $ECHO_N "checking for $cf_prog_gnat version... $ECHO_C" >&6
16933 if test "${cf_cv_gnat_version+set}" = set; then
16934   echo $ECHO_N "(cached) $ECHO_C" >&6
16935 else
16936
16937 cf_cv_gnat_version=`$cf_prog_gnat --version 2>&1 | \
16938         grep '[0-9].[0-9][0-9]*' |\
16939         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
16940
16941 fi
16942 echo "$as_me:16942: result: $cf_cv_gnat_version" >&5
16943 echo "${ECHO_T}$cf_cv_gnat_version" >&6
16944 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
16945 eval cf_TEMP_gnat=$cf_cv_gnat_version; unset cf_cv_gnat_version
16946
16947         fi
16948         eval "cf_cv_VERSION_$cf_upper_prog_gnat=$cf_TEMP_gnat"
16949
16950         unset cf_TEMP_gnat
16951         unset cf_cv_gnat_version
16952         unset ac_cv_path_cf_TEMP_gnat
16953 done
16954
16955 if test "x$cf_cv_VERSION_GNATMAKE" = "xno"; then
16956         cf_ada_make=
16957         cf_cv_prog_gnat_correct=no
16958 else
16959         cf_ada_make=gnatmake
16960         if test "x$cf_cv_VERSION_GPRCONFIG" = "xno"; then
16961                 # gprconfig is newer than gnatmake; we can continue...
16962                 cf_ada_config="##"
16963         else
16964                 rm -rf ./conftest* ./*~conftest*
16965                 if mkdir conftest.src
16966                 then
16967                         cf_ada_config=""
16968                         cd conftest.src
16969                         for cf_gprconfig in Ada C
16970                         do
16971                                 echo "$as_me:16971: checking for gprconfig name for $cf_gprconfig" >&5
16972 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
16973                                 if test "$cf_gprconfig" = C
16974                                 then
16975                                         for cf_gprconfig_param in \
16976                                                 "$cf_gprconfig,,,,GNATGCC" \
16977                                                 "$cf_gprconfig,,,,GCC" \
16978                                                 "$cf_gprconfig"
16979                                         do
16980                                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16981                                                 test -n "$cf_gprconfig_value" && break
16982                                         done
16983                                 else
16984                                         cf_gprconfig_param=$cf_gprconfig
16985                                         cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig_param 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
16986                                 fi
16987                                 if test -n "$cf_gprconfig_value"
16988                                 then
16989                                         eval "cf_ada_config_$cf_gprconfig=$cf_gprconfig_value"
16990                                         echo "$as_me:16990: result: $cf_gprconfig_value" >&5
16991 echo "${ECHO_T}$cf_gprconfig_value" >&6
16992                                 else
16993                                         echo "$as_me:16993: result: missing" >&5
16994 echo "${ECHO_T}missing" >&6
16995                                         cf_ada_config="#"
16996                                         break
16997                                 fi
16998                         done
16999                         cd ..
17000                         rm -rf ./conftest* ./*~conftest*
17001                 fi
17002         fi
17003         if test "x$cf_ada_config" != "x#"
17004         then
17005
17006 echo "$as_me:17006: checking for gnat version" >&5
17007 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
17008 if test "${cf_cv_gnat_version+set}" = set; then
17009   echo $ECHO_N "(cached) $ECHO_C" >&6
17010 else
17011
17012 cf_cv_gnat_version=`${cf_ada_make:-gnatmake} --version 2>&1 | \
17013         grep '[0-9].[0-9][0-9]*' |\
17014         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
17015
17016 fi
17017 echo "$as_me:17017: result: $cf_cv_gnat_version" >&5
17018 echo "${ECHO_T}$cf_cv_gnat_version" >&6
17019 test -z "$cf_cv_gnat_version" && cf_cv_gnat_version=no
17020
17021 case "$cf_cv_gnat_version" in
17022 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17023         cf_cv_prog_gnat_correct=yes
17024         ;;
17025 (*)
17026         { echo "$as_me:17026: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
17027 echo "$as_me: WARNING: Unsupported GNAT version $cf_cv_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
17028         cf_cv_prog_gnat_correct=no
17029         ;;
17030 esac
17031
17032                 # Extract the first word of "m4", so it can be a program name with args.
17033 set dummy m4; ac_word=$2
17034 echo "$as_me:17034: checking for $ac_word" >&5
17035 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17036 if test "${ac_cv_prog_M4_exists+set}" = set; then
17037   echo $ECHO_N "(cached) $ECHO_C" >&6
17038 else
17039   if test -n "$M4_exists"; then
17040   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
17041 else
17042   ac_save_IFS=$IFS; IFS=$ac_path_separator
17043 ac_dummy="$PATH"
17044 for ac_dir in $ac_dummy; do
17045   IFS=$ac_save_IFS
17046   test -z "$ac_dir" && ac_dir=.
17047   $as_executable_p "$ac_dir/$ac_word" || continue
17048 ac_cv_prog_M4_exists="yes"
17049 echo "$as_me:17049: found $ac_dir/$ac_word" >&5
17050 break
17051 done
17052
17053   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
17054 fi
17055 fi
17056 M4_exists=$ac_cv_prog_M4_exists
17057 if test -n "$M4_exists"; then
17058   echo "$as_me:17058: result: $M4_exists" >&5
17059 echo "${ECHO_T}$M4_exists" >&6
17060 else
17061   echo "$as_me:17061: result: no" >&5
17062 echo "${ECHO_T}no" >&6
17063 fi
17064
17065                 if test "$ac_cv_prog_M4_exists" = no; then
17066                         cf_cv_prog_gnat_correct=no
17067                         { echo "$as_me:17067: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&5
17068 echo "$as_me: WARNING: Ada95 binding required program m4 not found. Ada95 binding disabled" >&2;}
17069                 fi
17070                 if test "$cf_cv_prog_gnat_correct" = yes; then
17071                         echo "$as_me:17071: checking if GNAT works" >&5
17072 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
17073
17074 rm -rf ./conftest* ./*~conftest*
17075 cat >>conftest.ads <<CF_EOF
17076 procedure conftest;
17077 CF_EOF
17078 cat >>conftest.adb <<CF_EOF
17079 with Text_IO;
17080 with GNAT.OS_Lib;
17081 procedure conftest is
17082 begin
17083    Text_IO.Put ("Hello World");
17084    Text_IO.New_Line;
17085    GNAT.OS_Lib.OS_Exit (0);
17086 end conftest;
17087 CF_EOF
17088 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17089    if ( ./conftest 1>&5 2>&1 ) ; then
17090       cf_cv_prog_gnat_correct=yes
17091    else
17092       cf_cv_prog_gnat_correct=no
17093    fi
17094 else
17095    cf_cv_prog_gnat_correct=no
17096 fi
17097 rm -rf ./conftest* ./*~conftest*
17098
17099                         echo "$as_me:17099: result: $cf_cv_prog_gnat_correct" >&5
17100 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
17101                 fi
17102         else
17103                 cf_cv_prog_gnat_correct=no
17104         fi
17105 fi
17106
17107         if test "$cf_cv_prog_gnat_correct" = yes; then
17108
17109         echo "$as_me:17109: checking optimization options for ADAFLAGS" >&5
17110 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
17111         case "$CFLAGS" in
17112         (*-g*)
17113
17114         ADAFLAGS="$ADAFLAGS -g"
17115
17116                 ;;
17117         esac
17118         case "$CFLAGS" in
17119         (*-O*)
17120                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
17121
17122         ADAFLAGS="$ADAFLAGS $cf_O_flag"
17123
17124                 ;;
17125         esac
17126         echo "$as_me:17126: result: $ADAFLAGS" >&5
17127 echo "${ECHO_T}$ADAFLAGS" >&6
17128
17129 echo "$as_me:17129: checking if GNATPREP supports -T option" >&5
17130 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
17131 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
17132   echo $ECHO_N "(cached) $ECHO_C" >&6
17133 else
17134
17135 cf_cv_gnatprep_opt_t=no
17136 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
17137
17138 fi
17139 echo "$as_me:17139: result: $cf_cv_gnatprep_opt_t" >&5
17140 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
17141 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
17142
17143 echo "$as_me:17143: checking if GNAT supports generics" >&5
17144 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
17145 case "$cf_cv_gnat_version" in
17146 (3.1[1-9]*|3.[2-9]*|[4-9].*|[1-9][0-9].[0-9]*|20[0-9][0-9])
17147         cf_gnat_generics=yes
17148         ;;
17149 (*)
17150         cf_gnat_generics=no
17151         ;;
17152 esac
17153 echo "$as_me:17153: result: $cf_gnat_generics" >&5
17154 echo "${ECHO_T}$cf_gnat_generics" >&6
17155
17156 if test "$cf_gnat_generics" = yes
17157 then
17158         cf_compile_generics=generics
17159         cf_generic_objects="\${GENOBJS}"
17160 else
17161         cf_compile_generics=
17162         cf_generic_objects=
17163 fi
17164
17165 echo "$as_me:17165: checking if GNAT supports SIGINT" >&5
17166 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
17167 if test "${cf_cv_gnat_sigint+set}" = set; then
17168   echo $ECHO_N "(cached) $ECHO_C" >&6
17169 else
17170
17171 rm -rf ./conftest* ./*~conftest*
17172 cat >>conftest.ads <<CF_EOF
17173 with Ada.Interrupts.Names;
17174
17175 package ConfTest is
17176
17177    pragma Warnings (Off);  --  the next pragma exists since 3.11p
17178    pragma Unreserve_All_Interrupts;
17179    pragma Warnings (On);
17180
17181    protected Process is
17182       procedure Stop;
17183       function Continue return Boolean;
17184       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
17185    private
17186       Done : Boolean := False;
17187    end Process;
17188
17189 end ConfTest;
17190 CF_EOF
17191 cat >>conftest.adb <<CF_EOF
17192 package body ConfTest is
17193    protected body Process is
17194       procedure Stop is
17195       begin
17196          Done := True;
17197       end Stop;
17198       function Continue return Boolean is
17199       begin
17200          return not Done;
17201       end Continue;
17202    end Process;
17203 end ConfTest;
17204 CF_EOF
17205 if ( "$cf_ada_make" $ADAFLAGS conftest 1>&5 2>&1 ) ; then
17206       cf_cv_gnat_sigint=yes
17207 else
17208    cf_cv_gnat_sigint=no
17209 fi
17210 rm -rf ./conftest* ./*~conftest*
17211
17212 fi
17213 echo "$as_me:17213: result: $cf_cv_gnat_sigint" >&5
17214 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
17215
17216 if test "$cf_cv_gnat_sigint" = yes ; then
17217         USE_GNAT_SIGINT=""
17218 else
17219         USE_GNAT_SIGINT="#"
17220 fi
17221
17222 cf_gnat_libraries=no
17223 cf_gnat_projects=no
17224
17225 if test "$enable_gnat_projects" != no ; then
17226 echo "$as_me:17226: checking if GNAT supports project files" >&5
17227 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
17228 case "$cf_cv_gnat_version" in
17229 (3.[0-9]*)
17230         ;;
17231 (*)
17232         case "$cf_cv_system_name" in
17233         (cygwin*|msys*)
17234                 ;;
17235         (*)
17236                 rm -rf ./conftest* ./*~conftest*
17237                 if mkdir conftest.src conftest.bin conftest.lib
17238                 then
17239                         cd conftest.src
17240                         rm -rf ./conftest* ./*~conftest*
17241                         cat >>library.gpr <<CF_EOF
17242 project Library is
17243   Kind := External ("LIB_KIND");
17244   for Library_Name use "ConfTest";
17245   for Object_Dir use ".";
17246   for Library_ALI_Dir use External("LIBRARY_DIR");
17247   for Library_Version use External ("SONAME");
17248   for Library_Kind use Kind;
17249   for Library_Dir use External("BUILD_DIR");
17250   Source_Dir := External ("SOURCE_DIR");
17251   for Source_Dirs use (Source_Dir);
17252 end Library;
17253 CF_EOF
17254                         cat >>confpackage.ads <<CF_EOF
17255 package ConfPackage is
17256    procedure conftest;
17257 end ConfPackage;
17258 CF_EOF
17259                         cat >>confpackage.adb <<CF_EOF
17260 with Text_IO;
17261 package body ConfPackage is
17262    procedure conftest is
17263    begin
17264       Text_IO.Put ("Hello World");
17265       Text_IO.New_Line;
17266    end conftest;
17267 end ConfPackage;
17268 CF_EOF
17269                         if ( "$cf_ada_make" $ADAFLAGS \
17270                                         -Plibrary.gpr \
17271                                         -XBUILD_DIR="`cd ../conftest.bin;pwd`" \
17272                                         -XLIBRARY_DIR="`cd ../conftest.lib;pwd`" \
17273                                         -XSOURCE_DIR="`pwd`" \
17274                                         -XSONAME=libConfTest.so.1 \
17275                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
17276                                 cf_gnat_projects=yes
17277                         fi
17278                         cd ..
17279                 fi
17280                 if test -f conftest.lib/confpackage.ali
17281                 then
17282                         cf_gnat_libraries=yes
17283                 fi
17284                 rm -rf ./conftest* ./*~conftest*
17285                 ;;
17286         esac
17287         ;;
17288 esac
17289 echo "$as_me:17289: result: $cf_gnat_projects" >&5
17290 echo "${ECHO_T}$cf_gnat_projects" >&6
17291 fi # enable_gnat_projects
17292
17293 if test "$cf_gnat_projects" = yes
17294 then
17295         echo "$as_me:17295: checking if GNAT supports libraries" >&5
17296 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
17297         echo "$as_me:17297: result: $cf_gnat_libraries" >&5
17298 echo "${ECHO_T}$cf_gnat_libraries" >&6
17299 fi
17300
17301 USE_OLD_MAKERULES=""
17302 USE_GNAT_PROJECTS="#"
17303 USE_GNAT_MAKE_GPR="#"
17304 USE_GNAT_GPRBUILD="#"
17305
17306 if test "$cf_gnat_projects" = yes
17307 then
17308         USE_OLD_MAKERULES="#"
17309         USE_GNAT_PROJECTS=""
17310         if test "$cf_cv_VERSION_GPRBUILD" != no
17311         then
17312                 USE_GNAT_GPRBUILD=""
17313         elif test "$cf_cv_VERSION_GNATMAKE" != no
17314         then
17315                 USE_GNAT_MAKE_GPR=""
17316         else
17317                 { echo "$as_me:17317: WARNING: use old makefile rules since tools are missing" >&5
17318 echo "$as_me: WARNING: use old makefile rules since tools are missing" >&2;}
17319         fi
17320 fi
17321
17322 if test "$cf_gnat_libraries" = yes
17323 then
17324         USE_GNAT_LIBRARIES=""
17325 else
17326         USE_GNAT_LIBRARIES="#"
17327 fi
17328
17329 echo "$as_me:17329: checking for ada-compiler" >&5
17330 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
17331
17332 # Check whether --with-ada-compiler or --without-ada-compiler was given.
17333 if test "${with_ada_compiler+set}" = set; then
17334   withval="$with_ada_compiler"
17335   cf_ada_compiler=$withval
17336 else
17337   cf_ada_compiler=gnatmake
17338 fi;
17339
17340 echo "$as_me:17340: result: $cf_ada_compiler" >&5
17341 echo "${ECHO_T}$cf_ada_compiler" >&6
17342
17343                 cf_ada_package=terminal_interface
17344
17345 echo "$as_me:17345: checking for ada-include" >&5
17346 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
17347
17348 # Check whether --with-ada-include or --without-ada-include was given.
17349 if test "${with_ada_include+set}" = set; then
17350   withval="$with_ada_include"
17351
17352 else
17353   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
17354 fi; if test -n "$prefix/share/ada/adainclude" ; then
17355
17356 if test "x$prefix" != xNONE; then
17357         cf_path_syntax="$prefix"
17358 else
17359         cf_path_syntax="$ac_default_prefix"
17360 fi
17361
17362 case ".$withval" in
17363 (.\$\(*\)*|.\'*\'*)
17364         ;;
17365 (..|./*|.\\*)
17366         ;;
17367 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17368         ;;
17369 (.\$\{*prefix\}*|.\$\{*dir\}*)
17370         eval withval="$withval"
17371         case ".$withval" in
17372         (.NONE/*)
17373                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17374                 ;;
17375         esac
17376         ;;
17377 (.no|.NONE/*)
17378         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17379         ;;
17380 (*)
17381         { { echo "$as_me:17381: error: expected a pathname, not \"$withval\"" >&5
17382 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17383    { (exit 1); exit 1; }; }
17384         ;;
17385 esac
17386
17387 fi
17388 eval ADA_INCLUDE="$withval"
17389
17390 echo "$as_me:17390: result: $ADA_INCLUDE" >&5
17391 echo "${ECHO_T}$ADA_INCLUDE" >&6
17392
17393 echo "$as_me:17393: checking for ada-objects" >&5
17394 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
17395
17396 # Check whether --with-ada-objects or --without-ada-objects was given.
17397 if test "${with_ada_objects+set}" = set; then
17398   withval="$with_ada_objects"
17399
17400 else
17401   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
17402 fi; if test -n "$prefix/lib/ada/adalib" ; then
17403
17404 if test "x$prefix" != xNONE; then
17405         cf_path_syntax="$prefix"
17406 else
17407         cf_path_syntax="$ac_default_prefix"
17408 fi
17409
17410 case ".$withval" in
17411 (.\$\(*\)*|.\'*\'*)
17412         ;;
17413 (..|./*|.\\*)
17414         ;;
17415 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
17416         ;;
17417 (.\$\{*prefix\}*|.\$\{*dir\}*)
17418         eval withval="$withval"
17419         case ".$withval" in
17420         (.NONE/*)
17421                 withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17422                 ;;
17423         esac
17424         ;;
17425 (.no|.NONE/*)
17426         withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%`
17427         ;;
17428 (*)
17429         { { echo "$as_me:17429: error: expected a pathname, not \"$withval\"" >&5
17430 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
17431    { (exit 1); exit 1; }; }
17432         ;;
17433 esac
17434
17435 fi
17436 eval ADA_OBJECTS="$withval"
17437
17438 echo "$as_me:17438: result: $ADA_OBJECTS" >&5
17439 echo "${ECHO_T}$ADA_OBJECTS" >&6
17440
17441 echo "$as_me:17441: checking if an Ada95 shared-library should be built" >&5
17442 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
17443
17444 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
17445 if test "${with_ada_sharedlib+set}" = set; then
17446   withval="$with_ada_sharedlib"
17447   with_ada_sharedlib=$withval
17448 else
17449   with_ada_sharedlib=no
17450 fi;
17451 echo "$as_me:17451: result: $with_ada_sharedlib" >&5
17452 echo "${ECHO_T}$with_ada_sharedlib" >&6
17453
17454 if test "x$with_ada_sharedlib" != xno
17455 then
17456         if test "x$cf_gnat_projects" != xyes
17457         then
17458                 { echo "$as_me:17458: WARNING: disabling shared-library since GNAT projects are not supported" >&5
17459 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
17460                 with_ada_sharedlib=no
17461         fi
17462 fi
17463
17464 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
17465 MAKE_ADA_SHAREDLIB="#"
17466
17467 if test "x$with_ada_sharedlib" != xno
17468 then
17469         MAKE_ADA_SHAREDLIB=
17470         if test "x$with_ada_sharedlib" != xyes
17471         then
17472                 ADA_SHAREDLIB="$with_ada_sharedlib"
17473         fi
17474 fi
17475
17476                 # allow the Ada binding to be renamed
17477
17478 echo "$as_me:17478: checking for ada-libname" >&5
17479 echo $ECHO_N "checking for ada-libname... $ECHO_C" >&6
17480
17481 # Check whether --with-ada-libname or --without-ada-libname was given.
17482 if test "${with_ada_libname+set}" = set; then
17483   withval="$with_ada_libname"
17484   ADA_LIBNAME=$withval
17485 else
17486   ADA_LIBNAME=AdaCurses
17487 fi;
17488 case "x$ADA_LIBNAME" in
17489 (x|xyes|xno)
17490         ADA_LIBNAME=AdaCurses
17491         ;;
17492 esac
17493
17494 echo "$as_me:17494: result: $ADA_LIBNAME" >&5
17495 echo "${ECHO_T}$ADA_LIBNAME" >&6
17496
17497         else
17498                 { { echo "$as_me:17498: error: No usable Ada compiler found" >&5
17499 echo "$as_me: error: No usable Ada compiler found" >&2;}
17500    { (exit 1); exit 1; }; }
17501         fi
17502 else
17503         { { echo "$as_me:17503: error: The Ada compiler is needed for this package" >&5
17504 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
17505    { (exit 1); exit 1; }; }
17506 fi
17507
17508 ################################################################################
17509
17510 # not needed
17511 TINFO_LDFLAGS2=
17512
17513 TINFO_LIBS=
17514
17515 ### Construct the list of include-directories to be generated
17516
17517 if test "$srcdir" != "."; then
17518         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
17519 fi
17520 CPPFLAGS="-I../include $CPPFLAGS"
17521 if test "$srcdir" != "."; then
17522         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
17523 fi
17524 CPPFLAGS="-I. $CPPFLAGS"
17525
17526 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
17527 if test "$srcdir" != "."; then
17528         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
17529 fi
17530 if test "$GCC" != yes; then
17531         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17532 elif test "$includedir" != "/usr/include"; then
17533         if test "$includedir" = '${prefix}/include' ; then
17534                 if test x$prefix != x/usr ; then
17535                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17536                 fi
17537         else
17538                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
17539         fi
17540 fi
17541
17542 ### Build up pieces for makefile rules
17543 echo "$as_me:17543: checking default library suffix" >&5
17544 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
17545
17546         case $DFT_LWR_MODEL in
17547         (libtool) DFT_ARG_SUFFIX=''   ;;
17548         (normal)  DFT_ARG_SUFFIX=''   ;;
17549         (debug)   DFT_ARG_SUFFIX='_g' ;;
17550         (profile) DFT_ARG_SUFFIX='_p' ;;
17551         (shared)  DFT_ARG_SUFFIX=''   ;;
17552         esac
17553         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
17554 echo "$as_me:17554: result: $DFT_ARG_SUFFIX" >&5
17555 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
17556
17557 echo "$as_me:17557: checking default library-dependency suffix" >&5
17558 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
17559
17560         case X$DFT_LWR_MODEL in
17561         (Xlibtool)
17562                 DFT_LIB_SUFFIX='.la'
17563                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17564                 ;;
17565         (Xdebug)
17566                 case "$cf_cv_system_name" in
17567                 (*-msvc*)
17568                         DFT_LIB_SUFFIX='_g.lib'
17569                         ;;
17570                 (*)
17571                         DFT_LIB_SUFFIX='_g.a'
17572                         ;;
17573                 esac
17574                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17575                 ;;
17576         (Xprofile)
17577                 case "$cf_cv_system_name" in
17578                 (*-msvc*)
17579                         DFT_LIB_SUFFIX='_p.lib'
17580                         ;;
17581                 (*)
17582                         DFT_LIB_SUFFIX='_p.a'
17583                         ;;
17584                 esac
17585                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17586                 ;;
17587         (Xshared)
17588                 case "$cf_cv_system_name" in
17589                 (aix[5-7]*)
17590                         DFT_LIB_SUFFIX='.so'
17591                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17592                         ;;
17593                 (*-msvc*)
17594                         DFT_LIB_SUFFIX='.dll'
17595                         DFT_DEP_SUFFIX='.dll.lib'
17596                         ;;
17597                 (cygwin*|msys*|mingw*)
17598                         DFT_LIB_SUFFIX='.dll'
17599                         DFT_DEP_SUFFIX='.dll.a'
17600                         ;;
17601                 (darwin*)
17602                         DFT_LIB_SUFFIX='.dylib'
17603                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17604                         ;;
17605                 (hpux*)
17606                         case "$target" in
17607                         (ia64*)
17608                                 DFT_LIB_SUFFIX='.so'
17609                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17610                                 ;;
17611                         (*)
17612                                 DFT_LIB_SUFFIX='.sl'
17613                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17614                                 ;;
17615                         esac
17616                         ;;
17617                 (*)
17618                         DFT_LIB_SUFFIX='.so'
17619                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17620                         ;;
17621                 esac
17622                 ;;
17623         (*)
17624                 case "$target" in
17625                 (*-msvc*)
17626                         DFT_LIB_SUFFIX='.lib'
17627                         ;;
17628                 (*)
17629                         DFT_LIB_SUFFIX='.a'
17630                         ;;
17631                 esac
17632                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
17633                 ;;
17634         esac
17635         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
17636         then
17637                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
17638                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
17639         fi
17640 echo "$as_me:17640: result: $DFT_DEP_SUFFIX" >&5
17641 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
17642
17643 echo "$as_me:17643: checking default object directory" >&5
17644 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
17645
17646         case $DFT_LWR_MODEL in
17647         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
17648         (normal)  DFT_OBJ_SUBDIR='objects' ;;
17649         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
17650         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
17651         (shared)
17652                 case "$cf_cv_system_name" in
17653                 (cygwin|msys)
17654                         DFT_OBJ_SUBDIR='objects' ;;
17655                 (*)
17656                         DFT_OBJ_SUBDIR='obj_s' ;;
17657                 esac
17658         esac
17659 echo "$as_me:17659: result: $DFT_OBJ_SUBDIR" >&5
17660 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
17661
17662 ### Set up low-level terminfo dependencies for makefiles.
17663
17664 if test "$DFT_LWR_MODEL" = shared ; then
17665         case $cf_cv_system_name in
17666         (cygwin*)
17667                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
17668                 ;;
17669         (msys*)
17670                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
17671                 ;;
17672         esac
17673 fi
17674
17675 USE_ARG_SUFFIX=${DFT_ARG_SUFFIX}
17676
17677 USE_LIB_SUFFIX=${DFT_ARG_SUFFIX}
17678
17679 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
17680
17681 ### Construct the list of subdirectories for which we'll customize makefiles
17682 ### with the appropriate compile-rules.
17683
17684 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
17685
17686 cat >>confdefs.h <<EOF
17687 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
17688 EOF
17689
17690 ################################################################################
17691
17692 TEST_ARG2=
17693
17694 TEST_LIBS2=
17695
17696 NCURSES_SHLIB2="sh -c"
17697
17698 ADA_SUBDIRS="include gen src doc"
17699 if test "x$cf_with_tests" != "xno" ; then
17700         ADA_SUBDIRS="$ADA_SUBDIRS samples"
17701 fi
17702 for cf_dir in $ADA_SUBDIRS
17703 do
17704         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
17705 done
17706
17707 NCURSES_TREE="#"
17708
17709 EXTERNAL_TREE=
17710
17711 # match layout used by make-tar.sh
17712 ADAHTML_DIR=../doc/ada
17713
17714 if test "x$cross_compiling" = xyes ; then
17715         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
17716 else
17717         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
17718 fi
17719
17720 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"
17721 ac_config_commands="$ac_config_commands default"
17722 cat >confcache <<\_ACEOF
17723 # This file is a shell script that caches the results of configure
17724 # tests run on this system so they can be shared between configure
17725 # scripts and configure runs, see configure's option --config-cache.
17726 # It is not useful on other systems.  If it contains results you don't
17727 # want to keep, you may remove or edit it.
17728 #
17729 # config.status only pays attention to the cache file if you give it
17730 # the --recheck option to rerun configure.
17731 #
17732 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17733 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17734 # following values.
17735
17736 _ACEOF
17737
17738 # The following way of writing the cache mishandles newlines in values,
17739 # but we know of no workaround that is simple, portable, and efficient.
17740 # So, don't put newlines in cache variables' values.
17741 # Ultrix sh set writes to stderr and can't be redirected directly,
17742 # and sets the high bit in the cache file unless we assign to the vars.
17743 {
17744   (set) 2>&1 |
17745     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17746     *ac_space=\ *)
17747       # `set' does not quote correctly, so add quotes (double-quote
17748       # substitution turns \\\\ into \\, and sed turns \\ into \).
17749       sed -n \
17750         "s/'/'\\\\''/g;
17751           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17752       ;;
17753     *)
17754       # `set' quotes correctly as required by POSIX, so do not add quotes.
17755       sed -n \
17756         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17757       ;;
17758     esac;
17759 } |
17760   sed '
17761      t clear
17762      : clear
17763      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17764      t end
17765      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17766      : end' >>confcache
17767 if cmp -s $cache_file confcache; then :; else
17768   if test -w $cache_file; then
17769     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17770     cat confcache >$cache_file
17771   else
17772     echo "not updating unwritable cache $cache_file"
17773   fi
17774 fi
17775 rm -f confcache
17776
17777 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17778 # Let make expand exec_prefix.
17779 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17780
17781 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17782 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17783 # trailing colons and then remove the whole line if VPATH becomes empty
17784 # (actually we leave an empty line to preserve line numbers).
17785 if test "x$srcdir" = x.; then
17786   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17787 s/:*\$(srcdir):*/:/;
17788 s/:*\${srcdir}:*/:/;
17789 s/:*@srcdir@:*/:/;
17790 s/^\([^=]*=[    ]*\):*/\1/;
17791 s/:*$//;
17792 s/^[^=]*=[      ]*$//;
17793 }'
17794 fi
17795
17796 DEFS=-DHAVE_CONFIG_H
17797
17798 : "${CONFIG_STATUS=./config.status}"
17799 ac_clean_files_save=$ac_clean_files
17800 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17801 { echo "$as_me:17801: creating $CONFIG_STATUS" >&5
17802 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17803 cat >"$CONFIG_STATUS" <<_ACEOF
17804 #! $SHELL
17805 # Generated automatically by configure.
17806 # Run this file to recreate the current configuration.
17807 # Compiler output produced by configure, useful for debugging
17808 # configure, is in config.log if it exists.
17809
17810 debug=false
17811 SHELL=\${CONFIG_SHELL-$SHELL}
17812 ac_cs_invocation="\$0 \$@"
17813
17814 CLICOLOR_FORCE= GREP_OPTIONS=
17815 unset CLICOLOR_FORCE GREP_OPTIONS
17816 _ACEOF
17817
17818 cat >>"$CONFIG_STATUS" <<\_ACEOF
17819 # Be Bourne compatible
17820 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17821   emulate sh
17822   NULLCMD=:
17823 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17824   set -o posix
17825 fi
17826
17827 # Name of the executable.
17828 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17829
17830 if expr a : '\(a\)' >/dev/null 2>&1; then
17831   as_expr=expr
17832 else
17833   as_expr=false
17834 fi
17835
17836 rm -f conf$$ conf$$.exe conf$$.file
17837 echo >conf$$.file
17838 if ln -s conf$$.file conf$$ 2>/dev/null; then
17839   # We could just check for DJGPP; but this test a) works b) is more generic
17840   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17841   if test -f conf$$.exe; then
17842     # Don't use ln at all; we don't have any links
17843     as_ln_s='cp -p'
17844   else
17845     as_ln_s='ln -s'
17846   fi
17847 elif ln conf$$.file conf$$ 2>/dev/null; then
17848   as_ln_s=ln
17849 else
17850   as_ln_s='cp -p'
17851 fi
17852 rm -f conf$$ conf$$.exe conf$$.file
17853
17854 as_executable_p="test -f"
17855
17856 # Support unset when possible.
17857 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17858   as_unset="unset"
17859 else
17860   as_unset="false"
17861 fi
17862
17863 # NLS nuisances.
17864 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17865 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17866 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17867 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17868 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17869 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17870 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17871 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17872
17873 # IFS
17874 # We need space, tab and new line, in precisely that order.
17875 as_nl='
17876 '
17877 IFS="   $as_nl"
17878
17879 # CDPATH.
17880 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17881
17882 exec 6>&1
17883
17884 _ACEOF
17885
17886 # Files that config.status was made for.
17887 if test -n "$ac_config_files"; then
17888   echo "config_files=\"$ac_config_files\"" >>"$CONFIG_STATUS"
17889 fi
17890
17891 if test -n "$ac_config_headers"; then
17892   echo "config_headers=\"$ac_config_headers\"" >>"$CONFIG_STATUS"
17893 fi
17894
17895 if test -n "$ac_config_links"; then
17896   echo "config_links=\"$ac_config_links\"" >>"$CONFIG_STATUS"
17897 fi
17898
17899 if test -n "$ac_config_commands"; then
17900   echo "config_commands=\"$ac_config_commands\"" >>"$CONFIG_STATUS"
17901 fi
17902
17903 cat >>"$CONFIG_STATUS" <<\EOF
17904
17905 ac_cs_usage="\
17906 \`$as_me' instantiates files from templates according to the
17907 current configuration.
17908
17909 Usage: $0 [OPTIONS] [FILE]...
17910
17911   -h, --help       print this help, then exit
17912   -V, --version    print version number, then exit
17913   -d, --debug      don't remove temporary files
17914       --recheck    update $as_me by reconfiguring in the same conditions
17915   --file=FILE[:TEMPLATE]
17916                    instantiate the configuration file FILE
17917   --header=FILE[:TEMPLATE]
17918                    instantiate the configuration header FILE
17919
17920 Configuration files:
17921 $config_files
17922
17923 Configuration headers:
17924 $config_headers
17925
17926 Configuration commands:
17927 $config_commands
17928
17929 Report bugs to <dickey@invisible-island.net>."
17930 EOF
17931
17932 cat >>"$CONFIG_STATUS" <<EOF
17933 ac_cs_version="\\
17934 config.status
17935 configured by $0, generated by GNU Autoconf 2.52.20210105,
17936   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17937
17938 Copyright 2003-2020,2021        Thomas E. Dickey
17939 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17940 Free Software Foundation, Inc.
17941 This config.status script is free software; the Free Software Foundation
17942 gives unlimited permission to copy, distribute and modify it."
17943 srcdir="$srcdir"
17944 INSTALL="$INSTALL"
17945 EOF
17946
17947 cat >>"$CONFIG_STATUS" <<\EOF
17948 # If no file are specified by the user, then we need to provide default
17949 # value.  By we need to know if files were specified by the user.
17950 ac_need_defaults=:
17951 while test $# != 0
17952 do
17953   case $1 in
17954   --*=*)
17955     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17956     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17957     shift
17958     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17959     shift
17960     ;;
17961   -*);;
17962   *) # This is not an option, so the user has probably given explicit
17963      # arguments.
17964      ac_need_defaults=false;;
17965   esac
17966
17967   case $1 in
17968   # Handling of the options.
17969 EOF
17970 cat >>"$CONFIG_STATUS" <<EOF
17971   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17972     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17973     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17974 EOF
17975 cat >>"$CONFIG_STATUS" <<\EOF
17976   --version | --vers* | -V )
17977     echo "$ac_cs_version"; exit 0 ;;
17978   --he | --h)
17979     # Conflict between --help and --header
17980     { { echo "$as_me:17980: error: ambiguous option: $1
17981 Try \`$0 --help' for more information." >&5
17982 echo "$as_me: error: ambiguous option: $1
17983 Try \`$0 --help' for more information." >&2;}
17984    { (exit 1); exit 1; }; };;
17985   --help | --hel | -h )
17986     echo "$ac_cs_usage"; exit 0 ;;
17987   --debug | --d* | -d )
17988     debug=: ;;
17989   --file | --fil | --fi | --f )
17990     shift
17991     CONFIG_FILES="$CONFIG_FILES $1"
17992     ac_need_defaults=false;;
17993   --header | --heade | --head | --hea )
17994     shift
17995     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17996     ac_need_defaults=false;;
17997
17998   # This is an error.
17999   -*) { { echo "$as_me:17999: error: unrecognized option: $1
18000 Try \`$0 --help' for more information." >&5
18001 echo "$as_me: error: unrecognized option: $1
18002 Try \`$0 --help' for more information." >&2;}
18003    { (exit 1); exit 1; }; } ;;
18004
18005   *) ac_config_targets="$ac_config_targets $1" ;;
18006
18007   esac
18008   shift
18009 done
18010
18011 exec 5>>config.log
18012 cat >&5 << _ACEOF
18013
18014 ## ----------------------- ##
18015 ## Running config.status.  ##
18016 ## ----------------------- ##
18017
18018 This file was extended by $as_me 2.52.20210105, executed with
18019   CONFIG_FILES    = $CONFIG_FILES
18020   CONFIG_HEADERS  = $CONFIG_HEADERS
18021   CONFIG_LINKS    = $CONFIG_LINKS
18022   CONFIG_COMMANDS = $CONFIG_COMMANDS
18023   > "$ac_cs_invocation"
18024 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18025
18026 _ACEOF
18027 EOF
18028
18029 cat >>"$CONFIG_STATUS" <<EOF
18030 #
18031 # INIT-COMMANDS section.
18032 #
18033
18034 ### Special initialization commands, used to pass information from the
18035 ### configuration-run into config.status
18036
18037 AWK="$AWK"
18038 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
18039 DFT_LWR_MODEL="$DFT_LWR_MODEL"
18040 LIB_NAME="$LIB_NAME"
18041 LIB_PREFIX="$LIB_PREFIX"
18042 LIB_SUFFIX="$LIB_SUFFIX"
18043 LN_S="$LN_S"
18044 NCURSES_MAJOR="$NCURSES_MAJOR"
18045 NCURSES_MINOR="$NCURSES_MINOR"
18046 NCURSES_PATCH="$NCURSES_PATCH"
18047 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
18048 cf_cv_VERSION_GNATMAKE=$cf_cv_VERSION_GNATMAKE
18049 cf_cv_VERSION_GPRBUILD=$cf_cv_VERSION_GPRBUILD
18050 cf_cv_abi_version="$cf_cv_abi_version"
18051 cf_cv_rel_version="$cf_cv_rel_version"
18052 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
18053 cf_cv_shared_soname='$cf_cv_shared_soname'
18054 cf_cv_shlib_version="$cf_cv_shlib_version"
18055 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
18056 cf_cv_system_name="$cf_cv_system_name"
18057 host="$host"
18058 target="$target"
18059
18060 EOF
18061
18062 cat >>"$CONFIG_STATUS" <<\EOF
18063 for ac_config_target in $ac_config_targets
18064 do
18065   case "$ac_config_target" in
18066   # Handling of arguments.
18067   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
18068   "src/library.gpr" ) CONFIG_FILES="$CONFIG_FILES src/library.gpr:src/library.gpr.in" ;;
18069   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
18070   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18071   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18072   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
18073   *) { { echo "$as_me:18073: error: invalid argument: $ac_config_target" >&5
18074 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18075    { (exit 1); exit 1; }; };;
18076   esac
18077 done
18078
18079 # If the user did not use the arguments to specify the items to instantiate,
18080 # then the envvar interface is used.  Set only those that are not.
18081 # We use the long form for the default assignment because of an extremely
18082 # bizarre bug on SunOS 4.1.3.
18083 if "$ac_need_defaults"; then
18084   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18085   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18086   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18087 fi
18088
18089 # Create a temporary directory, and hook for its removal unless debugging.
18090 $debug ||
18091 {
18092   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18093   trap '{ (exit 1); exit 1; }' 1 2 13 15
18094 }
18095
18096 # Create a (secure) tmp directory for tmp files.
18097 : ${TMPDIR=/tmp}
18098 {
18099   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18100   test -n "$tmp" && test -d "$tmp"
18101 }  ||
18102 {
18103   tmp=$TMPDIR/cs$$-$RANDOM
18104   (umask 077 && mkdir $tmp)
18105 } ||
18106 {
18107    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18108    { (exit 1); exit 1; }
18109 }
18110
18111 EOF
18112
18113 cat >>"$CONFIG_STATUS" <<EOF
18114
18115 #
18116 # CONFIG_FILES section.
18117 #
18118
18119 # No need to generate the scripts if there are no CONFIG_FILES.
18120 # This happens for instance when ./config.status config.h
18121 if test -n "\$CONFIG_FILES"; then
18122   # Protect against being on the right side of a sed subst in config.status.
18123   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18124    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18125 s,@SHELL@,$SHELL,;t t
18126 s,@exec_prefix@,$exec_prefix,;t t
18127 s,@prefix@,$prefix,;t t
18128 s,@program_transform_name@,$program_transform_name,;t t
18129 s,@bindir@,$bindir,;t t
18130 s,@sbindir@,$sbindir,;t t
18131 s,@libexecdir@,$libexecdir,;t t
18132 s,@datarootdir@,$datarootdir,;t t
18133 s,@datadir@,$datadir,;t t
18134 s,@sysconfdir@,$sysconfdir,;t t
18135 s,@sharedstatedir@,$sharedstatedir,;t t
18136 s,@localstatedir@,$localstatedir,;t t
18137 s,@runstatedir@,$runstatedir,;t t
18138 s,@libdir@,$libdir,;t t
18139 s,@includedir@,$includedir,;t t
18140 s,@oldincludedir@,$oldincludedir,;t t
18141 s,@infodir@,$infodir,;t t
18142 s,@mandir@,$mandir,;t t
18143 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18144 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18145 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18146 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18147 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18148 s,@build_alias@,$build_alias,;t t
18149 s,@host_alias@,$host_alias,;t t
18150 s,@target_alias@,$target_alias,;t t
18151 s,@ECHO_C@,$ECHO_C,;t t
18152 s,@ECHO_N@,$ECHO_N,;t t
18153 s,@ECHO_T@,$ECHO_T,;t t
18154 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18155 s,@DEFS@,$DEFS,;t t
18156 s,@LIBS@,$LIBS,;t t
18157 s,@top_builddir@,$top_builddir,;t t
18158 s,@build@,$build,;t t
18159 s,@build_cpu@,$build_cpu,;t t
18160 s,@build_vendor@,$build_vendor,;t t
18161 s,@build_os@,$build_os,;t t
18162 s,@host@,$host,;t t
18163 s,@host_cpu@,$host_cpu,;t t
18164 s,@host_vendor@,$host_vendor,;t t
18165 s,@host_os@,$host_os,;t t
18166 s,@target@,$target,;t t
18167 s,@target_cpu@,$target_cpu,;t t
18168 s,@target_vendor@,$target_vendor,;t t
18169 s,@target_os@,$target_os,;t t
18170 s,@GREP@,$GREP,;t t
18171 s,@FGREP@,$FGREP,;t t
18172 s,@CC@,$CC,;t t
18173 s,@CFLAGS@,$CFLAGS,;t t
18174 s,@LDFLAGS@,$LDFLAGS,;t t
18175 s,@CPPFLAGS@,$CPPFLAGS,;t t
18176 s,@ac_ct_CC@,$ac_ct_CC,;t t
18177 s,@EXEEXT@,$EXEEXT,;t t
18178 s,@OBJEXT@,$OBJEXT,;t t
18179 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18180 s,@CPP@,$CPP,;t t
18181 s,@EGREP@,$EGREP,;t t
18182 s,@AWK@,$AWK,;t t
18183 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18184 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18185 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18186 s,@LN_S@,$LN_S,;t t
18187 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
18188 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
18189 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18190 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18191 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
18192 s,@SET_MAKE@,$SET_MAKE,;t t
18193 s,@CTAGS@,$CTAGS,;t t
18194 s,@ETAGS@,$ETAGS,;t t
18195 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18196 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18197 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
18198 s,@RANLIB@,$RANLIB,;t t
18199 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
18200 s,@LD@,$LD,;t t
18201 s,@ac_ct_LD@,$ac_ct_LD,;t t
18202 s,@AR@,$AR,;t t
18203 s,@ac_ct_AR@,$ac_ct_AR,;t t
18204 s,@ARFLAGS@,$ARFLAGS,;t t
18205 s,@DESTDIR@,$DESTDIR,;t t
18206 s,@BUILD_CC@,$BUILD_CC,;t t
18207 s,@BUILD_CPP@,$BUILD_CPP,;t t
18208 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
18209 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
18210 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
18211 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
18212 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
18213 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
18214 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
18215 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18216 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18217 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18218 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
18219 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
18220 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
18221 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18222 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18223 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
18224 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
18225 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
18226 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
18227 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
18228 s,@CC_G_OPT@,$CC_G_OPT,;t t
18229 s,@LD_MODEL@,$LD_MODEL,;t t
18230 s,@shlibdir@,$shlibdir,;t t
18231 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
18232 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18233 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
18234 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18235 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
18236 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
18237 s,@LINK_PROGS@,$LINK_PROGS,;t t
18238 s,@LINK_TESTS@,$LINK_TESTS,;t t
18239 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18240 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18241 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
18242 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
18243 s,@RPATH_LIST@,$RPATH_LIST,;t t
18244 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
18245 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
18246 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
18247 s,@PTHREAD@,$PTHREAD,;t t
18248 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
18249 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18250 s,@ECHO_LT@,$ECHO_LT,;t t
18251 s,@ECHO_LD@,$ECHO_LD,;t t
18252 s,@RULE_CC@,$RULE_CC,;t t
18253 s,@SHOW_CC@,$SHOW_CC,;t t
18254 s,@ECHO_CC@,$ECHO_CC,;t t
18255 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18256 s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t
18257 s,@ADAFLAGS@,$ADAFLAGS,;t t
18258 s,@ADA_TRACE@,$ADA_TRACE,;t t
18259 s,@cf_TEMP_gnat@,$cf_TEMP_gnat,;t t
18260 s,@M4_exists@,$M4_exists,;t t
18261 s,@cf_ada_make@,$cf_ada_make,;t t
18262 s,@cf_ada_config@,$cf_ada_config,;t t
18263 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
18264 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
18265 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
18266 s,@cf_compile_generics@,$cf_compile_generics,;t t
18267 s,@cf_generic_objects@,$cf_generic_objects,;t t
18268 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
18269 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
18270 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
18271 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
18272 s,@USE_GNAT_MAKE_GPR@,$USE_GNAT_MAKE_GPR,;t t
18273 s,@USE_GNAT_GPRBUILD@,$USE_GNAT_GPRBUILD,;t t
18274 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
18275 s,@cf_ada_package@,$cf_ada_package,;t t
18276 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
18277 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
18278 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
18279 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
18280 s,@ADA_LIBNAME@,$ADA_LIBNAME,;t t
18281 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
18282 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18283 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
18284 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
18285 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18286 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18287 s,@USE_ARG_SUFFIX@,$USE_ARG_SUFFIX,;t t
18288 s,@USE_LIB_SUFFIX@,$USE_LIB_SUFFIX,;t t
18289 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
18290 s,@TEST_ARG2@,$TEST_ARG2,;t t
18291 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
18292 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
18293 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
18294 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
18295 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
18296 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
18297 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
18298 CEOF
18299
18300 EOF
18301
18302   cat >>"$CONFIG_STATUS" <<\EOF
18303   # Split the substitutions into bite-sized pieces for seds with
18304   # small command number limits, like on Digital OSF/1 and HP-UX.
18305   ac_max_sed_lines=48
18306   ac_sed_frag=1 # Number of current file.
18307   ac_beg=1 # First line for current file.
18308   ac_end=$ac_max_sed_lines # Line after last line for current file.
18309   ac_more_lines=:
18310   ac_sed_cmds=
18311   while "$ac_more_lines"; do
18312     if test "$ac_beg" -gt 1; then
18313       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18314     else
18315       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18316     fi
18317     if test ! -s $tmp/subs.frag; then
18318       ac_more_lines=false
18319     else
18320       # The purpose of the label and of the branching condition is to
18321       # speed up the sed processing (if there are no `@' at all, there
18322       # is no need to browse any of the substitutions).
18323       # These are the two extra sed commands mentioned above.
18324       (echo ':t
18325   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18326       # It is possible to make a multiline substitution using escaped newlines.
18327       # Ensure that we do not split the substitution between script fragments.
18328       ac_BEG=$ac_end
18329       ac_END=`expr "$ac_end" + "$ac_max_sed_lines"`
18330       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18331       if test -s $tmp/subs.next; then
18332         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18333         if test ! -s $tmp/subs.edit; then
18334           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18335           if test ! -s $tmp/subs.edit; then
18336             if test "$ac_beg" -gt 1; then
18337               ac_end=`expr "$ac_end" - 1`
18338               continue
18339             fi
18340           fi
18341         fi
18342       fi
18343
18344       if test -z "$ac_sed_cmds"; then
18345         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18346       else
18347         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18348       fi
18349       ac_sed_frag=`expr "$ac_sed_frag" + 1`
18350       ac_beg=$ac_end
18351       ac_end=`expr "$ac_end" + "$ac_max_sed_lines"`
18352     fi
18353   done
18354   if test -z "$ac_sed_cmds"; then
18355     ac_sed_cmds=cat
18356   fi
18357 fi # test -n "$CONFIG_FILES"
18358
18359 EOF
18360 cat >>"$CONFIG_STATUS" <<\EOF
18361 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18362   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18363   case "$ac_file" in
18364   - | *:- | *:-:* ) # input from stdin
18365         cat >$tmp/stdin
18366         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18367         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18368   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18369         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18370   * )   ac_file_in=$ac_file.in ;;
18371   esac
18372
18373   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18374   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18375          X"$ac_file" : 'X\(//\)[^/]' \| \
18376          X"$ac_file" : 'X\(//\)$' \| \
18377          X"$ac_file" : 'X\(/\)' \| \
18378          .     : '\(.\)' 2>/dev/null ||
18379 echo X"$ac_file" |
18380     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18381           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18382           /^X\(\/\/\)$/{ s//\1/; q; }
18383           /^X\(\/\).*/{ s//\1/; q; }
18384           s/.*/./; q'`
18385   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18386     { case "$ac_dir" in
18387   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18388   *)                      as_incr_dir=.;;
18389 esac
18390 as_dummy="$ac_dir"
18391 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18392   case $as_mkdir_dir in
18393     # Skip DOS drivespec
18394     ?:) as_incr_dir=$as_mkdir_dir ;;
18395     *)
18396       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18397       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18398     ;;
18399   esac
18400 done; }
18401
18402     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18403     # A "../" for each directory in $ac_dir_suffix.
18404     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18405   else
18406     ac_dir_suffix= ac_dots=
18407   fi
18408
18409   case "$srcdir" in
18410   .)  ac_srcdir=.
18411       if test -z "$ac_dots"; then
18412          ac_top_srcdir=.
18413       else
18414          ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'`
18415       fi ;;
18416   [\\/]* | ?:[\\/]* )
18417       ac_srcdir="$srcdir$ac_dir_suffix";
18418       ac_top_srcdir="$srcdir" ;;
18419   *) # Relative path.
18420     ac_srcdir="$ac_dots$srcdir$ac_dir_suffix"
18421     ac_top_srcdir="$ac_dots$srcdir" ;;
18422   esac
18423
18424   case $INSTALL in
18425   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18426   *) ac_INSTALL=$ac_dots$INSTALL ;;
18427   esac
18428
18429   if test x"$ac_file" != x-; then
18430     { echo "$as_me:18430: creating $ac_file" >&5
18431 echo "$as_me: creating $ac_file" >&6;}
18432     rm -f "$ac_file"
18433   fi
18434   # Let's still pretend it is `configure' which instantiates (i.e., don't
18435   # use $as_me), people would be surprised to read:
18436   #    /* config.h.  Generated automatically by config.status.  */
18437   configure_input="Generated automatically from `echo $ac_file_in |
18438                                                  sed 's,.*/,,'` by configure."
18439
18440   # First look for the input files in the build tree, otherwise in the
18441   # src tree.
18442   ac_file_inputs=`IFS=:
18443     for f in $ac_file_in; do
18444       case $f in
18445       -) echo $tmp/stdin ;;
18446       [\\/$]*)
18447          # Absolute (can't be DOS-style, as IFS=:)
18448          test -f "$f" || { { echo "$as_me:18448: error: cannot find input file: $f" >&5
18449 echo "$as_me: error: cannot find input file: $f" >&2;}
18450    { (exit 1); exit 1; }; }
18451          echo $f;;
18452       *) # Relative
18453          if test -f "$f"; then
18454            # Build tree
18455            echo $f
18456          elif test -f "$srcdir/$f"; then
18457            # Source tree
18458            echo "$srcdir/$f"
18459          else
18460            # /dev/null tree
18461            { { echo "$as_me:18461: error: cannot find input file: $f" >&5
18462 echo "$as_me: error: cannot find input file: $f" >&2;}
18463    { (exit 1); exit 1; }; }
18464          fi;;
18465       esac
18466     done` || { (exit 1); exit 1; }
18467 EOF
18468 cat >>"$CONFIG_STATUS" <<\EOF
18469   ac_warn_datarootdir=no
18470   if test x"$ac_file" != x-; then
18471     for ac_item in $ac_file_inputs
18472     do
18473       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"`
18474       if test -n "$ac_seen"; then
18475         ac_used=`grep '@datarootdir@' "$ac_item"`
18476         if test -z "$ac_used"; then
18477           { echo "$as_me:18477: WARNING: datarootdir was used implicitly but not set:
18478 $ac_seen" >&5
18479 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18480 $ac_seen" >&2;}
18481           ac_warn_datarootdir=yes
18482         fi
18483       fi
18484       ac_seen=`grep '${datarootdir}' "$ac_item"`
18485       if test -n "$ac_seen"; then
18486         { echo "$as_me:18486: WARNING: datarootdir was used explicitly but not set:
18487 $ac_seen" >&5
18488 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18489 $ac_seen" >&2;}
18490         ac_warn_datarootdir=yes
18491       fi
18492     done
18493   fi
18494
18495 if test "x$ac_warn_datarootdir" = xyes; then
18496   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18497 fi
18498
18499 EOF
18500 cat >>"$CONFIG_STATUS" <<EOF
18501   sed "$ac_vpsub
18502 $extrasub
18503 EOF
18504 cat >>"$CONFIG_STATUS" <<\EOF
18505 :t
18506 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18507 s,@configure_input@,$configure_input,;t t
18508 s,@srcdir@,$ac_srcdir,;t t
18509 s,@top_srcdir@,$ac_top_srcdir,;t t
18510 s,@INSTALL@,$ac_INSTALL,;t t
18511 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18512   rm -f $tmp/stdin
18513   if test x"$ac_file" != x-; then
18514     cp "$tmp/out" "$ac_file"
18515
18516     for ac_name in prefix exec_prefix datarootdir
18517     do
18518         ac_seen=`${FGREP-fgrep} -n '${'$ac_name'[:=].*}' "$ac_file"`
18519         if test -n "$ac_seen"; then
18520             ac_init=`${EGREP-egrep} '[  ]*'$ac_name'[   ]*=' "$ac_file"`
18521             if test -z "$ac_init"; then
18522               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18523               { echo "$as_me:18523: WARNING: Variable $ac_name is used but was not set:
18524 $ac_seen" >&5
18525 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18526 $ac_seen" >&2;}
18527             fi
18528         fi
18529     done
18530     ${EGREP-egrep} -n '@[a-z_][a-z_0-9]+@' "$ac_file" >$tmp/out
18531     ${EGREP-egrep} -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>$tmp/out
18532     if test -s $tmp/out; then
18533       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18534       { echo "$as_me:18534: WARNING: Some variables may not be substituted:
18535 $ac_seen" >&5
18536 echo "$as_me: WARNING: Some variables may not be substituted:
18537 $ac_seen" >&2;}
18538     fi
18539   else
18540     cat $tmp/out
18541   fi
18542   rm -f $tmp/out
18543
18544 done
18545 EOF
18546 cat >>"$CONFIG_STATUS" <<\EOF
18547
18548 #
18549 # CONFIG_HEADER section.
18550 #
18551
18552 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18553 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18554 #
18555 # ac_d sets the value in "#define NAME VALUE" lines.
18556 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18557 ac_dB='[        ].*$,\1#\2'
18558 ac_dC=' '
18559 ac_dD=',;t'
18560 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18561 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18562 ac_iB='\([      ]\),\1#\2define\3'
18563 ac_iC=' '
18564 ac_iD='\4,;t'
18565 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18566 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18567 ac_uB='$,\1#\2define\3'
18568 ac_uC=' '
18569 ac_uD=',;t'
18570
18571 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18572   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18573   case "$ac_file" in
18574   - | *:- | *:-:* ) # input from stdin
18575         cat >$tmp/stdin
18576         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18577         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18578   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18579         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18580   * )   ac_file_in=$ac_file.in ;;
18581   esac
18582
18583   test x"$ac_file" != x- && { echo "$as_me:18583: creating $ac_file" >&5
18584 echo "$as_me: creating $ac_file" >&6;}
18585
18586   # First look for the input files in the build tree, otherwise in the
18587   # src tree.
18588   ac_file_inputs=`IFS=:
18589     for f in $ac_file_in; do
18590       case $f in
18591       -) echo $tmp/stdin ;;
18592       [\\/$]*)
18593          # Absolute (can't be DOS-style, as IFS=:)
18594          test -f "$f" || { { echo "$as_me:18594: error: cannot find input file: $f" >&5
18595 echo "$as_me: error: cannot find input file: $f" >&2;}
18596    { (exit 1); exit 1; }; }
18597          echo $f;;
18598       *) # Relative
18599          if test -f "$f"; then
18600            # Build tree
18601            echo $f
18602          elif test -f "$srcdir/$f"; then
18603            # Source tree
18604            echo "$srcdir/$f"
18605          else
18606            # /dev/null tree
18607            { { echo "$as_me:18607: error: cannot find input file: $f" >&5
18608 echo "$as_me: error: cannot find input file: $f" >&2;}
18609    { (exit 1); exit 1; }; }
18610          fi;;
18611       esac
18612     done` || { (exit 1); exit 1; }
18613   # Remove the trailing spaces.
18614   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18615
18616 EOF
18617
18618 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18619 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18620 # be either 'cat' or 'sort'.
18621 cat confdefs.h | uniq >conftest.vals
18622
18623 # Break up conftest.vals because some shells have a limit on
18624 # the size of here documents, and old seds have small limits too.
18625
18626 rm -f conftest.tail
18627 echo '  rm -f conftest.frag' >> "$CONFIG_STATUS"
18628 while grep . conftest.vals >/dev/null
18629 do
18630   # Write chunks of a limited-size here document to conftest.frag.
18631   echo '  cat >> conftest.frag <<CEOF' >> "$CONFIG_STATUS"
18632   sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS"
18633   echo 'CEOF' >> "$CONFIG_STATUS"
18634   sed "1,${ac_max_here_lines}d" conftest.vals > conftest.tail
18635   rm -f conftest.vals
18636   mv conftest.tail conftest.vals
18637 done
18638 rm -f conftest.vals
18639
18640 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18641 # marker @DEFS@.
18642 echo '  cat >> conftest.edit <<CEOF
18643 /@DEFS@/r conftest.frag
18644 /@DEFS@/d
18645 CEOF
18646 sed -f conftest.edit $tmp/in > $tmp/out
18647 rm -f $tmp/in
18648 mv $tmp/out $tmp/in
18649 rm -f conftest.edit conftest.frag
18650 ' >> "$CONFIG_STATUS"
18651
18652 cat >>"$CONFIG_STATUS" <<\EOF
18653   # Let's still pretend it is `configure' which instantiates (i.e., don't
18654   # use $as_me), people would be surprised to read:
18655   #    /* config.h.  Generated automatically by config.status.  */
18656   if test x"$ac_file" = x-; then
18657     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18658   else
18659     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18660   fi
18661   cat $tmp/in >>$tmp/config.h
18662   rm -f $tmp/in
18663   if test x"$ac_file" != x-; then
18664     if cmp -s "$ac_file" "$tmp/config.h" 2>/dev/null; then
18665       { echo "$as_me:18665: $ac_file is unchanged" >&5
18666 echo "$as_me: $ac_file is unchanged" >&6;}
18667     else
18668       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18669          X"$ac_file" : 'X\(//\)[^/]' \| \
18670          X"$ac_file" : 'X\(//\)$' \| \
18671          X"$ac_file" : 'X\(/\)' \| \
18672          .     : '\(.\)' 2>/dev/null ||
18673 echo X"$ac_file" |
18674     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18675           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18676           /^X\(\/\/\)$/{ s//\1/; q; }
18677           /^X\(\/\).*/{ s//\1/; q; }
18678           s/.*/./; q'`
18679       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18680         { case "$ac_dir" in
18681   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18682   *)                      as_incr_dir=.;;
18683 esac
18684 as_dummy="$ac_dir"
18685 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18686   case $as_mkdir_dir in
18687     # Skip DOS drivespec
18688     ?:) as_incr_dir=$as_mkdir_dir ;;
18689     *)
18690       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18691       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18692     ;;
18693   esac
18694 done; }
18695
18696       fi
18697       rm -f "$ac_file"
18698       mv "$tmp/config.h" "$ac_file"
18699     fi
18700   else
18701     cat $tmp/config.h
18702     rm -f $tmp/config.h
18703   fi
18704 done
18705 EOF
18706 cat >>"$CONFIG_STATUS" <<\EOF
18707 #
18708 # CONFIG_COMMANDS section.
18709 #
18710 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18711   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18712   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18713
18714   case "$ac_dest" in
18715     default )
18716 if test -z "$USE_OLD_MAKERULES" ; then
18717         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
18718 fi
18719  ;;
18720   esac
18721 done
18722 EOF
18723
18724 cat >>"$CONFIG_STATUS" <<\EOF
18725
18726 { (exit 0); exit 0; }
18727 EOF
18728 chmod +x "$CONFIG_STATUS"
18729 ac_clean_files=$ac_clean_files_save
18730
18731 # configure is writing to config.log, and then calls config.status.
18732 # config.status does its own redirection, appending to config.log.
18733 # Unfortunately, on DOS this fails, as config.log is still kept open
18734 # by configure, so config.status won't be able to write to it; its
18735 # output is simply discarded.  So we exec the FD to /dev/null,
18736 # effectively closing config.log, so it can be properly (re)opened and
18737 # appended to by config.status.  When coming back to configure, we
18738 # need to make the FD available again.
18739 if test "$no_create" != yes; then
18740   ac_cs_success=:
18741   exec 5>/dev/null
18742   $SHELL "$CONFIG_STATUS" || ac_cs_success=false
18743   exec 5>>config.log
18744   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18745   # would make configure fail if this is the last instruction.
18746   "$ac_cs_success" || { (exit 1); exit 1; }
18747 fi
18748 ${MAKE:-make} preinstall