]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20160903
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.62 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20150926.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 libdir='${exec_prefix}/lib'
180 includedir='${prefix}/include'
181 oldincludedir='/usr/include'
182 infodir='${datarootdir}/info'
183 mandir='${datarootdir}/man'
184
185 # Identity of this package.
186 PACKAGE_NAME=
187 PACKAGE_TARNAME=
188 PACKAGE_VERSION=
189 PACKAGE_STRING=
190 PACKAGE_BUGREPORT=
191
192 ac_prev=
193 for ac_option
194 do
195   # If the previous option needs an argument, assign it.
196   if test -n "$ac_prev"; then
197     eval "$ac_prev=\$ac_option"
198     ac_prev=
199     continue
200   fi
201
202   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
203
204   # Accept the important Cygnus configure options, so we can diagnose typos.
205
206   case $ac_option in
207
208   -bindir | --bindir | --bindi | --bind | --bin | --bi)
209     ac_prev=bindir ;;
210   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
211     bindir=$ac_optarg ;;
212
213   -build | --build | --buil | --bui | --bu)
214     ac_prev=build_alias ;;
215   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
216     build_alias=$ac_optarg ;;
217
218   -cache-file | --cache-file | --cache-fil | --cache-fi \
219   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
220     ac_prev=cache_file ;;
221   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
222   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
223     cache_file=$ac_optarg ;;
224
225   --config-cache | -C)
226     cache_file=config.cache ;;
227
228   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
229     ac_prev=datadir ;;
230   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
231   | --da=*)
232     datadir=$ac_optarg ;;
233
234   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
235   | --dataroo | --dataro | --datar)
236     ac_prev=datarootdir ;;
237   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
238   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
239     datarootdir=$ac_optarg ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     eval "enable_$ac_feature=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
252     # Reject names that are not valid shell variable names.
253     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
254       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
255    { (exit 1); exit 1; }; }
256     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
257     case $ac_option in
258       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_$ac_feature='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix=$ac_optarg ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he | -h)
277     ac_init_help=long ;;
278   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
279     ac_init_help=recursive ;;
280   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
281     ac_init_help=short ;;
282
283   -host | --host | --hos | --ho)
284     ac_prev=host_alias ;;
285   -host=* | --host=* | --hos=* | --ho=*)
286     host_alias=$ac_optarg ;;
287
288   -includedir | --includedir | --includedi | --included | --include \
289   | --includ | --inclu | --incl | --inc)
290     ac_prev=includedir ;;
291   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
292   | --includ=* | --inclu=* | --incl=* | --inc=*)
293     includedir=$ac_optarg ;;
294
295   -infodir | --infodir | --infodi | --infod | --info | --inf)
296     ac_prev=infodir ;;
297   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
298     infodir=$ac_optarg ;;
299
300   -libdir | --libdir | --libdi | --libd)
301     ac_prev=libdir ;;
302   -libdir=* | --libdir=* | --libdi=* | --libd=*)
303     libdir=$ac_optarg ;;
304
305   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
306   | --libexe | --libex | --libe)
307     ac_prev=libexecdir ;;
308   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
309   | --libexe=* | --libex=* | --libe=*)
310     libexecdir=$ac_optarg ;;
311
312   -localstatedir | --localstatedir | --localstatedi | --localstated \
313   | --localstate | --localstat | --localsta | --localst \
314   | --locals | --local | --loca | --loc | --lo)
315     ac_prev=localstatedir ;;
316   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
317   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
318   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
319     localstatedir=$ac_optarg ;;
320
321   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
322     ac_prev=mandir ;;
323   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
324     mandir=$ac_optarg ;;
325
326   -nfp | --nfp | --nf)
327     # Obsolete; use --without-fp.
328     with_fp=no ;;
329
330   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
331   | --no-cr | --no-c)
332     no_create=yes ;;
333
334   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
335   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
336     no_recursion=yes ;;
337
338   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
339   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
340   | --oldin | --oldi | --old | --ol | --o)
341     ac_prev=oldincludedir ;;
342   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
343   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
344   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
345     oldincludedir=$ac_optarg ;;
346
347   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
348     ac_prev=prefix ;;
349   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
350     prefix=$ac_optarg ;;
351
352   -program-prefix | --program-prefix | --program-prefi | --program-pref \
353   | --program-pre | --program-pr | --program-p)
354     ac_prev=program_prefix ;;
355   -program-prefix=* | --program-prefix=* | --program-prefi=* \
356   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
357     program_prefix=$ac_optarg ;;
358
359   -program-suffix | --program-suffix | --program-suffi | --program-suff \
360   | --program-suf | --program-su | --program-s)
361     ac_prev=program_suffix ;;
362   -program-suffix=* | --program-suffix=* | --program-suffi=* \
363   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
364     program_suffix=$ac_optarg ;;
365
366   -program-transform-name | --program-transform-name \
367   | --program-transform-nam | --program-transform-na \
368   | --program-transform-n | --program-transform- \
369   | --program-transform | --program-transfor \
370   | --program-transfo | --program-transf \
371   | --program-trans | --program-tran \
372   | --progr-tra | --program-tr | --program-t)
373     ac_prev=program_transform_name ;;
374   -program-transform-name=* | --program-transform-name=* \
375   | --program-transform-nam=* | --program-transform-na=* \
376   | --program-transform-n=* | --program-transform-=* \
377   | --program-transform=* | --program-transfor=* \
378   | --program-transfo=* | --program-transf=* \
379   | --program-trans=* | --program-tran=* \
380   | --progr-tra=* | --program-tr=* | --program-t=*)
381     program_transform_name=$ac_optarg ;;
382
383   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
384   | -silent | --silent | --silen | --sile | --sil)
385     silent=yes ;;
386
387   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
388     ac_prev=sbindir ;;
389   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
390   | --sbi=* | --sb=*)
391     sbindir=$ac_optarg ;;
392
393   -sharedstatedir | --sharedstatedir | --sharedstatedi \
394   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
395   | --sharedst | --shareds | --shared | --share | --shar \
396   | --sha | --sh)
397     ac_prev=sharedstatedir ;;
398   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
399   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
400   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
401   | --sha=* | --sh=*)
402     sharedstatedir=$ac_optarg ;;
403
404   -site | --site | --sit)
405     ac_prev=site ;;
406   -site=* | --site=* | --sit=*)
407     site=$ac_optarg ;;
408
409   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
410     ac_prev=srcdir ;;
411   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
412     srcdir=$ac_optarg ;;
413
414   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
415   | --syscon | --sysco | --sysc | --sys | --sy)
416     ac_prev=sysconfdir ;;
417   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
418   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
419     sysconfdir=$ac_optarg ;;
420
421   -target | --target | --targe | --targ | --tar | --ta | --t)
422     ac_prev=target_alias ;;
423   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
424     target_alias=$ac_optarg ;;
425
426   -v | -verbose | --verbose | --verbos | --verbo | --verb)
427     verbose=yes ;;
428
429   -version | --version | --versio | --versi | --vers | -V)
430     ac_init_version=: ;;
431
432   -with-* | --with-*)
433     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid package name: $ac_package" >&2
437    { (exit 1); exit 1; }; }
438     ac_package=`echo $ac_package| sed 's/-/_/g'`
439     case $ac_option in
440       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
441       *) ac_optarg=yes ;;
442     esac
443     eval "with_$ac_package='$ac_optarg'" ;;
444
445   -without-* | --without-*)
446     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
447     # Reject names that are not valid shell variable names.
448     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
449       { echo "$as_me: error: invalid package name: $ac_package" >&2
450    { (exit 1); exit 1; }; }
451     ac_package=`echo $ac_package | sed 's/-/_/g'`
452     eval "with_$ac_package=no" ;;
453
454   --x)
455     # Obsolete; use --with-x.
456     with_x=yes ;;
457
458   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
459   | --x-incl | --x-inc | --x-in | --x-i)
460     ac_prev=x_includes ;;
461   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
462   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
463     x_includes=$ac_optarg ;;
464
465   -x-libraries | --x-libraries | --x-librarie | --x-librari \
466   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
467     ac_prev=x_libraries ;;
468   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
469   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
470     x_libraries=$ac_optarg ;;
471
472   -*) { echo "$as_me: error: unrecognized option: $ac_option
473 Try \`$0 --help' for more information." >&2
474    { (exit 1); exit 1; }; }
475     ;;
476
477   *=*)
478     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
479     # Reject names that are not valid shell variable names.
480     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
481       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
482    { (exit 1); exit 1; }; }
483     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
484     eval "$ac_envvar='$ac_optarg'"
485     export $ac_envvar ;;
486
487   *)
488     # FIXME: should be removed in autoconf 3.0.
489     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
490     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
491       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
492     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
493     ;;
494
495   esac
496 done
497
498 if test -n "$ac_prev"; then
499   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
500   { echo "$as_me: error: missing argument to $ac_option" >&2
501    { (exit 1); exit 1; }; }
502 fi
503
504 # Be sure to have absolute paths.
505 for ac_var in exec_prefix prefix
506 do
507   eval ac_val=$`echo $ac_var`
508   case $ac_val in
509     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
510     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
511    { (exit 1); exit 1; }; };;
512   esac
513 done
514
515 # Be sure to have absolute paths.
516 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
517               localstatedir libdir includedir oldincludedir infodir mandir
518 do
519   eval ac_val=$`echo $ac_var`
520   case $ac_val in
521     [\\/$]* | ?:[\\/]* ) ;;
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 # There might be people who depend on the old broken behavior: `$host'
528 # used to hold the argument of --host etc.
529 build=$build_alias
530 host=$host_alias
531 target=$target_alias
532
533 # FIXME: should be removed in autoconf 3.0.
534 if test "x$host_alias" != x; then
535   if test "x$build_alias" = x; then
536     cross_compiling=maybe
537     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
538     If a cross compiler is detected then cross compile mode will be used." >&2
539   elif test "x$build_alias" != "x$host_alias"; then
540     cross_compiling=yes
541   fi
542 fi
543
544 ac_tool_prefix=
545 test -n "$host_alias" && ac_tool_prefix=$host_alias-
546
547 test "$silent" = yes && exec 6>/dev/null
548
549 # Find the source files, if location was not specified.
550 if test -z "$srcdir"; then
551   ac_srcdir_defaulted=yes
552   # Try the directory containing this script, then its parent.
553   ac_prog=$0
554   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
555   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
556   srcdir=$ac_confdir
557   if test ! -r $srcdir/$ac_unique_file; then
558     srcdir=..
559   fi
560 else
561   ac_srcdir_defaulted=no
562 fi
563 if test ! -r $srcdir/$ac_unique_file; then
564   if test "$ac_srcdir_defaulted" = yes; then
565     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
566    { (exit 1); exit 1; }; }
567   else
568     { echo "$as_me: error: cannot find sources in $srcdir" >&2
569    { (exit 1); exit 1; }; }
570   fi
571 fi
572 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
573 ac_env_build_alias_set=${build_alias+set}
574 ac_env_build_alias_value=$build_alias
575 ac_cv_env_build_alias_set=${build_alias+set}
576 ac_cv_env_build_alias_value=$build_alias
577 ac_env_host_alias_set=${host_alias+set}
578 ac_env_host_alias_value=$host_alias
579 ac_cv_env_host_alias_set=${host_alias+set}
580 ac_cv_env_host_alias_value=$host_alias
581 ac_env_target_alias_set=${target_alias+set}
582 ac_env_target_alias_value=$target_alias
583 ac_cv_env_target_alias_set=${target_alias+set}
584 ac_cv_env_target_alias_value=$target_alias
585 ac_env_CC_set=${CC+set}
586 ac_env_CC_value=$CC
587 ac_cv_env_CC_set=${CC+set}
588 ac_cv_env_CC_value=$CC
589 ac_env_CFLAGS_set=${CFLAGS+set}
590 ac_env_CFLAGS_value=$CFLAGS
591 ac_cv_env_CFLAGS_set=${CFLAGS+set}
592 ac_cv_env_CFLAGS_value=$CFLAGS
593 ac_env_LDFLAGS_set=${LDFLAGS+set}
594 ac_env_LDFLAGS_value=$LDFLAGS
595 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
596 ac_cv_env_LDFLAGS_value=$LDFLAGS
597 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
598 ac_env_CPPFLAGS_value=$CPPFLAGS
599 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
600 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
601 ac_env_CPP_set=${CPP+set}
602 ac_env_CPP_value=$CPP
603 ac_cv_env_CPP_set=${CPP+set}
604 ac_cv_env_CPP_value=$CPP
605
606 #
607 # Report the --help message.
608 #
609 if test "$ac_init_help" = "long"; then
610   # Omit some internal or obsolete options to make the list less imposing.
611   # This message is too long to be a string in the A/UX 3.1 sh.
612   cat <<EOF
613 \`configure' configures this package to adapt to many kinds of systems.
614
615 Usage: $0 [OPTION]... [VAR=VALUE]...
616
617 To assign environment variables (e.g., CC, CFLAGS...), specify them as
618 VAR=VALUE.  See below for descriptions of some of the useful variables.
619
620 Defaults for the options are specified in brackets.
621
622 Configuration:
623   -h, --help              display this help and exit
624       --help=short        display options specific to this package
625       --help=recursive    display the short help of all the included packages
626   -V, --version           display version information and exit
627   -q, --quiet, --silent   do not print \`checking...' messages
628       --cache-file=FILE   cache test results in FILE [disabled]
629   -C, --config-cache      alias for \`--cache-file=config.cache'
630   -n, --no-create         do not create output files
631       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
632
633 EOF
634
635   cat <<EOF
636 Installation directories:
637   --prefix=PREFIX         install architecture-independent files in PREFIX
638                           [$ac_default_prefix]
639   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
640                           [PREFIX]
641
642 By default, \`make install' will install all the files in
643 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
644 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
645 for instance \`--prefix=\$HOME'.
646
647 For better control, use the options below.
648
649 Fine tuning of the installation directories:
650   --bindir=DIR            user executables [EPREFIX/bin]
651   --sbindir=DIR           system admin executables [EPREFIX/sbin]
652   --libexecdir=DIR        program executables [EPREFIX/libexec]
653   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
654   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
655   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
656   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
657   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
658   --libdir=DIR            object code libraries [EPREFIX/lib]
659   --includedir=DIR        C header files [PREFIX/include]
660   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
661   --infodir=DIR           info documentation [DATAROOTDIR/info]
662   --mandir=DIR            man documentation [DATAROOTDIR/man]
663 EOF
664
665   cat <<\EOF
666
667 Program names:
668   --program-prefix=PREFIX            prepend PREFIX to installed program names
669   --program-suffix=SUFFIX            append SUFFIX to installed program names
670   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
671
672 System types:
673   --build=BUILD           configure for building on BUILD [guessed]
674   --host=HOST       build programs to run on HOST [BUILD]
675   --target=TARGET   configure for building compilers for TARGET [HOST]
676 EOF
677 fi
678
679 if test -n "$ac_init_help"; then
680
681   cat <<\EOF
682
683 Optional Packages:
684   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
685   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
686
687 Optional Features:
688   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
689   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
690
691   --with-system-type=XXX  test: override derived host system-type
692   --with-pkg-config{=path} enable/disable use of pkg-config
693   --with-pkg-config-libdir=XXX use given directory for installing pc-files
694   --without-tests         suppress build with test-programs
695   --enable-mixed-case     tic should assume mixed-case filenames
696   --with-install-prefix   prefixes actual install-location ($DESTDIR)
697 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
698   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
699   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
700   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
701   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
702   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
703   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
704 Options to Specify the Libraries Built/Used:
705   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
706   --with-curses-dir=DIR   directory in which (n)curses is installed
707   --enable-widec          compile with wide-char/UTF-8 code
708   --with-lib-prefix       override library-prefix
709   --with-shlib-version=X  Specify rel or abi version for shared libs
710   --enable-rpath-link     link sample programs with rpath option
711 Fine-Tuning Your Configuration:
712   --enable-broken_linker  compile with broken-linker support code
713   --disable-largefile     omit support for large files
714   --with-rcs-ids          compile-in RCS identifiers
715 Extensions:
716   --disable-ext-funcs     disable function-extensions
717   --enable-const          compile with extra/non-standard const
718 Development Code:
719   --without-develop       disable development options
720 Experimental Code:
721   --with-pthread          use POSIX thread library
722   --enable-weak-symbols   enable weak-symbols for pthreads
723   --enable-reentrant      compile with experimental reentrant code
724   --with-wrap-prefix=XXX  override prefix used for public variables
725 Testing/development Options:
726   --disable-echo          do not display "compiling" commands
727   --enable-warnings       build: turn on GCC compiler warnings
728   --enable-assertions     test: turn on generation of assertion code
729   --enable-expanded       test: generate functions for certain macros
730   --disable-macros        test: use functions rather than macros
731   --with-trace            test: add trace() function to all models of ncurses
732   --disable-gnat-projects test: disable GNAT projects even if usable
733 Ada95 Binding Options:
734   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
735   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
736   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
737   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
738
739 Some influential environment variables:
740   CC          C compiler command
741   CFLAGS      C compiler flags
742   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
743               nonstandard directory <lib dir>
744   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
745               headers in a nonstandard directory <include dir>
746   CPP         C preprocessor
747
748 Use these variables to override the choices made by `configure' or to help
749 it to find libraries and programs with nonstandard names/locations.
750
751 EOF
752 fi
753
754 if test "$ac_init_help" = "recursive"; then
755   # If there are subdirs, report their specific --help.
756   ac_popdir=`pwd`
757   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
758     cd $ac_subdir
759     # A "../" for each directory in /$ac_subdir.
760     ac_dots=`echo $ac_subdir |
761              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
762
763     case $srcdir in
764     .) # No --srcdir option.  We are building in place.
765       ac_sub_srcdir=$srcdir ;;
766     [\\/]* | ?:[\\/]* ) # Absolute path.
767       ac_sub_srcdir=$srcdir/$ac_subdir ;;
768     *) # Relative path.
769       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
770     esac
771
772     # Check for guested configure; otherwise get Cygnus style configure.
773     if test -f $ac_sub_srcdir/configure.gnu; then
774       echo
775       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
776     elif test -f $ac_sub_srcdir/configure; then
777       echo
778       $SHELL $ac_sub_srcdir/configure  --help=recursive
779     elif test -f $ac_sub_srcdir/configure.ac ||
780            test -f $ac_sub_srcdir/configure.in; then
781       echo
782       $ac_configure --help
783     else
784       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
785     fi
786     cd $ac_popdir
787   done
788 fi
789
790 test -n "$ac_init_help" && exit 0
791 if $ac_init_version; then
792   cat <<\EOF
793
794 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
795 Free Software Foundation, Inc.
796 This configure script is free software; the Free Software Foundation
797 gives unlimited permission to copy, distribute and modify it.
798 EOF
799   exit 0
800 fi
801 exec 5>config.log
802 cat >&5 <<EOF
803 This file contains any messages produced by compilers while
804 running configure, to aid debugging if configure makes a mistake.
805
806 It was created by $as_me, which was
807 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
808
809   $ $0 $@
810
811 EOF
812 {
813 cat <<_ASUNAME
814 ## ---------- ##
815 ## Platform.  ##
816 ## ---------- ##
817
818 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
819 uname -m = `(uname -m) 2>/dev/null || echo unknown`
820 uname -r = `(uname -r) 2>/dev/null || echo unknown`
821 uname -s = `(uname -s) 2>/dev/null || echo unknown`
822 uname -v = `(uname -v) 2>/dev/null || echo unknown`
823
824 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
825 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
826
827 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
828 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
829 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
830 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
831 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
832 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
833 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
834
835 PATH = $PATH
836
837 _ASUNAME
838 } >&5
839
840 cat >&5 <<EOF
841 ## ------------ ##
842 ## Core tests.  ##
843 ## ------------ ##
844
845 EOF
846
847 # Keep a trace of the command line.
848 # Strip out --no-create and --no-recursion so they do not pile up.
849 # Also quote any args containing shell meta-characters.
850 ac_configure_args=
851 ac_sep=
852 for ac_arg
853 do
854   case $ac_arg in
855   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
856   | --no-cr | --no-c) ;;
857   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
858   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
859   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
860     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
861     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
862     ac_sep=" " ;;
863   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
864      ac_sep=" " ;;
865   esac
866   # Get rid of the leading space.
867 done
868
869 # When interrupted or exit'd, cleanup temporary files, and complete
870 # config.log.  We remove comments because anyway the quotes in there
871 # would cause problems or look ugly.
872 trap 'exit_status=$?
873   # Save into config.log some information that might help in debugging.
874   echo >&5
875   echo "## ----------------- ##" >&5
876   echo "## Cache variables.  ##" >&5
877   echo "## ----------------- ##" >&5
878   echo >&5
879   # The following way of writing the cache mishandles newlines in values,
880 {
881   (set) 2>&1 |
882     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
883     *ac_space=\ *)
884       sed -n \
885         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
886           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
887       ;;
888     *)
889       sed -n \
890         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
891       ;;
892     esac;
893 } >&5
894   sed "/^$/d" confdefs.h >conftest.log
895   if test -s conftest.log; then
896     echo >&5
897     echo "## ------------ ##" >&5
898     echo "## confdefs.h.  ##" >&5
899     echo "## ------------ ##" >&5
900     echo >&5
901     cat conftest.log >&5
902   fi
903   (echo; echo) >&5
904   test "$ac_signal" != 0 &&
905     echo "$as_me: caught signal $ac_signal" >&5
906   echo "$as_me: exit $exit_status" >&5
907   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
908     exit $exit_status
909      ' 0
910 for ac_signal in 1 2 13 15; do
911   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
912 done
913 ac_signal=0
914
915 # confdefs.h avoids OS command line length limits that DEFS can exceed.
916 rm -rf conftest* confdefs.h
917 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
918 echo >confdefs.h
919
920 # Let the site file select an alternate cache file if it wants to.
921 # Prefer explicitly selected file to automatically selected ones.
922 if test -z "$CONFIG_SITE"; then
923   if test "x$prefix" != xNONE; then
924     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
925   else
926     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
927   fi
928 fi
929 for ac_site_file in $CONFIG_SITE; do
930   if test -r "$ac_site_file"; then
931     { echo "$as_me:931: loading site script $ac_site_file" >&5
932 echo "$as_me: loading site script $ac_site_file" >&6;}
933     cat "$ac_site_file" >&5
934     . "$ac_site_file"
935   fi
936 done
937
938 if test -r "$cache_file"; then
939   # Some versions of bash will fail to source /dev/null (special
940   # files actually), so we avoid doing that.
941   if test -f "$cache_file"; then
942     { echo "$as_me:942: loading cache $cache_file" >&5
943 echo "$as_me: loading cache $cache_file" >&6;}
944     case $cache_file in
945       [\\/]* | ?:[\\/]* ) . $cache_file;;
946       *)                      . ./$cache_file;;
947     esac
948   fi
949 else
950   { echo "$as_me:950: creating cache $cache_file" >&5
951 echo "$as_me: creating cache $cache_file" >&6;}
952   >$cache_file
953 fi
954
955 # Check that the precious variables saved in the cache have kept the same
956 # value.
957 ac_cache_corrupted=false
958 for ac_var in `(set) 2>&1 |
959                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
960   eval ac_old_set=\$ac_cv_env_${ac_var}_set
961   eval ac_new_set=\$ac_env_${ac_var}_set
962   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
963   eval ac_new_val="\$ac_env_${ac_var}_value"
964   case $ac_old_set,$ac_new_set in
965     set,)
966       { echo "$as_me:966: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
967 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
968       ac_cache_corrupted=: ;;
969     ,set)
970       { echo "$as_me:970: error: \`$ac_var' was not set in the previous run" >&5
971 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
972       ac_cache_corrupted=: ;;
973     ,);;
974     *)
975       if test "x$ac_old_val" != "x$ac_new_val"; then
976         { echo "$as_me:976: error: \`$ac_var' has changed since the previous run:" >&5
977 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
978         { echo "$as_me:978:   former value:  $ac_old_val" >&5
979 echo "$as_me:   former value:  $ac_old_val" >&2;}
980         { echo "$as_me:980:   current value: $ac_new_val" >&5
981 echo "$as_me:   current value: $ac_new_val" >&2;}
982         ac_cache_corrupted=:
983       fi;;
984   esac
985   # Pass precious variables to config.status.  It doesn't matter if
986   # we pass some twice (in addition to the command line arguments).
987   if test "$ac_new_set" = set; then
988     case $ac_new_val in
989     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
990       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
991       ac_configure_args="$ac_configure_args '$ac_arg'"
992       ;;
993     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
994        ;;
995     esac
996   fi
997 done
998 if $ac_cache_corrupted; then
999   { echo "$as_me:999: error: changes in the environment can compromise the build" >&5
1000 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1001   { { echo "$as_me:1001: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1002 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005
1006 ac_ext=c
1007 ac_cpp='$CPP $CPPFLAGS'
1008 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1009 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1010 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1011 ac_main_return=return
1012
1013 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1014   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1015                    ECHO_T='     ' ;;
1016   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1017   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1018 esac
1019 echo "#! $SHELL" >conftest.sh
1020 echo  "exit 0"   >>conftest.sh
1021 chmod +x conftest.sh
1022 if { (echo "$as_me:1022: PATH=\".;.\"; conftest.sh") >&5
1023   (PATH=".;."; conftest.sh) 2>&5
1024   ac_status=$?
1025   echo "$as_me:1025: \$? = $ac_status" >&5
1026   (exit $ac_status); }; then
1027   ac_path_separator=';'
1028 else
1029   ac_path_separator=:
1030 fi
1031 PATH_SEPARATOR="$ac_path_separator"
1032 rm -f conftest.sh
1033
1034 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1035
1036 top_builddir=`pwd`
1037
1038 ac_aux_dir=
1039 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1040   if test -f $ac_dir/install-sh; then
1041     ac_aux_dir=$ac_dir
1042     ac_install_sh="$ac_aux_dir/install-sh -c"
1043     break
1044   elif test -f $ac_dir/install.sh; then
1045     ac_aux_dir=$ac_dir
1046     ac_install_sh="$ac_aux_dir/install.sh -c"
1047     break
1048   elif test -f $ac_dir/shtool; then
1049     ac_aux_dir=$ac_dir
1050     ac_install_sh="$ac_aux_dir/shtool install -c"
1051     break
1052   fi
1053 done
1054 if test -z "$ac_aux_dir"; then
1055   { { echo "$as_me:1055: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1056 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1057    { (exit 1); exit 1; }; }
1058 fi
1059 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1060 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1061 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1062
1063 # Make sure we can run config.sub.
1064 $ac_config_sub sun4 >/dev/null 2>&1 ||
1065   { { echo "$as_me:1065: error: cannot run $ac_config_sub" >&5
1066 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1067    { (exit 1); exit 1; }; }
1068
1069 echo "$as_me:1069: checking build system type" >&5
1070 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1071 if test "${ac_cv_build+set}" = set; then
1072   echo $ECHO_N "(cached) $ECHO_C" >&6
1073 else
1074   ac_cv_build_alias=$build_alias
1075 test -z "$ac_cv_build_alias" &&
1076   ac_cv_build_alias=`$ac_config_guess`
1077 test -z "$ac_cv_build_alias" &&
1078   { { echo "$as_me:1078: error: cannot guess build type; you must specify one" >&5
1079 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1080    { (exit 1); exit 1; }; }
1081 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_build" >&5
1088 echo "${ECHO_T}$ac_cv_build" >&6
1089 build=$ac_cv_build
1090 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094 echo "$as_me:1094: checking host system type" >&5
1095 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1096 if test "${ac_cv_host+set}" = set; then
1097   echo $ECHO_N "(cached) $ECHO_C" >&6
1098 else
1099   ac_cv_host_alias=$host_alias
1100 test -z "$ac_cv_host_alias" &&
1101   ac_cv_host_alias=$ac_cv_build_alias
1102 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1103   { { echo "$as_me:1103: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1104 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1105    { (exit 1); exit 1; }; }
1106
1107 fi
1108 echo "$as_me:1108: result: $ac_cv_host" >&5
1109 echo "${ECHO_T}$ac_cv_host" >&6
1110 host=$ac_cv_host
1111 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1112 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1113 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1114
1115 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1116         echo "$as_me:1116: checking target system type" >&5
1117 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1118 if test "${ac_cv_target+set}" = set; then
1119   echo $ECHO_N "(cached) $ECHO_C" >&6
1120 else
1121   ac_cv_target_alias=$target_alias
1122 test "x$ac_cv_target_alias" = "x" &&
1123   ac_cv_target_alias=$ac_cv_host_alias
1124 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1125   { { echo "$as_me:1125: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1126 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1127    { (exit 1); exit 1; }; }
1128
1129 fi
1130 echo "$as_me:1130: result: $ac_cv_target" >&5
1131 echo "${ECHO_T}$ac_cv_target" >&6
1132 target=$ac_cv_target
1133 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1134 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1135 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1136
1137 # The aliases save the names the user supplied, while $host etc.
1138 # will get canonicalized.
1139 test -n "$target_alias" &&
1140   test "$program_prefix$program_suffix$program_transform_name" = \
1141     NONENONEs,x,x, &&
1142   program_prefix=${target_alias}-
1143         system_name="$host_os"
1144 else
1145         system_name="`(uname -s -r) 2>/dev/null`"
1146         if test -z "$system_name" ; then
1147                 system_name="`(hostname) 2>/dev/null`"
1148         fi
1149 fi
1150 test -n "$system_name" &&
1151 cat >>confdefs.h <<EOF
1152 #define SYSTEM_NAME "$system_name"
1153 EOF
1154
1155 if test "${cf_cv_system_name+set}" = set; then
1156   echo $ECHO_N "(cached) $ECHO_C" >&6
1157 else
1158   cf_cv_system_name="$system_name"
1159 fi
1160
1161 test -z "$system_name" && system_name="$cf_cv_system_name"
1162 test -n "$cf_cv_system_name" && echo "$as_me:1162: result: Configuring for $cf_cv_system_name" >&5
1163 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1164
1165 if test ".$system_name" != ".$cf_cv_system_name" ; then
1166         echo "$as_me:1166: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1167 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1168         { { echo "$as_me:1168: error: \"Please remove config.cache and try again.\"" >&5
1169 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1170    { (exit 1); exit 1; }; }
1171 fi
1172
1173 # Check whether --with-system-type or --without-system-type was given.
1174 if test "${with_system_type+set}" = set; then
1175   withval="$with_system_type"
1176   { echo "$as_me:1176: WARNING: overriding system type to $withval" >&5
1177 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1178         cf_cv_system_name=$withval
1179         host_os=$withval
1180
1181 fi;
1182
1183 ###     Save the given $CFLAGS to allow user-override.
1184 cf_user_CFLAGS="$CFLAGS"
1185
1186 ###     Default install-location
1187
1188 echo "$as_me:1188: checking for prefix" >&5
1189 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1190 if test "x$prefix" = "xNONE" ; then
1191         case "$cf_cv_system_name" in
1192                 # non-vendor systems don't have a conflict
1193         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1194                 prefix=/usr
1195                 ;;
1196         (*)     prefix=$ac_default_prefix
1197                 ;;
1198         esac
1199 fi
1200 echo "$as_me:1200: result: $prefix" >&5
1201 echo "${ECHO_T}$prefix" >&6
1202
1203 if test "x$prefix" = "xNONE" ; then
1204 echo "$as_me:1204: checking for default include-directory" >&5
1205 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1206 test -n "$verbose" && echo 1>&6
1207 for cf_symbol in \
1208         $includedir \
1209         $includedir/ncurses \
1210         $prefix/include \
1211         $prefix/include/ncurses \
1212         /usr/local/include \
1213         /usr/local/include/ncurses \
1214         /usr/include \
1215         /usr/include/ncurses
1216 do
1217         cf_dir=`eval echo $cf_symbol`
1218         if test -f $cf_dir/curses.h ; then
1219         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1220                 includedir="$cf_symbol"
1221                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1222                 break
1223         fi
1224         fi
1225         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1226 done
1227 echo "$as_me:1227: result: $includedir" >&5
1228 echo "${ECHO_T}$includedir" >&6
1229 fi
1230
1231 ###     Checks for programs.
1232
1233 ac_ext=c
1234 ac_cpp='$CPP $CPPFLAGS'
1235 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1236 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1237 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1238 ac_main_return=return
1239 if test -n "$ac_tool_prefix"; then
1240   for ac_prog in gnatgcc gcc cc
1241   do
1242     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1243 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1244 echo "$as_me:1244: checking for $ac_word" >&5
1245 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1246 if test "${ac_cv_prog_CC+set}" = set; then
1247   echo $ECHO_N "(cached) $ECHO_C" >&6
1248 else
1249   if test -n "$CC"; then
1250   ac_cv_prog_CC="$CC" # Let the user override the test.
1251 else
1252   ac_save_IFS=$IFS; IFS=$ac_path_separator
1253 ac_dummy="$PATH"
1254 for ac_dir in $ac_dummy; do
1255   IFS=$ac_save_IFS
1256   test -z "$ac_dir" && ac_dir=.
1257   $as_executable_p "$ac_dir/$ac_word" || continue
1258 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1259 echo "$as_me:1259: found $ac_dir/$ac_word" >&5
1260 break
1261 done
1262
1263 fi
1264 fi
1265 CC=$ac_cv_prog_CC
1266 if test -n "$CC"; then
1267   echo "$as_me:1267: result: $CC" >&5
1268 echo "${ECHO_T}$CC" >&6
1269 else
1270   echo "$as_me:1270: result: no" >&5
1271 echo "${ECHO_T}no" >&6
1272 fi
1273
1274     test -n "$CC" && break
1275   done
1276 fi
1277 if test -z "$CC"; then
1278   ac_ct_CC=$CC
1279   for ac_prog in gnatgcc gcc cc
1280 do
1281   # Extract the first word of "$ac_prog", so it can be a program name with args.
1282 set dummy $ac_prog; ac_word=$2
1283 echo "$as_me:1283: checking for $ac_word" >&5
1284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1285 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1286   echo $ECHO_N "(cached) $ECHO_C" >&6
1287 else
1288   if test -n "$ac_ct_CC"; then
1289   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1290 else
1291   ac_save_IFS=$IFS; IFS=$ac_path_separator
1292 ac_dummy="$PATH"
1293 for ac_dir in $ac_dummy; do
1294   IFS=$ac_save_IFS
1295   test -z "$ac_dir" && ac_dir=.
1296   $as_executable_p "$ac_dir/$ac_word" || continue
1297 ac_cv_prog_ac_ct_CC="$ac_prog"
1298 echo "$as_me:1298: found $ac_dir/$ac_word" >&5
1299 break
1300 done
1301
1302 fi
1303 fi
1304 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1305 if test -n "$ac_ct_CC"; then
1306   echo "$as_me:1306: result: $ac_ct_CC" >&5
1307 echo "${ECHO_T}$ac_ct_CC" >&6
1308 else
1309   echo "$as_me:1309: result: no" >&5
1310 echo "${ECHO_T}no" >&6
1311 fi
1312
1313   test -n "$ac_ct_CC" && break
1314 done
1315
1316   CC=$ac_ct_CC
1317 fi
1318
1319 test -z "$CC" && { { echo "$as_me:1319: error: no acceptable cc found in \$PATH" >&5
1320 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1321    { (exit 1); exit 1; }; }
1322
1323 # Provide some information about the compiler.
1324 echo "$as_me:1324:" \
1325      "checking for C compiler version" >&5
1326 ac_compiler=`set X $ac_compile; echo $2`
1327 { (eval echo "$as_me:1327: \"$ac_compiler --version </dev/null >&5\"") >&5
1328   (eval $ac_compiler --version </dev/null >&5) 2>&5
1329   ac_status=$?
1330   echo "$as_me:1330: \$? = $ac_status" >&5
1331   (exit $ac_status); }
1332 { (eval echo "$as_me:1332: \"$ac_compiler -v </dev/null >&5\"") >&5
1333   (eval $ac_compiler -v </dev/null >&5) 2>&5
1334   ac_status=$?
1335   echo "$as_me:1335: \$? = $ac_status" >&5
1336   (exit $ac_status); }
1337 { (eval echo "$as_me:1337: \"$ac_compiler -V </dev/null >&5\"") >&5
1338   (eval $ac_compiler -V </dev/null >&5) 2>&5
1339   ac_status=$?
1340   echo "$as_me:1340: \$? = $ac_status" >&5
1341   (exit $ac_status); }
1342
1343 cat >conftest.$ac_ext <<_ACEOF
1344 #line 1344 "configure"
1345 #include "confdefs.h"
1346
1347 int
1348 main ()
1349 {
1350
1351   ;
1352   return 0;
1353 }
1354 _ACEOF
1355 ac_clean_files_save=$ac_clean_files
1356 ac_clean_files="$ac_clean_files a.out a.exe"
1357 # Try to create an executable without -o first, disregard a.out.
1358 # It will help us diagnose broken compilers, and finding out an intuition
1359 # of exeext.
1360 echo "$as_me:1360: checking for C compiler default output" >&5
1361 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1362 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1363 if { (eval echo "$as_me:1363: \"$ac_link_default\"") >&5
1364   (eval $ac_link_default) 2>&5
1365   ac_status=$?
1366   echo "$as_me:1366: \$? = $ac_status" >&5
1367   (exit $ac_status); }; then
1368   # Find the output, starting from the most likely.  This scheme is
1369 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1370 # resort.
1371 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1372                 ls a.out conftest 2>/dev/null;
1373                 ls a.* conftest.* 2>/dev/null`; do
1374   case $ac_file in
1375     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1376     a.out ) # We found the default executable, but exeext='' is most
1377             # certainly right.
1378             break;;
1379     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1380           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1381           export ac_cv_exeext
1382           break;;
1383     * ) break;;
1384   esac
1385 done
1386 else
1387   echo "$as_me: failed program was:" >&5
1388 cat conftest.$ac_ext >&5
1389 { { echo "$as_me:1389: error: C compiler cannot create executables" >&5
1390 echo "$as_me: error: C compiler cannot create executables" >&2;}
1391    { (exit 77); exit 77; }; }
1392 fi
1393
1394 ac_exeext=$ac_cv_exeext
1395 echo "$as_me:1395: result: $ac_file" >&5
1396 echo "${ECHO_T}$ac_file" >&6
1397
1398 # Check the compiler produces executables we can run.  If not, either
1399 # the compiler is broken, or we cross compile.
1400 echo "$as_me:1400: checking whether the C compiler works" >&5
1401 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1402 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1403 # If not cross compiling, check that we can run a simple program.
1404 if test "$cross_compiling" != yes; then
1405   if { ac_try='./$ac_file'
1406   { (eval echo "$as_me:1406: \"$ac_try\"") >&5
1407   (eval $ac_try) 2>&5
1408   ac_status=$?
1409   echo "$as_me:1409: \$? = $ac_status" >&5
1410   (exit $ac_status); }; }; then
1411     cross_compiling=no
1412   else
1413     if test "$cross_compiling" = maybe; then
1414         cross_compiling=yes
1415     else
1416         { { echo "$as_me:1416: error: cannot run C compiled programs.
1417 If you meant to cross compile, use \`--host'." >&5
1418 echo "$as_me: error: cannot run C compiled programs.
1419 If you meant to cross compile, use \`--host'." >&2;}
1420    { (exit 1); exit 1; }; }
1421     fi
1422   fi
1423 fi
1424 echo "$as_me:1424: result: yes" >&5
1425 echo "${ECHO_T}yes" >&6
1426
1427 rm -f a.out a.exe conftest$ac_cv_exeext
1428 ac_clean_files=$ac_clean_files_save
1429 # Check the compiler produces executables we can run.  If not, either
1430 # the compiler is broken, or we cross compile.
1431 echo "$as_me:1431: checking whether we are cross compiling" >&5
1432 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1433 echo "$as_me:1433: result: $cross_compiling" >&5
1434 echo "${ECHO_T}$cross_compiling" >&6
1435
1436 echo "$as_me:1436: checking for executable suffix" >&5
1437 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1438 if { (eval echo "$as_me:1438: \"$ac_link\"") >&5
1439   (eval $ac_link) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }; then
1443   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1444 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1445 # work properly (i.e., refer to `conftest.exe'), while it won't with
1446 # `rm'.
1447 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1448   case $ac_file in
1449     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1450     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1451           export ac_cv_exeext
1452           break;;
1453     * ) break;;
1454   esac
1455 done
1456 else
1457   { { echo "$as_me:1457: error: cannot compute EXEEXT: cannot compile and link" >&5
1458 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1459    { (exit 1); exit 1; }; }
1460 fi
1461
1462 rm -f conftest$ac_cv_exeext
1463 echo "$as_me:1463: result: $ac_cv_exeext" >&5
1464 echo "${ECHO_T}$ac_cv_exeext" >&6
1465
1466 rm -f conftest.$ac_ext
1467 EXEEXT=$ac_cv_exeext
1468 ac_exeext=$EXEEXT
1469 echo "$as_me:1469: checking for object suffix" >&5
1470 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1471 if test "${ac_cv_objext+set}" = set; then
1472   echo $ECHO_N "(cached) $ECHO_C" >&6
1473 else
1474   cat >conftest.$ac_ext <<_ACEOF
1475 #line 1475 "configure"
1476 #include "confdefs.h"
1477
1478 int
1479 main ()
1480 {
1481
1482   ;
1483   return 0;
1484 }
1485 _ACEOF
1486 rm -f conftest.o conftest.obj
1487 if { (eval echo "$as_me:1487: \"$ac_compile\"") >&5
1488   (eval $ac_compile) 2>&5
1489   ac_status=$?
1490   echo "$as_me:1490: \$? = $ac_status" >&5
1491   (exit $ac_status); }; then
1492   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1493   case $ac_file in
1494     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1495     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1496        break;;
1497   esac
1498 done
1499 else
1500   echo "$as_me: failed program was:" >&5
1501 cat conftest.$ac_ext >&5
1502 { { echo "$as_me:1502: error: cannot compute OBJEXT: cannot compile" >&5
1503 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1504    { (exit 1); exit 1; }; }
1505 fi
1506
1507 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1508 fi
1509 echo "$as_me:1509: result: $ac_cv_objext" >&5
1510 echo "${ECHO_T}$ac_cv_objext" >&6
1511 OBJEXT=$ac_cv_objext
1512 ac_objext=$OBJEXT
1513 echo "$as_me:1513: checking whether we are using the GNU C compiler" >&5
1514 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1515 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1516   echo $ECHO_N "(cached) $ECHO_C" >&6
1517 else
1518   cat >conftest.$ac_ext <<_ACEOF
1519 #line 1519 "configure"
1520 #include "confdefs.h"
1521
1522 int
1523 main ()
1524 {
1525 #ifndef __GNUC__
1526        choke me
1527 #endif
1528
1529   ;
1530   return 0;
1531 }
1532 _ACEOF
1533 rm -f conftest.$ac_objext
1534 if { (eval echo "$as_me:1534: \"$ac_compile\"") >&5
1535   (eval $ac_compile) 2>&5
1536   ac_status=$?
1537   echo "$as_me:1537: \$? = $ac_status" >&5
1538   (exit $ac_status); } &&
1539          { ac_try='test -s conftest.$ac_objext'
1540   { (eval echo "$as_me:1540: \"$ac_try\"") >&5
1541   (eval $ac_try) 2>&5
1542   ac_status=$?
1543   echo "$as_me:1543: \$? = $ac_status" >&5
1544   (exit $ac_status); }; }; then
1545   ac_compiler_gnu=yes
1546 else
1547   echo "$as_me: failed program was:" >&5
1548 cat conftest.$ac_ext >&5
1549 ac_compiler_gnu=no
1550 fi
1551 rm -f conftest.$ac_objext conftest.$ac_ext
1552 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1553
1554 fi
1555 echo "$as_me:1555: result: $ac_cv_c_compiler_gnu" >&5
1556 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1557 GCC=`test $ac_compiler_gnu = yes && echo yes`
1558 ac_test_CFLAGS=${CFLAGS+set}
1559 ac_save_CFLAGS=$CFLAGS
1560 CFLAGS="-g"
1561 echo "$as_me:1561: checking whether $CC accepts -g" >&5
1562 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1563 if test "${ac_cv_prog_cc_g+set}" = set; then
1564   echo $ECHO_N "(cached) $ECHO_C" >&6
1565 else
1566   cat >conftest.$ac_ext <<_ACEOF
1567 #line 1567 "configure"
1568 #include "confdefs.h"
1569
1570 int
1571 main ()
1572 {
1573
1574   ;
1575   return 0;
1576 }
1577 _ACEOF
1578 rm -f conftest.$ac_objext
1579 if { (eval echo "$as_me:1579: \"$ac_compile\"") >&5
1580   (eval $ac_compile) 2>&5
1581   ac_status=$?
1582   echo "$as_me:1582: \$? = $ac_status" >&5
1583   (exit $ac_status); } &&
1584          { ac_try='test -s conftest.$ac_objext'
1585   { (eval echo "$as_me:1585: \"$ac_try\"") >&5
1586   (eval $ac_try) 2>&5
1587   ac_status=$?
1588   echo "$as_me:1588: \$? = $ac_status" >&5
1589   (exit $ac_status); }; }; then
1590   ac_cv_prog_cc_g=yes
1591 else
1592   echo "$as_me: failed program was:" >&5
1593 cat conftest.$ac_ext >&5
1594 ac_cv_prog_cc_g=no
1595 fi
1596 rm -f conftest.$ac_objext conftest.$ac_ext
1597 fi
1598 echo "$as_me:1598: result: $ac_cv_prog_cc_g" >&5
1599 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1600 if test "$ac_test_CFLAGS" = set; then
1601   CFLAGS=$ac_save_CFLAGS
1602 elif test $ac_cv_prog_cc_g = yes; then
1603   if test "$GCC" = yes; then
1604     CFLAGS="-g -O2"
1605   else
1606     CFLAGS="-g"
1607   fi
1608 else
1609   if test "$GCC" = yes; then
1610     CFLAGS="-O2"
1611   else
1612     CFLAGS=
1613   fi
1614 fi
1615 # Some people use a C++ compiler to compile C.  Since we use `exit',
1616 # in C++ we need to declare it.  In case someone uses the same compiler
1617 # for both compiling C and C++ we need to have the C++ compiler decide
1618 # the declaration of exit, since it's the most demanding environment.
1619 cat >conftest.$ac_ext <<_ACEOF
1620 #ifndef __cplusplus
1621   choke me
1622 #endif
1623 _ACEOF
1624 rm -f conftest.$ac_objext
1625 if { (eval echo "$as_me:1625: \"$ac_compile\"") >&5
1626   (eval $ac_compile) 2>&5
1627   ac_status=$?
1628   echo "$as_me:1628: \$? = $ac_status" >&5
1629   (exit $ac_status); } &&
1630          { ac_try='test -s conftest.$ac_objext'
1631   { (eval echo "$as_me:1631: \"$ac_try\"") >&5
1632   (eval $ac_try) 2>&5
1633   ac_status=$?
1634   echo "$as_me:1634: \$? = $ac_status" >&5
1635   (exit $ac_status); }; }; then
1636   for ac_declaration in \
1637    ''\
1638    '#include <stdlib.h>' \
1639    'extern "C" void std::exit (int) throw (); using std::exit;' \
1640    'extern "C" void std::exit (int); using std::exit;' \
1641    'extern "C" void exit (int) throw ();' \
1642    'extern "C" void exit (int);' \
1643    'void exit (int);'
1644 do
1645   cat >conftest.$ac_ext <<_ACEOF
1646 #line 1646 "configure"
1647 #include "confdefs.h"
1648 #include <stdlib.h>
1649 $ac_declaration
1650 int
1651 main ()
1652 {
1653 exit (42);
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   :
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 continue
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677   cat >conftest.$ac_ext <<_ACEOF
1678 #line 1678 "configure"
1679 #include "confdefs.h"
1680 $ac_declaration
1681 int
1682 main ()
1683 {
1684 exit (42);
1685   ;
1686   return 0;
1687 }
1688 _ACEOF
1689 rm -f conftest.$ac_objext
1690 if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
1691   (eval $ac_compile) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); } &&
1695          { ac_try='test -s conftest.$ac_objext'
1696   { (eval echo "$as_me:1696: \"$ac_try\"") >&5
1697   (eval $ac_try) 2>&5
1698   ac_status=$?
1699   echo "$as_me:1699: \$? = $ac_status" >&5
1700   (exit $ac_status); }; }; then
1701   break
1702 else
1703   echo "$as_me: failed program was:" >&5
1704 cat conftest.$ac_ext >&5
1705 fi
1706 rm -f conftest.$ac_objext conftest.$ac_ext
1707 done
1708 rm -rf conftest*
1709 if test -n "$ac_declaration"; then
1710   echo '#ifdef __cplusplus' >>confdefs.h
1711   echo $ac_declaration      >>confdefs.h
1712   echo '#endif'             >>confdefs.h
1713 fi
1714
1715 else
1716   echo "$as_me: failed program was:" >&5
1717 cat conftest.$ac_ext >&5
1718 fi
1719 rm -f conftest.$ac_objext conftest.$ac_ext
1720 ac_ext=c
1721 ac_cpp='$CPP $CPPFLAGS'
1722 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1723 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1724 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1725 ac_main_return=return
1726
1727 GCC_VERSION=none
1728 if test "$GCC" = yes ; then
1729         echo "$as_me:1729: checking version of $CC" >&5
1730 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1731         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.].*//'`"
1732         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1733         echo "$as_me:1733: result: $GCC_VERSION" >&5
1734 echo "${ECHO_T}$GCC_VERSION" >&6
1735 fi
1736
1737 echo "$as_me:1737: checking for $CC option to accept ANSI C" >&5
1738 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1739 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1740   echo $ECHO_N "(cached) $ECHO_C" >&6
1741 else
1742   ac_cv_prog_cc_stdc=no
1743 ac_save_CC=$CC
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #line 1745 "configure"
1746 #include "confdefs.h"
1747 #include <stdarg.h>
1748 #include <stdio.h>
1749 #include <sys/types.h>
1750 #include <sys/stat.h>
1751 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1752 struct buf { int x; };
1753 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1754 static char *e (p, i)
1755      char **p;
1756      int i;
1757 {
1758   return p[i];
1759 }
1760 static char *f (char * (*g) (char **, int), char **p, ...)
1761 {
1762   char *s;
1763   va_list v;
1764   va_start (v,p);
1765   s = g (p, va_arg (v,int));
1766   va_end (v);
1767   return s;
1768 }
1769 int test (int i, double x);
1770 struct s1 {int (*f) (int a);};
1771 struct s2 {int (*f) (double a);};
1772 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1773 int argc;
1774 char **argv;
1775 int
1776 main ()
1777 {
1778 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 # Don't try gcc -ansi; that turns off useful extensions and
1784 # breaks some systems' header files.
1785 # AIX                   -qlanglvl=ansi
1786 # Ultrix and OSF/1      -std1
1787 # HP-UX 10.20 and later -Ae
1788 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1789 # SVR4                  -Xc -D__EXTENSIONS__
1790 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1791 do
1792   CC="$ac_save_CC $ac_arg"
1793   rm -f conftest.$ac_objext
1794 if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
1795   (eval $ac_compile) 2>&5
1796   ac_status=$?
1797   echo "$as_me:1797: \$? = $ac_status" >&5
1798   (exit $ac_status); } &&
1799          { ac_try='test -s conftest.$ac_objext'
1800   { (eval echo "$as_me:1800: \"$ac_try\"") >&5
1801   (eval $ac_try) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit $ac_status); }; }; then
1805   ac_cv_prog_cc_stdc=$ac_arg
1806 break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext
1812 done
1813 rm -f conftest.$ac_ext conftest.$ac_objext
1814 CC=$ac_save_CC
1815
1816 fi
1817
1818 case "x$ac_cv_prog_cc_stdc" in
1819   x|xno)
1820     echo "$as_me:1820: result: none needed" >&5
1821 echo "${ECHO_T}none needed" >&6 ;;
1822   *)
1823     echo "$as_me:1823: result: $ac_cv_prog_cc_stdc" >&5
1824 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1825     CC="$CC $ac_cv_prog_cc_stdc" ;;
1826 esac
1827
1828 # This should have been defined by AC_PROG_CC
1829 : ${CC:=cc}
1830
1831 echo "$as_me:1831: checking \$CC variable" >&5
1832 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1833 case "$CC" in
1834 (*[\ \  ]-*)
1835         echo "$as_me:1835: result: broken" >&5
1836 echo "${ECHO_T}broken" >&6
1837         { echo "$as_me:1837: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1838 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1839         # humor him...
1840         cf_flags=`echo "$CC" | sed -e 's/^.*[   ]\(-[^  ]\)/\1/'`
1841         CC=`echo "$CC " | sed -e 's/[   ]-[^    ].*$//' -e 's/[         ]*$//'`
1842         for cf_arg in $cf_flags
1843         do
1844                 case "x$cf_arg" in
1845                 (x-[IUDfgOW]*)
1846
1847 cf_fix_cppflags=no
1848 cf_new_cflags=
1849 cf_new_cppflags=
1850 cf_new_extra_cppflags=
1851
1852 for cf_add_cflags in $cf_flags
1853 do
1854 case $cf_fix_cppflags in
1855 (no)
1856         case $cf_add_cflags in
1857         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1858                 case $cf_add_cflags in
1859                 (-D*)
1860                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1861
1862                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1863                                 && test -z "${cf_tst_cflags}" \
1864                                 && cf_fix_cppflags=yes
1865
1866                         if test $cf_fix_cppflags = yes ; then
1867                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1868                                 continue
1869                         elif test "${cf_tst_cflags}" = "\"'" ; then
1870                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1871                                 continue
1872                         fi
1873                         ;;
1874                 esac
1875                 case "$CPPFLAGS" in
1876                 (*$cf_add_cflags)
1877                         ;;
1878                 (*)
1879                         case $cf_add_cflags in
1880                         (-D*)
1881                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1882
1883 CPPFLAGS=`echo "$CPPFLAGS" | \
1884         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1885                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1886
1887                                 ;;
1888                         esac
1889                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1890                         ;;
1891                 esac
1892                 ;;
1893         (*)
1894                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1895                 ;;
1896         esac
1897         ;;
1898 (yes)
1899         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1900
1901         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1902
1903         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1904                 && test -z "${cf_tst_cflags}" \
1905                 && cf_fix_cppflags=no
1906         ;;
1907 esac
1908 done
1909
1910 if test -n "$cf_new_cflags" ; then
1911
1912         CFLAGS="$CFLAGS $cf_new_cflags"
1913 fi
1914
1915 if test -n "$cf_new_cppflags" ; then
1916
1917         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1918 fi
1919
1920 if test -n "$cf_new_extra_cppflags" ; then
1921
1922         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1923 fi
1924
1925                         ;;
1926                 (*)
1927                         CC="$CC $cf_arg"
1928                         ;;
1929                 esac
1930         done
1931         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
1932
1933 echo "${as_me:-configure}:1933: testing resulting CC: '$CC' ..." 1>&5
1934
1935         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
1936
1937 echo "${as_me:-configure}:1937: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
1938
1939         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
1940
1941 echo "${as_me:-configure}:1941: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
1942
1943         ;;
1944 (*)
1945         echo "$as_me:1945: result: ok" >&5
1946 echo "${ECHO_T}ok" >&6
1947         ;;
1948 esac
1949
1950 ac_ext=c
1951 ac_cpp='$CPP $CPPFLAGS'
1952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1955 ac_main_return=return
1956 echo "$as_me:1956: checking how to run the C preprocessor" >&5
1957 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1958 # On Suns, sometimes $CPP names a directory.
1959 if test -n "$CPP" && test -d "$CPP"; then
1960   CPP=
1961 fi
1962 if test -z "$CPP"; then
1963   if test "${ac_cv_prog_CPP+set}" = set; then
1964   echo $ECHO_N "(cached) $ECHO_C" >&6
1965 else
1966       # Double quotes because CPP needs to be expanded
1967     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1968     do
1969       ac_preproc_ok=false
1970 for ac_c_preproc_warn_flag in '' yes
1971 do
1972   # Use a header file that comes with gcc, so configuring glibc
1973   # with a fresh cross-compiler works.
1974   # On the NeXT, cc -E runs the code through the compiler's parser,
1975   # not just through cpp. "Syntax error" is here to catch this case.
1976   cat >conftest.$ac_ext <<_ACEOF
1977 #line 1977 "configure"
1978 #include "confdefs.h"
1979 #include <assert.h>
1980                      Syntax error
1981 _ACEOF
1982 if { (eval echo "$as_me:1982: \"$ac_cpp conftest.$ac_ext\"") >&5
1983   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1984   ac_status=$?
1985   egrep -v '^ *\+' conftest.er1 >conftest.err
1986   rm -f conftest.er1
1987   cat conftest.err >&5
1988   echo "$as_me:1988: \$? = $ac_status" >&5
1989   (exit $ac_status); } >/dev/null; then
1990   if test -s conftest.err; then
1991     ac_cpp_err=$ac_c_preproc_warn_flag
1992   else
1993     ac_cpp_err=
1994   fi
1995 else
1996   ac_cpp_err=yes
1997 fi
1998 if test -z "$ac_cpp_err"; then
1999   :
2000 else
2001   echo "$as_me: failed program was:" >&5
2002   cat conftest.$ac_ext >&5
2003   # Broken: fails on valid input.
2004 continue
2005 fi
2006 rm -f conftest.err conftest.$ac_ext
2007
2008   # OK, works on sane cases.  Now check whether non-existent headers
2009   # can be detected and how.
2010   cat >conftest.$ac_ext <<_ACEOF
2011 #line 2011 "configure"
2012 #include "confdefs.h"
2013 #include <ac_nonexistent.h>
2014 _ACEOF
2015 if { (eval echo "$as_me:2015: \"$ac_cpp conftest.$ac_ext\"") >&5
2016   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2017   ac_status=$?
2018   egrep -v '^ *\+' conftest.er1 >conftest.err
2019   rm -f conftest.er1
2020   cat conftest.err >&5
2021   echo "$as_me:2021: \$? = $ac_status" >&5
2022   (exit $ac_status); } >/dev/null; then
2023   if test -s conftest.err; then
2024     ac_cpp_err=$ac_c_preproc_warn_flag
2025   else
2026     ac_cpp_err=
2027   fi
2028 else
2029   ac_cpp_err=yes
2030 fi
2031 if test -z "$ac_cpp_err"; then
2032   # Broken: success on invalid input.
2033 continue
2034 else
2035   echo "$as_me: failed program was:" >&5
2036   cat conftest.$ac_ext >&5
2037   # Passes both tests.
2038 ac_preproc_ok=:
2039 break
2040 fi
2041 rm -f conftest.err conftest.$ac_ext
2042
2043 done
2044 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2045 rm -f conftest.err conftest.$ac_ext
2046 if $ac_preproc_ok; then
2047   break
2048 fi
2049
2050     done
2051     ac_cv_prog_CPP=$CPP
2052
2053 fi
2054   CPP=$ac_cv_prog_CPP
2055 else
2056   ac_cv_prog_CPP=$CPP
2057 fi
2058 echo "$as_me:2058: result: $CPP" >&5
2059 echo "${ECHO_T}$CPP" >&6
2060 ac_preproc_ok=false
2061 for ac_c_preproc_warn_flag in '' yes
2062 do
2063   # Use a header file that comes with gcc, so configuring glibc
2064   # with a fresh cross-compiler works.
2065   # On the NeXT, cc -E runs the code through the compiler's parser,
2066   # not just through cpp. "Syntax error" is here to catch this case.
2067   cat >conftest.$ac_ext <<_ACEOF
2068 #line 2068 "configure"
2069 #include "confdefs.h"
2070 #include <assert.h>
2071                      Syntax error
2072 _ACEOF
2073 if { (eval echo "$as_me:2073: \"$ac_cpp conftest.$ac_ext\"") >&5
2074   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2075   ac_status=$?
2076   egrep -v '^ *\+' conftest.er1 >conftest.err
2077   rm -f conftest.er1
2078   cat conftest.err >&5
2079   echo "$as_me:2079: \$? = $ac_status" >&5
2080   (exit $ac_status); } >/dev/null; then
2081   if test -s conftest.err; then
2082     ac_cpp_err=$ac_c_preproc_warn_flag
2083   else
2084     ac_cpp_err=
2085   fi
2086 else
2087   ac_cpp_err=yes
2088 fi
2089 if test -z "$ac_cpp_err"; then
2090   :
2091 else
2092   echo "$as_me: failed program was:" >&5
2093   cat conftest.$ac_ext >&5
2094   # Broken: fails on valid input.
2095 continue
2096 fi
2097 rm -f conftest.err conftest.$ac_ext
2098
2099   # OK, works on sane cases.  Now check whether non-existent headers
2100   # can be detected and how.
2101   cat >conftest.$ac_ext <<_ACEOF
2102 #line 2102 "configure"
2103 #include "confdefs.h"
2104 #include <ac_nonexistent.h>
2105 _ACEOF
2106 if { (eval echo "$as_me:2106: \"$ac_cpp conftest.$ac_ext\"") >&5
2107   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2108   ac_status=$?
2109   egrep -v '^ *\+' conftest.er1 >conftest.err
2110   rm -f conftest.er1
2111   cat conftest.err >&5
2112   echo "$as_me:2112: \$? = $ac_status" >&5
2113   (exit $ac_status); } >/dev/null; then
2114   if test -s conftest.err; then
2115     ac_cpp_err=$ac_c_preproc_warn_flag
2116   else
2117     ac_cpp_err=
2118   fi
2119 else
2120   ac_cpp_err=yes
2121 fi
2122 if test -z "$ac_cpp_err"; then
2123   # Broken: success on invalid input.
2124 continue
2125 else
2126   echo "$as_me: failed program was:" >&5
2127   cat conftest.$ac_ext >&5
2128   # Passes both tests.
2129 ac_preproc_ok=:
2130 break
2131 fi
2132 rm -f conftest.err conftest.$ac_ext
2133
2134 done
2135 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2136 rm -f conftest.err conftest.$ac_ext
2137 if $ac_preproc_ok; then
2138   :
2139 else
2140   { { echo "$as_me:2140: error: C preprocessor \"$CPP\" fails sanity check" >&5
2141 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2142    { (exit 1); exit 1; }; }
2143 fi
2144
2145 ac_ext=c
2146 ac_cpp='$CPP $CPPFLAGS'
2147 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2148 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2149 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2150 ac_main_return=return
2151
2152 if test $ac_cv_c_compiler_gnu = yes; then
2153     echo "$as_me:2153: checking whether $CC needs -traditional" >&5
2154 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2155 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2156   echo $ECHO_N "(cached) $ECHO_C" >&6
2157 else
2158     ac_pattern="Autoconf.*'x'"
2159   cat >conftest.$ac_ext <<_ACEOF
2160 #line 2160 "configure"
2161 #include "confdefs.h"
2162 #include <sgtty.h>
2163 int Autoconf = TIOCGETP;
2164 _ACEOF
2165 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2166   egrep "$ac_pattern" >/dev/null 2>&1; then
2167   ac_cv_prog_gcc_traditional=yes
2168 else
2169   ac_cv_prog_gcc_traditional=no
2170 fi
2171 rm -rf conftest*
2172
2173   if test $ac_cv_prog_gcc_traditional = no; then
2174     cat >conftest.$ac_ext <<_ACEOF
2175 #line 2175 "configure"
2176 #include "confdefs.h"
2177 #include <termio.h>
2178 int Autoconf = TCGETA;
2179 _ACEOF
2180 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2181   egrep "$ac_pattern" >/dev/null 2>&1; then
2182   ac_cv_prog_gcc_traditional=yes
2183 fi
2184 rm -rf conftest*
2185
2186   fi
2187 fi
2188 echo "$as_me:2188: result: $ac_cv_prog_gcc_traditional" >&5
2189 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2190   if test $ac_cv_prog_gcc_traditional = yes; then
2191     CC="$CC -traditional"
2192   fi
2193 fi
2194
2195 echo "$as_me:2195: checking whether $CC understands -c and -o together" >&5
2196 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2197 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2198   echo $ECHO_N "(cached) $ECHO_C" >&6
2199 else
2200
2201 cat > conftest.$ac_ext <<CF_EOF
2202 int main()
2203 {
2204         ${cf_cv_main_return:-return}(0);
2205 }
2206 CF_EOF
2207 # We do the test twice because some compilers refuse to overwrite an
2208 # existing .o file with -o, though they will create one.
2209 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2210 if { (eval echo "$as_me:2210: \"$ac_try\"") >&5
2211   (eval $ac_try) 2>&5
2212   ac_status=$?
2213   echo "$as_me:2213: \$? = $ac_status" >&5
2214   (exit $ac_status); } &&
2215   test -f conftest2.$ac_objext && { (eval echo "$as_me:2215: \"$ac_try\"") >&5
2216   (eval $ac_try) 2>&5
2217   ac_status=$?
2218   echo "$as_me:2218: \$? = $ac_status" >&5
2219   (exit $ac_status); };
2220 then
2221   eval cf_cv_prog_CC_c_o=yes
2222 else
2223   eval cf_cv_prog_CC_c_o=no
2224 fi
2225 rm -rf conftest*
2226
2227 fi
2228 if test $cf_cv_prog_CC_c_o = yes; then
2229   echo "$as_me:2229: result: yes" >&5
2230 echo "${ECHO_T}yes" >&6
2231 else
2232   echo "$as_me:2232: result: no" >&5
2233 echo "${ECHO_T}no" >&6
2234 fi
2235
2236 test "$program_prefix" != NONE &&
2237   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2238 # Use a double $ so make ignores it.
2239 test "$program_suffix" != NONE &&
2240   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2241 # Double any \ or $.  echo might interpret backslashes.
2242 # By default was `s,x,x', remove it if useless.
2243 cat <<\_ACEOF >conftest.sed
2244 s/[\\$]/&&/g;s/;s,x,x,$//
2245 _ACEOF
2246 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2247 rm conftest.sed
2248
2249 for ac_prog in mawk gawk nawk awk
2250 do
2251   # Extract the first word of "$ac_prog", so it can be a program name with args.
2252 set dummy $ac_prog; ac_word=$2
2253 echo "$as_me:2253: checking for $ac_word" >&5
2254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2255 if test "${ac_cv_prog_AWK+set}" = set; then
2256   echo $ECHO_N "(cached) $ECHO_C" >&6
2257 else
2258   if test -n "$AWK"; then
2259   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2260 else
2261   ac_save_IFS=$IFS; IFS=$ac_path_separator
2262 ac_dummy="$PATH"
2263 for ac_dir in $ac_dummy; do
2264   IFS=$ac_save_IFS
2265   test -z "$ac_dir" && ac_dir=.
2266   $as_executable_p "$ac_dir/$ac_word" || continue
2267 ac_cv_prog_AWK="$ac_prog"
2268 echo "$as_me:2268: found $ac_dir/$ac_word" >&5
2269 break
2270 done
2271
2272 fi
2273 fi
2274 AWK=$ac_cv_prog_AWK
2275 if test -n "$AWK"; then
2276   echo "$as_me:2276: result: $AWK" >&5
2277 echo "${ECHO_T}$AWK" >&6
2278 else
2279   echo "$as_me:2279: result: no" >&5
2280 echo "${ECHO_T}no" >&6
2281 fi
2282
2283   test -n "$AWK" && break
2284 done
2285
2286 test -z "$AWK" && { { echo "$as_me:2286: error: No awk program found" >&5
2287 echo "$as_me: error: No awk program found" >&2;}
2288    { (exit 1); exit 1; }; }
2289
2290 echo "$as_me:2290: checking for egrep" >&5
2291 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2292 if test "${ac_cv_prog_egrep+set}" = set; then
2293   echo $ECHO_N "(cached) $ECHO_C" >&6
2294 else
2295   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2296                 then ac_cv_prog_egrep='grep -E'
2297                 else ac_cv_prog_egrep='egrep'
2298         fi
2299 fi
2300 echo "$as_me:2300: result: $ac_cv_prog_egrep" >&5
2301 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2302         EGREP=$ac_cv_prog_egrep
2303
2304         test -z "$EGREP" && { { echo "$as_me:2304: error: No egrep program found" >&5
2305 echo "$as_me: error: No egrep program found" >&2;}
2306    { (exit 1); exit 1; }; }
2307
2308 # Find a good install program.  We prefer a C program (faster),
2309 # so one script is as good as another.  But avoid the broken or
2310 # incompatible versions:
2311 # SysV /etc/install, /usr/sbin/install
2312 # SunOS /usr/etc/install
2313 # IRIX /sbin/install
2314 # AIX /bin/install
2315 # AmigaOS /C/install, which installs bootblocks on floppy discs
2316 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2317 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2318 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2319 # ./install, which can be erroneously created by make from ./install.sh.
2320 echo "$as_me:2320: checking for a BSD compatible install" >&5
2321 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2322 if test -z "$INSTALL"; then
2323 if test "${ac_cv_path_install+set}" = set; then
2324   echo $ECHO_N "(cached) $ECHO_C" >&6
2325 else
2326     ac_save_IFS=$IFS; IFS=$ac_path_separator
2327   for ac_dir in $PATH; do
2328     IFS=$ac_save_IFS
2329     # Account for people who put trailing slashes in PATH elements.
2330     case $ac_dir/ in
2331     / | ./ | .// | /cC/* \
2332     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2333     | /usr/ucb/* ) ;;
2334     *)
2335       # OSF1 and SCO ODT 3.0 have their own names for install.
2336       # Don't use installbsd from OSF since it installs stuff as root
2337       # by default.
2338       for ac_prog in ginstall scoinst install; do
2339         if $as_executable_p "$ac_dir/$ac_prog"; then
2340           if test $ac_prog = install &&
2341             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2342             # AIX install.  It has an incompatible calling convention.
2343             :
2344           elif test $ac_prog = install &&
2345             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2346             # program-specific install script used by HP pwplus--don't use.
2347             :
2348           else
2349             ac_cv_path_install="$ac_dir/$ac_prog -c"
2350             break 2
2351           fi
2352         fi
2353       done
2354       ;;
2355     esac
2356   done
2357
2358 fi
2359   if test "${ac_cv_path_install+set}" = set; then
2360     INSTALL=$ac_cv_path_install
2361   else
2362     # As a last resort, use the slow shell script.  We don't cache a
2363     # path for INSTALL within a source directory, because that will
2364     # break other packages using the cache if that directory is
2365     # removed, or if the path is relative.
2366     INSTALL=$ac_install_sh
2367   fi
2368 fi
2369 echo "$as_me:2369: result: $INSTALL" >&5
2370 echo "${ECHO_T}$INSTALL" >&6
2371
2372 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2373 # It thinks the first close brace ends the variable substitution.
2374 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2375
2376 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2377
2378 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2379
2380 echo "$as_me:2380: checking whether ln -s works" >&5
2381 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2382 LN_S=$as_ln_s
2383 if test "$LN_S" = "ln -s"; then
2384   echo "$as_me:2384: result: yes" >&5
2385 echo "${ECHO_T}yes" >&6
2386 else
2387   echo "$as_me:2387: result: no, using $LN_S" >&5
2388 echo "${ECHO_T}no, using $LN_S" >&6
2389 fi
2390
2391 echo "$as_me:2391: checking if $LN_S -f options work" >&5
2392 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2393
2394 rm -f conf$$.src conf$$dst
2395 echo >conf$$.dst
2396 echo first >conf$$.src
2397 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2398         cf_prog_ln_sf=yes
2399 else
2400         cf_prog_ln_sf=no
2401 fi
2402 rm -f conf$$.dst conf$$src
2403 echo "$as_me:2403: result: $cf_prog_ln_sf" >&5
2404 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2405
2406 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2407
2408 echo "$as_me:2408: checking for long file names" >&5
2409 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2410 if test "${ac_cv_sys_long_file_names+set}" = set; then
2411   echo $ECHO_N "(cached) $ECHO_C" >&6
2412 else
2413   ac_cv_sys_long_file_names=yes
2414 # Test for long file names in all the places we know might matter:
2415 #      .                the current directory, where building will happen
2416 #      $prefix/lib      where we will be installing things
2417 #      $exec_prefix/lib likewise
2418 # eval it to expand exec_prefix.
2419 #      $TMPDIR          if set, where it might want to write temporary files
2420 # if $TMPDIR is not set:
2421 #      /tmp             where it might want to write temporary files
2422 #      /var/tmp         likewise
2423 #      /usr/tmp         likewise
2424 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2425   ac_tmpdirs=$TMPDIR
2426 else
2427   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2428 fi
2429 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2430   test -d $ac_dir || continue
2431   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2432   ac_xdir=$ac_dir/cf$$
2433   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2434   ac_tf1=$ac_xdir/conftest9012345
2435   ac_tf2=$ac_xdir/conftest9012346
2436   (echo 1 >$ac_tf1) 2>/dev/null
2437   (echo 2 >$ac_tf2) 2>/dev/null
2438   ac_val=`cat $ac_tf1 2>/dev/null`
2439   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2440     ac_cv_sys_long_file_names=no
2441     rm -rf $ac_xdir 2>/dev/null
2442     break
2443   fi
2444   rm -rf $ac_xdir 2>/dev/null
2445 done
2446 fi
2447 echo "$as_me:2447: result: $ac_cv_sys_long_file_names" >&5
2448 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2449 if test $ac_cv_sys_long_file_names = yes; then
2450
2451 cat >>confdefs.h <<\EOF
2452 #define HAVE_LONG_FILE_NAMES 1
2453 EOF
2454
2455 fi
2456
2457 # if we find pkg-config, check if we should install the ".pc" files.
2458
2459 echo "$as_me:2459: checking if you want to use pkg-config" >&5
2460 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2461
2462 # Check whether --with-pkg-config or --without-pkg-config was given.
2463 if test "${with_pkg_config+set}" = set; then
2464   withval="$with_pkg_config"
2465   cf_pkg_config=$withval
2466 else
2467   cf_pkg_config=yes
2468 fi;
2469 echo "$as_me:2469: result: $cf_pkg_config" >&5
2470 echo "${ECHO_T}$cf_pkg_config" >&6
2471
2472 case $cf_pkg_config in
2473 (no)
2474         PKG_CONFIG=none
2475         ;;
2476 (yes)
2477
2478 if test -n "$ac_tool_prefix"; then
2479   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2480 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2481 echo "$as_me:2481: checking for $ac_word" >&5
2482 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2483 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2484   echo $ECHO_N "(cached) $ECHO_C" >&6
2485 else
2486   case $PKG_CONFIG in
2487   [\\/]* | ?:[\\/]*)
2488   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2489   ;;
2490   *)
2491   ac_save_IFS=$IFS; IFS=$ac_path_separator
2492 ac_dummy="$PATH"
2493 for ac_dir in $ac_dummy; do
2494   IFS=$ac_save_IFS
2495   test -z "$ac_dir" && ac_dir=.
2496   if $as_executable_p "$ac_dir/$ac_word"; then
2497    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2498    echo "$as_me:2498: found $ac_dir/$ac_word" >&5
2499    break
2500 fi
2501 done
2502
2503   ;;
2504 esac
2505 fi
2506 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2507
2508 if test -n "$PKG_CONFIG"; then
2509   echo "$as_me:2509: result: $PKG_CONFIG" >&5
2510 echo "${ECHO_T}$PKG_CONFIG" >&6
2511 else
2512   echo "$as_me:2512: result: no" >&5
2513 echo "${ECHO_T}no" >&6
2514 fi
2515
2516 fi
2517 if test -z "$ac_cv_path_PKG_CONFIG"; then
2518   ac_pt_PKG_CONFIG=$PKG_CONFIG
2519   # Extract the first word of "pkg-config", so it can be a program name with args.
2520 set dummy pkg-config; ac_word=$2
2521 echo "$as_me:2521: checking for $ac_word" >&5
2522 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2523 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2524   echo $ECHO_N "(cached) $ECHO_C" >&6
2525 else
2526   case $ac_pt_PKG_CONFIG in
2527   [\\/]* | ?:[\\/]*)
2528   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2529   ;;
2530   *)
2531   ac_save_IFS=$IFS; IFS=$ac_path_separator
2532 ac_dummy="$PATH"
2533 for ac_dir in $ac_dummy; do
2534   IFS=$ac_save_IFS
2535   test -z "$ac_dir" && ac_dir=.
2536   if $as_executable_p "$ac_dir/$ac_word"; then
2537    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2538    echo "$as_me:2538: found $ac_dir/$ac_word" >&5
2539    break
2540 fi
2541 done
2542
2543   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2544   ;;
2545 esac
2546 fi
2547 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2548
2549 if test -n "$ac_pt_PKG_CONFIG"; then
2550   echo "$as_me:2550: result: $ac_pt_PKG_CONFIG" >&5
2551 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2552 else
2553   echo "$as_me:2553: result: no" >&5
2554 echo "${ECHO_T}no" >&6
2555 fi
2556
2557   PKG_CONFIG=$ac_pt_PKG_CONFIG
2558 else
2559   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2560 fi
2561
2562         ;;
2563 (*)
2564         PKG_CONFIG=$withval
2565         ;;
2566 esac
2567
2568 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2569 if test "$PKG_CONFIG" != none ; then
2570
2571 if test "x$prefix" != xNONE; then
2572         cf_path_syntax="$prefix"
2573 else
2574         cf_path_syntax="$ac_default_prefix"
2575 fi
2576
2577 case ".$PKG_CONFIG" in
2578 (.\$\(*\)*|.\'*\'*)
2579         ;;
2580 (..|./*|.\\*)
2581         ;;
2582 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2583         ;;
2584 (.\${*prefix}*|.\${*dir}*)
2585         eval PKG_CONFIG="$PKG_CONFIG"
2586         case ".$PKG_CONFIG" in
2587         (.NONE/*)
2588                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2589                 ;;
2590         esac
2591         ;;
2592 (.no|.NONE/*)
2593         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2594         ;;
2595 (*)
2596         { { echo "$as_me:2596: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2597 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2598    { (exit 1); exit 1; }; }
2599         ;;
2600 esac
2601
2602 elif test "x$cf_pkg_config" != xno ; then
2603         { echo "$as_me:2603: WARNING: pkg-config is not installed" >&5
2604 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2605 fi
2606
2607 case $PKG_CONFIG in
2608 (no|none|yes)
2609         echo "$as_me:2609: checking for pkg-config library directory" >&5
2610 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2611         ;;
2612 (*)
2613         echo "$as_me:2613: checking for $PKG_CONFIG library directory" >&5
2614 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2615         ;;
2616 esac
2617
2618 PKG_CONFIG_LIBDIR=no
2619
2620 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2621 if test "${with_pkg_config_libdir+set}" = set; then
2622   withval="$with_pkg_config_libdir"
2623   PKG_CONFIG_LIBDIR=$withval
2624 else
2625   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2626 fi;
2627
2628 case x$PKG_CONFIG_LIBDIR in
2629 (x/*)
2630         ;;
2631 (xyes)
2632         # Look for the library directory using the same prefix as the executable
2633         if test "x$PKG_CONFIG" = xnone
2634         then
2635                 cf_path=$prefix
2636         else
2637                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2638         fi
2639
2640         # If you don't like using the default architecture, you have to specify the
2641         # intended library directory and corresponding compiler/linker options.
2642         #
2643         # This case allows for Debian's 2014-flavor of multiarch, along with the
2644         # most common variations before that point.  Some other variants spell the
2645         # directory differently, e.g., "pkg-config", and put it in unusual places.
2646         # pkg-config has always been poorly standardized, which is ironic...
2647         case x`(arch) 2>/dev/null` in
2648         (*64)
2649                 cf_search_path="\
2650                         $cf_path/lib/*64-linux-gnu \
2651                         $cf_path/share \
2652                         $cf_path/lib64 \
2653                         $cf_path/lib32 \
2654                         $cf_path/lib"
2655                 ;;
2656         (*)
2657                 cf_search_path="\
2658                         $cf_path/lib/*-linux-gnu \
2659                         $cf_path/share \
2660                         $cf_path/lib32 \
2661                         $cf_path/lib \
2662                         $cf_path/libdata"
2663                 ;;
2664         esac
2665
2666         test -n "$verbose" && echo "    list..." 1>&6
2667
2668 echo "${as_me:-configure}:2668: testing list... ..." 1>&5
2669
2670         for cf_config in $cf_search_path
2671         do
2672                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2673
2674 echo "${as_me:-configure}:2674: testing checking $cf_config/pkgconfig ..." 1>&5
2675
2676                 if test -d $cf_config/pkgconfig
2677                 then
2678                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2679                         echo "$as_me:2679: checking done" >&5
2680 echo $ECHO_N "checking done... $ECHO_C" >&6
2681                         break
2682                 fi
2683         done
2684         ;;
2685 (*)
2686         ;;
2687 esac
2688
2689 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2690         echo "$as_me:2690: result: $PKG_CONFIG_LIBDIR" >&5
2691 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2692 fi
2693
2694 echo "$as_me:2694: checking if you want to build test-programs" >&5
2695 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2696
2697 # Check whether --with-tests or --without-tests was given.
2698 if test "${with_tests+set}" = set; then
2699   withval="$with_tests"
2700   cf_with_tests=$withval
2701 else
2702   cf_with_tests=yes
2703 fi;
2704 echo "$as_me:2704: result: $cf_with_tests" >&5
2705 echo "${ECHO_T}$cf_with_tests" >&6
2706
2707 echo "$as_me:2707: checking if we should assume mixed-case filenames" >&5
2708 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2709
2710 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2711 if test "${enable_mixed_case+set}" = set; then
2712   enableval="$enable_mixed_case"
2713   enable_mixedcase=$enableval
2714 else
2715   enable_mixedcase=auto
2716 fi;
2717 echo "$as_me:2717: result: $enable_mixedcase" >&5
2718 echo "${ECHO_T}$enable_mixedcase" >&6
2719 if test "$enable_mixedcase" = "auto" ; then
2720
2721 echo "$as_me:2721: checking if filesystem supports mixed-case filenames" >&5
2722 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2723 if test "${cf_cv_mixedcase+set}" = set; then
2724   echo $ECHO_N "(cached) $ECHO_C" >&6
2725 else
2726
2727 if test "$cross_compiling" = yes ; then
2728         case $target_alias in
2729         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2730                 cf_cv_mixedcase=no
2731                 ;;
2732         (*)
2733                 cf_cv_mixedcase=yes
2734                 ;;
2735         esac
2736 else
2737         rm -f conftest CONFTEST
2738         echo test >conftest
2739         if test -f CONFTEST ; then
2740                 cf_cv_mixedcase=no
2741         else
2742                 cf_cv_mixedcase=yes
2743         fi
2744         rm -f conftest CONFTEST
2745 fi
2746
2747 fi
2748 echo "$as_me:2748: result: $cf_cv_mixedcase" >&5
2749 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2750 test "$cf_cv_mixedcase" = yes &&
2751 cat >>confdefs.h <<\EOF
2752 #define MIXEDCASE_FILENAMES 1
2753 EOF
2754
2755 else
2756         cf_cv_mixedcase=$enable_mixedcase
2757         if test "$enable_mixedcase" = "yes" ; then
2758                 cat >>confdefs.h <<\EOF
2759 #define MIXEDCASE_FILENAMES 1
2760 EOF
2761
2762         fi
2763 fi
2764
2765 # do this after mixed-case option (tags/TAGS is not as important as tic).
2766 echo "$as_me:2766: checking whether ${MAKE-make} sets \${MAKE}" >&5
2767 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2768 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2769 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2770   echo $ECHO_N "(cached) $ECHO_C" >&6
2771 else
2772   cat >conftest.make <<\EOF
2773 all:
2774         @echo 'ac_maketemp="${MAKE}"'
2775 EOF
2776 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2777 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2778 if test -n "$ac_maketemp"; then
2779   eval ac_cv_prog_make_${ac_make}_set=yes
2780 else
2781   eval ac_cv_prog_make_${ac_make}_set=no
2782 fi
2783 rm -f conftest.make
2784 fi
2785 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2786   echo "$as_me:2786: result: yes" >&5
2787 echo "${ECHO_T}yes" >&6
2788   SET_MAKE=
2789 else
2790   echo "$as_me:2790: result: no" >&5
2791 echo "${ECHO_T}no" >&6
2792   SET_MAKE="MAKE=${MAKE-make}"
2793 fi
2794
2795 for ac_prog in exctags ctags
2796 do
2797   # Extract the first word of "$ac_prog", so it can be a program name with args.
2798 set dummy $ac_prog; ac_word=$2
2799 echo "$as_me:2799: checking for $ac_word" >&5
2800 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2801 if test "${ac_cv_prog_CTAGS+set}" = set; then
2802   echo $ECHO_N "(cached) $ECHO_C" >&6
2803 else
2804   if test -n "$CTAGS"; then
2805   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2806 else
2807   ac_save_IFS=$IFS; IFS=$ac_path_separator
2808 ac_dummy="$PATH"
2809 for ac_dir in $ac_dummy; do
2810   IFS=$ac_save_IFS
2811   test -z "$ac_dir" && ac_dir=.
2812   $as_executable_p "$ac_dir/$ac_word" || continue
2813 ac_cv_prog_CTAGS="$ac_prog"
2814 echo "$as_me:2814: found $ac_dir/$ac_word" >&5
2815 break
2816 done
2817
2818 fi
2819 fi
2820 CTAGS=$ac_cv_prog_CTAGS
2821 if test -n "$CTAGS"; then
2822   echo "$as_me:2822: result: $CTAGS" >&5
2823 echo "${ECHO_T}$CTAGS" >&6
2824 else
2825   echo "$as_me:2825: result: no" >&5
2826 echo "${ECHO_T}no" >&6
2827 fi
2828
2829   test -n "$CTAGS" && break
2830 done
2831
2832 for ac_prog in exetags etags
2833 do
2834   # Extract the first word of "$ac_prog", so it can be a program name with args.
2835 set dummy $ac_prog; ac_word=$2
2836 echo "$as_me:2836: checking for $ac_word" >&5
2837 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2838 if test "${ac_cv_prog_ETAGS+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841   if test -n "$ETAGS"; then
2842   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2843 else
2844   ac_save_IFS=$IFS; IFS=$ac_path_separator
2845 ac_dummy="$PATH"
2846 for ac_dir in $ac_dummy; do
2847   IFS=$ac_save_IFS
2848   test -z "$ac_dir" && ac_dir=.
2849   $as_executable_p "$ac_dir/$ac_word" || continue
2850 ac_cv_prog_ETAGS="$ac_prog"
2851 echo "$as_me:2851: found $ac_dir/$ac_word" >&5
2852 break
2853 done
2854
2855 fi
2856 fi
2857 ETAGS=$ac_cv_prog_ETAGS
2858 if test -n "$ETAGS"; then
2859   echo "$as_me:2859: result: $ETAGS" >&5
2860 echo "${ECHO_T}$ETAGS" >&6
2861 else
2862   echo "$as_me:2862: result: no" >&5
2863 echo "${ECHO_T}no" >&6
2864 fi
2865
2866   test -n "$ETAGS" && break
2867 done
2868
2869 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2870 set dummy ${CTAGS:-ctags}; ac_word=$2
2871 echo "$as_me:2871: checking for $ac_word" >&5
2872 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2873 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2874   echo $ECHO_N "(cached) $ECHO_C" >&6
2875 else
2876   if test -n "$MAKE_LOWER_TAGS"; then
2877   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2878 else
2879   ac_save_IFS=$IFS; IFS=$ac_path_separator
2880 ac_dummy="$PATH"
2881 for ac_dir in $ac_dummy; do
2882   IFS=$ac_save_IFS
2883   test -z "$ac_dir" && ac_dir=.
2884   $as_executable_p "$ac_dir/$ac_word" || continue
2885 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2886 echo "$as_me:2886: found $ac_dir/$ac_word" >&5
2887 break
2888 done
2889
2890   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2891 fi
2892 fi
2893 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2894 if test -n "$MAKE_LOWER_TAGS"; then
2895   echo "$as_me:2895: result: $MAKE_LOWER_TAGS" >&5
2896 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2897 else
2898   echo "$as_me:2898: result: no" >&5
2899 echo "${ECHO_T}no" >&6
2900 fi
2901
2902 if test "$cf_cv_mixedcase" = yes ; then
2903         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2904 set dummy ${ETAGS:-etags}; ac_word=$2
2905 echo "$as_me:2905: checking for $ac_word" >&5
2906 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2907 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2908   echo $ECHO_N "(cached) $ECHO_C" >&6
2909 else
2910   if test -n "$MAKE_UPPER_TAGS"; then
2911   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2912 else
2913   ac_save_IFS=$IFS; IFS=$ac_path_separator
2914 ac_dummy="$PATH"
2915 for ac_dir in $ac_dummy; do
2916   IFS=$ac_save_IFS
2917   test -z "$ac_dir" && ac_dir=.
2918   $as_executable_p "$ac_dir/$ac_word" || continue
2919 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2920 echo "$as_me:2920: found $ac_dir/$ac_word" >&5
2921 break
2922 done
2923
2924   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2925 fi
2926 fi
2927 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2928 if test -n "$MAKE_UPPER_TAGS"; then
2929   echo "$as_me:2929: result: $MAKE_UPPER_TAGS" >&5
2930 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2931 else
2932   echo "$as_me:2932: result: no" >&5
2933 echo "${ECHO_T}no" >&6
2934 fi
2935
2936 else
2937         MAKE_UPPER_TAGS=no
2938 fi
2939
2940 if test "$MAKE_UPPER_TAGS" = yes ; then
2941         MAKE_UPPER_TAGS=
2942 else
2943         MAKE_UPPER_TAGS="#"
2944 fi
2945
2946 if test "$MAKE_LOWER_TAGS" = yes ; then
2947         MAKE_LOWER_TAGS=
2948 else
2949         MAKE_LOWER_TAGS="#"
2950 fi
2951
2952 echo "$as_me:2952: checking for makeflags variable" >&5
2953 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2954 if test "${cf_cv_makeflags+set}" = set; then
2955   echo $ECHO_N "(cached) $ECHO_C" >&6
2956 else
2957
2958         cf_cv_makeflags=''
2959         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2960         do
2961                 cat >cf_makeflags.tmp <<CF_EOF
2962 SHELL = $SHELL
2963 all :
2964         @ echo '.$cf_option'
2965 CF_EOF
2966                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2967                 case "$cf_result" in
2968                 (.*k|.*kw)
2969                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2970                         case "$cf_result" in
2971                         (.*CC=*)        cf_cv_makeflags=
2972                                 ;;
2973                         (*)     cf_cv_makeflags=$cf_option
2974                                 ;;
2975                         esac
2976                         break
2977                         ;;
2978                 (.-)    ;;
2979                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2980                         ;;
2981                 esac
2982         done
2983         rm -f cf_makeflags.tmp
2984
2985 fi
2986 echo "$as_me:2986: result: $cf_cv_makeflags" >&5
2987 echo "${ECHO_T}$cf_cv_makeflags" >&6
2988
2989 if test -n "$ac_tool_prefix"; then
2990   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2991 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2992 echo "$as_me:2992: checking for $ac_word" >&5
2993 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2994 if test "${ac_cv_prog_RANLIB+set}" = set; then
2995   echo $ECHO_N "(cached) $ECHO_C" >&6
2996 else
2997   if test -n "$RANLIB"; then
2998   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2999 else
3000   ac_save_IFS=$IFS; IFS=$ac_path_separator
3001 ac_dummy="$PATH"
3002 for ac_dir in $ac_dummy; do
3003   IFS=$ac_save_IFS
3004   test -z "$ac_dir" && ac_dir=.
3005   $as_executable_p "$ac_dir/$ac_word" || continue
3006 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3007 echo "$as_me:3007: found $ac_dir/$ac_word" >&5
3008 break
3009 done
3010
3011 fi
3012 fi
3013 RANLIB=$ac_cv_prog_RANLIB
3014 if test -n "$RANLIB"; then
3015   echo "$as_me:3015: result: $RANLIB" >&5
3016 echo "${ECHO_T}$RANLIB" >&6
3017 else
3018   echo "$as_me:3018: result: no" >&5
3019 echo "${ECHO_T}no" >&6
3020 fi
3021
3022 fi
3023 if test -z "$ac_cv_prog_RANLIB"; then
3024   ac_ct_RANLIB=$RANLIB
3025   # Extract the first word of "ranlib", so it can be a program name with args.
3026 set dummy ranlib; ac_word=$2
3027 echo "$as_me:3027: checking for $ac_word" >&5
3028 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3029 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3030   echo $ECHO_N "(cached) $ECHO_C" >&6
3031 else
3032   if test -n "$ac_ct_RANLIB"; then
3033   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3034 else
3035   ac_save_IFS=$IFS; IFS=$ac_path_separator
3036 ac_dummy="$PATH"
3037 for ac_dir in $ac_dummy; do
3038   IFS=$ac_save_IFS
3039   test -z "$ac_dir" && ac_dir=.
3040   $as_executable_p "$ac_dir/$ac_word" || continue
3041 ac_cv_prog_ac_ct_RANLIB="ranlib"
3042 echo "$as_me:3042: found $ac_dir/$ac_word" >&5
3043 break
3044 done
3045
3046   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3047 fi
3048 fi
3049 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3050 if test -n "$ac_ct_RANLIB"; then
3051   echo "$as_me:3051: result: $ac_ct_RANLIB" >&5
3052 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3053 else
3054   echo "$as_me:3054: result: no" >&5
3055 echo "${ECHO_T}no" >&6
3056 fi
3057
3058   RANLIB=$ac_ct_RANLIB
3059 else
3060   RANLIB="$ac_cv_prog_RANLIB"
3061 fi
3062
3063 if test -n "$ac_tool_prefix"; then
3064   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3065 set dummy ${ac_tool_prefix}ld; ac_word=$2
3066 echo "$as_me:3066: checking for $ac_word" >&5
3067 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3068 if test "${ac_cv_prog_LD+set}" = set; then
3069   echo $ECHO_N "(cached) $ECHO_C" >&6
3070 else
3071   if test -n "$LD"; then
3072   ac_cv_prog_LD="$LD" # Let the user override the test.
3073 else
3074   ac_save_IFS=$IFS; IFS=$ac_path_separator
3075 ac_dummy="$PATH"
3076 for ac_dir in $ac_dummy; do
3077   IFS=$ac_save_IFS
3078   test -z "$ac_dir" && ac_dir=.
3079   $as_executable_p "$ac_dir/$ac_word" || continue
3080 ac_cv_prog_LD="${ac_tool_prefix}ld"
3081 echo "$as_me:3081: found $ac_dir/$ac_word" >&5
3082 break
3083 done
3084
3085 fi
3086 fi
3087 LD=$ac_cv_prog_LD
3088 if test -n "$LD"; then
3089   echo "$as_me:3089: result: $LD" >&5
3090 echo "${ECHO_T}$LD" >&6
3091 else
3092   echo "$as_me:3092: result: no" >&5
3093 echo "${ECHO_T}no" >&6
3094 fi
3095
3096 fi
3097 if test -z "$ac_cv_prog_LD"; then
3098   ac_ct_LD=$LD
3099   # Extract the first word of "ld", so it can be a program name with args.
3100 set dummy ld; ac_word=$2
3101 echo "$as_me:3101: checking for $ac_word" >&5
3102 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3103 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3104   echo $ECHO_N "(cached) $ECHO_C" >&6
3105 else
3106   if test -n "$ac_ct_LD"; then
3107   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3108 else
3109   ac_save_IFS=$IFS; IFS=$ac_path_separator
3110 ac_dummy="$PATH"
3111 for ac_dir in $ac_dummy; do
3112   IFS=$ac_save_IFS
3113   test -z "$ac_dir" && ac_dir=.
3114   $as_executable_p "$ac_dir/$ac_word" || continue
3115 ac_cv_prog_ac_ct_LD="ld"
3116 echo "$as_me:3116: found $ac_dir/$ac_word" >&5
3117 break
3118 done
3119
3120   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3121 fi
3122 fi
3123 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3124 if test -n "$ac_ct_LD"; then
3125   echo "$as_me:3125: result: $ac_ct_LD" >&5
3126 echo "${ECHO_T}$ac_ct_LD" >&6
3127 else
3128   echo "$as_me:3128: result: no" >&5
3129 echo "${ECHO_T}no" >&6
3130 fi
3131
3132   LD=$ac_ct_LD
3133 else
3134   LD="$ac_cv_prog_LD"
3135 fi
3136
3137 if test -n "$ac_tool_prefix"; then
3138   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3139 set dummy ${ac_tool_prefix}ar; ac_word=$2
3140 echo "$as_me:3140: checking for $ac_word" >&5
3141 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3142 if test "${ac_cv_prog_AR+set}" = set; then
3143   echo $ECHO_N "(cached) $ECHO_C" >&6
3144 else
3145   if test -n "$AR"; then
3146   ac_cv_prog_AR="$AR" # Let the user override the test.
3147 else
3148   ac_save_IFS=$IFS; IFS=$ac_path_separator
3149 ac_dummy="$PATH"
3150 for ac_dir in $ac_dummy; do
3151   IFS=$ac_save_IFS
3152   test -z "$ac_dir" && ac_dir=.
3153   $as_executable_p "$ac_dir/$ac_word" || continue
3154 ac_cv_prog_AR="${ac_tool_prefix}ar"
3155 echo "$as_me:3155: found $ac_dir/$ac_word" >&5
3156 break
3157 done
3158
3159 fi
3160 fi
3161 AR=$ac_cv_prog_AR
3162 if test -n "$AR"; then
3163   echo "$as_me:3163: result: $AR" >&5
3164 echo "${ECHO_T}$AR" >&6
3165 else
3166   echo "$as_me:3166: result: no" >&5
3167 echo "${ECHO_T}no" >&6
3168 fi
3169
3170 fi
3171 if test -z "$ac_cv_prog_AR"; then
3172   ac_ct_AR=$AR
3173   # Extract the first word of "ar", so it can be a program name with args.
3174 set dummy ar; ac_word=$2
3175 echo "$as_me:3175: checking for $ac_word" >&5
3176 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3177 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3178   echo $ECHO_N "(cached) $ECHO_C" >&6
3179 else
3180   if test -n "$ac_ct_AR"; then
3181   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3182 else
3183   ac_save_IFS=$IFS; IFS=$ac_path_separator
3184 ac_dummy="$PATH"
3185 for ac_dir in $ac_dummy; do
3186   IFS=$ac_save_IFS
3187   test -z "$ac_dir" && ac_dir=.
3188   $as_executable_p "$ac_dir/$ac_word" || continue
3189 ac_cv_prog_ac_ct_AR="ar"
3190 echo "$as_me:3190: found $ac_dir/$ac_word" >&5
3191 break
3192 done
3193
3194   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3195 fi
3196 fi
3197 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3198 if test -n "$ac_ct_AR"; then
3199   echo "$as_me:3199: result: $ac_ct_AR" >&5
3200 echo "${ECHO_T}$ac_ct_AR" >&6
3201 else
3202   echo "$as_me:3202: result: no" >&5
3203 echo "${ECHO_T}no" >&6
3204 fi
3205
3206   AR=$ac_ct_AR
3207 else
3208   AR="$ac_cv_prog_AR"
3209 fi
3210
3211 if test -n "$ac_tool_prefix"; then
3212   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3213 set dummy ${ac_tool_prefix}ar; ac_word=$2
3214 echo "$as_me:3214: checking for $ac_word" >&5
3215 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3216 if test "${ac_cv_prog_AR+set}" = set; then
3217   echo $ECHO_N "(cached) $ECHO_C" >&6
3218 else
3219   if test -n "$AR"; then
3220   ac_cv_prog_AR="$AR" # Let the user override the test.
3221 else
3222   ac_save_IFS=$IFS; IFS=$ac_path_separator
3223 ac_dummy="$PATH"
3224 for ac_dir in $ac_dummy; do
3225   IFS=$ac_save_IFS
3226   test -z "$ac_dir" && ac_dir=.
3227   $as_executable_p "$ac_dir/$ac_word" || continue
3228 ac_cv_prog_AR="${ac_tool_prefix}ar"
3229 echo "$as_me:3229: found $ac_dir/$ac_word" >&5
3230 break
3231 done
3232
3233 fi
3234 fi
3235 AR=$ac_cv_prog_AR
3236 if test -n "$AR"; then
3237   echo "$as_me:3237: result: $AR" >&5
3238 echo "${ECHO_T}$AR" >&6
3239 else
3240   echo "$as_me:3240: result: no" >&5
3241 echo "${ECHO_T}no" >&6
3242 fi
3243
3244 fi
3245 if test -z "$ac_cv_prog_AR"; then
3246   ac_ct_AR=$AR
3247   # Extract the first word of "ar", so it can be a program name with args.
3248 set dummy ar; ac_word=$2
3249 echo "$as_me:3249: checking for $ac_word" >&5
3250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3251 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3252   echo $ECHO_N "(cached) $ECHO_C" >&6
3253 else
3254   if test -n "$ac_ct_AR"; then
3255   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3256 else
3257   ac_save_IFS=$IFS; IFS=$ac_path_separator
3258 ac_dummy="$PATH"
3259 for ac_dir in $ac_dummy; do
3260   IFS=$ac_save_IFS
3261   test -z "$ac_dir" && ac_dir=.
3262   $as_executable_p "$ac_dir/$ac_word" || continue
3263 ac_cv_prog_ac_ct_AR="ar"
3264 echo "$as_me:3264: found $ac_dir/$ac_word" >&5
3265 break
3266 done
3267
3268   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3269 fi
3270 fi
3271 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3272 if test -n "$ac_ct_AR"; then
3273   echo "$as_me:3273: result: $ac_ct_AR" >&5
3274 echo "${ECHO_T}$ac_ct_AR" >&6
3275 else
3276   echo "$as_me:3276: result: no" >&5
3277 echo "${ECHO_T}no" >&6
3278 fi
3279
3280   AR=$ac_ct_AR
3281 else
3282   AR="$ac_cv_prog_AR"
3283 fi
3284
3285 echo "$as_me:3285: checking for options to update archives" >&5
3286 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3287 if test "${cf_cv_ar_flags+set}" = set; then
3288   echo $ECHO_N "(cached) $ECHO_C" >&6
3289 else
3290
3291         cf_cv_ar_flags=unknown
3292         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3293         do
3294
3295                 # check if $ARFLAGS already contains this choice
3296                 if test "x$ARFLAGS" != "x" ; then
3297                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3298                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3299                                 cf_cv_ar_flags=
3300                                 break
3301                         fi
3302                 fi
3303
3304                 rm -f conftest.$ac_cv_objext
3305                 rm -f conftest.a
3306
3307                 cat >conftest.$ac_ext <<EOF
3308 #line 3308 "configure"
3309 int     testdata[3] = { 123, 456, 789 };
3310 EOF
3311                 if { (eval echo "$as_me:3311: \"$ac_compile\"") >&5
3312   (eval $ac_compile) 2>&5
3313   ac_status=$?
3314   echo "$as_me:3314: \$? = $ac_status" >&5
3315   (exit $ac_status); } ; then
3316                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3317                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3318                         if test -f conftest.a ; then
3319                                 cf_cv_ar_flags=$cf_ar_flags
3320                                 break
3321                         fi
3322                 else
3323                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3324
3325 echo "${as_me:-configure}:3325: testing cannot compile test-program ..." 1>&5
3326
3327                         break
3328                 fi
3329         done
3330         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3331
3332 fi
3333 echo "$as_me:3333: result: $cf_cv_ar_flags" >&5
3334 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3335
3336 if test -n "$ARFLAGS" ; then
3337         if test -n "$cf_cv_ar_flags" ; then
3338                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3339         fi
3340 else
3341         ARFLAGS=$cf_cv_ar_flags
3342 fi
3343
3344         echo "$as_me:3344: checking for PATH separator" >&5
3345 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3346         case $cf_cv_system_name in
3347         (os2*)  PATH_SEPARATOR=';'  ;;
3348         (*)     ${PATH_SEPARATOR:=':'}  ;;
3349         esac
3350
3351         echo "$as_me:3351: result: $PATH_SEPARATOR" >&5
3352 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3353
3354 echo "$as_me:3354: checking if you have specified an install-prefix" >&5
3355 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3356
3357 # Check whether --with-install-prefix or --without-install-prefix was given.
3358 if test "${with_install_prefix+set}" = set; then
3359   withval="$with_install_prefix"
3360   case "$withval" in
3361         (yes|no)
3362                 ;;
3363         (*)     DESTDIR="$withval"
3364                 ;;
3365         esac
3366 fi;
3367 echo "$as_me:3367: result: $DESTDIR" >&5
3368 echo "${ECHO_T}$DESTDIR" >&6
3369
3370 ###############################################################################
3371
3372 # If we're cross-compiling, allow the user to override the tools and their
3373 # options.  The configure script is oriented toward identifying the host
3374 # compiler, etc., but we need a build compiler to generate parts of the source.
3375
3376 if test "$cross_compiling" = yes ; then
3377
3378         # defaults that we might want to override
3379         : ${BUILD_CFLAGS:=''}
3380         : ${BUILD_CPPFLAGS:=''}
3381         : ${BUILD_LDFLAGS:=''}
3382         : ${BUILD_LIBS:=''}
3383         : ${BUILD_EXEEXT:='$x'}
3384         : ${BUILD_OBJEXT:='o'}
3385
3386 # Check whether --with-build-cc or --without-build-cc was given.
3387 if test "${with_build_cc+set}" = set; then
3388   withval="$with_build_cc"
3389   BUILD_CC="$withval"
3390 else
3391   for ac_prog in gcc cc cl
3392 do
3393   # Extract the first word of "$ac_prog", so it can be a program name with args.
3394 set dummy $ac_prog; ac_word=$2
3395 echo "$as_me:3395: checking for $ac_word" >&5
3396 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3397 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3398   echo $ECHO_N "(cached) $ECHO_C" >&6
3399 else
3400   if test -n "$BUILD_CC"; then
3401   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3402 else
3403   ac_save_IFS=$IFS; IFS=$ac_path_separator
3404 ac_dummy="$PATH"
3405 for ac_dir in $ac_dummy; do
3406   IFS=$ac_save_IFS
3407   test -z "$ac_dir" && ac_dir=.
3408   $as_executable_p "$ac_dir/$ac_word" || continue
3409 ac_cv_prog_BUILD_CC="$ac_prog"
3410 echo "$as_me:3410: found $ac_dir/$ac_word" >&5
3411 break
3412 done
3413
3414 fi
3415 fi
3416 BUILD_CC=$ac_cv_prog_BUILD_CC
3417 if test -n "$BUILD_CC"; then
3418   echo "$as_me:3418: result: $BUILD_CC" >&5
3419 echo "${ECHO_T}$BUILD_CC" >&6
3420 else
3421   echo "$as_me:3421: result: no" >&5
3422 echo "${ECHO_T}no" >&6
3423 fi
3424
3425   test -n "$BUILD_CC" && break
3426 done
3427
3428 fi;
3429         echo "$as_me:3429: checking for native build C compiler" >&5
3430 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3431         echo "$as_me:3431: result: $BUILD_CC" >&5
3432 echo "${ECHO_T}$BUILD_CC" >&6
3433
3434         echo "$as_me:3434: checking for native build C preprocessor" >&5
3435 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3436
3437 # Check whether --with-build-cpp or --without-build-cpp was given.
3438 if test "${with_build_cpp+set}" = set; then
3439   withval="$with_build_cpp"
3440   BUILD_CPP="$withval"
3441 else
3442   BUILD_CPP='${BUILD_CC} -E'
3443 fi;
3444         echo "$as_me:3444: result: $BUILD_CPP" >&5
3445 echo "${ECHO_T}$BUILD_CPP" >&6
3446
3447         echo "$as_me:3447: checking for native build C flags" >&5
3448 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3449
3450 # Check whether --with-build-cflags or --without-build-cflags was given.
3451 if test "${with_build_cflags+set}" = set; then
3452   withval="$with_build_cflags"
3453   BUILD_CFLAGS="$withval"
3454 fi;
3455         echo "$as_me:3455: result: $BUILD_CFLAGS" >&5
3456 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3457
3458         echo "$as_me:3458: checking for native build C preprocessor-flags" >&5
3459 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3460
3461 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3462 if test "${with_build_cppflags+set}" = set; then
3463   withval="$with_build_cppflags"
3464   BUILD_CPPFLAGS="$withval"
3465 fi;
3466         echo "$as_me:3466: result: $BUILD_CPPFLAGS" >&5
3467 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3468
3469         echo "$as_me:3469: checking for native build linker-flags" >&5
3470 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3471
3472 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3473 if test "${with_build_ldflags+set}" = set; then
3474   withval="$with_build_ldflags"
3475   BUILD_LDFLAGS="$withval"
3476 fi;
3477         echo "$as_me:3477: result: $BUILD_LDFLAGS" >&5
3478 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3479
3480         echo "$as_me:3480: checking for native build linker-libraries" >&5
3481 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3482
3483 # Check whether --with-build-libs or --without-build-libs was given.
3484 if test "${with_build_libs+set}" = set; then
3485   withval="$with_build_libs"
3486   BUILD_LIBS="$withval"
3487 fi;
3488         echo "$as_me:3488: result: $BUILD_LIBS" >&5
3489 echo "${ECHO_T}$BUILD_LIBS" >&6
3490
3491         # this assumes we're on Unix.
3492         BUILD_EXEEXT=
3493         BUILD_OBJEXT=o
3494
3495         : ${BUILD_CC:='${CC}'}
3496
3497         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3498                 { { echo "$as_me:3498: error: Cross-build requires two compilers.
3499 Use --with-build-cc to specify the native compiler." >&5
3500 echo "$as_me: error: Cross-build requires two compilers.
3501 Use --with-build-cc to specify the native compiler." >&2;}
3502    { (exit 1); exit 1; }; }
3503         fi
3504
3505 else
3506         : ${BUILD_CC:='${CC}'}
3507         : ${BUILD_CPP:='${CPP}'}
3508         : ${BUILD_CFLAGS:='${CFLAGS}'}
3509         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3510         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3511         : ${BUILD_LIBS:='${LIBS}'}
3512         : ${BUILD_EXEEXT:='$x'}
3513         : ${BUILD_OBJEXT:='o'}
3514 fi
3515
3516 ###############################################################################
3517
3518 ### Options to allow the user to specify the set of libraries which are used.
3519 ### Use "--without-normal --with-shared" to allow the default model to be
3520 ### shared, for example.
3521 cf_list_models=""
3522
3523 echo "$as_me:3523: checking if you want to build shared C-objects" >&5
3524 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3525
3526 # Check whether --with-shared or --without-shared was given.
3527 if test "${with_shared+set}" = set; then
3528   withval="$with_shared"
3529   with_shared=$withval
3530 else
3531   with_shared=no
3532 fi;
3533 echo "$as_me:3533: result: $with_shared" >&5
3534 echo "${ECHO_T}$with_shared" >&6
3535 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3536
3537 echo "$as_me:3537: checking for specified models" >&5
3538 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3539 test -z "$cf_list_models" && cf_list_models=normal
3540 echo "$as_me:3540: result: $cf_list_models" >&5
3541 echo "${ECHO_T}$cf_list_models" >&6
3542
3543 ### Use the first model as the default, and save its suffix for use in building
3544 ### up test-applications.
3545 echo "$as_me:3545: checking for default model" >&5
3546 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3547 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3548 echo "$as_me:3548: result: $DFT_LWR_MODEL" >&5
3549 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3550
3551 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3552
3553 echo "$as_me:3553: checking for specific curses-directory" >&5
3554 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3555
3556 # Check whether --with-curses-dir or --without-curses-dir was given.
3557 if test "${with_curses_dir+set}" = set; then
3558   withval="$with_curses_dir"
3559   cf_cv_curses_dir=$withval
3560 else
3561   cf_cv_curses_dir=no
3562 fi;
3563 echo "$as_me:3563: result: $cf_cv_curses_dir" >&5
3564 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3565
3566 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3567 then
3568
3569 if test "x$prefix" != xNONE; then
3570         cf_path_syntax="$prefix"
3571 else
3572         cf_path_syntax="$ac_default_prefix"
3573 fi
3574
3575 case ".$withval" in
3576 (.\$\(*\)*|.\'*\'*)
3577         ;;
3578 (..|./*|.\\*)
3579         ;;
3580 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3581         ;;
3582 (.\${*prefix}*|.\${*dir}*)
3583         eval withval="$withval"
3584         case ".$withval" in
3585         (.NONE/*)
3586                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3587                 ;;
3588         esac
3589         ;;
3590 (.no|.NONE/*)
3591         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3592         ;;
3593 (*)
3594         { { echo "$as_me:3594: error: expected a pathname, not \"$withval\"" >&5
3595 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3596    { (exit 1); exit 1; }; }
3597         ;;
3598 esac
3599
3600         if test -d "$cf_cv_curses_dir"
3601         then
3602
3603 if test -n "$cf_cv_curses_dir/include" ; then
3604   for cf_add_incdir in $cf_cv_curses_dir/include
3605   do
3606         while test $cf_add_incdir != /usr/include
3607         do
3608           if test -d $cf_add_incdir
3609           then
3610                 cf_have_incdir=no
3611                 if test -n "$CFLAGS$CPPFLAGS" ; then
3612                   # a loop is needed to ensure we can add subdirs of existing dirs
3613                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3614                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3615                           cf_have_incdir=yes; break
3616                         fi
3617                   done
3618                 fi
3619
3620                 if test "$cf_have_incdir" = no ; then
3621                   if test "$cf_add_incdir" = /usr/local/include ; then
3622                         if test "$GCC" = yes
3623                         then
3624                           cf_save_CPPFLAGS=$CPPFLAGS
3625                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3626                           cat >conftest.$ac_ext <<_ACEOF
3627 #line 3627 "configure"
3628 #include "confdefs.h"
3629 #include <stdio.h>
3630 int
3631 main ()
3632 {
3633 printf("Hello")
3634   ;
3635   return 0;
3636 }
3637 _ACEOF
3638 rm -f conftest.$ac_objext
3639 if { (eval echo "$as_me:3639: \"$ac_compile\"") >&5
3640   (eval $ac_compile) 2>&5
3641   ac_status=$?
3642   echo "$as_me:3642: \$? = $ac_status" >&5
3643   (exit $ac_status); } &&
3644          { ac_try='test -s conftest.$ac_objext'
3645   { (eval echo "$as_me:3645: \"$ac_try\"") >&5
3646   (eval $ac_try) 2>&5
3647   ac_status=$?
3648   echo "$as_me:3648: \$? = $ac_status" >&5
3649   (exit $ac_status); }; }; then
3650   :
3651 else
3652   echo "$as_me: failed program was:" >&5
3653 cat conftest.$ac_ext >&5
3654 cf_have_incdir=yes
3655 fi
3656 rm -f conftest.$ac_objext conftest.$ac_ext
3657                           CPPFLAGS=$cf_save_CPPFLAGS
3658                         fi
3659                   fi
3660                 fi
3661
3662                 if test "$cf_have_incdir" = no ; then
3663                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3664
3665 echo "${as_me:-configure}:3665: testing adding $cf_add_incdir to include-path ..." 1>&5
3666
3667                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3668
3669                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3670                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3671                   cf_add_incdir="$cf_top_incdir"
3672                 else
3673                   break
3674                 fi
3675           else
3676                 break
3677           fi
3678         done
3679   done
3680 fi
3681
3682 if test -n "$cf_cv_curses_dir/lib" ; then
3683         for cf_add_libdir in $cf_cv_curses_dir/lib
3684         do
3685                 if test $cf_add_libdir = /usr/lib ; then
3686                         :
3687                 elif test -d $cf_add_libdir
3688                 then
3689                         cf_have_libdir=no
3690                         if test -n "$LDFLAGS$LIBS" ; then
3691                                 # a loop is needed to ensure we can add subdirs of existing dirs
3692                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3693                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3694                                                 cf_have_libdir=yes; break
3695                                         fi
3696                                 done
3697                         fi
3698                         if test "$cf_have_libdir" = no ; then
3699                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3700
3701 echo "${as_me:-configure}:3701: testing adding $cf_add_libdir to library-path ..." 1>&5
3702
3703                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3704                         fi
3705                 fi
3706         done
3707 fi
3708
3709         fi
3710 fi
3711
3712 cf_ncuconfig_root=ncurses
3713 cf_have_ncuconfig=no
3714
3715 if test "x${PKG_CONFIG:=none}" != xnone; then
3716         echo "$as_me:3716: checking pkg-config for $cf_ncuconfig_root" >&5
3717 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3718         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3719                 echo "$as_me:3719: result: yes" >&5
3720 echo "${ECHO_T}yes" >&6
3721
3722                 echo "$as_me:3722: checking if the $cf_ncuconfig_root package files work" >&5
3723 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3724                 cf_have_ncuconfig=unknown
3725
3726                 cf_save_CPPFLAGS="$CPPFLAGS"
3727                 cf_save_LIBS="$LIBS"
3728
3729                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3730
3731 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3732 # Filter out duplicates - this happens with badly-designed ".pc" files...
3733 for cf_add_1lib in $LIBS
3734 do
3735         for cf_add_2lib in $cf_add_libs
3736         do
3737                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3738                 then
3739                         cf_add_1lib=
3740                         break
3741                 fi
3742         done
3743         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3744 done
3745 LIBS="$cf_add_libs"
3746
3747                 cat >conftest.$ac_ext <<_ACEOF
3748 #line 3748 "configure"
3749 #include "confdefs.h"
3750 #include <${cf_cv_ncurses_header:-curses.h}>
3751 int
3752 main ()
3753 {
3754 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3755   ;
3756   return 0;
3757 }
3758 _ACEOF
3759 rm -f conftest.$ac_objext conftest$ac_exeext
3760 if { (eval echo "$as_me:3760: \"$ac_link\"") >&5
3761   (eval $ac_link) 2>&5
3762   ac_status=$?
3763   echo "$as_me:3763: \$? = $ac_status" >&5
3764   (exit $ac_status); } &&
3765          { ac_try='test -s conftest$ac_exeext'
3766   { (eval echo "$as_me:3766: \"$ac_try\"") >&5
3767   (eval $ac_try) 2>&5
3768   ac_status=$?
3769   echo "$as_me:3769: \$? = $ac_status" >&5
3770   (exit $ac_status); }; }; then
3771   if test "$cross_compiling" = yes; then
3772   cf_have_ncuconfig=maybe
3773 else
3774   cat >conftest.$ac_ext <<_ACEOF
3775 #line 3775 "configure"
3776 #include "confdefs.h"
3777 #include <${cf_cv_ncurses_header:-curses.h}>
3778                                 int main(void)
3779                                 { char *xx = curses_version(); return (xx == 0); }
3780 _ACEOF
3781 rm -f conftest$ac_exeext
3782 if { (eval echo "$as_me:3782: \"$ac_link\"") >&5
3783   (eval $ac_link) 2>&5
3784   ac_status=$?
3785   echo "$as_me:3785: \$? = $ac_status" >&5
3786   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3787   { (eval echo "$as_me:3787: \"$ac_try\"") >&5
3788   (eval $ac_try) 2>&5
3789   ac_status=$?
3790   echo "$as_me:3790: \$? = $ac_status" >&5
3791   (exit $ac_status); }; }; then
3792   cf_have_ncuconfig=yes
3793 else
3794   echo "$as_me: program exited with status $ac_status" >&5
3795 echo "$as_me: failed program was:" >&5
3796 cat conftest.$ac_ext >&5
3797 cf_have_ncuconfig=no
3798 fi
3799 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3800 fi
3801 else
3802   echo "$as_me: failed program was:" >&5
3803 cat conftest.$ac_ext >&5
3804 cf_have_ncuconfig=no
3805 fi
3806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3807                 echo "$as_me:3807: result: $cf_have_ncuconfig" >&5
3808 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3809                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3810                 if test "$cf_have_ncuconfig" != "yes"
3811                 then
3812                         CPPFLAGS="$cf_save_CPPFLAGS"
3813                         LIBS="$cf_save_LIBS"
3814                         NCURSES_CONFIG_PKG=none
3815                 else
3816
3817 cat >>confdefs.h <<\EOF
3818 #define NCURSES 1
3819 EOF
3820
3821                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3822                 fi
3823
3824         else
3825                 echo "$as_me:3825: result: no" >&5
3826 echo "${ECHO_T}no" >&6
3827                 NCURSES_CONFIG_PKG=none
3828         fi
3829 else
3830         NCURSES_CONFIG_PKG=none
3831 fi
3832
3833 if test "x$cf_have_ncuconfig" = "xno"; then
3834         echo "Looking for ${cf_ncuconfig_root}-config"
3835
3836 if test -n "$ac_tool_prefix"; then
3837   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3838   do
3839     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3840 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3841 echo "$as_me:3841: checking for $ac_word" >&5
3842 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3843 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3844   echo $ECHO_N "(cached) $ECHO_C" >&6
3845 else
3846   if test -n "$NCURSES_CONFIG"; then
3847   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3848 else
3849   ac_save_IFS=$IFS; IFS=$ac_path_separator
3850 ac_dummy="$PATH"
3851 for ac_dir in $ac_dummy; do
3852   IFS=$ac_save_IFS
3853   test -z "$ac_dir" && ac_dir=.
3854   $as_executable_p "$ac_dir/$ac_word" || continue
3855 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3856 echo "$as_me:3856: found $ac_dir/$ac_word" >&5
3857 break
3858 done
3859
3860 fi
3861 fi
3862 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3863 if test -n "$NCURSES_CONFIG"; then
3864   echo "$as_me:3864: result: $NCURSES_CONFIG" >&5
3865 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3866 else
3867   echo "$as_me:3867: result: no" >&5
3868 echo "${ECHO_T}no" >&6
3869 fi
3870
3871     test -n "$NCURSES_CONFIG" && break
3872   done
3873 fi
3874 if test -z "$NCURSES_CONFIG"; then
3875   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3876   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3877 do
3878   # Extract the first word of "$ac_prog", so it can be a program name with args.
3879 set dummy $ac_prog; ac_word=$2
3880 echo "$as_me:3880: checking for $ac_word" >&5
3881 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3882 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3883   echo $ECHO_N "(cached) $ECHO_C" >&6
3884 else
3885   if test -n "$ac_ct_NCURSES_CONFIG"; then
3886   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3887 else
3888   ac_save_IFS=$IFS; IFS=$ac_path_separator
3889 ac_dummy="$PATH"
3890 for ac_dir in $ac_dummy; do
3891   IFS=$ac_save_IFS
3892   test -z "$ac_dir" && ac_dir=.
3893   $as_executable_p "$ac_dir/$ac_word" || continue
3894 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3895 echo "$as_me:3895: found $ac_dir/$ac_word" >&5
3896 break
3897 done
3898
3899 fi
3900 fi
3901 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3902 if test -n "$ac_ct_NCURSES_CONFIG"; then
3903   echo "$as_me:3903: result: $ac_ct_NCURSES_CONFIG" >&5
3904 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3905 else
3906   echo "$as_me:3906: result: no" >&5
3907 echo "${ECHO_T}no" >&6
3908 fi
3909
3910   test -n "$ac_ct_NCURSES_CONFIG" && break
3911 done
3912 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3913
3914   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3915 fi
3916
3917         if test "$NCURSES_CONFIG" != none ; then
3918
3919                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3920
3921 cf_add_libs="`$NCURSES_CONFIG --libs`"
3922 # Filter out duplicates - this happens with badly-designed ".pc" files...
3923 for cf_add_1lib in $LIBS
3924 do
3925         for cf_add_2lib in $cf_add_libs
3926         do
3927                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3928                 then
3929                         cf_add_1lib=
3930                         break
3931                 fi
3932         done
3933         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3934 done
3935 LIBS="$cf_add_libs"
3936
3937                 # even with config script, some packages use no-override for curses.h
3938
3939 echo "$as_me:3939: checking if we have identified curses headers" >&5
3940 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3941 if test "${cf_cv_ncurses_header+set}" = set; then
3942   echo $ECHO_N "(cached) $ECHO_C" >&6
3943 else
3944
3945 cf_cv_ncurses_header=none
3946 for cf_header in \
3947         ncurses.h ncurses/ncurses.h \
3948         curses.h ncurses/curses.h
3949 do
3950 cat >conftest.$ac_ext <<_ACEOF
3951 #line 3951 "configure"
3952 #include "confdefs.h"
3953 #include <${cf_header}>
3954 int
3955 main ()
3956 {
3957 initscr(); tgoto("?", 0,0)
3958   ;
3959   return 0;
3960 }
3961 _ACEOF
3962 rm -f conftest.$ac_objext
3963 if { (eval echo "$as_me:3963: \"$ac_compile\"") >&5
3964   (eval $ac_compile) 2>&5
3965   ac_status=$?
3966   echo "$as_me:3966: \$? = $ac_status" >&5
3967   (exit $ac_status); } &&
3968          { ac_try='test -s conftest.$ac_objext'
3969   { (eval echo "$as_me:3969: \"$ac_try\"") >&5
3970   (eval $ac_try) 2>&5
3971   ac_status=$?
3972   echo "$as_me:3972: \$? = $ac_status" >&5
3973   (exit $ac_status); }; }; then
3974   cf_cv_ncurses_header=$cf_header; break
3975 else
3976   echo "$as_me: failed program was:" >&5
3977 cat conftest.$ac_ext >&5
3978 fi
3979 rm -f conftest.$ac_objext conftest.$ac_ext
3980 done
3981
3982 fi
3983 echo "$as_me:3983: result: $cf_cv_ncurses_header" >&5
3984 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3985
3986 if test "$cf_cv_ncurses_header" = none ; then
3987         { { echo "$as_me:3987: error: No curses header-files found" >&5
3988 echo "$as_me: error: No curses header-files found" >&2;}
3989    { (exit 1); exit 1; }; }
3990 fi
3991
3992 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3993
3994 for ac_header in $cf_cv_ncurses_header
3995 do
3996 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3997 echo "$as_me:3997: checking for $ac_header" >&5
3998 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3999 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4000   echo $ECHO_N "(cached) $ECHO_C" >&6
4001 else
4002   cat >conftest.$ac_ext <<_ACEOF
4003 #line 4003 "configure"
4004 #include "confdefs.h"
4005 #include <$ac_header>
4006 _ACEOF
4007 if { (eval echo "$as_me:4007: \"$ac_cpp conftest.$ac_ext\"") >&5
4008   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4009   ac_status=$?
4010   egrep -v '^ *\+' conftest.er1 >conftest.err
4011   rm -f conftest.er1
4012   cat conftest.err >&5
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit $ac_status); } >/dev/null; then
4015   if test -s conftest.err; then
4016     ac_cpp_err=$ac_c_preproc_warn_flag
4017   else
4018     ac_cpp_err=
4019   fi
4020 else
4021   ac_cpp_err=yes
4022 fi
4023 if test -z "$ac_cpp_err"; then
4024   eval "$as_ac_Header=yes"
4025 else
4026   echo "$as_me: failed program was:" >&5
4027   cat conftest.$ac_ext >&5
4028   eval "$as_ac_Header=no"
4029 fi
4030 rm -f conftest.err conftest.$ac_ext
4031 fi
4032 echo "$as_me:4032: result: `eval echo '${'$as_ac_Header'}'`" >&5
4033 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4034 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4035   cat >>confdefs.h <<EOF
4036 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4037 EOF
4038
4039 fi
4040 done
4041
4042 cat >>confdefs.h <<\EOF
4043 #define NCURSES 1
4044 EOF
4045
4046 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4047
4048                 cat >>confdefs.h <<EOF
4049 #define $cf_nculib_ROOT 1
4050 EOF
4051
4052                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4053
4054         else
4055
4056 cf_ncuhdr_root=ncurses
4057
4058 test -n "$cf_cv_curses_dir" && \
4059 test "$cf_cv_curses_dir" != "no" && { \
4060
4061 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4062   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4063   do
4064         while test $cf_add_incdir != /usr/include
4065         do
4066           if test -d $cf_add_incdir
4067           then
4068                 cf_have_incdir=no
4069                 if test -n "$CFLAGS$CPPFLAGS" ; then
4070                   # a loop is needed to ensure we can add subdirs of existing dirs
4071                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4072                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4073                           cf_have_incdir=yes; break
4074                         fi
4075                   done
4076                 fi
4077
4078                 if test "$cf_have_incdir" = no ; then
4079                   if test "$cf_add_incdir" = /usr/local/include ; then
4080                         if test "$GCC" = yes
4081                         then
4082                           cf_save_CPPFLAGS=$CPPFLAGS
4083                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4084                           cat >conftest.$ac_ext <<_ACEOF
4085 #line 4085 "configure"
4086 #include "confdefs.h"
4087 #include <stdio.h>
4088 int
4089 main ()
4090 {
4091 printf("Hello")
4092   ;
4093   return 0;
4094 }
4095 _ACEOF
4096 rm -f conftest.$ac_objext
4097 if { (eval echo "$as_me:4097: \"$ac_compile\"") >&5
4098   (eval $ac_compile) 2>&5
4099   ac_status=$?
4100   echo "$as_me:4100: \$? = $ac_status" >&5
4101   (exit $ac_status); } &&
4102          { ac_try='test -s conftest.$ac_objext'
4103   { (eval echo "$as_me:4103: \"$ac_try\"") >&5
4104   (eval $ac_try) 2>&5
4105   ac_status=$?
4106   echo "$as_me:4106: \$? = $ac_status" >&5
4107   (exit $ac_status); }; }; then
4108   :
4109 else
4110   echo "$as_me: failed program was:" >&5
4111 cat conftest.$ac_ext >&5
4112 cf_have_incdir=yes
4113 fi
4114 rm -f conftest.$ac_objext conftest.$ac_ext
4115                           CPPFLAGS=$cf_save_CPPFLAGS
4116                         fi
4117                   fi
4118                 fi
4119
4120                 if test "$cf_have_incdir" = no ; then
4121                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4122
4123 echo "${as_me:-configure}:4123: testing adding $cf_add_incdir to include-path ..." 1>&5
4124
4125                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4126
4127                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4128                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4129                   cf_add_incdir="$cf_top_incdir"
4130                 else
4131                   break
4132                 fi
4133           else
4134                 break
4135           fi
4136         done
4137   done
4138 fi
4139
4140 }
4141
4142 echo "$as_me:4142: checking for $cf_ncuhdr_root header in include-path" >&5
4143 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4144 if test "${cf_cv_ncurses_h+set}" = set; then
4145   echo $ECHO_N "(cached) $ECHO_C" >&6
4146 else
4147
4148         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4149         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4150         for cf_header in $cf_header_list
4151         do
4152
4153         cat >conftest.$ac_ext <<_ACEOF
4154 #line 4154 "configure"
4155 #include "confdefs.h"
4156
4157 #include <$cf_header>
4158 int
4159 main ()
4160 {
4161
4162 #ifdef NCURSES_VERSION
4163
4164 printf("%s\n", NCURSES_VERSION);
4165 #else
4166 #ifdef __NCURSES_H
4167 printf("old\n");
4168 #else
4169         make an error
4170 #endif
4171 #endif
4172
4173   ;
4174   return 0;
4175 }
4176 _ACEOF
4177 rm -f conftest.$ac_objext
4178 if { (eval echo "$as_me:4178: \"$ac_compile\"") >&5
4179   (eval $ac_compile) 2>&5
4180   ac_status=$?
4181   echo "$as_me:4181: \$? = $ac_status" >&5
4182   (exit $ac_status); } &&
4183          { ac_try='test -s conftest.$ac_objext'
4184   { (eval echo "$as_me:4184: \"$ac_try\"") >&5
4185   (eval $ac_try) 2>&5
4186   ac_status=$?
4187   echo "$as_me:4187: \$? = $ac_status" >&5
4188   (exit $ac_status); }; }; then
4189   cf_cv_ncurses_h=$cf_header
4190
4191 else
4192   echo "$as_me: failed program was:" >&5
4193 cat conftest.$ac_ext >&5
4194 cf_cv_ncurses_h=no
4195 fi
4196 rm -f conftest.$ac_objext conftest.$ac_ext
4197
4198                 test "$cf_cv_ncurses_h" != no && break
4199         done
4200
4201 fi
4202 echo "$as_me:4202: result: $cf_cv_ncurses_h" >&5
4203 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4204
4205 if test "$cf_cv_ncurses_h" != no ; then
4206         cf_cv_ncurses_header=$cf_cv_ncurses_h
4207 else
4208
4209 echo "$as_me:4209: checking for $cf_ncuhdr_root include-path" >&5
4210 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4211 if test "${cf_cv_ncurses_h2+set}" = set; then
4212   echo $ECHO_N "(cached) $ECHO_C" >&6
4213 else
4214
4215         test -n "$verbose" && echo
4216
4217 cf_search=
4218
4219 # collect the current set of include-directories from compiler flags
4220 cf_header_path_list=""
4221 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4222         for cf_header_path in $CPPFLAGS $CFLAGS
4223         do
4224                 case $cf_header_path in
4225                 (-I*)
4226                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4227
4228 test "x$cf_header_path" != "xNONE" && \
4229 test -d "$cf_header_path" && \
4230  {
4231         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4232         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4233         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4234         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4235         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4236         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"
4237 }
4238
4239                         cf_header_path_list="$cf_header_path_list $cf_search"
4240                         ;;
4241                 esac
4242         done
4243 fi
4244
4245 # add the variations for the package we are looking for
4246
4247 cf_search=
4248
4249 test "x$prefix" != "xNONE" && \
4250 test -d "$prefix" && \
4251  {
4252         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4253         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4254         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4255         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4256         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4257         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4258 }
4259
4260 for cf_subdir_prefix in \
4261         /usr \
4262         /usr/local \
4263         /usr/pkg \
4264         /opt \
4265         /opt/local \
4266         $HOME
4267 do
4268
4269 test "x$cf_subdir_prefix" != "x$prefix" && \
4270 test -d "$cf_subdir_prefix" && \
4271 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4272         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4273         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4274         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4275         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4276         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4277         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"
4278 }
4279
4280 done
4281
4282 test "$includedir" != NONE && \
4283 test "$includedir" != "/usr/include" && \
4284 test -d "$includedir" && {
4285         test -d $includedir &&    cf_search="$cf_search $includedir"
4286         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4287 }
4288
4289 test "$oldincludedir" != NONE && \
4290 test "$oldincludedir" != "/usr/include" && \
4291 test -d "$oldincludedir" && {
4292         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4293         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4294 }
4295
4296 cf_search="$cf_search $cf_header_path_list"
4297
4298         test -n "$verbose" && echo search path $cf_search
4299         cf_save2_CPPFLAGS="$CPPFLAGS"
4300         for cf_incdir in $cf_search
4301         do
4302
4303 if test -n "$cf_incdir" ; then
4304   for cf_add_incdir in $cf_incdir
4305   do
4306         while test $cf_add_incdir != /usr/include
4307         do
4308           if test -d $cf_add_incdir
4309           then
4310                 cf_have_incdir=no
4311                 if test -n "$CFLAGS$CPPFLAGS" ; then
4312                   # a loop is needed to ensure we can add subdirs of existing dirs
4313                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4314                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4315                           cf_have_incdir=yes; break
4316                         fi
4317                   done
4318                 fi
4319
4320                 if test "$cf_have_incdir" = no ; then
4321                   if test "$cf_add_incdir" = /usr/local/include ; then
4322                         if test "$GCC" = yes
4323                         then
4324                           cf_save_CPPFLAGS=$CPPFLAGS
4325                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4326                           cat >conftest.$ac_ext <<_ACEOF
4327 #line 4327 "configure"
4328 #include "confdefs.h"
4329 #include <stdio.h>
4330 int
4331 main ()
4332 {
4333 printf("Hello")
4334   ;
4335   return 0;
4336 }
4337 _ACEOF
4338 rm -f conftest.$ac_objext
4339 if { (eval echo "$as_me:4339: \"$ac_compile\"") >&5
4340   (eval $ac_compile) 2>&5
4341   ac_status=$?
4342   echo "$as_me:4342: \$? = $ac_status" >&5
4343   (exit $ac_status); } &&
4344          { ac_try='test -s conftest.$ac_objext'
4345   { (eval echo "$as_me:4345: \"$ac_try\"") >&5
4346   (eval $ac_try) 2>&5
4347   ac_status=$?
4348   echo "$as_me:4348: \$? = $ac_status" >&5
4349   (exit $ac_status); }; }; then
4350   :
4351 else
4352   echo "$as_me: failed program was:" >&5
4353 cat conftest.$ac_ext >&5
4354 cf_have_incdir=yes
4355 fi
4356 rm -f conftest.$ac_objext conftest.$ac_ext
4357                           CPPFLAGS=$cf_save_CPPFLAGS
4358                         fi
4359                   fi
4360                 fi
4361
4362                 if test "$cf_have_incdir" = no ; then
4363                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4364
4365 echo "${as_me:-configure}:4365: testing adding $cf_add_incdir to include-path ..." 1>&5
4366
4367                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4368
4369                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4370                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4371                   cf_add_incdir="$cf_top_incdir"
4372                 else
4373                   break
4374                 fi
4375           else
4376                 break
4377           fi
4378         done
4379   done
4380 fi
4381
4382                 for cf_header in \
4383                         ncurses.h \
4384                         curses.h
4385                 do
4386
4387         cat >conftest.$ac_ext <<_ACEOF
4388 #line 4388 "configure"
4389 #include "confdefs.h"
4390
4391 #include <$cf_header>
4392 int
4393 main ()
4394 {
4395
4396 #ifdef NCURSES_VERSION
4397
4398 printf("%s\n", NCURSES_VERSION);
4399 #else
4400 #ifdef __NCURSES_H
4401 printf("old\n");
4402 #else
4403         make an error
4404 #endif
4405 #endif
4406
4407   ;
4408   return 0;
4409 }
4410 _ACEOF
4411 rm -f conftest.$ac_objext
4412 if { (eval echo "$as_me:4412: \"$ac_compile\"") >&5
4413   (eval $ac_compile) 2>&5
4414   ac_status=$?
4415   echo "$as_me:4415: \$? = $ac_status" >&5
4416   (exit $ac_status); } &&
4417          { ac_try='test -s conftest.$ac_objext'
4418   { (eval echo "$as_me:4418: \"$ac_try\"") >&5
4419   (eval $ac_try) 2>&5
4420   ac_status=$?
4421   echo "$as_me:4421: \$? = $ac_status" >&5
4422   (exit $ac_status); }; }; then
4423   cf_cv_ncurses_h2=$cf_header
4424
4425 else
4426   echo "$as_me: failed program was:" >&5
4427 cat conftest.$ac_ext >&5
4428 cf_cv_ncurses_h2=no
4429 fi
4430 rm -f conftest.$ac_objext conftest.$ac_ext
4431
4432                         if test "$cf_cv_ncurses_h2" != no ; then
4433                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4434                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4435                                 break
4436                         fi
4437                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4438                 done
4439                 CPPFLAGS="$cf_save2_CPPFLAGS"
4440                 test "$cf_cv_ncurses_h2" != no && break
4441         done
4442         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4442: error: not found" >&5
4443 echo "$as_me: error: not found" >&2;}
4444    { (exit 1); exit 1; }; }
4445
4446 fi
4447 echo "$as_me:4447: result: $cf_cv_ncurses_h2" >&5
4448 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4449
4450         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4451         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4452         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4453                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4454         fi
4455
4456 if test -n "$cf_1st_incdir" ; then
4457   for cf_add_incdir in $cf_1st_incdir
4458   do
4459         while test $cf_add_incdir != /usr/include
4460         do
4461           if test -d $cf_add_incdir
4462           then
4463                 cf_have_incdir=no
4464                 if test -n "$CFLAGS$CPPFLAGS" ; then
4465                   # a loop is needed to ensure we can add subdirs of existing dirs
4466                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4467                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4468                           cf_have_incdir=yes; break
4469                         fi
4470                   done
4471                 fi
4472
4473                 if test "$cf_have_incdir" = no ; then
4474                   if test "$cf_add_incdir" = /usr/local/include ; then
4475                         if test "$GCC" = yes
4476                         then
4477                           cf_save_CPPFLAGS=$CPPFLAGS
4478                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4479                           cat >conftest.$ac_ext <<_ACEOF
4480 #line 4480 "configure"
4481 #include "confdefs.h"
4482 #include <stdio.h>
4483 int
4484 main ()
4485 {
4486 printf("Hello")
4487   ;
4488   return 0;
4489 }
4490 _ACEOF
4491 rm -f conftest.$ac_objext
4492 if { (eval echo "$as_me:4492: \"$ac_compile\"") >&5
4493   (eval $ac_compile) 2>&5
4494   ac_status=$?
4495   echo "$as_me:4495: \$? = $ac_status" >&5
4496   (exit $ac_status); } &&
4497          { ac_try='test -s conftest.$ac_objext'
4498   { (eval echo "$as_me:4498: \"$ac_try\"") >&5
4499   (eval $ac_try) 2>&5
4500   ac_status=$?
4501   echo "$as_me:4501: \$? = $ac_status" >&5
4502   (exit $ac_status); }; }; then
4503   :
4504 else
4505   echo "$as_me: failed program was:" >&5
4506 cat conftest.$ac_ext >&5
4507 cf_have_incdir=yes
4508 fi
4509 rm -f conftest.$ac_objext conftest.$ac_ext
4510                           CPPFLAGS=$cf_save_CPPFLAGS
4511                         fi
4512                   fi
4513                 fi
4514
4515                 if test "$cf_have_incdir" = no ; then
4516                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4517
4518 echo "${as_me:-configure}:4518: testing adding $cf_add_incdir to include-path ..." 1>&5
4519
4520                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4521
4522                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4523                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4524                   cf_add_incdir="$cf_top_incdir"
4525                 else
4526                   break
4527                 fi
4528           else
4529                 break
4530           fi
4531         done
4532   done
4533 fi
4534
4535 fi
4536
4537 # Set definitions to allow ifdef'ing for ncurses.h
4538
4539 case $cf_cv_ncurses_header in
4540 (*ncurses.h)
4541
4542 cat >>confdefs.h <<\EOF
4543 #define HAVE_NCURSES_H 1
4544 EOF
4545
4546         ;;
4547 esac
4548
4549 case $cf_cv_ncurses_header in
4550 (ncurses/curses.h|ncurses/ncurses.h)
4551
4552 cat >>confdefs.h <<\EOF
4553 #define HAVE_NCURSES_NCURSES_H 1
4554 EOF
4555
4556         ;;
4557 (ncursesw/curses.h|ncursesw/ncurses.h)
4558
4559 cat >>confdefs.h <<\EOF
4560 #define HAVE_NCURSESW_NCURSES_H 1
4561 EOF
4562
4563         ;;
4564 esac
4565
4566 echo "$as_me:4566: checking for terminfo header" >&5
4567 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4568 if test "${cf_cv_term_header+set}" = set; then
4569   echo $ECHO_N "(cached) $ECHO_C" >&6
4570 else
4571
4572 case ${cf_cv_ncurses_header} in
4573 (*/ncurses.h|*/ncursesw.h)
4574         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4575         ;;
4576 (*)
4577         cf_term_header=term.h
4578         ;;
4579 esac
4580
4581 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4582 do
4583 cat >conftest.$ac_ext <<_ACEOF
4584 #line 4584 "configure"
4585 #include "confdefs.h"
4586 #include <stdio.h>
4587 #include <${cf_cv_ncurses_header:-curses.h}>
4588 #include <$cf_test>
4589
4590 int
4591 main ()
4592 {
4593 int x = auto_left_margin
4594   ;
4595   return 0;
4596 }
4597 _ACEOF
4598 rm -f conftest.$ac_objext
4599 if { (eval echo "$as_me:4599: \"$ac_compile\"") >&5
4600   (eval $ac_compile) 2>&5
4601   ac_status=$?
4602   echo "$as_me:4602: \$? = $ac_status" >&5
4603   (exit $ac_status); } &&
4604          { ac_try='test -s conftest.$ac_objext'
4605   { (eval echo "$as_me:4605: \"$ac_try\"") >&5
4606   (eval $ac_try) 2>&5
4607   ac_status=$?
4608   echo "$as_me:4608: \$? = $ac_status" >&5
4609   (exit $ac_status); }; }; then
4610
4611         cf_cv_term_header="$cf_test"
4612 else
4613   echo "$as_me: failed program was:" >&5
4614 cat conftest.$ac_ext >&5
4615
4616         cf_cv_term_header=unknown
4617
4618 fi
4619 rm -f conftest.$ac_objext conftest.$ac_ext
4620         test "$cf_cv_term_header" != unknown && break
4621 done
4622
4623 fi
4624 echo "$as_me:4624: result: $cf_cv_term_header" >&5
4625 echo "${ECHO_T}$cf_cv_term_header" >&6
4626
4627 # Set definitions to allow ifdef'ing to accommodate subdirectories
4628
4629 case $cf_cv_term_header in
4630 (*term.h)
4631
4632 cat >>confdefs.h <<\EOF
4633 #define HAVE_TERM_H 1
4634 EOF
4635
4636         ;;
4637 esac
4638
4639 case $cf_cv_term_header in
4640 (ncurses/term.h)
4641
4642 cat >>confdefs.h <<\EOF
4643 #define HAVE_NCURSES_TERM_H 1
4644 EOF
4645
4646         ;;
4647 (ncursesw/term.h)
4648
4649 cat >>confdefs.h <<\EOF
4650 #define HAVE_NCURSESW_TERM_H 1
4651 EOF
4652
4653         ;;
4654 esac
4655
4656 # some applications need this, but should check for NCURSES_VERSION
4657
4658 cat >>confdefs.h <<\EOF
4659 #define NCURSES 1
4660 EOF
4661
4662 echo "$as_me:4662: checking for ncurses version" >&5
4663 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4664 if test "${cf_cv_ncurses_version+set}" = set; then
4665   echo $ECHO_N "(cached) $ECHO_C" >&6
4666 else
4667
4668         cf_cv_ncurses_version=no
4669         cf_tempfile=out$$
4670         rm -f $cf_tempfile
4671         if test "$cross_compiling" = yes; then
4672
4673         # This will not work if the preprocessor splits the line after the
4674         # Autoconf token.  The 'unproto' program does that.
4675         cat > conftest.$ac_ext <<EOF
4676 #include <${cf_cv_ncurses_header:-curses.h}>
4677 #undef Autoconf
4678 #ifdef NCURSES_VERSION
4679 Autoconf NCURSES_VERSION
4680 #else
4681 #ifdef __NCURSES_H
4682 Autoconf "old"
4683 #endif
4684 ;
4685 #endif
4686 EOF
4687         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4688         { (eval echo "$as_me:4688: \"$cf_try\"") >&5
4689   (eval $cf_try) 2>&5
4690   ac_status=$?
4691   echo "$as_me:4691: \$? = $ac_status" >&5
4692   (exit $ac_status); }
4693         if test -f conftest.out ; then
4694                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4695                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4696                 rm -f conftest.out
4697         fi
4698
4699 else
4700   cat >conftest.$ac_ext <<_ACEOF
4701 #line 4701 "configure"
4702 #include "confdefs.h"
4703
4704 #include <${cf_cv_ncurses_header:-curses.h}>
4705 #include <stdio.h>
4706 int main()
4707 {
4708         FILE *fp = fopen("$cf_tempfile", "w");
4709 #ifdef NCURSES_VERSION
4710 # ifdef NCURSES_VERSION_PATCH
4711         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4712 # else
4713         fprintf(fp, "%s\n", NCURSES_VERSION);
4714 # endif
4715 #else
4716 # ifdef __NCURSES_H
4717         fprintf(fp, "old\n");
4718 # else
4719         make an error
4720 # endif
4721 #endif
4722         ${cf_cv_main_return:-return}(0);
4723 }
4724 _ACEOF
4725 rm -f conftest$ac_exeext
4726 if { (eval echo "$as_me:4726: \"$ac_link\"") >&5
4727   (eval $ac_link) 2>&5
4728   ac_status=$?
4729   echo "$as_me:4729: \$? = $ac_status" >&5
4730   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4731   { (eval echo "$as_me:4731: \"$ac_try\"") >&5
4732   (eval $ac_try) 2>&5
4733   ac_status=$?
4734   echo "$as_me:4734: \$? = $ac_status" >&5
4735   (exit $ac_status); }; }; then
4736
4737         cf_cv_ncurses_version=`cat $cf_tempfile`
4738 else
4739   echo "$as_me: program exited with status $ac_status" >&5
4740 echo "$as_me: failed program was:" >&5
4741 cat conftest.$ac_ext >&5
4742 fi
4743 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4744 fi
4745         rm -f $cf_tempfile
4746
4747 fi
4748 echo "$as_me:4748: result: $cf_cv_ncurses_version" >&5
4749 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4750 test "$cf_cv_ncurses_version" = no ||
4751 cat >>confdefs.h <<\EOF
4752 #define NCURSES 1
4753 EOF
4754
4755 cf_nculib_root=ncurses
4756         # This works, except for the special case where we find gpm, but
4757         # ncurses is in a nonstandard location via $LIBS, and we really want
4758         # to link gpm.
4759 cf_ncurses_LIBS=""
4760 cf_ncurses_SAVE="$LIBS"
4761 echo "$as_me:4761: checking for Gpm_Open in -lgpm" >&5
4762 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4763 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4764   echo $ECHO_N "(cached) $ECHO_C" >&6
4765 else
4766   ac_check_lib_save_LIBS=$LIBS
4767 LIBS="-lgpm  $LIBS"
4768 cat >conftest.$ac_ext <<_ACEOF
4769 #line 4769 "configure"
4770 #include "confdefs.h"
4771
4772 /* Override any gcc2 internal prototype to avoid an error.  */
4773 #ifdef __cplusplus
4774 extern "C"
4775 #endif
4776 /* We use char because int might match the return type of a gcc2
4777    builtin and then its argument prototype would still apply.  */
4778 char Gpm_Open ();
4779 int
4780 main ()
4781 {
4782 Gpm_Open ();
4783   ;
4784   return 0;
4785 }
4786 _ACEOF
4787 rm -f conftest.$ac_objext conftest$ac_exeext
4788 if { (eval echo "$as_me:4788: \"$ac_link\"") >&5
4789   (eval $ac_link) 2>&5
4790   ac_status=$?
4791   echo "$as_me:4791: \$? = $ac_status" >&5
4792   (exit $ac_status); } &&
4793          { ac_try='test -s conftest$ac_exeext'
4794   { (eval echo "$as_me:4794: \"$ac_try\"") >&5
4795   (eval $ac_try) 2>&5
4796   ac_status=$?
4797   echo "$as_me:4797: \$? = $ac_status" >&5
4798   (exit $ac_status); }; }; then
4799   ac_cv_lib_gpm_Gpm_Open=yes
4800 else
4801   echo "$as_me: failed program was:" >&5
4802 cat conftest.$ac_ext >&5
4803 ac_cv_lib_gpm_Gpm_Open=no
4804 fi
4805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4806 LIBS=$ac_check_lib_save_LIBS
4807 fi
4808 echo "$as_me:4808: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4809 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4810 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4811   echo "$as_me:4811: checking for initscr in -lgpm" >&5
4812 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4813 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4814   echo $ECHO_N "(cached) $ECHO_C" >&6
4815 else
4816   ac_check_lib_save_LIBS=$LIBS
4817 LIBS="-lgpm  $LIBS"
4818 cat >conftest.$ac_ext <<_ACEOF
4819 #line 4819 "configure"
4820 #include "confdefs.h"
4821
4822 /* Override any gcc2 internal prototype to avoid an error.  */
4823 #ifdef __cplusplus
4824 extern "C"
4825 #endif
4826 /* We use char because int might match the return type of a gcc2
4827    builtin and then its argument prototype would still apply.  */
4828 char initscr ();
4829 int
4830 main ()
4831 {
4832 initscr ();
4833   ;
4834   return 0;
4835 }
4836 _ACEOF
4837 rm -f conftest.$ac_objext conftest$ac_exeext
4838 if { (eval echo "$as_me:4838: \"$ac_link\"") >&5
4839   (eval $ac_link) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); } &&
4843          { ac_try='test -s conftest$ac_exeext'
4844   { (eval echo "$as_me:4844: \"$ac_try\"") >&5
4845   (eval $ac_try) 2>&5
4846   ac_status=$?
4847   echo "$as_me:4847: \$? = $ac_status" >&5
4848   (exit $ac_status); }; }; then
4849   ac_cv_lib_gpm_initscr=yes
4850 else
4851   echo "$as_me: failed program was:" >&5
4852 cat conftest.$ac_ext >&5
4853 ac_cv_lib_gpm_initscr=no
4854 fi
4855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4856 LIBS=$ac_check_lib_save_LIBS
4857 fi
4858 echo "$as_me:4858: result: $ac_cv_lib_gpm_initscr" >&5
4859 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4860 if test $ac_cv_lib_gpm_initscr = yes; then
4861   LIBS="$cf_ncurses_SAVE"
4862 else
4863   cf_ncurses_LIBS="-lgpm"
4864 fi
4865
4866 fi
4867
4868 case $host_os in
4869 (freebsd*)
4870         # This is only necessary if you are linking against an obsolete
4871         # version of ncurses (but it should do no harm, since it's static).
4872         if test "$cf_nculib_root" = ncurses ; then
4873                 echo "$as_me:4873: checking for tgoto in -lmytinfo" >&5
4874 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4875 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4876   echo $ECHO_N "(cached) $ECHO_C" >&6
4877 else
4878   ac_check_lib_save_LIBS=$LIBS
4879 LIBS="-lmytinfo  $LIBS"
4880 cat >conftest.$ac_ext <<_ACEOF
4881 #line 4881 "configure"
4882 #include "confdefs.h"
4883
4884 /* Override any gcc2 internal prototype to avoid an error.  */
4885 #ifdef __cplusplus
4886 extern "C"
4887 #endif
4888 /* We use char because int might match the return type of a gcc2
4889    builtin and then its argument prototype would still apply.  */
4890 char tgoto ();
4891 int
4892 main ()
4893 {
4894 tgoto ();
4895   ;
4896   return 0;
4897 }
4898 _ACEOF
4899 rm -f conftest.$ac_objext conftest$ac_exeext
4900 if { (eval echo "$as_me:4900: \"$ac_link\"") >&5
4901   (eval $ac_link) 2>&5
4902   ac_status=$?
4903   echo "$as_me:4903: \$? = $ac_status" >&5
4904   (exit $ac_status); } &&
4905          { ac_try='test -s conftest$ac_exeext'
4906   { (eval echo "$as_me:4906: \"$ac_try\"") >&5
4907   (eval $ac_try) 2>&5
4908   ac_status=$?
4909   echo "$as_me:4909: \$? = $ac_status" >&5
4910   (exit $ac_status); }; }; then
4911   ac_cv_lib_mytinfo_tgoto=yes
4912 else
4913   echo "$as_me: failed program was:" >&5
4914 cat conftest.$ac_ext >&5
4915 ac_cv_lib_mytinfo_tgoto=no
4916 fi
4917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4918 LIBS=$ac_check_lib_save_LIBS
4919 fi
4920 echo "$as_me:4920: result: $ac_cv_lib_mytinfo_tgoto" >&5
4921 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4922 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4923   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4924 fi
4925
4926         fi
4927         ;;
4928 esac
4929
4930 cf_add_libs="$cf_ncurses_LIBS"
4931 # Filter out duplicates - this happens with badly-designed ".pc" files...
4932 for cf_add_1lib in $LIBS
4933 do
4934         for cf_add_2lib in $cf_add_libs
4935         do
4936                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4937                 then
4938                         cf_add_1lib=
4939                         break
4940                 fi
4941         done
4942         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4943 done
4944 LIBS="$cf_add_libs"
4945
4946 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4947 then
4948
4949 cf_add_libs="-l$cf_nculib_root"
4950 # Filter out duplicates - this happens with badly-designed ".pc" files...
4951 for cf_add_1lib in $LIBS
4952 do
4953         for cf_add_2lib in $cf_add_libs
4954         do
4955                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4956                 then
4957                         cf_add_1lib=
4958                         break
4959                 fi
4960         done
4961         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4962 done
4963 LIBS="$cf_add_libs"
4964
4965 else
4966
4967         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4968         cf_libdir=""
4969         echo "$as_me:4969: checking for initscr" >&5
4970 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4971 if test "${ac_cv_func_initscr+set}" = set; then
4972   echo $ECHO_N "(cached) $ECHO_C" >&6
4973 else
4974   cat >conftest.$ac_ext <<_ACEOF
4975 #line 4975 "configure"
4976 #include "confdefs.h"
4977 /* System header to define __stub macros and hopefully few prototypes,
4978     which can conflict with char initscr (); below.  */
4979 #include <assert.h>
4980 /* Override any gcc2 internal prototype to avoid an error.  */
4981 #ifdef __cplusplus
4982 extern "C"
4983 #endif
4984 /* We use char because int might match the return type of a gcc2
4985    builtin and then its argument prototype would still apply.  */
4986 char initscr ();
4987 char (*f) ();
4988
4989 int
4990 main ()
4991 {
4992 /* The GNU C library defines this for functions which it implements
4993     to always fail with ENOSYS.  Some functions are actually named
4994     something starting with __ and the normal name is an alias.  */
4995 #if defined (__stub_initscr) || defined (__stub___initscr)
4996 choke me
4997 #else
4998 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4999 #endif
5000
5001   ;
5002   return 0;
5003 }
5004 _ACEOF
5005 rm -f conftest.$ac_objext conftest$ac_exeext
5006 if { (eval echo "$as_me:5006: \"$ac_link\"") >&5
5007   (eval $ac_link) 2>&5
5008   ac_status=$?
5009   echo "$as_me:5009: \$? = $ac_status" >&5
5010   (exit $ac_status); } &&
5011          { ac_try='test -s conftest$ac_exeext'
5012   { (eval echo "$as_me:5012: \"$ac_try\"") >&5
5013   (eval $ac_try) 2>&5
5014   ac_status=$?
5015   echo "$as_me:5015: \$? = $ac_status" >&5
5016   (exit $ac_status); }; }; then
5017   ac_cv_func_initscr=yes
5018 else
5019   echo "$as_me: failed program was:" >&5
5020 cat conftest.$ac_ext >&5
5021 ac_cv_func_initscr=no
5022 fi
5023 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5024 fi
5025 echo "$as_me:5025: result: $ac_cv_func_initscr" >&5
5026 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5027 if test $ac_cv_func_initscr = yes; then
5028   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5029 else
5030
5031                 cf_save_LIBS="$LIBS"
5032                 echo "$as_me:5032: checking for initscr in -l$cf_nculib_root" >&5
5033 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5034                 LIBS="-l$cf_nculib_root $LIBS"
5035                 cat >conftest.$ac_ext <<_ACEOF
5036 #line 5036 "configure"
5037 #include "confdefs.h"
5038 #include <${cf_cv_ncurses_header:-curses.h}>
5039 int
5040 main ()
5041 {
5042 initscr()
5043   ;
5044   return 0;
5045 }
5046 _ACEOF
5047 rm -f conftest.$ac_objext conftest$ac_exeext
5048 if { (eval echo "$as_me:5048: \"$ac_link\"") >&5
5049   (eval $ac_link) 2>&5
5050   ac_status=$?
5051   echo "$as_me:5051: \$? = $ac_status" >&5
5052   (exit $ac_status); } &&
5053          { ac_try='test -s conftest$ac_exeext'
5054   { (eval echo "$as_me:5054: \"$ac_try\"") >&5
5055   (eval $ac_try) 2>&5
5056   ac_status=$?
5057   echo "$as_me:5057: \$? = $ac_status" >&5
5058   (exit $ac_status); }; }; then
5059   echo "$as_me:5059: result: yes" >&5
5060 echo "${ECHO_T}yes" >&6
5061                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5062
5063 else
5064   echo "$as_me: failed program was:" >&5
5065 cat conftest.$ac_ext >&5
5066 echo "$as_me:5066: result: no" >&5
5067 echo "${ECHO_T}no" >&6
5068
5069 cf_search=
5070 cf_library_path_list=""
5071 if test -n "${LDFLAGS}${LIBS}" ; then
5072         for cf_library_path in $LDFLAGS $LIBS
5073         do
5074                 case $cf_library_path in
5075                 (-L*)
5076                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5077
5078 test "x$cf_library_path" != "xNONE" && \
5079 test -d "$cf_library_path" && \
5080  {
5081         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5082         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5083         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5084         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5085         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5086         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"
5087 }
5088
5089                         cf_library_path_list="$cf_library_path_list $cf_search"
5090                         ;;
5091                 esac
5092         done
5093 fi
5094
5095 cf_search=
5096
5097 test "x$prefix" != "xNONE" && \
5098 test -d "$prefix" && \
5099  {
5100         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5101         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5102         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5103         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5104         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5105         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5106 }
5107
5108 for cf_subdir_prefix in \
5109         /usr \
5110         /usr/local \
5111         /usr/pkg \
5112         /opt \
5113         /opt/local \
5114         $HOME
5115 do
5116
5117 test "x$cf_subdir_prefix" != "x$prefix" && \
5118 test -d "$cf_subdir_prefix" && \
5119 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5120         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5121         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5122         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5123         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5124         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5125         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"
5126 }
5127
5128 done
5129
5130 cf_search="$cf_library_path_list $cf_search"
5131
5132                         for cf_libdir in $cf_search
5133                         do
5134                                 echo "$as_me:5134: checking for -l$cf_nculib_root in $cf_libdir" >&5
5135 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5136                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5137                                 cat >conftest.$ac_ext <<_ACEOF
5138 #line 5138 "configure"
5139 #include "confdefs.h"
5140 #include <${cf_cv_ncurses_header:-curses.h}>
5141 int
5142 main ()
5143 {
5144 initscr()
5145   ;
5146   return 0;
5147 }
5148 _ACEOF
5149 rm -f conftest.$ac_objext conftest$ac_exeext
5150 if { (eval echo "$as_me:5150: \"$ac_link\"") >&5
5151   (eval $ac_link) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit $ac_status); } &&
5155          { ac_try='test -s conftest$ac_exeext'
5156   { (eval echo "$as_me:5156: \"$ac_try\"") >&5
5157   (eval $ac_try) 2>&5
5158   ac_status=$?
5159   echo "$as_me:5159: \$? = $ac_status" >&5
5160   (exit $ac_status); }; }; then
5161   echo "$as_me:5161: result: yes" >&5
5162 echo "${ECHO_T}yes" >&6
5163                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5164                                          break
5165 else
5166   echo "$as_me: failed program was:" >&5
5167 cat conftest.$ac_ext >&5
5168 echo "$as_me:5168: result: no" >&5
5169 echo "${ECHO_T}no" >&6
5170                                          LIBS="$cf_save_LIBS"
5171 fi
5172 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5173                         done
5174
5175 fi
5176 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5177
5178 fi
5179
5180 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5181
5182 if test $cf_found_library = no ; then
5183         { { echo "$as_me:5183: error: Cannot link $cf_nculib_root library" >&5
5184 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5185    { (exit 1); exit 1; }; }
5186 fi
5187
5188 fi
5189
5190 if test -n "$cf_ncurses_LIBS" ; then
5191         echo "$as_me:5191: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5192 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5193         cf_ncurses_SAVE="$LIBS"
5194         for p in $cf_ncurses_LIBS ; do
5195                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5196                 if test "$q" != "$LIBS" ; then
5197                         LIBS="$q"
5198                 fi
5199         done
5200         cat >conftest.$ac_ext <<_ACEOF
5201 #line 5201 "configure"
5202 #include "confdefs.h"
5203 #include <${cf_cv_ncurses_header:-curses.h}>
5204 int
5205 main ()
5206 {
5207 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5208   ;
5209   return 0;
5210 }
5211 _ACEOF
5212 rm -f conftest.$ac_objext conftest$ac_exeext
5213 if { (eval echo "$as_me:5213: \"$ac_link\"") >&5
5214   (eval $ac_link) 2>&5
5215   ac_status=$?
5216   echo "$as_me:5216: \$? = $ac_status" >&5
5217   (exit $ac_status); } &&
5218          { ac_try='test -s conftest$ac_exeext'
5219   { (eval echo "$as_me:5219: \"$ac_try\"") >&5
5220   (eval $ac_try) 2>&5
5221   ac_status=$?
5222   echo "$as_me:5222: \$? = $ac_status" >&5
5223   (exit $ac_status); }; }; then
5224   echo "$as_me:5224: result: yes" >&5
5225 echo "${ECHO_T}yes" >&6
5226 else
5227   echo "$as_me: failed program was:" >&5
5228 cat conftest.$ac_ext >&5
5229 echo "$as_me:5229: result: no" >&5
5230 echo "${ECHO_T}no" >&6
5231                  LIBS="$cf_ncurses_SAVE"
5232 fi
5233 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5234 fi
5235
5236 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5237
5238 cat >>confdefs.h <<EOF
5239 #define $cf_nculib_ROOT 1
5240 EOF
5241
5242         fi
5243 else
5244         NCURSES_CONFIG=none
5245 fi
5246
5247 echo "$as_me:5247: checking if you want wide-character code" >&5
5248 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5249
5250 # Check whether --enable-widec or --disable-widec was given.
5251 if test "${enable_widec+set}" = set; then
5252   enableval="$enable_widec"
5253   with_widec=$enableval
5254 else
5255   with_widec=no
5256 fi;
5257 echo "$as_me:5257: result: $with_widec" >&5
5258 echo "${ECHO_T}$with_widec" >&6
5259 if test "$with_widec" = yes ; then
5260
5261 echo "$as_me:5261: checking for multibyte character support" >&5
5262 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5263 if test "${cf_cv_utf8_lib+set}" = set; then
5264   echo $ECHO_N "(cached) $ECHO_C" >&6
5265 else
5266
5267         cf_save_LIBS="$LIBS"
5268         cat >conftest.$ac_ext <<_ACEOF
5269 #line 5269 "configure"
5270 #include "confdefs.h"
5271
5272 #include <stdlib.h>
5273 int
5274 main ()
5275 {
5276 putwc(0,0);
5277   ;
5278   return 0;
5279 }
5280 _ACEOF
5281 rm -f conftest.$ac_objext conftest$ac_exeext
5282 if { (eval echo "$as_me:5282: \"$ac_link\"") >&5
5283   (eval $ac_link) 2>&5
5284   ac_status=$?
5285   echo "$as_me:5285: \$? = $ac_status" >&5
5286   (exit $ac_status); } &&
5287          { ac_try='test -s conftest$ac_exeext'
5288   { (eval echo "$as_me:5288: \"$ac_try\"") >&5
5289   (eval $ac_try) 2>&5
5290   ac_status=$?
5291   echo "$as_me:5291: \$? = $ac_status" >&5
5292   (exit $ac_status); }; }; then
5293   cf_cv_utf8_lib=yes
5294 else
5295   echo "$as_me: failed program was:" >&5
5296 cat conftest.$ac_ext >&5
5297
5298 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5299 # will be set on completion of the AC_TRY_LINK below.
5300 cf_cv_header_path_utf8=
5301 cf_cv_library_path_utf8=
5302
5303 echo "${as_me:-configure}:5303: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5304
5305 cf_save_LIBS="$LIBS"
5306
5307 cat >conftest.$ac_ext <<_ACEOF
5308 #line 5308 "configure"
5309 #include "confdefs.h"
5310
5311 #include <libutf8.h>
5312 int
5313 main ()
5314 {
5315 putwc(0,0);
5316   ;
5317   return 0;
5318 }
5319 _ACEOF
5320 rm -f conftest.$ac_objext conftest$ac_exeext
5321 if { (eval echo "$as_me:5321: \"$ac_link\"") >&5
5322   (eval $ac_link) 2>&5
5323   ac_status=$?
5324   echo "$as_me:5324: \$? = $ac_status" >&5
5325   (exit $ac_status); } &&
5326          { ac_try='test -s conftest$ac_exeext'
5327   { (eval echo "$as_me:5327: \"$ac_try\"") >&5
5328   (eval $ac_try) 2>&5
5329   ac_status=$?
5330   echo "$as_me:5330: \$? = $ac_status" >&5
5331   (exit $ac_status); }; }; then
5332
5333         cf_cv_find_linkage_utf8=yes
5334         cf_cv_header_path_utf8=/usr/include
5335         cf_cv_library_path_utf8=/usr/lib
5336
5337 else
5338   echo "$as_me: failed program was:" >&5
5339 cat conftest.$ac_ext >&5
5340
5341 LIBS="-lutf8  $cf_save_LIBS"
5342
5343 cat >conftest.$ac_ext <<_ACEOF
5344 #line 5344 "configure"
5345 #include "confdefs.h"
5346
5347 #include <libutf8.h>
5348 int
5349 main ()
5350 {
5351 putwc(0,0);
5352   ;
5353   return 0;
5354 }
5355 _ACEOF
5356 rm -f conftest.$ac_objext conftest$ac_exeext
5357 if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
5358   (eval $ac_link) 2>&5
5359   ac_status=$?
5360   echo "$as_me:5360: \$? = $ac_status" >&5
5361   (exit $ac_status); } &&
5362          { ac_try='test -s conftest$ac_exeext'
5363   { (eval echo "$as_me:5363: \"$ac_try\"") >&5
5364   (eval $ac_try) 2>&5
5365   ac_status=$?
5366   echo "$as_me:5366: \$? = $ac_status" >&5
5367   (exit $ac_status); }; }; then
5368
5369         cf_cv_find_linkage_utf8=yes
5370         cf_cv_header_path_utf8=/usr/include
5371         cf_cv_library_path_utf8=/usr/lib
5372         cf_cv_library_file_utf8="-lutf8"
5373
5374 else
5375   echo "$as_me: failed program was:" >&5
5376 cat conftest.$ac_ext >&5
5377
5378         cf_cv_find_linkage_utf8=no
5379         LIBS="$cf_save_LIBS"
5380
5381         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5382
5383 echo "${as_me:-configure}:5383: testing find linkage for utf8 library ..." 1>&5
5384
5385 echo "${as_me:-configure}:5385: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5386
5387         cf_save_CPPFLAGS="$CPPFLAGS"
5388         cf_test_CPPFLAGS="$CPPFLAGS"
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/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5407         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5408         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5409         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
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/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5428         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5429         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5430         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
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/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5448         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5449         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5450         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
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/utf8 && cf_search="$cf_search $includedir/utf8"
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/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5467 }
5468
5469 cf_search="$cf_search $cf_header_path_list"
5470
5471         for cf_cv_header_path_utf8 in $cf_search
5472         do
5473                 if test -d $cf_cv_header_path_utf8 ; then
5474                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5475
5476 echo "${as_me:-configure}:5476: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5477
5478                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5479                         cat >conftest.$ac_ext <<_ACEOF
5480 #line 5480 "configure"
5481 #include "confdefs.h"
5482
5483 #include <libutf8.h>
5484 int
5485 main ()
5486 {
5487 putwc(0,0);
5488   ;
5489   return 0;
5490 }
5491 _ACEOF
5492 rm -f conftest.$ac_objext
5493 if { (eval echo "$as_me:5493: \"$ac_compile\"") >&5
5494   (eval $ac_compile) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit $ac_status); } &&
5498          { ac_try='test -s conftest.$ac_objext'
5499   { (eval echo "$as_me:5499: \"$ac_try\"") >&5
5500   (eval $ac_try) 2>&5
5501   ac_status=$?
5502   echo "$as_me:5502: \$? = $ac_status" >&5
5503   (exit $ac_status); }; }; then
5504
5505                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5506
5507 echo "${as_me:-configure}:5507: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5508
5509                                 cf_cv_find_linkage_utf8=maybe
5510                                 cf_test_CPPFLAGS="$CPPFLAGS"
5511                                 break
5512 else
5513   echo "$as_me: failed program was:" >&5
5514 cat conftest.$ac_ext >&5
5515
5516                                 CPPFLAGS="$cf_save_CPPFLAGS"
5517
5518 fi
5519 rm -f conftest.$ac_objext conftest.$ac_ext
5520                 fi
5521         done
5522
5523         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5524
5525 echo "${as_me:-configure}:5525: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5526
5527                 cf_save_LIBS="$LIBS"
5528                 cf_save_LDFLAGS="$LDFLAGS"
5529
5530                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5531
5532 cf_search=
5533 cf_library_path_list=""
5534 if test -n "${LDFLAGS}${LIBS}" ; then
5535         for cf_library_path in $LDFLAGS $LIBS
5536         do
5537                 case $cf_library_path in
5538                 (-L*)
5539                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5540
5541 test "x$cf_library_path" != "xNONE" && \
5542 test -d "$cf_library_path" && \
5543  {
5544         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5545         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5546         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5547         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5548         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5549         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5550 }
5551
5552                         cf_library_path_list="$cf_library_path_list $cf_search"
5553                         ;;
5554                 esac
5555         done
5556 fi
5557
5558 cf_search=
5559
5560 test "x$prefix" != "xNONE" && \
5561 test -d "$prefix" && \
5562  {
5563         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5564         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5565         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5566         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5567         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5568         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5569 }
5570
5571 for cf_subdir_prefix in \
5572         /usr \
5573         /usr/local \
5574         /usr/pkg \
5575         /opt \
5576         /opt/local \
5577         $HOME
5578 do
5579
5580 test "x$cf_subdir_prefix" != "x$prefix" && \
5581 test -d "$cf_subdir_prefix" && \
5582 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5583         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5584         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5585         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5586         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5587         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5588         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5589 }
5590
5591 done
5592
5593 cf_search="$cf_library_path_list $cf_search"
5594
5595                         for cf_cv_library_path_utf8 in $cf_search
5596                         do
5597                                 if test -d $cf_cv_library_path_utf8 ; then
5598                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5599
5600 echo "${as_me:-configure}:5600: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5601
5602                                         CPPFLAGS="$cf_test_CPPFLAGS"
5603                                         LIBS="-lutf8  $cf_save_LIBS"
5604                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5605                                         cat >conftest.$ac_ext <<_ACEOF
5606 #line 5606 "configure"
5607 #include "confdefs.h"
5608
5609 #include <libutf8.h>
5610 int
5611 main ()
5612 {
5613 putwc(0,0);
5614   ;
5615   return 0;
5616 }
5617 _ACEOF
5618 rm -f conftest.$ac_objext conftest$ac_exeext
5619 if { (eval echo "$as_me:5619: \"$ac_link\"") >&5
5620   (eval $ac_link) 2>&5
5621   ac_status=$?
5622   echo "$as_me:5622: \$? = $ac_status" >&5
5623   (exit $ac_status); } &&
5624          { ac_try='test -s conftest$ac_exeext'
5625   { (eval echo "$as_me:5625: \"$ac_try\"") >&5
5626   (eval $ac_try) 2>&5
5627   ac_status=$?
5628   echo "$as_me:5628: \$? = $ac_status" >&5
5629   (exit $ac_status); }; }; then
5630
5631                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5632
5633 echo "${as_me:-configure}:5633: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5634
5635                                         cf_cv_find_linkage_utf8=yes
5636                                         cf_cv_library_file_utf8="-lutf8"
5637                                         break
5638 else
5639   echo "$as_me: failed program was:" >&5
5640 cat conftest.$ac_ext >&5
5641
5642                                         CPPFLAGS="$cf_save_CPPFLAGS"
5643                                         LIBS="$cf_save_LIBS"
5644                                         LDFLAGS="$cf_save_LDFLAGS"
5645
5646 fi
5647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5648                                 fi
5649                         done
5650                         CPPFLAGS="$cf_save_CPPFLAGS"
5651                         LDFLAGS="$cf_save_LDFLAGS"
5652                 fi
5653
5654         else
5655                 cf_cv_find_linkage_utf8=no
5656         fi
5657
5658 fi
5659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5660
5661 fi
5662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5663
5664 LIBS="$cf_save_LIBS"
5665
5666 if test "$cf_cv_find_linkage_utf8" = yes ; then
5667 cf_cv_utf8_lib=add-on
5668 else
5669 cf_cv_utf8_lib=no
5670 fi
5671
5672 fi
5673 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5674 fi
5675 echo "$as_me:5675: result: $cf_cv_utf8_lib" >&5
5676 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5677
5678 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5679 # ncurses/ncursesw:
5680 if test "$cf_cv_utf8_lib" = "add-on" ; then
5681
5682 cat >>confdefs.h <<\EOF
5683 #define HAVE_LIBUTF8_H 1
5684 EOF
5685
5686 if test -n "$cf_cv_header_path_utf8" ; then
5687   for cf_add_incdir in $cf_cv_header_path_utf8
5688   do
5689         while test $cf_add_incdir != /usr/include
5690         do
5691           if test -d $cf_add_incdir
5692           then
5693                 cf_have_incdir=no
5694                 if test -n "$CFLAGS$CPPFLAGS" ; then
5695                   # a loop is needed to ensure we can add subdirs of existing dirs
5696                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5697                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5698                           cf_have_incdir=yes; break
5699                         fi
5700                   done
5701                 fi
5702
5703                 if test "$cf_have_incdir" = no ; then
5704                   if test "$cf_add_incdir" = /usr/local/include ; then
5705                         if test "$GCC" = yes
5706                         then
5707                           cf_save_CPPFLAGS=$CPPFLAGS
5708                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5709                           cat >conftest.$ac_ext <<_ACEOF
5710 #line 5710 "configure"
5711 #include "confdefs.h"
5712 #include <stdio.h>
5713 int
5714 main ()
5715 {
5716 printf("Hello")
5717   ;
5718   return 0;
5719 }
5720 _ACEOF
5721 rm -f conftest.$ac_objext
5722 if { (eval echo "$as_me:5722: \"$ac_compile\"") >&5
5723   (eval $ac_compile) 2>&5
5724   ac_status=$?
5725   echo "$as_me:5725: \$? = $ac_status" >&5
5726   (exit $ac_status); } &&
5727          { ac_try='test -s conftest.$ac_objext'
5728   { (eval echo "$as_me:5728: \"$ac_try\"") >&5
5729   (eval $ac_try) 2>&5
5730   ac_status=$?
5731   echo "$as_me:5731: \$? = $ac_status" >&5
5732   (exit $ac_status); }; }; then
5733   :
5734 else
5735   echo "$as_me: failed program was:" >&5
5736 cat conftest.$ac_ext >&5
5737 cf_have_incdir=yes
5738 fi
5739 rm -f conftest.$ac_objext conftest.$ac_ext
5740                           CPPFLAGS=$cf_save_CPPFLAGS
5741                         fi
5742                   fi
5743                 fi
5744
5745                 if test "$cf_have_incdir" = no ; then
5746                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5747
5748 echo "${as_me:-configure}:5748: testing adding $cf_add_incdir to include-path ..." 1>&5
5749
5750                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5751
5752                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5753                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5754                   cf_add_incdir="$cf_top_incdir"
5755                 else
5756                   break
5757                 fi
5758           else
5759                 break
5760           fi
5761         done
5762   done
5763 fi
5764
5765 if test -n "$cf_cv_library_path_utf8" ; then
5766         for cf_add_libdir in $cf_cv_library_path_utf8
5767         do
5768                 if test $cf_add_libdir = /usr/lib ; then
5769                         :
5770                 elif test -d $cf_add_libdir
5771                 then
5772                         cf_have_libdir=no
5773                         if test -n "$LDFLAGS$LIBS" ; then
5774                                 # a loop is needed to ensure we can add subdirs of existing dirs
5775                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5776                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5777                                                 cf_have_libdir=yes; break
5778                                         fi
5779                                 done
5780                         fi
5781                         if test "$cf_have_libdir" = no ; then
5782                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5783
5784 echo "${as_me:-configure}:5784: testing adding $cf_add_libdir to library-path ..." 1>&5
5785
5786                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5787                         fi
5788                 fi
5789         done
5790 fi
5791
5792 cf_add_libs="$cf_cv_library_file_utf8"
5793 # Filter out duplicates - this happens with badly-designed ".pc" files...
5794 for cf_add_1lib in $LIBS
5795 do
5796         for cf_add_2lib in $cf_add_libs
5797         do
5798                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5799                 then
5800                         cf_add_1lib=
5801                         break
5802                 fi
5803         done
5804         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5805 done
5806 LIBS="$cf_add_libs"
5807
5808 fi
5809
5810 cf_ncuconfig_root=ncursesw
5811 cf_have_ncuconfig=no
5812
5813 if test "x${PKG_CONFIG:=none}" != xnone; then
5814         echo "$as_me:5814: checking pkg-config for $cf_ncuconfig_root" >&5
5815 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5816         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5817                 echo "$as_me:5817: result: yes" >&5
5818 echo "${ECHO_T}yes" >&6
5819
5820                 echo "$as_me:5820: checking if the $cf_ncuconfig_root package files work" >&5
5821 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5822                 cf_have_ncuconfig=unknown
5823
5824                 cf_save_CPPFLAGS="$CPPFLAGS"
5825                 cf_save_LIBS="$LIBS"
5826
5827                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5828
5829 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5830 # Filter out duplicates - this happens with badly-designed ".pc" files...
5831 for cf_add_1lib in $LIBS
5832 do
5833         for cf_add_2lib in $cf_add_libs
5834         do
5835                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5836                 then
5837                         cf_add_1lib=
5838                         break
5839                 fi
5840         done
5841         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5842 done
5843 LIBS="$cf_add_libs"
5844
5845                 cat >conftest.$ac_ext <<_ACEOF
5846 #line 5846 "configure"
5847 #include "confdefs.h"
5848 #include <${cf_cv_ncurses_header:-curses.h}>
5849 int
5850 main ()
5851 {
5852 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5853   ;
5854   return 0;
5855 }
5856 _ACEOF
5857 rm -f conftest.$ac_objext conftest$ac_exeext
5858 if { (eval echo "$as_me:5858: \"$ac_link\"") >&5
5859   (eval $ac_link) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit $ac_status); } &&
5863          { ac_try='test -s conftest$ac_exeext'
5864   { (eval echo "$as_me:5864: \"$ac_try\"") >&5
5865   (eval $ac_try) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); }; }; then
5869   if test "$cross_compiling" = yes; then
5870   cf_have_ncuconfig=maybe
5871 else
5872   cat >conftest.$ac_ext <<_ACEOF
5873 #line 5873 "configure"
5874 #include "confdefs.h"
5875 #include <${cf_cv_ncurses_header:-curses.h}>
5876                                 int main(void)
5877                                 { char *xx = curses_version(); return (xx == 0); }
5878 _ACEOF
5879 rm -f conftest$ac_exeext
5880 if { (eval echo "$as_me:5880: \"$ac_link\"") >&5
5881   (eval $ac_link) 2>&5
5882   ac_status=$?
5883   echo "$as_me:5883: \$? = $ac_status" >&5
5884   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5885   { (eval echo "$as_me:5885: \"$ac_try\"") >&5
5886   (eval $ac_try) 2>&5
5887   ac_status=$?
5888   echo "$as_me:5888: \$? = $ac_status" >&5
5889   (exit $ac_status); }; }; then
5890   cf_have_ncuconfig=yes
5891 else
5892   echo "$as_me: program exited with status $ac_status" >&5
5893 echo "$as_me: failed program was:" >&5
5894 cat conftest.$ac_ext >&5
5895 cf_have_ncuconfig=no
5896 fi
5897 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5898 fi
5899 else
5900   echo "$as_me: failed program was:" >&5
5901 cat conftest.$ac_ext >&5
5902 cf_have_ncuconfig=no
5903 fi
5904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5905                 echo "$as_me:5905: result: $cf_have_ncuconfig" >&5
5906 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5907                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5908                 if test "$cf_have_ncuconfig" != "yes"
5909                 then
5910                         CPPFLAGS="$cf_save_CPPFLAGS"
5911                         LIBS="$cf_save_LIBS"
5912                         NCURSES_CONFIG_PKG=none
5913                 else
5914
5915 cat >>confdefs.h <<\EOF
5916 #define NCURSES 1
5917 EOF
5918
5919                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5920                 fi
5921
5922         else
5923                 echo "$as_me:5923: result: no" >&5
5924 echo "${ECHO_T}no" >&6
5925                 NCURSES_CONFIG_PKG=none
5926         fi
5927 else
5928         NCURSES_CONFIG_PKG=none
5929 fi
5930
5931 if test "x$cf_have_ncuconfig" = "xno"; then
5932         echo "Looking for ${cf_ncuconfig_root}-config"
5933
5934 if test -n "$ac_tool_prefix"; then
5935   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5936   do
5937     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5938 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5939 echo "$as_me:5939: checking for $ac_word" >&5
5940 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5941 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5942   echo $ECHO_N "(cached) $ECHO_C" >&6
5943 else
5944   if test -n "$NCURSES_CONFIG"; then
5945   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5946 else
5947   ac_save_IFS=$IFS; IFS=$ac_path_separator
5948 ac_dummy="$PATH"
5949 for ac_dir in $ac_dummy; do
5950   IFS=$ac_save_IFS
5951   test -z "$ac_dir" && ac_dir=.
5952   $as_executable_p "$ac_dir/$ac_word" || continue
5953 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5954 echo "$as_me:5954: found $ac_dir/$ac_word" >&5
5955 break
5956 done
5957
5958 fi
5959 fi
5960 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5961 if test -n "$NCURSES_CONFIG"; then
5962   echo "$as_me:5962: result: $NCURSES_CONFIG" >&5
5963 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5964 else
5965   echo "$as_me:5965: result: no" >&5
5966 echo "${ECHO_T}no" >&6
5967 fi
5968
5969     test -n "$NCURSES_CONFIG" && break
5970   done
5971 fi
5972 if test -z "$NCURSES_CONFIG"; then
5973   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5974   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5975 do
5976   # Extract the first word of "$ac_prog", so it can be a program name with args.
5977 set dummy $ac_prog; ac_word=$2
5978 echo "$as_me:5978: checking for $ac_word" >&5
5979 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5980 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5981   echo $ECHO_N "(cached) $ECHO_C" >&6
5982 else
5983   if test -n "$ac_ct_NCURSES_CONFIG"; then
5984   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5985 else
5986   ac_save_IFS=$IFS; IFS=$ac_path_separator
5987 ac_dummy="$PATH"
5988 for ac_dir in $ac_dummy; do
5989   IFS=$ac_save_IFS
5990   test -z "$ac_dir" && ac_dir=.
5991   $as_executable_p "$ac_dir/$ac_word" || continue
5992 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5993 echo "$as_me:5993: found $ac_dir/$ac_word" >&5
5994 break
5995 done
5996
5997 fi
5998 fi
5999 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6000 if test -n "$ac_ct_NCURSES_CONFIG"; then
6001   echo "$as_me:6001: result: $ac_ct_NCURSES_CONFIG" >&5
6002 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6003 else
6004   echo "$as_me:6004: result: no" >&5
6005 echo "${ECHO_T}no" >&6
6006 fi
6007
6008   test -n "$ac_ct_NCURSES_CONFIG" && break
6009 done
6010 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6011
6012   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6013 fi
6014
6015         if test "$NCURSES_CONFIG" != none ; then
6016
6017                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6018
6019 cf_add_libs="`$NCURSES_CONFIG --libs`"
6020 # Filter out duplicates - this happens with badly-designed ".pc" files...
6021 for cf_add_1lib in $LIBS
6022 do
6023         for cf_add_2lib in $cf_add_libs
6024         do
6025                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6026                 then
6027                         cf_add_1lib=
6028                         break
6029                 fi
6030         done
6031         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6032 done
6033 LIBS="$cf_add_libs"
6034
6035                 # even with config script, some packages use no-override for curses.h
6036
6037 echo "$as_me:6037: checking if we have identified curses headers" >&5
6038 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6039 if test "${cf_cv_ncurses_header+set}" = set; then
6040   echo $ECHO_N "(cached) $ECHO_C" >&6
6041 else
6042
6043 cf_cv_ncurses_header=none
6044 for cf_header in \
6045         ncurses.h ncursesw/ncurses.h \
6046         curses.h ncursesw/curses.h
6047 do
6048 cat >conftest.$ac_ext <<_ACEOF
6049 #line 6049 "configure"
6050 #include "confdefs.h"
6051 #include <${cf_header}>
6052 int
6053 main ()
6054 {
6055 initscr(); tgoto("?", 0,0)
6056   ;
6057   return 0;
6058 }
6059 _ACEOF
6060 rm -f conftest.$ac_objext
6061 if { (eval echo "$as_me:6061: \"$ac_compile\"") >&5
6062   (eval $ac_compile) 2>&5
6063   ac_status=$?
6064   echo "$as_me:6064: \$? = $ac_status" >&5
6065   (exit $ac_status); } &&
6066          { ac_try='test -s conftest.$ac_objext'
6067   { (eval echo "$as_me:6067: \"$ac_try\"") >&5
6068   (eval $ac_try) 2>&5
6069   ac_status=$?
6070   echo "$as_me:6070: \$? = $ac_status" >&5
6071   (exit $ac_status); }; }; then
6072   cf_cv_ncurses_header=$cf_header; break
6073 else
6074   echo "$as_me: failed program was:" >&5
6075 cat conftest.$ac_ext >&5
6076 fi
6077 rm -f conftest.$ac_objext conftest.$ac_ext
6078 done
6079
6080 fi
6081 echo "$as_me:6081: result: $cf_cv_ncurses_header" >&5
6082 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6083
6084 if test "$cf_cv_ncurses_header" = none ; then
6085         { { echo "$as_me:6085: error: No curses header-files found" >&5
6086 echo "$as_me: error: No curses header-files found" >&2;}
6087    { (exit 1); exit 1; }; }
6088 fi
6089
6090 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6091
6092 for ac_header in $cf_cv_ncurses_header
6093 do
6094 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6095 echo "$as_me:6095: checking for $ac_header" >&5
6096 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6097 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6098   echo $ECHO_N "(cached) $ECHO_C" >&6
6099 else
6100   cat >conftest.$ac_ext <<_ACEOF
6101 #line 6101 "configure"
6102 #include "confdefs.h"
6103 #include <$ac_header>
6104 _ACEOF
6105 if { (eval echo "$as_me:6105: \"$ac_cpp conftest.$ac_ext\"") >&5
6106   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6107   ac_status=$?
6108   egrep -v '^ *\+' conftest.er1 >conftest.err
6109   rm -f conftest.er1
6110   cat conftest.err >&5
6111   echo "$as_me:6111: \$? = $ac_status" >&5
6112   (exit $ac_status); } >/dev/null; then
6113   if test -s conftest.err; then
6114     ac_cpp_err=$ac_c_preproc_warn_flag
6115   else
6116     ac_cpp_err=
6117   fi
6118 else
6119   ac_cpp_err=yes
6120 fi
6121 if test -z "$ac_cpp_err"; then
6122   eval "$as_ac_Header=yes"
6123 else
6124   echo "$as_me: failed program was:" >&5
6125   cat conftest.$ac_ext >&5
6126   eval "$as_ac_Header=no"
6127 fi
6128 rm -f conftest.err conftest.$ac_ext
6129 fi
6130 echo "$as_me:6130: result: `eval echo '${'$as_ac_Header'}'`" >&5
6131 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6132 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6133   cat >>confdefs.h <<EOF
6134 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6135 EOF
6136
6137 fi
6138 done
6139
6140 cat >>confdefs.h <<\EOF
6141 #define NCURSES 1
6142 EOF
6143
6144 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6145
6146                 cat >>confdefs.h <<EOF
6147 #define $cf_nculib_ROOT 1
6148 EOF
6149
6150                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6151
6152         else
6153
6154 cf_ncuhdr_root=ncursesw
6155
6156 test -n "$cf_cv_curses_dir" && \
6157 test "$cf_cv_curses_dir" != "no" && { \
6158
6159 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6160   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6161   do
6162         while test $cf_add_incdir != /usr/include
6163         do
6164           if test -d $cf_add_incdir
6165           then
6166                 cf_have_incdir=no
6167                 if test -n "$CFLAGS$CPPFLAGS" ; then
6168                   # a loop is needed to ensure we can add subdirs of existing dirs
6169                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6170                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6171                           cf_have_incdir=yes; break
6172                         fi
6173                   done
6174                 fi
6175
6176                 if test "$cf_have_incdir" = no ; then
6177                   if test "$cf_add_incdir" = /usr/local/include ; then
6178                         if test "$GCC" = yes
6179                         then
6180                           cf_save_CPPFLAGS=$CPPFLAGS
6181                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6182                           cat >conftest.$ac_ext <<_ACEOF
6183 #line 6183 "configure"
6184 #include "confdefs.h"
6185 #include <stdio.h>
6186 int
6187 main ()
6188 {
6189 printf("Hello")
6190   ;
6191   return 0;
6192 }
6193 _ACEOF
6194 rm -f conftest.$ac_objext
6195 if { (eval echo "$as_me:6195: \"$ac_compile\"") >&5
6196   (eval $ac_compile) 2>&5
6197   ac_status=$?
6198   echo "$as_me:6198: \$? = $ac_status" >&5
6199   (exit $ac_status); } &&
6200          { ac_try='test -s conftest.$ac_objext'
6201   { (eval echo "$as_me:6201: \"$ac_try\"") >&5
6202   (eval $ac_try) 2>&5
6203   ac_status=$?
6204   echo "$as_me:6204: \$? = $ac_status" >&5
6205   (exit $ac_status); }; }; then
6206   :
6207 else
6208   echo "$as_me: failed program was:" >&5
6209 cat conftest.$ac_ext >&5
6210 cf_have_incdir=yes
6211 fi
6212 rm -f conftest.$ac_objext conftest.$ac_ext
6213                           CPPFLAGS=$cf_save_CPPFLAGS
6214                         fi
6215                   fi
6216                 fi
6217
6218                 if test "$cf_have_incdir" = no ; then
6219                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6220
6221 echo "${as_me:-configure}:6221: testing adding $cf_add_incdir to include-path ..." 1>&5
6222
6223                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6224
6225                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6226                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6227                   cf_add_incdir="$cf_top_incdir"
6228                 else
6229                   break
6230                 fi
6231           else
6232                 break
6233           fi
6234         done
6235   done
6236 fi
6237
6238 }
6239
6240 echo "$as_me:6240: checking for $cf_ncuhdr_root header in include-path" >&5
6241 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6242 if test "${cf_cv_ncurses_h+set}" = set; then
6243   echo $ECHO_N "(cached) $ECHO_C" >&6
6244 else
6245
6246         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6247         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6248         for cf_header in $cf_header_list
6249         do
6250
6251         cat >conftest.$ac_ext <<_ACEOF
6252 #line 6252 "configure"
6253 #include "confdefs.h"
6254
6255 #define _XOPEN_SOURCE_EXTENDED
6256 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6257 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6258
6259 #include <$cf_header>
6260 int
6261 main ()
6262 {
6263
6264 #ifdef NCURSES_VERSION
6265
6266 #ifndef WACS_BSSB
6267         make an error
6268 #endif
6269
6270 printf("%s\n", NCURSES_VERSION);
6271 #else
6272 #ifdef __NCURSES_H
6273 printf("old\n");
6274 #else
6275         make an error
6276 #endif
6277 #endif
6278
6279   ;
6280   return 0;
6281 }
6282 _ACEOF
6283 rm -f conftest.$ac_objext
6284 if { (eval echo "$as_me:6284: \"$ac_compile\"") >&5
6285   (eval $ac_compile) 2>&5
6286   ac_status=$?
6287   echo "$as_me:6287: \$? = $ac_status" >&5
6288   (exit $ac_status); } &&
6289          { ac_try='test -s conftest.$ac_objext'
6290   { (eval echo "$as_me:6290: \"$ac_try\"") >&5
6291   (eval $ac_try) 2>&5
6292   ac_status=$?
6293   echo "$as_me:6293: \$? = $ac_status" >&5
6294   (exit $ac_status); }; }; then
6295   cf_cv_ncurses_h=$cf_header
6296
6297 else
6298   echo "$as_me: failed program was:" >&5
6299 cat conftest.$ac_ext >&5
6300 cf_cv_ncurses_h=no
6301 fi
6302 rm -f conftest.$ac_objext conftest.$ac_ext
6303
6304                 test "$cf_cv_ncurses_h" != no && break
6305         done
6306
6307 fi
6308 echo "$as_me:6308: result: $cf_cv_ncurses_h" >&5
6309 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6310
6311 if test "$cf_cv_ncurses_h" != no ; then
6312         cf_cv_ncurses_header=$cf_cv_ncurses_h
6313 else
6314
6315 echo "$as_me:6315: checking for $cf_ncuhdr_root include-path" >&5
6316 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6317 if test "${cf_cv_ncurses_h2+set}" = set; then
6318   echo $ECHO_N "(cached) $ECHO_C" >&6
6319 else
6320
6321         test -n "$verbose" && echo
6322
6323 cf_search=
6324
6325 # collect the current set of include-directories from compiler flags
6326 cf_header_path_list=""
6327 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6328         for cf_header_path in $CPPFLAGS $CFLAGS
6329         do
6330                 case $cf_header_path in
6331                 (-I*)
6332                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6333
6334 test "x$cf_header_path" != "xNONE" && \
6335 test -d "$cf_header_path" && \
6336  {
6337         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6338         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6339         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6340         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6341         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6342         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"
6343 }
6344
6345                         cf_header_path_list="$cf_header_path_list $cf_search"
6346                         ;;
6347                 esac
6348         done
6349 fi
6350
6351 # add the variations for the package we are looking for
6352
6353 cf_search=
6354
6355 test "x$prefix" != "xNONE" && \
6356 test -d "$prefix" && \
6357  {
6358         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6359         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6360         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6361         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6362         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6363         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6364 }
6365
6366 for cf_subdir_prefix in \
6367         /usr \
6368         /usr/local \
6369         /usr/pkg \
6370         /opt \
6371         /opt/local \
6372         $HOME
6373 do
6374
6375 test "x$cf_subdir_prefix" != "x$prefix" && \
6376 test -d "$cf_subdir_prefix" && \
6377 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6378         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6379         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6380         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6381         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6382         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6383         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"
6384 }
6385
6386 done
6387
6388 test "$includedir" != NONE && \
6389 test "$includedir" != "/usr/include" && \
6390 test -d "$includedir" && {
6391         test -d $includedir &&    cf_search="$cf_search $includedir"
6392         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6393 }
6394
6395 test "$oldincludedir" != NONE && \
6396 test "$oldincludedir" != "/usr/include" && \
6397 test -d "$oldincludedir" && {
6398         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6399         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6400 }
6401
6402 cf_search="$cf_search $cf_header_path_list"
6403
6404         test -n "$verbose" && echo search path $cf_search
6405         cf_save2_CPPFLAGS="$CPPFLAGS"
6406         for cf_incdir in $cf_search
6407         do
6408
6409 if test -n "$cf_incdir" ; then
6410   for cf_add_incdir in $cf_incdir
6411   do
6412         while test $cf_add_incdir != /usr/include
6413         do
6414           if test -d $cf_add_incdir
6415           then
6416                 cf_have_incdir=no
6417                 if test -n "$CFLAGS$CPPFLAGS" ; then
6418                   # a loop is needed to ensure we can add subdirs of existing dirs
6419                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6420                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6421                           cf_have_incdir=yes; break
6422                         fi
6423                   done
6424                 fi
6425
6426                 if test "$cf_have_incdir" = no ; then
6427                   if test "$cf_add_incdir" = /usr/local/include ; then
6428                         if test "$GCC" = yes
6429                         then
6430                           cf_save_CPPFLAGS=$CPPFLAGS
6431                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6432                           cat >conftest.$ac_ext <<_ACEOF
6433 #line 6433 "configure"
6434 #include "confdefs.h"
6435 #include <stdio.h>
6436 int
6437 main ()
6438 {
6439 printf("Hello")
6440   ;
6441   return 0;
6442 }
6443 _ACEOF
6444 rm -f conftest.$ac_objext
6445 if { (eval echo "$as_me:6445: \"$ac_compile\"") >&5
6446   (eval $ac_compile) 2>&5
6447   ac_status=$?
6448   echo "$as_me:6448: \$? = $ac_status" >&5
6449   (exit $ac_status); } &&
6450          { ac_try='test -s conftest.$ac_objext'
6451   { (eval echo "$as_me:6451: \"$ac_try\"") >&5
6452   (eval $ac_try) 2>&5
6453   ac_status=$?
6454   echo "$as_me:6454: \$? = $ac_status" >&5
6455   (exit $ac_status); }; }; then
6456   :
6457 else
6458   echo "$as_me: failed program was:" >&5
6459 cat conftest.$ac_ext >&5
6460 cf_have_incdir=yes
6461 fi
6462 rm -f conftest.$ac_objext conftest.$ac_ext
6463                           CPPFLAGS=$cf_save_CPPFLAGS
6464                         fi
6465                   fi
6466                 fi
6467
6468                 if test "$cf_have_incdir" = no ; then
6469                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6470
6471 echo "${as_me:-configure}:6471: testing adding $cf_add_incdir to include-path ..." 1>&5
6472
6473                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6474
6475                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6476                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6477                   cf_add_incdir="$cf_top_incdir"
6478                 else
6479                   break
6480                 fi
6481           else
6482                 break
6483           fi
6484         done
6485   done
6486 fi
6487
6488                 for cf_header in \
6489                         ncurses.h \
6490                         curses.h
6491                 do
6492
6493         cat >conftest.$ac_ext <<_ACEOF
6494 #line 6494 "configure"
6495 #include "confdefs.h"
6496
6497 #include <$cf_header>
6498 int
6499 main ()
6500 {
6501
6502 #ifdef NCURSES_VERSION
6503
6504 printf("%s\n", NCURSES_VERSION);
6505 #else
6506 #ifdef __NCURSES_H
6507 printf("old\n");
6508 #else
6509         make an error
6510 #endif
6511 #endif
6512
6513   ;
6514   return 0;
6515 }
6516 _ACEOF
6517 rm -f conftest.$ac_objext
6518 if { (eval echo "$as_me:6518: \"$ac_compile\"") >&5
6519   (eval $ac_compile) 2>&5
6520   ac_status=$?
6521   echo "$as_me:6521: \$? = $ac_status" >&5
6522   (exit $ac_status); } &&
6523          { ac_try='test -s conftest.$ac_objext'
6524   { (eval echo "$as_me:6524: \"$ac_try\"") >&5
6525   (eval $ac_try) 2>&5
6526   ac_status=$?
6527   echo "$as_me:6527: \$? = $ac_status" >&5
6528   (exit $ac_status); }; }; then
6529   cf_cv_ncurses_h2=$cf_header
6530
6531 else
6532   echo "$as_me: failed program was:" >&5
6533 cat conftest.$ac_ext >&5
6534 cf_cv_ncurses_h2=no
6535 fi
6536 rm -f conftest.$ac_objext conftest.$ac_ext
6537
6538                         if test "$cf_cv_ncurses_h2" != no ; then
6539                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6540                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6541                                 break
6542                         fi
6543                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6544                 done
6545                 CPPFLAGS="$cf_save2_CPPFLAGS"
6546                 test "$cf_cv_ncurses_h2" != no && break
6547         done
6548         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6548: error: not found" >&5
6549 echo "$as_me: error: not found" >&2;}
6550    { (exit 1); exit 1; }; }
6551
6552 fi
6553 echo "$as_me:6553: result: $cf_cv_ncurses_h2" >&5
6554 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6555
6556         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6557         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6558         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6559                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6560         fi
6561
6562 if test -n "$cf_1st_incdir" ; then
6563   for cf_add_incdir in $cf_1st_incdir
6564   do
6565         while test $cf_add_incdir != /usr/include
6566         do
6567           if test -d $cf_add_incdir
6568           then
6569                 cf_have_incdir=no
6570                 if test -n "$CFLAGS$CPPFLAGS" ; then
6571                   # a loop is needed to ensure we can add subdirs of existing dirs
6572                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6573                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6574                           cf_have_incdir=yes; break
6575                         fi
6576                   done
6577                 fi
6578
6579                 if test "$cf_have_incdir" = no ; then
6580                   if test "$cf_add_incdir" = /usr/local/include ; then
6581                         if test "$GCC" = yes
6582                         then
6583                           cf_save_CPPFLAGS=$CPPFLAGS
6584                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6585                           cat >conftest.$ac_ext <<_ACEOF
6586 #line 6586 "configure"
6587 #include "confdefs.h"
6588 #include <stdio.h>
6589 int
6590 main ()
6591 {
6592 printf("Hello")
6593   ;
6594   return 0;
6595 }
6596 _ACEOF
6597 rm -f conftest.$ac_objext
6598 if { (eval echo "$as_me:6598: \"$ac_compile\"") >&5
6599   (eval $ac_compile) 2>&5
6600   ac_status=$?
6601   echo "$as_me:6601: \$? = $ac_status" >&5
6602   (exit $ac_status); } &&
6603          { ac_try='test -s conftest.$ac_objext'
6604   { (eval echo "$as_me:6604: \"$ac_try\"") >&5
6605   (eval $ac_try) 2>&5
6606   ac_status=$?
6607   echo "$as_me:6607: \$? = $ac_status" >&5
6608   (exit $ac_status); }; }; then
6609   :
6610 else
6611   echo "$as_me: failed program was:" >&5
6612 cat conftest.$ac_ext >&5
6613 cf_have_incdir=yes
6614 fi
6615 rm -f conftest.$ac_objext conftest.$ac_ext
6616                           CPPFLAGS=$cf_save_CPPFLAGS
6617                         fi
6618                   fi
6619                 fi
6620
6621                 if test "$cf_have_incdir" = no ; then
6622                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6623
6624 echo "${as_me:-configure}:6624: testing adding $cf_add_incdir to include-path ..." 1>&5
6625
6626                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6627
6628                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6629                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6630                   cf_add_incdir="$cf_top_incdir"
6631                 else
6632                   break
6633                 fi
6634           else
6635                 break
6636           fi
6637         done
6638   done
6639 fi
6640
6641 fi
6642
6643 # Set definitions to allow ifdef'ing for ncurses.h
6644
6645 case $cf_cv_ncurses_header in
6646 (*ncurses.h)
6647
6648 cat >>confdefs.h <<\EOF
6649 #define HAVE_NCURSES_H 1
6650 EOF
6651
6652         ;;
6653 esac
6654
6655 case $cf_cv_ncurses_header in
6656 (ncurses/curses.h|ncurses/ncurses.h)
6657
6658 cat >>confdefs.h <<\EOF
6659 #define HAVE_NCURSES_NCURSES_H 1
6660 EOF
6661
6662         ;;
6663 (ncursesw/curses.h|ncursesw/ncurses.h)
6664
6665 cat >>confdefs.h <<\EOF
6666 #define HAVE_NCURSESW_NCURSES_H 1
6667 EOF
6668
6669         ;;
6670 esac
6671
6672 echo "$as_me:6672: checking for terminfo header" >&5
6673 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6674 if test "${cf_cv_term_header+set}" = set; then
6675   echo $ECHO_N "(cached) $ECHO_C" >&6
6676 else
6677
6678 case ${cf_cv_ncurses_header} in
6679 (*/ncurses.h|*/ncursesw.h)
6680         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6681         ;;
6682 (*)
6683         cf_term_header=term.h
6684         ;;
6685 esac
6686
6687 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6688 do
6689 cat >conftest.$ac_ext <<_ACEOF
6690 #line 6690 "configure"
6691 #include "confdefs.h"
6692 #include <stdio.h>
6693 #include <${cf_cv_ncurses_header:-curses.h}>
6694 #include <$cf_test>
6695
6696 int
6697 main ()
6698 {
6699 int x = auto_left_margin
6700   ;
6701   return 0;
6702 }
6703 _ACEOF
6704 rm -f conftest.$ac_objext
6705 if { (eval echo "$as_me:6705: \"$ac_compile\"") >&5
6706   (eval $ac_compile) 2>&5
6707   ac_status=$?
6708   echo "$as_me:6708: \$? = $ac_status" >&5
6709   (exit $ac_status); } &&
6710          { ac_try='test -s conftest.$ac_objext'
6711   { (eval echo "$as_me:6711: \"$ac_try\"") >&5
6712   (eval $ac_try) 2>&5
6713   ac_status=$?
6714   echo "$as_me:6714: \$? = $ac_status" >&5
6715   (exit $ac_status); }; }; then
6716
6717         cf_cv_term_header="$cf_test"
6718 else
6719   echo "$as_me: failed program was:" >&5
6720 cat conftest.$ac_ext >&5
6721
6722         cf_cv_term_header=unknown
6723
6724 fi
6725 rm -f conftest.$ac_objext conftest.$ac_ext
6726         test "$cf_cv_term_header" != unknown && break
6727 done
6728
6729 fi
6730 echo "$as_me:6730: result: $cf_cv_term_header" >&5
6731 echo "${ECHO_T}$cf_cv_term_header" >&6
6732
6733 # Set definitions to allow ifdef'ing to accommodate subdirectories
6734
6735 case $cf_cv_term_header in
6736 (*term.h)
6737
6738 cat >>confdefs.h <<\EOF
6739 #define HAVE_TERM_H 1
6740 EOF
6741
6742         ;;
6743 esac
6744
6745 case $cf_cv_term_header in
6746 (ncurses/term.h)
6747
6748 cat >>confdefs.h <<\EOF
6749 #define HAVE_NCURSES_TERM_H 1
6750 EOF
6751
6752         ;;
6753 (ncursesw/term.h)
6754
6755 cat >>confdefs.h <<\EOF
6756 #define HAVE_NCURSESW_TERM_H 1
6757 EOF
6758
6759         ;;
6760 esac
6761
6762 # some applications need this, but should check for NCURSES_VERSION
6763
6764 cat >>confdefs.h <<\EOF
6765 #define NCURSES 1
6766 EOF
6767
6768 echo "$as_me:6768: checking for ncurses version" >&5
6769 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6770 if test "${cf_cv_ncurses_version+set}" = set; then
6771   echo $ECHO_N "(cached) $ECHO_C" >&6
6772 else
6773
6774         cf_cv_ncurses_version=no
6775         cf_tempfile=out$$
6776         rm -f $cf_tempfile
6777         if test "$cross_compiling" = yes; then
6778
6779         # This will not work if the preprocessor splits the line after the
6780         # Autoconf token.  The 'unproto' program does that.
6781         cat > conftest.$ac_ext <<EOF
6782 #include <${cf_cv_ncurses_header:-curses.h}>
6783 #undef Autoconf
6784 #ifdef NCURSES_VERSION
6785 Autoconf NCURSES_VERSION
6786 #else
6787 #ifdef __NCURSES_H
6788 Autoconf "old"
6789 #endif
6790 ;
6791 #endif
6792 EOF
6793         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6794         { (eval echo "$as_me:6794: \"$cf_try\"") >&5
6795   (eval $cf_try) 2>&5
6796   ac_status=$?
6797   echo "$as_me:6797: \$? = $ac_status" >&5
6798   (exit $ac_status); }
6799         if test -f conftest.out ; then
6800                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6801                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6802                 rm -f conftest.out
6803         fi
6804
6805 else
6806   cat >conftest.$ac_ext <<_ACEOF
6807 #line 6807 "configure"
6808 #include "confdefs.h"
6809
6810 #include <${cf_cv_ncurses_header:-curses.h}>
6811 #include <stdio.h>
6812 int main()
6813 {
6814         FILE *fp = fopen("$cf_tempfile", "w");
6815 #ifdef NCURSES_VERSION
6816 # ifdef NCURSES_VERSION_PATCH
6817         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6818 # else
6819         fprintf(fp, "%s\n", NCURSES_VERSION);
6820 # endif
6821 #else
6822 # ifdef __NCURSES_H
6823         fprintf(fp, "old\n");
6824 # else
6825         make an error
6826 # endif
6827 #endif
6828         ${cf_cv_main_return:-return}(0);
6829 }
6830 _ACEOF
6831 rm -f conftest$ac_exeext
6832 if { (eval echo "$as_me:6832: \"$ac_link\"") >&5
6833   (eval $ac_link) 2>&5
6834   ac_status=$?
6835   echo "$as_me:6835: \$? = $ac_status" >&5
6836   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6837   { (eval echo "$as_me:6837: \"$ac_try\"") >&5
6838   (eval $ac_try) 2>&5
6839   ac_status=$?
6840   echo "$as_me:6840: \$? = $ac_status" >&5
6841   (exit $ac_status); }; }; then
6842
6843         cf_cv_ncurses_version=`cat $cf_tempfile`
6844 else
6845   echo "$as_me: program exited with status $ac_status" >&5
6846 echo "$as_me: failed program was:" >&5
6847 cat conftest.$ac_ext >&5
6848 fi
6849 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6850 fi
6851         rm -f $cf_tempfile
6852
6853 fi
6854 echo "$as_me:6854: result: $cf_cv_ncurses_version" >&5
6855 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6856 test "$cf_cv_ncurses_version" = no ||
6857 cat >>confdefs.h <<\EOF
6858 #define NCURSES 1
6859 EOF
6860
6861 cf_nculib_root=ncursesw
6862         # This works, except for the special case where we find gpm, but
6863         # ncurses is in a nonstandard location via $LIBS, and we really want
6864         # to link gpm.
6865 cf_ncurses_LIBS=""
6866 cf_ncurses_SAVE="$LIBS"
6867 echo "$as_me:6867: checking for Gpm_Open in -lgpm" >&5
6868 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6869 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6870   echo $ECHO_N "(cached) $ECHO_C" >&6
6871 else
6872   ac_check_lib_save_LIBS=$LIBS
6873 LIBS="-lgpm  $LIBS"
6874 cat >conftest.$ac_ext <<_ACEOF
6875 #line 6875 "configure"
6876 #include "confdefs.h"
6877
6878 /* Override any gcc2 internal prototype to avoid an error.  */
6879 #ifdef __cplusplus
6880 extern "C"
6881 #endif
6882 /* We use char because int might match the return type of a gcc2
6883    builtin and then its argument prototype would still apply.  */
6884 char Gpm_Open ();
6885 int
6886 main ()
6887 {
6888 Gpm_Open ();
6889   ;
6890   return 0;
6891 }
6892 _ACEOF
6893 rm -f conftest.$ac_objext conftest$ac_exeext
6894 if { (eval echo "$as_me:6894: \"$ac_link\"") >&5
6895   (eval $ac_link) 2>&5
6896   ac_status=$?
6897   echo "$as_me:6897: \$? = $ac_status" >&5
6898   (exit $ac_status); } &&
6899          { ac_try='test -s conftest$ac_exeext'
6900   { (eval echo "$as_me:6900: \"$ac_try\"") >&5
6901   (eval $ac_try) 2>&5
6902   ac_status=$?
6903   echo "$as_me:6903: \$? = $ac_status" >&5
6904   (exit $ac_status); }; }; then
6905   ac_cv_lib_gpm_Gpm_Open=yes
6906 else
6907   echo "$as_me: failed program was:" >&5
6908 cat conftest.$ac_ext >&5
6909 ac_cv_lib_gpm_Gpm_Open=no
6910 fi
6911 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6912 LIBS=$ac_check_lib_save_LIBS
6913 fi
6914 echo "$as_me:6914: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6915 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6916 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6917   echo "$as_me:6917: checking for initscr in -lgpm" >&5
6918 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6919 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6920   echo $ECHO_N "(cached) $ECHO_C" >&6
6921 else
6922   ac_check_lib_save_LIBS=$LIBS
6923 LIBS="-lgpm  $LIBS"
6924 cat >conftest.$ac_ext <<_ACEOF
6925 #line 6925 "configure"
6926 #include "confdefs.h"
6927
6928 /* Override any gcc2 internal prototype to avoid an error.  */
6929 #ifdef __cplusplus
6930 extern "C"
6931 #endif
6932 /* We use char because int might match the return type of a gcc2
6933    builtin and then its argument prototype would still apply.  */
6934 char initscr ();
6935 int
6936 main ()
6937 {
6938 initscr ();
6939   ;
6940   return 0;
6941 }
6942 _ACEOF
6943 rm -f conftest.$ac_objext conftest$ac_exeext
6944 if { (eval echo "$as_me:6944: \"$ac_link\"") >&5
6945   (eval $ac_link) 2>&5
6946   ac_status=$?
6947   echo "$as_me:6947: \$? = $ac_status" >&5
6948   (exit $ac_status); } &&
6949          { ac_try='test -s conftest$ac_exeext'
6950   { (eval echo "$as_me:6950: \"$ac_try\"") >&5
6951   (eval $ac_try) 2>&5
6952   ac_status=$?
6953   echo "$as_me:6953: \$? = $ac_status" >&5
6954   (exit $ac_status); }; }; then
6955   ac_cv_lib_gpm_initscr=yes
6956 else
6957   echo "$as_me: failed program was:" >&5
6958 cat conftest.$ac_ext >&5
6959 ac_cv_lib_gpm_initscr=no
6960 fi
6961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6962 LIBS=$ac_check_lib_save_LIBS
6963 fi
6964 echo "$as_me:6964: result: $ac_cv_lib_gpm_initscr" >&5
6965 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6966 if test $ac_cv_lib_gpm_initscr = yes; then
6967   LIBS="$cf_ncurses_SAVE"
6968 else
6969   cf_ncurses_LIBS="-lgpm"
6970 fi
6971
6972 fi
6973
6974 case $host_os in
6975 (freebsd*)
6976         # This is only necessary if you are linking against an obsolete
6977         # version of ncurses (but it should do no harm, since it's static).
6978         if test "$cf_nculib_root" = ncurses ; then
6979                 echo "$as_me:6979: checking for tgoto in -lmytinfo" >&5
6980 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6981 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6982   echo $ECHO_N "(cached) $ECHO_C" >&6
6983 else
6984   ac_check_lib_save_LIBS=$LIBS
6985 LIBS="-lmytinfo  $LIBS"
6986 cat >conftest.$ac_ext <<_ACEOF
6987 #line 6987 "configure"
6988 #include "confdefs.h"
6989
6990 /* Override any gcc2 internal prototype to avoid an error.  */
6991 #ifdef __cplusplus
6992 extern "C"
6993 #endif
6994 /* We use char because int might match the return type of a gcc2
6995    builtin and then its argument prototype would still apply.  */
6996 char tgoto ();
6997 int
6998 main ()
6999 {
7000 tgoto ();
7001   ;
7002   return 0;
7003 }
7004 _ACEOF
7005 rm -f conftest.$ac_objext conftest$ac_exeext
7006 if { (eval echo "$as_me:7006: \"$ac_link\"") >&5
7007   (eval $ac_link) 2>&5
7008   ac_status=$?
7009   echo "$as_me:7009: \$? = $ac_status" >&5
7010   (exit $ac_status); } &&
7011          { ac_try='test -s conftest$ac_exeext'
7012   { (eval echo "$as_me:7012: \"$ac_try\"") >&5
7013   (eval $ac_try) 2>&5
7014   ac_status=$?
7015   echo "$as_me:7015: \$? = $ac_status" >&5
7016   (exit $ac_status); }; }; then
7017   ac_cv_lib_mytinfo_tgoto=yes
7018 else
7019   echo "$as_me: failed program was:" >&5
7020 cat conftest.$ac_ext >&5
7021 ac_cv_lib_mytinfo_tgoto=no
7022 fi
7023 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7024 LIBS=$ac_check_lib_save_LIBS
7025 fi
7026 echo "$as_me:7026: result: $ac_cv_lib_mytinfo_tgoto" >&5
7027 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7028 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7029   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7030 fi
7031
7032         fi
7033         ;;
7034 esac
7035
7036 cf_add_libs="$cf_ncurses_LIBS"
7037 # Filter out duplicates - this happens with badly-designed ".pc" files...
7038 for cf_add_1lib in $LIBS
7039 do
7040         for cf_add_2lib in $cf_add_libs
7041         do
7042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7043                 then
7044                         cf_add_1lib=
7045                         break
7046                 fi
7047         done
7048         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7049 done
7050 LIBS="$cf_add_libs"
7051
7052 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7053 then
7054
7055 cf_add_libs="-l$cf_nculib_root"
7056 # Filter out duplicates - this happens with badly-designed ".pc" files...
7057 for cf_add_1lib in $LIBS
7058 do
7059         for cf_add_2lib in $cf_add_libs
7060         do
7061                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7062                 then
7063                         cf_add_1lib=
7064                         break
7065                 fi
7066         done
7067         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7068 done
7069 LIBS="$cf_add_libs"
7070
7071 else
7072
7073         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7074         cf_libdir=""
7075         echo "$as_me:7075: checking for initscr" >&5
7076 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7077 if test "${ac_cv_func_initscr+set}" = set; then
7078   echo $ECHO_N "(cached) $ECHO_C" >&6
7079 else
7080   cat >conftest.$ac_ext <<_ACEOF
7081 #line 7081 "configure"
7082 #include "confdefs.h"
7083 /* System header to define __stub macros and hopefully few prototypes,
7084     which can conflict with char initscr (); below.  */
7085 #include <assert.h>
7086 /* Override any gcc2 internal prototype to avoid an error.  */
7087 #ifdef __cplusplus
7088 extern "C"
7089 #endif
7090 /* We use char because int might match the return type of a gcc2
7091    builtin and then its argument prototype would still apply.  */
7092 char initscr ();
7093 char (*f) ();
7094
7095 int
7096 main ()
7097 {
7098 /* The GNU C library defines this for functions which it implements
7099     to always fail with ENOSYS.  Some functions are actually named
7100     something starting with __ and the normal name is an alias.  */
7101 #if defined (__stub_initscr) || defined (__stub___initscr)
7102 choke me
7103 #else
7104 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7105 #endif
7106
7107   ;
7108   return 0;
7109 }
7110 _ACEOF
7111 rm -f conftest.$ac_objext conftest$ac_exeext
7112 if { (eval echo "$as_me:7112: \"$ac_link\"") >&5
7113   (eval $ac_link) 2>&5
7114   ac_status=$?
7115   echo "$as_me:7115: \$? = $ac_status" >&5
7116   (exit $ac_status); } &&
7117          { ac_try='test -s conftest$ac_exeext'
7118   { (eval echo "$as_me:7118: \"$ac_try\"") >&5
7119   (eval $ac_try) 2>&5
7120   ac_status=$?
7121   echo "$as_me:7121: \$? = $ac_status" >&5
7122   (exit $ac_status); }; }; then
7123   ac_cv_func_initscr=yes
7124 else
7125   echo "$as_me: failed program was:" >&5
7126 cat conftest.$ac_ext >&5
7127 ac_cv_func_initscr=no
7128 fi
7129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7130 fi
7131 echo "$as_me:7131: result: $ac_cv_func_initscr" >&5
7132 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7133 if test $ac_cv_func_initscr = yes; then
7134   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7135 else
7136
7137                 cf_save_LIBS="$LIBS"
7138                 echo "$as_me:7138: checking for initscr in -l$cf_nculib_root" >&5
7139 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7140                 LIBS="-l$cf_nculib_root $LIBS"
7141                 cat >conftest.$ac_ext <<_ACEOF
7142 #line 7142 "configure"
7143 #include "confdefs.h"
7144 #include <${cf_cv_ncurses_header:-curses.h}>
7145 int
7146 main ()
7147 {
7148 initscr()
7149   ;
7150   return 0;
7151 }
7152 _ACEOF
7153 rm -f conftest.$ac_objext conftest$ac_exeext
7154 if { (eval echo "$as_me:7154: \"$ac_link\"") >&5
7155   (eval $ac_link) 2>&5
7156   ac_status=$?
7157   echo "$as_me:7157: \$? = $ac_status" >&5
7158   (exit $ac_status); } &&
7159          { ac_try='test -s conftest$ac_exeext'
7160   { (eval echo "$as_me:7160: \"$ac_try\"") >&5
7161   (eval $ac_try) 2>&5
7162   ac_status=$?
7163   echo "$as_me:7163: \$? = $ac_status" >&5
7164   (exit $ac_status); }; }; then
7165   echo "$as_me:7165: result: yes" >&5
7166 echo "${ECHO_T}yes" >&6
7167                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7168
7169 else
7170   echo "$as_me: failed program was:" >&5
7171 cat conftest.$ac_ext >&5
7172 echo "$as_me:7172: result: no" >&5
7173 echo "${ECHO_T}no" >&6
7174
7175 cf_search=
7176 cf_library_path_list=""
7177 if test -n "${LDFLAGS}${LIBS}" ; then
7178         for cf_library_path in $LDFLAGS $LIBS
7179         do
7180                 case $cf_library_path in
7181                 (-L*)
7182                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7183
7184 test "x$cf_library_path" != "xNONE" && \
7185 test -d "$cf_library_path" && \
7186  {
7187         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7188         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7189         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7190         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7191         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7192         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"
7193 }
7194
7195                         cf_library_path_list="$cf_library_path_list $cf_search"
7196                         ;;
7197                 esac
7198         done
7199 fi
7200
7201 cf_search=
7202
7203 test "x$prefix" != "xNONE" && \
7204 test -d "$prefix" && \
7205  {
7206         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7207         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7208         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7209         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7210         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7211         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7212 }
7213
7214 for cf_subdir_prefix in \
7215         /usr \
7216         /usr/local \
7217         /usr/pkg \
7218         /opt \
7219         /opt/local \
7220         $HOME
7221 do
7222
7223 test "x$cf_subdir_prefix" != "x$prefix" && \
7224 test -d "$cf_subdir_prefix" && \
7225 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7226         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7227         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7228         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7229         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7230         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7231         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"
7232 }
7233
7234 done
7235
7236 cf_search="$cf_library_path_list $cf_search"
7237
7238                         for cf_libdir in $cf_search
7239                         do
7240                                 echo "$as_me:7240: checking for -l$cf_nculib_root in $cf_libdir" >&5
7241 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7242                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7243                                 cat >conftest.$ac_ext <<_ACEOF
7244 #line 7244 "configure"
7245 #include "confdefs.h"
7246 #include <${cf_cv_ncurses_header:-curses.h}>
7247 int
7248 main ()
7249 {
7250 initscr()
7251   ;
7252   return 0;
7253 }
7254 _ACEOF
7255 rm -f conftest.$ac_objext conftest$ac_exeext
7256 if { (eval echo "$as_me:7256: \"$ac_link\"") >&5
7257   (eval $ac_link) 2>&5
7258   ac_status=$?
7259   echo "$as_me:7259: \$? = $ac_status" >&5
7260   (exit $ac_status); } &&
7261          { ac_try='test -s conftest$ac_exeext'
7262   { (eval echo "$as_me:7262: \"$ac_try\"") >&5
7263   (eval $ac_try) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit $ac_status); }; }; then
7267   echo "$as_me:7267: result: yes" >&5
7268 echo "${ECHO_T}yes" >&6
7269                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7270                                          break
7271 else
7272   echo "$as_me: failed program was:" >&5
7273 cat conftest.$ac_ext >&5
7274 echo "$as_me:7274: result: no" >&5
7275 echo "${ECHO_T}no" >&6
7276                                          LIBS="$cf_save_LIBS"
7277 fi
7278 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7279                         done
7280
7281 fi
7282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7283
7284 fi
7285
7286 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7287
7288 if test $cf_found_library = no ; then
7289         { { echo "$as_me:7289: error: Cannot link $cf_nculib_root library" >&5
7290 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7291    { (exit 1); exit 1; }; }
7292 fi
7293
7294 fi
7295
7296 if test -n "$cf_ncurses_LIBS" ; then
7297         echo "$as_me:7297: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7298 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7299         cf_ncurses_SAVE="$LIBS"
7300         for p in $cf_ncurses_LIBS ; do
7301                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7302                 if test "$q" != "$LIBS" ; then
7303                         LIBS="$q"
7304                 fi
7305         done
7306         cat >conftest.$ac_ext <<_ACEOF
7307 #line 7307 "configure"
7308 #include "confdefs.h"
7309 #include <${cf_cv_ncurses_header:-curses.h}>
7310 int
7311 main ()
7312 {
7313 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7314   ;
7315   return 0;
7316 }
7317 _ACEOF
7318 rm -f conftest.$ac_objext conftest$ac_exeext
7319 if { (eval echo "$as_me:7319: \"$ac_link\"") >&5
7320   (eval $ac_link) 2>&5
7321   ac_status=$?
7322   echo "$as_me:7322: \$? = $ac_status" >&5
7323   (exit $ac_status); } &&
7324          { ac_try='test -s conftest$ac_exeext'
7325   { (eval echo "$as_me:7325: \"$ac_try\"") >&5
7326   (eval $ac_try) 2>&5
7327   ac_status=$?
7328   echo "$as_me:7328: \$? = $ac_status" >&5
7329   (exit $ac_status); }; }; then
7330   echo "$as_me:7330: result: yes" >&5
7331 echo "${ECHO_T}yes" >&6
7332 else
7333   echo "$as_me: failed program was:" >&5
7334 cat conftest.$ac_ext >&5
7335 echo "$as_me:7335: result: no" >&5
7336 echo "${ECHO_T}no" >&6
7337                  LIBS="$cf_ncurses_SAVE"
7338 fi
7339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7340 fi
7341
7342 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7343
7344 cat >>confdefs.h <<EOF
7345 #define $cf_nculib_ROOT 1
7346 EOF
7347
7348         fi
7349 else
7350         NCURSES_CONFIG=none
7351 fi
7352
7353 else
7354
7355 cf_ncuconfig_root=ncurses
7356 cf_have_ncuconfig=no
7357
7358 if test "x${PKG_CONFIG:=none}" != xnone; then
7359         echo "$as_me:7359: checking pkg-config for $cf_ncuconfig_root" >&5
7360 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7361         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7362                 echo "$as_me:7362: result: yes" >&5
7363 echo "${ECHO_T}yes" >&6
7364
7365                 echo "$as_me:7365: checking if the $cf_ncuconfig_root package files work" >&5
7366 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7367                 cf_have_ncuconfig=unknown
7368
7369                 cf_save_CPPFLAGS="$CPPFLAGS"
7370                 cf_save_LIBS="$LIBS"
7371
7372                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7373
7374 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7375 # Filter out duplicates - this happens with badly-designed ".pc" files...
7376 for cf_add_1lib in $LIBS
7377 do
7378         for cf_add_2lib in $cf_add_libs
7379         do
7380                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7381                 then
7382                         cf_add_1lib=
7383                         break
7384                 fi
7385         done
7386         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7387 done
7388 LIBS="$cf_add_libs"
7389
7390                 cat >conftest.$ac_ext <<_ACEOF
7391 #line 7391 "configure"
7392 #include "confdefs.h"
7393 #include <${cf_cv_ncurses_header:-curses.h}>
7394 int
7395 main ()
7396 {
7397 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7398   ;
7399   return 0;
7400 }
7401 _ACEOF
7402 rm -f conftest.$ac_objext conftest$ac_exeext
7403 if { (eval echo "$as_me:7403: \"$ac_link\"") >&5
7404   (eval $ac_link) 2>&5
7405   ac_status=$?
7406   echo "$as_me:7406: \$? = $ac_status" >&5
7407   (exit $ac_status); } &&
7408          { ac_try='test -s conftest$ac_exeext'
7409   { (eval echo "$as_me:7409: \"$ac_try\"") >&5
7410   (eval $ac_try) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit $ac_status); }; }; then
7414   if test "$cross_compiling" = yes; then
7415   cf_have_ncuconfig=maybe
7416 else
7417   cat >conftest.$ac_ext <<_ACEOF
7418 #line 7418 "configure"
7419 #include "confdefs.h"
7420 #include <${cf_cv_ncurses_header:-curses.h}>
7421                                 int main(void)
7422                                 { char *xx = curses_version(); return (xx == 0); }
7423 _ACEOF
7424 rm -f conftest$ac_exeext
7425 if { (eval echo "$as_me:7425: \"$ac_link\"") >&5
7426   (eval $ac_link) 2>&5
7427   ac_status=$?
7428   echo "$as_me:7428: \$? = $ac_status" >&5
7429   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7430   { (eval echo "$as_me:7430: \"$ac_try\"") >&5
7431   (eval $ac_try) 2>&5
7432   ac_status=$?
7433   echo "$as_me:7433: \$? = $ac_status" >&5
7434   (exit $ac_status); }; }; then
7435   cf_have_ncuconfig=yes
7436 else
7437   echo "$as_me: program exited with status $ac_status" >&5
7438 echo "$as_me: failed program was:" >&5
7439 cat conftest.$ac_ext >&5
7440 cf_have_ncuconfig=no
7441 fi
7442 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7443 fi
7444 else
7445   echo "$as_me: failed program was:" >&5
7446 cat conftest.$ac_ext >&5
7447 cf_have_ncuconfig=no
7448 fi
7449 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7450                 echo "$as_me:7450: result: $cf_have_ncuconfig" >&5
7451 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7452                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7453                 if test "$cf_have_ncuconfig" != "yes"
7454                 then
7455                         CPPFLAGS="$cf_save_CPPFLAGS"
7456                         LIBS="$cf_save_LIBS"
7457                         NCURSES_CONFIG_PKG=none
7458                 else
7459
7460 cat >>confdefs.h <<\EOF
7461 #define NCURSES 1
7462 EOF
7463
7464                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7465                 fi
7466
7467         else
7468                 echo "$as_me:7468: result: no" >&5
7469 echo "${ECHO_T}no" >&6
7470                 NCURSES_CONFIG_PKG=none
7471         fi
7472 else
7473         NCURSES_CONFIG_PKG=none
7474 fi
7475
7476 if test "x$cf_have_ncuconfig" = "xno"; then
7477         echo "Looking for ${cf_ncuconfig_root}-config"
7478
7479 if test -n "$ac_tool_prefix"; then
7480   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7481   do
7482     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7483 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7484 echo "$as_me:7484: checking for $ac_word" >&5
7485 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7486 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7487   echo $ECHO_N "(cached) $ECHO_C" >&6
7488 else
7489   if test -n "$NCURSES_CONFIG"; then
7490   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7491 else
7492   ac_save_IFS=$IFS; IFS=$ac_path_separator
7493 ac_dummy="$PATH"
7494 for ac_dir in $ac_dummy; do
7495   IFS=$ac_save_IFS
7496   test -z "$ac_dir" && ac_dir=.
7497   $as_executable_p "$ac_dir/$ac_word" || continue
7498 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7499 echo "$as_me:7499: found $ac_dir/$ac_word" >&5
7500 break
7501 done
7502
7503 fi
7504 fi
7505 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7506 if test -n "$NCURSES_CONFIG"; then
7507   echo "$as_me:7507: result: $NCURSES_CONFIG" >&5
7508 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7509 else
7510   echo "$as_me:7510: result: no" >&5
7511 echo "${ECHO_T}no" >&6
7512 fi
7513
7514     test -n "$NCURSES_CONFIG" && break
7515   done
7516 fi
7517 if test -z "$NCURSES_CONFIG"; then
7518   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7519   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7520 do
7521   # Extract the first word of "$ac_prog", so it can be a program name with args.
7522 set dummy $ac_prog; ac_word=$2
7523 echo "$as_me:7523: checking for $ac_word" >&5
7524 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7525 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7526   echo $ECHO_N "(cached) $ECHO_C" >&6
7527 else
7528   if test -n "$ac_ct_NCURSES_CONFIG"; then
7529   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7530 else
7531   ac_save_IFS=$IFS; IFS=$ac_path_separator
7532 ac_dummy="$PATH"
7533 for ac_dir in $ac_dummy; do
7534   IFS=$ac_save_IFS
7535   test -z "$ac_dir" && ac_dir=.
7536   $as_executable_p "$ac_dir/$ac_word" || continue
7537 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7538 echo "$as_me:7538: found $ac_dir/$ac_word" >&5
7539 break
7540 done
7541
7542 fi
7543 fi
7544 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7545 if test -n "$ac_ct_NCURSES_CONFIG"; then
7546   echo "$as_me:7546: result: $ac_ct_NCURSES_CONFIG" >&5
7547 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7548 else
7549   echo "$as_me:7549: result: no" >&5
7550 echo "${ECHO_T}no" >&6
7551 fi
7552
7553   test -n "$ac_ct_NCURSES_CONFIG" && break
7554 done
7555 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7556
7557   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7558 fi
7559
7560         if test "$NCURSES_CONFIG" != none ; then
7561
7562                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7563
7564 cf_add_libs="`$NCURSES_CONFIG --libs`"
7565 # Filter out duplicates - this happens with badly-designed ".pc" files...
7566 for cf_add_1lib in $LIBS
7567 do
7568         for cf_add_2lib in $cf_add_libs
7569         do
7570                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7571                 then
7572                         cf_add_1lib=
7573                         break
7574                 fi
7575         done
7576         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7577 done
7578 LIBS="$cf_add_libs"
7579
7580                 # even with config script, some packages use no-override for curses.h
7581
7582 echo "$as_me:7582: checking if we have identified curses headers" >&5
7583 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7584 if test "${cf_cv_ncurses_header+set}" = set; then
7585   echo $ECHO_N "(cached) $ECHO_C" >&6
7586 else
7587
7588 cf_cv_ncurses_header=none
7589 for cf_header in \
7590         ncurses.h ncurses/ncurses.h \
7591         curses.h ncurses/curses.h
7592 do
7593 cat >conftest.$ac_ext <<_ACEOF
7594 #line 7594 "configure"
7595 #include "confdefs.h"
7596 #include <${cf_header}>
7597 int
7598 main ()
7599 {
7600 initscr(); tgoto("?", 0,0)
7601   ;
7602   return 0;
7603 }
7604 _ACEOF
7605 rm -f conftest.$ac_objext
7606 if { (eval echo "$as_me:7606: \"$ac_compile\"") >&5
7607   (eval $ac_compile) 2>&5
7608   ac_status=$?
7609   echo "$as_me:7609: \$? = $ac_status" >&5
7610   (exit $ac_status); } &&
7611          { ac_try='test -s conftest.$ac_objext'
7612   { (eval echo "$as_me:7612: \"$ac_try\"") >&5
7613   (eval $ac_try) 2>&5
7614   ac_status=$?
7615   echo "$as_me:7615: \$? = $ac_status" >&5
7616   (exit $ac_status); }; }; then
7617   cf_cv_ncurses_header=$cf_header; break
7618 else
7619   echo "$as_me: failed program was:" >&5
7620 cat conftest.$ac_ext >&5
7621 fi
7622 rm -f conftest.$ac_objext conftest.$ac_ext
7623 done
7624
7625 fi
7626 echo "$as_me:7626: result: $cf_cv_ncurses_header" >&5
7627 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7628
7629 if test "$cf_cv_ncurses_header" = none ; then
7630         { { echo "$as_me:7630: error: No curses header-files found" >&5
7631 echo "$as_me: error: No curses header-files found" >&2;}
7632    { (exit 1); exit 1; }; }
7633 fi
7634
7635 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7636
7637 for ac_header in $cf_cv_ncurses_header
7638 do
7639 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7640 echo "$as_me:7640: checking for $ac_header" >&5
7641 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7642 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7643   echo $ECHO_N "(cached) $ECHO_C" >&6
7644 else
7645   cat >conftest.$ac_ext <<_ACEOF
7646 #line 7646 "configure"
7647 #include "confdefs.h"
7648 #include <$ac_header>
7649 _ACEOF
7650 if { (eval echo "$as_me:7650: \"$ac_cpp conftest.$ac_ext\"") >&5
7651   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7652   ac_status=$?
7653   egrep -v '^ *\+' conftest.er1 >conftest.err
7654   rm -f conftest.er1
7655   cat conftest.err >&5
7656   echo "$as_me:7656: \$? = $ac_status" >&5
7657   (exit $ac_status); } >/dev/null; then
7658   if test -s conftest.err; then
7659     ac_cpp_err=$ac_c_preproc_warn_flag
7660   else
7661     ac_cpp_err=
7662   fi
7663 else
7664   ac_cpp_err=yes
7665 fi
7666 if test -z "$ac_cpp_err"; then
7667   eval "$as_ac_Header=yes"
7668 else
7669   echo "$as_me: failed program was:" >&5
7670   cat conftest.$ac_ext >&5
7671   eval "$as_ac_Header=no"
7672 fi
7673 rm -f conftest.err conftest.$ac_ext
7674 fi
7675 echo "$as_me:7675: result: `eval echo '${'$as_ac_Header'}'`" >&5
7676 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7677 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7678   cat >>confdefs.h <<EOF
7679 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7680 EOF
7681
7682 fi
7683 done
7684
7685 cat >>confdefs.h <<\EOF
7686 #define NCURSES 1
7687 EOF
7688
7689 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7690
7691                 cat >>confdefs.h <<EOF
7692 #define $cf_nculib_ROOT 1
7693 EOF
7694
7695                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7696
7697         else
7698
7699 cf_ncuhdr_root=ncurses
7700
7701 test -n "$cf_cv_curses_dir" && \
7702 test "$cf_cv_curses_dir" != "no" && { \
7703
7704 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7705   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7706   do
7707         while test $cf_add_incdir != /usr/include
7708         do
7709           if test -d $cf_add_incdir
7710           then
7711                 cf_have_incdir=no
7712                 if test -n "$CFLAGS$CPPFLAGS" ; then
7713                   # a loop is needed to ensure we can add subdirs of existing dirs
7714                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7715                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7716                           cf_have_incdir=yes; break
7717                         fi
7718                   done
7719                 fi
7720
7721                 if test "$cf_have_incdir" = no ; then
7722                   if test "$cf_add_incdir" = /usr/local/include ; then
7723                         if test "$GCC" = yes
7724                         then
7725                           cf_save_CPPFLAGS=$CPPFLAGS
7726                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7727                           cat >conftest.$ac_ext <<_ACEOF
7728 #line 7728 "configure"
7729 #include "confdefs.h"
7730 #include <stdio.h>
7731 int
7732 main ()
7733 {
7734 printf("Hello")
7735   ;
7736   return 0;
7737 }
7738 _ACEOF
7739 rm -f conftest.$ac_objext
7740 if { (eval echo "$as_me:7740: \"$ac_compile\"") >&5
7741   (eval $ac_compile) 2>&5
7742   ac_status=$?
7743   echo "$as_me:7743: \$? = $ac_status" >&5
7744   (exit $ac_status); } &&
7745          { ac_try='test -s conftest.$ac_objext'
7746   { (eval echo "$as_me:7746: \"$ac_try\"") >&5
7747   (eval $ac_try) 2>&5
7748   ac_status=$?
7749   echo "$as_me:7749: \$? = $ac_status" >&5
7750   (exit $ac_status); }; }; then
7751   :
7752 else
7753   echo "$as_me: failed program was:" >&5
7754 cat conftest.$ac_ext >&5
7755 cf_have_incdir=yes
7756 fi
7757 rm -f conftest.$ac_objext conftest.$ac_ext
7758                           CPPFLAGS=$cf_save_CPPFLAGS
7759                         fi
7760                   fi
7761                 fi
7762
7763                 if test "$cf_have_incdir" = no ; then
7764                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7765
7766 echo "${as_me:-configure}:7766: testing adding $cf_add_incdir to include-path ..." 1>&5
7767
7768                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7769
7770                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7771                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7772                   cf_add_incdir="$cf_top_incdir"
7773                 else
7774                   break
7775                 fi
7776           else
7777                 break
7778           fi
7779         done
7780   done
7781 fi
7782
7783 }
7784
7785 echo "$as_me:7785: checking for $cf_ncuhdr_root header in include-path" >&5
7786 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7787 if test "${cf_cv_ncurses_h+set}" = set; then
7788   echo $ECHO_N "(cached) $ECHO_C" >&6
7789 else
7790
7791         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7792         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7793         for cf_header in $cf_header_list
7794         do
7795
7796         cat >conftest.$ac_ext <<_ACEOF
7797 #line 7797 "configure"
7798 #include "confdefs.h"
7799
7800 #include <$cf_header>
7801 int
7802 main ()
7803 {
7804
7805 #ifdef NCURSES_VERSION
7806
7807 printf("%s\n", NCURSES_VERSION);
7808 #else
7809 #ifdef __NCURSES_H
7810 printf("old\n");
7811 #else
7812         make an error
7813 #endif
7814 #endif
7815
7816   ;
7817   return 0;
7818 }
7819 _ACEOF
7820 rm -f conftest.$ac_objext
7821 if { (eval echo "$as_me:7821: \"$ac_compile\"") >&5
7822   (eval $ac_compile) 2>&5
7823   ac_status=$?
7824   echo "$as_me:7824: \$? = $ac_status" >&5
7825   (exit $ac_status); } &&
7826          { ac_try='test -s conftest.$ac_objext'
7827   { (eval echo "$as_me:7827: \"$ac_try\"") >&5
7828   (eval $ac_try) 2>&5
7829   ac_status=$?
7830   echo "$as_me:7830: \$? = $ac_status" >&5
7831   (exit $ac_status); }; }; then
7832   cf_cv_ncurses_h=$cf_header
7833
7834 else
7835   echo "$as_me: failed program was:" >&5
7836 cat conftest.$ac_ext >&5
7837 cf_cv_ncurses_h=no
7838 fi
7839 rm -f conftest.$ac_objext conftest.$ac_ext
7840
7841                 test "$cf_cv_ncurses_h" != no && break
7842         done
7843
7844 fi
7845 echo "$as_me:7845: result: $cf_cv_ncurses_h" >&5
7846 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7847
7848 if test "$cf_cv_ncurses_h" != no ; then
7849         cf_cv_ncurses_header=$cf_cv_ncurses_h
7850 else
7851
7852 echo "$as_me:7852: checking for $cf_ncuhdr_root include-path" >&5
7853 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7854 if test "${cf_cv_ncurses_h2+set}" = set; then
7855   echo $ECHO_N "(cached) $ECHO_C" >&6
7856 else
7857
7858         test -n "$verbose" && echo
7859
7860 cf_search=
7861
7862 # collect the current set of include-directories from compiler flags
7863 cf_header_path_list=""
7864 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7865         for cf_header_path in $CPPFLAGS $CFLAGS
7866         do
7867                 case $cf_header_path in
7868                 (-I*)
7869                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7870
7871 test "x$cf_header_path" != "xNONE" && \
7872 test -d "$cf_header_path" && \
7873  {
7874         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7875         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7876         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7877         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7878         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7879         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"
7880 }
7881
7882                         cf_header_path_list="$cf_header_path_list $cf_search"
7883                         ;;
7884                 esac
7885         done
7886 fi
7887
7888 # add the variations for the package we are looking for
7889
7890 cf_search=
7891
7892 test "x$prefix" != "xNONE" && \
7893 test -d "$prefix" && \
7894  {
7895         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7896         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7897         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7898         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7899         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7900         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7901 }
7902
7903 for cf_subdir_prefix in \
7904         /usr \
7905         /usr/local \
7906         /usr/pkg \
7907         /opt \
7908         /opt/local \
7909         $HOME
7910 do
7911
7912 test "x$cf_subdir_prefix" != "x$prefix" && \
7913 test -d "$cf_subdir_prefix" && \
7914 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7915         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7916         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7917         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7918         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7919         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7920         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"
7921 }
7922
7923 done
7924
7925 test "$includedir" != NONE && \
7926 test "$includedir" != "/usr/include" && \
7927 test -d "$includedir" && {
7928         test -d $includedir &&    cf_search="$cf_search $includedir"
7929         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7930 }
7931
7932 test "$oldincludedir" != NONE && \
7933 test "$oldincludedir" != "/usr/include" && \
7934 test -d "$oldincludedir" && {
7935         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7936         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7937 }
7938
7939 cf_search="$cf_search $cf_header_path_list"
7940
7941         test -n "$verbose" && echo search path $cf_search
7942         cf_save2_CPPFLAGS="$CPPFLAGS"
7943         for cf_incdir in $cf_search
7944         do
7945
7946 if test -n "$cf_incdir" ; then
7947   for cf_add_incdir in $cf_incdir
7948   do
7949         while test $cf_add_incdir != /usr/include
7950         do
7951           if test -d $cf_add_incdir
7952           then
7953                 cf_have_incdir=no
7954                 if test -n "$CFLAGS$CPPFLAGS" ; then
7955                   # a loop is needed to ensure we can add subdirs of existing dirs
7956                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7957                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7958                           cf_have_incdir=yes; break
7959                         fi
7960                   done
7961                 fi
7962
7963                 if test "$cf_have_incdir" = no ; then
7964                   if test "$cf_add_incdir" = /usr/local/include ; then
7965                         if test "$GCC" = yes
7966                         then
7967                           cf_save_CPPFLAGS=$CPPFLAGS
7968                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7969                           cat >conftest.$ac_ext <<_ACEOF
7970 #line 7970 "configure"
7971 #include "confdefs.h"
7972 #include <stdio.h>
7973 int
7974 main ()
7975 {
7976 printf("Hello")
7977   ;
7978   return 0;
7979 }
7980 _ACEOF
7981 rm -f conftest.$ac_objext
7982 if { (eval echo "$as_me:7982: \"$ac_compile\"") >&5
7983   (eval $ac_compile) 2>&5
7984   ac_status=$?
7985   echo "$as_me:7985: \$? = $ac_status" >&5
7986   (exit $ac_status); } &&
7987          { ac_try='test -s conftest.$ac_objext'
7988   { (eval echo "$as_me:7988: \"$ac_try\"") >&5
7989   (eval $ac_try) 2>&5
7990   ac_status=$?
7991   echo "$as_me:7991: \$? = $ac_status" >&5
7992   (exit $ac_status); }; }; then
7993   :
7994 else
7995   echo "$as_me: failed program was:" >&5
7996 cat conftest.$ac_ext >&5
7997 cf_have_incdir=yes
7998 fi
7999 rm -f conftest.$ac_objext conftest.$ac_ext
8000                           CPPFLAGS=$cf_save_CPPFLAGS
8001                         fi
8002                   fi
8003                 fi
8004
8005                 if test "$cf_have_incdir" = no ; then
8006                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8007
8008 echo "${as_me:-configure}:8008: testing adding $cf_add_incdir to include-path ..." 1>&5
8009
8010                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8011
8012                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8013                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8014                   cf_add_incdir="$cf_top_incdir"
8015                 else
8016                   break
8017                 fi
8018           else
8019                 break
8020           fi
8021         done
8022   done
8023 fi
8024
8025                 for cf_header in \
8026                         ncurses.h \
8027                         curses.h
8028                 do
8029
8030         cat >conftest.$ac_ext <<_ACEOF
8031 #line 8031 "configure"
8032 #include "confdefs.h"
8033
8034 #include <$cf_header>
8035 int
8036 main ()
8037 {
8038
8039 #ifdef NCURSES_VERSION
8040
8041 printf("%s\n", NCURSES_VERSION);
8042 #else
8043 #ifdef __NCURSES_H
8044 printf("old\n");
8045 #else
8046         make an error
8047 #endif
8048 #endif
8049
8050   ;
8051   return 0;
8052 }
8053 _ACEOF
8054 rm -f conftest.$ac_objext
8055 if { (eval echo "$as_me:8055: \"$ac_compile\"") >&5
8056   (eval $ac_compile) 2>&5
8057   ac_status=$?
8058   echo "$as_me:8058: \$? = $ac_status" >&5
8059   (exit $ac_status); } &&
8060          { ac_try='test -s conftest.$ac_objext'
8061   { (eval echo "$as_me:8061: \"$ac_try\"") >&5
8062   (eval $ac_try) 2>&5
8063   ac_status=$?
8064   echo "$as_me:8064: \$? = $ac_status" >&5
8065   (exit $ac_status); }; }; then
8066   cf_cv_ncurses_h2=$cf_header
8067
8068 else
8069   echo "$as_me: failed program was:" >&5
8070 cat conftest.$ac_ext >&5
8071 cf_cv_ncurses_h2=no
8072 fi
8073 rm -f conftest.$ac_objext conftest.$ac_ext
8074
8075                         if test "$cf_cv_ncurses_h2" != no ; then
8076                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8077                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8078                                 break
8079                         fi
8080                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8081                 done
8082                 CPPFLAGS="$cf_save2_CPPFLAGS"
8083                 test "$cf_cv_ncurses_h2" != no && break
8084         done
8085         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8085: error: not found" >&5
8086 echo "$as_me: error: not found" >&2;}
8087    { (exit 1); exit 1; }; }
8088
8089 fi
8090 echo "$as_me:8090: result: $cf_cv_ncurses_h2" >&5
8091 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8092
8093         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8094         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8095         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8096                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8097         fi
8098
8099 if test -n "$cf_1st_incdir" ; then
8100   for cf_add_incdir in $cf_1st_incdir
8101   do
8102         while test $cf_add_incdir != /usr/include
8103         do
8104           if test -d $cf_add_incdir
8105           then
8106                 cf_have_incdir=no
8107                 if test -n "$CFLAGS$CPPFLAGS" ; then
8108                   # a loop is needed to ensure we can add subdirs of existing dirs
8109                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8110                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8111                           cf_have_incdir=yes; break
8112                         fi
8113                   done
8114                 fi
8115
8116                 if test "$cf_have_incdir" = no ; then
8117                   if test "$cf_add_incdir" = /usr/local/include ; then
8118                         if test "$GCC" = yes
8119                         then
8120                           cf_save_CPPFLAGS=$CPPFLAGS
8121                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8122                           cat >conftest.$ac_ext <<_ACEOF
8123 #line 8123 "configure"
8124 #include "confdefs.h"
8125 #include <stdio.h>
8126 int
8127 main ()
8128 {
8129 printf("Hello")
8130   ;
8131   return 0;
8132 }
8133 _ACEOF
8134 rm -f conftest.$ac_objext
8135 if { (eval echo "$as_me:8135: \"$ac_compile\"") >&5
8136   (eval $ac_compile) 2>&5
8137   ac_status=$?
8138   echo "$as_me:8138: \$? = $ac_status" >&5
8139   (exit $ac_status); } &&
8140          { ac_try='test -s conftest.$ac_objext'
8141   { (eval echo "$as_me:8141: \"$ac_try\"") >&5
8142   (eval $ac_try) 2>&5
8143   ac_status=$?
8144   echo "$as_me:8144: \$? = $ac_status" >&5
8145   (exit $ac_status); }; }; then
8146   :
8147 else
8148   echo "$as_me: failed program was:" >&5
8149 cat conftest.$ac_ext >&5
8150 cf_have_incdir=yes
8151 fi
8152 rm -f conftest.$ac_objext conftest.$ac_ext
8153                           CPPFLAGS=$cf_save_CPPFLAGS
8154                         fi
8155                   fi
8156                 fi
8157
8158                 if test "$cf_have_incdir" = no ; then
8159                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8160
8161 echo "${as_me:-configure}:8161: testing adding $cf_add_incdir to include-path ..." 1>&5
8162
8163                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8164
8165                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8166                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8167                   cf_add_incdir="$cf_top_incdir"
8168                 else
8169                   break
8170                 fi
8171           else
8172                 break
8173           fi
8174         done
8175   done
8176 fi
8177
8178 fi
8179
8180 # Set definitions to allow ifdef'ing for ncurses.h
8181
8182 case $cf_cv_ncurses_header in
8183 (*ncurses.h)
8184
8185 cat >>confdefs.h <<\EOF
8186 #define HAVE_NCURSES_H 1
8187 EOF
8188
8189         ;;
8190 esac
8191
8192 case $cf_cv_ncurses_header in
8193 (ncurses/curses.h|ncurses/ncurses.h)
8194
8195 cat >>confdefs.h <<\EOF
8196 #define HAVE_NCURSES_NCURSES_H 1
8197 EOF
8198
8199         ;;
8200 (ncursesw/curses.h|ncursesw/ncurses.h)
8201
8202 cat >>confdefs.h <<\EOF
8203 #define HAVE_NCURSESW_NCURSES_H 1
8204 EOF
8205
8206         ;;
8207 esac
8208
8209 echo "$as_me:8209: checking for terminfo header" >&5
8210 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8211 if test "${cf_cv_term_header+set}" = set; then
8212   echo $ECHO_N "(cached) $ECHO_C" >&6
8213 else
8214
8215 case ${cf_cv_ncurses_header} in
8216 (*/ncurses.h|*/ncursesw.h)
8217         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8218         ;;
8219 (*)
8220         cf_term_header=term.h
8221         ;;
8222 esac
8223
8224 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8225 do
8226 cat >conftest.$ac_ext <<_ACEOF
8227 #line 8227 "configure"
8228 #include "confdefs.h"
8229 #include <stdio.h>
8230 #include <${cf_cv_ncurses_header:-curses.h}>
8231 #include <$cf_test>
8232
8233 int
8234 main ()
8235 {
8236 int x = auto_left_margin
8237   ;
8238   return 0;
8239 }
8240 _ACEOF
8241 rm -f conftest.$ac_objext
8242 if { (eval echo "$as_me:8242: \"$ac_compile\"") >&5
8243   (eval $ac_compile) 2>&5
8244   ac_status=$?
8245   echo "$as_me:8245: \$? = $ac_status" >&5
8246   (exit $ac_status); } &&
8247          { ac_try='test -s conftest.$ac_objext'
8248   { (eval echo "$as_me:8248: \"$ac_try\"") >&5
8249   (eval $ac_try) 2>&5
8250   ac_status=$?
8251   echo "$as_me:8251: \$? = $ac_status" >&5
8252   (exit $ac_status); }; }; then
8253
8254         cf_cv_term_header="$cf_test"
8255 else
8256   echo "$as_me: failed program was:" >&5
8257 cat conftest.$ac_ext >&5
8258
8259         cf_cv_term_header=unknown
8260
8261 fi
8262 rm -f conftest.$ac_objext conftest.$ac_ext
8263         test "$cf_cv_term_header" != unknown && break
8264 done
8265
8266 fi
8267 echo "$as_me:8267: result: $cf_cv_term_header" >&5
8268 echo "${ECHO_T}$cf_cv_term_header" >&6
8269
8270 # Set definitions to allow ifdef'ing to accommodate subdirectories
8271
8272 case $cf_cv_term_header in
8273 (*term.h)
8274
8275 cat >>confdefs.h <<\EOF
8276 #define HAVE_TERM_H 1
8277 EOF
8278
8279         ;;
8280 esac
8281
8282 case $cf_cv_term_header in
8283 (ncurses/term.h)
8284
8285 cat >>confdefs.h <<\EOF
8286 #define HAVE_NCURSES_TERM_H 1
8287 EOF
8288
8289         ;;
8290 (ncursesw/term.h)
8291
8292 cat >>confdefs.h <<\EOF
8293 #define HAVE_NCURSESW_TERM_H 1
8294 EOF
8295
8296         ;;
8297 esac
8298
8299 # some applications need this, but should check for NCURSES_VERSION
8300
8301 cat >>confdefs.h <<\EOF
8302 #define NCURSES 1
8303 EOF
8304
8305 echo "$as_me:8305: checking for ncurses version" >&5
8306 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8307 if test "${cf_cv_ncurses_version+set}" = set; then
8308   echo $ECHO_N "(cached) $ECHO_C" >&6
8309 else
8310
8311         cf_cv_ncurses_version=no
8312         cf_tempfile=out$$
8313         rm -f $cf_tempfile
8314         if test "$cross_compiling" = yes; then
8315
8316         # This will not work if the preprocessor splits the line after the
8317         # Autoconf token.  The 'unproto' program does that.
8318         cat > conftest.$ac_ext <<EOF
8319 #include <${cf_cv_ncurses_header:-curses.h}>
8320 #undef Autoconf
8321 #ifdef NCURSES_VERSION
8322 Autoconf NCURSES_VERSION
8323 #else
8324 #ifdef __NCURSES_H
8325 Autoconf "old"
8326 #endif
8327 ;
8328 #endif
8329 EOF
8330         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8331         { (eval echo "$as_me:8331: \"$cf_try\"") >&5
8332   (eval $cf_try) 2>&5
8333   ac_status=$?
8334   echo "$as_me:8334: \$? = $ac_status" >&5
8335   (exit $ac_status); }
8336         if test -f conftest.out ; then
8337                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8338                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8339                 rm -f conftest.out
8340         fi
8341
8342 else
8343   cat >conftest.$ac_ext <<_ACEOF
8344 #line 8344 "configure"
8345 #include "confdefs.h"
8346
8347 #include <${cf_cv_ncurses_header:-curses.h}>
8348 #include <stdio.h>
8349 int main()
8350 {
8351         FILE *fp = fopen("$cf_tempfile", "w");
8352 #ifdef NCURSES_VERSION
8353 # ifdef NCURSES_VERSION_PATCH
8354         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8355 # else
8356         fprintf(fp, "%s\n", NCURSES_VERSION);
8357 # endif
8358 #else
8359 # ifdef __NCURSES_H
8360         fprintf(fp, "old\n");
8361 # else
8362         make an error
8363 # endif
8364 #endif
8365         ${cf_cv_main_return:-return}(0);
8366 }
8367 _ACEOF
8368 rm -f conftest$ac_exeext
8369 if { (eval echo "$as_me:8369: \"$ac_link\"") >&5
8370   (eval $ac_link) 2>&5
8371   ac_status=$?
8372   echo "$as_me:8372: \$? = $ac_status" >&5
8373   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8374   { (eval echo "$as_me:8374: \"$ac_try\"") >&5
8375   (eval $ac_try) 2>&5
8376   ac_status=$?
8377   echo "$as_me:8377: \$? = $ac_status" >&5
8378   (exit $ac_status); }; }; then
8379
8380         cf_cv_ncurses_version=`cat $cf_tempfile`
8381 else
8382   echo "$as_me: program exited with status $ac_status" >&5
8383 echo "$as_me: failed program was:" >&5
8384 cat conftest.$ac_ext >&5
8385 fi
8386 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8387 fi
8388         rm -f $cf_tempfile
8389
8390 fi
8391 echo "$as_me:8391: result: $cf_cv_ncurses_version" >&5
8392 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8393 test "$cf_cv_ncurses_version" = no ||
8394 cat >>confdefs.h <<\EOF
8395 #define NCURSES 1
8396 EOF
8397
8398 cf_nculib_root=ncurses
8399         # This works, except for the special case where we find gpm, but
8400         # ncurses is in a nonstandard location via $LIBS, and we really want
8401         # to link gpm.
8402 cf_ncurses_LIBS=""
8403 cf_ncurses_SAVE="$LIBS"
8404 echo "$as_me:8404: checking for Gpm_Open in -lgpm" >&5
8405 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8406 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8407   echo $ECHO_N "(cached) $ECHO_C" >&6
8408 else
8409   ac_check_lib_save_LIBS=$LIBS
8410 LIBS="-lgpm  $LIBS"
8411 cat >conftest.$ac_ext <<_ACEOF
8412 #line 8412 "configure"
8413 #include "confdefs.h"
8414
8415 /* Override any gcc2 internal prototype to avoid an error.  */
8416 #ifdef __cplusplus
8417 extern "C"
8418 #endif
8419 /* We use char because int might match the return type of a gcc2
8420    builtin and then its argument prototype would still apply.  */
8421 char Gpm_Open ();
8422 int
8423 main ()
8424 {
8425 Gpm_Open ();
8426   ;
8427   return 0;
8428 }
8429 _ACEOF
8430 rm -f conftest.$ac_objext conftest$ac_exeext
8431 if { (eval echo "$as_me:8431: \"$ac_link\"") >&5
8432   (eval $ac_link) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); } &&
8436          { ac_try='test -s conftest$ac_exeext'
8437   { (eval echo "$as_me:8437: \"$ac_try\"") >&5
8438   (eval $ac_try) 2>&5
8439   ac_status=$?
8440   echo "$as_me:8440: \$? = $ac_status" >&5
8441   (exit $ac_status); }; }; then
8442   ac_cv_lib_gpm_Gpm_Open=yes
8443 else
8444   echo "$as_me: failed program was:" >&5
8445 cat conftest.$ac_ext >&5
8446 ac_cv_lib_gpm_Gpm_Open=no
8447 fi
8448 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8449 LIBS=$ac_check_lib_save_LIBS
8450 fi
8451 echo "$as_me:8451: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8452 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8453 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8454   echo "$as_me:8454: checking for initscr in -lgpm" >&5
8455 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8456 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8457   echo $ECHO_N "(cached) $ECHO_C" >&6
8458 else
8459   ac_check_lib_save_LIBS=$LIBS
8460 LIBS="-lgpm  $LIBS"
8461 cat >conftest.$ac_ext <<_ACEOF
8462 #line 8462 "configure"
8463 #include "confdefs.h"
8464
8465 /* Override any gcc2 internal prototype to avoid an error.  */
8466 #ifdef __cplusplus
8467 extern "C"
8468 #endif
8469 /* We use char because int might match the return type of a gcc2
8470    builtin and then its argument prototype would still apply.  */
8471 char initscr ();
8472 int
8473 main ()
8474 {
8475 initscr ();
8476   ;
8477   return 0;
8478 }
8479 _ACEOF
8480 rm -f conftest.$ac_objext conftest$ac_exeext
8481 if { (eval echo "$as_me:8481: \"$ac_link\"") >&5
8482   (eval $ac_link) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit $ac_status); } &&
8486          { ac_try='test -s conftest$ac_exeext'
8487   { (eval echo "$as_me:8487: \"$ac_try\"") >&5
8488   (eval $ac_try) 2>&5
8489   ac_status=$?
8490   echo "$as_me:8490: \$? = $ac_status" >&5
8491   (exit $ac_status); }; }; then
8492   ac_cv_lib_gpm_initscr=yes
8493 else
8494   echo "$as_me: failed program was:" >&5
8495 cat conftest.$ac_ext >&5
8496 ac_cv_lib_gpm_initscr=no
8497 fi
8498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8499 LIBS=$ac_check_lib_save_LIBS
8500 fi
8501 echo "$as_me:8501: result: $ac_cv_lib_gpm_initscr" >&5
8502 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8503 if test $ac_cv_lib_gpm_initscr = yes; then
8504   LIBS="$cf_ncurses_SAVE"
8505 else
8506   cf_ncurses_LIBS="-lgpm"
8507 fi
8508
8509 fi
8510
8511 case $host_os in
8512 (freebsd*)
8513         # This is only necessary if you are linking against an obsolete
8514         # version of ncurses (but it should do no harm, since it's static).
8515         if test "$cf_nculib_root" = ncurses ; then
8516                 echo "$as_me:8516: checking for tgoto in -lmytinfo" >&5
8517 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8518 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8519   echo $ECHO_N "(cached) $ECHO_C" >&6
8520 else
8521   ac_check_lib_save_LIBS=$LIBS
8522 LIBS="-lmytinfo  $LIBS"
8523 cat >conftest.$ac_ext <<_ACEOF
8524 #line 8524 "configure"
8525 #include "confdefs.h"
8526
8527 /* Override any gcc2 internal prototype to avoid an error.  */
8528 #ifdef __cplusplus
8529 extern "C"
8530 #endif
8531 /* We use char because int might match the return type of a gcc2
8532    builtin and then its argument prototype would still apply.  */
8533 char tgoto ();
8534 int
8535 main ()
8536 {
8537 tgoto ();
8538   ;
8539   return 0;
8540 }
8541 _ACEOF
8542 rm -f conftest.$ac_objext conftest$ac_exeext
8543 if { (eval echo "$as_me:8543: \"$ac_link\"") >&5
8544   (eval $ac_link) 2>&5
8545   ac_status=$?
8546   echo "$as_me:8546: \$? = $ac_status" >&5
8547   (exit $ac_status); } &&
8548          { ac_try='test -s conftest$ac_exeext'
8549   { (eval echo "$as_me:8549: \"$ac_try\"") >&5
8550   (eval $ac_try) 2>&5
8551   ac_status=$?
8552   echo "$as_me:8552: \$? = $ac_status" >&5
8553   (exit $ac_status); }; }; then
8554   ac_cv_lib_mytinfo_tgoto=yes
8555 else
8556   echo "$as_me: failed program was:" >&5
8557 cat conftest.$ac_ext >&5
8558 ac_cv_lib_mytinfo_tgoto=no
8559 fi
8560 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8561 LIBS=$ac_check_lib_save_LIBS
8562 fi
8563 echo "$as_me:8563: result: $ac_cv_lib_mytinfo_tgoto" >&5
8564 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8565 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8566   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8567 fi
8568
8569         fi
8570         ;;
8571 esac
8572
8573 cf_add_libs="$cf_ncurses_LIBS"
8574 # Filter out duplicates - this happens with badly-designed ".pc" files...
8575 for cf_add_1lib in $LIBS
8576 do
8577         for cf_add_2lib in $cf_add_libs
8578         do
8579                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8580                 then
8581                         cf_add_1lib=
8582                         break
8583                 fi
8584         done
8585         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8586 done
8587 LIBS="$cf_add_libs"
8588
8589 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8590 then
8591
8592 cf_add_libs="-l$cf_nculib_root"
8593 # Filter out duplicates - this happens with badly-designed ".pc" files...
8594 for cf_add_1lib in $LIBS
8595 do
8596         for cf_add_2lib in $cf_add_libs
8597         do
8598                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8599                 then
8600                         cf_add_1lib=
8601                         break
8602                 fi
8603         done
8604         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8605 done
8606 LIBS="$cf_add_libs"
8607
8608 else
8609
8610         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8611         cf_libdir=""
8612         echo "$as_me:8612: checking for initscr" >&5
8613 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8614 if test "${ac_cv_func_initscr+set}" = set; then
8615   echo $ECHO_N "(cached) $ECHO_C" >&6
8616 else
8617   cat >conftest.$ac_ext <<_ACEOF
8618 #line 8618 "configure"
8619 #include "confdefs.h"
8620 /* System header to define __stub macros and hopefully few prototypes,
8621     which can conflict with char initscr (); below.  */
8622 #include <assert.h>
8623 /* Override any gcc2 internal prototype to avoid an error.  */
8624 #ifdef __cplusplus
8625 extern "C"
8626 #endif
8627 /* We use char because int might match the return type of a gcc2
8628    builtin and then its argument prototype would still apply.  */
8629 char initscr ();
8630 char (*f) ();
8631
8632 int
8633 main ()
8634 {
8635 /* The GNU C library defines this for functions which it implements
8636     to always fail with ENOSYS.  Some functions are actually named
8637     something starting with __ and the normal name is an alias.  */
8638 #if defined (__stub_initscr) || defined (__stub___initscr)
8639 choke me
8640 #else
8641 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8642 #endif
8643
8644   ;
8645   return 0;
8646 }
8647 _ACEOF
8648 rm -f conftest.$ac_objext conftest$ac_exeext
8649 if { (eval echo "$as_me:8649: \"$ac_link\"") >&5
8650   (eval $ac_link) 2>&5
8651   ac_status=$?
8652   echo "$as_me:8652: \$? = $ac_status" >&5
8653   (exit $ac_status); } &&
8654          { ac_try='test -s conftest$ac_exeext'
8655   { (eval echo "$as_me:8655: \"$ac_try\"") >&5
8656   (eval $ac_try) 2>&5
8657   ac_status=$?
8658   echo "$as_me:8658: \$? = $ac_status" >&5
8659   (exit $ac_status); }; }; then
8660   ac_cv_func_initscr=yes
8661 else
8662   echo "$as_me: failed program was:" >&5
8663 cat conftest.$ac_ext >&5
8664 ac_cv_func_initscr=no
8665 fi
8666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8667 fi
8668 echo "$as_me:8668: result: $ac_cv_func_initscr" >&5
8669 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8670 if test $ac_cv_func_initscr = yes; then
8671   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8672 else
8673
8674                 cf_save_LIBS="$LIBS"
8675                 echo "$as_me:8675: checking for initscr in -l$cf_nculib_root" >&5
8676 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8677                 LIBS="-l$cf_nculib_root $LIBS"
8678                 cat >conftest.$ac_ext <<_ACEOF
8679 #line 8679 "configure"
8680 #include "confdefs.h"
8681 #include <${cf_cv_ncurses_header:-curses.h}>
8682 int
8683 main ()
8684 {
8685 initscr()
8686   ;
8687   return 0;
8688 }
8689 _ACEOF
8690 rm -f conftest.$ac_objext conftest$ac_exeext
8691 if { (eval echo "$as_me:8691: \"$ac_link\"") >&5
8692   (eval $ac_link) 2>&5
8693   ac_status=$?
8694   echo "$as_me:8694: \$? = $ac_status" >&5
8695   (exit $ac_status); } &&
8696          { ac_try='test -s conftest$ac_exeext'
8697   { (eval echo "$as_me:8697: \"$ac_try\"") >&5
8698   (eval $ac_try) 2>&5
8699   ac_status=$?
8700   echo "$as_me:8700: \$? = $ac_status" >&5
8701   (exit $ac_status); }; }; then
8702   echo "$as_me:8702: result: yes" >&5
8703 echo "${ECHO_T}yes" >&6
8704                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8705
8706 else
8707   echo "$as_me: failed program was:" >&5
8708 cat conftest.$ac_ext >&5
8709 echo "$as_me:8709: result: no" >&5
8710 echo "${ECHO_T}no" >&6
8711
8712 cf_search=
8713 cf_library_path_list=""
8714 if test -n "${LDFLAGS}${LIBS}" ; then
8715         for cf_library_path in $LDFLAGS $LIBS
8716         do
8717                 case $cf_library_path in
8718                 (-L*)
8719                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8720
8721 test "x$cf_library_path" != "xNONE" && \
8722 test -d "$cf_library_path" && \
8723  {
8724         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8725         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8726         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8727         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8728         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8729         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"
8730 }
8731
8732                         cf_library_path_list="$cf_library_path_list $cf_search"
8733                         ;;
8734                 esac
8735         done
8736 fi
8737
8738 cf_search=
8739
8740 test "x$prefix" != "xNONE" && \
8741 test -d "$prefix" && \
8742  {
8743         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8744         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8745         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8746         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8747         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8748         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8749 }
8750
8751 for cf_subdir_prefix in \
8752         /usr \
8753         /usr/local \
8754         /usr/pkg \
8755         /opt \
8756         /opt/local \
8757         $HOME
8758 do
8759
8760 test "x$cf_subdir_prefix" != "x$prefix" && \
8761 test -d "$cf_subdir_prefix" && \
8762 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8763         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8764         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8765         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8766         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8767         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8768         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"
8769 }
8770
8771 done
8772
8773 cf_search="$cf_library_path_list $cf_search"
8774
8775                         for cf_libdir in $cf_search
8776                         do
8777                                 echo "$as_me:8777: checking for -l$cf_nculib_root in $cf_libdir" >&5
8778 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8779                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8780                                 cat >conftest.$ac_ext <<_ACEOF
8781 #line 8781 "configure"
8782 #include "confdefs.h"
8783 #include <${cf_cv_ncurses_header:-curses.h}>
8784 int
8785 main ()
8786 {
8787 initscr()
8788   ;
8789   return 0;
8790 }
8791 _ACEOF
8792 rm -f conftest.$ac_objext conftest$ac_exeext
8793 if { (eval echo "$as_me:8793: \"$ac_link\"") >&5
8794   (eval $ac_link) 2>&5
8795   ac_status=$?
8796   echo "$as_me:8796: \$? = $ac_status" >&5
8797   (exit $ac_status); } &&
8798          { ac_try='test -s conftest$ac_exeext'
8799   { (eval echo "$as_me:8799: \"$ac_try\"") >&5
8800   (eval $ac_try) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); }; }; then
8804   echo "$as_me:8804: result: yes" >&5
8805 echo "${ECHO_T}yes" >&6
8806                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8807                                          break
8808 else
8809   echo "$as_me: failed program was:" >&5
8810 cat conftest.$ac_ext >&5
8811 echo "$as_me:8811: result: no" >&5
8812 echo "${ECHO_T}no" >&6
8813                                          LIBS="$cf_save_LIBS"
8814 fi
8815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8816                         done
8817
8818 fi
8819 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8820
8821 fi
8822
8823 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8824
8825 if test $cf_found_library = no ; then
8826         { { echo "$as_me:8826: error: Cannot link $cf_nculib_root library" >&5
8827 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8828    { (exit 1); exit 1; }; }
8829 fi
8830
8831 fi
8832
8833 if test -n "$cf_ncurses_LIBS" ; then
8834         echo "$as_me:8834: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8835 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8836         cf_ncurses_SAVE="$LIBS"
8837         for p in $cf_ncurses_LIBS ; do
8838                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8839                 if test "$q" != "$LIBS" ; then
8840                         LIBS="$q"
8841                 fi
8842         done
8843         cat >conftest.$ac_ext <<_ACEOF
8844 #line 8844 "configure"
8845 #include "confdefs.h"
8846 #include <${cf_cv_ncurses_header:-curses.h}>
8847 int
8848 main ()
8849 {
8850 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8851   ;
8852   return 0;
8853 }
8854 _ACEOF
8855 rm -f conftest.$ac_objext conftest$ac_exeext
8856 if { (eval echo "$as_me:8856: \"$ac_link\"") >&5
8857   (eval $ac_link) 2>&5
8858   ac_status=$?
8859   echo "$as_me:8859: \$? = $ac_status" >&5
8860   (exit $ac_status); } &&
8861          { ac_try='test -s conftest$ac_exeext'
8862   { (eval echo "$as_me:8862: \"$ac_try\"") >&5
8863   (eval $ac_try) 2>&5
8864   ac_status=$?
8865   echo "$as_me:8865: \$? = $ac_status" >&5
8866   (exit $ac_status); }; }; then
8867   echo "$as_me:8867: result: yes" >&5
8868 echo "${ECHO_T}yes" >&6
8869 else
8870   echo "$as_me: failed program was:" >&5
8871 cat conftest.$ac_ext >&5
8872 echo "$as_me:8872: result: no" >&5
8873 echo "${ECHO_T}no" >&6
8874                  LIBS="$cf_ncurses_SAVE"
8875 fi
8876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8877 fi
8878
8879 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8880
8881 cat >>confdefs.h <<EOF
8882 #define $cf_nculib_ROOT 1
8883 EOF
8884
8885         fi
8886 else
8887         NCURSES_CONFIG=none
8888 fi
8889
8890 fi
8891
8892 if test "$NCURSES_CONFIG_PKG" != none ; then
8893         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8894
8895         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8896         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8897         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8898
8899         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8900         if test -z "$cf_cv_abi_version"
8901         then
8902                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8903         fi
8904
8905 elif test "$NCURSES_CONFIG" != none ; then
8906
8907         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8908
8909         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8910         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8911         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8912
8913         # ABI version is not available from headers
8914         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8915
8916 else
8917
8918         for cf_name in MAJOR MINOR PATCH
8919         do
8920         cat >conftest.$ac_ext <<CF_EOF
8921         #include <${cf_cv_ncurses_header:-curses.h}>
8922         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8923 CF_EOF
8924                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8925                 { (eval echo "$as_me:8925: \"$cf_try\"") >&5
8926   (eval $cf_try) 2>&5
8927   ac_status=$?
8928   echo "$as_me:8928: \$? = $ac_status" >&5
8929   (exit $ac_status); }
8930                 if test -f conftest.out ; then
8931                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8932                         eval NCURSES_$cf_name=\"$cf_result\"
8933                         # cat conftest.$ac_ext
8934                         # cat conftest.out
8935                 fi
8936         done
8937
8938         cf_cv_abi_version=${NCURSES_MAJOR}
8939
8940 fi
8941
8942 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8943
8944 cf_cv_timestamp=`date`
8945
8946 echo "$as_me:8946: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8947 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8948
8949 echo "$as_me:8949: checking if you want to have a library-prefix" >&5
8950 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8951
8952 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8953 if test "${with_lib_prefix+set}" = set; then
8954   withval="$with_lib_prefix"
8955   with_lib_prefix=$withval
8956 else
8957   with_lib_prefix=auto
8958 fi;
8959 echo "$as_me:8959: result: $with_lib_prefix" >&5
8960 echo "${ECHO_T}$with_lib_prefix" >&6
8961
8962 if test $with_lib_prefix = auto
8963 then
8964
8965         case $cf_cv_system_name in
8966         (OS/2*|os2*)
8967                 if test "$DFT_LWR_MODEL" = libtool; then
8968                         LIB_PREFIX='lib'
8969                 else
8970                         LIB_PREFIX=''
8971                 fi
8972                 ;;
8973         (*)     LIB_PREFIX='lib'
8974                 ;;
8975         esac
8976 cf_prefix=$LIB_PREFIX
8977
8978 elif test $with_lib_prefix = no
8979 then
8980         LIB_PREFIX=
8981 else
8982         LIB_PREFIX=$with_lib_prefix
8983 fi
8984
8985 LIB_SUFFIX=
8986
8987 ###############################################################################
8988
8989 if test X"$CC_G_OPT" = X"" ; then
8990         CC_G_OPT='-g'
8991         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8992 fi
8993
8994 echo "$as_me:8994: checking for default loader flags" >&5
8995 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8996 case $DFT_LWR_MODEL in
8997 (normal)  LD_MODEL=''   ;;
8998 (debug)   LD_MODEL=$CC_G_OPT ;;
8999 (profile) LD_MODEL='-pg';;
9000 (shared)  LD_MODEL=''   ;;
9001 esac
9002 echo "$as_me:9002: result: $LD_MODEL" >&5
9003 echo "${ECHO_T}$LD_MODEL" >&6
9004
9005 LD_RPATH_OPT=
9006 echo "$as_me:9006: checking for an rpath option" >&5
9007 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9008 case $cf_cv_system_name in
9009 (irix*)
9010         if test "$GCC" = yes; then
9011                 LD_RPATH_OPT="-Wl,-rpath,"
9012         else
9013                 LD_RPATH_OPT="-rpath "
9014         fi
9015         ;;
9016 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9017         LD_RPATH_OPT="-Wl,-rpath,"
9018         ;;
9019 (openbsd[2-9].*|mirbsd*)
9020         LD_RPATH_OPT="-Wl,-rpath,"
9021         ;;
9022 (dragonfly*)
9023         LD_RPATH_OPT="-rpath "
9024         ;;
9025 (netbsd*)
9026         LD_RPATH_OPT="-Wl,-rpath,"
9027         ;;
9028 (osf*|mls+*)
9029         LD_RPATH_OPT="-rpath "
9030         ;;
9031 (solaris2*)
9032         LD_RPATH_OPT="-R"
9033         ;;
9034 (*)
9035         ;;
9036 esac
9037 echo "$as_me:9037: result: $LD_RPATH_OPT" >&5
9038 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9039
9040 case "x$LD_RPATH_OPT" in
9041 (x-R*)
9042         echo "$as_me:9042: checking if we need a space after rpath option" >&5
9043 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9044         cf_save_LIBS="$LIBS"
9045
9046 cf_add_libs="${LD_RPATH_OPT}$libdir"
9047 # Filter out duplicates - this happens with badly-designed ".pc" files...
9048 for cf_add_1lib in $LIBS
9049 do
9050         for cf_add_2lib in $cf_add_libs
9051         do
9052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9053                 then
9054                         cf_add_1lib=
9055                         break
9056                 fi
9057         done
9058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9059 done
9060 LIBS="$cf_add_libs"
9061
9062         cat >conftest.$ac_ext <<_ACEOF
9063 #line 9063 "configure"
9064 #include "confdefs.h"
9065
9066 int
9067 main ()
9068 {
9069
9070   ;
9071   return 0;
9072 }
9073 _ACEOF
9074 rm -f conftest.$ac_objext conftest$ac_exeext
9075 if { (eval echo "$as_me:9075: \"$ac_link\"") >&5
9076   (eval $ac_link) 2>&5
9077   ac_status=$?
9078   echo "$as_me:9078: \$? = $ac_status" >&5
9079   (exit $ac_status); } &&
9080          { ac_try='test -s conftest$ac_exeext'
9081   { (eval echo "$as_me:9081: \"$ac_try\"") >&5
9082   (eval $ac_try) 2>&5
9083   ac_status=$?
9084   echo "$as_me:9084: \$? = $ac_status" >&5
9085   (exit $ac_status); }; }; then
9086   cf_rpath_space=no
9087 else
9088   echo "$as_me: failed program was:" >&5
9089 cat conftest.$ac_ext >&5
9090 cf_rpath_space=yes
9091 fi
9092 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9093         LIBS="$cf_save_LIBS"
9094         echo "$as_me:9094: result: $cf_rpath_space" >&5
9095 echo "${ECHO_T}$cf_rpath_space" >&6
9096         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9097         ;;
9098 esac
9099
9100         RM_SHARED_OPTS=
9101         LOCAL_LDFLAGS=
9102         LOCAL_LDFLAGS2=
9103         LD_SHARED_OPTS=
9104         INSTALL_LIB="-m 644"
9105         : ${rel_builddir:=.}
9106
9107         shlibdir=$libdir
9108
9109         MAKE_DLLS="#"
9110
9111         cf_cv_do_symlinks=no
9112         cf_ld_rpath_opt=
9113         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9114
9115         echo "$as_me:9115: checking if release/abi version should be used for shared libs" >&5
9116 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9117
9118 # Check whether --with-shlib-version or --without-shlib-version was given.
9119 if test "${with_shlib_version+set}" = set; then
9120   withval="$with_shlib_version"
9121   test -z "$withval" && withval=auto
9122         case $withval in
9123         (yes)
9124                 cf_cv_shlib_version=auto
9125                 ;;
9126         (rel|abi|auto)
9127                 cf_cv_shlib_version=$withval
9128                 ;;
9129         (*)
9130                 echo "$as_me:9130: result: $withval" >&5
9131 echo "${ECHO_T}$withval" >&6
9132                 { { echo "$as_me:9132: error: option value must be one of: rel, abi, or auto" >&5
9133 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9134    { (exit 1); exit 1; }; }
9135                 ;;
9136         esac
9137
9138 else
9139   cf_cv_shlib_version=auto
9140 fi;
9141         echo "$as_me:9141: result: $cf_cv_shlib_version" >&5
9142 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9143
9144         cf_cv_rm_so_locs=no
9145         cf_try_cflags=
9146
9147         # Some less-capable ports of gcc support only -fpic
9148         CC_SHARED_OPTS=
9149         if test "$GCC" = yes
9150         then
9151                 echo "$as_me:9151: checking which $CC option to use" >&5
9152 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9153                 cf_save_CFLAGS="$CFLAGS"
9154                 for CC_SHARED_OPTS in -fPIC -fpic ''
9155                 do
9156                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9157                         cat >conftest.$ac_ext <<_ACEOF
9158 #line 9158 "configure"
9159 #include "confdefs.h"
9160 #include <stdio.h>
9161 int
9162 main ()
9163 {
9164 int x = 1
9165   ;
9166   return 0;
9167 }
9168 _ACEOF
9169 rm -f conftest.$ac_objext
9170 if { (eval echo "$as_me:9170: \"$ac_compile\"") >&5
9171   (eval $ac_compile) 2>&5
9172   ac_status=$?
9173   echo "$as_me:9173: \$? = $ac_status" >&5
9174   (exit $ac_status); } &&
9175          { ac_try='test -s conftest.$ac_objext'
9176   { (eval echo "$as_me:9176: \"$ac_try\"") >&5
9177   (eval $ac_try) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); }; }; then
9181   break
9182 else
9183   echo "$as_me: failed program was:" >&5
9184 cat conftest.$ac_ext >&5
9185 fi
9186 rm -f conftest.$ac_objext conftest.$ac_ext
9187                 done
9188                 echo "$as_me:9188: result: $CC_SHARED_OPTS" >&5
9189 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9190                 CFLAGS="$cf_save_CFLAGS"
9191         fi
9192
9193         cf_cv_shlib_version_infix=no
9194
9195         case $cf_cv_system_name in
9196         (aix4.3-9*|aix[5-7]*)
9197                 if test "$GCC" = yes; then
9198                         CC_SHARED_OPTS='-Wl,-brtl'
9199                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9200                 else
9201                         CC_SHARED_OPTS='-brtl'
9202                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9203                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9204                 fi
9205                 ;;
9206         (beos*)
9207                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9208                 ;;
9209         (cygwin*)
9210                 CC_SHARED_OPTS=
9211                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9212                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9213                 cf_cv_shlib_version=cygdll
9214                 cf_cv_shlib_version_infix=cygdll
9215                 shlibdir=$bindir
9216                 MAKE_DLLS=
9217                 cat >mk_shared_lib.sh <<-CF_EOF
9218                 #!$SHELL
9219                 SHARED_LIB=\$1
9220                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9221                 shift
9222                 cat <<-EOF
9223                 Linking shared library
9224                 ** SHARED_LIB \$SHARED_LIB
9225                 ** IMPORT_LIB \$IMPORT_LIB
9226 EOF
9227                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9228 CF_EOF
9229                 chmod +x mk_shared_lib.sh
9230                 ;;
9231         (msys*)
9232                 CC_SHARED_OPTS=
9233                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9234                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9235                 cf_cv_shlib_version=msysdll
9236                 cf_cv_shlib_version_infix=msysdll
9237                 shlibdir=$bindir
9238                 MAKE_DLLS=
9239                 cat >mk_shared_lib.sh <<-CF_EOF
9240                 #!$SHELL
9241                 SHARED_LIB=\$1
9242                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9243                 shift
9244                 cat <<-EOF
9245                 Linking shared library
9246                 ** SHARED_LIB \$SHARED_LIB
9247                 ** IMPORT_LIB \$IMPORT_LIB
9248 EOF
9249                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9250 CF_EOF
9251                 chmod +x mk_shared_lib.sh
9252                 ;;
9253         (darwin*)
9254                 cf_try_cflags="no-cpp-precomp"
9255                 CC_SHARED_OPTS="-dynamic"
9256                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9257                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9258                 cf_cv_shlib_version_infix=yes
9259                 echo "$as_me:9259: checking if ld -search_paths_first works" >&5
9260 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9261 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9262   echo $ECHO_N "(cached) $ECHO_C" >&6
9263 else
9264
9265                         cf_save_LDFLAGS=$LDFLAGS
9266                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9267                         cat >conftest.$ac_ext <<_ACEOF
9268 #line 9268 "configure"
9269 #include "confdefs.h"
9270
9271 int
9272 main ()
9273 {
9274 int i;
9275   ;
9276   return 0;
9277 }
9278 _ACEOF
9279 rm -f conftest.$ac_objext conftest$ac_exeext
9280 if { (eval echo "$as_me:9280: \"$ac_link\"") >&5
9281   (eval $ac_link) 2>&5
9282   ac_status=$?
9283   echo "$as_me:9283: \$? = $ac_status" >&5
9284   (exit $ac_status); } &&
9285          { ac_try='test -s conftest$ac_exeext'
9286   { (eval echo "$as_me:9286: \"$ac_try\"") >&5
9287   (eval $ac_try) 2>&5
9288   ac_status=$?
9289   echo "$as_me:9289: \$? = $ac_status" >&5
9290   (exit $ac_status); }; }; then
9291   cf_cv_ldflags_search_paths_first=yes
9292 else
9293   echo "$as_me: failed program was:" >&5
9294 cat conftest.$ac_ext >&5
9295 cf_cv_ldflags_search_paths_first=no
9296 fi
9297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9298                                 LDFLAGS=$cf_save_LDFLAGS
9299 fi
9300 echo "$as_me:9300: result: $cf_cv_ldflags_search_paths_first" >&5
9301 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9302                 if test $cf_cv_ldflags_search_paths_first = yes; then
9303                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9304                 fi
9305                 ;;
9306         (hpux[7-8]*)
9307                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9308                 if test "$GCC" != yes; then
9309                         CC_SHARED_OPTS='+Z'
9310                 fi
9311                 MK_SHARED_LIB='${LD} -b -o $@'
9312                 INSTALL_LIB="-m 555"
9313                 ;;
9314         (hpux*)
9315                 # (tested with gcc 2.7.2 -- I don't have c89)
9316                 if test "$GCC" = yes; then
9317                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9318                 else
9319                         CC_SHARED_OPTS='+Z'
9320                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9321                 fi
9322                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9323                 # HP-UX shared libraries must be executable, and should be
9324                 # readonly to exploit a quirk in the memory manager.
9325                 INSTALL_LIB="-m 555"
9326                 ;;
9327         (interix*)
9328                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9329                 if test "$cf_cv_shlib_version" = rel; then
9330                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9331                 else
9332                         cf_shared_soname='`basename `'
9333                 fi
9334                 CC_SHARED_OPTS=
9335                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9336                 ;;
9337         (irix*)
9338                 if test "$cf_cv_enable_rpath" = yes ; then
9339                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9340                 fi
9341                 # tested with IRIX 5.2 and 'cc'.
9342                 if test "$GCC" != yes; then
9343                         CC_SHARED_OPTS='-KPIC'
9344                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9345                 else
9346                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9347                 fi
9348                 cf_cv_rm_so_locs=yes
9349                 ;;
9350         (linux*|gnu*|k*bsd*-gnu)
9351                 if test "$DFT_LWR_MODEL" = "shared" ; then
9352                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9353                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9354                 fi
9355                 if test "$cf_cv_enable_rpath" = yes ; then
9356                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9357                 fi
9358
9359         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9360         if test "$cf_cv_shlib_version" = rel; then
9361                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9362         else
9363                 cf_cv_shared_soname='`basename $@`'
9364         fi
9365
9366                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9367                 ;;
9368         (mingw*)
9369                 cf_cv_shlib_version=mingw
9370                 cf_cv_shlib_version_infix=mingw
9371                 shlibdir=$bindir
9372                 MAKE_DLLS=
9373                 if test "$DFT_LWR_MODEL" = "shared" ; then
9374                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9375                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9376                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9377                 fi
9378                 CC_SHARED_OPTS=
9379                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9380                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9381                 cat >mk_shared_lib.sh <<-CF_EOF
9382                 #!$SHELL
9383                 SHARED_LIB=\$1
9384                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9385                 shift
9386                 cat <<-EOF
9387                 Linking shared library
9388                 ** SHARED_LIB \$SHARED_LIB
9389                 ** IMPORT_LIB \$IMPORT_LIB
9390 EOF
9391                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9392 CF_EOF
9393                 chmod +x mk_shared_lib.sh
9394                 ;;
9395         (openbsd[2-9].*|mirbsd*)
9396                 if test "$DFT_LWR_MODEL" = "shared" ; then
9397                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9398                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9399                 fi
9400                 if test "$cf_cv_enable_rpath" = yes ; then
9401                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9402                 fi
9403                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9404
9405         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9406         if test "$cf_cv_shlib_version" = rel; then
9407                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9408         else
9409                 cf_cv_shared_soname='`basename $@`'
9410         fi
9411
9412                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9413                 ;;
9414         (nto-qnx*|openbsd*|freebsd[12].*)
9415                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9416                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9417                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9418                 ;;
9419         (dragonfly*|freebsd*)
9420                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9421                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9422                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9423                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9424                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9425                 fi
9426
9427         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9428         if test "$cf_cv_shlib_version" = rel; then
9429                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9430         else
9431                 cf_cv_shared_soname='`basename $@`'
9432         fi
9433
9434                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9435                 ;;
9436         (netbsd*)
9437                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9438                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9439                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9440                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9441                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9442                         if test "$cf_cv_shlib_version" = auto; then
9443                         if test -f /usr/libexec/ld.elf_so; then
9444                                 cf_cv_shlib_version=abi
9445                         else
9446                                 cf_cv_shlib_version=rel
9447                         fi
9448                         fi
9449
9450         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9451         if test "$cf_cv_shlib_version" = rel; then
9452                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9453         else
9454                 cf_cv_shared_soname='`basename $@`'
9455         fi
9456
9457                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9458                 else
9459                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9460                 fi
9461                 ;;
9462         (osf*|mls+*)
9463                 # tested with OSF/1 V3.2 and 'cc'
9464                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9465                 # link with shared libs).
9466                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9467                 case $host_os in
9468                 (osf4*)
9469                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9470                         ;;
9471                 esac
9472                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9473                 if test "$DFT_LWR_MODEL" = "shared" ; then
9474                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9475                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9476                 fi
9477                 cf_cv_rm_so_locs=yes
9478                 ;;
9479         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9480                 # tested with osr5.0.5
9481                 if test "$GCC" != yes; then
9482                         CC_SHARED_OPTS='-belf -KPIC'
9483                 fi
9484                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9485                 if test "$cf_cv_enable_rpath" = yes ; then
9486                         # only way is to set LD_RUN_PATH but no switch for it
9487                         RUN_PATH=$libdir
9488                 fi
9489                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9490                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9491                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9492                 ;;
9493         (sunos4*)
9494                 # tested with SunOS 4.1.1 and gcc 2.7.0
9495                 if test "$GCC" != yes; then
9496                         CC_SHARED_OPTS='-KPIC'
9497                 fi
9498                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9499                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9500                 ;;
9501         (solaris2*)
9502                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9503                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9504                 if test "$DFT_LWR_MODEL" = "shared" ; then
9505                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9506                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9507                 fi
9508                 if test "$cf_cv_enable_rpath" = yes ; then
9509                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9510                 fi
9511
9512         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9513         if test "$cf_cv_shlib_version" = rel; then
9514                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9515         else
9516                 cf_cv_shared_soname='`basename $@`'
9517         fi
9518
9519                 if test "$GCC" != yes; then
9520                         cf_save_CFLAGS="$CFLAGS"
9521                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9522                         do
9523                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9524                                 cat >conftest.$ac_ext <<_ACEOF
9525 #line 9525 "configure"
9526 #include "confdefs.h"
9527 #include <stdio.h>
9528 int
9529 main ()
9530 {
9531 printf("Hello\n");
9532   ;
9533   return 0;
9534 }
9535 _ACEOF
9536 rm -f conftest.$ac_objext
9537 if { (eval echo "$as_me:9537: \"$ac_compile\"") >&5
9538   (eval $ac_compile) 2>&5
9539   ac_status=$?
9540   echo "$as_me:9540: \$? = $ac_status" >&5
9541   (exit $ac_status); } &&
9542          { ac_try='test -s conftest.$ac_objext'
9543   { (eval echo "$as_me:9543: \"$ac_try\"") >&5
9544   (eval $ac_try) 2>&5
9545   ac_status=$?
9546   echo "$as_me:9546: \$? = $ac_status" >&5
9547   (exit $ac_status); }; }; then
9548   break
9549 else
9550   echo "$as_me: failed program was:" >&5
9551 cat conftest.$ac_ext >&5
9552 fi
9553 rm -f conftest.$ac_objext conftest.$ac_ext
9554                         done
9555                         CFLAGS="$cf_save_CFLAGS"
9556                         CC_SHARED_OPTS=$cf_shared_opts
9557                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9558                 else
9559                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9560                 fi
9561                 ;;
9562         (sysv5uw7*|unix_sv*)
9563                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9564                 if test "$GCC" != yes; then
9565                         CC_SHARED_OPTS='-KPIC'
9566                 fi
9567                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9568                 ;;
9569         (*)
9570                 CC_SHARED_OPTS='unknown'
9571                 MK_SHARED_LIB='echo unknown'
9572                 ;;
9573         esac
9574
9575         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9576         case "$cf_cv_shlib_version" in
9577         (rel|abi)
9578                 case "$MK_SHARED_LIB" in
9579                 (*'-o $@')
9580                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9581                         ;;
9582                 (*)
9583                         { echo "$as_me:9583: WARNING: ignored --with-shlib-version" >&5
9584 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9585                         ;;
9586                 esac
9587                 ;;
9588         esac
9589
9590         if test -n "$cf_try_cflags"
9591         then
9592 cat > conftest.$ac_ext <<EOF
9593 #line 9593 "${as_me:-configure}"
9594 #include <stdio.h>
9595 int main(int argc, char *argv[])
9596 {
9597         printf("hello\n");
9598         return (argv[argc-1] == 0) ;
9599 }
9600 EOF
9601                 cf_save_CFLAGS="$CFLAGS"
9602                 for cf_opt in $cf_try_cflags
9603                 do
9604                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9605                         echo "$as_me:9605: checking if CFLAGS option -$cf_opt works" >&5
9606 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9607                         if { (eval echo "$as_me:9607: \"$ac_compile\"") >&5
9608   (eval $ac_compile) 2>&5
9609   ac_status=$?
9610   echo "$as_me:9610: \$? = $ac_status" >&5
9611   (exit $ac_status); }; then
9612                                 echo "$as_me:9612: result: yes" >&5
9613 echo "${ECHO_T}yes" >&6
9614                                 cf_save_CFLAGS="$CFLAGS"
9615                         else
9616                                 echo "$as_me:9616: result: no" >&5
9617 echo "${ECHO_T}no" >&6
9618                         fi
9619                 done
9620                 CFLAGS="$cf_save_CFLAGS"
9621         fi
9622
9623         # RPATH_LIST is a colon-separated list of directories
9624         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9625         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9626
9627         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9628
9629         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9630
9631 echo "${as_me:-configure}:9631: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9632
9633         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9634
9635 echo "${as_me:-configure}:9635: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9636
9637 # The test/sample programs in the original tree link using rpath option.
9638 # Make it optional for packagers.
9639 if test -n "$LOCAL_LDFLAGS"
9640 then
9641         echo "$as_me:9641: checking if you want to link sample programs with rpath option" >&5
9642 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9643
9644 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9645 if test "${enable_rpath_link+set}" = set; then
9646   enableval="$enable_rpath_link"
9647   with_rpath_link=$enableval
9648 else
9649   with_rpath_link=yes
9650 fi;
9651         echo "$as_me:9651: result: $with_rpath_link" >&5
9652 echo "${ECHO_T}$with_rpath_link" >&6
9653         if test "$with_rpath_link" = no
9654         then
9655                 LOCAL_LDFLAGS=
9656                 LOCAL_LDFLAGS2=
9657         fi
9658 fi
9659
9660 ###############################################################################
9661
9662 ###   use option --enable-broken-linker to force on use of broken-linker support
9663 echo "$as_me:9663: checking if you want broken-linker support code" >&5
9664 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9665
9666 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9667 if test "${enable_broken_linker+set}" = set; then
9668   enableval="$enable_broken_linker"
9669   with_broken_linker=$enableval
9670 else
9671   with_broken_linker=${BROKEN_LINKER:-no}
9672 fi;
9673 echo "$as_me:9673: result: $with_broken_linker" >&5
9674 echo "${ECHO_T}$with_broken_linker" >&6
9675
9676 BROKEN_LINKER=0
9677 if test "$with_broken_linker" = yes ; then
9678         cat >>confdefs.h <<\EOF
9679 #define BROKEN_LINKER 1
9680 EOF
9681
9682         BROKEN_LINKER=1
9683 elif test "$DFT_LWR_MODEL" = shared ; then
9684         case $cf_cv_system_name in
9685         (cygwin*)
9686                 cat >>confdefs.h <<\EOF
9687 #define BROKEN_LINKER 1
9688 EOF
9689
9690                 BROKEN_LINKER=1
9691                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9692
9693 echo "${as_me:-configure}:9693: testing cygwin linker is broken anyway ..." 1>&5
9694
9695                 ;;
9696         esac
9697 fi
9698
9699 # Check to define _XOPEN_SOURCE "automatically"
9700
9701 cf_XOPEN_SOURCE=500
9702 cf_POSIX_C_SOURCE=199506L
9703 cf_xopen_source=
9704
9705 case $host_os in
9706 (aix[4-7]*)
9707         cf_xopen_source="-D_ALL_SOURCE"
9708         ;;
9709 (msys)
9710         cf_XOPEN_SOURCE=600
9711         ;;
9712 (darwin[0-8].*)
9713         cf_xopen_source="-D_APPLE_C_SOURCE"
9714         ;;
9715 (darwin*)
9716         cf_xopen_source="-D_DARWIN_C_SOURCE"
9717         cf_XOPEN_SOURCE=
9718         ;;
9719 (freebsd*|dragonfly*)
9720         # 5.x headers associate
9721         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9722         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9723         cf_POSIX_C_SOURCE=200112L
9724         cf_XOPEN_SOURCE=600
9725         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9726         ;;
9727 (hpux11*)
9728         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9729         ;;
9730 (hpux*)
9731         cf_xopen_source="-D_HPUX_SOURCE"
9732         ;;
9733 (irix[56].*)
9734         cf_xopen_source="-D_SGI_SOURCE"
9735         cf_XOPEN_SOURCE=
9736         ;;
9737 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
9738
9739 echo "$as_me:9739: checking if we must define _GNU_SOURCE" >&5
9740 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9741 if test "${cf_cv_gnu_source+set}" = set; then
9742   echo $ECHO_N "(cached) $ECHO_C" >&6
9743 else
9744
9745 cat >conftest.$ac_ext <<_ACEOF
9746 #line 9746 "configure"
9747 #include "confdefs.h"
9748 #include <sys/types.h>
9749 int
9750 main ()
9751 {
9752
9753 #ifndef _XOPEN_SOURCE
9754 make an error
9755 #endif
9756   ;
9757   return 0;
9758 }
9759 _ACEOF
9760 rm -f conftest.$ac_objext
9761 if { (eval echo "$as_me:9761: \"$ac_compile\"") >&5
9762   (eval $ac_compile) 2>&5
9763   ac_status=$?
9764   echo "$as_me:9764: \$? = $ac_status" >&5
9765   (exit $ac_status); } &&
9766          { ac_try='test -s conftest.$ac_objext'
9767   { (eval echo "$as_me:9767: \"$ac_try\"") >&5
9768   (eval $ac_try) 2>&5
9769   ac_status=$?
9770   echo "$as_me:9770: \$? = $ac_status" >&5
9771   (exit $ac_status); }; }; then
9772   cf_cv_gnu_source=no
9773 else
9774   echo "$as_me: failed program was:" >&5
9775 cat conftest.$ac_ext >&5
9776 cf_save="$CPPFLAGS"
9777          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9778          cat >conftest.$ac_ext <<_ACEOF
9779 #line 9779 "configure"
9780 #include "confdefs.h"
9781 #include <sys/types.h>
9782 int
9783 main ()
9784 {
9785
9786 #ifdef _XOPEN_SOURCE
9787 make an error
9788 #endif
9789   ;
9790   return 0;
9791 }
9792 _ACEOF
9793 rm -f conftest.$ac_objext
9794 if { (eval echo "$as_me:9794: \"$ac_compile\"") >&5
9795   (eval $ac_compile) 2>&5
9796   ac_status=$?
9797   echo "$as_me:9797: \$? = $ac_status" >&5
9798   (exit $ac_status); } &&
9799          { ac_try='test -s conftest.$ac_objext'
9800   { (eval echo "$as_me:9800: \"$ac_try\"") >&5
9801   (eval $ac_try) 2>&5
9802   ac_status=$?
9803   echo "$as_me:9803: \$? = $ac_status" >&5
9804   (exit $ac_status); }; }; then
9805   cf_cv_gnu_source=no
9806 else
9807   echo "$as_me: failed program was:" >&5
9808 cat conftest.$ac_ext >&5
9809 cf_cv_gnu_source=yes
9810 fi
9811 rm -f conftest.$ac_objext conftest.$ac_ext
9812         CPPFLAGS="$cf_save"
9813
9814 fi
9815 rm -f conftest.$ac_objext conftest.$ac_ext
9816
9817 fi
9818 echo "$as_me:9818: result: $cf_cv_gnu_source" >&5
9819 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9820
9821 if test "$cf_cv_gnu_source" = yes
9822 then
9823 echo "$as_me:9823: checking if we should also define _DEFAULT_SOURCE" >&5
9824 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
9825 if test "${cf_cv_default_source+set}" = set; then
9826   echo $ECHO_N "(cached) $ECHO_C" >&6
9827 else
9828
9829 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9830         cat >conftest.$ac_ext <<_ACEOF
9831 #line 9831 "configure"
9832 #include "confdefs.h"
9833 #include <sys/types.h>
9834 int
9835 main ()
9836 {
9837
9838 #ifdef _DEFAULT_SOURCE
9839 make an error
9840 #endif
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext
9846 if { (eval echo "$as_me:9846: \"$ac_compile\"") >&5
9847   (eval $ac_compile) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest.$ac_objext'
9852   { (eval echo "$as_me:9852: \"$ac_try\"") >&5
9853   (eval $ac_try) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); }; }; then
9857   cf_cv_default_source=no
9858 else
9859   echo "$as_me: failed program was:" >&5
9860 cat conftest.$ac_ext >&5
9861 cf_cv_default_source=yes
9862 fi
9863 rm -f conftest.$ac_objext conftest.$ac_ext
9864
9865 fi
9866 echo "$as_me:9866: result: $cf_cv_default_source" >&5
9867 echo "${ECHO_T}$cf_cv_default_source" >&6
9868 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
9869 fi
9870
9871         ;;
9872 (minix*)
9873         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9874         ;;
9875 (mirbsd*)
9876         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9877         cf_XOPEN_SOURCE=
9878
9879 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9880
9881 cf_save_CFLAGS="$CFLAGS"
9882 cf_save_CPPFLAGS="$CPPFLAGS"
9883
9884 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9885         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9886                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9887
9888 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9889         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9890                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9891
9892 echo "$as_me:9892: checking if we should define _POSIX_C_SOURCE" >&5
9893 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9894 if test "${cf_cv_posix_c_source+set}" = set; then
9895   echo $ECHO_N "(cached) $ECHO_C" >&6
9896 else
9897
9898 echo "${as_me:-configure}:9898: testing if the symbol is already defined go no further ..." 1>&5
9899
9900         cat >conftest.$ac_ext <<_ACEOF
9901 #line 9901 "configure"
9902 #include "confdefs.h"
9903 #include <sys/types.h>
9904 int
9905 main ()
9906 {
9907
9908 #ifndef _POSIX_C_SOURCE
9909 make an error
9910 #endif
9911   ;
9912   return 0;
9913 }
9914 _ACEOF
9915 rm -f conftest.$ac_objext
9916 if { (eval echo "$as_me:9916: \"$ac_compile\"") >&5
9917   (eval $ac_compile) 2>&5
9918   ac_status=$?
9919   echo "$as_me:9919: \$? = $ac_status" >&5
9920   (exit $ac_status); } &&
9921          { ac_try='test -s conftest.$ac_objext'
9922   { (eval echo "$as_me:9922: \"$ac_try\"") >&5
9923   (eval $ac_try) 2>&5
9924   ac_status=$?
9925   echo "$as_me:9925: \$? = $ac_status" >&5
9926   (exit $ac_status); }; }; then
9927   cf_cv_posix_c_source=no
9928 else
9929   echo "$as_me: failed program was:" >&5
9930 cat conftest.$ac_ext >&5
9931 cf_want_posix_source=no
9932          case .$cf_POSIX_C_SOURCE in
9933          (.[12]??*)
9934                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9935                 ;;
9936          (.2)
9937                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9938                 cf_want_posix_source=yes
9939                 ;;
9940          (.*)
9941                 cf_want_posix_source=yes
9942                 ;;
9943          esac
9944          if test "$cf_want_posix_source" = yes ; then
9945                 cat >conftest.$ac_ext <<_ACEOF
9946 #line 9946 "configure"
9947 #include "confdefs.h"
9948 #include <sys/types.h>
9949 int
9950 main ()
9951 {
9952
9953 #ifdef _POSIX_SOURCE
9954 make an error
9955 #endif
9956   ;
9957   return 0;
9958 }
9959 _ACEOF
9960 rm -f conftest.$ac_objext
9961 if { (eval echo "$as_me:9961: \"$ac_compile\"") >&5
9962   (eval $ac_compile) 2>&5
9963   ac_status=$?
9964   echo "$as_me:9964: \$? = $ac_status" >&5
9965   (exit $ac_status); } &&
9966          { ac_try='test -s conftest.$ac_objext'
9967   { (eval echo "$as_me:9967: \"$ac_try\"") >&5
9968   (eval $ac_try) 2>&5
9969   ac_status=$?
9970   echo "$as_me:9970: \$? = $ac_status" >&5
9971   (exit $ac_status); }; }; then
9972   :
9973 else
9974   echo "$as_me: failed program was:" >&5
9975 cat conftest.$ac_ext >&5
9976 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9977 fi
9978 rm -f conftest.$ac_objext conftest.$ac_ext
9979          fi
9980
9981 echo "${as_me:-configure}:9981: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9982
9983          CFLAGS="$cf_trim_CFLAGS"
9984          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9985
9986 echo "${as_me:-configure}:9986: testing if the second compile does not leave our definition intact error ..." 1>&5
9987
9988          cat >conftest.$ac_ext <<_ACEOF
9989 #line 9989 "configure"
9990 #include "confdefs.h"
9991 #include <sys/types.h>
9992 int
9993 main ()
9994 {
9995
9996 #ifndef _POSIX_C_SOURCE
9997 make an error
9998 #endif
9999   ;
10000   return 0;
10001 }
10002 _ACEOF
10003 rm -f conftest.$ac_objext
10004 if { (eval echo "$as_me:10004: \"$ac_compile\"") >&5
10005   (eval $ac_compile) 2>&5
10006   ac_status=$?
10007   echo "$as_me:10007: \$? = $ac_status" >&5
10008   (exit $ac_status); } &&
10009          { ac_try='test -s conftest.$ac_objext'
10010   { (eval echo "$as_me:10010: \"$ac_try\"") >&5
10011   (eval $ac_try) 2>&5
10012   ac_status=$?
10013   echo "$as_me:10013: \$? = $ac_status" >&5
10014   (exit $ac_status); }; }; then
10015   :
10016 else
10017   echo "$as_me: failed program was:" >&5
10018 cat conftest.$ac_ext >&5
10019 cf_cv_posix_c_source=no
10020 fi
10021 rm -f conftest.$ac_objext conftest.$ac_ext
10022          CFLAGS="$cf_save_CFLAGS"
10023          CPPFLAGS="$cf_save_CPPFLAGS"
10024
10025 fi
10026 rm -f conftest.$ac_objext conftest.$ac_ext
10027
10028 fi
10029 echo "$as_me:10029: result: $cf_cv_posix_c_source" >&5
10030 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10031
10032 if test "$cf_cv_posix_c_source" != no ; then
10033         CFLAGS="$cf_trim_CFLAGS"
10034         CPPFLAGS="$cf_trim_CPPFLAGS"
10035
10036 cf_fix_cppflags=no
10037 cf_new_cflags=
10038 cf_new_cppflags=
10039 cf_new_extra_cppflags=
10040
10041 for cf_add_cflags in $cf_cv_posix_c_source
10042 do
10043 case $cf_fix_cppflags in
10044 (no)
10045         case $cf_add_cflags in
10046         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10047                 case $cf_add_cflags in
10048                 (-D*)
10049                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10050
10051                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10052                                 && test -z "${cf_tst_cflags}" \
10053                                 && cf_fix_cppflags=yes
10054
10055                         if test $cf_fix_cppflags = yes ; then
10056                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10057                                 continue
10058                         elif test "${cf_tst_cflags}" = "\"'" ; then
10059                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10060                                 continue
10061                         fi
10062                         ;;
10063                 esac
10064                 case "$CPPFLAGS" in
10065                 (*$cf_add_cflags)
10066                         ;;
10067                 (*)
10068                         case $cf_add_cflags in
10069                         (-D*)
10070                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10071
10072 CPPFLAGS=`echo "$CPPFLAGS" | \
10073         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10074                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10075
10076                                 ;;
10077                         esac
10078                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10079                         ;;
10080                 esac
10081                 ;;
10082         (*)
10083                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10084                 ;;
10085         esac
10086         ;;
10087 (yes)
10088         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10089
10090         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10091
10092         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10093                 && test -z "${cf_tst_cflags}" \
10094                 && cf_fix_cppflags=no
10095         ;;
10096 esac
10097 done
10098
10099 if test -n "$cf_new_cflags" ; then
10100
10101         CFLAGS="$CFLAGS $cf_new_cflags"
10102 fi
10103
10104 if test -n "$cf_new_cppflags" ; then
10105
10106         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10107 fi
10108
10109 if test -n "$cf_new_extra_cppflags" ; then
10110
10111         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10112 fi
10113
10114 fi
10115
10116         ;;
10117 (netbsd*)
10118         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10119         ;;
10120 (openbsd[4-9]*)
10121         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10122         cf_xopen_source="-D_BSD_SOURCE"
10123         cf_XOPEN_SOURCE=600
10124         ;;
10125 (openbsd*)
10126         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10127         ;;
10128 (osf[45]*)
10129         cf_xopen_source="-D_OSF_SOURCE"
10130         ;;
10131 (nto-qnx*)
10132         cf_xopen_source="-D_QNX_SOURCE"
10133         ;;
10134 (sco*)
10135         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10136         ;;
10137 (solaris2.*)
10138         cf_xopen_source="-D__EXTENSIONS__"
10139         cf_cv_xopen_source=broken
10140         ;;
10141 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10142         cf_XOPEN_SOURCE=
10143         cf_POSIX_C_SOURCE=
10144         ;;
10145 (*)
10146
10147 echo "$as_me:10147: checking if we should define _XOPEN_SOURCE" >&5
10148 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10149 if test "${cf_cv_xopen_source+set}" = set; then
10150   echo $ECHO_N "(cached) $ECHO_C" >&6
10151 else
10152
10153         cat >conftest.$ac_ext <<_ACEOF
10154 #line 10154 "configure"
10155 #include "confdefs.h"
10156
10157 #include <stdlib.h>
10158 #include <string.h>
10159 #include <sys/types.h>
10160
10161 int
10162 main ()
10163 {
10164
10165 #ifndef _XOPEN_SOURCE
10166 make an error
10167 #endif
10168   ;
10169   return 0;
10170 }
10171 _ACEOF
10172 rm -f conftest.$ac_objext
10173 if { (eval echo "$as_me:10173: \"$ac_compile\"") >&5
10174   (eval $ac_compile) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); } &&
10178          { ac_try='test -s conftest.$ac_objext'
10179   { (eval echo "$as_me:10179: \"$ac_try\"") >&5
10180   (eval $ac_try) 2>&5
10181   ac_status=$?
10182   echo "$as_me:10182: \$? = $ac_status" >&5
10183   (exit $ac_status); }; }; then
10184   cf_cv_xopen_source=no
10185 else
10186   echo "$as_me: failed program was:" >&5
10187 cat conftest.$ac_ext >&5
10188 cf_save="$CPPFLAGS"
10189          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10190          cat >conftest.$ac_ext <<_ACEOF
10191 #line 10191 "configure"
10192 #include "confdefs.h"
10193
10194 #include <stdlib.h>
10195 #include <string.h>
10196 #include <sys/types.h>
10197
10198 int
10199 main ()
10200 {
10201
10202 #ifdef _XOPEN_SOURCE
10203 make an error
10204 #endif
10205   ;
10206   return 0;
10207 }
10208 _ACEOF
10209 rm -f conftest.$ac_objext
10210 if { (eval echo "$as_me:10210: \"$ac_compile\"") >&5
10211   (eval $ac_compile) 2>&5
10212   ac_status=$?
10213   echo "$as_me:10213: \$? = $ac_status" >&5
10214   (exit $ac_status); } &&
10215          { ac_try='test -s conftest.$ac_objext'
10216   { (eval echo "$as_me:10216: \"$ac_try\"") >&5
10217   (eval $ac_try) 2>&5
10218   ac_status=$?
10219   echo "$as_me:10219: \$? = $ac_status" >&5
10220   (exit $ac_status); }; }; then
10221   cf_cv_xopen_source=no
10222 else
10223   echo "$as_me: failed program was:" >&5
10224 cat conftest.$ac_ext >&5
10225 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10226 fi
10227 rm -f conftest.$ac_objext conftest.$ac_ext
10228         CPPFLAGS="$cf_save"
10229
10230 fi
10231 rm -f conftest.$ac_objext conftest.$ac_ext
10232
10233 fi
10234 echo "$as_me:10234: result: $cf_cv_xopen_source" >&5
10235 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10236
10237 if test "$cf_cv_xopen_source" != no ; then
10238
10239 CFLAGS=`echo "$CFLAGS" | \
10240         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10241                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10242
10243 CPPFLAGS=`echo "$CPPFLAGS" | \
10244         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10245                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10246
10247         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10248
10249 cf_fix_cppflags=no
10250 cf_new_cflags=
10251 cf_new_cppflags=
10252 cf_new_extra_cppflags=
10253
10254 for cf_add_cflags in $cf_temp_xopen_source
10255 do
10256 case $cf_fix_cppflags in
10257 (no)
10258         case $cf_add_cflags in
10259         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10260                 case $cf_add_cflags in
10261                 (-D*)
10262                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10263
10264                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10265                                 && test -z "${cf_tst_cflags}" \
10266                                 && cf_fix_cppflags=yes
10267
10268                         if test $cf_fix_cppflags = yes ; then
10269                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10270                                 continue
10271                         elif test "${cf_tst_cflags}" = "\"'" ; then
10272                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10273                                 continue
10274                         fi
10275                         ;;
10276                 esac
10277                 case "$CPPFLAGS" in
10278                 (*$cf_add_cflags)
10279                         ;;
10280                 (*)
10281                         case $cf_add_cflags in
10282                         (-D*)
10283                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10284
10285 CPPFLAGS=`echo "$CPPFLAGS" | \
10286         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10287                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10288
10289                                 ;;
10290                         esac
10291                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10292                         ;;
10293                 esac
10294                 ;;
10295         (*)
10296                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10297                 ;;
10298         esac
10299         ;;
10300 (yes)
10301         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10302
10303         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10304
10305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10306                 && test -z "${cf_tst_cflags}" \
10307                 && cf_fix_cppflags=no
10308         ;;
10309 esac
10310 done
10311
10312 if test -n "$cf_new_cflags" ; then
10313
10314         CFLAGS="$CFLAGS $cf_new_cflags"
10315 fi
10316
10317 if test -n "$cf_new_cppflags" ; then
10318
10319         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10320 fi
10321
10322 if test -n "$cf_new_extra_cppflags" ; then
10323
10324         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10325 fi
10326
10327 fi
10328
10329 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10330
10331 cf_save_CFLAGS="$CFLAGS"
10332 cf_save_CPPFLAGS="$CPPFLAGS"
10333
10334 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10335         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10336                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10337
10338 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10339         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10340                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10341
10342 echo "$as_me:10342: checking if we should define _POSIX_C_SOURCE" >&5
10343 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10344 if test "${cf_cv_posix_c_source+set}" = set; then
10345   echo $ECHO_N "(cached) $ECHO_C" >&6
10346 else
10347
10348 echo "${as_me:-configure}:10348: testing if the symbol is already defined go no further ..." 1>&5
10349
10350         cat >conftest.$ac_ext <<_ACEOF
10351 #line 10351 "configure"
10352 #include "confdefs.h"
10353 #include <sys/types.h>
10354 int
10355 main ()
10356 {
10357
10358 #ifndef _POSIX_C_SOURCE
10359 make an error
10360 #endif
10361   ;
10362   return 0;
10363 }
10364 _ACEOF
10365 rm -f conftest.$ac_objext
10366 if { (eval echo "$as_me:10366: \"$ac_compile\"") >&5
10367   (eval $ac_compile) 2>&5
10368   ac_status=$?
10369   echo "$as_me:10369: \$? = $ac_status" >&5
10370   (exit $ac_status); } &&
10371          { ac_try='test -s conftest.$ac_objext'
10372   { (eval echo "$as_me:10372: \"$ac_try\"") >&5
10373   (eval $ac_try) 2>&5
10374   ac_status=$?
10375   echo "$as_me:10375: \$? = $ac_status" >&5
10376   (exit $ac_status); }; }; then
10377   cf_cv_posix_c_source=no
10378 else
10379   echo "$as_me: failed program was:" >&5
10380 cat conftest.$ac_ext >&5
10381 cf_want_posix_source=no
10382          case .$cf_POSIX_C_SOURCE in
10383          (.[12]??*)
10384                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10385                 ;;
10386          (.2)
10387                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10388                 cf_want_posix_source=yes
10389                 ;;
10390          (.*)
10391                 cf_want_posix_source=yes
10392                 ;;
10393          esac
10394          if test "$cf_want_posix_source" = yes ; then
10395                 cat >conftest.$ac_ext <<_ACEOF
10396 #line 10396 "configure"
10397 #include "confdefs.h"
10398 #include <sys/types.h>
10399 int
10400 main ()
10401 {
10402
10403 #ifdef _POSIX_SOURCE
10404 make an error
10405 #endif
10406   ;
10407   return 0;
10408 }
10409 _ACEOF
10410 rm -f conftest.$ac_objext
10411 if { (eval echo "$as_me:10411: \"$ac_compile\"") >&5
10412   (eval $ac_compile) 2>&5
10413   ac_status=$?
10414   echo "$as_me:10414: \$? = $ac_status" >&5
10415   (exit $ac_status); } &&
10416          { ac_try='test -s conftest.$ac_objext'
10417   { (eval echo "$as_me:10417: \"$ac_try\"") >&5
10418   (eval $ac_try) 2>&5
10419   ac_status=$?
10420   echo "$as_me:10420: \$? = $ac_status" >&5
10421   (exit $ac_status); }; }; then
10422   :
10423 else
10424   echo "$as_me: failed program was:" >&5
10425 cat conftest.$ac_ext >&5
10426 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10427 fi
10428 rm -f conftest.$ac_objext conftest.$ac_ext
10429          fi
10430
10431 echo "${as_me:-configure}:10431: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10432
10433          CFLAGS="$cf_trim_CFLAGS"
10434          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10435
10436 echo "${as_me:-configure}:10436: testing if the second compile does not leave our definition intact error ..." 1>&5
10437
10438          cat >conftest.$ac_ext <<_ACEOF
10439 #line 10439 "configure"
10440 #include "confdefs.h"
10441 #include <sys/types.h>
10442 int
10443 main ()
10444 {
10445
10446 #ifndef _POSIX_C_SOURCE
10447 make an error
10448 #endif
10449   ;
10450   return 0;
10451 }
10452 _ACEOF
10453 rm -f conftest.$ac_objext
10454 if { (eval echo "$as_me:10454: \"$ac_compile\"") >&5
10455   (eval $ac_compile) 2>&5
10456   ac_status=$?
10457   echo "$as_me:10457: \$? = $ac_status" >&5
10458   (exit $ac_status); } &&
10459          { ac_try='test -s conftest.$ac_objext'
10460   { (eval echo "$as_me:10460: \"$ac_try\"") >&5
10461   (eval $ac_try) 2>&5
10462   ac_status=$?
10463   echo "$as_me:10463: \$? = $ac_status" >&5
10464   (exit $ac_status); }; }; then
10465   :
10466 else
10467   echo "$as_me: failed program was:" >&5
10468 cat conftest.$ac_ext >&5
10469 cf_cv_posix_c_source=no
10470 fi
10471 rm -f conftest.$ac_objext conftest.$ac_ext
10472          CFLAGS="$cf_save_CFLAGS"
10473          CPPFLAGS="$cf_save_CPPFLAGS"
10474
10475 fi
10476 rm -f conftest.$ac_objext conftest.$ac_ext
10477
10478 fi
10479 echo "$as_me:10479: result: $cf_cv_posix_c_source" >&5
10480 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10481
10482 if test "$cf_cv_posix_c_source" != no ; then
10483         CFLAGS="$cf_trim_CFLAGS"
10484         CPPFLAGS="$cf_trim_CPPFLAGS"
10485
10486 cf_fix_cppflags=no
10487 cf_new_cflags=
10488 cf_new_cppflags=
10489 cf_new_extra_cppflags=
10490
10491 for cf_add_cflags in $cf_cv_posix_c_source
10492 do
10493 case $cf_fix_cppflags in
10494 (no)
10495         case $cf_add_cflags in
10496         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10497                 case $cf_add_cflags in
10498                 (-D*)
10499                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10500
10501                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10502                                 && test -z "${cf_tst_cflags}" \
10503                                 && cf_fix_cppflags=yes
10504
10505                         if test $cf_fix_cppflags = yes ; then
10506                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10507                                 continue
10508                         elif test "${cf_tst_cflags}" = "\"'" ; then
10509                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10510                                 continue
10511                         fi
10512                         ;;
10513                 esac
10514                 case "$CPPFLAGS" in
10515                 (*$cf_add_cflags)
10516                         ;;
10517                 (*)
10518                         case $cf_add_cflags in
10519                         (-D*)
10520                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10521
10522 CPPFLAGS=`echo "$CPPFLAGS" | \
10523         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10524                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10525
10526                                 ;;
10527                         esac
10528                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10529                         ;;
10530                 esac
10531                 ;;
10532         (*)
10533                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10534                 ;;
10535         esac
10536         ;;
10537 (yes)
10538         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10539
10540         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10541
10542         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10543                 && test -z "${cf_tst_cflags}" \
10544                 && cf_fix_cppflags=no
10545         ;;
10546 esac
10547 done
10548
10549 if test -n "$cf_new_cflags" ; then
10550
10551         CFLAGS="$CFLAGS $cf_new_cflags"
10552 fi
10553
10554 if test -n "$cf_new_cppflags" ; then
10555
10556         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10557 fi
10558
10559 if test -n "$cf_new_extra_cppflags" ; then
10560
10561         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10562 fi
10563
10564 fi
10565
10566         ;;
10567 esac
10568
10569 if test -n "$cf_xopen_source" ; then
10570
10571 cf_fix_cppflags=no
10572 cf_new_cflags=
10573 cf_new_cppflags=
10574 cf_new_extra_cppflags=
10575
10576 for cf_add_cflags in $cf_xopen_source
10577 do
10578 case $cf_fix_cppflags in
10579 (no)
10580         case $cf_add_cflags in
10581         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10582                 case $cf_add_cflags in
10583                 (-D*)
10584                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10585
10586                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10587                                 && test -z "${cf_tst_cflags}" \
10588                                 && cf_fix_cppflags=yes
10589
10590                         if test $cf_fix_cppflags = yes ; then
10591                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10592                                 continue
10593                         elif test "${cf_tst_cflags}" = "\"'" ; then
10594                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10595                                 continue
10596                         fi
10597                         ;;
10598                 esac
10599                 case "$CPPFLAGS" in
10600                 (*$cf_add_cflags)
10601                         ;;
10602                 (*)
10603                         case $cf_add_cflags in
10604                         (-D*)
10605                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10606
10607 CPPFLAGS=`echo "$CPPFLAGS" | \
10608         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10609                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10610
10611                                 ;;
10612                         esac
10613                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10614                         ;;
10615                 esac
10616                 ;;
10617         (*)
10618                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10619                 ;;
10620         esac
10621         ;;
10622 (yes)
10623         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10624
10625         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10626
10627         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10628                 && test -z "${cf_tst_cflags}" \
10629                 && cf_fix_cppflags=no
10630         ;;
10631 esac
10632 done
10633
10634 if test -n "$cf_new_cflags" ; then
10635         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10636
10637 echo "${as_me:-configure}:10637: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10638
10639         CFLAGS="$CFLAGS $cf_new_cflags"
10640 fi
10641
10642 if test -n "$cf_new_cppflags" ; then
10643         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10644
10645 echo "${as_me:-configure}:10645: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10646
10647         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10648 fi
10649
10650 if test -n "$cf_new_extra_cppflags" ; then
10651         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10652
10653 echo "${as_me:-configure}:10653: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10654
10655         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10656 fi
10657
10658 fi
10659
10660 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10661         echo "$as_me:10661: checking if _XOPEN_SOURCE really is set" >&5
10662 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10663         cat >conftest.$ac_ext <<_ACEOF
10664 #line 10664 "configure"
10665 #include "confdefs.h"
10666 #include <stdlib.h>
10667 int
10668 main ()
10669 {
10670
10671 #ifndef _XOPEN_SOURCE
10672 make an error
10673 #endif
10674   ;
10675   return 0;
10676 }
10677 _ACEOF
10678 rm -f conftest.$ac_objext
10679 if { (eval echo "$as_me:10679: \"$ac_compile\"") >&5
10680   (eval $ac_compile) 2>&5
10681   ac_status=$?
10682   echo "$as_me:10682: \$? = $ac_status" >&5
10683   (exit $ac_status); } &&
10684          { ac_try='test -s conftest.$ac_objext'
10685   { (eval echo "$as_me:10685: \"$ac_try\"") >&5
10686   (eval $ac_try) 2>&5
10687   ac_status=$?
10688   echo "$as_me:10688: \$? = $ac_status" >&5
10689   (exit $ac_status); }; }; then
10690   cf_XOPEN_SOURCE_set=yes
10691 else
10692   echo "$as_me: failed program was:" >&5
10693 cat conftest.$ac_ext >&5
10694 cf_XOPEN_SOURCE_set=no
10695 fi
10696 rm -f conftest.$ac_objext conftest.$ac_ext
10697         echo "$as_me:10697: result: $cf_XOPEN_SOURCE_set" >&5
10698 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10699         if test $cf_XOPEN_SOURCE_set = yes
10700         then
10701                 cat >conftest.$ac_ext <<_ACEOF
10702 #line 10702 "configure"
10703 #include "confdefs.h"
10704 #include <stdlib.h>
10705 int
10706 main ()
10707 {
10708
10709 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10710 make an error
10711 #endif
10712   ;
10713   return 0;
10714 }
10715 _ACEOF
10716 rm -f conftest.$ac_objext
10717 if { (eval echo "$as_me:10717: \"$ac_compile\"") >&5
10718   (eval $ac_compile) 2>&5
10719   ac_status=$?
10720   echo "$as_me:10720: \$? = $ac_status" >&5
10721   (exit $ac_status); } &&
10722          { ac_try='test -s conftest.$ac_objext'
10723   { (eval echo "$as_me:10723: \"$ac_try\"") >&5
10724   (eval $ac_try) 2>&5
10725   ac_status=$?
10726   echo "$as_me:10726: \$? = $ac_status" >&5
10727   (exit $ac_status); }; }; then
10728   cf_XOPEN_SOURCE_set_ok=yes
10729 else
10730   echo "$as_me: failed program was:" >&5
10731 cat conftest.$ac_ext >&5
10732 cf_XOPEN_SOURCE_set_ok=no
10733 fi
10734 rm -f conftest.$ac_objext conftest.$ac_ext
10735                 if test $cf_XOPEN_SOURCE_set_ok = no
10736                 then
10737                         { echo "$as_me:10737: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10738 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10739                 fi
10740         else
10741
10742 echo "$as_me:10742: checking if we should define _XOPEN_SOURCE" >&5
10743 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10744 if test "${cf_cv_xopen_source+set}" = set; then
10745   echo $ECHO_N "(cached) $ECHO_C" >&6
10746 else
10747
10748         cat >conftest.$ac_ext <<_ACEOF
10749 #line 10749 "configure"
10750 #include "confdefs.h"
10751
10752 #include <stdlib.h>
10753 #include <string.h>
10754 #include <sys/types.h>
10755
10756 int
10757 main ()
10758 {
10759
10760 #ifndef _XOPEN_SOURCE
10761 make an error
10762 #endif
10763   ;
10764   return 0;
10765 }
10766 _ACEOF
10767 rm -f conftest.$ac_objext
10768 if { (eval echo "$as_me:10768: \"$ac_compile\"") >&5
10769   (eval $ac_compile) 2>&5
10770   ac_status=$?
10771   echo "$as_me:10771: \$? = $ac_status" >&5
10772   (exit $ac_status); } &&
10773          { ac_try='test -s conftest.$ac_objext'
10774   { (eval echo "$as_me:10774: \"$ac_try\"") >&5
10775   (eval $ac_try) 2>&5
10776   ac_status=$?
10777   echo "$as_me:10777: \$? = $ac_status" >&5
10778   (exit $ac_status); }; }; then
10779   cf_cv_xopen_source=no
10780 else
10781   echo "$as_me: failed program was:" >&5
10782 cat conftest.$ac_ext >&5
10783 cf_save="$CPPFLAGS"
10784          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10785          cat >conftest.$ac_ext <<_ACEOF
10786 #line 10786 "configure"
10787 #include "confdefs.h"
10788
10789 #include <stdlib.h>
10790 #include <string.h>
10791 #include <sys/types.h>
10792
10793 int
10794 main ()
10795 {
10796
10797 #ifdef _XOPEN_SOURCE
10798 make an error
10799 #endif
10800   ;
10801   return 0;
10802 }
10803 _ACEOF
10804 rm -f conftest.$ac_objext
10805 if { (eval echo "$as_me:10805: \"$ac_compile\"") >&5
10806   (eval $ac_compile) 2>&5
10807   ac_status=$?
10808   echo "$as_me:10808: \$? = $ac_status" >&5
10809   (exit $ac_status); } &&
10810          { ac_try='test -s conftest.$ac_objext'
10811   { (eval echo "$as_me:10811: \"$ac_try\"") >&5
10812   (eval $ac_try) 2>&5
10813   ac_status=$?
10814   echo "$as_me:10814: \$? = $ac_status" >&5
10815   (exit $ac_status); }; }; then
10816   cf_cv_xopen_source=no
10817 else
10818   echo "$as_me: failed program was:" >&5
10819 cat conftest.$ac_ext >&5
10820 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10821 fi
10822 rm -f conftest.$ac_objext conftest.$ac_ext
10823         CPPFLAGS="$cf_save"
10824
10825 fi
10826 rm -f conftest.$ac_objext conftest.$ac_ext
10827
10828 fi
10829 echo "$as_me:10829: result: $cf_cv_xopen_source" >&5
10830 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10831
10832 if test "$cf_cv_xopen_source" != no ; then
10833
10834 CFLAGS=`echo "$CFLAGS" | \
10835         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10836                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10837
10838 CPPFLAGS=`echo "$CPPFLAGS" | \
10839         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10840                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10841
10842         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10843
10844 cf_fix_cppflags=no
10845 cf_new_cflags=
10846 cf_new_cppflags=
10847 cf_new_extra_cppflags=
10848
10849 for cf_add_cflags in $cf_temp_xopen_source
10850 do
10851 case $cf_fix_cppflags in
10852 (no)
10853         case $cf_add_cflags in
10854         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10855                 case $cf_add_cflags in
10856                 (-D*)
10857                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10858
10859                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10860                                 && test -z "${cf_tst_cflags}" \
10861                                 && cf_fix_cppflags=yes
10862
10863                         if test $cf_fix_cppflags = yes ; then
10864                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10865                                 continue
10866                         elif test "${cf_tst_cflags}" = "\"'" ; then
10867                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10868                                 continue
10869                         fi
10870                         ;;
10871                 esac
10872                 case "$CPPFLAGS" in
10873                 (*$cf_add_cflags)
10874                         ;;
10875                 (*)
10876                         case $cf_add_cflags in
10877                         (-D*)
10878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10879
10880 CPPFLAGS=`echo "$CPPFLAGS" | \
10881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10883
10884                                 ;;
10885                         esac
10886                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10887                         ;;
10888                 esac
10889                 ;;
10890         (*)
10891                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10892                 ;;
10893         esac
10894         ;;
10895 (yes)
10896         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10897
10898         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10899
10900         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10901                 && test -z "${cf_tst_cflags}" \
10902                 && cf_fix_cppflags=no
10903         ;;
10904 esac
10905 done
10906
10907 if test -n "$cf_new_cflags" ; then
10908
10909         CFLAGS="$CFLAGS $cf_new_cflags"
10910 fi
10911
10912 if test -n "$cf_new_cppflags" ; then
10913
10914         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10915 fi
10916
10917 if test -n "$cf_new_extra_cppflags" ; then
10918
10919         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10920 fi
10921
10922 fi
10923
10924         fi
10925 fi
10926
10927 # Check whether --enable-largefile or --disable-largefile was given.
10928 if test "${enable_largefile+set}" = set; then
10929   enableval="$enable_largefile"
10930
10931 fi;
10932 if test "$enable_largefile" != no; then
10933
10934   echo "$as_me:10934: checking for special C compiler options needed for large files" >&5
10935 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10936 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10937   echo $ECHO_N "(cached) $ECHO_C" >&6
10938 else
10939   ac_cv_sys_largefile_CC=no
10940      if test "$GCC" != yes; then
10941        ac_save_CC=$CC
10942        while :; do
10943          # IRIX 6.2 and later do not support large files by default,
10944          # so use the C compiler's -n32 option if that helps.
10945          cat >conftest.$ac_ext <<_ACEOF
10946 #line 10946 "configure"
10947 #include "confdefs.h"
10948 #include <sys/types.h>
10949  /* Check that off_t can represent 2**63 - 1 correctly.
10950     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10951     since some C++ compilers masquerading as C compilers
10952     incorrectly reject 9223372036854775807.  */
10953 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10954   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10955                        && LARGE_OFF_T % 2147483647 == 1)
10956                       ? 1 : -1];
10957 int
10958 main ()
10959 {
10960
10961   ;
10962   return 0;
10963 }
10964 _ACEOF
10965          rm -f conftest.$ac_objext
10966 if { (eval echo "$as_me:10966: \"$ac_compile\"") >&5
10967   (eval $ac_compile) 2>&5
10968   ac_status=$?
10969   echo "$as_me:10969: \$? = $ac_status" >&5
10970   (exit $ac_status); } &&
10971          { ac_try='test -s conftest.$ac_objext'
10972   { (eval echo "$as_me:10972: \"$ac_try\"") >&5
10973   (eval $ac_try) 2>&5
10974   ac_status=$?
10975   echo "$as_me:10975: \$? = $ac_status" >&5
10976   (exit $ac_status); }; }; then
10977   break
10978 else
10979   echo "$as_me: failed program was:" >&5
10980 cat conftest.$ac_ext >&5
10981 fi
10982 rm -f conftest.$ac_objext
10983          CC="$CC -n32"
10984          rm -f conftest.$ac_objext
10985 if { (eval echo "$as_me:10985: \"$ac_compile\"") >&5
10986   (eval $ac_compile) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); } &&
10990          { ac_try='test -s conftest.$ac_objext'
10991   { (eval echo "$as_me:10991: \"$ac_try\"") >&5
10992   (eval $ac_try) 2>&5
10993   ac_status=$?
10994   echo "$as_me:10994: \$? = $ac_status" >&5
10995   (exit $ac_status); }; }; then
10996   ac_cv_sys_largefile_CC=' -n32'; break
10997 else
10998   echo "$as_me: failed program was:" >&5
10999 cat conftest.$ac_ext >&5
11000 fi
11001 rm -f conftest.$ac_objext
11002          break
11003        done
11004        CC=$ac_save_CC
11005        rm -f conftest.$ac_ext
11006     fi
11007 fi
11008 echo "$as_me:11008: result: $ac_cv_sys_largefile_CC" >&5
11009 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11010   if test "$ac_cv_sys_largefile_CC" != no; then
11011     CC=$CC$ac_cv_sys_largefile_CC
11012   fi
11013
11014   echo "$as_me:11014: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11015 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11016 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11017   echo $ECHO_N "(cached) $ECHO_C" >&6
11018 else
11019   while :; do
11020   ac_cv_sys_file_offset_bits=no
11021   cat >conftest.$ac_ext <<_ACEOF
11022 #line 11022 "configure"
11023 #include "confdefs.h"
11024 #include <sys/types.h>
11025  /* Check that off_t can represent 2**63 - 1 correctly.
11026     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11027     since some C++ compilers masquerading as C compilers
11028     incorrectly reject 9223372036854775807.  */
11029 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11030   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11031                        && LARGE_OFF_T % 2147483647 == 1)
11032                       ? 1 : -1];
11033 int
11034 main ()
11035 {
11036
11037   ;
11038   return 0;
11039 }
11040 _ACEOF
11041 rm -f conftest.$ac_objext
11042 if { (eval echo "$as_me:11042: \"$ac_compile\"") >&5
11043   (eval $ac_compile) 2>&5
11044   ac_status=$?
11045   echo "$as_me:11045: \$? = $ac_status" >&5
11046   (exit $ac_status); } &&
11047          { ac_try='test -s conftest.$ac_objext'
11048   { (eval echo "$as_me:11048: \"$ac_try\"") >&5
11049   (eval $ac_try) 2>&5
11050   ac_status=$?
11051   echo "$as_me:11051: \$? = $ac_status" >&5
11052   (exit $ac_status); }; }; then
11053   break
11054 else
11055   echo "$as_me: failed program was:" >&5
11056 cat conftest.$ac_ext >&5
11057 fi
11058 rm -f conftest.$ac_objext conftest.$ac_ext
11059   cat >conftest.$ac_ext <<_ACEOF
11060 #line 11060 "configure"
11061 #include "confdefs.h"
11062 #define _FILE_OFFSET_BITS 64
11063 #include <sys/types.h>
11064  /* Check that off_t can represent 2**63 - 1 correctly.
11065     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11066     since some C++ compilers masquerading as C compilers
11067     incorrectly reject 9223372036854775807.  */
11068 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11069   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11070                        && LARGE_OFF_T % 2147483647 == 1)
11071                       ? 1 : -1];
11072 int
11073 main ()
11074 {
11075
11076   ;
11077   return 0;
11078 }
11079 _ACEOF
11080 rm -f conftest.$ac_objext
11081 if { (eval echo "$as_me:11081: \"$ac_compile\"") >&5
11082   (eval $ac_compile) 2>&5
11083   ac_status=$?
11084   echo "$as_me:11084: \$? = $ac_status" >&5
11085   (exit $ac_status); } &&
11086          { ac_try='test -s conftest.$ac_objext'
11087   { (eval echo "$as_me:11087: \"$ac_try\"") >&5
11088   (eval $ac_try) 2>&5
11089   ac_status=$?
11090   echo "$as_me:11090: \$? = $ac_status" >&5
11091   (exit $ac_status); }; }; then
11092   ac_cv_sys_file_offset_bits=64; break
11093 else
11094   echo "$as_me: failed program was:" >&5
11095 cat conftest.$ac_ext >&5
11096 fi
11097 rm -f conftest.$ac_objext conftest.$ac_ext
11098   break
11099 done
11100 fi
11101 echo "$as_me:11101: result: $ac_cv_sys_file_offset_bits" >&5
11102 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11103 if test "$ac_cv_sys_file_offset_bits" != no; then
11104
11105 cat >>confdefs.h <<EOF
11106 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11107 EOF
11108
11109 fi
11110 rm -rf conftest*
11111   echo "$as_me:11111: checking for _LARGE_FILES value needed for large files" >&5
11112 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11113 if test "${ac_cv_sys_large_files+set}" = set; then
11114   echo $ECHO_N "(cached) $ECHO_C" >&6
11115 else
11116   while :; do
11117   ac_cv_sys_large_files=no
11118   cat >conftest.$ac_ext <<_ACEOF
11119 #line 11119 "configure"
11120 #include "confdefs.h"
11121 #include <sys/types.h>
11122  /* Check that off_t can represent 2**63 - 1 correctly.
11123     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11124     since some C++ compilers masquerading as C compilers
11125     incorrectly reject 9223372036854775807.  */
11126 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11127   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11128                        && LARGE_OFF_T % 2147483647 == 1)
11129                       ? 1 : -1];
11130 int
11131 main ()
11132 {
11133
11134   ;
11135   return 0;
11136 }
11137 _ACEOF
11138 rm -f conftest.$ac_objext
11139 if { (eval echo "$as_me:11139: \"$ac_compile\"") >&5
11140   (eval $ac_compile) 2>&5
11141   ac_status=$?
11142   echo "$as_me:11142: \$? = $ac_status" >&5
11143   (exit $ac_status); } &&
11144          { ac_try='test -s conftest.$ac_objext'
11145   { (eval echo "$as_me:11145: \"$ac_try\"") >&5
11146   (eval $ac_try) 2>&5
11147   ac_status=$?
11148   echo "$as_me:11148: \$? = $ac_status" >&5
11149   (exit $ac_status); }; }; then
11150   break
11151 else
11152   echo "$as_me: failed program was:" >&5
11153 cat conftest.$ac_ext >&5
11154 fi
11155 rm -f conftest.$ac_objext conftest.$ac_ext
11156   cat >conftest.$ac_ext <<_ACEOF
11157 #line 11157 "configure"
11158 #include "confdefs.h"
11159 #define _LARGE_FILES 1
11160 #include <sys/types.h>
11161  /* Check that off_t can represent 2**63 - 1 correctly.
11162     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11163     since some C++ compilers masquerading as C compilers
11164     incorrectly reject 9223372036854775807.  */
11165 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11166   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11167                        && LARGE_OFF_T % 2147483647 == 1)
11168                       ? 1 : -1];
11169 int
11170 main ()
11171 {
11172
11173   ;
11174   return 0;
11175 }
11176 _ACEOF
11177 rm -f conftest.$ac_objext
11178 if { (eval echo "$as_me:11178: \"$ac_compile\"") >&5
11179   (eval $ac_compile) 2>&5
11180   ac_status=$?
11181   echo "$as_me:11181: \$? = $ac_status" >&5
11182   (exit $ac_status); } &&
11183          { ac_try='test -s conftest.$ac_objext'
11184   { (eval echo "$as_me:11184: \"$ac_try\"") >&5
11185   (eval $ac_try) 2>&5
11186   ac_status=$?
11187   echo "$as_me:11187: \$? = $ac_status" >&5
11188   (exit $ac_status); }; }; then
11189   ac_cv_sys_large_files=1; break
11190 else
11191   echo "$as_me: failed program was:" >&5
11192 cat conftest.$ac_ext >&5
11193 fi
11194 rm -f conftest.$ac_objext conftest.$ac_ext
11195   break
11196 done
11197 fi
11198 echo "$as_me:11198: result: $ac_cv_sys_large_files" >&5
11199 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11200 if test "$ac_cv_sys_large_files" != no; then
11201
11202 cat >>confdefs.h <<EOF
11203 #define _LARGE_FILES $ac_cv_sys_large_files
11204 EOF
11205
11206 fi
11207 rm -rf conftest*
11208 fi
11209
11210         if test "$enable_largefile" != no ; then
11211         echo "$as_me:11211: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11212 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11213 if test "${ac_cv_sys_largefile_source+set}" = set; then
11214   echo $ECHO_N "(cached) $ECHO_C" >&6
11215 else
11216   while :; do
11217   ac_cv_sys_largefile_source=no
11218   cat >conftest.$ac_ext <<_ACEOF
11219 #line 11219 "configure"
11220 #include "confdefs.h"
11221 #include <stdio.h>
11222 int
11223 main ()
11224 {
11225 return !fseeko;
11226   ;
11227   return 0;
11228 }
11229 _ACEOF
11230 rm -f conftest.$ac_objext
11231 if { (eval echo "$as_me:11231: \"$ac_compile\"") >&5
11232   (eval $ac_compile) 2>&5
11233   ac_status=$?
11234   echo "$as_me:11234: \$? = $ac_status" >&5
11235   (exit $ac_status); } &&
11236          { ac_try='test -s conftest.$ac_objext'
11237   { (eval echo "$as_me:11237: \"$ac_try\"") >&5
11238   (eval $ac_try) 2>&5
11239   ac_status=$?
11240   echo "$as_me:11240: \$? = $ac_status" >&5
11241   (exit $ac_status); }; }; then
11242   break
11243 else
11244   echo "$as_me: failed program was:" >&5
11245 cat conftest.$ac_ext >&5
11246 fi
11247 rm -f conftest.$ac_objext conftest.$ac_ext
11248   cat >conftest.$ac_ext <<_ACEOF
11249 #line 11249 "configure"
11250 #include "confdefs.h"
11251 #define _LARGEFILE_SOURCE 1
11252 #include <stdio.h>
11253 int
11254 main ()
11255 {
11256 return !fseeko;
11257   ;
11258   return 0;
11259 }
11260 _ACEOF
11261 rm -f conftest.$ac_objext
11262 if { (eval echo "$as_me:11262: \"$ac_compile\"") >&5
11263   (eval $ac_compile) 2>&5
11264   ac_status=$?
11265   echo "$as_me:11265: \$? = $ac_status" >&5
11266   (exit $ac_status); } &&
11267          { ac_try='test -s conftest.$ac_objext'
11268   { (eval echo "$as_me:11268: \"$ac_try\"") >&5
11269   (eval $ac_try) 2>&5
11270   ac_status=$?
11271   echo "$as_me:11271: \$? = $ac_status" >&5
11272   (exit $ac_status); }; }; then
11273   ac_cv_sys_largefile_source=1; break
11274 else
11275   echo "$as_me: failed program was:" >&5
11276 cat conftest.$ac_ext >&5
11277 fi
11278 rm -f conftest.$ac_objext conftest.$ac_ext
11279   break
11280 done
11281 fi
11282 echo "$as_me:11282: result: $ac_cv_sys_largefile_source" >&5
11283 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11284 if test "$ac_cv_sys_largefile_source" != no; then
11285
11286 cat >>confdefs.h <<EOF
11287 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11288 EOF
11289
11290 fi
11291 rm -rf conftest*
11292
11293 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11294 # in glibc 2.1.3, but that breaks too many other things.
11295 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11296 echo "$as_me:11296: checking for fseeko" >&5
11297 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11298 if test "${ac_cv_func_fseeko+set}" = set; then
11299   echo $ECHO_N "(cached) $ECHO_C" >&6
11300 else
11301   cat >conftest.$ac_ext <<_ACEOF
11302 #line 11302 "configure"
11303 #include "confdefs.h"
11304 #include <stdio.h>
11305 int
11306 main ()
11307 {
11308 return fseeko && fseeko (stdin, 0, 0);
11309   ;
11310   return 0;
11311 }
11312 _ACEOF
11313 rm -f conftest.$ac_objext conftest$ac_exeext
11314 if { (eval echo "$as_me:11314: \"$ac_link\"") >&5
11315   (eval $ac_link) 2>&5
11316   ac_status=$?
11317   echo "$as_me:11317: \$? = $ac_status" >&5
11318   (exit $ac_status); } &&
11319          { ac_try='test -s conftest$ac_exeext'
11320   { (eval echo "$as_me:11320: \"$ac_try\"") >&5
11321   (eval $ac_try) 2>&5
11322   ac_status=$?
11323   echo "$as_me:11323: \$? = $ac_status" >&5
11324   (exit $ac_status); }; }; then
11325   ac_cv_func_fseeko=yes
11326 else
11327   echo "$as_me: failed program was:" >&5
11328 cat conftest.$ac_ext >&5
11329 ac_cv_func_fseeko=no
11330 fi
11331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11332 fi
11333 echo "$as_me:11333: result: $ac_cv_func_fseeko" >&5
11334 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11335 if test $ac_cv_func_fseeko = yes; then
11336
11337 cat >>confdefs.h <<\EOF
11338 #define HAVE_FSEEKO 1
11339 EOF
11340
11341 fi
11342
11343         # Normally we would collect these definitions in the config.h,
11344         # but (like _XOPEN_SOURCE), some environments rely on having these
11345         # defined before any of the system headers are included.  Another
11346         # case comes up with C++, e.g., on AIX the compiler compiles the
11347         # header files by themselves before looking at the body files it is
11348         # told to compile.  For ncurses, those header files do not include
11349         # the config.h
11350         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11351         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11352         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11353
11354         echo "$as_me:11354: checking whether to use struct dirent64" >&5
11355 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11356 if test "${cf_cv_struct_dirent64+set}" = set; then
11357   echo $ECHO_N "(cached) $ECHO_C" >&6
11358 else
11359
11360                 cat >conftest.$ac_ext <<_ACEOF
11361 #line 11361 "configure"
11362 #include "confdefs.h"
11363
11364 #include <sys/types.h>
11365 #include <dirent.h>
11366
11367 int
11368 main ()
11369 {
11370
11371                 /* if transitional largefile support is setup, this is true */
11372                 extern struct dirent64 * readdir(DIR *);
11373                 struct dirent64 *x = readdir((DIR *)0);
11374                 struct dirent *y = readdir((DIR *)0);
11375                 int z = x - y;
11376
11377   ;
11378   return 0;
11379 }
11380 _ACEOF
11381 rm -f conftest.$ac_objext
11382 if { (eval echo "$as_me:11382: \"$ac_compile\"") >&5
11383   (eval $ac_compile) 2>&5
11384   ac_status=$?
11385   echo "$as_me:11385: \$? = $ac_status" >&5
11386   (exit $ac_status); } &&
11387          { ac_try='test -s conftest.$ac_objext'
11388   { (eval echo "$as_me:11388: \"$ac_try\"") >&5
11389   (eval $ac_try) 2>&5
11390   ac_status=$?
11391   echo "$as_me:11391: \$? = $ac_status" >&5
11392   (exit $ac_status); }; }; then
11393   cf_cv_struct_dirent64=yes
11394 else
11395   echo "$as_me: failed program was:" >&5
11396 cat conftest.$ac_ext >&5
11397 cf_cv_struct_dirent64=no
11398 fi
11399 rm -f conftest.$ac_objext conftest.$ac_ext
11400
11401 fi
11402 echo "$as_me:11402: result: $cf_cv_struct_dirent64" >&5
11403 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11404         test "$cf_cv_struct_dirent64" = yes &&
11405 cat >>confdefs.h <<\EOF
11406 #define HAVE_STRUCT_DIRENT64 1
11407 EOF
11408
11409         fi
11410
11411 ### Enable compiling-in rcs id's
11412 echo "$as_me:11412: checking if RCS identifiers should be compiled-in" >&5
11413 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11414
11415 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11416 if test "${with_rcs_ids+set}" = set; then
11417   withval="$with_rcs_ids"
11418   with_rcs_ids=$withval
11419 else
11420   with_rcs_ids=no
11421 fi;
11422 echo "$as_me:11422: result: $with_rcs_ids" >&5
11423 echo "${ECHO_T}$with_rcs_ids" >&6
11424 test "$with_rcs_ids" = yes &&
11425 cat >>confdefs.h <<\EOF
11426 #define USE_RCS_IDS 1
11427 EOF
11428
11429 ###############################################################################
11430
11431 ### Note that some functions (such as const) are normally disabled anyway.
11432 echo "$as_me:11432: checking if you want to build with function extensions" >&5
11433 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11434
11435 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11436 if test "${enable_ext_funcs+set}" = set; then
11437   enableval="$enable_ext_funcs"
11438   with_ext_funcs=$enableval
11439 else
11440   with_ext_funcs=yes
11441 fi;
11442 echo "$as_me:11442: result: $with_ext_funcs" >&5
11443 echo "${ECHO_T}$with_ext_funcs" >&6
11444 if test "$with_ext_funcs" = yes ; then
11445         NCURSES_EXT_FUNCS=1
11446
11447 cat >>confdefs.h <<\EOF
11448 #define HAVE_USE_DEFAULT_COLORS 1
11449 EOF
11450
11451 cat >>confdefs.h <<\EOF
11452 #define NCURSES_EXT_FUNCS 1
11453 EOF
11454
11455 else
11456         NCURSES_EXT_FUNCS=0
11457 fi
11458
11459 ###   use option --enable-const to turn on use of const beyond that in XSI.
11460 echo "$as_me:11460: checking for extended use of const keyword" >&5
11461 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11462
11463 # Check whether --enable-const or --disable-const was given.
11464 if test "${enable_const+set}" = set; then
11465   enableval="$enable_const"
11466   with_ext_const=$enableval
11467 else
11468   with_ext_const=no
11469 fi;
11470 echo "$as_me:11470: result: $with_ext_const" >&5
11471 echo "${ECHO_T}$with_ext_const" >&6
11472 NCURSES_CONST='/*nothing*/'
11473 if test "$with_ext_const" = yes ; then
11474         NCURSES_CONST=const
11475 fi
11476
11477 ###############################################################################
11478 # These options are relatively safe to experiment with.
11479
11480 echo "$as_me:11480: checking if you want all development code" >&5
11481 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11482
11483 # Check whether --with-develop or --without-develop was given.
11484 if test "${with_develop+set}" = set; then
11485   withval="$with_develop"
11486   with_develop=$withval
11487 else
11488   with_develop=no
11489 fi;
11490 echo "$as_me:11490: result: $with_develop" >&5
11491 echo "${ECHO_T}$with_develop" >&6
11492
11493 ###############################################################################
11494 # These are just experimental, probably should not be in a package:
11495
11496 # This is still experimental (20080329), but should ultimately be moved to
11497 # the script-block --with-normal, etc.
11498
11499 echo "$as_me:11499: checking if you want to link with the pthread library" >&5
11500 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11501
11502 # Check whether --with-pthread or --without-pthread was given.
11503 if test "${with_pthread+set}" = set; then
11504   withval="$with_pthread"
11505   with_pthread=$withval
11506 else
11507   with_pthread=no
11508 fi;
11509 echo "$as_me:11509: result: $with_pthread" >&5
11510 echo "${ECHO_T}$with_pthread" >&6
11511
11512 if test "$with_pthread" != no ; then
11513         echo "$as_me:11513: checking for pthread.h" >&5
11514 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11515 if test "${ac_cv_header_pthread_h+set}" = set; then
11516   echo $ECHO_N "(cached) $ECHO_C" >&6
11517 else
11518   cat >conftest.$ac_ext <<_ACEOF
11519 #line 11519 "configure"
11520 #include "confdefs.h"
11521 #include <pthread.h>
11522 _ACEOF
11523 if { (eval echo "$as_me:11523: \"$ac_cpp conftest.$ac_ext\"") >&5
11524   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11525   ac_status=$?
11526   egrep -v '^ *\+' conftest.er1 >conftest.err
11527   rm -f conftest.er1
11528   cat conftest.err >&5
11529   echo "$as_me:11529: \$? = $ac_status" >&5
11530   (exit $ac_status); } >/dev/null; then
11531   if test -s conftest.err; then
11532     ac_cpp_err=$ac_c_preproc_warn_flag
11533   else
11534     ac_cpp_err=
11535   fi
11536 else
11537   ac_cpp_err=yes
11538 fi
11539 if test -z "$ac_cpp_err"; then
11540   ac_cv_header_pthread_h=yes
11541 else
11542   echo "$as_me: failed program was:" >&5
11543   cat conftest.$ac_ext >&5
11544   ac_cv_header_pthread_h=no
11545 fi
11546 rm -f conftest.err conftest.$ac_ext
11547 fi
11548 echo "$as_me:11548: result: $ac_cv_header_pthread_h" >&5
11549 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11550 if test $ac_cv_header_pthread_h = yes; then
11551
11552 cat >>confdefs.h <<\EOF
11553 #define HAVE_PTHREADS_H 1
11554 EOF
11555
11556         for cf_lib_pthread in pthread c_r
11557         do
11558             echo "$as_me:11558: checking if we can link with the $cf_lib_pthread library" >&5
11559 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11560             cf_save_LIBS="$LIBS"
11561
11562 cf_add_libs="-l$cf_lib_pthread"
11563 # Filter out duplicates - this happens with badly-designed ".pc" files...
11564 for cf_add_1lib in $LIBS
11565 do
11566         for cf_add_2lib in $cf_add_libs
11567         do
11568                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11569                 then
11570                         cf_add_1lib=
11571                         break
11572                 fi
11573         done
11574         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11575 done
11576 LIBS="$cf_add_libs"
11577
11578             cat >conftest.$ac_ext <<_ACEOF
11579 #line 11579 "configure"
11580 #include "confdefs.h"
11581
11582 #include <pthread.h>
11583
11584 int
11585 main ()
11586 {
11587
11588                 int rc = pthread_create(0,0,0,0);
11589                 int r2 = pthread_mutexattr_settype(0, 0);
11590
11591   ;
11592   return 0;
11593 }
11594 _ACEOF
11595 rm -f conftest.$ac_objext conftest$ac_exeext
11596 if { (eval echo "$as_me:11596: \"$ac_link\"") >&5
11597   (eval $ac_link) 2>&5
11598   ac_status=$?
11599   echo "$as_me:11599: \$? = $ac_status" >&5
11600   (exit $ac_status); } &&
11601          { ac_try='test -s conftest$ac_exeext'
11602   { (eval echo "$as_me:11602: \"$ac_try\"") >&5
11603   (eval $ac_try) 2>&5
11604   ac_status=$?
11605   echo "$as_me:11605: \$? = $ac_status" >&5
11606   (exit $ac_status); }; }; then
11607   with_pthread=yes
11608 else
11609   echo "$as_me: failed program was:" >&5
11610 cat conftest.$ac_ext >&5
11611 with_pthread=no
11612 fi
11613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11614             LIBS="$cf_save_LIBS"
11615             echo "$as_me:11615: result: $with_pthread" >&5
11616 echo "${ECHO_T}$with_pthread" >&6
11617             test "$with_pthread" = yes && break
11618         done
11619
11620         if test "$with_pthread" = yes ; then
11621
11622 cf_add_libs="-l$cf_lib_pthread"
11623 # Filter out duplicates - this happens with badly-designed ".pc" files...
11624 for cf_add_1lib in $LIBS
11625 do
11626         for cf_add_2lib in $cf_add_libs
11627         do
11628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11629                 then
11630                         cf_add_1lib=
11631                         break
11632                 fi
11633         done
11634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11635 done
11636 LIBS="$cf_add_libs"
11637
11638 cat >>confdefs.h <<\EOF
11639 #define HAVE_LIBPTHREADS 1
11640 EOF
11641
11642         else
11643             { { echo "$as_me:11643: error: Cannot link with pthread library" >&5
11644 echo "$as_me: error: Cannot link with pthread library" >&2;}
11645    { (exit 1); exit 1; }; }
11646         fi
11647
11648 fi
11649
11650 fi
11651
11652 echo "$as_me:11652: checking if you want to use weak-symbols for pthreads" >&5
11653 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11654
11655 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11656 if test "${enable_weak_symbols+set}" = set; then
11657   enableval="$enable_weak_symbols"
11658   use_weak_symbols=$withval
11659 else
11660   use_weak_symbols=no
11661 fi;
11662 echo "$as_me:11662: result: $use_weak_symbols" >&5
11663 echo "${ECHO_T}$use_weak_symbols" >&6
11664 if test "$use_weak_symbols" = yes ; then
11665
11666 echo "$as_me:11666: checking if $CC supports weak symbols" >&5
11667 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11668 if test "${cf_cv_weak_symbols+set}" = set; then
11669   echo $ECHO_N "(cached) $ECHO_C" >&6
11670 else
11671
11672 cat >conftest.$ac_ext <<_ACEOF
11673 #line 11673 "configure"
11674 #include "confdefs.h"
11675
11676 #include <stdio.h>
11677 int
11678 main ()
11679 {
11680
11681 #if defined(__GNUC__)
11682 #  if defined __USE_ISOC99
11683 #    define _cat_pragma(exp)    _Pragma(#exp)
11684 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11685 #  else
11686 #    define _weak_pragma(exp)
11687 #  endif
11688 #  define _declare(name)        __extension__ extern __typeof__(name) name
11689 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11690 #endif
11691
11692 weak_symbol(fopen);
11693
11694   ;
11695   return 0;
11696 }
11697 _ACEOF
11698 rm -f conftest.$ac_objext
11699 if { (eval echo "$as_me:11699: \"$ac_compile\"") >&5
11700   (eval $ac_compile) 2>&5
11701   ac_status=$?
11702   echo "$as_me:11702: \$? = $ac_status" >&5
11703   (exit $ac_status); } &&
11704          { ac_try='test -s conftest.$ac_objext'
11705   { (eval echo "$as_me:11705: \"$ac_try\"") >&5
11706   (eval $ac_try) 2>&5
11707   ac_status=$?
11708   echo "$as_me:11708: \$? = $ac_status" >&5
11709   (exit $ac_status); }; }; then
11710   cf_cv_weak_symbols=yes
11711 else
11712   echo "$as_me: failed program was:" >&5
11713 cat conftest.$ac_ext >&5
11714 cf_cv_weak_symbols=no
11715 fi
11716 rm -f conftest.$ac_objext conftest.$ac_ext
11717
11718 fi
11719 echo "$as_me:11719: result: $cf_cv_weak_symbols" >&5
11720 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11721
11722 else
11723         cf_cv_weak_symbols=no
11724 fi
11725
11726 if test $cf_cv_weak_symbols = yes ; then
11727
11728 cat >>confdefs.h <<\EOF
11729 #define USE_WEAK_SYMBOLS 1
11730 EOF
11731
11732 fi
11733
11734 PTHREAD=
11735 if test "$with_pthread" = "yes" ; then
11736
11737 cat >>confdefs.h <<\EOF
11738 #define USE_PTHREADS 1
11739 EOF
11740
11741         enable_reentrant=yes
11742         if test $cf_cv_weak_symbols = yes ; then
11743                 PTHREAD=-lpthread
11744         fi
11745 fi
11746
11747 # OpenSUSE is installing ncurses6, using reentrant option.
11748 echo "$as_me:11748: checking for _nc_TABSIZE" >&5
11749 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11750 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11751   echo $ECHO_N "(cached) $ECHO_C" >&6
11752 else
11753   cat >conftest.$ac_ext <<_ACEOF
11754 #line 11754 "configure"
11755 #include "confdefs.h"
11756 /* System header to define __stub macros and hopefully few prototypes,
11757     which can conflict with char _nc_TABSIZE (); below.  */
11758 #include <assert.h>
11759 /* Override any gcc2 internal prototype to avoid an error.  */
11760 #ifdef __cplusplus
11761 extern "C"
11762 #endif
11763 /* We use char because int might match the return type of a gcc2
11764    builtin and then its argument prototype would still apply.  */
11765 char _nc_TABSIZE ();
11766 char (*f) ();
11767
11768 int
11769 main ()
11770 {
11771 /* The GNU C library defines this for functions which it implements
11772     to always fail with ENOSYS.  Some functions are actually named
11773     something starting with __ and the normal name is an alias.  */
11774 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11775 choke me
11776 #else
11777 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11778 #endif
11779
11780   ;
11781   return 0;
11782 }
11783 _ACEOF
11784 rm -f conftest.$ac_objext conftest$ac_exeext
11785 if { (eval echo "$as_me:11785: \"$ac_link\"") >&5
11786   (eval $ac_link) 2>&5
11787   ac_status=$?
11788   echo "$as_me:11788: \$? = $ac_status" >&5
11789   (exit $ac_status); } &&
11790          { ac_try='test -s conftest$ac_exeext'
11791   { (eval echo "$as_me:11791: \"$ac_try\"") >&5
11792   (eval $ac_try) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit $ac_status); }; }; then
11796   ac_cv_func__nc_TABSIZE=yes
11797 else
11798   echo "$as_me: failed program was:" >&5
11799 cat conftest.$ac_ext >&5
11800 ac_cv_func__nc_TABSIZE=no
11801 fi
11802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11803 fi
11804 echo "$as_me:11804: result: $ac_cv_func__nc_TABSIZE" >&5
11805 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11806 if test $ac_cv_func__nc_TABSIZE = yes; then
11807   assume_reentrant=yes
11808 else
11809   assume_reentrant=no
11810 fi
11811
11812 # Reentrant code has to be opaque; there's little advantage to making ncurses
11813 # opaque outside of that, so there is no --enable-opaque option.  We can use
11814 # this option without --with-pthreads, but this will be always set for
11815 # pthreads.
11816 echo "$as_me:11816: checking if you want experimental reentrant code" >&5
11817 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11818
11819 # Check whether --enable-reentrant or --disable-reentrant was given.
11820 if test "${enable_reentrant+set}" = set; then
11821   enableval="$enable_reentrant"
11822   with_reentrant=$enableval
11823 else
11824   with_reentrant=$assume_reentrant
11825 fi;
11826 echo "$as_me:11826: result: $with_reentrant" >&5
11827 echo "${ECHO_T}$with_reentrant" >&6
11828 if test "$with_reentrant" = yes ; then
11829         cf_cv_enable_reentrant=1
11830         if test $cf_cv_weak_symbols = yes ; then
11831
11832 # remove pthread library from $LIBS
11833 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11834
11835         elif test "$assume_reentrant" = no ; then
11836                 LIB_SUFFIX="t${LIB_SUFFIX}"
11837         fi
11838
11839 cat >>confdefs.h <<\EOF
11840 #define USE_REENTRANT 1
11841 EOF
11842
11843 else
11844         cf_cv_enable_reentrant=0
11845 fi
11846
11847 ### Allow using a different wrap-prefix
11848 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11849         echo "$as_me:11849: checking for prefix used to wrap public variables" >&5
11850 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11851
11852 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11853 if test "${with_wrap_prefix+set}" = set; then
11854   withval="$with_wrap_prefix"
11855   NCURSES_WRAP_PREFIX=$withval
11856 else
11857   NCURSES_WRAP_PREFIX=_nc_
11858 fi;
11859         echo "$as_me:11859: result: $NCURSES_WRAP_PREFIX" >&5
11860 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11861 else
11862         NCURSES_WRAP_PREFIX=_nc_
11863 fi
11864
11865 cat >>confdefs.h <<EOF
11866 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11867 EOF
11868
11869 ###############################################################################
11870
11871 ###     use option --disable-echo to suppress full display compiling commands
11872
11873 echo "$as_me:11873: checking if you want to see long compiling messages" >&5
11874 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11875
11876 # Check whether --enable-echo or --disable-echo was given.
11877 if test "${enable_echo+set}" = set; then
11878   enableval="$enable_echo"
11879   test "$enableval" != no && enableval=yes
11880         if test "$enableval" != "yes" ; then
11881
11882         ECHO_LT='--silent'
11883         ECHO_LD='@echo linking $@;'
11884         RULE_CC='@echo compiling $<'
11885         SHOW_CC='@echo compiling $@'
11886         ECHO_CC='@'
11887
11888         else
11889
11890         ECHO_LT=''
11891         ECHO_LD=''
11892         RULE_CC=''
11893         SHOW_CC=''
11894         ECHO_CC=''
11895
11896         fi
11897 else
11898   enableval=yes
11899
11900         ECHO_LT=''
11901         ECHO_LD=''
11902         RULE_CC=''
11903         SHOW_CC=''
11904         ECHO_CC=''
11905
11906 fi;
11907 echo "$as_me:11907: result: $enableval" >&5
11908 echo "${ECHO_T}$enableval" >&6
11909
11910 ###     use option --enable-warnings to turn on all gcc warnings
11911 echo "$as_me:11911: checking if you want to see compiler warnings" >&5
11912 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11913
11914 # Check whether --enable-warnings or --disable-warnings was given.
11915 if test "${enable_warnings+set}" = set; then
11916   enableval="$enable_warnings"
11917   with_warnings=$enableval
11918 fi;
11919 echo "$as_me:11919: result: $with_warnings" >&5
11920 echo "${ECHO_T}$with_warnings" >&6
11921
11922 if test "x$with_warnings" = "xyes"; then
11923
11924         ADAFLAGS="$ADAFLAGS -gnatg"
11925
11926 INTEL_COMPILER=no
11927
11928 if test "$GCC" = yes ; then
11929         case $host_os in
11930         (linux*|gnu*)
11931                 echo "$as_me:11931: checking if this is really Intel C compiler" >&5
11932 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11933                 cf_save_CFLAGS="$CFLAGS"
11934                 CFLAGS="$CFLAGS -no-gcc"
11935                 cat >conftest.$ac_ext <<_ACEOF
11936 #line 11936 "configure"
11937 #include "confdefs.h"
11938
11939 int
11940 main ()
11941 {
11942
11943 #ifdef __INTEL_COMPILER
11944 #else
11945 make an error
11946 #endif
11947
11948   ;
11949   return 0;
11950 }
11951 _ACEOF
11952 rm -f conftest.$ac_objext
11953 if { (eval echo "$as_me:11953: \"$ac_compile\"") >&5
11954   (eval $ac_compile) 2>&5
11955   ac_status=$?
11956   echo "$as_me:11956: \$? = $ac_status" >&5
11957   (exit $ac_status); } &&
11958          { ac_try='test -s conftest.$ac_objext'
11959   { (eval echo "$as_me:11959: \"$ac_try\"") >&5
11960   (eval $ac_try) 2>&5
11961   ac_status=$?
11962   echo "$as_me:11962: \$? = $ac_status" >&5
11963   (exit $ac_status); }; }; then
11964   INTEL_COMPILER=yes
11965 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11966
11967 else
11968   echo "$as_me: failed program was:" >&5
11969 cat conftest.$ac_ext >&5
11970 fi
11971 rm -f conftest.$ac_objext conftest.$ac_ext
11972                 CFLAGS="$cf_save_CFLAGS"
11973                 echo "$as_me:11973: result: $INTEL_COMPILER" >&5
11974 echo "${ECHO_T}$INTEL_COMPILER" >&6
11975                 ;;
11976         esac
11977 fi
11978
11979 CLANG_COMPILER=no
11980
11981 if test "$GCC" = yes ; then
11982         echo "$as_me:11982: checking if this is really Clang C compiler" >&5
11983 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11984         cf_save_CFLAGS="$CFLAGS"
11985         CFLAGS="$CFLAGS -Qunused-arguments"
11986         cat >conftest.$ac_ext <<_ACEOF
11987 #line 11987 "configure"
11988 #include "confdefs.h"
11989
11990 int
11991 main ()
11992 {
11993
11994 #ifdef __clang__
11995 #else
11996 make an error
11997 #endif
11998
11999   ;
12000   return 0;
12001 }
12002 _ACEOF
12003 rm -f conftest.$ac_objext
12004 if { (eval echo "$as_me:12004: \"$ac_compile\"") >&5
12005   (eval $ac_compile) 2>&5
12006   ac_status=$?
12007   echo "$as_me:12007: \$? = $ac_status" >&5
12008   (exit $ac_status); } &&
12009          { ac_try='test -s conftest.$ac_objext'
12010   { (eval echo "$as_me:12010: \"$ac_try\"") >&5
12011   (eval $ac_try) 2>&5
12012   ac_status=$?
12013   echo "$as_me:12013: \$? = $ac_status" >&5
12014   (exit $ac_status); }; }; then
12015   CLANG_COMPILER=yes
12016 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12017
12018 else
12019   echo "$as_me: failed program was:" >&5
12020 cat conftest.$ac_ext >&5
12021 fi
12022 rm -f conftest.$ac_objext conftest.$ac_ext
12023         CFLAGS="$cf_save_CFLAGS"
12024         echo "$as_me:12024: result: $CLANG_COMPILER" >&5
12025 echo "${ECHO_T}$CLANG_COMPILER" >&6
12026 fi
12027
12028 cat > conftest.$ac_ext <<EOF
12029 #line 12029 "${as_me:-configure}"
12030 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12031 EOF
12032
12033 if test "$INTEL_COMPILER" = yes
12034 then
12035 # The "-wdXXX" options suppress warnings:
12036 # remark #1419: external declaration in primary source file
12037 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12038 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12039 # remark #193: zero used for undefined preprocessing identifier
12040 # remark #593: variable "curs_sb_left_arrow" was set but never used
12041 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12042 # remark #869: parameter "tw" was never referenced
12043 # remark #981: operands are evaluated in unspecified order
12044 # warning #279: controlling expression is constant
12045
12046         { echo "$as_me:12046: checking for $CC warning options..." >&5
12047 echo "$as_me: checking for $CC warning options..." >&6;}
12048         cf_save_CFLAGS="$CFLAGS"
12049         EXTRA_CFLAGS="-Wall"
12050         for cf_opt in \
12051                 wd1419 \
12052                 wd1683 \
12053                 wd1684 \
12054                 wd193 \
12055                 wd593 \
12056                 wd279 \
12057                 wd810 \
12058                 wd869 \
12059                 wd981
12060         do
12061                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12062                 if { (eval echo "$as_me:12062: \"$ac_compile\"") >&5
12063   (eval $ac_compile) 2>&5
12064   ac_status=$?
12065   echo "$as_me:12065: \$? = $ac_status" >&5
12066   (exit $ac_status); }; then
12067                         test -n "$verbose" && echo "$as_me:12067: result: ... -$cf_opt" >&5
12068 echo "${ECHO_T}... -$cf_opt" >&6
12069                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12070                 fi
12071         done
12072         CFLAGS="$cf_save_CFLAGS"
12073
12074 elif test "$GCC" = yes
12075 then
12076         { echo "$as_me:12076: checking for $CC warning options..." >&5
12077 echo "$as_me: checking for $CC warning options..." >&6;}
12078         cf_save_CFLAGS="$CFLAGS"
12079         EXTRA_CFLAGS=
12080         cf_warn_CONST=""
12081         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12082         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12083         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12084         for cf_opt in W Wall \
12085                 Wbad-function-cast \
12086                 Wcast-align \
12087                 Wcast-qual \
12088                 Wdeclaration-after-statement \
12089                 Wextra \
12090                 Winline \
12091                 Wmissing-declarations \
12092                 Wmissing-prototypes \
12093                 Wnested-externs \
12094                 Wpointer-arith \
12095                 Wshadow \
12096                 Wstrict-prototypes \
12097                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12098         do
12099                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12100                 if { (eval echo "$as_me:12100: \"$ac_compile\"") >&5
12101   (eval $ac_compile) 2>&5
12102   ac_status=$?
12103   echo "$as_me:12103: \$? = $ac_status" >&5
12104   (exit $ac_status); }; then
12105                         test -n "$verbose" && echo "$as_me:12105: result: ... -$cf_opt" >&5
12106 echo "${ECHO_T}... -$cf_opt" >&6
12107                         case $cf_opt in
12108                         (Wcast-qual)
12109                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12110                                 ;;
12111                         (Winline)
12112                                 case $GCC_VERSION in
12113                                 ([34].*)
12114                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12115
12116 echo "${as_me:-configure}:12116: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12117
12118                                         continue;;
12119                                 esac
12120                                 ;;
12121                         (Wpointer-arith)
12122                                 case $GCC_VERSION in
12123                                 ([12].*)
12124                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12125
12126 echo "${as_me:-configure}:12126: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12127
12128                                         continue;;
12129                                 esac
12130                                 ;;
12131                         esac
12132                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12133                 fi
12134         done
12135         CFLAGS="$cf_save_CFLAGS"
12136 fi
12137 rm -rf conftest*
12138
12139 fi
12140
12141 if test "$GCC" = yes
12142 then
12143 cat > conftest.i <<EOF
12144 #ifndef GCC_PRINTF
12145 #define GCC_PRINTF 0
12146 #endif
12147 #ifndef GCC_SCANF
12148 #define GCC_SCANF 0
12149 #endif
12150 #ifndef GCC_NORETURN
12151 #define GCC_NORETURN /* nothing */
12152 #endif
12153 #ifndef GCC_UNUSED
12154 #define GCC_UNUSED /* nothing */
12155 #endif
12156 EOF
12157 if test "$GCC" = yes
12158 then
12159         { echo "$as_me:12159: checking for $CC __attribute__ directives..." >&5
12160 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12161 cat > conftest.$ac_ext <<EOF
12162 #line 12162 "${as_me:-configure}"
12163 #include "confdefs.h"
12164 #include "conftest.h"
12165 #include "conftest.i"
12166 #if     GCC_PRINTF
12167 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12168 #else
12169 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12170 #endif
12171 #if     GCC_SCANF
12172 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12173 #else
12174 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12175 #endif
12176 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12177 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12178 extern void foo(void) GCC_NORETURN;
12179 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12180 EOF
12181         cf_printf_attribute=no
12182         cf_scanf_attribute=no
12183         for cf_attribute in scanf printf unused noreturn
12184         do
12185
12186 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12187
12188                 cf_directive="__attribute__(($cf_attribute))"
12189                 echo "checking for $CC $cf_directive" 1>&5
12190
12191                 case $cf_attribute in
12192                 (printf)
12193                         cf_printf_attribute=yes
12194                         cat >conftest.h <<EOF
12195 #define GCC_$cf_ATTRIBUTE 1
12196 EOF
12197                         ;;
12198                 (scanf)
12199                         cf_scanf_attribute=yes
12200                         cat >conftest.h <<EOF
12201 #define GCC_$cf_ATTRIBUTE 1
12202 EOF
12203                         ;;
12204                 (*)
12205                         cat >conftest.h <<EOF
12206 #define GCC_$cf_ATTRIBUTE $cf_directive
12207 EOF
12208                         ;;
12209                 esac
12210
12211                 if { (eval echo "$as_me:12211: \"$ac_compile\"") >&5
12212   (eval $ac_compile) 2>&5
12213   ac_status=$?
12214   echo "$as_me:12214: \$? = $ac_status" >&5
12215   (exit $ac_status); }; then
12216                         test -n "$verbose" && echo "$as_me:12216: result: ... $cf_attribute" >&5
12217 echo "${ECHO_T}... $cf_attribute" >&6
12218                         cat conftest.h >>confdefs.h
12219                         case $cf_attribute in
12220                         (noreturn)
12221
12222 cat >>confdefs.h <<EOF
12223 #define GCC_NORETURN $cf_directive
12224 EOF
12225
12226                                 ;;
12227                         (printf)
12228                                 cf_value='/* nothing */'
12229                                 if test "$cf_printf_attribute" != no ; then
12230                                         cf_value='__attribute__((format(printf,fmt,var)))'
12231
12232 cat >>confdefs.h <<\EOF
12233 #define GCC_PRINTF 1
12234 EOF
12235
12236                                 fi
12237
12238 cat >>confdefs.h <<EOF
12239 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12240 EOF
12241
12242                                 ;;
12243                         (scanf)
12244                                 cf_value='/* nothing */'
12245                                 if test "$cf_scanf_attribute" != no ; then
12246                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12247
12248 cat >>confdefs.h <<\EOF
12249 #define GCC_SCANF 1
12250 EOF
12251
12252                                 fi
12253
12254 cat >>confdefs.h <<EOF
12255 #define GCC_SCANFLIKE(fmt,var) $cf_value
12256 EOF
12257
12258                                 ;;
12259                         (unused)
12260
12261 cat >>confdefs.h <<EOF
12262 #define GCC_UNUSED $cf_directive
12263 EOF
12264
12265                                 ;;
12266                         esac
12267                 fi
12268         done
12269 else
12270         fgrep define conftest.i >>confdefs.h
12271 fi
12272 rm -rf conftest*
12273 fi
12274
12275 ###     use option --enable-assertions to turn on generation of assertion code
12276 echo "$as_me:12276: checking if you want to enable runtime assertions" >&5
12277 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12278
12279 # Check whether --enable-assertions or --disable-assertions was given.
12280 if test "${enable_assertions+set}" = set; then
12281   enableval="$enable_assertions"
12282   with_assertions=$enableval
12283 else
12284   with_assertions=no
12285 fi;
12286 echo "$as_me:12286: result: $with_assertions" >&5
12287 echo "${ECHO_T}$with_assertions" >&6
12288 if test -n "$GCC"
12289 then
12290         if test "$with_assertions" = no
12291         then
12292                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12293         else
12294
12295         ADAFLAGS="$ADAFLAGS -gnata"
12296
12297         fi
12298 fi
12299
12300 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12301
12302 cat >>confdefs.h <<\EOF
12303 #define HAVE_NC_ALLOC_H 1
12304 EOF
12305
12306 ###     use option --enable-expanded to generate certain macros as functions
12307
12308 # Check whether --enable-expanded or --disable-expanded was given.
12309 if test "${enable_expanded+set}" = set; then
12310   enableval="$enable_expanded"
12311   test "$enableval" = yes &&
12312 cat >>confdefs.h <<\EOF
12313 #define NCURSES_EXPANDED 1
12314 EOF
12315
12316 fi;
12317
12318 ###     use option --disable-macros to suppress macros in favor of functions
12319
12320 # Check whether --enable-macros or --disable-macros was given.
12321 if test "${enable_macros+set}" = set; then
12322   enableval="$enable_macros"
12323   test "$enableval" = no &&
12324 cat >>confdefs.h <<\EOF
12325 #define NCURSES_NOMACROS 1
12326 EOF
12327
12328 fi;
12329
12330 # Normally we only add trace() to the debug-library.  Allow this to be
12331 # extended to all models of the ncurses library:
12332 cf_all_traces=no
12333 case "$CFLAGS $CPPFLAGS" in
12334 (*-DTRACE*)
12335         cf_all_traces=yes
12336         ;;
12337 esac
12338
12339 echo "$as_me:12339: checking whether to add trace feature to all models" >&5
12340 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12341
12342 # Check whether --with-trace or --without-trace was given.
12343 if test "${with_trace+set}" = set; then
12344   withval="$with_trace"
12345   cf_with_trace=$withval
12346 else
12347   cf_with_trace=$cf_all_traces
12348 fi;
12349 echo "$as_me:12349: result: $cf_with_trace" >&5
12350 echo "${ECHO_T}$cf_with_trace" >&6
12351
12352 if test "$cf_with_trace" = yes ; then
12353         ADA_TRACE=TRUE
12354
12355 cf_fix_cppflags=no
12356 cf_new_cflags=
12357 cf_new_cppflags=
12358 cf_new_extra_cppflags=
12359
12360 for cf_add_cflags in -DTRACE
12361 do
12362 case $cf_fix_cppflags in
12363 (no)
12364         case $cf_add_cflags in
12365         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12366                 case $cf_add_cflags in
12367                 (-D*)
12368                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12369
12370                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12371                                 && test -z "${cf_tst_cflags}" \
12372                                 && cf_fix_cppflags=yes
12373
12374                         if test $cf_fix_cppflags = yes ; then
12375                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12376                                 continue
12377                         elif test "${cf_tst_cflags}" = "\"'" ; then
12378                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12379                                 continue
12380                         fi
12381                         ;;
12382                 esac
12383                 case "$CPPFLAGS" in
12384                 (*$cf_add_cflags)
12385                         ;;
12386                 (*)
12387                         case $cf_add_cflags in
12388                         (-D*)
12389                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12390
12391 CPPFLAGS=`echo "$CPPFLAGS" | \
12392         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12393                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12394
12395                                 ;;
12396                         esac
12397                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12398                         ;;
12399                 esac
12400                 ;;
12401         (*)
12402                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12403                 ;;
12404         esac
12405         ;;
12406 (yes)
12407         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12408
12409         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12410
12411         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12412                 && test -z "${cf_tst_cflags}" \
12413                 && cf_fix_cppflags=no
12414         ;;
12415 esac
12416 done
12417
12418 if test -n "$cf_new_cflags" ; then
12419
12420         CFLAGS="$CFLAGS $cf_new_cflags"
12421 fi
12422
12423 if test -n "$cf_new_cppflags" ; then
12424
12425         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12426 fi
12427
12428 if test -n "$cf_new_extra_cppflags" ; then
12429
12430         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12431 fi
12432
12433 else
12434         ADA_TRACE=FALSE
12435 fi
12436
12437 echo "$as_me:12437: checking if we want to use GNAT projects" >&5
12438 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12439
12440 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12441 if test "${enable_gnat_projects+set}" = set; then
12442   enableval="$enable_gnat_projects"
12443   test "$enableval" != no && enableval=yes
12444         if test "$enableval" != "yes" ; then
12445     enable_gnat_projects=no
12446         else
12447                 enable_gnat_projects=yes
12448         fi
12449 else
12450   enableval=yes
12451         enable_gnat_projects=yes
12452
12453 fi;
12454 echo "$as_me:12454: result: $enable_gnat_projects" >&5
12455 echo "${ECHO_T}$enable_gnat_projects" >&6
12456
12457 ###     Checks for libraries.
12458 case $cf_cv_system_name in
12459 (*mingw32*)
12460         ;;
12461 (*)
12462 echo "$as_me:12462: checking for gettimeofday" >&5
12463 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12464 if test "${ac_cv_func_gettimeofday+set}" = set; then
12465   echo $ECHO_N "(cached) $ECHO_C" >&6
12466 else
12467   cat >conftest.$ac_ext <<_ACEOF
12468 #line 12468 "configure"
12469 #include "confdefs.h"
12470 /* System header to define __stub macros and hopefully few prototypes,
12471     which can conflict with char gettimeofday (); below.  */
12472 #include <assert.h>
12473 /* Override any gcc2 internal prototype to avoid an error.  */
12474 #ifdef __cplusplus
12475 extern "C"
12476 #endif
12477 /* We use char because int might match the return type of a gcc2
12478    builtin and then its argument prototype would still apply.  */
12479 char gettimeofday ();
12480 char (*f) ();
12481
12482 int
12483 main ()
12484 {
12485 /* The GNU C library defines this for functions which it implements
12486     to always fail with ENOSYS.  Some functions are actually named
12487     something starting with __ and the normal name is an alias.  */
12488 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12489 choke me
12490 #else
12491 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12492 #endif
12493
12494   ;
12495   return 0;
12496 }
12497 _ACEOF
12498 rm -f conftest.$ac_objext conftest$ac_exeext
12499 if { (eval echo "$as_me:12499: \"$ac_link\"") >&5
12500   (eval $ac_link) 2>&5
12501   ac_status=$?
12502   echo "$as_me:12502: \$? = $ac_status" >&5
12503   (exit $ac_status); } &&
12504          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_func_gettimeofday=yes
12511 else
12512   echo "$as_me: failed program was:" >&5
12513 cat conftest.$ac_ext >&5
12514 ac_cv_func_gettimeofday=no
12515 fi
12516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12517 fi
12518 echo "$as_me:12518: result: $ac_cv_func_gettimeofday" >&5
12519 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12520 if test $ac_cv_func_gettimeofday = yes; then
12521   cat >>confdefs.h <<\EOF
12522 #define HAVE_GETTIMEOFDAY 1
12523 EOF
12524
12525 else
12526
12527 echo "$as_me:12527: checking for gettimeofday in -lbsd" >&5
12528 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12529 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12530   echo $ECHO_N "(cached) $ECHO_C" >&6
12531 else
12532   ac_check_lib_save_LIBS=$LIBS
12533 LIBS="-lbsd  $LIBS"
12534 cat >conftest.$ac_ext <<_ACEOF
12535 #line 12535 "configure"
12536 #include "confdefs.h"
12537
12538 /* Override any gcc2 internal prototype to avoid an error.  */
12539 #ifdef __cplusplus
12540 extern "C"
12541 #endif
12542 /* We use char because int might match the return type of a gcc2
12543    builtin and then its argument prototype would still apply.  */
12544 char gettimeofday ();
12545 int
12546 main ()
12547 {
12548 gettimeofday ();
12549   ;
12550   return 0;
12551 }
12552 _ACEOF
12553 rm -f conftest.$ac_objext conftest$ac_exeext
12554 if { (eval echo "$as_me:12554: \"$ac_link\"") >&5
12555   (eval $ac_link) 2>&5
12556   ac_status=$?
12557   echo "$as_me:12557: \$? = $ac_status" >&5
12558   (exit $ac_status); } &&
12559          { ac_try='test -s conftest$ac_exeext'
12560   { (eval echo "$as_me:12560: \"$ac_try\"") >&5
12561   (eval $ac_try) 2>&5
12562   ac_status=$?
12563   echo "$as_me:12563: \$? = $ac_status" >&5
12564   (exit $ac_status); }; }; then
12565   ac_cv_lib_bsd_gettimeofday=yes
12566 else
12567   echo "$as_me: failed program was:" >&5
12568 cat conftest.$ac_ext >&5
12569 ac_cv_lib_bsd_gettimeofday=no
12570 fi
12571 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12572 LIBS=$ac_check_lib_save_LIBS
12573 fi
12574 echo "$as_me:12574: result: $ac_cv_lib_bsd_gettimeofday" >&5
12575 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12576 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12577
12578 cat >>confdefs.h <<\EOF
12579 #define HAVE_GETTIMEOFDAY 1
12580 EOF
12581
12582         LIBS="$LIBS -lbsd"
12583 fi
12584
12585 fi
12586         ;;
12587 esac
12588
12589 ###     Checks for header files.
12590 echo "$as_me:12590: checking for ANSI C header files" >&5
12591 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12592 if test "${ac_cv_header_stdc+set}" = set; then
12593   echo $ECHO_N "(cached) $ECHO_C" >&6
12594 else
12595   cat >conftest.$ac_ext <<_ACEOF
12596 #line 12596 "configure"
12597 #include "confdefs.h"
12598 #include <stdlib.h>
12599 #include <stdarg.h>
12600 #include <string.h>
12601 #include <float.h>
12602
12603 _ACEOF
12604 if { (eval echo "$as_me:12604: \"$ac_cpp conftest.$ac_ext\"") >&5
12605   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12606   ac_status=$?
12607   egrep -v '^ *\+' conftest.er1 >conftest.err
12608   rm -f conftest.er1
12609   cat conftest.err >&5
12610   echo "$as_me:12610: \$? = $ac_status" >&5
12611   (exit $ac_status); } >/dev/null; then
12612   if test -s conftest.err; then
12613     ac_cpp_err=$ac_c_preproc_warn_flag
12614   else
12615     ac_cpp_err=
12616   fi
12617 else
12618   ac_cpp_err=yes
12619 fi
12620 if test -z "$ac_cpp_err"; then
12621   ac_cv_header_stdc=yes
12622 else
12623   echo "$as_me: failed program was:" >&5
12624   cat conftest.$ac_ext >&5
12625   ac_cv_header_stdc=no
12626 fi
12627 rm -f conftest.err conftest.$ac_ext
12628
12629 if test $ac_cv_header_stdc = yes; then
12630   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12631   cat >conftest.$ac_ext <<_ACEOF
12632 #line 12632 "configure"
12633 #include "confdefs.h"
12634 #include <string.h>
12635
12636 _ACEOF
12637 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12638   egrep "memchr" >/dev/null 2>&1; then
12639   :
12640 else
12641   ac_cv_header_stdc=no
12642 fi
12643 rm -rf conftest*
12644
12645 fi
12646
12647 if test $ac_cv_header_stdc = yes; then
12648   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12649   cat >conftest.$ac_ext <<_ACEOF
12650 #line 12650 "configure"
12651 #include "confdefs.h"
12652 #include <stdlib.h>
12653
12654 _ACEOF
12655 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12656   egrep "free" >/dev/null 2>&1; then
12657   :
12658 else
12659   ac_cv_header_stdc=no
12660 fi
12661 rm -rf conftest*
12662
12663 fi
12664
12665 if test $ac_cv_header_stdc = yes; then
12666   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12667   if test "$cross_compiling" = yes; then
12668   :
12669 else
12670   cat >conftest.$ac_ext <<_ACEOF
12671 #line 12671 "configure"
12672 #include "confdefs.h"
12673 #include <ctype.h>
12674 #if ((' ' & 0x0FF) == 0x020)
12675 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12676 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12677 #else
12678 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12679                      || ('j' <= (c) && (c) <= 'r') \
12680                      || ('s' <= (c) && (c) <= 'z'))
12681 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12682 #endif
12683
12684 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12685 int
12686 main ()
12687 {
12688   int i;
12689   for (i = 0; i < 256; i++)
12690     if (XOR (islower (i), ISLOWER (i))
12691         || toupper (i) != TOUPPER (i))
12692       $ac_main_return(2);
12693   $ac_main_return (0);
12694 }
12695 _ACEOF
12696 rm -f conftest$ac_exeext
12697 if { (eval echo "$as_me:12697: \"$ac_link\"") >&5
12698   (eval $ac_link) 2>&5
12699   ac_status=$?
12700   echo "$as_me:12700: \$? = $ac_status" >&5
12701   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12702   { (eval echo "$as_me:12702: \"$ac_try\"") >&5
12703   (eval $ac_try) 2>&5
12704   ac_status=$?
12705   echo "$as_me:12705: \$? = $ac_status" >&5
12706   (exit $ac_status); }; }; then
12707   :
12708 else
12709   echo "$as_me: program exited with status $ac_status" >&5
12710 echo "$as_me: failed program was:" >&5
12711 cat conftest.$ac_ext >&5
12712 ac_cv_header_stdc=no
12713 fi
12714 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12715 fi
12716 fi
12717 fi
12718 echo "$as_me:12718: result: $ac_cv_header_stdc" >&5
12719 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12720 if test $ac_cv_header_stdc = yes; then
12721
12722 cat >>confdefs.h <<\EOF
12723 #define STDC_HEADERS 1
12724 EOF
12725
12726 fi
12727
12728 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
12729
12730 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
12731                   inttypes.h stdint.h unistd.h
12732 do
12733 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12734 echo "$as_me:12734: checking for $ac_header" >&5
12735 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12736 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12737   echo $ECHO_N "(cached) $ECHO_C" >&6
12738 else
12739   cat >conftest.$ac_ext <<_ACEOF
12740 #line 12740 "configure"
12741 #include "confdefs.h"
12742 $ac_includes_default
12743 #include <$ac_header>
12744 _ACEOF
12745 rm -f conftest.$ac_objext
12746 if { (eval echo "$as_me:12746: \"$ac_compile\"") >&5
12747   (eval $ac_compile) 2>&5
12748   ac_status=$?
12749   echo "$as_me:12749: \$? = $ac_status" >&5
12750   (exit $ac_status); } &&
12751          { ac_try='test -s conftest.$ac_objext'
12752   { (eval echo "$as_me:12752: \"$ac_try\"") >&5
12753   (eval $ac_try) 2>&5
12754   ac_status=$?
12755   echo "$as_me:12755: \$? = $ac_status" >&5
12756   (exit $ac_status); }; }; then
12757   eval "$as_ac_Header=yes"
12758 else
12759   echo "$as_me: failed program was:" >&5
12760 cat conftest.$ac_ext >&5
12761 eval "$as_ac_Header=no"
12762 fi
12763 rm -f conftest.$ac_objext conftest.$ac_ext
12764 fi
12765 echo "$as_me:12765: result: `eval echo '${'$as_ac_Header'}'`" >&5
12766 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12767 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12768   cat >>confdefs.h <<EOF
12769 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12770 EOF
12771
12772 fi
12773 done
12774
12775 echo "$as_me:12775: checking for signed char" >&5
12776 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
12777 if test "${ac_cv_type_signed_char+set}" = set; then
12778   echo $ECHO_N "(cached) $ECHO_C" >&6
12779 else
12780   cat >conftest.$ac_ext <<_ACEOF
12781 #line 12781 "configure"
12782 #include "confdefs.h"
12783 $ac_includes_default
12784 int
12785 main ()
12786 {
12787 if ((signed char *) 0)
12788   return 0;
12789 if (sizeof (signed char))
12790   return 0;
12791   ;
12792   return 0;
12793 }
12794 _ACEOF
12795 rm -f conftest.$ac_objext
12796 if { (eval echo "$as_me:12796: \"$ac_compile\"") >&5
12797   (eval $ac_compile) 2>&5
12798   ac_status=$?
12799   echo "$as_me:12799: \$? = $ac_status" >&5
12800   (exit $ac_status); } &&
12801          { ac_try='test -s conftest.$ac_objext'
12802   { (eval echo "$as_me:12802: \"$ac_try\"") >&5
12803   (eval $ac_try) 2>&5
12804   ac_status=$?
12805   echo "$as_me:12805: \$? = $ac_status" >&5
12806   (exit $ac_status); }; }; then
12807   ac_cv_type_signed_char=yes
12808 else
12809   echo "$as_me: failed program was:" >&5
12810 cat conftest.$ac_ext >&5
12811 ac_cv_type_signed_char=no
12812 fi
12813 rm -f conftest.$ac_objext conftest.$ac_ext
12814 fi
12815 echo "$as_me:12815: result: $ac_cv_type_signed_char" >&5
12816 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
12817
12818 echo "$as_me:12818: checking size of signed char" >&5
12819 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
12820 if test "${ac_cv_sizeof_signed_char+set}" = set; then
12821   echo $ECHO_N "(cached) $ECHO_C" >&6
12822 else
12823   if test "$ac_cv_type_signed_char" = yes; then
12824   if test "$cross_compiling" = yes; then
12825   # Depending upon the size, compute the lo and hi bounds.
12826 cat >conftest.$ac_ext <<_ACEOF
12827 #line 12827 "configure"
12828 #include "confdefs.h"
12829 $ac_includes_default
12830 int
12831 main ()
12832 {
12833 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
12834   ;
12835   return 0;
12836 }
12837 _ACEOF
12838 rm -f conftest.$ac_objext
12839 if { (eval echo "$as_me:12839: \"$ac_compile\"") >&5
12840   (eval $ac_compile) 2>&5
12841   ac_status=$?
12842   echo "$as_me:12842: \$? = $ac_status" >&5
12843   (exit $ac_status); } &&
12844          { ac_try='test -s conftest.$ac_objext'
12845   { (eval echo "$as_me:12845: \"$ac_try\"") >&5
12846   (eval $ac_try) 2>&5
12847   ac_status=$?
12848   echo "$as_me:12848: \$? = $ac_status" >&5
12849   (exit $ac_status); }; }; then
12850   ac_lo=0 ac_mid=0
12851   while :; do
12852     cat >conftest.$ac_ext <<_ACEOF
12853 #line 12853 "configure"
12854 #include "confdefs.h"
12855 $ac_includes_default
12856 int
12857 main ()
12858 {
12859 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12860   ;
12861   return 0;
12862 }
12863 _ACEOF
12864 rm -f conftest.$ac_objext
12865 if { (eval echo "$as_me:12865: \"$ac_compile\"") >&5
12866   (eval $ac_compile) 2>&5
12867   ac_status=$?
12868   echo "$as_me:12868: \$? = $ac_status" >&5
12869   (exit $ac_status); } &&
12870          { ac_try='test -s conftest.$ac_objext'
12871   { (eval echo "$as_me:12871: \"$ac_try\"") >&5
12872   (eval $ac_try) 2>&5
12873   ac_status=$?
12874   echo "$as_me:12874: \$? = $ac_status" >&5
12875   (exit $ac_status); }; }; then
12876   ac_hi=$ac_mid; break
12877 else
12878   echo "$as_me: failed program was:" >&5
12879 cat conftest.$ac_ext >&5
12880 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
12881 fi
12882 rm -f conftest.$ac_objext conftest.$ac_ext
12883   done
12884 else
12885   echo "$as_me: failed program was:" >&5
12886 cat conftest.$ac_ext >&5
12887 ac_hi=-1 ac_mid=-1
12888   while :; do
12889     cat >conftest.$ac_ext <<_ACEOF
12890 #line 12890 "configure"
12891 #include "confdefs.h"
12892 $ac_includes_default
12893 int
12894 main ()
12895 {
12896 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
12897   ;
12898   return 0;
12899 }
12900 _ACEOF
12901 rm -f conftest.$ac_objext
12902 if { (eval echo "$as_me:12902: \"$ac_compile\"") >&5
12903   (eval $ac_compile) 2>&5
12904   ac_status=$?
12905   echo "$as_me:12905: \$? = $ac_status" >&5
12906   (exit $ac_status); } &&
12907          { ac_try='test -s conftest.$ac_objext'
12908   { (eval echo "$as_me:12908: \"$ac_try\"") >&5
12909   (eval $ac_try) 2>&5
12910   ac_status=$?
12911   echo "$as_me:12911: \$? = $ac_status" >&5
12912   (exit $ac_status); }; }; then
12913   ac_lo=$ac_mid; break
12914 else
12915   echo "$as_me: failed program was:" >&5
12916 cat conftest.$ac_ext >&5
12917 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12918 fi
12919 rm -f conftest.$ac_objext conftest.$ac_ext
12920   done
12921 fi
12922 rm -f conftest.$ac_objext conftest.$ac_ext
12923 # Binary search between lo and hi bounds.
12924 while test "x$ac_lo" != "x$ac_hi"; do
12925   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12926   cat >conftest.$ac_ext <<_ACEOF
12927 #line 12927 "configure"
12928 #include "confdefs.h"
12929 $ac_includes_default
12930 int
12931 main ()
12932 {
12933 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12934   ;
12935   return 0;
12936 }
12937 _ACEOF
12938 rm -f conftest.$ac_objext
12939 if { (eval echo "$as_me:12939: \"$ac_compile\"") >&5
12940   (eval $ac_compile) 2>&5
12941   ac_status=$?
12942   echo "$as_me:12942: \$? = $ac_status" >&5
12943   (exit $ac_status); } &&
12944          { ac_try='test -s conftest.$ac_objext'
12945   { (eval echo "$as_me:12945: \"$ac_try\"") >&5
12946   (eval $ac_try) 2>&5
12947   ac_status=$?
12948   echo "$as_me:12948: \$? = $ac_status" >&5
12949   (exit $ac_status); }; }; then
12950   ac_hi=$ac_mid
12951 else
12952   echo "$as_me: failed program was:" >&5
12953 cat conftest.$ac_ext >&5
12954 ac_lo=`expr $ac_mid + 1`
12955 fi
12956 rm -f conftest.$ac_objext conftest.$ac_ext
12957 done
12958 ac_cv_sizeof_signed_char=$ac_lo
12959 else
12960   if test "$cross_compiling" = yes; then
12961   { { echo "$as_me:12961: error: cannot run test program while cross compiling" >&5
12962 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12963    { (exit 1); exit 1; }; }
12964 else
12965   cat >conftest.$ac_ext <<_ACEOF
12966 #line 12966 "configure"
12967 #include "confdefs.h"
12968 $ac_includes_default
12969 int
12970 main ()
12971 {
12972 FILE *f = fopen ("conftest.val", "w");
12973 if (!f)
12974   $ac_main_return (1);
12975 fprintf (f, "%d", (sizeof (signed char)));
12976 fclose (f);
12977   ;
12978   return 0;
12979 }
12980 _ACEOF
12981 rm -f conftest$ac_exeext
12982 if { (eval echo "$as_me:12982: \"$ac_link\"") >&5
12983   (eval $ac_link) 2>&5
12984   ac_status=$?
12985   echo "$as_me:12985: \$? = $ac_status" >&5
12986   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12987   { (eval echo "$as_me:12987: \"$ac_try\"") >&5
12988   (eval $ac_try) 2>&5
12989   ac_status=$?
12990   echo "$as_me:12990: \$? = $ac_status" >&5
12991   (exit $ac_status); }; }; then
12992   ac_cv_sizeof_signed_char=`cat conftest.val`
12993 else
12994   echo "$as_me: program exited with status $ac_status" >&5
12995 echo "$as_me: failed program was:" >&5
12996 cat conftest.$ac_ext >&5
12997 fi
12998 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12999 fi
13000 fi
13001 rm -f conftest.val
13002 else
13003   ac_cv_sizeof_signed_char=0
13004 fi
13005 fi
13006 echo "$as_me:13006: result: $ac_cv_sizeof_signed_char" >&5
13007 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13008 cat >>confdefs.h <<EOF
13009 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13010 EOF
13011
13012 echo "$as_me:13012: checking for ANSI C header files" >&5
13013 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13014 if test "${ac_cv_header_stdc+set}" = set; then
13015   echo $ECHO_N "(cached) $ECHO_C" >&6
13016 else
13017   cat >conftest.$ac_ext <<_ACEOF
13018 #line 13018 "configure"
13019 #include "confdefs.h"
13020 #include <stdlib.h>
13021 #include <stdarg.h>
13022 #include <string.h>
13023 #include <float.h>
13024
13025 _ACEOF
13026 if { (eval echo "$as_me:13026: \"$ac_cpp conftest.$ac_ext\"") >&5
13027   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13028   ac_status=$?
13029   egrep -v '^ *\+' conftest.er1 >conftest.err
13030   rm -f conftest.er1
13031   cat conftest.err >&5
13032   echo "$as_me:13032: \$? = $ac_status" >&5
13033   (exit $ac_status); } >/dev/null; then
13034   if test -s conftest.err; then
13035     ac_cpp_err=$ac_c_preproc_warn_flag
13036   else
13037     ac_cpp_err=
13038   fi
13039 else
13040   ac_cpp_err=yes
13041 fi
13042 if test -z "$ac_cpp_err"; then
13043   ac_cv_header_stdc=yes
13044 else
13045   echo "$as_me: failed program was:" >&5
13046   cat conftest.$ac_ext >&5
13047   ac_cv_header_stdc=no
13048 fi
13049 rm -f conftest.err conftest.$ac_ext
13050
13051 if test $ac_cv_header_stdc = yes; then
13052   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13053   cat >conftest.$ac_ext <<_ACEOF
13054 #line 13054 "configure"
13055 #include "confdefs.h"
13056 #include <string.h>
13057
13058 _ACEOF
13059 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13060   egrep "memchr" >/dev/null 2>&1; then
13061   :
13062 else
13063   ac_cv_header_stdc=no
13064 fi
13065 rm -rf conftest*
13066
13067 fi
13068
13069 if test $ac_cv_header_stdc = yes; then
13070   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13071   cat >conftest.$ac_ext <<_ACEOF
13072 #line 13072 "configure"
13073 #include "confdefs.h"
13074 #include <stdlib.h>
13075
13076 _ACEOF
13077 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13078   egrep "free" >/dev/null 2>&1; then
13079   :
13080 else
13081   ac_cv_header_stdc=no
13082 fi
13083 rm -rf conftest*
13084
13085 fi
13086
13087 if test $ac_cv_header_stdc = yes; then
13088   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13089   if test "$cross_compiling" = yes; then
13090   :
13091 else
13092   cat >conftest.$ac_ext <<_ACEOF
13093 #line 13093 "configure"
13094 #include "confdefs.h"
13095 #include <ctype.h>
13096 #if ((' ' & 0x0FF) == 0x020)
13097 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13098 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13099 #else
13100 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13101                      || ('j' <= (c) && (c) <= 'r') \
13102                      || ('s' <= (c) && (c) <= 'z'))
13103 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13104 #endif
13105
13106 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13107 int
13108 main ()
13109 {
13110   int i;
13111   for (i = 0; i < 256; i++)
13112     if (XOR (islower (i), ISLOWER (i))
13113         || toupper (i) != TOUPPER (i))
13114       $ac_main_return(2);
13115   $ac_main_return (0);
13116 }
13117 _ACEOF
13118 rm -f conftest$ac_exeext
13119 if { (eval echo "$as_me:13119: \"$ac_link\"") >&5
13120   (eval $ac_link) 2>&5
13121   ac_status=$?
13122   echo "$as_me:13122: \$? = $ac_status" >&5
13123   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13124   { (eval echo "$as_me:13124: \"$ac_try\"") >&5
13125   (eval $ac_try) 2>&5
13126   ac_status=$?
13127   echo "$as_me:13127: \$? = $ac_status" >&5
13128   (exit $ac_status); }; }; then
13129   :
13130 else
13131   echo "$as_me: program exited with status $ac_status" >&5
13132 echo "$as_me: failed program was:" >&5
13133 cat conftest.$ac_ext >&5
13134 ac_cv_header_stdc=no
13135 fi
13136 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13137 fi
13138 fi
13139 fi
13140 echo "$as_me:13140: result: $ac_cv_header_stdc" >&5
13141 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13142 if test $ac_cv_header_stdc = yes; then
13143
13144 cat >>confdefs.h <<\EOF
13145 #define STDC_HEADERS 1
13146 EOF
13147
13148 fi
13149
13150 ac_header_dirent=no
13151 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13152   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13153 echo "$as_me:13153: checking for $ac_hdr that defines DIR" >&5
13154 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13155 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13156   echo $ECHO_N "(cached) $ECHO_C" >&6
13157 else
13158   cat >conftest.$ac_ext <<_ACEOF
13159 #line 13159 "configure"
13160 #include "confdefs.h"
13161 #include <sys/types.h>
13162 #include <$ac_hdr>
13163
13164 int
13165 main ()
13166 {
13167 if ((DIR *) 0)
13168 return 0;
13169   ;
13170   return 0;
13171 }
13172 _ACEOF
13173 rm -f conftest.$ac_objext
13174 if { (eval echo "$as_me:13174: \"$ac_compile\"") >&5
13175   (eval $ac_compile) 2>&5
13176   ac_status=$?
13177   echo "$as_me:13177: \$? = $ac_status" >&5
13178   (exit $ac_status); } &&
13179          { ac_try='test -s conftest.$ac_objext'
13180   { (eval echo "$as_me:13180: \"$ac_try\"") >&5
13181   (eval $ac_try) 2>&5
13182   ac_status=$?
13183   echo "$as_me:13183: \$? = $ac_status" >&5
13184   (exit $ac_status); }; }; then
13185   eval "$as_ac_Header=yes"
13186 else
13187   echo "$as_me: failed program was:" >&5
13188 cat conftest.$ac_ext >&5
13189 eval "$as_ac_Header=no"
13190 fi
13191 rm -f conftest.$ac_objext conftest.$ac_ext
13192 fi
13193 echo "$as_me:13193: result: `eval echo '${'$as_ac_Header'}'`" >&5
13194 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13195 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13196   cat >>confdefs.h <<EOF
13197 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13198 EOF
13199
13200 ac_header_dirent=$ac_hdr; break
13201 fi
13202
13203 done
13204 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13205 if test $ac_header_dirent = dirent.h; then
13206   echo "$as_me:13206: checking for opendir in -ldir" >&5
13207 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13208 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13209   echo $ECHO_N "(cached) $ECHO_C" >&6
13210 else
13211   ac_check_lib_save_LIBS=$LIBS
13212 LIBS="-ldir  $LIBS"
13213 cat >conftest.$ac_ext <<_ACEOF
13214 #line 13214 "configure"
13215 #include "confdefs.h"
13216
13217 /* Override any gcc2 internal prototype to avoid an error.  */
13218 #ifdef __cplusplus
13219 extern "C"
13220 #endif
13221 /* We use char because int might match the return type of a gcc2
13222    builtin and then its argument prototype would still apply.  */
13223 char opendir ();
13224 int
13225 main ()
13226 {
13227 opendir ();
13228   ;
13229   return 0;
13230 }
13231 _ACEOF
13232 rm -f conftest.$ac_objext conftest$ac_exeext
13233 if { (eval echo "$as_me:13233: \"$ac_link\"") >&5
13234   (eval $ac_link) 2>&5
13235   ac_status=$?
13236   echo "$as_me:13236: \$? = $ac_status" >&5
13237   (exit $ac_status); } &&
13238          { ac_try='test -s conftest$ac_exeext'
13239   { (eval echo "$as_me:13239: \"$ac_try\"") >&5
13240   (eval $ac_try) 2>&5
13241   ac_status=$?
13242   echo "$as_me:13242: \$? = $ac_status" >&5
13243   (exit $ac_status); }; }; then
13244   ac_cv_lib_dir_opendir=yes
13245 else
13246   echo "$as_me: failed program was:" >&5
13247 cat conftest.$ac_ext >&5
13248 ac_cv_lib_dir_opendir=no
13249 fi
13250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13251 LIBS=$ac_check_lib_save_LIBS
13252 fi
13253 echo "$as_me:13253: result: $ac_cv_lib_dir_opendir" >&5
13254 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13255 if test $ac_cv_lib_dir_opendir = yes; then
13256   LIBS="$LIBS -ldir"
13257 fi
13258
13259 else
13260   echo "$as_me:13260: checking for opendir in -lx" >&5
13261 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13262 if test "${ac_cv_lib_x_opendir+set}" = set; then
13263   echo $ECHO_N "(cached) $ECHO_C" >&6
13264 else
13265   ac_check_lib_save_LIBS=$LIBS
13266 LIBS="-lx  $LIBS"
13267 cat >conftest.$ac_ext <<_ACEOF
13268 #line 13268 "configure"
13269 #include "confdefs.h"
13270
13271 /* Override any gcc2 internal prototype to avoid an error.  */
13272 #ifdef __cplusplus
13273 extern "C"
13274 #endif
13275 /* We use char because int might match the return type of a gcc2
13276    builtin and then its argument prototype would still apply.  */
13277 char opendir ();
13278 int
13279 main ()
13280 {
13281 opendir ();
13282   ;
13283   return 0;
13284 }
13285 _ACEOF
13286 rm -f conftest.$ac_objext conftest$ac_exeext
13287 if { (eval echo "$as_me:13287: \"$ac_link\"") >&5
13288   (eval $ac_link) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit $ac_status); } &&
13292          { ac_try='test -s conftest$ac_exeext'
13293   { (eval echo "$as_me:13293: \"$ac_try\"") >&5
13294   (eval $ac_try) 2>&5
13295   ac_status=$?
13296   echo "$as_me:13296: \$? = $ac_status" >&5
13297   (exit $ac_status); }; }; then
13298   ac_cv_lib_x_opendir=yes
13299 else
13300   echo "$as_me: failed program was:" >&5
13301 cat conftest.$ac_ext >&5
13302 ac_cv_lib_x_opendir=no
13303 fi
13304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13305 LIBS=$ac_check_lib_save_LIBS
13306 fi
13307 echo "$as_me:13307: result: $ac_cv_lib_x_opendir" >&5
13308 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13309 if test $ac_cv_lib_x_opendir = yes; then
13310   LIBS="$LIBS -lx"
13311 fi
13312
13313 fi
13314
13315 echo "$as_me:13315: checking whether time.h and sys/time.h may both be included" >&5
13316 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13317 if test "${ac_cv_header_time+set}" = set; then
13318   echo $ECHO_N "(cached) $ECHO_C" >&6
13319 else
13320   cat >conftest.$ac_ext <<_ACEOF
13321 #line 13321 "configure"
13322 #include "confdefs.h"
13323 #include <sys/types.h>
13324 #include <sys/time.h>
13325 #include <time.h>
13326
13327 int
13328 main ()
13329 {
13330 if ((struct tm *) 0)
13331 return 0;
13332   ;
13333   return 0;
13334 }
13335 _ACEOF
13336 rm -f conftest.$ac_objext
13337 if { (eval echo "$as_me:13337: \"$ac_compile\"") >&5
13338   (eval $ac_compile) 2>&5
13339   ac_status=$?
13340   echo "$as_me:13340: \$? = $ac_status" >&5
13341   (exit $ac_status); } &&
13342          { ac_try='test -s conftest.$ac_objext'
13343   { (eval echo "$as_me:13343: \"$ac_try\"") >&5
13344   (eval $ac_try) 2>&5
13345   ac_status=$?
13346   echo "$as_me:13346: \$? = $ac_status" >&5
13347   (exit $ac_status); }; }; then
13348   ac_cv_header_time=yes
13349 else
13350   echo "$as_me: failed program was:" >&5
13351 cat conftest.$ac_ext >&5
13352 ac_cv_header_time=no
13353 fi
13354 rm -f conftest.$ac_objext conftest.$ac_ext
13355 fi
13356 echo "$as_me:13356: result: $ac_cv_header_time" >&5
13357 echo "${ECHO_T}$ac_cv_header_time" >&6
13358 if test $ac_cv_header_time = yes; then
13359
13360 cat >>confdefs.h <<\EOF
13361 #define TIME_WITH_SYS_TIME 1
13362 EOF
13363
13364 fi
13365
13366 ###     checks for compiler characteristics
13367 ac_ext=c
13368 ac_cpp='$CPP $CPPFLAGS'
13369 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13370 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13371 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13372 ac_main_return=return
13373
13374 echo "$as_me:13374: checking for an ANSI C-conforming const" >&5
13375 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13376 if test "${ac_cv_c_const+set}" = set; then
13377   echo $ECHO_N "(cached) $ECHO_C" >&6
13378 else
13379   cat >conftest.$ac_ext <<_ACEOF
13380 #line 13380 "configure"
13381 #include "confdefs.h"
13382
13383 int
13384 main ()
13385 {
13386 /* FIXME: Include the comments suggested by Paul. */
13387 #ifndef __cplusplus
13388   /* Ultrix mips cc rejects this.  */
13389   typedef int charset[2];
13390   const charset x;
13391   /* SunOS 4.1.1 cc rejects this.  */
13392   char const *const *ccp;
13393   char **p;
13394   /* NEC SVR4.0.2 mips cc rejects this.  */
13395   struct point {int x, y;};
13396   static struct point const zero = {0,0};
13397   /* AIX XL C 1.02.0.0 rejects this.
13398      It does not let you subtract one const X* pointer from another in
13399      an arm of an if-expression whose if-part is not a constant
13400      expression */
13401   const char *g = "string";
13402   ccp = &g + (g ? g-g : 0);
13403   /* HPUX 7.0 cc rejects these. */
13404   ++ccp;
13405   p = (char**) ccp;
13406   ccp = (char const *const *) p;
13407   { /* SCO 3.2v4 cc rejects this.  */
13408     char *t;
13409     char const *s = 0 ? (char *) 0 : (char const *) 0;
13410
13411     *t++ = 0;
13412   }
13413   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13414     int x[] = {25, 17};
13415     const int *foo = &x[0];
13416     ++foo;
13417   }
13418   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13419     typedef const int *iptr;
13420     iptr p = 0;
13421     ++p;
13422   }
13423   { /* AIX XL C 1.02.0.0 rejects this saying
13424        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13425     struct s { int j; const int *ap[3]; };
13426     struct s *b; b->j = 5;
13427   }
13428   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13429     const int foo = 10;
13430   }
13431 #endif
13432
13433   ;
13434   return 0;
13435 }
13436 _ACEOF
13437 rm -f conftest.$ac_objext
13438 if { (eval echo "$as_me:13438: \"$ac_compile\"") >&5
13439   (eval $ac_compile) 2>&5
13440   ac_status=$?
13441   echo "$as_me:13441: \$? = $ac_status" >&5
13442   (exit $ac_status); } &&
13443          { ac_try='test -s conftest.$ac_objext'
13444   { (eval echo "$as_me:13444: \"$ac_try\"") >&5
13445   (eval $ac_try) 2>&5
13446   ac_status=$?
13447   echo "$as_me:13447: \$? = $ac_status" >&5
13448   (exit $ac_status); }; }; then
13449   ac_cv_c_const=yes
13450 else
13451   echo "$as_me: failed program was:" >&5
13452 cat conftest.$ac_ext >&5
13453 ac_cv_c_const=no
13454 fi
13455 rm -f conftest.$ac_objext conftest.$ac_ext
13456 fi
13457 echo "$as_me:13457: result: $ac_cv_c_const" >&5
13458 echo "${ECHO_T}$ac_cv_c_const" >&6
13459 if test $ac_cv_c_const = no; then
13460
13461 cat >>confdefs.h <<\EOF
13462 #define const
13463 EOF
13464
13465 fi
13466
13467 ###     Checks for external-data
13468
13469 echo "$as_me:13469: checking if data-only library module links" >&5
13470 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13471 if test "${cf_cv_link_dataonly+set}" = set; then
13472   echo $ECHO_N "(cached) $ECHO_C" >&6
13473 else
13474
13475         rm -f conftest.a
13476         cat >conftest.$ac_ext <<EOF
13477 #line 13477 "configure"
13478 int     testdata[3] = { 123, 456, 789 };
13479 EOF
13480         if { (eval echo "$as_me:13480: \"$ac_compile\"") >&5
13481   (eval $ac_compile) 2>&5
13482   ac_status=$?
13483   echo "$as_me:13483: \$? = $ac_status" >&5
13484   (exit $ac_status); } ; then
13485                 mv conftest.o data.o && \
13486                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13487         fi
13488         rm -f conftest.$ac_ext data.o
13489         cat >conftest.$ac_ext <<EOF
13490 #line 13490 "configure"
13491 int     testfunc()
13492 {
13493 #if defined(NeXT)
13494         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13495 #else
13496         extern int testdata[3];
13497         return testdata[0] == 123
13498            &&  testdata[1] == 456
13499            &&  testdata[2] == 789;
13500 #endif
13501 }
13502 EOF
13503         if { (eval echo "$as_me:13503: \"$ac_compile\"") >&5
13504   (eval $ac_compile) 2>&5
13505   ac_status=$?
13506   echo "$as_me:13506: \$? = $ac_status" >&5
13507   (exit $ac_status); }; then
13508                 mv conftest.o func.o && \
13509                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13510         fi
13511         rm -f conftest.$ac_ext func.o
13512         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13513         cf_saveLIBS="$LIBS"
13514         LIBS="conftest.a $LIBS"
13515         if test "$cross_compiling" = yes; then
13516   cf_cv_link_dataonly=unknown
13517 else
13518   cat >conftest.$ac_ext <<_ACEOF
13519 #line 13519 "configure"
13520 #include "confdefs.h"
13521
13522         int main()
13523         {
13524                 extern int testfunc();
13525                 ${cf_cv_main_return:-return} (!testfunc());
13526         }
13527
13528 _ACEOF
13529 rm -f conftest$ac_exeext
13530 if { (eval echo "$as_me:13530: \"$ac_link\"") >&5
13531   (eval $ac_link) 2>&5
13532   ac_status=$?
13533   echo "$as_me:13533: \$? = $ac_status" >&5
13534   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13535   { (eval echo "$as_me:13535: \"$ac_try\"") >&5
13536   (eval $ac_try) 2>&5
13537   ac_status=$?
13538   echo "$as_me:13538: \$? = $ac_status" >&5
13539   (exit $ac_status); }; }; then
13540   cf_cv_link_dataonly=yes
13541 else
13542   echo "$as_me: program exited with status $ac_status" >&5
13543 echo "$as_me: failed program was:" >&5
13544 cat conftest.$ac_ext >&5
13545 cf_cv_link_dataonly=no
13546 fi
13547 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13548 fi
13549         LIBS="$cf_saveLIBS"
13550
13551 fi
13552
13553 echo "$as_me:13553: result: $cf_cv_link_dataonly" >&5
13554 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13555
13556 if test "$cf_cv_link_dataonly" = no ; then
13557
13558 cat >>confdefs.h <<\EOF
13559 #define BROKEN_LINKER 1
13560 EOF
13561
13562         BROKEN_LINKER=1
13563 fi
13564
13565 ###     Checks for library functions.
13566
13567 echo "$as_me:13567: checking for working mkstemp" >&5
13568 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13569 if test "${cf_cv_func_mkstemp+set}" = set; then
13570   echo $ECHO_N "(cached) $ECHO_C" >&6
13571 else
13572
13573 rm -rf conftest*
13574 if test "$cross_compiling" = yes; then
13575   cf_cv_func_mkstemp=maybe
13576 else
13577   cat >conftest.$ac_ext <<_ACEOF
13578 #line 13578 "configure"
13579 #include "confdefs.h"
13580
13581 #include <sys/types.h>
13582 #include <stdlib.h>
13583 #include <stdio.h>
13584 #include <string.h>
13585 #include <sys/stat.h>
13586 int main()
13587 {
13588         char *tmpl = "conftestXXXXXX";
13589         char name[2][80];
13590         int n;
13591         int result = 0;
13592         int fd;
13593         struct stat sb;
13594
13595         umask(077);
13596         for (n = 0; n < 2; ++n) {
13597                 strcpy(name[n], tmpl);
13598                 if ((fd = mkstemp(name[n])) >= 0) {
13599                         if (!strcmp(name[n], tmpl)
13600                          || stat(name[n], &sb) != 0
13601                          || (sb.st_mode & S_IFMT) != S_IFREG
13602                          || (sb.st_mode & 077) != 0) {
13603                                 result = 1;
13604                         }
13605                         close(fd);
13606                 }
13607         }
13608         if (result == 0
13609          && !strcmp(name[0], name[1]))
13610                 result = 1;
13611         ${cf_cv_main_return:-return}(result);
13612 }
13613
13614 _ACEOF
13615 rm -f conftest$ac_exeext
13616 if { (eval echo "$as_me:13616: \"$ac_link\"") >&5
13617   (eval $ac_link) 2>&5
13618   ac_status=$?
13619   echo "$as_me:13619: \$? = $ac_status" >&5
13620   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13621   { (eval echo "$as_me:13621: \"$ac_try\"") >&5
13622   (eval $ac_try) 2>&5
13623   ac_status=$?
13624   echo "$as_me:13624: \$? = $ac_status" >&5
13625   (exit $ac_status); }; }; then
13626   cf_cv_func_mkstemp=yes
13627
13628 else
13629   echo "$as_me: program exited with status $ac_status" >&5
13630 echo "$as_me: failed program was:" >&5
13631 cat conftest.$ac_ext >&5
13632 cf_cv_func_mkstemp=no
13633
13634 fi
13635 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13636 fi
13637
13638 fi
13639 echo "$as_me:13639: result: $cf_cv_func_mkstemp" >&5
13640 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13641 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13642         echo "$as_me:13642: checking for mkstemp" >&5
13643 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13644 if test "${ac_cv_func_mkstemp+set}" = set; then
13645   echo $ECHO_N "(cached) $ECHO_C" >&6
13646 else
13647   cat >conftest.$ac_ext <<_ACEOF
13648 #line 13648 "configure"
13649 #include "confdefs.h"
13650 /* System header to define __stub macros and hopefully few prototypes,
13651     which can conflict with char mkstemp (); below.  */
13652 #include <assert.h>
13653 /* Override any gcc2 internal prototype to avoid an error.  */
13654 #ifdef __cplusplus
13655 extern "C"
13656 #endif
13657 /* We use char because int might match the return type of a gcc2
13658    builtin and then its argument prototype would still apply.  */
13659 char mkstemp ();
13660 char (*f) ();
13661
13662 int
13663 main ()
13664 {
13665 /* The GNU C library defines this for functions which it implements
13666     to always fail with ENOSYS.  Some functions are actually named
13667     something starting with __ and the normal name is an alias.  */
13668 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13669 choke me
13670 #else
13671 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13672 #endif
13673
13674   ;
13675   return 0;
13676 }
13677 _ACEOF
13678 rm -f conftest.$ac_objext conftest$ac_exeext
13679 if { (eval echo "$as_me:13679: \"$ac_link\"") >&5
13680   (eval $ac_link) 2>&5
13681   ac_status=$?
13682   echo "$as_me:13682: \$? = $ac_status" >&5
13683   (exit $ac_status); } &&
13684          { ac_try='test -s conftest$ac_exeext'
13685   { (eval echo "$as_me:13685: \"$ac_try\"") >&5
13686   (eval $ac_try) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); }; }; then
13690   ac_cv_func_mkstemp=yes
13691 else
13692   echo "$as_me: failed program was:" >&5
13693 cat conftest.$ac_ext >&5
13694 ac_cv_func_mkstemp=no
13695 fi
13696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13697 fi
13698 echo "$as_me:13698: result: $ac_cv_func_mkstemp" >&5
13699 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13700
13701 fi
13702 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13703
13704 cat >>confdefs.h <<\EOF
13705 #define HAVE_MKSTEMP 1
13706 EOF
13707
13708 fi
13709
13710 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13711         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13712         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13713 fi
13714
13715 cf_with_ada=yes
13716 if test "$cf_with_ada" != "no" ; then
13717
13718 cf_ada_make=gnatmake
13719 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13720 set dummy $cf_ada_make; ac_word=$2
13721 echo "$as_me:13721: checking for $ac_word" >&5
13722 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13723 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13724   echo $ECHO_N "(cached) $ECHO_C" >&6
13725 else
13726   if test -n "$gnat_exists"; then
13727   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13728 else
13729   ac_save_IFS=$IFS; IFS=$ac_path_separator
13730 ac_dummy="$PATH"
13731 for ac_dir in $ac_dummy; do
13732   IFS=$ac_save_IFS
13733   test -z "$ac_dir" && ac_dir=.
13734   $as_executable_p "$ac_dir/$ac_word" || continue
13735 ac_cv_prog_gnat_exists="yes"
13736 echo "$as_me:13736: found $ac_dir/$ac_word" >&5
13737 break
13738 done
13739
13740   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13741 fi
13742 fi
13743 gnat_exists=$ac_cv_prog_gnat_exists
13744 if test -n "$gnat_exists"; then
13745   echo "$as_me:13745: result: $gnat_exists" >&5
13746 echo "${ECHO_T}$gnat_exists" >&6
13747 else
13748   echo "$as_me:13748: result: no" >&5
13749 echo "${ECHO_T}no" >&6
13750 fi
13751
13752 if test "$ac_cv_prog_gnat_exists" = no; then
13753         cf_ada_make=
13754         cf_cv_prog_gnat_correct=no
13755 else
13756
13757 echo "$as_me:13757: checking for gnat version" >&5
13758 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13759 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13760         grep '[0-9].[0-9][0-9]*' |\
13761         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13762 echo "$as_me:13762: result: $cf_gnat_version" >&5
13763 echo "${ECHO_T}$cf_gnat_version" >&6
13764
13765 case $cf_gnat_version in
13766 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13767         cf_cv_prog_gnat_correct=yes
13768         ;;
13769 (*)
13770         { echo "$as_me:13770: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13771 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13772         cf_cv_prog_gnat_correct=no
13773         ;;
13774 esac
13775
13776         # Extract the first word of "m4", so it can be a program name with args.
13777 set dummy m4; ac_word=$2
13778 echo "$as_me:13778: checking for $ac_word" >&5
13779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13780 if test "${ac_cv_prog_M4_exists+set}" = set; then
13781   echo $ECHO_N "(cached) $ECHO_C" >&6
13782 else
13783   if test -n "$M4_exists"; then
13784   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13785 else
13786   ac_save_IFS=$IFS; IFS=$ac_path_separator
13787 ac_dummy="$PATH"
13788 for ac_dir in $ac_dummy; do
13789   IFS=$ac_save_IFS
13790   test -z "$ac_dir" && ac_dir=.
13791   $as_executable_p "$ac_dir/$ac_word" || continue
13792 ac_cv_prog_M4_exists="yes"
13793 echo "$as_me:13793: found $ac_dir/$ac_word" >&5
13794 break
13795 done
13796
13797   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13798 fi
13799 fi
13800 M4_exists=$ac_cv_prog_M4_exists
13801 if test -n "$M4_exists"; then
13802   echo "$as_me:13802: result: $M4_exists" >&5
13803 echo "${ECHO_T}$M4_exists" >&6
13804 else
13805   echo "$as_me:13805: result: no" >&5
13806 echo "${ECHO_T}no" >&6
13807 fi
13808
13809         if test "$ac_cv_prog_M4_exists" = no; then
13810                 cf_cv_prog_gnat_correct=no
13811                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13812         fi
13813         if test "$cf_cv_prog_gnat_correct" = yes; then
13814                 echo "$as_me:13814: checking if GNAT works" >&5
13815 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13816
13817 rm -rf conftest* *~conftest*
13818 cat >>conftest.ads <<CF_EOF
13819 procedure conftest;
13820 CF_EOF
13821 cat >>conftest.adb <<CF_EOF
13822 with Text_IO;
13823 with GNAT.OS_Lib;
13824 procedure conftest is
13825 begin
13826    Text_IO.Put ("Hello World");
13827    Text_IO.New_Line;
13828    GNAT.OS_Lib.OS_Exit (0);
13829 end conftest;
13830 CF_EOF
13831 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13832    if ( ./conftest 1>&5 2>&1 ) ; then
13833       cf_cv_prog_gnat_correct=yes
13834    else
13835       cf_cv_prog_gnat_correct=no
13836    fi
13837 else
13838    cf_cv_prog_gnat_correct=no
13839 fi
13840 rm -rf conftest* *~conftest*
13841
13842                 echo "$as_me:13842: result: $cf_cv_prog_gnat_correct" >&5
13843 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13844         fi
13845 fi
13846
13847         if test "$cf_cv_prog_gnat_correct" = yes; then
13848
13849         echo "$as_me:13849: checking optimization options for ADAFLAGS" >&5
13850 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13851         case "$CFLAGS" in
13852         (*-g*)
13853
13854         ADAFLAGS="$ADAFLAGS -g"
13855
13856                 ;;
13857         esac
13858         case "$CFLAGS" in
13859         (*-O*)
13860                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13861
13862         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13863
13864                 ;;
13865         esac
13866         echo "$as_me:13866: result: $ADAFLAGS" >&5
13867 echo "${ECHO_T}$ADAFLAGS" >&6
13868
13869 echo "$as_me:13869: checking if GNATPREP supports -T option" >&5
13870 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13871 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13872   echo $ECHO_N "(cached) $ECHO_C" >&6
13873 else
13874
13875 cf_cv_gnatprep_opt_t=no
13876 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13877
13878 fi
13879 echo "$as_me:13879: result: $cf_cv_gnatprep_opt_t" >&5
13880 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13881 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13882
13883 echo "$as_me:13883: checking if GNAT supports generics" >&5
13884 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13885 case $cf_gnat_version in
13886 (3.[1-9]*|[4-9].*)
13887         cf_gnat_generics=yes
13888         ;;
13889 (*)
13890         cf_gnat_generics=no
13891         ;;
13892 esac
13893 echo "$as_me:13893: result: $cf_gnat_generics" >&5
13894 echo "${ECHO_T}$cf_gnat_generics" >&6
13895
13896 if test "$cf_gnat_generics" = yes
13897 then
13898         cf_compile_generics=generics
13899         cf_generic_objects="\${GENOBJS}"
13900 else
13901         cf_compile_generics=
13902         cf_generic_objects=
13903 fi
13904
13905 echo "$as_me:13905: checking if GNAT supports SIGINT" >&5
13906 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13907 if test "${cf_cv_gnat_sigint+set}" = set; then
13908   echo $ECHO_N "(cached) $ECHO_C" >&6
13909 else
13910
13911 rm -rf conftest* *~conftest*
13912 cat >>conftest.ads <<CF_EOF
13913 with Ada.Interrupts.Names;
13914
13915 package ConfTest is
13916
13917    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13918    pragma Unreserve_All_Interrupts;
13919    pragma Warnings (On);
13920
13921    protected Process is
13922       procedure Stop;
13923       function Continue return Boolean;
13924       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13925    private
13926       Done : Boolean := False;
13927    end Process;
13928
13929 end ConfTest;
13930 CF_EOF
13931 cat >>conftest.adb <<CF_EOF
13932 package body ConfTest is
13933    protected body Process is
13934       procedure Stop is
13935       begin
13936          Done := True;
13937       end Stop;
13938       function Continue return Boolean is
13939       begin
13940          return not Done;
13941       end Continue;
13942    end Process;
13943 end ConfTest;
13944 CF_EOF
13945 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13946       cf_cv_gnat_sigint=yes
13947 else
13948    cf_cv_gnat_sigint=no
13949 fi
13950 rm -rf conftest* *~conftest*
13951
13952 fi
13953 echo "$as_me:13953: result: $cf_cv_gnat_sigint" >&5
13954 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13955
13956 if test $cf_cv_gnat_sigint = yes ; then
13957         USE_GNAT_SIGINT=""
13958 else
13959         USE_GNAT_SIGINT="#"
13960 fi
13961
13962 cf_gnat_libraries=no
13963 cf_gnat_projects=no
13964
13965 if test "$enable_gnat_projects" != no ; then
13966 echo "$as_me:13966: checking if GNAT supports project files" >&5
13967 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13968 case $cf_gnat_version in
13969 (3.[0-9]*)
13970         ;;
13971 (*)
13972         case $cf_cv_system_name in
13973         (cygwin*|msys*)
13974                 ;;
13975         (*)
13976                 mkdir conftest.src conftest.bin conftest.lib
13977                 cd conftest.src
13978                 rm -rf conftest* *~conftest*
13979                 cat >>library.gpr <<CF_EOF
13980 project Library is
13981   Kind := External ("LIB_KIND");
13982   for Library_Name use "ConfTest";
13983   for Object_Dir use ".";
13984   for Library_ALI_Dir use External("LIBRARY_DIR");
13985   for Library_Version use External ("SONAME");
13986   for Library_Kind use Kind;
13987   for Library_Dir use External("BUILD_DIR");
13988   Source_Dir := External ("SOURCE_DIR");
13989   for Source_Dirs use (Source_Dir);
13990 end Library;
13991 CF_EOF
13992                 cat >>confpackage.ads <<CF_EOF
13993 package ConfPackage is
13994    procedure conftest;
13995 end ConfPackage;
13996 CF_EOF
13997                 cat >>confpackage.adb <<CF_EOF
13998 with Text_IO;
13999 package body ConfPackage is
14000    procedure conftest is
14001    begin
14002       Text_IO.Put ("Hello World");
14003       Text_IO.New_Line;
14004    end conftest;
14005 end ConfPackage;
14006 CF_EOF
14007                 if ( $cf_ada_make $ADAFLAGS \
14008                                 -Plibrary.gpr \
14009                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14010                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14011                                 -XSOURCE_DIR=`pwd` \
14012                                 -XSONAME=libConfTest.so.1 \
14013                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
14014                         cf_gnat_projects=yes
14015                 fi
14016                 cd ..
14017                 if test -f conftest.lib/confpackage.ali
14018                 then
14019                         cf_gnat_libraries=yes
14020                 fi
14021                 rm -rf conftest* *~conftest*
14022                 ;;
14023         esac
14024         ;;
14025 esac
14026 echo "$as_me:14026: result: $cf_gnat_projects" >&5
14027 echo "${ECHO_T}$cf_gnat_projects" >&6
14028 fi # enable_gnat_projects
14029
14030 if test $cf_gnat_projects = yes
14031 then
14032         echo "$as_me:14032: checking if GNAT supports libraries" >&5
14033 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14034         echo "$as_me:14034: result: $cf_gnat_libraries" >&5
14035 echo "${ECHO_T}$cf_gnat_libraries" >&6
14036 fi
14037
14038 if test "$cf_gnat_projects" = yes
14039 then
14040         USE_OLD_MAKERULES="#"
14041         USE_GNAT_PROJECTS=""
14042 else
14043         USE_OLD_MAKERULES=""
14044         USE_GNAT_PROJECTS="#"
14045 fi
14046
14047 if test "$cf_gnat_libraries" = yes
14048 then
14049         USE_GNAT_LIBRARIES=""
14050 else
14051         USE_GNAT_LIBRARIES="#"
14052 fi
14053
14054 echo "$as_me:14054: checking for ada-compiler" >&5
14055 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14056
14057 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14058 if test "${with_ada_compiler+set}" = set; then
14059   withval="$with_ada_compiler"
14060   cf_ada_compiler=$withval
14061 else
14062   cf_ada_compiler=gnatmake
14063 fi;
14064
14065 echo "$as_me:14065: result: $cf_ada_compiler" >&5
14066 echo "${ECHO_T}$cf_ada_compiler" >&6
14067
14068                 cf_ada_package=terminal_interface
14069
14070 echo "$as_me:14070: checking for ada-include" >&5
14071 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14072
14073 # Check whether --with-ada-include or --without-ada-include was given.
14074 if test "${with_ada_include+set}" = set; then
14075   withval="$with_ada_include"
14076
14077 else
14078   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14079 fi; if test -n "$prefix/share/ada/adainclude" ; then
14080
14081 if test "x$prefix" != xNONE; then
14082         cf_path_syntax="$prefix"
14083 else
14084         cf_path_syntax="$ac_default_prefix"
14085 fi
14086
14087 case ".$withval" in
14088 (.\$\(*\)*|.\'*\'*)
14089         ;;
14090 (..|./*|.\\*)
14091         ;;
14092 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14093         ;;
14094 (.\${*prefix}*|.\${*dir}*)
14095         eval withval="$withval"
14096         case ".$withval" in
14097         (.NONE/*)
14098                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14099                 ;;
14100         esac
14101         ;;
14102 (.no|.NONE/*)
14103         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14104         ;;
14105 (*)
14106         { { echo "$as_me:14106: error: expected a pathname, not \"$withval\"" >&5
14107 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14108    { (exit 1); exit 1; }; }
14109         ;;
14110 esac
14111
14112 fi
14113 eval ADA_INCLUDE="$withval"
14114
14115 echo "$as_me:14115: result: $ADA_INCLUDE" >&5
14116 echo "${ECHO_T}$ADA_INCLUDE" >&6
14117
14118 echo "$as_me:14118: checking for ada-objects" >&5
14119 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14120
14121 # Check whether --with-ada-objects or --without-ada-objects was given.
14122 if test "${with_ada_objects+set}" = set; then
14123   withval="$with_ada_objects"
14124
14125 else
14126   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14127 fi; if test -n "$prefix/lib/ada/adalib" ; then
14128
14129 if test "x$prefix" != xNONE; then
14130         cf_path_syntax="$prefix"
14131 else
14132         cf_path_syntax="$ac_default_prefix"
14133 fi
14134
14135 case ".$withval" in
14136 (.\$\(*\)*|.\'*\'*)
14137         ;;
14138 (..|./*|.\\*)
14139         ;;
14140 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14141         ;;
14142 (.\${*prefix}*|.\${*dir}*)
14143         eval withval="$withval"
14144         case ".$withval" in
14145         (.NONE/*)
14146                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14147                 ;;
14148         esac
14149         ;;
14150 (.no|.NONE/*)
14151         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14152         ;;
14153 (*)
14154         { { echo "$as_me:14154: error: expected a pathname, not \"$withval\"" >&5
14155 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14156    { (exit 1); exit 1; }; }
14157         ;;
14158 esac
14159
14160 fi
14161 eval ADA_OBJECTS="$withval"
14162
14163 echo "$as_me:14163: result: $ADA_OBJECTS" >&5
14164 echo "${ECHO_T}$ADA_OBJECTS" >&6
14165
14166 echo "$as_me:14166: checking if an Ada95 shared-library should be built" >&5
14167 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14168
14169 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14170 if test "${with_ada_sharedlib+set}" = set; then
14171   withval="$with_ada_sharedlib"
14172   with_ada_sharedlib=$withval
14173 else
14174   with_ada_sharedlib=no
14175 fi;
14176 echo "$as_me:14176: result: $with_ada_sharedlib" >&5
14177 echo "${ECHO_T}$with_ada_sharedlib" >&6
14178
14179 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14180 MAKE_ADA_SHAREDLIB="#"
14181
14182 if test "x$with_ada_sharedlib" != xno
14183 then
14184         MAKE_ADA_SHAREDLIB=
14185         if test "x$with_ada_sharedlib" != xyes
14186         then
14187                 ADA_SHAREDLIB="$with_ada_sharedlib"
14188         fi
14189 fi
14190
14191         else
14192                 { { echo "$as_me:14192: error: No usable Ada compiler found" >&5
14193 echo "$as_me: error: No usable Ada compiler found" >&2;}
14194    { (exit 1); exit 1; }; }
14195         fi
14196 else
14197         { { echo "$as_me:14197: error: The Ada compiler is needed for this package" >&5
14198 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14199    { (exit 1); exit 1; }; }
14200 fi
14201
14202 ################################################################################
14203
14204 # not needed
14205 TINFO_LDFLAGS2=
14206
14207 TINFO_LIBS=
14208
14209 ### Construct the list of include-directories to be generated
14210
14211 if test "$srcdir" != "."; then
14212         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14213 fi
14214 CPPFLAGS="-I../include $CPPFLAGS"
14215 if test "$srcdir" != "."; then
14216         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14217 fi
14218 CPPFLAGS="-I. $CPPFLAGS"
14219
14220 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14221 if test "$srcdir" != "."; then
14222         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14223 fi
14224 if test "$GCC" != yes; then
14225         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14226 elif test "$includedir" != "/usr/include"; then
14227         if test "$includedir" = '${prefix}/include' ; then
14228                 if test x$prefix != x/usr ; then
14229                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14230                 fi
14231         else
14232                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14233         fi
14234 fi
14235
14236 ### Build up pieces for makefile rules
14237 echo "$as_me:14237: checking default library suffix" >&5
14238 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14239
14240         case $DFT_LWR_MODEL in
14241         (libtool) DFT_ARG_SUFFIX=''   ;;
14242         (normal)  DFT_ARG_SUFFIX=''   ;;
14243         (debug)   DFT_ARG_SUFFIX='_g' ;;
14244         (profile) DFT_ARG_SUFFIX='_p' ;;
14245         (shared)  DFT_ARG_SUFFIX=''   ;;
14246         esac
14247         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14248 echo "$as_me:14248: result: $DFT_ARG_SUFFIX" >&5
14249 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14250
14251 echo "$as_me:14251: checking default library-dependency suffix" >&5
14252 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14253
14254         case X$DFT_LWR_MODEL in
14255         (Xlibtool)
14256                 DFT_LIB_SUFFIX='.la'
14257                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14258                 ;;
14259         (Xdebug)
14260                 DFT_LIB_SUFFIX='_g.a'
14261                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14262                 ;;
14263         (Xprofile)
14264                 DFT_LIB_SUFFIX='_p.a'
14265                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14266                 ;;
14267         (Xshared)
14268                 case $cf_cv_system_name in
14269                 (aix[5-7]*)
14270                         DFT_LIB_SUFFIX='.so'
14271                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14272                         ;;
14273                 (cygwin*|msys*|mingw*)
14274                         DFT_LIB_SUFFIX='.dll'
14275                         DFT_DEP_SUFFIX='.dll.a'
14276                         ;;
14277                 (darwin*)
14278                         DFT_LIB_SUFFIX='.dylib'
14279                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14280                         ;;
14281                 (hpux*)
14282                         case $target in
14283                         (ia64*)
14284                                 DFT_LIB_SUFFIX='.so'
14285                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14286                                 ;;
14287                         (*)
14288                                 DFT_LIB_SUFFIX='.sl'
14289                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14290                                 ;;
14291                         esac
14292                         ;;
14293                 (*)
14294                         DFT_LIB_SUFFIX='.so'
14295                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14296                         ;;
14297                 esac
14298                 ;;
14299         (*)
14300                 DFT_LIB_SUFFIX='.a'
14301                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14302                 ;;
14303         esac
14304         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14305         then
14306                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14307                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14308         fi
14309 echo "$as_me:14309: result: $DFT_DEP_SUFFIX" >&5
14310 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14311
14312 echo "$as_me:14312: checking default object directory" >&5
14313 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14314
14315         case $DFT_LWR_MODEL in
14316         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14317         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14318         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14319         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14320         (shared)
14321                 case $cf_cv_system_name in
14322                 (cygwin|msys)
14323                         DFT_OBJ_SUBDIR='objects' ;;
14324                 (*)
14325                         DFT_OBJ_SUBDIR='obj_s' ;;
14326                 esac
14327         esac
14328 echo "$as_me:14328: result: $DFT_OBJ_SUBDIR" >&5
14329 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14330
14331 ### Set up low-level terminfo dependencies for makefiles.
14332
14333 if test "$DFT_LWR_MODEL" = shared ; then
14334         case $cf_cv_system_name in
14335         (cygwin*)
14336                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14337                 ;;
14338         (msys*)
14339                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14340                 ;;
14341         esac
14342 fi
14343
14344 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14345
14346 ### Construct the list of subdirectories for which we'll customize makefiles
14347 ### with the appropriate compile-rules.
14348
14349 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14350
14351 cat >>confdefs.h <<EOF
14352 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14353 EOF
14354
14355 ### Now that we're done running tests, add the compiler-warnings, if any
14356
14357 cf_fix_cppflags=no
14358 cf_new_cflags=
14359 cf_new_cppflags=
14360 cf_new_extra_cppflags=
14361
14362 for cf_add_cflags in $EXTRA_CFLAGS
14363 do
14364 case $cf_fix_cppflags in
14365 (no)
14366         case $cf_add_cflags in
14367         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14368                 case $cf_add_cflags in
14369                 (-D*)
14370                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14371
14372                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14373                                 && test -z "${cf_tst_cflags}" \
14374                                 && cf_fix_cppflags=yes
14375
14376                         if test $cf_fix_cppflags = yes ; then
14377                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14378                                 continue
14379                         elif test "${cf_tst_cflags}" = "\"'" ; then
14380                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14381                                 continue
14382                         fi
14383                         ;;
14384                 esac
14385                 case "$CPPFLAGS" in
14386                 (*$cf_add_cflags)
14387                         ;;
14388                 (*)
14389                         case $cf_add_cflags in
14390                         (-D*)
14391                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14392
14393 CPPFLAGS=`echo "$CPPFLAGS" | \
14394         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14395                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14396
14397                                 ;;
14398                         esac
14399                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
14400                         ;;
14401                 esac
14402                 ;;
14403         (*)
14404                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
14405                 ;;
14406         esac
14407         ;;
14408 (yes)
14409         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14410
14411         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14412
14413         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14414                 && test -z "${cf_tst_cflags}" \
14415                 && cf_fix_cppflags=no
14416         ;;
14417 esac
14418 done
14419
14420 if test -n "$cf_new_cflags" ; then
14421
14422         CFLAGS="$CFLAGS $cf_new_cflags"
14423 fi
14424
14425 if test -n "$cf_new_cppflags" ; then
14426
14427         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
14428 fi
14429
14430 if test -n "$cf_new_extra_cppflags" ; then
14431
14432         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
14433 fi
14434
14435 ################################################################################
14436
14437 TEST_ARG2=
14438
14439 TEST_LIBS2=
14440
14441 NCURSES_SHLIB2="sh -c"
14442
14443 ADA_SUBDIRS="include gen src doc"
14444 if test "x$cf_with_tests" != "xno" ; then
14445         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14446 fi
14447 for cf_dir in $ADA_SUBDIRS
14448 do
14449         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14450 done
14451
14452 NCURSES_TREE="#"
14453
14454 EXTERNAL_TREE=
14455
14456 # match layout used by make-tar.sh
14457 ADAHTML_DIR=../doc/ada
14458
14459 if test "x$cross_compiling" = xyes ; then
14460         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14461 else
14462         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14463 fi
14464
14465 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14466 ac_config_commands="$ac_config_commands default"
14467 cat >confcache <<\_ACEOF
14468 # This file is a shell script that caches the results of configure
14469 # tests run on this system so they can be shared between configure
14470 # scripts and configure runs, see configure's option --config-cache.
14471 # It is not useful on other systems.  If it contains results you don't
14472 # want to keep, you may remove or edit it.
14473 #
14474 # config.status only pays attention to the cache file if you give it
14475 # the --recheck option to rerun configure.
14476 #
14477 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14478 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14479 # following values.
14480
14481 _ACEOF
14482
14483 # The following way of writing the cache mishandles newlines in values,
14484 # but we know of no workaround that is simple, portable, and efficient.
14485 # So, don't put newlines in cache variables' values.
14486 # Ultrix sh set writes to stderr and can't be redirected directly,
14487 # and sets the high bit in the cache file unless we assign to the vars.
14488 {
14489   (set) 2>&1 |
14490     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14491     *ac_space=\ *)
14492       # `set' does not quote correctly, so add quotes (double-quote
14493       # substitution turns \\\\ into \\, and sed turns \\ into \).
14494       sed -n \
14495         "s/'/'\\\\''/g;
14496           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14497       ;;
14498     *)
14499       # `set' quotes correctly as required by POSIX, so do not add quotes.
14500       sed -n \
14501         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14502       ;;
14503     esac;
14504 } |
14505   sed '
14506      t clear
14507      : clear
14508      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14509      t end
14510      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14511      : end' >>confcache
14512 if cmp -s $cache_file confcache; then :; else
14513   if test -w $cache_file; then
14514     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14515     cat confcache >$cache_file
14516   else
14517     echo "not updating unwritable cache $cache_file"
14518   fi
14519 fi
14520 rm -f confcache
14521
14522 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14523 # Let make expand exec_prefix.
14524 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14525
14526 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14527 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14528 # trailing colons and then remove the whole line if VPATH becomes empty
14529 # (actually we leave an empty line to preserve line numbers).
14530 if test "x$srcdir" = x.; then
14531   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14532 s/:*\$(srcdir):*/:/;
14533 s/:*\${srcdir}:*/:/;
14534 s/:*@srcdir@:*/:/;
14535 s/^\([^=]*=[    ]*\):*/\1/;
14536 s/:*$//;
14537 s/^[^=]*=[      ]*$//;
14538 }'
14539 fi
14540
14541 DEFS=-DHAVE_CONFIG_H
14542
14543 : ${CONFIG_STATUS=./config.status}
14544 ac_clean_files_save=$ac_clean_files
14545 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14546 { echo "$as_me:14546: creating $CONFIG_STATUS" >&5
14547 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14548 cat >$CONFIG_STATUS <<_ACEOF
14549 #! $SHELL
14550 # Generated automatically by configure.
14551 # Run this file to recreate the current configuration.
14552 # Compiler output produced by configure, useful for debugging
14553 # configure, is in config.log if it exists.
14554
14555 debug=false
14556 SHELL=\${CONFIG_SHELL-$SHELL}
14557 ac_cs_invocation="\$0 \$@"
14558
14559 _ACEOF
14560
14561 cat >>$CONFIG_STATUS <<\_ACEOF
14562 # Be Bourne compatible
14563 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14564   emulate sh
14565   NULLCMD=:
14566 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14567   set -o posix
14568 fi
14569
14570 # Name of the executable.
14571 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14572
14573 if expr a : '\(a\)' >/dev/null 2>&1; then
14574   as_expr=expr
14575 else
14576   as_expr=false
14577 fi
14578
14579 rm -f conf$$ conf$$.exe conf$$.file
14580 echo >conf$$.file
14581 if ln -s conf$$.file conf$$ 2>/dev/null; then
14582   # We could just check for DJGPP; but this test a) works b) is more generic
14583   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14584   if test -f conf$$.exe; then
14585     # Don't use ln at all; we don't have any links
14586     as_ln_s='cp -p'
14587   else
14588     as_ln_s='ln -s'
14589   fi
14590 elif ln conf$$.file conf$$ 2>/dev/null; then
14591   as_ln_s=ln
14592 else
14593   as_ln_s='cp -p'
14594 fi
14595 rm -f conf$$ conf$$.exe conf$$.file
14596
14597 as_executable_p="test -f"
14598
14599 # Support unset when possible.
14600 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14601   as_unset=unset
14602 else
14603   as_unset=false
14604 fi
14605
14606 # NLS nuisances.
14607 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14608 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14609 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14610 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14611 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14612 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14613 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14614 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14615
14616 # IFS
14617 # We need space, tab and new line, in precisely that order.
14618 as_nl='
14619 '
14620 IFS="   $as_nl"
14621
14622 # CDPATH.
14623 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14624
14625 exec 6>&1
14626
14627 _ACEOF
14628
14629 # Files that config.status was made for.
14630 if test -n "$ac_config_files"; then
14631   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14632 fi
14633
14634 if test -n "$ac_config_headers"; then
14635   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14636 fi
14637
14638 if test -n "$ac_config_links"; then
14639   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14640 fi
14641
14642 if test -n "$ac_config_commands"; then
14643   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14644 fi
14645
14646 cat >>$CONFIG_STATUS <<\EOF
14647
14648 ac_cs_usage="\
14649 \`$as_me' instantiates files from templates according to the
14650 current configuration.
14651
14652 Usage: $0 [OPTIONS] [FILE]...
14653
14654   -h, --help       print this help, then exit
14655   -V, --version    print version number, then exit
14656   -d, --debug      don't remove temporary files
14657       --recheck    update $as_me by reconfiguring in the same conditions
14658   --file=FILE[:TEMPLATE]
14659                    instantiate the configuration file FILE
14660   --header=FILE[:TEMPLATE]
14661                    instantiate the configuration header FILE
14662
14663 Configuration files:
14664 $config_files
14665
14666 Configuration headers:
14667 $config_headers
14668
14669 Configuration commands:
14670 $config_commands
14671
14672 Report bugs to <dickey@invisible-island.net>."
14673 EOF
14674
14675 cat >>$CONFIG_STATUS <<EOF
14676 ac_cs_version="\\
14677 config.status
14678 configured by $0, generated by GNU Autoconf 2.52.20150926,
14679   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14680
14681 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14682 Free Software Foundation, Inc.
14683 This config.status script is free software; the Free Software Foundation
14684 gives unlimited permission to copy, distribute and modify it."
14685 srcdir=$srcdir
14686 INSTALL="$INSTALL"
14687 EOF
14688
14689 cat >>$CONFIG_STATUS <<\EOF
14690 # If no file are specified by the user, then we need to provide default
14691 # value.  By we need to know if files were specified by the user.
14692 ac_need_defaults=:
14693 while test $# != 0
14694 do
14695   case $1 in
14696   --*=*)
14697     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14698     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14699     shift
14700     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14701     shift
14702     ;;
14703   -*);;
14704   *) # This is not an option, so the user has probably given explicit
14705      # arguments.
14706      ac_need_defaults=false;;
14707   esac
14708
14709   case $1 in
14710   # Handling of the options.
14711 EOF
14712 cat >>$CONFIG_STATUS <<EOF
14713   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14714     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14715     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14716 EOF
14717 cat >>$CONFIG_STATUS <<\EOF
14718   --version | --vers* | -V )
14719     echo "$ac_cs_version"; exit 0 ;;
14720   --he | --h)
14721     # Conflict between --help and --header
14722     { { echo "$as_me:14722: error: ambiguous option: $1
14723 Try \`$0 --help' for more information." >&5
14724 echo "$as_me: error: ambiguous option: $1
14725 Try \`$0 --help' for more information." >&2;}
14726    { (exit 1); exit 1; }; };;
14727   --help | --hel | -h )
14728     echo "$ac_cs_usage"; exit 0 ;;
14729   --debug | --d* | -d )
14730     debug=: ;;
14731   --file | --fil | --fi | --f )
14732     shift
14733     CONFIG_FILES="$CONFIG_FILES $1"
14734     ac_need_defaults=false;;
14735   --header | --heade | --head | --hea )
14736     shift
14737     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14738     ac_need_defaults=false;;
14739
14740   # This is an error.
14741   -*) { { echo "$as_me:14741: error: unrecognized option: $1
14742 Try \`$0 --help' for more information." >&5
14743 echo "$as_me: error: unrecognized option: $1
14744 Try \`$0 --help' for more information." >&2;}
14745    { (exit 1); exit 1; }; } ;;
14746
14747   *) ac_config_targets="$ac_config_targets $1" ;;
14748
14749   esac
14750   shift
14751 done
14752
14753 exec 5>>config.log
14754 cat >&5 << _ACEOF
14755
14756 ## ----------------------- ##
14757 ## Running config.status.  ##
14758 ## ----------------------- ##
14759
14760 This file was extended by $as_me 2.52.20150926, executed with
14761   CONFIG_FILES    = $CONFIG_FILES
14762   CONFIG_HEADERS  = $CONFIG_HEADERS
14763   CONFIG_LINKS    = $CONFIG_LINKS
14764   CONFIG_COMMANDS = $CONFIG_COMMANDS
14765   > $ac_cs_invocation
14766 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14767
14768 _ACEOF
14769 EOF
14770
14771 cat >>$CONFIG_STATUS <<EOF
14772 #
14773 # INIT-COMMANDS section.
14774 #
14775
14776 ### Special initialization commands, used to pass information from the
14777 ### configuration-run into config.status
14778
14779 AWK="$AWK"
14780 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14781 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14782 LIB_NAME="$LIB_NAME"
14783 LIB_PREFIX="$LIB_PREFIX"
14784 LIB_SUFFIX="$LIB_SUFFIX"
14785 LN_S="$LN_S"
14786 NCURSES_MAJOR="$NCURSES_MAJOR"
14787 NCURSES_MINOR="$NCURSES_MINOR"
14788 NCURSES_PATCH="$NCURSES_PATCH"
14789 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14790 cf_cv_abi_version="$cf_cv_abi_version"
14791 cf_cv_rel_version="$cf_cv_rel_version"
14792 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14793 cf_cv_shared_soname='$cf_cv_shared_soname'
14794 cf_cv_shlib_version="$cf_cv_shlib_version"
14795 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14796 cf_cv_system_name="$cf_cv_system_name"
14797 host="$host"
14798 target="$target"
14799
14800 EOF
14801
14802 cat >>$CONFIG_STATUS <<\EOF
14803 for ac_config_target in $ac_config_targets
14804 do
14805   case "$ac_config_target" in
14806   # Handling of arguments.
14807   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14808   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14809   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14810   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14811   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14812   *) { { echo "$as_me:14812: error: invalid argument: $ac_config_target" >&5
14813 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14814    { (exit 1); exit 1; }; };;
14815   esac
14816 done
14817
14818 # If the user did not use the arguments to specify the items to instantiate,
14819 # then the envvar interface is used.  Set only those that are not.
14820 # We use the long form for the default assignment because of an extremely
14821 # bizarre bug on SunOS 4.1.3.
14822 if $ac_need_defaults; then
14823   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14824   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14825   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14826 fi
14827
14828 # Create a temporary directory, and hook for its removal unless debugging.
14829 $debug ||
14830 {
14831   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14832   trap '{ (exit 1); exit 1; }' 1 2 13 15
14833 }
14834
14835 # Create a (secure) tmp directory for tmp files.
14836 : ${TMPDIR=/tmp}
14837 {
14838   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14839   test -n "$tmp" && test -d "$tmp"
14840 }  ||
14841 {
14842   tmp=$TMPDIR/cs$$-$RANDOM
14843   (umask 077 && mkdir $tmp)
14844 } ||
14845 {
14846    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14847    { (exit 1); exit 1; }
14848 }
14849
14850 EOF
14851
14852 cat >>$CONFIG_STATUS <<EOF
14853
14854 #
14855 # CONFIG_FILES section.
14856 #
14857
14858 # No need to generate the scripts if there are no CONFIG_FILES.
14859 # This happens for instance when ./config.status config.h
14860 if test -n "\$CONFIG_FILES"; then
14861   # Protect against being on the right side of a sed subst in config.status.
14862   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14863    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14864 s,@SHELL@,$SHELL,;t t
14865 s,@exec_prefix@,$exec_prefix,;t t
14866 s,@prefix@,$prefix,;t t
14867 s,@program_transform_name@,$program_transform_name,;t t
14868 s,@bindir@,$bindir,;t t
14869 s,@sbindir@,$sbindir,;t t
14870 s,@libexecdir@,$libexecdir,;t t
14871 s,@datarootdir@,$datarootdir,;t t
14872 s,@datadir@,$datadir,;t t
14873 s,@sysconfdir@,$sysconfdir,;t t
14874 s,@sharedstatedir@,$sharedstatedir,;t t
14875 s,@localstatedir@,$localstatedir,;t t
14876 s,@libdir@,$libdir,;t t
14877 s,@includedir@,$includedir,;t t
14878 s,@oldincludedir@,$oldincludedir,;t t
14879 s,@infodir@,$infodir,;t t
14880 s,@mandir@,$mandir,;t t
14881 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14882 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14883 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14884 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14885 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14886 s,@build_alias@,$build_alias,;t t
14887 s,@host_alias@,$host_alias,;t t
14888 s,@target_alias@,$target_alias,;t t
14889 s,@ECHO_C@,$ECHO_C,;t t
14890 s,@ECHO_N@,$ECHO_N,;t t
14891 s,@ECHO_T@,$ECHO_T,;t t
14892 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14893 s,@DEFS@,$DEFS,;t t
14894 s,@LIBS@,$LIBS,;t t
14895 s,@top_builddir@,$top_builddir,;t t
14896 s,@build@,$build,;t t
14897 s,@build_cpu@,$build_cpu,;t t
14898 s,@build_vendor@,$build_vendor,;t t
14899 s,@build_os@,$build_os,;t t
14900 s,@host@,$host,;t t
14901 s,@host_cpu@,$host_cpu,;t t
14902 s,@host_vendor@,$host_vendor,;t t
14903 s,@host_os@,$host_os,;t t
14904 s,@target@,$target,;t t
14905 s,@target_cpu@,$target_cpu,;t t
14906 s,@target_vendor@,$target_vendor,;t t
14907 s,@target_os@,$target_os,;t t
14908 s,@CC@,$CC,;t t
14909 s,@CFLAGS@,$CFLAGS,;t t
14910 s,@LDFLAGS@,$LDFLAGS,;t t
14911 s,@CPPFLAGS@,$CPPFLAGS,;t t
14912 s,@ac_ct_CC@,$ac_ct_CC,;t t
14913 s,@EXEEXT@,$EXEEXT,;t t
14914 s,@OBJEXT@,$OBJEXT,;t t
14915 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14916 s,@CPP@,$CPP,;t t
14917 s,@AWK@,$AWK,;t t
14918 s,@EGREP@,$EGREP,;t t
14919 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14920 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14921 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14922 s,@LN_S@,$LN_S,;t t
14923 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14924 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14925 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14926 s,@SET_MAKE@,$SET_MAKE,;t t
14927 s,@CTAGS@,$CTAGS,;t t
14928 s,@ETAGS@,$ETAGS,;t t
14929 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14930 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14931 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14932 s,@RANLIB@,$RANLIB,;t t
14933 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14934 s,@LD@,$LD,;t t
14935 s,@ac_ct_LD@,$ac_ct_LD,;t t
14936 s,@AR@,$AR,;t t
14937 s,@ac_ct_AR@,$ac_ct_AR,;t t
14938 s,@ARFLAGS@,$ARFLAGS,;t t
14939 s,@DESTDIR@,$DESTDIR,;t t
14940 s,@BUILD_CC@,$BUILD_CC,;t t
14941 s,@BUILD_CPP@,$BUILD_CPP,;t t
14942 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14943 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14944 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14945 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14946 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14947 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14948 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14949 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14950 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14951 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14952 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14953 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14954 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14955 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14956 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14957 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14958 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14959 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14960 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14961 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14962 s,@CC_G_OPT@,$CC_G_OPT,;t t
14963 s,@LD_MODEL@,$LD_MODEL,;t t
14964 s,@shlibdir@,$shlibdir,;t t
14965 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14966 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14967 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14968 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14969 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14970 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14971 s,@LINK_PROGS@,$LINK_PROGS,;t t
14972 s,@LINK_TESTS@,$LINK_TESTS,;t t
14973 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14974 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14975 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14976 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14977 s,@RPATH_LIST@,$RPATH_LIST,;t t
14978 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14979 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14980 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14981 s,@PTHREAD@,$PTHREAD,;t t
14982 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14983 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14984 s,@ECHO_LT@,$ECHO_LT,;t t
14985 s,@ECHO_LD@,$ECHO_LD,;t t
14986 s,@RULE_CC@,$RULE_CC,;t t
14987 s,@SHOW_CC@,$SHOW_CC,;t t
14988 s,@ECHO_CC@,$ECHO_CC,;t t
14989 s,@ADAFLAGS@,$ADAFLAGS,;t t
14990 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14991 s,@ADA_TRACE@,$ADA_TRACE,;t t
14992 s,@gnat_exists@,$gnat_exists,;t t
14993 s,@M4_exists@,$M4_exists,;t t
14994 s,@cf_ada_make@,$cf_ada_make,;t t
14995 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14996 s,@cf_compile_generics@,$cf_compile_generics,;t t
14997 s,@cf_generic_objects@,$cf_generic_objects,;t t
14998 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14999 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15000 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15001 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15002 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15003 s,@cf_ada_package@,$cf_ada_package,;t t
15004 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15005 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15006 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15007 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15008 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15009 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15010 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15011 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15012 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15013 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15014 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15015 s,@TEST_ARG2@,$TEST_ARG2,;t t
15016 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15017 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15018 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15019 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15020 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15021 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15022 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15023 CEOF
15024
15025 EOF
15026
15027   cat >>$CONFIG_STATUS <<\EOF
15028   # Split the substitutions into bite-sized pieces for seds with
15029   # small command number limits, like on Digital OSF/1 and HP-UX.
15030   ac_max_sed_lines=48
15031   ac_sed_frag=1 # Number of current file.
15032   ac_beg=1 # First line for current file.
15033   ac_end=$ac_max_sed_lines # Line after last line for current file.
15034   ac_more_lines=:
15035   ac_sed_cmds=
15036   while $ac_more_lines; do
15037     if test $ac_beg -gt 1; then
15038       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15039     else
15040       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15041     fi
15042     if test ! -s $tmp/subs.frag; then
15043       ac_more_lines=false
15044     else
15045       # The purpose of the label and of the branching condition is to
15046       # speed up the sed processing (if there are no `@' at all, there
15047       # is no need to browse any of the substitutions).
15048       # These are the two extra sed commands mentioned above.
15049       (echo ':t
15050   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15051       # It is possible to make a multiline substitution using escaped newlines.
15052       # Ensure that we do not split the substitution between script fragments.
15053       ac_BEG=$ac_end
15054       ac_END=`expr $ac_end + $ac_max_sed_lines`
15055       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15056       if test -s $tmp/subs.next; then
15057         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15058         if test ! -s $tmp/subs.edit; then
15059           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15060           if test ! -s $tmp/subs.edit; then
15061             if test $ac_beg -gt 1; then
15062               ac_end=`expr $ac_end - 1`
15063               continue
15064             fi
15065           fi
15066         fi
15067       fi
15068
15069       if test -z "$ac_sed_cmds"; then
15070         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15071       else
15072         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15073       fi
15074       ac_sed_frag=`expr $ac_sed_frag + 1`
15075       ac_beg=$ac_end
15076       ac_end=`expr $ac_end + $ac_max_sed_lines`
15077     fi
15078   done
15079   if test -z "$ac_sed_cmds"; then
15080     ac_sed_cmds=cat
15081   fi
15082 fi # test -n "$CONFIG_FILES"
15083
15084 EOF
15085 cat >>$CONFIG_STATUS <<\EOF
15086 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15087   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15088   case $ac_file in
15089   - | *:- | *:-:* ) # input from stdin
15090         cat >$tmp/stdin
15091         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15092         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15093   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15094         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15095   * )   ac_file_in=$ac_file.in ;;
15096   esac
15097
15098   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15099   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15100          X"$ac_file" : 'X\(//\)[^/]' \| \
15101          X"$ac_file" : 'X\(//\)$' \| \
15102          X"$ac_file" : 'X\(/\)' \| \
15103          .     : '\(.\)' 2>/dev/null ||
15104 echo X"$ac_file" |
15105     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15106           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15107           /^X\(\/\/\)$/{ s//\1/; q; }
15108           /^X\(\/\).*/{ s//\1/; q; }
15109           s/.*/./; q'`
15110   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15111     { case "$ac_dir" in
15112   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15113   *)                      as_incr_dir=.;;
15114 esac
15115 as_dummy="$ac_dir"
15116 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15117   case $as_mkdir_dir in
15118     # Skip DOS drivespec
15119     ?:) as_incr_dir=$as_mkdir_dir ;;
15120     *)
15121       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15122       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15123     ;;
15124   esac
15125 done; }
15126
15127     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15128     # A "../" for each directory in $ac_dir_suffix.
15129     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15130   else
15131     ac_dir_suffix= ac_dots=
15132   fi
15133
15134   case $srcdir in
15135   .)  ac_srcdir=.
15136       if test -z "$ac_dots"; then
15137          ac_top_srcdir=.
15138       else
15139          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15140       fi ;;
15141   [\\/]* | ?:[\\/]* )
15142       ac_srcdir=$srcdir$ac_dir_suffix;
15143       ac_top_srcdir=$srcdir ;;
15144   *) # Relative path.
15145     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15146     ac_top_srcdir=$ac_dots$srcdir ;;
15147   esac
15148
15149   case $INSTALL in
15150   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15151   *) ac_INSTALL=$ac_dots$INSTALL ;;
15152   esac
15153
15154   if test x"$ac_file" != x-; then
15155     { echo "$as_me:15155: creating $ac_file" >&5
15156 echo "$as_me: creating $ac_file" >&6;}
15157     rm -f "$ac_file"
15158   fi
15159   # Let's still pretend it is `configure' which instantiates (i.e., don't
15160   # use $as_me), people would be surprised to read:
15161   #    /* config.h.  Generated automatically by config.status.  */
15162   configure_input="Generated automatically from `echo $ac_file_in |
15163                                                  sed 's,.*/,,'` by configure."
15164
15165   # First look for the input files in the build tree, otherwise in the
15166   # src tree.
15167   ac_file_inputs=`IFS=:
15168     for f in $ac_file_in; do
15169       case $f in
15170       -) echo $tmp/stdin ;;
15171       [\\/$]*)
15172          # Absolute (can't be DOS-style, as IFS=:)
15173          test -f "$f" || { { echo "$as_me:15173: error: cannot find input file: $f" >&5
15174 echo "$as_me: error: cannot find input file: $f" >&2;}
15175    { (exit 1); exit 1; }; }
15176          echo $f;;
15177       *) # Relative
15178          if test -f "$f"; then
15179            # Build tree
15180            echo $f
15181          elif test -f "$srcdir/$f"; then
15182            # Source tree
15183            echo $srcdir/$f
15184          else
15185            # /dev/null tree
15186            { { echo "$as_me:15186: error: cannot find input file: $f" >&5
15187 echo "$as_me: error: cannot find input file: $f" >&2;}
15188    { (exit 1); exit 1; }; }
15189          fi;;
15190       esac
15191     done` || { (exit 1); exit 1; }
15192 EOF
15193 cat >>$CONFIG_STATUS <<\EOF
15194   ac_warn_datarootdir=no
15195   if test x"$ac_file" != x-; then
15196     for ac_item in $ac_file_inputs
15197     do
15198       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15199       if test -n "$ac_seen"; then
15200         ac_used=`grep '@datarootdir@' $ac_item`
15201         if test -z "$ac_used"; then
15202           { echo "$as_me:15202: WARNING: datarootdir was used implicitly but not set:
15203 $ac_seen" >&5
15204 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15205 $ac_seen" >&2;}
15206           ac_warn_datarootdir=yes
15207         fi
15208       fi
15209       ac_seen=`grep '${datarootdir}' $ac_item`
15210       if test -n "$ac_seen"; then
15211         { echo "$as_me:15211: WARNING: datarootdir was used explicitly but not set:
15212 $ac_seen" >&5
15213 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15214 $ac_seen" >&2;}
15215         ac_warn_datarootdir=yes
15216       fi
15217     done
15218   fi
15219
15220 if test "x$ac_warn_datarootdir" = xyes; then
15221   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15222 fi
15223
15224 EOF
15225 cat >>$CONFIG_STATUS <<EOF
15226   sed "$ac_vpsub
15227 $extrasub
15228 EOF
15229 cat >>$CONFIG_STATUS <<\EOF
15230 :t
15231 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15232 s,@configure_input@,$configure_input,;t t
15233 s,@srcdir@,$ac_srcdir,;t t
15234 s,@top_srcdir@,$ac_top_srcdir,;t t
15235 s,@INSTALL@,$ac_INSTALL,;t t
15236 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15237   rm -f $tmp/stdin
15238   if test x"$ac_file" != x-; then
15239     cp $tmp/out $ac_file
15240
15241     for ac_name in prefix exec_prefix datarootdir
15242     do
15243         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15244         if test -n "$ac_seen"; then
15245             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15246             if test -z "$ac_init"; then
15247               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15248               { echo "$as_me:15248: WARNING: Variable $ac_name is used but was not set:
15249 $ac_seen" >&5
15250 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15251 $ac_seen" >&2;}
15252             fi
15253         fi
15254     done
15255     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15256     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15257     if test -s $tmp/out; then
15258       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15259       { echo "$as_me:15259: WARNING: Some variables may not be substituted:
15260 $ac_seen" >&5
15261 echo "$as_me: WARNING: Some variables may not be substituted:
15262 $ac_seen" >&2;}
15263     fi
15264   else
15265     cat $tmp/out
15266   fi
15267   rm -f $tmp/out
15268
15269 done
15270 EOF
15271 cat >>$CONFIG_STATUS <<\EOF
15272
15273 #
15274 # CONFIG_HEADER section.
15275 #
15276
15277 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15278 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15279 #
15280 # ac_d sets the value in "#define NAME VALUE" lines.
15281 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15282 ac_dB='[        ].*$,\1#\2'
15283 ac_dC=' '
15284 ac_dD=',;t'
15285 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15286 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15287 ac_iB='\([      ]\),\1#\2define\3'
15288 ac_iC=' '
15289 ac_iD='\4,;t'
15290 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15291 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15292 ac_uB='$,\1#\2define\3'
15293 ac_uC=' '
15294 ac_uD=',;t'
15295
15296 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15297   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15298   case $ac_file in
15299   - | *:- | *:-:* ) # input from stdin
15300         cat >$tmp/stdin
15301         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15302         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15303   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15304         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15305   * )   ac_file_in=$ac_file.in ;;
15306   esac
15307
15308   test x"$ac_file" != x- && { echo "$as_me:15308: creating $ac_file" >&5
15309 echo "$as_me: creating $ac_file" >&6;}
15310
15311   # First look for the input files in the build tree, otherwise in the
15312   # src tree.
15313   ac_file_inputs=`IFS=:
15314     for f in $ac_file_in; do
15315       case $f in
15316       -) echo $tmp/stdin ;;
15317       [\\/$]*)
15318          # Absolute (can't be DOS-style, as IFS=:)
15319          test -f "$f" || { { echo "$as_me:15319: error: cannot find input file: $f" >&5
15320 echo "$as_me: error: cannot find input file: $f" >&2;}
15321    { (exit 1); exit 1; }; }
15322          echo $f;;
15323       *) # Relative
15324          if test -f "$f"; then
15325            # Build tree
15326            echo $f
15327          elif test -f "$srcdir/$f"; then
15328            # Source tree
15329            echo $srcdir/$f
15330          else
15331            # /dev/null tree
15332            { { echo "$as_me:15332: error: cannot find input file: $f" >&5
15333 echo "$as_me: error: cannot find input file: $f" >&2;}
15334    { (exit 1); exit 1; }; }
15335          fi;;
15336       esac
15337     done` || { (exit 1); exit 1; }
15338   # Remove the trailing spaces.
15339   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15340
15341 EOF
15342
15343 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15344 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15345 # be either 'cat' or 'sort'.
15346 cat confdefs.h | uniq >conftest.vals
15347
15348 # Break up conftest.vals because some shells have a limit on
15349 # the size of here documents, and old seds have small limits too.
15350
15351 rm -f conftest.tail
15352 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15353 while grep . conftest.vals >/dev/null
15354 do
15355   # Write chunks of a limited-size here document to conftest.frag.
15356   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15357   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15358   echo 'CEOF' >> $CONFIG_STATUS
15359   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15360   rm -f conftest.vals
15361   mv conftest.tail conftest.vals
15362 done
15363 rm -f conftest.vals
15364
15365 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15366 # marker @DEFS@.
15367 echo '  cat >> conftest.edit <<CEOF
15368 /@DEFS@/r conftest.frag
15369 /@DEFS@/d
15370 CEOF
15371 sed -f conftest.edit $tmp/in > $tmp/out
15372 rm -f $tmp/in
15373 mv $tmp/out $tmp/in
15374 rm -f conftest.edit conftest.frag
15375 ' >> $CONFIG_STATUS
15376
15377 cat >>$CONFIG_STATUS <<\EOF
15378   # Let's still pretend it is `configure' which instantiates (i.e., don't
15379   # use $as_me), people would be surprised to read:
15380   #    /* config.h.  Generated automatically by config.status.  */
15381   if test x"$ac_file" = x-; then
15382     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15383   else
15384     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15385   fi
15386   cat $tmp/in >>$tmp/config.h
15387   rm -f $tmp/in
15388   if test x"$ac_file" != x-; then
15389     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15390       { echo "$as_me:15390: $ac_file is unchanged" >&5
15391 echo "$as_me: $ac_file is unchanged" >&6;}
15392     else
15393       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15394          X"$ac_file" : 'X\(//\)[^/]' \| \
15395          X"$ac_file" : 'X\(//\)$' \| \
15396          X"$ac_file" : 'X\(/\)' \| \
15397          .     : '\(.\)' 2>/dev/null ||
15398 echo X"$ac_file" |
15399     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15400           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15401           /^X\(\/\/\)$/{ s//\1/; q; }
15402           /^X\(\/\).*/{ s//\1/; q; }
15403           s/.*/./; q'`
15404       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15405         { case "$ac_dir" in
15406   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15407   *)                      as_incr_dir=.;;
15408 esac
15409 as_dummy="$ac_dir"
15410 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15411   case $as_mkdir_dir in
15412     # Skip DOS drivespec
15413     ?:) as_incr_dir=$as_mkdir_dir ;;
15414     *)
15415       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15416       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15417     ;;
15418   esac
15419 done; }
15420
15421       fi
15422       rm -f $ac_file
15423       mv $tmp/config.h $ac_file
15424     fi
15425   else
15426     cat $tmp/config.h
15427     rm -f $tmp/config.h
15428   fi
15429 done
15430 EOF
15431 cat >>$CONFIG_STATUS <<\EOF
15432 #
15433 # CONFIG_COMMANDS section.
15434 #
15435 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15436   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15437   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15438
15439   case $ac_dest in
15440     default )
15441 if test -z "$USE_OLD_MAKERULES" ; then
15442         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15443 fi
15444  ;;
15445   esac
15446 done
15447 EOF
15448
15449 cat >>$CONFIG_STATUS <<\EOF
15450
15451 { (exit 0); exit 0; }
15452 EOF
15453 chmod +x $CONFIG_STATUS
15454 ac_clean_files=$ac_clean_files_save
15455
15456 # configure is writing to config.log, and then calls config.status.
15457 # config.status does its own redirection, appending to config.log.
15458 # Unfortunately, on DOS this fails, as config.log is still kept open
15459 # by configure, so config.status won't be able to write to it; its
15460 # output is simply discarded.  So we exec the FD to /dev/null,
15461 # effectively closing config.log, so it can be properly (re)opened and
15462 # appended to by config.status.  When coming back to configure, we
15463 # need to make the FD available again.
15464 if test "$no_create" != yes; then
15465   ac_cs_success=:
15466   exec 5>/dev/null
15467   $SHELL $CONFIG_STATUS || ac_cs_success=false
15468   exec 5>>config.log
15469   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15470   # would make configure fail if this is the last instruction.
15471   $ac_cs_success || { (exit 1); exit 1; }
15472 fi
15473 ${MAKE:-make} preinstall