]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20160806
[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/^[^    ]*[     ][      ]*//'`
1841         CC=`echo "$CC " | sed -e 's/[   ]-[IUD][^       ][^     ]*//g' -e 's/[  ]*$//'`
1842
1843 cf_fix_cppflags=no
1844 cf_new_cflags=
1845 cf_new_cppflags=
1846 cf_new_extra_cppflags=
1847
1848 for cf_add_cflags in $cf_flags
1849 do
1850 case $cf_fix_cppflags in
1851 (no)
1852         case $cf_add_cflags in
1853         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1854                 case $cf_add_cflags in
1855                 (-D*)
1856                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1857
1858                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1859                                 && test -z "${cf_tst_cflags}" \
1860                                 && cf_fix_cppflags=yes
1861
1862                         if test $cf_fix_cppflags = yes ; then
1863                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1864                                 continue
1865                         elif test "${cf_tst_cflags}" = "\"'" ; then
1866                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1867                                 continue
1868                         fi
1869                         ;;
1870                 esac
1871                 case "$CPPFLAGS" in
1872                 (*$cf_add_cflags)
1873                         ;;
1874                 (*)
1875                         case $cf_add_cflags in
1876                         (-D*)
1877                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1878
1879 CPPFLAGS=`echo "$CPPFLAGS" | \
1880         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1881                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1882
1883                                 ;;
1884                         esac
1885                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1886                         ;;
1887                 esac
1888                 ;;
1889         (*)
1890                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1891                 ;;
1892         esac
1893         ;;
1894 (yes)
1895         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1896
1897         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1898
1899         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1900                 && test -z "${cf_tst_cflags}" \
1901                 && cf_fix_cppflags=no
1902         ;;
1903 esac
1904 done
1905
1906 if test -n "$cf_new_cflags" ; then
1907
1908         CFLAGS="$CFLAGS $cf_new_cflags"
1909 fi
1910
1911 if test -n "$cf_new_cppflags" ; then
1912
1913         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
1914 fi
1915
1916 if test -n "$cf_new_extra_cppflags" ; then
1917
1918         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
1919 fi
1920
1921         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
1922
1923 echo "${as_me:-configure}:1923: testing resulting CC: '$CC' ..." 1>&5
1924
1925         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
1926
1927 echo "${as_me:-configure}:1927: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
1928
1929         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
1930
1931 echo "${as_me:-configure}:1931: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
1932
1933         ;;
1934 (*)
1935         echo "$as_me:1935: result: ok" >&5
1936 echo "${ECHO_T}ok" >&6
1937         ;;
1938 esac
1939
1940 ac_ext=c
1941 ac_cpp='$CPP $CPPFLAGS'
1942 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1943 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1944 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1945 ac_main_return=return
1946 echo "$as_me:1946: checking how to run the C preprocessor" >&5
1947 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1948 # On Suns, sometimes $CPP names a directory.
1949 if test -n "$CPP" && test -d "$CPP"; then
1950   CPP=
1951 fi
1952 if test -z "$CPP"; then
1953   if test "${ac_cv_prog_CPP+set}" = set; then
1954   echo $ECHO_N "(cached) $ECHO_C" >&6
1955 else
1956       # Double quotes because CPP needs to be expanded
1957     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1958     do
1959       ac_preproc_ok=false
1960 for ac_c_preproc_warn_flag in '' yes
1961 do
1962   # Use a header file that comes with gcc, so configuring glibc
1963   # with a fresh cross-compiler works.
1964   # On the NeXT, cc -E runs the code through the compiler's parser,
1965   # not just through cpp. "Syntax error" is here to catch this case.
1966   cat >conftest.$ac_ext <<_ACEOF
1967 #line 1967 "configure"
1968 #include "confdefs.h"
1969 #include <assert.h>
1970                      Syntax error
1971 _ACEOF
1972 if { (eval echo "$as_me:1972: \"$ac_cpp conftest.$ac_ext\"") >&5
1973   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1974   ac_status=$?
1975   egrep -v '^ *\+' conftest.er1 >conftest.err
1976   rm -f conftest.er1
1977   cat conftest.err >&5
1978   echo "$as_me:1978: \$? = $ac_status" >&5
1979   (exit $ac_status); } >/dev/null; then
1980   if test -s conftest.err; then
1981     ac_cpp_err=$ac_c_preproc_warn_flag
1982   else
1983     ac_cpp_err=
1984   fi
1985 else
1986   ac_cpp_err=yes
1987 fi
1988 if test -z "$ac_cpp_err"; then
1989   :
1990 else
1991   echo "$as_me: failed program was:" >&5
1992   cat conftest.$ac_ext >&5
1993   # Broken: fails on valid input.
1994 continue
1995 fi
1996 rm -f conftest.err conftest.$ac_ext
1997
1998   # OK, works on sane cases.  Now check whether non-existent headers
1999   # can be detected and how.
2000   cat >conftest.$ac_ext <<_ACEOF
2001 #line 2001 "configure"
2002 #include "confdefs.h"
2003 #include <ac_nonexistent.h>
2004 _ACEOF
2005 if { (eval echo "$as_me:2005: \"$ac_cpp conftest.$ac_ext\"") >&5
2006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2007   ac_status=$?
2008   egrep -v '^ *\+' conftest.er1 >conftest.err
2009   rm -f conftest.er1
2010   cat conftest.err >&5
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit $ac_status); } >/dev/null; then
2013   if test -s conftest.err; then
2014     ac_cpp_err=$ac_c_preproc_warn_flag
2015   else
2016     ac_cpp_err=
2017   fi
2018 else
2019   ac_cpp_err=yes
2020 fi
2021 if test -z "$ac_cpp_err"; then
2022   # Broken: success on invalid input.
2023 continue
2024 else
2025   echo "$as_me: failed program was:" >&5
2026   cat conftest.$ac_ext >&5
2027   # Passes both tests.
2028 ac_preproc_ok=:
2029 break
2030 fi
2031 rm -f conftest.err conftest.$ac_ext
2032
2033 done
2034 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2035 rm -f conftest.err conftest.$ac_ext
2036 if $ac_preproc_ok; then
2037   break
2038 fi
2039
2040     done
2041     ac_cv_prog_CPP=$CPP
2042
2043 fi
2044   CPP=$ac_cv_prog_CPP
2045 else
2046   ac_cv_prog_CPP=$CPP
2047 fi
2048 echo "$as_me:2048: result: $CPP" >&5
2049 echo "${ECHO_T}$CPP" >&6
2050 ac_preproc_ok=false
2051 for ac_c_preproc_warn_flag in '' yes
2052 do
2053   # Use a header file that comes with gcc, so configuring glibc
2054   # with a fresh cross-compiler works.
2055   # On the NeXT, cc -E runs the code through the compiler's parser,
2056   # not just through cpp. "Syntax error" is here to catch this case.
2057   cat >conftest.$ac_ext <<_ACEOF
2058 #line 2058 "configure"
2059 #include "confdefs.h"
2060 #include <assert.h>
2061                      Syntax error
2062 _ACEOF
2063 if { (eval echo "$as_me:2063: \"$ac_cpp conftest.$ac_ext\"") >&5
2064   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2065   ac_status=$?
2066   egrep -v '^ *\+' conftest.er1 >conftest.err
2067   rm -f conftest.er1
2068   cat conftest.err >&5
2069   echo "$as_me:2069: \$? = $ac_status" >&5
2070   (exit $ac_status); } >/dev/null; then
2071   if test -s conftest.err; then
2072     ac_cpp_err=$ac_c_preproc_warn_flag
2073   else
2074     ac_cpp_err=
2075   fi
2076 else
2077   ac_cpp_err=yes
2078 fi
2079 if test -z "$ac_cpp_err"; then
2080   :
2081 else
2082   echo "$as_me: failed program was:" >&5
2083   cat conftest.$ac_ext >&5
2084   # Broken: fails on valid input.
2085 continue
2086 fi
2087 rm -f conftest.err conftest.$ac_ext
2088
2089   # OK, works on sane cases.  Now check whether non-existent headers
2090   # can be detected and how.
2091   cat >conftest.$ac_ext <<_ACEOF
2092 #line 2092 "configure"
2093 #include "confdefs.h"
2094 #include <ac_nonexistent.h>
2095 _ACEOF
2096 if { (eval echo "$as_me:2096: \"$ac_cpp conftest.$ac_ext\"") >&5
2097   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2098   ac_status=$?
2099   egrep -v '^ *\+' conftest.er1 >conftest.err
2100   rm -f conftest.er1
2101   cat conftest.err >&5
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } >/dev/null; then
2104   if test -s conftest.err; then
2105     ac_cpp_err=$ac_c_preproc_warn_flag
2106   else
2107     ac_cpp_err=
2108   fi
2109 else
2110   ac_cpp_err=yes
2111 fi
2112 if test -z "$ac_cpp_err"; then
2113   # Broken: success on invalid input.
2114 continue
2115 else
2116   echo "$as_me: failed program was:" >&5
2117   cat conftest.$ac_ext >&5
2118   # Passes both tests.
2119 ac_preproc_ok=:
2120 break
2121 fi
2122 rm -f conftest.err conftest.$ac_ext
2123
2124 done
2125 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2126 rm -f conftest.err conftest.$ac_ext
2127 if $ac_preproc_ok; then
2128   :
2129 else
2130   { { echo "$as_me:2130: error: C preprocessor \"$CPP\" fails sanity check" >&5
2131 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2132    { (exit 1); exit 1; }; }
2133 fi
2134
2135 ac_ext=c
2136 ac_cpp='$CPP $CPPFLAGS'
2137 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2138 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2139 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2140 ac_main_return=return
2141
2142 if test $ac_cv_c_compiler_gnu = yes; then
2143     echo "$as_me:2143: checking whether $CC needs -traditional" >&5
2144 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2145 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2146   echo $ECHO_N "(cached) $ECHO_C" >&6
2147 else
2148     ac_pattern="Autoconf.*'x'"
2149   cat >conftest.$ac_ext <<_ACEOF
2150 #line 2150 "configure"
2151 #include "confdefs.h"
2152 #include <sgtty.h>
2153 int Autoconf = TIOCGETP;
2154 _ACEOF
2155 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2156   egrep "$ac_pattern" >/dev/null 2>&1; then
2157   ac_cv_prog_gcc_traditional=yes
2158 else
2159   ac_cv_prog_gcc_traditional=no
2160 fi
2161 rm -rf conftest*
2162
2163   if test $ac_cv_prog_gcc_traditional = no; then
2164     cat >conftest.$ac_ext <<_ACEOF
2165 #line 2165 "configure"
2166 #include "confdefs.h"
2167 #include <termio.h>
2168 int Autoconf = TCGETA;
2169 _ACEOF
2170 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2171   egrep "$ac_pattern" >/dev/null 2>&1; then
2172   ac_cv_prog_gcc_traditional=yes
2173 fi
2174 rm -rf conftest*
2175
2176   fi
2177 fi
2178 echo "$as_me:2178: result: $ac_cv_prog_gcc_traditional" >&5
2179 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2180   if test $ac_cv_prog_gcc_traditional = yes; then
2181     CC="$CC -traditional"
2182   fi
2183 fi
2184
2185 echo "$as_me:2185: checking whether $CC understands -c and -o together" >&5
2186 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2187 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2188   echo $ECHO_N "(cached) $ECHO_C" >&6
2189 else
2190
2191 cat > conftest.$ac_ext <<CF_EOF
2192 int main()
2193 {
2194         ${cf_cv_main_return:-return}(0);
2195 }
2196 CF_EOF
2197 # We do the test twice because some compilers refuse to overwrite an
2198 # existing .o file with -o, though they will create one.
2199 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2200 if { (eval echo "$as_me:2200: \"$ac_try\"") >&5
2201   (eval $ac_try) 2>&5
2202   ac_status=$?
2203   echo "$as_me:2203: \$? = $ac_status" >&5
2204   (exit $ac_status); } &&
2205   test -f conftest2.$ac_objext && { (eval echo "$as_me:2205: \"$ac_try\"") >&5
2206   (eval $ac_try) 2>&5
2207   ac_status=$?
2208   echo "$as_me:2208: \$? = $ac_status" >&5
2209   (exit $ac_status); };
2210 then
2211   eval cf_cv_prog_CC_c_o=yes
2212 else
2213   eval cf_cv_prog_CC_c_o=no
2214 fi
2215 rm -rf conftest*
2216
2217 fi
2218 if test $cf_cv_prog_CC_c_o = yes; then
2219   echo "$as_me:2219: result: yes" >&5
2220 echo "${ECHO_T}yes" >&6
2221 else
2222   echo "$as_me:2222: result: no" >&5
2223 echo "${ECHO_T}no" >&6
2224 fi
2225
2226 test "$program_prefix" != NONE &&
2227   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2228 # Use a double $ so make ignores it.
2229 test "$program_suffix" != NONE &&
2230   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2231 # Double any \ or $.  echo might interpret backslashes.
2232 # By default was `s,x,x', remove it if useless.
2233 cat <<\_ACEOF >conftest.sed
2234 s/[\\$]/&&/g;s/;s,x,x,$//
2235 _ACEOF
2236 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2237 rm conftest.sed
2238
2239 for ac_prog in mawk gawk nawk awk
2240 do
2241   # Extract the first word of "$ac_prog", so it can be a program name with args.
2242 set dummy $ac_prog; ac_word=$2
2243 echo "$as_me:2243: checking for $ac_word" >&5
2244 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2245 if test "${ac_cv_prog_AWK+set}" = set; then
2246   echo $ECHO_N "(cached) $ECHO_C" >&6
2247 else
2248   if test -n "$AWK"; then
2249   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2250 else
2251   ac_save_IFS=$IFS; IFS=$ac_path_separator
2252 ac_dummy="$PATH"
2253 for ac_dir in $ac_dummy; do
2254   IFS=$ac_save_IFS
2255   test -z "$ac_dir" && ac_dir=.
2256   $as_executable_p "$ac_dir/$ac_word" || continue
2257 ac_cv_prog_AWK="$ac_prog"
2258 echo "$as_me:2258: found $ac_dir/$ac_word" >&5
2259 break
2260 done
2261
2262 fi
2263 fi
2264 AWK=$ac_cv_prog_AWK
2265 if test -n "$AWK"; then
2266   echo "$as_me:2266: result: $AWK" >&5
2267 echo "${ECHO_T}$AWK" >&6
2268 else
2269   echo "$as_me:2269: result: no" >&5
2270 echo "${ECHO_T}no" >&6
2271 fi
2272
2273   test -n "$AWK" && break
2274 done
2275
2276 test -z "$AWK" && { { echo "$as_me:2276: error: No awk program found" >&5
2277 echo "$as_me: error: No awk program found" >&2;}
2278    { (exit 1); exit 1; }; }
2279
2280 echo "$as_me:2280: checking for egrep" >&5
2281 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2282 if test "${ac_cv_prog_egrep+set}" = set; then
2283   echo $ECHO_N "(cached) $ECHO_C" >&6
2284 else
2285   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2286                 then ac_cv_prog_egrep='grep -E'
2287                 else ac_cv_prog_egrep='egrep'
2288         fi
2289 fi
2290 echo "$as_me:2290: result: $ac_cv_prog_egrep" >&5
2291 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2292         EGREP=$ac_cv_prog_egrep
2293
2294         test -z "$EGREP" && { { echo "$as_me:2294: error: No egrep program found" >&5
2295 echo "$as_me: error: No egrep program found" >&2;}
2296    { (exit 1); exit 1; }; }
2297
2298 # Find a good install program.  We prefer a C program (faster),
2299 # so one script is as good as another.  But avoid the broken or
2300 # incompatible versions:
2301 # SysV /etc/install, /usr/sbin/install
2302 # SunOS /usr/etc/install
2303 # IRIX /sbin/install
2304 # AIX /bin/install
2305 # AmigaOS /C/install, which installs bootblocks on floppy discs
2306 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2307 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2308 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2309 # ./install, which can be erroneously created by make from ./install.sh.
2310 echo "$as_me:2310: checking for a BSD compatible install" >&5
2311 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2312 if test -z "$INSTALL"; then
2313 if test "${ac_cv_path_install+set}" = set; then
2314   echo $ECHO_N "(cached) $ECHO_C" >&6
2315 else
2316     ac_save_IFS=$IFS; IFS=$ac_path_separator
2317   for ac_dir in $PATH; do
2318     IFS=$ac_save_IFS
2319     # Account for people who put trailing slashes in PATH elements.
2320     case $ac_dir/ in
2321     / | ./ | .// | /cC/* \
2322     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2323     | /usr/ucb/* ) ;;
2324     *)
2325       # OSF1 and SCO ODT 3.0 have their own names for install.
2326       # Don't use installbsd from OSF since it installs stuff as root
2327       # by default.
2328       for ac_prog in ginstall scoinst install; do
2329         if $as_executable_p "$ac_dir/$ac_prog"; then
2330           if test $ac_prog = install &&
2331             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2332             # AIX install.  It has an incompatible calling convention.
2333             :
2334           elif test $ac_prog = install &&
2335             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2336             # program-specific install script used by HP pwplus--don't use.
2337             :
2338           else
2339             ac_cv_path_install="$ac_dir/$ac_prog -c"
2340             break 2
2341           fi
2342         fi
2343       done
2344       ;;
2345     esac
2346   done
2347
2348 fi
2349   if test "${ac_cv_path_install+set}" = set; then
2350     INSTALL=$ac_cv_path_install
2351   else
2352     # As a last resort, use the slow shell script.  We don't cache a
2353     # path for INSTALL within a source directory, because that will
2354     # break other packages using the cache if that directory is
2355     # removed, or if the path is relative.
2356     INSTALL=$ac_install_sh
2357   fi
2358 fi
2359 echo "$as_me:2359: result: $INSTALL" >&5
2360 echo "${ECHO_T}$INSTALL" >&6
2361
2362 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2363 # It thinks the first close brace ends the variable substitution.
2364 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2365
2366 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2367
2368 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2369
2370 echo "$as_me:2370: checking whether ln -s works" >&5
2371 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2372 LN_S=$as_ln_s
2373 if test "$LN_S" = "ln -s"; then
2374   echo "$as_me:2374: result: yes" >&5
2375 echo "${ECHO_T}yes" >&6
2376 else
2377   echo "$as_me:2377: result: no, using $LN_S" >&5
2378 echo "${ECHO_T}no, using $LN_S" >&6
2379 fi
2380
2381 echo "$as_me:2381: checking if $LN_S -f options work" >&5
2382 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2383
2384 rm -f conf$$.src conf$$dst
2385 echo >conf$$.dst
2386 echo first >conf$$.src
2387 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2388         cf_prog_ln_sf=yes
2389 else
2390         cf_prog_ln_sf=no
2391 fi
2392 rm -f conf$$.dst conf$$src
2393 echo "$as_me:2393: result: $cf_prog_ln_sf" >&5
2394 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2395
2396 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2397
2398 echo "$as_me:2398: checking for long file names" >&5
2399 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2400 if test "${ac_cv_sys_long_file_names+set}" = set; then
2401   echo $ECHO_N "(cached) $ECHO_C" >&6
2402 else
2403   ac_cv_sys_long_file_names=yes
2404 # Test for long file names in all the places we know might matter:
2405 #      .                the current directory, where building will happen
2406 #      $prefix/lib      where we will be installing things
2407 #      $exec_prefix/lib likewise
2408 # eval it to expand exec_prefix.
2409 #      $TMPDIR          if set, where it might want to write temporary files
2410 # if $TMPDIR is not set:
2411 #      /tmp             where it might want to write temporary files
2412 #      /var/tmp         likewise
2413 #      /usr/tmp         likewise
2414 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2415   ac_tmpdirs=$TMPDIR
2416 else
2417   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2418 fi
2419 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2420   test -d $ac_dir || continue
2421   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2422   ac_xdir=$ac_dir/cf$$
2423   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2424   ac_tf1=$ac_xdir/conftest9012345
2425   ac_tf2=$ac_xdir/conftest9012346
2426   (echo 1 >$ac_tf1) 2>/dev/null
2427   (echo 2 >$ac_tf2) 2>/dev/null
2428   ac_val=`cat $ac_tf1 2>/dev/null`
2429   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2430     ac_cv_sys_long_file_names=no
2431     rm -rf $ac_xdir 2>/dev/null
2432     break
2433   fi
2434   rm -rf $ac_xdir 2>/dev/null
2435 done
2436 fi
2437 echo "$as_me:2437: result: $ac_cv_sys_long_file_names" >&5
2438 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2439 if test $ac_cv_sys_long_file_names = yes; then
2440
2441 cat >>confdefs.h <<\EOF
2442 #define HAVE_LONG_FILE_NAMES 1
2443 EOF
2444
2445 fi
2446
2447 # if we find pkg-config, check if we should install the ".pc" files.
2448
2449 echo "$as_me:2449: checking if you want to use pkg-config" >&5
2450 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2451
2452 # Check whether --with-pkg-config or --without-pkg-config was given.
2453 if test "${with_pkg_config+set}" = set; then
2454   withval="$with_pkg_config"
2455   cf_pkg_config=$withval
2456 else
2457   cf_pkg_config=yes
2458 fi;
2459 echo "$as_me:2459: result: $cf_pkg_config" >&5
2460 echo "${ECHO_T}$cf_pkg_config" >&6
2461
2462 case $cf_pkg_config in
2463 (no)
2464         PKG_CONFIG=none
2465         ;;
2466 (yes)
2467
2468 if test -n "$ac_tool_prefix"; then
2469   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2470 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2471 echo "$as_me:2471: checking for $ac_word" >&5
2472 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2473 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2474   echo $ECHO_N "(cached) $ECHO_C" >&6
2475 else
2476   case $PKG_CONFIG in
2477   [\\/]* | ?:[\\/]*)
2478   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2479   ;;
2480   *)
2481   ac_save_IFS=$IFS; IFS=$ac_path_separator
2482 ac_dummy="$PATH"
2483 for ac_dir in $ac_dummy; do
2484   IFS=$ac_save_IFS
2485   test -z "$ac_dir" && ac_dir=.
2486   if $as_executable_p "$ac_dir/$ac_word"; then
2487    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2488    echo "$as_me:2488: found $ac_dir/$ac_word" >&5
2489    break
2490 fi
2491 done
2492
2493   ;;
2494 esac
2495 fi
2496 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2497
2498 if test -n "$PKG_CONFIG"; then
2499   echo "$as_me:2499: result: $PKG_CONFIG" >&5
2500 echo "${ECHO_T}$PKG_CONFIG" >&6
2501 else
2502   echo "$as_me:2502: result: no" >&5
2503 echo "${ECHO_T}no" >&6
2504 fi
2505
2506 fi
2507 if test -z "$ac_cv_path_PKG_CONFIG"; then
2508   ac_pt_PKG_CONFIG=$PKG_CONFIG
2509   # Extract the first word of "pkg-config", so it can be a program name with args.
2510 set dummy pkg-config; ac_word=$2
2511 echo "$as_me:2511: checking for $ac_word" >&5
2512 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2513 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2514   echo $ECHO_N "(cached) $ECHO_C" >&6
2515 else
2516   case $ac_pt_PKG_CONFIG in
2517   [\\/]* | ?:[\\/]*)
2518   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2519   ;;
2520   *)
2521   ac_save_IFS=$IFS; IFS=$ac_path_separator
2522 ac_dummy="$PATH"
2523 for ac_dir in $ac_dummy; do
2524   IFS=$ac_save_IFS
2525   test -z "$ac_dir" && ac_dir=.
2526   if $as_executable_p "$ac_dir/$ac_word"; then
2527    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2528    echo "$as_me:2528: found $ac_dir/$ac_word" >&5
2529    break
2530 fi
2531 done
2532
2533   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2534   ;;
2535 esac
2536 fi
2537 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2538
2539 if test -n "$ac_pt_PKG_CONFIG"; then
2540   echo "$as_me:2540: result: $ac_pt_PKG_CONFIG" >&5
2541 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2542 else
2543   echo "$as_me:2543: result: no" >&5
2544 echo "${ECHO_T}no" >&6
2545 fi
2546
2547   PKG_CONFIG=$ac_pt_PKG_CONFIG
2548 else
2549   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2550 fi
2551
2552         ;;
2553 (*)
2554         PKG_CONFIG=$withval
2555         ;;
2556 esac
2557
2558 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2559 if test "$PKG_CONFIG" != none ; then
2560
2561 if test "x$prefix" != xNONE; then
2562         cf_path_syntax="$prefix"
2563 else
2564         cf_path_syntax="$ac_default_prefix"
2565 fi
2566
2567 case ".$PKG_CONFIG" in
2568 (.\$\(*\)*|.\'*\'*)
2569         ;;
2570 (..|./*|.\\*)
2571         ;;
2572 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2573         ;;
2574 (.\${*prefix}*|.\${*dir}*)
2575         eval PKG_CONFIG="$PKG_CONFIG"
2576         case ".$PKG_CONFIG" in
2577         (.NONE/*)
2578                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2579                 ;;
2580         esac
2581         ;;
2582 (.no|.NONE/*)
2583         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2584         ;;
2585 (*)
2586         { { echo "$as_me:2586: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2587 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2588    { (exit 1); exit 1; }; }
2589         ;;
2590 esac
2591
2592 elif test "x$cf_pkg_config" != xno ; then
2593         { echo "$as_me:2593: WARNING: pkg-config is not installed" >&5
2594 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2595 fi
2596
2597 case $PKG_CONFIG in
2598 (no|none|yes)
2599         echo "$as_me:2599: checking for pkg-config library directory" >&5
2600 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2601         ;;
2602 (*)
2603         echo "$as_me:2603: checking for $PKG_CONFIG library directory" >&5
2604 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2605         ;;
2606 esac
2607
2608 PKG_CONFIG_LIBDIR=no
2609
2610 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2611 if test "${with_pkg_config_libdir+set}" = set; then
2612   withval="$with_pkg_config_libdir"
2613   PKG_CONFIG_LIBDIR=$withval
2614 else
2615   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2616 fi;
2617
2618 case x$PKG_CONFIG_LIBDIR in
2619 (x/*)
2620         ;;
2621 (xyes)
2622         # Look for the library directory using the same prefix as the executable
2623         if test "x$PKG_CONFIG" = xnone
2624         then
2625                 cf_path=$prefix
2626         else
2627                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2628         fi
2629
2630         # If you don't like using the default architecture, you have to specify the
2631         # intended library directory and corresponding compiler/linker options.
2632         #
2633         # This case allows for Debian's 2014-flavor of multiarch, along with the
2634         # most common variations before that point.  Some other variants spell the
2635         # directory differently, e.g., "pkg-config", and put it in unusual places.
2636         # pkg-config has always been poorly standardized, which is ironic...
2637         case x`(arch) 2>/dev/null` in
2638         (*64)
2639                 cf_search_path="\
2640                         $cf_path/lib/*64-linux-gnu \
2641                         $cf_path/share \
2642                         $cf_path/lib64 \
2643                         $cf_path/lib32 \
2644                         $cf_path/lib"
2645                 ;;
2646         (*)
2647                 cf_search_path="\
2648                         $cf_path/lib/*-linux-gnu \
2649                         $cf_path/share \
2650                         $cf_path/lib32 \
2651                         $cf_path/lib \
2652                         $cf_path/libdata"
2653                 ;;
2654         esac
2655
2656         test -n "$verbose" && echo "    list..." 1>&6
2657
2658 echo "${as_me:-configure}:2658: testing list... ..." 1>&5
2659
2660         for cf_config in $cf_search_path
2661         do
2662                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2663
2664 echo "${as_me:-configure}:2664: testing checking $cf_config/pkgconfig ..." 1>&5
2665
2666                 if test -d $cf_config/pkgconfig
2667                 then
2668                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2669                         echo "$as_me:2669: checking done" >&5
2670 echo $ECHO_N "checking done... $ECHO_C" >&6
2671                         break
2672                 fi
2673         done
2674         ;;
2675 (*)
2676         ;;
2677 esac
2678
2679 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2680         echo "$as_me:2680: result: $PKG_CONFIG_LIBDIR" >&5
2681 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2682 fi
2683
2684 echo "$as_me:2684: checking if you want to build test-programs" >&5
2685 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2686
2687 # Check whether --with-tests or --without-tests was given.
2688 if test "${with_tests+set}" = set; then
2689   withval="$with_tests"
2690   cf_with_tests=$withval
2691 else
2692   cf_with_tests=yes
2693 fi;
2694 echo "$as_me:2694: result: $cf_with_tests" >&5
2695 echo "${ECHO_T}$cf_with_tests" >&6
2696
2697 echo "$as_me:2697: checking if we should assume mixed-case filenames" >&5
2698 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2699
2700 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2701 if test "${enable_mixed_case+set}" = set; then
2702   enableval="$enable_mixed_case"
2703   enable_mixedcase=$enableval
2704 else
2705   enable_mixedcase=auto
2706 fi;
2707 echo "$as_me:2707: result: $enable_mixedcase" >&5
2708 echo "${ECHO_T}$enable_mixedcase" >&6
2709 if test "$enable_mixedcase" = "auto" ; then
2710
2711 echo "$as_me:2711: checking if filesystem supports mixed-case filenames" >&5
2712 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2713 if test "${cf_cv_mixedcase+set}" = set; then
2714   echo $ECHO_N "(cached) $ECHO_C" >&6
2715 else
2716
2717 if test "$cross_compiling" = yes ; then
2718         case $target_alias in
2719         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2720                 cf_cv_mixedcase=no
2721                 ;;
2722         (*)
2723                 cf_cv_mixedcase=yes
2724                 ;;
2725         esac
2726 else
2727         rm -f conftest CONFTEST
2728         echo test >conftest
2729         if test -f CONFTEST ; then
2730                 cf_cv_mixedcase=no
2731         else
2732                 cf_cv_mixedcase=yes
2733         fi
2734         rm -f conftest CONFTEST
2735 fi
2736
2737 fi
2738 echo "$as_me:2738: result: $cf_cv_mixedcase" >&5
2739 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2740 test "$cf_cv_mixedcase" = yes &&
2741 cat >>confdefs.h <<\EOF
2742 #define MIXEDCASE_FILENAMES 1
2743 EOF
2744
2745 else
2746         cf_cv_mixedcase=$enable_mixedcase
2747         if test "$enable_mixedcase" = "yes" ; then
2748                 cat >>confdefs.h <<\EOF
2749 #define MIXEDCASE_FILENAMES 1
2750 EOF
2751
2752         fi
2753 fi
2754
2755 # do this after mixed-case option (tags/TAGS is not as important as tic).
2756 echo "$as_me:2756: checking whether ${MAKE-make} sets \${MAKE}" >&5
2757 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2758 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2759 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2760   echo $ECHO_N "(cached) $ECHO_C" >&6
2761 else
2762   cat >conftest.make <<\EOF
2763 all:
2764         @echo 'ac_maketemp="${MAKE}"'
2765 EOF
2766 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2767 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2768 if test -n "$ac_maketemp"; then
2769   eval ac_cv_prog_make_${ac_make}_set=yes
2770 else
2771   eval ac_cv_prog_make_${ac_make}_set=no
2772 fi
2773 rm -f conftest.make
2774 fi
2775 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2776   echo "$as_me:2776: result: yes" >&5
2777 echo "${ECHO_T}yes" >&6
2778   SET_MAKE=
2779 else
2780   echo "$as_me:2780: result: no" >&5
2781 echo "${ECHO_T}no" >&6
2782   SET_MAKE="MAKE=${MAKE-make}"
2783 fi
2784
2785 for ac_prog in exctags ctags
2786 do
2787   # Extract the first word of "$ac_prog", so it can be a program name with args.
2788 set dummy $ac_prog; ac_word=$2
2789 echo "$as_me:2789: checking for $ac_word" >&5
2790 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2791 if test "${ac_cv_prog_CTAGS+set}" = set; then
2792   echo $ECHO_N "(cached) $ECHO_C" >&6
2793 else
2794   if test -n "$CTAGS"; then
2795   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2796 else
2797   ac_save_IFS=$IFS; IFS=$ac_path_separator
2798 ac_dummy="$PATH"
2799 for ac_dir in $ac_dummy; do
2800   IFS=$ac_save_IFS
2801   test -z "$ac_dir" && ac_dir=.
2802   $as_executable_p "$ac_dir/$ac_word" || continue
2803 ac_cv_prog_CTAGS="$ac_prog"
2804 echo "$as_me:2804: found $ac_dir/$ac_word" >&5
2805 break
2806 done
2807
2808 fi
2809 fi
2810 CTAGS=$ac_cv_prog_CTAGS
2811 if test -n "$CTAGS"; then
2812   echo "$as_me:2812: result: $CTAGS" >&5
2813 echo "${ECHO_T}$CTAGS" >&6
2814 else
2815   echo "$as_me:2815: result: no" >&5
2816 echo "${ECHO_T}no" >&6
2817 fi
2818
2819   test -n "$CTAGS" && break
2820 done
2821
2822 for ac_prog in exetags etags
2823 do
2824   # Extract the first word of "$ac_prog", so it can be a program name with args.
2825 set dummy $ac_prog; ac_word=$2
2826 echo "$as_me:2826: checking for $ac_word" >&5
2827 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2828 if test "${ac_cv_prog_ETAGS+set}" = set; then
2829   echo $ECHO_N "(cached) $ECHO_C" >&6
2830 else
2831   if test -n "$ETAGS"; then
2832   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2833 else
2834   ac_save_IFS=$IFS; IFS=$ac_path_separator
2835 ac_dummy="$PATH"
2836 for ac_dir in $ac_dummy; do
2837   IFS=$ac_save_IFS
2838   test -z "$ac_dir" && ac_dir=.
2839   $as_executable_p "$ac_dir/$ac_word" || continue
2840 ac_cv_prog_ETAGS="$ac_prog"
2841 echo "$as_me:2841: found $ac_dir/$ac_word" >&5
2842 break
2843 done
2844
2845 fi
2846 fi
2847 ETAGS=$ac_cv_prog_ETAGS
2848 if test -n "$ETAGS"; then
2849   echo "$as_me:2849: result: $ETAGS" >&5
2850 echo "${ECHO_T}$ETAGS" >&6
2851 else
2852   echo "$as_me:2852: result: no" >&5
2853 echo "${ECHO_T}no" >&6
2854 fi
2855
2856   test -n "$ETAGS" && break
2857 done
2858
2859 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2860 set dummy ${CTAGS:-ctags}; ac_word=$2
2861 echo "$as_me:2861: checking for $ac_word" >&5
2862 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2863 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2864   echo $ECHO_N "(cached) $ECHO_C" >&6
2865 else
2866   if test -n "$MAKE_LOWER_TAGS"; then
2867   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2868 else
2869   ac_save_IFS=$IFS; IFS=$ac_path_separator
2870 ac_dummy="$PATH"
2871 for ac_dir in $ac_dummy; do
2872   IFS=$ac_save_IFS
2873   test -z "$ac_dir" && ac_dir=.
2874   $as_executable_p "$ac_dir/$ac_word" || continue
2875 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2876 echo "$as_me:2876: found $ac_dir/$ac_word" >&5
2877 break
2878 done
2879
2880   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2881 fi
2882 fi
2883 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2884 if test -n "$MAKE_LOWER_TAGS"; then
2885   echo "$as_me:2885: result: $MAKE_LOWER_TAGS" >&5
2886 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2887 else
2888   echo "$as_me:2888: result: no" >&5
2889 echo "${ECHO_T}no" >&6
2890 fi
2891
2892 if test "$cf_cv_mixedcase" = yes ; then
2893         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2894 set dummy ${ETAGS:-etags}; ac_word=$2
2895 echo "$as_me:2895: checking for $ac_word" >&5
2896 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2897 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2898   echo $ECHO_N "(cached) $ECHO_C" >&6
2899 else
2900   if test -n "$MAKE_UPPER_TAGS"; then
2901   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2902 else
2903   ac_save_IFS=$IFS; IFS=$ac_path_separator
2904 ac_dummy="$PATH"
2905 for ac_dir in $ac_dummy; do
2906   IFS=$ac_save_IFS
2907   test -z "$ac_dir" && ac_dir=.
2908   $as_executable_p "$ac_dir/$ac_word" || continue
2909 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2910 echo "$as_me:2910: found $ac_dir/$ac_word" >&5
2911 break
2912 done
2913
2914   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2915 fi
2916 fi
2917 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2918 if test -n "$MAKE_UPPER_TAGS"; then
2919   echo "$as_me:2919: result: $MAKE_UPPER_TAGS" >&5
2920 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2921 else
2922   echo "$as_me:2922: result: no" >&5
2923 echo "${ECHO_T}no" >&6
2924 fi
2925
2926 else
2927         MAKE_UPPER_TAGS=no
2928 fi
2929
2930 if test "$MAKE_UPPER_TAGS" = yes ; then
2931         MAKE_UPPER_TAGS=
2932 else
2933         MAKE_UPPER_TAGS="#"
2934 fi
2935
2936 if test "$MAKE_LOWER_TAGS" = yes ; then
2937         MAKE_LOWER_TAGS=
2938 else
2939         MAKE_LOWER_TAGS="#"
2940 fi
2941
2942 echo "$as_me:2942: checking for makeflags variable" >&5
2943 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2944 if test "${cf_cv_makeflags+set}" = set; then
2945   echo $ECHO_N "(cached) $ECHO_C" >&6
2946 else
2947
2948         cf_cv_makeflags=''
2949         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2950         do
2951                 cat >cf_makeflags.tmp <<CF_EOF
2952 SHELL = $SHELL
2953 all :
2954         @ echo '.$cf_option'
2955 CF_EOF
2956                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2957                 case "$cf_result" in
2958                 (.*k|.*kw)
2959                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2960                         case "$cf_result" in
2961                         (.*CC=*)        cf_cv_makeflags=
2962                                 ;;
2963                         (*)     cf_cv_makeflags=$cf_option
2964                                 ;;
2965                         esac
2966                         break
2967                         ;;
2968                 (.-)    ;;
2969                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2970                         ;;
2971                 esac
2972         done
2973         rm -f cf_makeflags.tmp
2974
2975 fi
2976 echo "$as_me:2976: result: $cf_cv_makeflags" >&5
2977 echo "${ECHO_T}$cf_cv_makeflags" >&6
2978
2979 if test -n "$ac_tool_prefix"; then
2980   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2981 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2982 echo "$as_me:2982: checking for $ac_word" >&5
2983 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2984 if test "${ac_cv_prog_RANLIB+set}" = set; then
2985   echo $ECHO_N "(cached) $ECHO_C" >&6
2986 else
2987   if test -n "$RANLIB"; then
2988   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2989 else
2990   ac_save_IFS=$IFS; IFS=$ac_path_separator
2991 ac_dummy="$PATH"
2992 for ac_dir in $ac_dummy; do
2993   IFS=$ac_save_IFS
2994   test -z "$ac_dir" && ac_dir=.
2995   $as_executable_p "$ac_dir/$ac_word" || continue
2996 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2997 echo "$as_me:2997: found $ac_dir/$ac_word" >&5
2998 break
2999 done
3000
3001 fi
3002 fi
3003 RANLIB=$ac_cv_prog_RANLIB
3004 if test -n "$RANLIB"; then
3005   echo "$as_me:3005: result: $RANLIB" >&5
3006 echo "${ECHO_T}$RANLIB" >&6
3007 else
3008   echo "$as_me:3008: result: no" >&5
3009 echo "${ECHO_T}no" >&6
3010 fi
3011
3012 fi
3013 if test -z "$ac_cv_prog_RANLIB"; then
3014   ac_ct_RANLIB=$RANLIB
3015   # Extract the first word of "ranlib", so it can be a program name with args.
3016 set dummy ranlib; ac_word=$2
3017 echo "$as_me:3017: checking for $ac_word" >&5
3018 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3019 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3020   echo $ECHO_N "(cached) $ECHO_C" >&6
3021 else
3022   if test -n "$ac_ct_RANLIB"; then
3023   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3024 else
3025   ac_save_IFS=$IFS; IFS=$ac_path_separator
3026 ac_dummy="$PATH"
3027 for ac_dir in $ac_dummy; do
3028   IFS=$ac_save_IFS
3029   test -z "$ac_dir" && ac_dir=.
3030   $as_executable_p "$ac_dir/$ac_word" || continue
3031 ac_cv_prog_ac_ct_RANLIB="ranlib"
3032 echo "$as_me:3032: found $ac_dir/$ac_word" >&5
3033 break
3034 done
3035
3036   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3037 fi
3038 fi
3039 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3040 if test -n "$ac_ct_RANLIB"; then
3041   echo "$as_me:3041: result: $ac_ct_RANLIB" >&5
3042 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3043 else
3044   echo "$as_me:3044: result: no" >&5
3045 echo "${ECHO_T}no" >&6
3046 fi
3047
3048   RANLIB=$ac_ct_RANLIB
3049 else
3050   RANLIB="$ac_cv_prog_RANLIB"
3051 fi
3052
3053 if test -n "$ac_tool_prefix"; then
3054   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3055 set dummy ${ac_tool_prefix}ld; ac_word=$2
3056 echo "$as_me:3056: checking for $ac_word" >&5
3057 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3058 if test "${ac_cv_prog_LD+set}" = set; then
3059   echo $ECHO_N "(cached) $ECHO_C" >&6
3060 else
3061   if test -n "$LD"; then
3062   ac_cv_prog_LD="$LD" # Let the user override the test.
3063 else
3064   ac_save_IFS=$IFS; IFS=$ac_path_separator
3065 ac_dummy="$PATH"
3066 for ac_dir in $ac_dummy; do
3067   IFS=$ac_save_IFS
3068   test -z "$ac_dir" && ac_dir=.
3069   $as_executable_p "$ac_dir/$ac_word" || continue
3070 ac_cv_prog_LD="${ac_tool_prefix}ld"
3071 echo "$as_me:3071: found $ac_dir/$ac_word" >&5
3072 break
3073 done
3074
3075 fi
3076 fi
3077 LD=$ac_cv_prog_LD
3078 if test -n "$LD"; then
3079   echo "$as_me:3079: result: $LD" >&5
3080 echo "${ECHO_T}$LD" >&6
3081 else
3082   echo "$as_me:3082: result: no" >&5
3083 echo "${ECHO_T}no" >&6
3084 fi
3085
3086 fi
3087 if test -z "$ac_cv_prog_LD"; then
3088   ac_ct_LD=$LD
3089   # Extract the first word of "ld", so it can be a program name with args.
3090 set dummy ld; ac_word=$2
3091 echo "$as_me:3091: checking for $ac_word" >&5
3092 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3093 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3094   echo $ECHO_N "(cached) $ECHO_C" >&6
3095 else
3096   if test -n "$ac_ct_LD"; then
3097   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3098 else
3099   ac_save_IFS=$IFS; IFS=$ac_path_separator
3100 ac_dummy="$PATH"
3101 for ac_dir in $ac_dummy; do
3102   IFS=$ac_save_IFS
3103   test -z "$ac_dir" && ac_dir=.
3104   $as_executable_p "$ac_dir/$ac_word" || continue
3105 ac_cv_prog_ac_ct_LD="ld"
3106 echo "$as_me:3106: found $ac_dir/$ac_word" >&5
3107 break
3108 done
3109
3110   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3111 fi
3112 fi
3113 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3114 if test -n "$ac_ct_LD"; then
3115   echo "$as_me:3115: result: $ac_ct_LD" >&5
3116 echo "${ECHO_T}$ac_ct_LD" >&6
3117 else
3118   echo "$as_me:3118: result: no" >&5
3119 echo "${ECHO_T}no" >&6
3120 fi
3121
3122   LD=$ac_ct_LD
3123 else
3124   LD="$ac_cv_prog_LD"
3125 fi
3126
3127 if test -n "$ac_tool_prefix"; then
3128   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3129 set dummy ${ac_tool_prefix}ar; ac_word=$2
3130 echo "$as_me:3130: checking for $ac_word" >&5
3131 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3132 if test "${ac_cv_prog_AR+set}" = set; then
3133   echo $ECHO_N "(cached) $ECHO_C" >&6
3134 else
3135   if test -n "$AR"; then
3136   ac_cv_prog_AR="$AR" # Let the user override the test.
3137 else
3138   ac_save_IFS=$IFS; IFS=$ac_path_separator
3139 ac_dummy="$PATH"
3140 for ac_dir in $ac_dummy; do
3141   IFS=$ac_save_IFS
3142   test -z "$ac_dir" && ac_dir=.
3143   $as_executable_p "$ac_dir/$ac_word" || continue
3144 ac_cv_prog_AR="${ac_tool_prefix}ar"
3145 echo "$as_me:3145: found $ac_dir/$ac_word" >&5
3146 break
3147 done
3148
3149 fi
3150 fi
3151 AR=$ac_cv_prog_AR
3152 if test -n "$AR"; then
3153   echo "$as_me:3153: result: $AR" >&5
3154 echo "${ECHO_T}$AR" >&6
3155 else
3156   echo "$as_me:3156: result: no" >&5
3157 echo "${ECHO_T}no" >&6
3158 fi
3159
3160 fi
3161 if test -z "$ac_cv_prog_AR"; then
3162   ac_ct_AR=$AR
3163   # Extract the first word of "ar", so it can be a program name with args.
3164 set dummy ar; ac_word=$2
3165 echo "$as_me:3165: checking for $ac_word" >&5
3166 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3167 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3168   echo $ECHO_N "(cached) $ECHO_C" >&6
3169 else
3170   if test -n "$ac_ct_AR"; then
3171   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3172 else
3173   ac_save_IFS=$IFS; IFS=$ac_path_separator
3174 ac_dummy="$PATH"
3175 for ac_dir in $ac_dummy; do
3176   IFS=$ac_save_IFS
3177   test -z "$ac_dir" && ac_dir=.
3178   $as_executable_p "$ac_dir/$ac_word" || continue
3179 ac_cv_prog_ac_ct_AR="ar"
3180 echo "$as_me:3180: found $ac_dir/$ac_word" >&5
3181 break
3182 done
3183
3184   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3185 fi
3186 fi
3187 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3188 if test -n "$ac_ct_AR"; then
3189   echo "$as_me:3189: result: $ac_ct_AR" >&5
3190 echo "${ECHO_T}$ac_ct_AR" >&6
3191 else
3192   echo "$as_me:3192: result: no" >&5
3193 echo "${ECHO_T}no" >&6
3194 fi
3195
3196   AR=$ac_ct_AR
3197 else
3198   AR="$ac_cv_prog_AR"
3199 fi
3200
3201 if test -n "$ac_tool_prefix"; then
3202   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3203 set dummy ${ac_tool_prefix}ar; ac_word=$2
3204 echo "$as_me:3204: checking for $ac_word" >&5
3205 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3206 if test "${ac_cv_prog_AR+set}" = set; then
3207   echo $ECHO_N "(cached) $ECHO_C" >&6
3208 else
3209   if test -n "$AR"; then
3210   ac_cv_prog_AR="$AR" # Let the user override the test.
3211 else
3212   ac_save_IFS=$IFS; IFS=$ac_path_separator
3213 ac_dummy="$PATH"
3214 for ac_dir in $ac_dummy; do
3215   IFS=$ac_save_IFS
3216   test -z "$ac_dir" && ac_dir=.
3217   $as_executable_p "$ac_dir/$ac_word" || continue
3218 ac_cv_prog_AR="${ac_tool_prefix}ar"
3219 echo "$as_me:3219: found $ac_dir/$ac_word" >&5
3220 break
3221 done
3222
3223 fi
3224 fi
3225 AR=$ac_cv_prog_AR
3226 if test -n "$AR"; then
3227   echo "$as_me:3227: result: $AR" >&5
3228 echo "${ECHO_T}$AR" >&6
3229 else
3230   echo "$as_me:3230: result: no" >&5
3231 echo "${ECHO_T}no" >&6
3232 fi
3233
3234 fi
3235 if test -z "$ac_cv_prog_AR"; then
3236   ac_ct_AR=$AR
3237   # Extract the first word of "ar", so it can be a program name with args.
3238 set dummy ar; ac_word=$2
3239 echo "$as_me:3239: checking for $ac_word" >&5
3240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3241 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3242   echo $ECHO_N "(cached) $ECHO_C" >&6
3243 else
3244   if test -n "$ac_ct_AR"; then
3245   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3246 else
3247   ac_save_IFS=$IFS; IFS=$ac_path_separator
3248 ac_dummy="$PATH"
3249 for ac_dir in $ac_dummy; do
3250   IFS=$ac_save_IFS
3251   test -z "$ac_dir" && ac_dir=.
3252   $as_executable_p "$ac_dir/$ac_word" || continue
3253 ac_cv_prog_ac_ct_AR="ar"
3254 echo "$as_me:3254: found $ac_dir/$ac_word" >&5
3255 break
3256 done
3257
3258   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3259 fi
3260 fi
3261 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3262 if test -n "$ac_ct_AR"; then
3263   echo "$as_me:3263: result: $ac_ct_AR" >&5
3264 echo "${ECHO_T}$ac_ct_AR" >&6
3265 else
3266   echo "$as_me:3266: result: no" >&5
3267 echo "${ECHO_T}no" >&6
3268 fi
3269
3270   AR=$ac_ct_AR
3271 else
3272   AR="$ac_cv_prog_AR"
3273 fi
3274
3275 echo "$as_me:3275: checking for options to update archives" >&5
3276 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3277 if test "${cf_cv_ar_flags+set}" = set; then
3278   echo $ECHO_N "(cached) $ECHO_C" >&6
3279 else
3280
3281         cf_cv_ar_flags=unknown
3282         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3283         do
3284
3285                 # check if $ARFLAGS already contains this choice
3286                 if test "x$ARFLAGS" != "x" ; then
3287                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3288                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3289                                 cf_cv_ar_flags=
3290                                 break
3291                         fi
3292                 fi
3293
3294                 rm -f conftest.$ac_cv_objext
3295                 rm -f conftest.a
3296
3297                 cat >conftest.$ac_ext <<EOF
3298 #line 3298 "configure"
3299 int     testdata[3] = { 123, 456, 789 };
3300 EOF
3301                 if { (eval echo "$as_me:3301: \"$ac_compile\"") >&5
3302   (eval $ac_compile) 2>&5
3303   ac_status=$?
3304   echo "$as_me:3304: \$? = $ac_status" >&5
3305   (exit $ac_status); } ; then
3306                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3307                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3308                         if test -f conftest.a ; then
3309                                 cf_cv_ar_flags=$cf_ar_flags
3310                                 break
3311                         fi
3312                 else
3313                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3314
3315 echo "${as_me:-configure}:3315: testing cannot compile test-program ..." 1>&5
3316
3317                         break
3318                 fi
3319         done
3320         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3321
3322 fi
3323 echo "$as_me:3323: result: $cf_cv_ar_flags" >&5
3324 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3325
3326 if test -n "$ARFLAGS" ; then
3327         if test -n "$cf_cv_ar_flags" ; then
3328                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3329         fi
3330 else
3331         ARFLAGS=$cf_cv_ar_flags
3332 fi
3333
3334         echo "$as_me:3334: checking for PATH separator" >&5
3335 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3336         case $cf_cv_system_name in
3337         (os2*)  PATH_SEPARATOR=';'  ;;
3338         (*)     ${PATH_SEPARATOR:=':'}  ;;
3339         esac
3340
3341         echo "$as_me:3341: result: $PATH_SEPARATOR" >&5
3342 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3343
3344 echo "$as_me:3344: checking if you have specified an install-prefix" >&5
3345 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3346
3347 # Check whether --with-install-prefix or --without-install-prefix was given.
3348 if test "${with_install_prefix+set}" = set; then
3349   withval="$with_install_prefix"
3350   case "$withval" in
3351         (yes|no)
3352                 ;;
3353         (*)     DESTDIR="$withval"
3354                 ;;
3355         esac
3356 fi;
3357 echo "$as_me:3357: result: $DESTDIR" >&5
3358 echo "${ECHO_T}$DESTDIR" >&6
3359
3360 ###############################################################################
3361
3362 # If we're cross-compiling, allow the user to override the tools and their
3363 # options.  The configure script is oriented toward identifying the host
3364 # compiler, etc., but we need a build compiler to generate parts of the source.
3365
3366 if test "$cross_compiling" = yes ; then
3367
3368         # defaults that we might want to override
3369         : ${BUILD_CFLAGS:=''}
3370         : ${BUILD_CPPFLAGS:=''}
3371         : ${BUILD_LDFLAGS:=''}
3372         : ${BUILD_LIBS:=''}
3373         : ${BUILD_EXEEXT:='$x'}
3374         : ${BUILD_OBJEXT:='o'}
3375
3376 # Check whether --with-build-cc or --without-build-cc was given.
3377 if test "${with_build_cc+set}" = set; then
3378   withval="$with_build_cc"
3379   BUILD_CC="$withval"
3380 else
3381   for ac_prog in gcc cc cl
3382 do
3383   # Extract the first word of "$ac_prog", so it can be a program name with args.
3384 set dummy $ac_prog; ac_word=$2
3385 echo "$as_me:3385: checking for $ac_word" >&5
3386 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3387 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3388   echo $ECHO_N "(cached) $ECHO_C" >&6
3389 else
3390   if test -n "$BUILD_CC"; then
3391   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3392 else
3393   ac_save_IFS=$IFS; IFS=$ac_path_separator
3394 ac_dummy="$PATH"
3395 for ac_dir in $ac_dummy; do
3396   IFS=$ac_save_IFS
3397   test -z "$ac_dir" && ac_dir=.
3398   $as_executable_p "$ac_dir/$ac_word" || continue
3399 ac_cv_prog_BUILD_CC="$ac_prog"
3400 echo "$as_me:3400: found $ac_dir/$ac_word" >&5
3401 break
3402 done
3403
3404 fi
3405 fi
3406 BUILD_CC=$ac_cv_prog_BUILD_CC
3407 if test -n "$BUILD_CC"; then
3408   echo "$as_me:3408: result: $BUILD_CC" >&5
3409 echo "${ECHO_T}$BUILD_CC" >&6
3410 else
3411   echo "$as_me:3411: result: no" >&5
3412 echo "${ECHO_T}no" >&6
3413 fi
3414
3415   test -n "$BUILD_CC" && break
3416 done
3417
3418 fi;
3419         echo "$as_me:3419: checking for native build C compiler" >&5
3420 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3421         echo "$as_me:3421: result: $BUILD_CC" >&5
3422 echo "${ECHO_T}$BUILD_CC" >&6
3423
3424         echo "$as_me:3424: checking for native build C preprocessor" >&5
3425 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3426
3427 # Check whether --with-build-cpp or --without-build-cpp was given.
3428 if test "${with_build_cpp+set}" = set; then
3429   withval="$with_build_cpp"
3430   BUILD_CPP="$withval"
3431 else
3432   BUILD_CPP='${BUILD_CC} -E'
3433 fi;
3434         echo "$as_me:3434: result: $BUILD_CPP" >&5
3435 echo "${ECHO_T}$BUILD_CPP" >&6
3436
3437         echo "$as_me:3437: checking for native build C flags" >&5
3438 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3439
3440 # Check whether --with-build-cflags or --without-build-cflags was given.
3441 if test "${with_build_cflags+set}" = set; then
3442   withval="$with_build_cflags"
3443   BUILD_CFLAGS="$withval"
3444 fi;
3445         echo "$as_me:3445: result: $BUILD_CFLAGS" >&5
3446 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3447
3448         echo "$as_me:3448: checking for native build C preprocessor-flags" >&5
3449 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3450
3451 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3452 if test "${with_build_cppflags+set}" = set; then
3453   withval="$with_build_cppflags"
3454   BUILD_CPPFLAGS="$withval"
3455 fi;
3456         echo "$as_me:3456: result: $BUILD_CPPFLAGS" >&5
3457 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3458
3459         echo "$as_me:3459: checking for native build linker-flags" >&5
3460 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3461
3462 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3463 if test "${with_build_ldflags+set}" = set; then
3464   withval="$with_build_ldflags"
3465   BUILD_LDFLAGS="$withval"
3466 fi;
3467         echo "$as_me:3467: result: $BUILD_LDFLAGS" >&5
3468 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3469
3470         echo "$as_me:3470: checking for native build linker-libraries" >&5
3471 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3472
3473 # Check whether --with-build-libs or --without-build-libs was given.
3474 if test "${with_build_libs+set}" = set; then
3475   withval="$with_build_libs"
3476   BUILD_LIBS="$withval"
3477 fi;
3478         echo "$as_me:3478: result: $BUILD_LIBS" >&5
3479 echo "${ECHO_T}$BUILD_LIBS" >&6
3480
3481         # this assumes we're on Unix.
3482         BUILD_EXEEXT=
3483         BUILD_OBJEXT=o
3484
3485         : ${BUILD_CC:='${CC}'}
3486
3487         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3488                 { { echo "$as_me:3488: error: Cross-build requires two compilers.
3489 Use --with-build-cc to specify the native compiler." >&5
3490 echo "$as_me: error: Cross-build requires two compilers.
3491 Use --with-build-cc to specify the native compiler." >&2;}
3492    { (exit 1); exit 1; }; }
3493         fi
3494
3495 else
3496         : ${BUILD_CC:='${CC}'}
3497         : ${BUILD_CPP:='${CPP}'}
3498         : ${BUILD_CFLAGS:='${CFLAGS}'}
3499         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3500         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3501         : ${BUILD_LIBS:='${LIBS}'}
3502         : ${BUILD_EXEEXT:='$x'}
3503         : ${BUILD_OBJEXT:='o'}
3504 fi
3505
3506 ###############################################################################
3507
3508 ### Options to allow the user to specify the set of libraries which are used.
3509 ### Use "--without-normal --with-shared" to allow the default model to be
3510 ### shared, for example.
3511 cf_list_models=""
3512
3513 echo "$as_me:3513: checking if you want to build shared C-objects" >&5
3514 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3515
3516 # Check whether --with-shared or --without-shared was given.
3517 if test "${with_shared+set}" = set; then
3518   withval="$with_shared"
3519   with_shared=$withval
3520 else
3521   with_shared=no
3522 fi;
3523 echo "$as_me:3523: result: $with_shared" >&5
3524 echo "${ECHO_T}$with_shared" >&6
3525 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3526
3527 echo "$as_me:3527: checking for specified models" >&5
3528 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3529 test -z "$cf_list_models" && cf_list_models=normal
3530 echo "$as_me:3530: result: $cf_list_models" >&5
3531 echo "${ECHO_T}$cf_list_models" >&6
3532
3533 ### Use the first model as the default, and save its suffix for use in building
3534 ### up test-applications.
3535 echo "$as_me:3535: checking for default model" >&5
3536 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3537 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3538 echo "$as_me:3538: result: $DFT_LWR_MODEL" >&5
3539 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3540
3541 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3542
3543 echo "$as_me:3543: checking for specific curses-directory" >&5
3544 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3545
3546 # Check whether --with-curses-dir or --without-curses-dir was given.
3547 if test "${with_curses_dir+set}" = set; then
3548   withval="$with_curses_dir"
3549   cf_cv_curses_dir=$withval
3550 else
3551   cf_cv_curses_dir=no
3552 fi;
3553 echo "$as_me:3553: result: $cf_cv_curses_dir" >&5
3554 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3555
3556 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3557 then
3558
3559 if test "x$prefix" != xNONE; then
3560         cf_path_syntax="$prefix"
3561 else
3562         cf_path_syntax="$ac_default_prefix"
3563 fi
3564
3565 case ".$withval" in
3566 (.\$\(*\)*|.\'*\'*)
3567         ;;
3568 (..|./*|.\\*)
3569         ;;
3570 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3571         ;;
3572 (.\${*prefix}*|.\${*dir}*)
3573         eval withval="$withval"
3574         case ".$withval" in
3575         (.NONE/*)
3576                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3577                 ;;
3578         esac
3579         ;;
3580 (.no|.NONE/*)
3581         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3582         ;;
3583 (*)
3584         { { echo "$as_me:3584: error: expected a pathname, not \"$withval\"" >&5
3585 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3586    { (exit 1); exit 1; }; }
3587         ;;
3588 esac
3589
3590         if test -d "$cf_cv_curses_dir"
3591         then
3592
3593 if test -n "$cf_cv_curses_dir/include" ; then
3594   for cf_add_incdir in $cf_cv_curses_dir/include
3595   do
3596         while test $cf_add_incdir != /usr/include
3597         do
3598           if test -d $cf_add_incdir
3599           then
3600                 cf_have_incdir=no
3601                 if test -n "$CFLAGS$CPPFLAGS" ; then
3602                   # a loop is needed to ensure we can add subdirs of existing dirs
3603                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3604                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3605                           cf_have_incdir=yes; break
3606                         fi
3607                   done
3608                 fi
3609
3610                 if test "$cf_have_incdir" = no ; then
3611                   if test "$cf_add_incdir" = /usr/local/include ; then
3612                         if test "$GCC" = yes
3613                         then
3614                           cf_save_CPPFLAGS=$CPPFLAGS
3615                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3616                           cat >conftest.$ac_ext <<_ACEOF
3617 #line 3617 "configure"
3618 #include "confdefs.h"
3619 #include <stdio.h>
3620 int
3621 main ()
3622 {
3623 printf("Hello")
3624   ;
3625   return 0;
3626 }
3627 _ACEOF
3628 rm -f conftest.$ac_objext
3629 if { (eval echo "$as_me:3629: \"$ac_compile\"") >&5
3630   (eval $ac_compile) 2>&5
3631   ac_status=$?
3632   echo "$as_me:3632: \$? = $ac_status" >&5
3633   (exit $ac_status); } &&
3634          { ac_try='test -s conftest.$ac_objext'
3635   { (eval echo "$as_me:3635: \"$ac_try\"") >&5
3636   (eval $ac_try) 2>&5
3637   ac_status=$?
3638   echo "$as_me:3638: \$? = $ac_status" >&5
3639   (exit $ac_status); }; }; then
3640   :
3641 else
3642   echo "$as_me: failed program was:" >&5
3643 cat conftest.$ac_ext >&5
3644 cf_have_incdir=yes
3645 fi
3646 rm -f conftest.$ac_objext conftest.$ac_ext
3647                           CPPFLAGS=$cf_save_CPPFLAGS
3648                         fi
3649                   fi
3650                 fi
3651
3652                 if test "$cf_have_incdir" = no ; then
3653                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3654
3655 echo "${as_me:-configure}:3655: testing adding $cf_add_incdir to include-path ..." 1>&5
3656
3657                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3658
3659                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3660                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3661                   cf_add_incdir="$cf_top_incdir"
3662                 else
3663                   break
3664                 fi
3665           else
3666                 break
3667           fi
3668         done
3669   done
3670 fi
3671
3672 if test -n "$cf_cv_curses_dir/lib" ; then
3673         for cf_add_libdir in $cf_cv_curses_dir/lib
3674         do
3675                 if test $cf_add_libdir = /usr/lib ; then
3676                         :
3677                 elif test -d $cf_add_libdir
3678                 then
3679                         cf_have_libdir=no
3680                         if test -n "$LDFLAGS$LIBS" ; then
3681                                 # a loop is needed to ensure we can add subdirs of existing dirs
3682                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3683                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3684                                                 cf_have_libdir=yes; break
3685                                         fi
3686                                 done
3687                         fi
3688                         if test "$cf_have_libdir" = no ; then
3689                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3690
3691 echo "${as_me:-configure}:3691: testing adding $cf_add_libdir to library-path ..." 1>&5
3692
3693                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3694                         fi
3695                 fi
3696         done
3697 fi
3698
3699         fi
3700 fi
3701
3702 cf_ncuconfig_root=ncurses
3703 cf_have_ncuconfig=no
3704
3705 if test "x${PKG_CONFIG:=none}" != xnone; then
3706         echo "$as_me:3706: checking pkg-config for $cf_ncuconfig_root" >&5
3707 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3708         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3709                 echo "$as_me:3709: result: yes" >&5
3710 echo "${ECHO_T}yes" >&6
3711
3712                 echo "$as_me:3712: checking if the $cf_ncuconfig_root package files work" >&5
3713 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3714                 cf_have_ncuconfig=unknown
3715
3716                 cf_save_CPPFLAGS="$CPPFLAGS"
3717                 cf_save_LIBS="$LIBS"
3718
3719                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3720
3721 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3722 # Filter out duplicates - this happens with badly-designed ".pc" files...
3723 for cf_add_1lib in $LIBS
3724 do
3725         for cf_add_2lib in $cf_add_libs
3726         do
3727                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3728                 then
3729                         cf_add_1lib=
3730                         break
3731                 fi
3732         done
3733         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3734 done
3735 LIBS="$cf_add_libs"
3736
3737                 cat >conftest.$ac_ext <<_ACEOF
3738 #line 3738 "configure"
3739 #include "confdefs.h"
3740 #include <${cf_cv_ncurses_header:-curses.h}>
3741 int
3742 main ()
3743 {
3744 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3745   ;
3746   return 0;
3747 }
3748 _ACEOF
3749 rm -f conftest.$ac_objext conftest$ac_exeext
3750 if { (eval echo "$as_me:3750: \"$ac_link\"") >&5
3751   (eval $ac_link) 2>&5
3752   ac_status=$?
3753   echo "$as_me:3753: \$? = $ac_status" >&5
3754   (exit $ac_status); } &&
3755          { ac_try='test -s conftest$ac_exeext'
3756   { (eval echo "$as_me:3756: \"$ac_try\"") >&5
3757   (eval $ac_try) 2>&5
3758   ac_status=$?
3759   echo "$as_me:3759: \$? = $ac_status" >&5
3760   (exit $ac_status); }; }; then
3761   if test "$cross_compiling" = yes; then
3762   cf_have_ncuconfig=maybe
3763 else
3764   cat >conftest.$ac_ext <<_ACEOF
3765 #line 3765 "configure"
3766 #include "confdefs.h"
3767 #include <${cf_cv_ncurses_header:-curses.h}>
3768                                 int main(void)
3769                                 { char *xx = curses_version(); return (xx == 0); }
3770 _ACEOF
3771 rm -f conftest$ac_exeext
3772 if { (eval echo "$as_me:3772: \"$ac_link\"") >&5
3773   (eval $ac_link) 2>&5
3774   ac_status=$?
3775   echo "$as_me:3775: \$? = $ac_status" >&5
3776   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3777   { (eval echo "$as_me:3777: \"$ac_try\"") >&5
3778   (eval $ac_try) 2>&5
3779   ac_status=$?
3780   echo "$as_me:3780: \$? = $ac_status" >&5
3781   (exit $ac_status); }; }; then
3782   cf_have_ncuconfig=yes
3783 else
3784   echo "$as_me: program exited with status $ac_status" >&5
3785 echo "$as_me: failed program was:" >&5
3786 cat conftest.$ac_ext >&5
3787 cf_have_ncuconfig=no
3788 fi
3789 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3790 fi
3791 else
3792   echo "$as_me: failed program was:" >&5
3793 cat conftest.$ac_ext >&5
3794 cf_have_ncuconfig=no
3795 fi
3796 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3797                 echo "$as_me:3797: result: $cf_have_ncuconfig" >&5
3798 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3799                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3800                 if test "$cf_have_ncuconfig" != "yes"
3801                 then
3802                         CPPFLAGS="$cf_save_CPPFLAGS"
3803                         LIBS="$cf_save_LIBS"
3804                         NCURSES_CONFIG_PKG=none
3805                 else
3806
3807 cat >>confdefs.h <<\EOF
3808 #define NCURSES 1
3809 EOF
3810
3811                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3812                 fi
3813
3814         else
3815                 echo "$as_me:3815: result: no" >&5
3816 echo "${ECHO_T}no" >&6
3817                 NCURSES_CONFIG_PKG=none
3818         fi
3819 else
3820         NCURSES_CONFIG_PKG=none
3821 fi
3822
3823 if test "x$cf_have_ncuconfig" = "xno"; then
3824         echo "Looking for ${cf_ncuconfig_root}-config"
3825
3826 if test -n "$ac_tool_prefix"; then
3827   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3828   do
3829     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3830 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3831 echo "$as_me:3831: checking for $ac_word" >&5
3832 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3833 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3834   echo $ECHO_N "(cached) $ECHO_C" >&6
3835 else
3836   if test -n "$NCURSES_CONFIG"; then
3837   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3838 else
3839   ac_save_IFS=$IFS; IFS=$ac_path_separator
3840 ac_dummy="$PATH"
3841 for ac_dir in $ac_dummy; do
3842   IFS=$ac_save_IFS
3843   test -z "$ac_dir" && ac_dir=.
3844   $as_executable_p "$ac_dir/$ac_word" || continue
3845 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3846 echo "$as_me:3846: found $ac_dir/$ac_word" >&5
3847 break
3848 done
3849
3850 fi
3851 fi
3852 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3853 if test -n "$NCURSES_CONFIG"; then
3854   echo "$as_me:3854: result: $NCURSES_CONFIG" >&5
3855 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3856 else
3857   echo "$as_me:3857: result: no" >&5
3858 echo "${ECHO_T}no" >&6
3859 fi
3860
3861     test -n "$NCURSES_CONFIG" && break
3862   done
3863 fi
3864 if test -z "$NCURSES_CONFIG"; then
3865   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3866   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3867 do
3868   # Extract the first word of "$ac_prog", so it can be a program name with args.
3869 set dummy $ac_prog; ac_word=$2
3870 echo "$as_me:3870: checking for $ac_word" >&5
3871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3872 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3873   echo $ECHO_N "(cached) $ECHO_C" >&6
3874 else
3875   if test -n "$ac_ct_NCURSES_CONFIG"; then
3876   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3877 else
3878   ac_save_IFS=$IFS; IFS=$ac_path_separator
3879 ac_dummy="$PATH"
3880 for ac_dir in $ac_dummy; do
3881   IFS=$ac_save_IFS
3882   test -z "$ac_dir" && ac_dir=.
3883   $as_executable_p "$ac_dir/$ac_word" || continue
3884 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3885 echo "$as_me:3885: found $ac_dir/$ac_word" >&5
3886 break
3887 done
3888
3889 fi
3890 fi
3891 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3892 if test -n "$ac_ct_NCURSES_CONFIG"; then
3893   echo "$as_me:3893: result: $ac_ct_NCURSES_CONFIG" >&5
3894 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3895 else
3896   echo "$as_me:3896: result: no" >&5
3897 echo "${ECHO_T}no" >&6
3898 fi
3899
3900   test -n "$ac_ct_NCURSES_CONFIG" && break
3901 done
3902 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3903
3904   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3905 fi
3906
3907         if test "$NCURSES_CONFIG" != none ; then
3908
3909                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3910
3911 cf_add_libs="`$NCURSES_CONFIG --libs`"
3912 # Filter out duplicates - this happens with badly-designed ".pc" files...
3913 for cf_add_1lib in $LIBS
3914 do
3915         for cf_add_2lib in $cf_add_libs
3916         do
3917                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3918                 then
3919                         cf_add_1lib=
3920                         break
3921                 fi
3922         done
3923         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3924 done
3925 LIBS="$cf_add_libs"
3926
3927                 # even with config script, some packages use no-override for curses.h
3928
3929 echo "$as_me:3929: checking if we have identified curses headers" >&5
3930 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3931 if test "${cf_cv_ncurses_header+set}" = set; then
3932   echo $ECHO_N "(cached) $ECHO_C" >&6
3933 else
3934
3935 cf_cv_ncurses_header=none
3936 for cf_header in \
3937         ncurses.h ncurses/ncurses.h \
3938         curses.h ncurses/curses.h
3939 do
3940 cat >conftest.$ac_ext <<_ACEOF
3941 #line 3941 "configure"
3942 #include "confdefs.h"
3943 #include <${cf_header}>
3944 int
3945 main ()
3946 {
3947 initscr(); tgoto("?", 0,0)
3948   ;
3949   return 0;
3950 }
3951 _ACEOF
3952 rm -f conftest.$ac_objext
3953 if { (eval echo "$as_me:3953: \"$ac_compile\"") >&5
3954   (eval $ac_compile) 2>&5
3955   ac_status=$?
3956   echo "$as_me:3956: \$? = $ac_status" >&5
3957   (exit $ac_status); } &&
3958          { ac_try='test -s conftest.$ac_objext'
3959   { (eval echo "$as_me:3959: \"$ac_try\"") >&5
3960   (eval $ac_try) 2>&5
3961   ac_status=$?
3962   echo "$as_me:3962: \$? = $ac_status" >&5
3963   (exit $ac_status); }; }; then
3964   cf_cv_ncurses_header=$cf_header; break
3965 else
3966   echo "$as_me: failed program was:" >&5
3967 cat conftest.$ac_ext >&5
3968 fi
3969 rm -f conftest.$ac_objext conftest.$ac_ext
3970 done
3971
3972 fi
3973 echo "$as_me:3973: result: $cf_cv_ncurses_header" >&5
3974 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3975
3976 if test "$cf_cv_ncurses_header" = none ; then
3977         { { echo "$as_me:3977: error: No curses header-files found" >&5
3978 echo "$as_me: error: No curses header-files found" >&2;}
3979    { (exit 1); exit 1; }; }
3980 fi
3981
3982 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3983
3984 for ac_header in $cf_cv_ncurses_header
3985 do
3986 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3987 echo "$as_me:3987: checking for $ac_header" >&5
3988 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3989 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3990   echo $ECHO_N "(cached) $ECHO_C" >&6
3991 else
3992   cat >conftest.$ac_ext <<_ACEOF
3993 #line 3993 "configure"
3994 #include "confdefs.h"
3995 #include <$ac_header>
3996 _ACEOF
3997 if { (eval echo "$as_me:3997: \"$ac_cpp conftest.$ac_ext\"") >&5
3998   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3999   ac_status=$?
4000   egrep -v '^ *\+' conftest.er1 >conftest.err
4001   rm -f conftest.er1
4002   cat conftest.err >&5
4003   echo "$as_me:4003: \$? = $ac_status" >&5
4004   (exit $ac_status); } >/dev/null; then
4005   if test -s conftest.err; then
4006     ac_cpp_err=$ac_c_preproc_warn_flag
4007   else
4008     ac_cpp_err=
4009   fi
4010 else
4011   ac_cpp_err=yes
4012 fi
4013 if test -z "$ac_cpp_err"; then
4014   eval "$as_ac_Header=yes"
4015 else
4016   echo "$as_me: failed program was:" >&5
4017   cat conftest.$ac_ext >&5
4018   eval "$as_ac_Header=no"
4019 fi
4020 rm -f conftest.err conftest.$ac_ext
4021 fi
4022 echo "$as_me:4022: result: `eval echo '${'$as_ac_Header'}'`" >&5
4023 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4024 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4025   cat >>confdefs.h <<EOF
4026 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4027 EOF
4028
4029 fi
4030 done
4031
4032 cat >>confdefs.h <<\EOF
4033 #define NCURSES 1
4034 EOF
4035
4036 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4037
4038                 cat >>confdefs.h <<EOF
4039 #define $cf_nculib_ROOT 1
4040 EOF
4041
4042                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4043
4044         else
4045
4046 cf_ncuhdr_root=ncurses
4047
4048 test -n "$cf_cv_curses_dir" && \
4049 test "$cf_cv_curses_dir" != "no" && { \
4050
4051 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4052   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4053   do
4054         while test $cf_add_incdir != /usr/include
4055         do
4056           if test -d $cf_add_incdir
4057           then
4058                 cf_have_incdir=no
4059                 if test -n "$CFLAGS$CPPFLAGS" ; then
4060                   # a loop is needed to ensure we can add subdirs of existing dirs
4061                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4062                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4063                           cf_have_incdir=yes; break
4064                         fi
4065                   done
4066                 fi
4067
4068                 if test "$cf_have_incdir" = no ; then
4069                   if test "$cf_add_incdir" = /usr/local/include ; then
4070                         if test "$GCC" = yes
4071                         then
4072                           cf_save_CPPFLAGS=$CPPFLAGS
4073                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4074                           cat >conftest.$ac_ext <<_ACEOF
4075 #line 4075 "configure"
4076 #include "confdefs.h"
4077 #include <stdio.h>
4078 int
4079 main ()
4080 {
4081 printf("Hello")
4082   ;
4083   return 0;
4084 }
4085 _ACEOF
4086 rm -f conftest.$ac_objext
4087 if { (eval echo "$as_me:4087: \"$ac_compile\"") >&5
4088   (eval $ac_compile) 2>&5
4089   ac_status=$?
4090   echo "$as_me:4090: \$? = $ac_status" >&5
4091   (exit $ac_status); } &&
4092          { ac_try='test -s conftest.$ac_objext'
4093   { (eval echo "$as_me:4093: \"$ac_try\"") >&5
4094   (eval $ac_try) 2>&5
4095   ac_status=$?
4096   echo "$as_me:4096: \$? = $ac_status" >&5
4097   (exit $ac_status); }; }; then
4098   :
4099 else
4100   echo "$as_me: failed program was:" >&5
4101 cat conftest.$ac_ext >&5
4102 cf_have_incdir=yes
4103 fi
4104 rm -f conftest.$ac_objext conftest.$ac_ext
4105                           CPPFLAGS=$cf_save_CPPFLAGS
4106                         fi
4107                   fi
4108                 fi
4109
4110                 if test "$cf_have_incdir" = no ; then
4111                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4112
4113 echo "${as_me:-configure}:4113: testing adding $cf_add_incdir to include-path ..." 1>&5
4114
4115                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4116
4117                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4118                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4119                   cf_add_incdir="$cf_top_incdir"
4120                 else
4121                   break
4122                 fi
4123           else
4124                 break
4125           fi
4126         done
4127   done
4128 fi
4129
4130 }
4131
4132 echo "$as_me:4132: checking for $cf_ncuhdr_root header in include-path" >&5
4133 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4134 if test "${cf_cv_ncurses_h+set}" = set; then
4135   echo $ECHO_N "(cached) $ECHO_C" >&6
4136 else
4137
4138         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4139         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4140         for cf_header in $cf_header_list
4141         do
4142
4143         cat >conftest.$ac_ext <<_ACEOF
4144 #line 4144 "configure"
4145 #include "confdefs.h"
4146
4147 #include <$cf_header>
4148 int
4149 main ()
4150 {
4151
4152 #ifdef NCURSES_VERSION
4153
4154 printf("%s\n", NCURSES_VERSION);
4155 #else
4156 #ifdef __NCURSES_H
4157 printf("old\n");
4158 #else
4159         make an error
4160 #endif
4161 #endif
4162
4163   ;
4164   return 0;
4165 }
4166 _ACEOF
4167 rm -f conftest.$ac_objext
4168 if { (eval echo "$as_me:4168: \"$ac_compile\"") >&5
4169   (eval $ac_compile) 2>&5
4170   ac_status=$?
4171   echo "$as_me:4171: \$? = $ac_status" >&5
4172   (exit $ac_status); } &&
4173          { ac_try='test -s conftest.$ac_objext'
4174   { (eval echo "$as_me:4174: \"$ac_try\"") >&5
4175   (eval $ac_try) 2>&5
4176   ac_status=$?
4177   echo "$as_me:4177: \$? = $ac_status" >&5
4178   (exit $ac_status); }; }; then
4179   cf_cv_ncurses_h=$cf_header
4180
4181 else
4182   echo "$as_me: failed program was:" >&5
4183 cat conftest.$ac_ext >&5
4184 cf_cv_ncurses_h=no
4185 fi
4186 rm -f conftest.$ac_objext conftest.$ac_ext
4187
4188                 test "$cf_cv_ncurses_h" != no && break
4189         done
4190
4191 fi
4192 echo "$as_me:4192: result: $cf_cv_ncurses_h" >&5
4193 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4194
4195 if test "$cf_cv_ncurses_h" != no ; then
4196         cf_cv_ncurses_header=$cf_cv_ncurses_h
4197 else
4198
4199 echo "$as_me:4199: checking for $cf_ncuhdr_root include-path" >&5
4200 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4201 if test "${cf_cv_ncurses_h2+set}" = set; then
4202   echo $ECHO_N "(cached) $ECHO_C" >&6
4203 else
4204
4205         test -n "$verbose" && echo
4206
4207 cf_search=
4208
4209 # collect the current set of include-directories from compiler flags
4210 cf_header_path_list=""
4211 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4212         for cf_header_path in $CPPFLAGS $CFLAGS
4213         do
4214                 case $cf_header_path in
4215                 (-I*)
4216                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4217
4218 test "x$cf_header_path" != "xNONE" && \
4219 test -d "$cf_header_path" && \
4220  {
4221         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4222         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4223         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4224         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4225         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4226         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"
4227 }
4228
4229                         cf_header_path_list="$cf_header_path_list $cf_search"
4230                         ;;
4231                 esac
4232         done
4233 fi
4234
4235 # add the variations for the package we are looking for
4236
4237 cf_search=
4238
4239 test "x$prefix" != "xNONE" && \
4240 test -d "$prefix" && \
4241  {
4242         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4243         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4244         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4245         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4246         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4247         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4248 }
4249
4250 for cf_subdir_prefix in \
4251         /usr \
4252         /usr/local \
4253         /usr/pkg \
4254         /opt \
4255         /opt/local \
4256         $HOME
4257 do
4258
4259 test "x$cf_subdir_prefix" != "x$prefix" && \
4260 test -d "$cf_subdir_prefix" && \
4261 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4262         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4263         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4264         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4265         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4266         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4267         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"
4268 }
4269
4270 done
4271
4272 test "$includedir" != NONE && \
4273 test "$includedir" != "/usr/include" && \
4274 test -d "$includedir" && {
4275         test -d $includedir &&    cf_search="$cf_search $includedir"
4276         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4277 }
4278
4279 test "$oldincludedir" != NONE && \
4280 test "$oldincludedir" != "/usr/include" && \
4281 test -d "$oldincludedir" && {
4282         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4283         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4284 }
4285
4286 cf_search="$cf_search $cf_header_path_list"
4287
4288         test -n "$verbose" && echo search path $cf_search
4289         cf_save2_CPPFLAGS="$CPPFLAGS"
4290         for cf_incdir in $cf_search
4291         do
4292
4293 if test -n "$cf_incdir" ; then
4294   for cf_add_incdir in $cf_incdir
4295   do
4296         while test $cf_add_incdir != /usr/include
4297         do
4298           if test -d $cf_add_incdir
4299           then
4300                 cf_have_incdir=no
4301                 if test -n "$CFLAGS$CPPFLAGS" ; then
4302                   # a loop is needed to ensure we can add subdirs of existing dirs
4303                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4304                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4305                           cf_have_incdir=yes; break
4306                         fi
4307                   done
4308                 fi
4309
4310                 if test "$cf_have_incdir" = no ; then
4311                   if test "$cf_add_incdir" = /usr/local/include ; then
4312                         if test "$GCC" = yes
4313                         then
4314                           cf_save_CPPFLAGS=$CPPFLAGS
4315                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4316                           cat >conftest.$ac_ext <<_ACEOF
4317 #line 4317 "configure"
4318 #include "confdefs.h"
4319 #include <stdio.h>
4320 int
4321 main ()
4322 {
4323 printf("Hello")
4324   ;
4325   return 0;
4326 }
4327 _ACEOF
4328 rm -f conftest.$ac_objext
4329 if { (eval echo "$as_me:4329: \"$ac_compile\"") >&5
4330   (eval $ac_compile) 2>&5
4331   ac_status=$?
4332   echo "$as_me:4332: \$? = $ac_status" >&5
4333   (exit $ac_status); } &&
4334          { ac_try='test -s conftest.$ac_objext'
4335   { (eval echo "$as_me:4335: \"$ac_try\"") >&5
4336   (eval $ac_try) 2>&5
4337   ac_status=$?
4338   echo "$as_me:4338: \$? = $ac_status" >&5
4339   (exit $ac_status); }; }; then
4340   :
4341 else
4342   echo "$as_me: failed program was:" >&5
4343 cat conftest.$ac_ext >&5
4344 cf_have_incdir=yes
4345 fi
4346 rm -f conftest.$ac_objext conftest.$ac_ext
4347                           CPPFLAGS=$cf_save_CPPFLAGS
4348                         fi
4349                   fi
4350                 fi
4351
4352                 if test "$cf_have_incdir" = no ; then
4353                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4354
4355 echo "${as_me:-configure}:4355: testing adding $cf_add_incdir to include-path ..." 1>&5
4356
4357                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4358
4359                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4360                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4361                   cf_add_incdir="$cf_top_incdir"
4362                 else
4363                   break
4364                 fi
4365           else
4366                 break
4367           fi
4368         done
4369   done
4370 fi
4371
4372                 for cf_header in \
4373                         ncurses.h \
4374                         curses.h
4375                 do
4376
4377         cat >conftest.$ac_ext <<_ACEOF
4378 #line 4378 "configure"
4379 #include "confdefs.h"
4380
4381 #include <$cf_header>
4382 int
4383 main ()
4384 {
4385
4386 #ifdef NCURSES_VERSION
4387
4388 printf("%s\n", NCURSES_VERSION);
4389 #else
4390 #ifdef __NCURSES_H
4391 printf("old\n");
4392 #else
4393         make an error
4394 #endif
4395 #endif
4396
4397   ;
4398   return 0;
4399 }
4400 _ACEOF
4401 rm -f conftest.$ac_objext
4402 if { (eval echo "$as_me:4402: \"$ac_compile\"") >&5
4403   (eval $ac_compile) 2>&5
4404   ac_status=$?
4405   echo "$as_me:4405: \$? = $ac_status" >&5
4406   (exit $ac_status); } &&
4407          { ac_try='test -s conftest.$ac_objext'
4408   { (eval echo "$as_me:4408: \"$ac_try\"") >&5
4409   (eval $ac_try) 2>&5
4410   ac_status=$?
4411   echo "$as_me:4411: \$? = $ac_status" >&5
4412   (exit $ac_status); }; }; then
4413   cf_cv_ncurses_h2=$cf_header
4414
4415 else
4416   echo "$as_me: failed program was:" >&5
4417 cat conftest.$ac_ext >&5
4418 cf_cv_ncurses_h2=no
4419 fi
4420 rm -f conftest.$ac_objext conftest.$ac_ext
4421
4422                         if test "$cf_cv_ncurses_h2" != no ; then
4423                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4424                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4425                                 break
4426                         fi
4427                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4428                 done
4429                 CPPFLAGS="$cf_save2_CPPFLAGS"
4430                 test "$cf_cv_ncurses_h2" != no && break
4431         done
4432         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4432: error: not found" >&5
4433 echo "$as_me: error: not found" >&2;}
4434    { (exit 1); exit 1; }; }
4435
4436 fi
4437 echo "$as_me:4437: result: $cf_cv_ncurses_h2" >&5
4438 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4439
4440         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4441         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4442         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4443                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4444         fi
4445
4446 if test -n "$cf_1st_incdir" ; then
4447   for cf_add_incdir in $cf_1st_incdir
4448   do
4449         while test $cf_add_incdir != /usr/include
4450         do
4451           if test -d $cf_add_incdir
4452           then
4453                 cf_have_incdir=no
4454                 if test -n "$CFLAGS$CPPFLAGS" ; then
4455                   # a loop is needed to ensure we can add subdirs of existing dirs
4456                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4457                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4458                           cf_have_incdir=yes; break
4459                         fi
4460                   done
4461                 fi
4462
4463                 if test "$cf_have_incdir" = no ; then
4464                   if test "$cf_add_incdir" = /usr/local/include ; then
4465                         if test "$GCC" = yes
4466                         then
4467                           cf_save_CPPFLAGS=$CPPFLAGS
4468                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4469                           cat >conftest.$ac_ext <<_ACEOF
4470 #line 4470 "configure"
4471 #include "confdefs.h"
4472 #include <stdio.h>
4473 int
4474 main ()
4475 {
4476 printf("Hello")
4477   ;
4478   return 0;
4479 }
4480 _ACEOF
4481 rm -f conftest.$ac_objext
4482 if { (eval echo "$as_me:4482: \"$ac_compile\"") >&5
4483   (eval $ac_compile) 2>&5
4484   ac_status=$?
4485   echo "$as_me:4485: \$? = $ac_status" >&5
4486   (exit $ac_status); } &&
4487          { ac_try='test -s conftest.$ac_objext'
4488   { (eval echo "$as_me:4488: \"$ac_try\"") >&5
4489   (eval $ac_try) 2>&5
4490   ac_status=$?
4491   echo "$as_me:4491: \$? = $ac_status" >&5
4492   (exit $ac_status); }; }; then
4493   :
4494 else
4495   echo "$as_me: failed program was:" >&5
4496 cat conftest.$ac_ext >&5
4497 cf_have_incdir=yes
4498 fi
4499 rm -f conftest.$ac_objext conftest.$ac_ext
4500                           CPPFLAGS=$cf_save_CPPFLAGS
4501                         fi
4502                   fi
4503                 fi
4504
4505                 if test "$cf_have_incdir" = no ; then
4506                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4507
4508 echo "${as_me:-configure}:4508: testing adding $cf_add_incdir to include-path ..." 1>&5
4509
4510                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4511
4512                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4513                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4514                   cf_add_incdir="$cf_top_incdir"
4515                 else
4516                   break
4517                 fi
4518           else
4519                 break
4520           fi
4521         done
4522   done
4523 fi
4524
4525 fi
4526
4527 # Set definitions to allow ifdef'ing for ncurses.h
4528
4529 case $cf_cv_ncurses_header in
4530 (*ncurses.h)
4531
4532 cat >>confdefs.h <<\EOF
4533 #define HAVE_NCURSES_H 1
4534 EOF
4535
4536         ;;
4537 esac
4538
4539 case $cf_cv_ncurses_header in
4540 (ncurses/curses.h|ncurses/ncurses.h)
4541
4542 cat >>confdefs.h <<\EOF
4543 #define HAVE_NCURSES_NCURSES_H 1
4544 EOF
4545
4546         ;;
4547 (ncursesw/curses.h|ncursesw/ncurses.h)
4548
4549 cat >>confdefs.h <<\EOF
4550 #define HAVE_NCURSESW_NCURSES_H 1
4551 EOF
4552
4553         ;;
4554 esac
4555
4556 echo "$as_me:4556: checking for terminfo header" >&5
4557 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4558 if test "${cf_cv_term_header+set}" = set; then
4559   echo $ECHO_N "(cached) $ECHO_C" >&6
4560 else
4561
4562 case ${cf_cv_ncurses_header} in
4563 (*/ncurses.h|*/ncursesw.h)
4564         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4565         ;;
4566 (*)
4567         cf_term_header=term.h
4568         ;;
4569 esac
4570
4571 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4572 do
4573 cat >conftest.$ac_ext <<_ACEOF
4574 #line 4574 "configure"
4575 #include "confdefs.h"
4576 #include <stdio.h>
4577 #include <${cf_cv_ncurses_header:-curses.h}>
4578 #include <$cf_test>
4579
4580 int
4581 main ()
4582 {
4583 int x = auto_left_margin
4584   ;
4585   return 0;
4586 }
4587 _ACEOF
4588 rm -f conftest.$ac_objext
4589 if { (eval echo "$as_me:4589: \"$ac_compile\"") >&5
4590   (eval $ac_compile) 2>&5
4591   ac_status=$?
4592   echo "$as_me:4592: \$? = $ac_status" >&5
4593   (exit $ac_status); } &&
4594          { ac_try='test -s conftest.$ac_objext'
4595   { (eval echo "$as_me:4595: \"$ac_try\"") >&5
4596   (eval $ac_try) 2>&5
4597   ac_status=$?
4598   echo "$as_me:4598: \$? = $ac_status" >&5
4599   (exit $ac_status); }; }; then
4600
4601         cf_cv_term_header="$cf_test"
4602 else
4603   echo "$as_me: failed program was:" >&5
4604 cat conftest.$ac_ext >&5
4605
4606         cf_cv_term_header=unknown
4607
4608 fi
4609 rm -f conftest.$ac_objext conftest.$ac_ext
4610         test "$cf_cv_term_header" != unknown && break
4611 done
4612
4613 fi
4614 echo "$as_me:4614: result: $cf_cv_term_header" >&5
4615 echo "${ECHO_T}$cf_cv_term_header" >&6
4616
4617 # Set definitions to allow ifdef'ing to accommodate subdirectories
4618
4619 case $cf_cv_term_header in
4620 (*term.h)
4621
4622 cat >>confdefs.h <<\EOF
4623 #define HAVE_TERM_H 1
4624 EOF
4625
4626         ;;
4627 esac
4628
4629 case $cf_cv_term_header in
4630 (ncurses/term.h)
4631
4632 cat >>confdefs.h <<\EOF
4633 #define HAVE_NCURSES_TERM_H 1
4634 EOF
4635
4636         ;;
4637 (ncursesw/term.h)
4638
4639 cat >>confdefs.h <<\EOF
4640 #define HAVE_NCURSESW_TERM_H 1
4641 EOF
4642
4643         ;;
4644 esac
4645
4646 # some applications need this, but should check for NCURSES_VERSION
4647
4648 cat >>confdefs.h <<\EOF
4649 #define NCURSES 1
4650 EOF
4651
4652 echo "$as_me:4652: checking for ncurses version" >&5
4653 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4654 if test "${cf_cv_ncurses_version+set}" = set; then
4655   echo $ECHO_N "(cached) $ECHO_C" >&6
4656 else
4657
4658         cf_cv_ncurses_version=no
4659         cf_tempfile=out$$
4660         rm -f $cf_tempfile
4661         if test "$cross_compiling" = yes; then
4662
4663         # This will not work if the preprocessor splits the line after the
4664         # Autoconf token.  The 'unproto' program does that.
4665         cat > conftest.$ac_ext <<EOF
4666 #include <${cf_cv_ncurses_header:-curses.h}>
4667 #undef Autoconf
4668 #ifdef NCURSES_VERSION
4669 Autoconf NCURSES_VERSION
4670 #else
4671 #ifdef __NCURSES_H
4672 Autoconf "old"
4673 #endif
4674 ;
4675 #endif
4676 EOF
4677         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4678         { (eval echo "$as_me:4678: \"$cf_try\"") >&5
4679   (eval $cf_try) 2>&5
4680   ac_status=$?
4681   echo "$as_me:4681: \$? = $ac_status" >&5
4682   (exit $ac_status); }
4683         if test -f conftest.out ; then
4684                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4685                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4686                 rm -f conftest.out
4687         fi
4688
4689 else
4690   cat >conftest.$ac_ext <<_ACEOF
4691 #line 4691 "configure"
4692 #include "confdefs.h"
4693
4694 #include <${cf_cv_ncurses_header:-curses.h}>
4695 #include <stdio.h>
4696 int main()
4697 {
4698         FILE *fp = fopen("$cf_tempfile", "w");
4699 #ifdef NCURSES_VERSION
4700 # ifdef NCURSES_VERSION_PATCH
4701         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4702 # else
4703         fprintf(fp, "%s\n", NCURSES_VERSION);
4704 # endif
4705 #else
4706 # ifdef __NCURSES_H
4707         fprintf(fp, "old\n");
4708 # else
4709         make an error
4710 # endif
4711 #endif
4712         ${cf_cv_main_return:-return}(0);
4713 }
4714 _ACEOF
4715 rm -f conftest$ac_exeext
4716 if { (eval echo "$as_me:4716: \"$ac_link\"") >&5
4717   (eval $ac_link) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4721   { (eval echo "$as_me:4721: \"$ac_try\"") >&5
4722   (eval $ac_try) 2>&5
4723   ac_status=$?
4724   echo "$as_me:4724: \$? = $ac_status" >&5
4725   (exit $ac_status); }; }; then
4726
4727         cf_cv_ncurses_version=`cat $cf_tempfile`
4728 else
4729   echo "$as_me: program exited with status $ac_status" >&5
4730 echo "$as_me: failed program was:" >&5
4731 cat conftest.$ac_ext >&5
4732 fi
4733 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4734 fi
4735         rm -f $cf_tempfile
4736
4737 fi
4738 echo "$as_me:4738: result: $cf_cv_ncurses_version" >&5
4739 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4740 test "$cf_cv_ncurses_version" = no ||
4741 cat >>confdefs.h <<\EOF
4742 #define NCURSES 1
4743 EOF
4744
4745 cf_nculib_root=ncurses
4746         # This works, except for the special case where we find gpm, but
4747         # ncurses is in a nonstandard location via $LIBS, and we really want
4748         # to link gpm.
4749 cf_ncurses_LIBS=""
4750 cf_ncurses_SAVE="$LIBS"
4751 echo "$as_me:4751: checking for Gpm_Open in -lgpm" >&5
4752 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4753 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4754   echo $ECHO_N "(cached) $ECHO_C" >&6
4755 else
4756   ac_check_lib_save_LIBS=$LIBS
4757 LIBS="-lgpm  $LIBS"
4758 cat >conftest.$ac_ext <<_ACEOF
4759 #line 4759 "configure"
4760 #include "confdefs.h"
4761
4762 /* Override any gcc2 internal prototype to avoid an error.  */
4763 #ifdef __cplusplus
4764 extern "C"
4765 #endif
4766 /* We use char because int might match the return type of a gcc2
4767    builtin and then its argument prototype would still apply.  */
4768 char Gpm_Open ();
4769 int
4770 main ()
4771 {
4772 Gpm_Open ();
4773   ;
4774   return 0;
4775 }
4776 _ACEOF
4777 rm -f conftest.$ac_objext conftest$ac_exeext
4778 if { (eval echo "$as_me:4778: \"$ac_link\"") >&5
4779   (eval $ac_link) 2>&5
4780   ac_status=$?
4781   echo "$as_me:4781: \$? = $ac_status" >&5
4782   (exit $ac_status); } &&
4783          { ac_try='test -s conftest$ac_exeext'
4784   { (eval echo "$as_me:4784: \"$ac_try\"") >&5
4785   (eval $ac_try) 2>&5
4786   ac_status=$?
4787   echo "$as_me:4787: \$? = $ac_status" >&5
4788   (exit $ac_status); }; }; then
4789   ac_cv_lib_gpm_Gpm_Open=yes
4790 else
4791   echo "$as_me: failed program was:" >&5
4792 cat conftest.$ac_ext >&5
4793 ac_cv_lib_gpm_Gpm_Open=no
4794 fi
4795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4796 LIBS=$ac_check_lib_save_LIBS
4797 fi
4798 echo "$as_me:4798: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4799 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4800 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4801   echo "$as_me:4801: checking for initscr in -lgpm" >&5
4802 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4803 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4804   echo $ECHO_N "(cached) $ECHO_C" >&6
4805 else
4806   ac_check_lib_save_LIBS=$LIBS
4807 LIBS="-lgpm  $LIBS"
4808 cat >conftest.$ac_ext <<_ACEOF
4809 #line 4809 "configure"
4810 #include "confdefs.h"
4811
4812 /* Override any gcc2 internal prototype to avoid an error.  */
4813 #ifdef __cplusplus
4814 extern "C"
4815 #endif
4816 /* We use char because int might match the return type of a gcc2
4817    builtin and then its argument prototype would still apply.  */
4818 char initscr ();
4819 int
4820 main ()
4821 {
4822 initscr ();
4823   ;
4824   return 0;
4825 }
4826 _ACEOF
4827 rm -f conftest.$ac_objext conftest$ac_exeext
4828 if { (eval echo "$as_me:4828: \"$ac_link\"") >&5
4829   (eval $ac_link) 2>&5
4830   ac_status=$?
4831   echo "$as_me:4831: \$? = $ac_status" >&5
4832   (exit $ac_status); } &&
4833          { ac_try='test -s conftest$ac_exeext'
4834   { (eval echo "$as_me:4834: \"$ac_try\"") >&5
4835   (eval $ac_try) 2>&5
4836   ac_status=$?
4837   echo "$as_me:4837: \$? = $ac_status" >&5
4838   (exit $ac_status); }; }; then
4839   ac_cv_lib_gpm_initscr=yes
4840 else
4841   echo "$as_me: failed program was:" >&5
4842 cat conftest.$ac_ext >&5
4843 ac_cv_lib_gpm_initscr=no
4844 fi
4845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4846 LIBS=$ac_check_lib_save_LIBS
4847 fi
4848 echo "$as_me:4848: result: $ac_cv_lib_gpm_initscr" >&5
4849 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4850 if test $ac_cv_lib_gpm_initscr = yes; then
4851   LIBS="$cf_ncurses_SAVE"
4852 else
4853   cf_ncurses_LIBS="-lgpm"
4854 fi
4855
4856 fi
4857
4858 case $host_os in
4859 (freebsd*)
4860         # This is only necessary if you are linking against an obsolete
4861         # version of ncurses (but it should do no harm, since it's static).
4862         if test "$cf_nculib_root" = ncurses ; then
4863                 echo "$as_me:4863: checking for tgoto in -lmytinfo" >&5
4864 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4865 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4866   echo $ECHO_N "(cached) $ECHO_C" >&6
4867 else
4868   ac_check_lib_save_LIBS=$LIBS
4869 LIBS="-lmytinfo  $LIBS"
4870 cat >conftest.$ac_ext <<_ACEOF
4871 #line 4871 "configure"
4872 #include "confdefs.h"
4873
4874 /* Override any gcc2 internal prototype to avoid an error.  */
4875 #ifdef __cplusplus
4876 extern "C"
4877 #endif
4878 /* We use char because int might match the return type of a gcc2
4879    builtin and then its argument prototype would still apply.  */
4880 char tgoto ();
4881 int
4882 main ()
4883 {
4884 tgoto ();
4885   ;
4886   return 0;
4887 }
4888 _ACEOF
4889 rm -f conftest.$ac_objext conftest$ac_exeext
4890 if { (eval echo "$as_me:4890: \"$ac_link\"") >&5
4891   (eval $ac_link) 2>&5
4892   ac_status=$?
4893   echo "$as_me:4893: \$? = $ac_status" >&5
4894   (exit $ac_status); } &&
4895          { ac_try='test -s conftest$ac_exeext'
4896   { (eval echo "$as_me:4896: \"$ac_try\"") >&5
4897   (eval $ac_try) 2>&5
4898   ac_status=$?
4899   echo "$as_me:4899: \$? = $ac_status" >&5
4900   (exit $ac_status); }; }; then
4901   ac_cv_lib_mytinfo_tgoto=yes
4902 else
4903   echo "$as_me: failed program was:" >&5
4904 cat conftest.$ac_ext >&5
4905 ac_cv_lib_mytinfo_tgoto=no
4906 fi
4907 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4908 LIBS=$ac_check_lib_save_LIBS
4909 fi
4910 echo "$as_me:4910: result: $ac_cv_lib_mytinfo_tgoto" >&5
4911 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4912 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4913   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4914 fi
4915
4916         fi
4917         ;;
4918 esac
4919
4920 cf_add_libs="$cf_ncurses_LIBS"
4921 # Filter out duplicates - this happens with badly-designed ".pc" files...
4922 for cf_add_1lib in $LIBS
4923 do
4924         for cf_add_2lib in $cf_add_libs
4925         do
4926                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4927                 then
4928                         cf_add_1lib=
4929                         break
4930                 fi
4931         done
4932         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4933 done
4934 LIBS="$cf_add_libs"
4935
4936 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4937 then
4938
4939 cf_add_libs="-l$cf_nculib_root"
4940 # Filter out duplicates - this happens with badly-designed ".pc" files...
4941 for cf_add_1lib in $LIBS
4942 do
4943         for cf_add_2lib in $cf_add_libs
4944         do
4945                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4946                 then
4947                         cf_add_1lib=
4948                         break
4949                 fi
4950         done
4951         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4952 done
4953 LIBS="$cf_add_libs"
4954
4955 else
4956
4957         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4958         cf_libdir=""
4959         echo "$as_me:4959: checking for initscr" >&5
4960 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4961 if test "${ac_cv_func_initscr+set}" = set; then
4962   echo $ECHO_N "(cached) $ECHO_C" >&6
4963 else
4964   cat >conftest.$ac_ext <<_ACEOF
4965 #line 4965 "configure"
4966 #include "confdefs.h"
4967 /* System header to define __stub macros and hopefully few prototypes,
4968     which can conflict with char initscr (); below.  */
4969 #include <assert.h>
4970 /* Override any gcc2 internal prototype to avoid an error.  */
4971 #ifdef __cplusplus
4972 extern "C"
4973 #endif
4974 /* We use char because int might match the return type of a gcc2
4975    builtin and then its argument prototype would still apply.  */
4976 char initscr ();
4977 char (*f) ();
4978
4979 int
4980 main ()
4981 {
4982 /* The GNU C library defines this for functions which it implements
4983     to always fail with ENOSYS.  Some functions are actually named
4984     something starting with __ and the normal name is an alias.  */
4985 #if defined (__stub_initscr) || defined (__stub___initscr)
4986 choke me
4987 #else
4988 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4989 #endif
4990
4991   ;
4992   return 0;
4993 }
4994 _ACEOF
4995 rm -f conftest.$ac_objext conftest$ac_exeext
4996 if { (eval echo "$as_me:4996: \"$ac_link\"") >&5
4997   (eval $ac_link) 2>&5
4998   ac_status=$?
4999   echo "$as_me:4999: \$? = $ac_status" >&5
5000   (exit $ac_status); } &&
5001          { ac_try='test -s conftest$ac_exeext'
5002   { (eval echo "$as_me:5002: \"$ac_try\"") >&5
5003   (eval $ac_try) 2>&5
5004   ac_status=$?
5005   echo "$as_me:5005: \$? = $ac_status" >&5
5006   (exit $ac_status); }; }; then
5007   ac_cv_func_initscr=yes
5008 else
5009   echo "$as_me: failed program was:" >&5
5010 cat conftest.$ac_ext >&5
5011 ac_cv_func_initscr=no
5012 fi
5013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5014 fi
5015 echo "$as_me:5015: result: $ac_cv_func_initscr" >&5
5016 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5017 if test $ac_cv_func_initscr = yes; then
5018   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5019 else
5020
5021                 cf_save_LIBS="$LIBS"
5022                 echo "$as_me:5022: checking for initscr in -l$cf_nculib_root" >&5
5023 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5024                 LIBS="-l$cf_nculib_root $LIBS"
5025                 cat >conftest.$ac_ext <<_ACEOF
5026 #line 5026 "configure"
5027 #include "confdefs.h"
5028 #include <${cf_cv_ncurses_header:-curses.h}>
5029 int
5030 main ()
5031 {
5032 initscr()
5033   ;
5034   return 0;
5035 }
5036 _ACEOF
5037 rm -f conftest.$ac_objext conftest$ac_exeext
5038 if { (eval echo "$as_me:5038: \"$ac_link\"") >&5
5039   (eval $ac_link) 2>&5
5040   ac_status=$?
5041   echo "$as_me:5041: \$? = $ac_status" >&5
5042   (exit $ac_status); } &&
5043          { ac_try='test -s conftest$ac_exeext'
5044   { (eval echo "$as_me:5044: \"$ac_try\"") >&5
5045   (eval $ac_try) 2>&5
5046   ac_status=$?
5047   echo "$as_me:5047: \$? = $ac_status" >&5
5048   (exit $ac_status); }; }; then
5049   echo "$as_me:5049: result: yes" >&5
5050 echo "${ECHO_T}yes" >&6
5051                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5052
5053 else
5054   echo "$as_me: failed program was:" >&5
5055 cat conftest.$ac_ext >&5
5056 echo "$as_me:5056: result: no" >&5
5057 echo "${ECHO_T}no" >&6
5058
5059 cf_search=
5060 cf_library_path_list=""
5061 if test -n "${LDFLAGS}${LIBS}" ; then
5062         for cf_library_path in $LDFLAGS $LIBS
5063         do
5064                 case $cf_library_path in
5065                 (-L*)
5066                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5067
5068 test "x$cf_library_path" != "xNONE" && \
5069 test -d "$cf_library_path" && \
5070  {
5071         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5072         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5073         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5074         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5075         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5076         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"
5077 }
5078
5079                         cf_library_path_list="$cf_library_path_list $cf_search"
5080                         ;;
5081                 esac
5082         done
5083 fi
5084
5085 cf_search=
5086
5087 test "x$prefix" != "xNONE" && \
5088 test -d "$prefix" && \
5089  {
5090         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5091         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5092         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5093         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5094         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5095         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5096 }
5097
5098 for cf_subdir_prefix in \
5099         /usr \
5100         /usr/local \
5101         /usr/pkg \
5102         /opt \
5103         /opt/local \
5104         $HOME
5105 do
5106
5107 test "x$cf_subdir_prefix" != "x$prefix" && \
5108 test -d "$cf_subdir_prefix" && \
5109 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5110         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5111         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5112         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5113         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5114         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5115         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"
5116 }
5117
5118 done
5119
5120 cf_search="$cf_library_path_list $cf_search"
5121
5122                         for cf_libdir in $cf_search
5123                         do
5124                                 echo "$as_me:5124: checking for -l$cf_nculib_root in $cf_libdir" >&5
5125 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5126                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5127                                 cat >conftest.$ac_ext <<_ACEOF
5128 #line 5128 "configure"
5129 #include "confdefs.h"
5130 #include <${cf_cv_ncurses_header:-curses.h}>
5131 int
5132 main ()
5133 {
5134 initscr()
5135   ;
5136   return 0;
5137 }
5138 _ACEOF
5139 rm -f conftest.$ac_objext conftest$ac_exeext
5140 if { (eval echo "$as_me:5140: \"$ac_link\"") >&5
5141   (eval $ac_link) 2>&5
5142   ac_status=$?
5143   echo "$as_me:5143: \$? = $ac_status" >&5
5144   (exit $ac_status); } &&
5145          { ac_try='test -s conftest$ac_exeext'
5146   { (eval echo "$as_me:5146: \"$ac_try\"") >&5
5147   (eval $ac_try) 2>&5
5148   ac_status=$?
5149   echo "$as_me:5149: \$? = $ac_status" >&5
5150   (exit $ac_status); }; }; then
5151   echo "$as_me:5151: result: yes" >&5
5152 echo "${ECHO_T}yes" >&6
5153                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5154                                          break
5155 else
5156   echo "$as_me: failed program was:" >&5
5157 cat conftest.$ac_ext >&5
5158 echo "$as_me:5158: result: no" >&5
5159 echo "${ECHO_T}no" >&6
5160                                          LIBS="$cf_save_LIBS"
5161 fi
5162 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5163                         done
5164
5165 fi
5166 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5167
5168 fi
5169
5170 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5171
5172 if test $cf_found_library = no ; then
5173         { { echo "$as_me:5173: error: Cannot link $cf_nculib_root library" >&5
5174 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5175    { (exit 1); exit 1; }; }
5176 fi
5177
5178 fi
5179
5180 if test -n "$cf_ncurses_LIBS" ; then
5181         echo "$as_me:5181: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5182 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5183         cf_ncurses_SAVE="$LIBS"
5184         for p in $cf_ncurses_LIBS ; do
5185                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5186                 if test "$q" != "$LIBS" ; then
5187                         LIBS="$q"
5188                 fi
5189         done
5190         cat >conftest.$ac_ext <<_ACEOF
5191 #line 5191 "configure"
5192 #include "confdefs.h"
5193 #include <${cf_cv_ncurses_header:-curses.h}>
5194 int
5195 main ()
5196 {
5197 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5198   ;
5199   return 0;
5200 }
5201 _ACEOF
5202 rm -f conftest.$ac_objext conftest$ac_exeext
5203 if { (eval echo "$as_me:5203: \"$ac_link\"") >&5
5204   (eval $ac_link) 2>&5
5205   ac_status=$?
5206   echo "$as_me:5206: \$? = $ac_status" >&5
5207   (exit $ac_status); } &&
5208          { ac_try='test -s conftest$ac_exeext'
5209   { (eval echo "$as_me:5209: \"$ac_try\"") >&5
5210   (eval $ac_try) 2>&5
5211   ac_status=$?
5212   echo "$as_me:5212: \$? = $ac_status" >&5
5213   (exit $ac_status); }; }; then
5214   echo "$as_me:5214: result: yes" >&5
5215 echo "${ECHO_T}yes" >&6
5216 else
5217   echo "$as_me: failed program was:" >&5
5218 cat conftest.$ac_ext >&5
5219 echo "$as_me:5219: result: no" >&5
5220 echo "${ECHO_T}no" >&6
5221                  LIBS="$cf_ncurses_SAVE"
5222 fi
5223 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5224 fi
5225
5226 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5227
5228 cat >>confdefs.h <<EOF
5229 #define $cf_nculib_ROOT 1
5230 EOF
5231
5232         fi
5233 else
5234         NCURSES_CONFIG=none
5235 fi
5236
5237 echo "$as_me:5237: checking if you want wide-character code" >&5
5238 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5239
5240 # Check whether --enable-widec or --disable-widec was given.
5241 if test "${enable_widec+set}" = set; then
5242   enableval="$enable_widec"
5243   with_widec=$enableval
5244 else
5245   with_widec=no
5246 fi;
5247 echo "$as_me:5247: result: $with_widec" >&5
5248 echo "${ECHO_T}$with_widec" >&6
5249 if test "$with_widec" = yes ; then
5250
5251 echo "$as_me:5251: checking for multibyte character support" >&5
5252 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5253 if test "${cf_cv_utf8_lib+set}" = set; then
5254   echo $ECHO_N "(cached) $ECHO_C" >&6
5255 else
5256
5257         cf_save_LIBS="$LIBS"
5258         cat >conftest.$ac_ext <<_ACEOF
5259 #line 5259 "configure"
5260 #include "confdefs.h"
5261
5262 #include <stdlib.h>
5263 int
5264 main ()
5265 {
5266 putwc(0,0);
5267   ;
5268   return 0;
5269 }
5270 _ACEOF
5271 rm -f conftest.$ac_objext conftest$ac_exeext
5272 if { (eval echo "$as_me:5272: \"$ac_link\"") >&5
5273   (eval $ac_link) 2>&5
5274   ac_status=$?
5275   echo "$as_me:5275: \$? = $ac_status" >&5
5276   (exit $ac_status); } &&
5277          { ac_try='test -s conftest$ac_exeext'
5278   { (eval echo "$as_me:5278: \"$ac_try\"") >&5
5279   (eval $ac_try) 2>&5
5280   ac_status=$?
5281   echo "$as_me:5281: \$? = $ac_status" >&5
5282   (exit $ac_status); }; }; then
5283   cf_cv_utf8_lib=yes
5284 else
5285   echo "$as_me: failed program was:" >&5
5286 cat conftest.$ac_ext >&5
5287
5288 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5289 # will be set on completion of the AC_TRY_LINK below.
5290 cf_cv_header_path_utf8=
5291 cf_cv_library_path_utf8=
5292
5293 echo "${as_me:-configure}:5293: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5294
5295 cf_save_LIBS="$LIBS"
5296
5297 cat >conftest.$ac_ext <<_ACEOF
5298 #line 5298 "configure"
5299 #include "confdefs.h"
5300
5301 #include <libutf8.h>
5302 int
5303 main ()
5304 {
5305 putwc(0,0);
5306   ;
5307   return 0;
5308 }
5309 _ACEOF
5310 rm -f conftest.$ac_objext conftest$ac_exeext
5311 if { (eval echo "$as_me:5311: \"$ac_link\"") >&5
5312   (eval $ac_link) 2>&5
5313   ac_status=$?
5314   echo "$as_me:5314: \$? = $ac_status" >&5
5315   (exit $ac_status); } &&
5316          { ac_try='test -s conftest$ac_exeext'
5317   { (eval echo "$as_me:5317: \"$ac_try\"") >&5
5318   (eval $ac_try) 2>&5
5319   ac_status=$?
5320   echo "$as_me:5320: \$? = $ac_status" >&5
5321   (exit $ac_status); }; }; then
5322
5323         cf_cv_find_linkage_utf8=yes
5324         cf_cv_header_path_utf8=/usr/include
5325         cf_cv_library_path_utf8=/usr/lib
5326
5327 else
5328   echo "$as_me: failed program was:" >&5
5329 cat conftest.$ac_ext >&5
5330
5331 LIBS="-lutf8  $cf_save_LIBS"
5332
5333 cat >conftest.$ac_ext <<_ACEOF
5334 #line 5334 "configure"
5335 #include "confdefs.h"
5336
5337 #include <libutf8.h>
5338 int
5339 main ()
5340 {
5341 putwc(0,0);
5342   ;
5343   return 0;
5344 }
5345 _ACEOF
5346 rm -f conftest.$ac_objext conftest$ac_exeext
5347 if { (eval echo "$as_me:5347: \"$ac_link\"") >&5
5348   (eval $ac_link) 2>&5
5349   ac_status=$?
5350   echo "$as_me:5350: \$? = $ac_status" >&5
5351   (exit $ac_status); } &&
5352          { ac_try='test -s conftest$ac_exeext'
5353   { (eval echo "$as_me:5353: \"$ac_try\"") >&5
5354   (eval $ac_try) 2>&5
5355   ac_status=$?
5356   echo "$as_me:5356: \$? = $ac_status" >&5
5357   (exit $ac_status); }; }; then
5358
5359         cf_cv_find_linkage_utf8=yes
5360         cf_cv_header_path_utf8=/usr/include
5361         cf_cv_library_path_utf8=/usr/lib
5362         cf_cv_library_file_utf8="-lutf8"
5363
5364 else
5365   echo "$as_me: failed program was:" >&5
5366 cat conftest.$ac_ext >&5
5367
5368         cf_cv_find_linkage_utf8=no
5369         LIBS="$cf_save_LIBS"
5370
5371         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5372
5373 echo "${as_me:-configure}:5373: testing find linkage for utf8 library ..." 1>&5
5374
5375 echo "${as_me:-configure}:5375: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5376
5377         cf_save_CPPFLAGS="$CPPFLAGS"
5378         cf_test_CPPFLAGS="$CPPFLAGS"
5379
5380 cf_search=
5381
5382 # collect the current set of include-directories from compiler flags
5383 cf_header_path_list=""
5384 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5385         for cf_header_path in $CPPFLAGS $CFLAGS
5386         do
5387                 case $cf_header_path in
5388                 (-I*)
5389                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5390
5391 test "x$cf_header_path" != "xNONE" && \
5392 test -d "$cf_header_path" && \
5393  {
5394         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5395         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5396         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5397         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5398         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5399         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5400 }
5401
5402                         cf_header_path_list="$cf_header_path_list $cf_search"
5403                         ;;
5404                 esac
5405         done
5406 fi
5407
5408 # add the variations for the package we are looking for
5409
5410 cf_search=
5411
5412 test "x$prefix" != "xNONE" && \
5413 test -d "$prefix" && \
5414  {
5415         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5416         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5417         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5418         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5419         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5420         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5421 }
5422
5423 for cf_subdir_prefix in \
5424         /usr \
5425         /usr/local \
5426         /usr/pkg \
5427         /opt \
5428         /opt/local \
5429         $HOME
5430 do
5431
5432 test "x$cf_subdir_prefix" != "x$prefix" && \
5433 test -d "$cf_subdir_prefix" && \
5434 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5435         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5436         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5437         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5438         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5439         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5440         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5441 }
5442
5443 done
5444
5445 test "$includedir" != NONE && \
5446 test "$includedir" != "/usr/include" && \
5447 test -d "$includedir" && {
5448         test -d $includedir &&    cf_search="$cf_search $includedir"
5449         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5450 }
5451
5452 test "$oldincludedir" != NONE && \
5453 test "$oldincludedir" != "/usr/include" && \
5454 test -d "$oldincludedir" && {
5455         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5456         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5457 }
5458
5459 cf_search="$cf_search $cf_header_path_list"
5460
5461         for cf_cv_header_path_utf8 in $cf_search
5462         do
5463                 if test -d $cf_cv_header_path_utf8 ; then
5464                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5465
5466 echo "${as_me:-configure}:5466: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5467
5468                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5469                         cat >conftest.$ac_ext <<_ACEOF
5470 #line 5470 "configure"
5471 #include "confdefs.h"
5472
5473 #include <libutf8.h>
5474 int
5475 main ()
5476 {
5477 putwc(0,0);
5478   ;
5479   return 0;
5480 }
5481 _ACEOF
5482 rm -f conftest.$ac_objext
5483 if { (eval echo "$as_me:5483: \"$ac_compile\"") >&5
5484   (eval $ac_compile) 2>&5
5485   ac_status=$?
5486   echo "$as_me:5486: \$? = $ac_status" >&5
5487   (exit $ac_status); } &&
5488          { ac_try='test -s conftest.$ac_objext'
5489   { (eval echo "$as_me:5489: \"$ac_try\"") >&5
5490   (eval $ac_try) 2>&5
5491   ac_status=$?
5492   echo "$as_me:5492: \$? = $ac_status" >&5
5493   (exit $ac_status); }; }; then
5494
5495                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5496
5497 echo "${as_me:-configure}:5497: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5498
5499                                 cf_cv_find_linkage_utf8=maybe
5500                                 cf_test_CPPFLAGS="$CPPFLAGS"
5501                                 break
5502 else
5503   echo "$as_me: failed program was:" >&5
5504 cat conftest.$ac_ext >&5
5505
5506                                 CPPFLAGS="$cf_save_CPPFLAGS"
5507
5508 fi
5509 rm -f conftest.$ac_objext conftest.$ac_ext
5510                 fi
5511         done
5512
5513         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5514
5515 echo "${as_me:-configure}:5515: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5516
5517                 cf_save_LIBS="$LIBS"
5518                 cf_save_LDFLAGS="$LDFLAGS"
5519
5520                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5521
5522 cf_search=
5523 cf_library_path_list=""
5524 if test -n "${LDFLAGS}${LIBS}" ; then
5525         for cf_library_path in $LDFLAGS $LIBS
5526         do
5527                 case $cf_library_path in
5528                 (-L*)
5529                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5530
5531 test "x$cf_library_path" != "xNONE" && \
5532 test -d "$cf_library_path" && \
5533  {
5534         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5535         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5536         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5537         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5538         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5539         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5540 }
5541
5542                         cf_library_path_list="$cf_library_path_list $cf_search"
5543                         ;;
5544                 esac
5545         done
5546 fi
5547
5548 cf_search=
5549
5550 test "x$prefix" != "xNONE" && \
5551 test -d "$prefix" && \
5552  {
5553         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5554         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5555         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5556         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5557         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5558         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5559 }
5560
5561 for cf_subdir_prefix in \
5562         /usr \
5563         /usr/local \
5564         /usr/pkg \
5565         /opt \
5566         /opt/local \
5567         $HOME
5568 do
5569
5570 test "x$cf_subdir_prefix" != "x$prefix" && \
5571 test -d "$cf_subdir_prefix" && \
5572 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5573         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5574         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5575         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5576         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5577         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5578         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5579 }
5580
5581 done
5582
5583 cf_search="$cf_library_path_list $cf_search"
5584
5585                         for cf_cv_library_path_utf8 in $cf_search
5586                         do
5587                                 if test -d $cf_cv_library_path_utf8 ; then
5588                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5589
5590 echo "${as_me:-configure}:5590: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5591
5592                                         CPPFLAGS="$cf_test_CPPFLAGS"
5593                                         LIBS="-lutf8  $cf_save_LIBS"
5594                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5595                                         cat >conftest.$ac_ext <<_ACEOF
5596 #line 5596 "configure"
5597 #include "confdefs.h"
5598
5599 #include <libutf8.h>
5600 int
5601 main ()
5602 {
5603 putwc(0,0);
5604   ;
5605   return 0;
5606 }
5607 _ACEOF
5608 rm -f conftest.$ac_objext conftest$ac_exeext
5609 if { (eval echo "$as_me:5609: \"$ac_link\"") >&5
5610   (eval $ac_link) 2>&5
5611   ac_status=$?
5612   echo "$as_me:5612: \$? = $ac_status" >&5
5613   (exit $ac_status); } &&
5614          { ac_try='test -s conftest$ac_exeext'
5615   { (eval echo "$as_me:5615: \"$ac_try\"") >&5
5616   (eval $ac_try) 2>&5
5617   ac_status=$?
5618   echo "$as_me:5618: \$? = $ac_status" >&5
5619   (exit $ac_status); }; }; then
5620
5621                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5622
5623 echo "${as_me:-configure}:5623: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5624
5625                                         cf_cv_find_linkage_utf8=yes
5626                                         cf_cv_library_file_utf8="-lutf8"
5627                                         break
5628 else
5629   echo "$as_me: failed program was:" >&5
5630 cat conftest.$ac_ext >&5
5631
5632                                         CPPFLAGS="$cf_save_CPPFLAGS"
5633                                         LIBS="$cf_save_LIBS"
5634                                         LDFLAGS="$cf_save_LDFLAGS"
5635
5636 fi
5637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5638                                 fi
5639                         done
5640                         CPPFLAGS="$cf_save_CPPFLAGS"
5641                         LDFLAGS="$cf_save_LDFLAGS"
5642                 fi
5643
5644         else
5645                 cf_cv_find_linkage_utf8=no
5646         fi
5647
5648 fi
5649 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5650
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653
5654 LIBS="$cf_save_LIBS"
5655
5656 if test "$cf_cv_find_linkage_utf8" = yes ; then
5657 cf_cv_utf8_lib=add-on
5658 else
5659 cf_cv_utf8_lib=no
5660 fi
5661
5662 fi
5663 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5664 fi
5665 echo "$as_me:5665: result: $cf_cv_utf8_lib" >&5
5666 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5667
5668 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5669 # ncurses/ncursesw:
5670 if test "$cf_cv_utf8_lib" = "add-on" ; then
5671
5672 cat >>confdefs.h <<\EOF
5673 #define HAVE_LIBUTF8_H 1
5674 EOF
5675
5676 if test -n "$cf_cv_header_path_utf8" ; then
5677   for cf_add_incdir in $cf_cv_header_path_utf8
5678   do
5679         while test $cf_add_incdir != /usr/include
5680         do
5681           if test -d $cf_add_incdir
5682           then
5683                 cf_have_incdir=no
5684                 if test -n "$CFLAGS$CPPFLAGS" ; then
5685                   # a loop is needed to ensure we can add subdirs of existing dirs
5686                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5687                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5688                           cf_have_incdir=yes; break
5689                         fi
5690                   done
5691                 fi
5692
5693                 if test "$cf_have_incdir" = no ; then
5694                   if test "$cf_add_incdir" = /usr/local/include ; then
5695                         if test "$GCC" = yes
5696                         then
5697                           cf_save_CPPFLAGS=$CPPFLAGS
5698                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5699                           cat >conftest.$ac_ext <<_ACEOF
5700 #line 5700 "configure"
5701 #include "confdefs.h"
5702 #include <stdio.h>
5703 int
5704 main ()
5705 {
5706 printf("Hello")
5707   ;
5708   return 0;
5709 }
5710 _ACEOF
5711 rm -f conftest.$ac_objext
5712 if { (eval echo "$as_me:5712: \"$ac_compile\"") >&5
5713   (eval $ac_compile) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit $ac_status); } &&
5717          { ac_try='test -s conftest.$ac_objext'
5718   { (eval echo "$as_me:5718: \"$ac_try\"") >&5
5719   (eval $ac_try) 2>&5
5720   ac_status=$?
5721   echo "$as_me:5721: \$? = $ac_status" >&5
5722   (exit $ac_status); }; }; then
5723   :
5724 else
5725   echo "$as_me: failed program was:" >&5
5726 cat conftest.$ac_ext >&5
5727 cf_have_incdir=yes
5728 fi
5729 rm -f conftest.$ac_objext conftest.$ac_ext
5730                           CPPFLAGS=$cf_save_CPPFLAGS
5731                         fi
5732                   fi
5733                 fi
5734
5735                 if test "$cf_have_incdir" = no ; then
5736                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5737
5738 echo "${as_me:-configure}:5738: testing adding $cf_add_incdir to include-path ..." 1>&5
5739
5740                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5741
5742                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5743                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5744                   cf_add_incdir="$cf_top_incdir"
5745                 else
5746                   break
5747                 fi
5748           else
5749                 break
5750           fi
5751         done
5752   done
5753 fi
5754
5755 if test -n "$cf_cv_library_path_utf8" ; then
5756         for cf_add_libdir in $cf_cv_library_path_utf8
5757         do
5758                 if test $cf_add_libdir = /usr/lib ; then
5759                         :
5760                 elif test -d $cf_add_libdir
5761                 then
5762                         cf_have_libdir=no
5763                         if test -n "$LDFLAGS$LIBS" ; then
5764                                 # a loop is needed to ensure we can add subdirs of existing dirs
5765                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5766                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5767                                                 cf_have_libdir=yes; break
5768                                         fi
5769                                 done
5770                         fi
5771                         if test "$cf_have_libdir" = no ; then
5772                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5773
5774 echo "${as_me:-configure}:5774: testing adding $cf_add_libdir to library-path ..." 1>&5
5775
5776                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5777                         fi
5778                 fi
5779         done
5780 fi
5781
5782 cf_add_libs="$cf_cv_library_file_utf8"
5783 # Filter out duplicates - this happens with badly-designed ".pc" files...
5784 for cf_add_1lib in $LIBS
5785 do
5786         for cf_add_2lib in $cf_add_libs
5787         do
5788                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5789                 then
5790                         cf_add_1lib=
5791                         break
5792                 fi
5793         done
5794         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5795 done
5796 LIBS="$cf_add_libs"
5797
5798 fi
5799
5800 cf_ncuconfig_root=ncursesw
5801 cf_have_ncuconfig=no
5802
5803 if test "x${PKG_CONFIG:=none}" != xnone; then
5804         echo "$as_me:5804: checking pkg-config for $cf_ncuconfig_root" >&5
5805 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5806         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5807                 echo "$as_me:5807: result: yes" >&5
5808 echo "${ECHO_T}yes" >&6
5809
5810                 echo "$as_me:5810: checking if the $cf_ncuconfig_root package files work" >&5
5811 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5812                 cf_have_ncuconfig=unknown
5813
5814                 cf_save_CPPFLAGS="$CPPFLAGS"
5815                 cf_save_LIBS="$LIBS"
5816
5817                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5818
5819 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5820 # Filter out duplicates - this happens with badly-designed ".pc" files...
5821 for cf_add_1lib in $LIBS
5822 do
5823         for cf_add_2lib in $cf_add_libs
5824         do
5825                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5826                 then
5827                         cf_add_1lib=
5828                         break
5829                 fi
5830         done
5831         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5832 done
5833 LIBS="$cf_add_libs"
5834
5835                 cat >conftest.$ac_ext <<_ACEOF
5836 #line 5836 "configure"
5837 #include "confdefs.h"
5838 #include <${cf_cv_ncurses_header:-curses.h}>
5839 int
5840 main ()
5841 {
5842 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5843   ;
5844   return 0;
5845 }
5846 _ACEOF
5847 rm -f conftest.$ac_objext conftest$ac_exeext
5848 if { (eval echo "$as_me:5848: \"$ac_link\"") >&5
5849   (eval $ac_link) 2>&5
5850   ac_status=$?
5851   echo "$as_me:5851: \$? = $ac_status" >&5
5852   (exit $ac_status); } &&
5853          { ac_try='test -s conftest$ac_exeext'
5854   { (eval echo "$as_me:5854: \"$ac_try\"") >&5
5855   (eval $ac_try) 2>&5
5856   ac_status=$?
5857   echo "$as_me:5857: \$? = $ac_status" >&5
5858   (exit $ac_status); }; }; then
5859   if test "$cross_compiling" = yes; then
5860   cf_have_ncuconfig=maybe
5861 else
5862   cat >conftest.$ac_ext <<_ACEOF
5863 #line 5863 "configure"
5864 #include "confdefs.h"
5865 #include <${cf_cv_ncurses_header:-curses.h}>
5866                                 int main(void)
5867                                 { char *xx = curses_version(); return (xx == 0); }
5868 _ACEOF
5869 rm -f conftest$ac_exeext
5870 if { (eval echo "$as_me:5870: \"$ac_link\"") >&5
5871   (eval $ac_link) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5875   { (eval echo "$as_me:5875: \"$ac_try\"") >&5
5876   (eval $ac_try) 2>&5
5877   ac_status=$?
5878   echo "$as_me:5878: \$? = $ac_status" >&5
5879   (exit $ac_status); }; }; then
5880   cf_have_ncuconfig=yes
5881 else
5882   echo "$as_me: program exited with status $ac_status" >&5
5883 echo "$as_me: failed program was:" >&5
5884 cat conftest.$ac_ext >&5
5885 cf_have_ncuconfig=no
5886 fi
5887 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5888 fi
5889 else
5890   echo "$as_me: failed program was:" >&5
5891 cat conftest.$ac_ext >&5
5892 cf_have_ncuconfig=no
5893 fi
5894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5895                 echo "$as_me:5895: result: $cf_have_ncuconfig" >&5
5896 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5897                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5898                 if test "$cf_have_ncuconfig" != "yes"
5899                 then
5900                         CPPFLAGS="$cf_save_CPPFLAGS"
5901                         LIBS="$cf_save_LIBS"
5902                         NCURSES_CONFIG_PKG=none
5903                 else
5904
5905 cat >>confdefs.h <<\EOF
5906 #define NCURSES 1
5907 EOF
5908
5909                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5910                 fi
5911
5912         else
5913                 echo "$as_me:5913: result: no" >&5
5914 echo "${ECHO_T}no" >&6
5915                 NCURSES_CONFIG_PKG=none
5916         fi
5917 else
5918         NCURSES_CONFIG_PKG=none
5919 fi
5920
5921 if test "x$cf_have_ncuconfig" = "xno"; then
5922         echo "Looking for ${cf_ncuconfig_root}-config"
5923
5924 if test -n "$ac_tool_prefix"; then
5925   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5926   do
5927     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5928 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5929 echo "$as_me:5929: checking for $ac_word" >&5
5930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5931 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5932   echo $ECHO_N "(cached) $ECHO_C" >&6
5933 else
5934   if test -n "$NCURSES_CONFIG"; then
5935   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5936 else
5937   ac_save_IFS=$IFS; IFS=$ac_path_separator
5938 ac_dummy="$PATH"
5939 for ac_dir in $ac_dummy; do
5940   IFS=$ac_save_IFS
5941   test -z "$ac_dir" && ac_dir=.
5942   $as_executable_p "$ac_dir/$ac_word" || continue
5943 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5944 echo "$as_me:5944: found $ac_dir/$ac_word" >&5
5945 break
5946 done
5947
5948 fi
5949 fi
5950 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5951 if test -n "$NCURSES_CONFIG"; then
5952   echo "$as_me:5952: result: $NCURSES_CONFIG" >&5
5953 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5954 else
5955   echo "$as_me:5955: result: no" >&5
5956 echo "${ECHO_T}no" >&6
5957 fi
5958
5959     test -n "$NCURSES_CONFIG" && break
5960   done
5961 fi
5962 if test -z "$NCURSES_CONFIG"; then
5963   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5964   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5965 do
5966   # Extract the first word of "$ac_prog", so it can be a program name with args.
5967 set dummy $ac_prog; ac_word=$2
5968 echo "$as_me:5968: checking for $ac_word" >&5
5969 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5970 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5971   echo $ECHO_N "(cached) $ECHO_C" >&6
5972 else
5973   if test -n "$ac_ct_NCURSES_CONFIG"; then
5974   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5975 else
5976   ac_save_IFS=$IFS; IFS=$ac_path_separator
5977 ac_dummy="$PATH"
5978 for ac_dir in $ac_dummy; do
5979   IFS=$ac_save_IFS
5980   test -z "$ac_dir" && ac_dir=.
5981   $as_executable_p "$ac_dir/$ac_word" || continue
5982 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5983 echo "$as_me:5983: found $ac_dir/$ac_word" >&5
5984 break
5985 done
5986
5987 fi
5988 fi
5989 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5990 if test -n "$ac_ct_NCURSES_CONFIG"; then
5991   echo "$as_me:5991: result: $ac_ct_NCURSES_CONFIG" >&5
5992 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5993 else
5994   echo "$as_me:5994: result: no" >&5
5995 echo "${ECHO_T}no" >&6
5996 fi
5997
5998   test -n "$ac_ct_NCURSES_CONFIG" && break
5999 done
6000 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6001
6002   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6003 fi
6004
6005         if test "$NCURSES_CONFIG" != none ; then
6006
6007                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6008
6009 cf_add_libs="`$NCURSES_CONFIG --libs`"
6010 # Filter out duplicates - this happens with badly-designed ".pc" files...
6011 for cf_add_1lib in $LIBS
6012 do
6013         for cf_add_2lib in $cf_add_libs
6014         do
6015                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6016                 then
6017                         cf_add_1lib=
6018                         break
6019                 fi
6020         done
6021         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6022 done
6023 LIBS="$cf_add_libs"
6024
6025                 # even with config script, some packages use no-override for curses.h
6026
6027 echo "$as_me:6027: checking if we have identified curses headers" >&5
6028 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6029 if test "${cf_cv_ncurses_header+set}" = set; then
6030   echo $ECHO_N "(cached) $ECHO_C" >&6
6031 else
6032
6033 cf_cv_ncurses_header=none
6034 for cf_header in \
6035         ncurses.h ncursesw/ncurses.h \
6036         curses.h ncursesw/curses.h
6037 do
6038 cat >conftest.$ac_ext <<_ACEOF
6039 #line 6039 "configure"
6040 #include "confdefs.h"
6041 #include <${cf_header}>
6042 int
6043 main ()
6044 {
6045 initscr(); tgoto("?", 0,0)
6046   ;
6047   return 0;
6048 }
6049 _ACEOF
6050 rm -f conftest.$ac_objext
6051 if { (eval echo "$as_me:6051: \"$ac_compile\"") >&5
6052   (eval $ac_compile) 2>&5
6053   ac_status=$?
6054   echo "$as_me:6054: \$? = $ac_status" >&5
6055   (exit $ac_status); } &&
6056          { ac_try='test -s conftest.$ac_objext'
6057   { (eval echo "$as_me:6057: \"$ac_try\"") >&5
6058   (eval $ac_try) 2>&5
6059   ac_status=$?
6060   echo "$as_me:6060: \$? = $ac_status" >&5
6061   (exit $ac_status); }; }; then
6062   cf_cv_ncurses_header=$cf_header; break
6063 else
6064   echo "$as_me: failed program was:" >&5
6065 cat conftest.$ac_ext >&5
6066 fi
6067 rm -f conftest.$ac_objext conftest.$ac_ext
6068 done
6069
6070 fi
6071 echo "$as_me:6071: result: $cf_cv_ncurses_header" >&5
6072 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6073
6074 if test "$cf_cv_ncurses_header" = none ; then
6075         { { echo "$as_me:6075: error: No curses header-files found" >&5
6076 echo "$as_me: error: No curses header-files found" >&2;}
6077    { (exit 1); exit 1; }; }
6078 fi
6079
6080 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6081
6082 for ac_header in $cf_cv_ncurses_header
6083 do
6084 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6085 echo "$as_me:6085: checking for $ac_header" >&5
6086 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6087 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6088   echo $ECHO_N "(cached) $ECHO_C" >&6
6089 else
6090   cat >conftest.$ac_ext <<_ACEOF
6091 #line 6091 "configure"
6092 #include "confdefs.h"
6093 #include <$ac_header>
6094 _ACEOF
6095 if { (eval echo "$as_me:6095: \"$ac_cpp conftest.$ac_ext\"") >&5
6096   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6097   ac_status=$?
6098   egrep -v '^ *\+' conftest.er1 >conftest.err
6099   rm -f conftest.er1
6100   cat conftest.err >&5
6101   echo "$as_me:6101: \$? = $ac_status" >&5
6102   (exit $ac_status); } >/dev/null; then
6103   if test -s conftest.err; then
6104     ac_cpp_err=$ac_c_preproc_warn_flag
6105   else
6106     ac_cpp_err=
6107   fi
6108 else
6109   ac_cpp_err=yes
6110 fi
6111 if test -z "$ac_cpp_err"; then
6112   eval "$as_ac_Header=yes"
6113 else
6114   echo "$as_me: failed program was:" >&5
6115   cat conftest.$ac_ext >&5
6116   eval "$as_ac_Header=no"
6117 fi
6118 rm -f conftest.err conftest.$ac_ext
6119 fi
6120 echo "$as_me:6120: result: `eval echo '${'$as_ac_Header'}'`" >&5
6121 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6122 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6123   cat >>confdefs.h <<EOF
6124 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6125 EOF
6126
6127 fi
6128 done
6129
6130 cat >>confdefs.h <<\EOF
6131 #define NCURSES 1
6132 EOF
6133
6134 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6135
6136                 cat >>confdefs.h <<EOF
6137 #define $cf_nculib_ROOT 1
6138 EOF
6139
6140                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6141
6142         else
6143
6144 cf_ncuhdr_root=ncursesw
6145
6146 test -n "$cf_cv_curses_dir" && \
6147 test "$cf_cv_curses_dir" != "no" && { \
6148
6149 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6150   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6151   do
6152         while test $cf_add_incdir != /usr/include
6153         do
6154           if test -d $cf_add_incdir
6155           then
6156                 cf_have_incdir=no
6157                 if test -n "$CFLAGS$CPPFLAGS" ; then
6158                   # a loop is needed to ensure we can add subdirs of existing dirs
6159                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6160                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6161                           cf_have_incdir=yes; break
6162                         fi
6163                   done
6164                 fi
6165
6166                 if test "$cf_have_incdir" = no ; then
6167                   if test "$cf_add_incdir" = /usr/local/include ; then
6168                         if test "$GCC" = yes
6169                         then
6170                           cf_save_CPPFLAGS=$CPPFLAGS
6171                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6172                           cat >conftest.$ac_ext <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175 #include <stdio.h>
6176 int
6177 main ()
6178 {
6179 printf("Hello")
6180   ;
6181   return 0;
6182 }
6183 _ACEOF
6184 rm -f conftest.$ac_objext
6185 if { (eval echo "$as_me:6185: \"$ac_compile\"") >&5
6186   (eval $ac_compile) 2>&5
6187   ac_status=$?
6188   echo "$as_me:6188: \$? = $ac_status" >&5
6189   (exit $ac_status); } &&
6190          { ac_try='test -s conftest.$ac_objext'
6191   { (eval echo "$as_me:6191: \"$ac_try\"") >&5
6192   (eval $ac_try) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit $ac_status); }; }; then
6196   :
6197 else
6198   echo "$as_me: failed program was:" >&5
6199 cat conftest.$ac_ext >&5
6200 cf_have_incdir=yes
6201 fi
6202 rm -f conftest.$ac_objext conftest.$ac_ext
6203                           CPPFLAGS=$cf_save_CPPFLAGS
6204                         fi
6205                   fi
6206                 fi
6207
6208                 if test "$cf_have_incdir" = no ; then
6209                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6210
6211 echo "${as_me:-configure}:6211: testing adding $cf_add_incdir to include-path ..." 1>&5
6212
6213                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6214
6215                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6216                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6217                   cf_add_incdir="$cf_top_incdir"
6218                 else
6219                   break
6220                 fi
6221           else
6222                 break
6223           fi
6224         done
6225   done
6226 fi
6227
6228 }
6229
6230 echo "$as_me:6230: checking for $cf_ncuhdr_root header in include-path" >&5
6231 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6232 if test "${cf_cv_ncurses_h+set}" = set; then
6233   echo $ECHO_N "(cached) $ECHO_C" >&6
6234 else
6235
6236         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6237         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6238         for cf_header in $cf_header_list
6239         do
6240
6241         cat >conftest.$ac_ext <<_ACEOF
6242 #line 6242 "configure"
6243 #include "confdefs.h"
6244
6245 #define _XOPEN_SOURCE_EXTENDED
6246 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6247 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6248
6249 #include <$cf_header>
6250 int
6251 main ()
6252 {
6253
6254 #ifdef NCURSES_VERSION
6255
6256 #ifndef WACS_BSSB
6257         make an error
6258 #endif
6259
6260 printf("%s\n", NCURSES_VERSION);
6261 #else
6262 #ifdef __NCURSES_H
6263 printf("old\n");
6264 #else
6265         make an error
6266 #endif
6267 #endif
6268
6269   ;
6270   return 0;
6271 }
6272 _ACEOF
6273 rm -f conftest.$ac_objext
6274 if { (eval echo "$as_me:6274: \"$ac_compile\"") >&5
6275   (eval $ac_compile) 2>&5
6276   ac_status=$?
6277   echo "$as_me:6277: \$? = $ac_status" >&5
6278   (exit $ac_status); } &&
6279          { ac_try='test -s conftest.$ac_objext'
6280   { (eval echo "$as_me:6280: \"$ac_try\"") >&5
6281   (eval $ac_try) 2>&5
6282   ac_status=$?
6283   echo "$as_me:6283: \$? = $ac_status" >&5
6284   (exit $ac_status); }; }; then
6285   cf_cv_ncurses_h=$cf_header
6286
6287 else
6288   echo "$as_me: failed program was:" >&5
6289 cat conftest.$ac_ext >&5
6290 cf_cv_ncurses_h=no
6291 fi
6292 rm -f conftest.$ac_objext conftest.$ac_ext
6293
6294                 test "$cf_cv_ncurses_h" != no && break
6295         done
6296
6297 fi
6298 echo "$as_me:6298: result: $cf_cv_ncurses_h" >&5
6299 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6300
6301 if test "$cf_cv_ncurses_h" != no ; then
6302         cf_cv_ncurses_header=$cf_cv_ncurses_h
6303 else
6304
6305 echo "$as_me:6305: checking for $cf_ncuhdr_root include-path" >&5
6306 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6307 if test "${cf_cv_ncurses_h2+set}" = set; then
6308   echo $ECHO_N "(cached) $ECHO_C" >&6
6309 else
6310
6311         test -n "$verbose" && echo
6312
6313 cf_search=
6314
6315 # collect the current set of include-directories from compiler flags
6316 cf_header_path_list=""
6317 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6318         for cf_header_path in $CPPFLAGS $CFLAGS
6319         do
6320                 case $cf_header_path in
6321                 (-I*)
6322                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6323
6324 test "x$cf_header_path" != "xNONE" && \
6325 test -d "$cf_header_path" && \
6326  {
6327         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6328         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6329         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6330         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6331         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6332         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"
6333 }
6334
6335                         cf_header_path_list="$cf_header_path_list $cf_search"
6336                         ;;
6337                 esac
6338         done
6339 fi
6340
6341 # add the variations for the package we are looking for
6342
6343 cf_search=
6344
6345 test "x$prefix" != "xNONE" && \
6346 test -d "$prefix" && \
6347  {
6348         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6349         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6350         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6351         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6352         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6353         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6354 }
6355
6356 for cf_subdir_prefix in \
6357         /usr \
6358         /usr/local \
6359         /usr/pkg \
6360         /opt \
6361         /opt/local \
6362         $HOME
6363 do
6364
6365 test "x$cf_subdir_prefix" != "x$prefix" && \
6366 test -d "$cf_subdir_prefix" && \
6367 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6368         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6369         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6370         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6371         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6372         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6373         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"
6374 }
6375
6376 done
6377
6378 test "$includedir" != NONE && \
6379 test "$includedir" != "/usr/include" && \
6380 test -d "$includedir" && {
6381         test -d $includedir &&    cf_search="$cf_search $includedir"
6382         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6383 }
6384
6385 test "$oldincludedir" != NONE && \
6386 test "$oldincludedir" != "/usr/include" && \
6387 test -d "$oldincludedir" && {
6388         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6389         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6390 }
6391
6392 cf_search="$cf_search $cf_header_path_list"
6393
6394         test -n "$verbose" && echo search path $cf_search
6395         cf_save2_CPPFLAGS="$CPPFLAGS"
6396         for cf_incdir in $cf_search
6397         do
6398
6399 if test -n "$cf_incdir" ; then
6400   for cf_add_incdir in $cf_incdir
6401   do
6402         while test $cf_add_incdir != /usr/include
6403         do
6404           if test -d $cf_add_incdir
6405           then
6406                 cf_have_incdir=no
6407                 if test -n "$CFLAGS$CPPFLAGS" ; then
6408                   # a loop is needed to ensure we can add subdirs of existing dirs
6409                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6410                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6411                           cf_have_incdir=yes; break
6412                         fi
6413                   done
6414                 fi
6415
6416                 if test "$cf_have_incdir" = no ; then
6417                   if test "$cf_add_incdir" = /usr/local/include ; then
6418                         if test "$GCC" = yes
6419                         then
6420                           cf_save_CPPFLAGS=$CPPFLAGS
6421                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6422                           cat >conftest.$ac_ext <<_ACEOF
6423 #line 6423 "configure"
6424 #include "confdefs.h"
6425 #include <stdio.h>
6426 int
6427 main ()
6428 {
6429 printf("Hello")
6430   ;
6431   return 0;
6432 }
6433 _ACEOF
6434 rm -f conftest.$ac_objext
6435 if { (eval echo "$as_me:6435: \"$ac_compile\"") >&5
6436   (eval $ac_compile) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); } &&
6440          { ac_try='test -s conftest.$ac_objext'
6441   { (eval echo "$as_me:6441: \"$ac_try\"") >&5
6442   (eval $ac_try) 2>&5
6443   ac_status=$?
6444   echo "$as_me:6444: \$? = $ac_status" >&5
6445   (exit $ac_status); }; }; then
6446   :
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450 cf_have_incdir=yes
6451 fi
6452 rm -f conftest.$ac_objext conftest.$ac_ext
6453                           CPPFLAGS=$cf_save_CPPFLAGS
6454                         fi
6455                   fi
6456                 fi
6457
6458                 if test "$cf_have_incdir" = no ; then
6459                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6460
6461 echo "${as_me:-configure}:6461: testing adding $cf_add_incdir to include-path ..." 1>&5
6462
6463                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6464
6465                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6466                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6467                   cf_add_incdir="$cf_top_incdir"
6468                 else
6469                   break
6470                 fi
6471           else
6472                 break
6473           fi
6474         done
6475   done
6476 fi
6477
6478                 for cf_header in \
6479                         ncurses.h \
6480                         curses.h
6481                 do
6482
6483         cat >conftest.$ac_ext <<_ACEOF
6484 #line 6484 "configure"
6485 #include "confdefs.h"
6486
6487 #include <$cf_header>
6488 int
6489 main ()
6490 {
6491
6492 #ifdef NCURSES_VERSION
6493
6494 printf("%s\n", NCURSES_VERSION);
6495 #else
6496 #ifdef __NCURSES_H
6497 printf("old\n");
6498 #else
6499         make an error
6500 #endif
6501 #endif
6502
6503   ;
6504   return 0;
6505 }
6506 _ACEOF
6507 rm -f conftest.$ac_objext
6508 if { (eval echo "$as_me:6508: \"$ac_compile\"") >&5
6509   (eval $ac_compile) 2>&5
6510   ac_status=$?
6511   echo "$as_me:6511: \$? = $ac_status" >&5
6512   (exit $ac_status); } &&
6513          { ac_try='test -s conftest.$ac_objext'
6514   { (eval echo "$as_me:6514: \"$ac_try\"") >&5
6515   (eval $ac_try) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); }; }; then
6519   cf_cv_ncurses_h2=$cf_header
6520
6521 else
6522   echo "$as_me: failed program was:" >&5
6523 cat conftest.$ac_ext >&5
6524 cf_cv_ncurses_h2=no
6525 fi
6526 rm -f conftest.$ac_objext conftest.$ac_ext
6527
6528                         if test "$cf_cv_ncurses_h2" != no ; then
6529                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6530                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6531                                 break
6532                         fi
6533                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6534                 done
6535                 CPPFLAGS="$cf_save2_CPPFLAGS"
6536                 test "$cf_cv_ncurses_h2" != no && break
6537         done
6538         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6538: error: not found" >&5
6539 echo "$as_me: error: not found" >&2;}
6540    { (exit 1); exit 1; }; }
6541
6542 fi
6543 echo "$as_me:6543: result: $cf_cv_ncurses_h2" >&5
6544 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6545
6546         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6547         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6548         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6549                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6550         fi
6551
6552 if test -n "$cf_1st_incdir" ; then
6553   for cf_add_incdir in $cf_1st_incdir
6554   do
6555         while test $cf_add_incdir != /usr/include
6556         do
6557           if test -d $cf_add_incdir
6558           then
6559                 cf_have_incdir=no
6560                 if test -n "$CFLAGS$CPPFLAGS" ; then
6561                   # a loop is needed to ensure we can add subdirs of existing dirs
6562                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6563                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6564                           cf_have_incdir=yes; break
6565                         fi
6566                   done
6567                 fi
6568
6569                 if test "$cf_have_incdir" = no ; then
6570                   if test "$cf_add_incdir" = /usr/local/include ; then
6571                         if test "$GCC" = yes
6572                         then
6573                           cf_save_CPPFLAGS=$CPPFLAGS
6574                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6575                           cat >conftest.$ac_ext <<_ACEOF
6576 #line 6576 "configure"
6577 #include "confdefs.h"
6578 #include <stdio.h>
6579 int
6580 main ()
6581 {
6582 printf("Hello")
6583   ;
6584   return 0;
6585 }
6586 _ACEOF
6587 rm -f conftest.$ac_objext
6588 if { (eval echo "$as_me:6588: \"$ac_compile\"") >&5
6589   (eval $ac_compile) 2>&5
6590   ac_status=$?
6591   echo "$as_me:6591: \$? = $ac_status" >&5
6592   (exit $ac_status); } &&
6593          { ac_try='test -s conftest.$ac_objext'
6594   { (eval echo "$as_me:6594: \"$ac_try\"") >&5
6595   (eval $ac_try) 2>&5
6596   ac_status=$?
6597   echo "$as_me:6597: \$? = $ac_status" >&5
6598   (exit $ac_status); }; }; then
6599   :
6600 else
6601   echo "$as_me: failed program was:" >&5
6602 cat conftest.$ac_ext >&5
6603 cf_have_incdir=yes
6604 fi
6605 rm -f conftest.$ac_objext conftest.$ac_ext
6606                           CPPFLAGS=$cf_save_CPPFLAGS
6607                         fi
6608                   fi
6609                 fi
6610
6611                 if test "$cf_have_incdir" = no ; then
6612                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6613
6614 echo "${as_me:-configure}:6614: testing adding $cf_add_incdir to include-path ..." 1>&5
6615
6616                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6617
6618                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6619                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6620                   cf_add_incdir="$cf_top_incdir"
6621                 else
6622                   break
6623                 fi
6624           else
6625                 break
6626           fi
6627         done
6628   done
6629 fi
6630
6631 fi
6632
6633 # Set definitions to allow ifdef'ing for ncurses.h
6634
6635 case $cf_cv_ncurses_header in
6636 (*ncurses.h)
6637
6638 cat >>confdefs.h <<\EOF
6639 #define HAVE_NCURSES_H 1
6640 EOF
6641
6642         ;;
6643 esac
6644
6645 case $cf_cv_ncurses_header in
6646 (ncurses/curses.h|ncurses/ncurses.h)
6647
6648 cat >>confdefs.h <<\EOF
6649 #define HAVE_NCURSES_NCURSES_H 1
6650 EOF
6651
6652         ;;
6653 (ncursesw/curses.h|ncursesw/ncurses.h)
6654
6655 cat >>confdefs.h <<\EOF
6656 #define HAVE_NCURSESW_NCURSES_H 1
6657 EOF
6658
6659         ;;
6660 esac
6661
6662 echo "$as_me:6662: checking for terminfo header" >&5
6663 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6664 if test "${cf_cv_term_header+set}" = set; then
6665   echo $ECHO_N "(cached) $ECHO_C" >&6
6666 else
6667
6668 case ${cf_cv_ncurses_header} in
6669 (*/ncurses.h|*/ncursesw.h)
6670         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6671         ;;
6672 (*)
6673         cf_term_header=term.h
6674         ;;
6675 esac
6676
6677 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6678 do
6679 cat >conftest.$ac_ext <<_ACEOF
6680 #line 6680 "configure"
6681 #include "confdefs.h"
6682 #include <stdio.h>
6683 #include <${cf_cv_ncurses_header:-curses.h}>
6684 #include <$cf_test>
6685
6686 int
6687 main ()
6688 {
6689 int x = auto_left_margin
6690   ;
6691   return 0;
6692 }
6693 _ACEOF
6694 rm -f conftest.$ac_objext
6695 if { (eval echo "$as_me:6695: \"$ac_compile\"") >&5
6696   (eval $ac_compile) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit $ac_status); } &&
6700          { ac_try='test -s conftest.$ac_objext'
6701   { (eval echo "$as_me:6701: \"$ac_try\"") >&5
6702   (eval $ac_try) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); }; }; then
6706
6707         cf_cv_term_header="$cf_test"
6708 else
6709   echo "$as_me: failed program was:" >&5
6710 cat conftest.$ac_ext >&5
6711
6712         cf_cv_term_header=unknown
6713
6714 fi
6715 rm -f conftest.$ac_objext conftest.$ac_ext
6716         test "$cf_cv_term_header" != unknown && break
6717 done
6718
6719 fi
6720 echo "$as_me:6720: result: $cf_cv_term_header" >&5
6721 echo "${ECHO_T}$cf_cv_term_header" >&6
6722
6723 # Set definitions to allow ifdef'ing to accommodate subdirectories
6724
6725 case $cf_cv_term_header in
6726 (*term.h)
6727
6728 cat >>confdefs.h <<\EOF
6729 #define HAVE_TERM_H 1
6730 EOF
6731
6732         ;;
6733 esac
6734
6735 case $cf_cv_term_header in
6736 (ncurses/term.h)
6737
6738 cat >>confdefs.h <<\EOF
6739 #define HAVE_NCURSES_TERM_H 1
6740 EOF
6741
6742         ;;
6743 (ncursesw/term.h)
6744
6745 cat >>confdefs.h <<\EOF
6746 #define HAVE_NCURSESW_TERM_H 1
6747 EOF
6748
6749         ;;
6750 esac
6751
6752 # some applications need this, but should check for NCURSES_VERSION
6753
6754 cat >>confdefs.h <<\EOF
6755 #define NCURSES 1
6756 EOF
6757
6758 echo "$as_me:6758: checking for ncurses version" >&5
6759 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6760 if test "${cf_cv_ncurses_version+set}" = set; then
6761   echo $ECHO_N "(cached) $ECHO_C" >&6
6762 else
6763
6764         cf_cv_ncurses_version=no
6765         cf_tempfile=out$$
6766         rm -f $cf_tempfile
6767         if test "$cross_compiling" = yes; then
6768
6769         # This will not work if the preprocessor splits the line after the
6770         # Autoconf token.  The 'unproto' program does that.
6771         cat > conftest.$ac_ext <<EOF
6772 #include <${cf_cv_ncurses_header:-curses.h}>
6773 #undef Autoconf
6774 #ifdef NCURSES_VERSION
6775 Autoconf NCURSES_VERSION
6776 #else
6777 #ifdef __NCURSES_H
6778 Autoconf "old"
6779 #endif
6780 ;
6781 #endif
6782 EOF
6783         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6784         { (eval echo "$as_me:6784: \"$cf_try\"") >&5
6785   (eval $cf_try) 2>&5
6786   ac_status=$?
6787   echo "$as_me:6787: \$? = $ac_status" >&5
6788   (exit $ac_status); }
6789         if test -f conftest.out ; then
6790                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6791                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6792                 rm -f conftest.out
6793         fi
6794
6795 else
6796   cat >conftest.$ac_ext <<_ACEOF
6797 #line 6797 "configure"
6798 #include "confdefs.h"
6799
6800 #include <${cf_cv_ncurses_header:-curses.h}>
6801 #include <stdio.h>
6802 int main()
6803 {
6804         FILE *fp = fopen("$cf_tempfile", "w");
6805 #ifdef NCURSES_VERSION
6806 # ifdef NCURSES_VERSION_PATCH
6807         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6808 # else
6809         fprintf(fp, "%s\n", NCURSES_VERSION);
6810 # endif
6811 #else
6812 # ifdef __NCURSES_H
6813         fprintf(fp, "old\n");
6814 # else
6815         make an error
6816 # endif
6817 #endif
6818         ${cf_cv_main_return:-return}(0);
6819 }
6820 _ACEOF
6821 rm -f conftest$ac_exeext
6822 if { (eval echo "$as_me:6822: \"$ac_link\"") >&5
6823   (eval $ac_link) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6827   { (eval echo "$as_me:6827: \"$ac_try\"") >&5
6828   (eval $ac_try) 2>&5
6829   ac_status=$?
6830   echo "$as_me:6830: \$? = $ac_status" >&5
6831   (exit $ac_status); }; }; then
6832
6833         cf_cv_ncurses_version=`cat $cf_tempfile`
6834 else
6835   echo "$as_me: program exited with status $ac_status" >&5
6836 echo "$as_me: failed program was:" >&5
6837 cat conftest.$ac_ext >&5
6838 fi
6839 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6840 fi
6841         rm -f $cf_tempfile
6842
6843 fi
6844 echo "$as_me:6844: result: $cf_cv_ncurses_version" >&5
6845 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6846 test "$cf_cv_ncurses_version" = no ||
6847 cat >>confdefs.h <<\EOF
6848 #define NCURSES 1
6849 EOF
6850
6851 cf_nculib_root=ncursesw
6852         # This works, except for the special case where we find gpm, but
6853         # ncurses is in a nonstandard location via $LIBS, and we really want
6854         # to link gpm.
6855 cf_ncurses_LIBS=""
6856 cf_ncurses_SAVE="$LIBS"
6857 echo "$as_me:6857: checking for Gpm_Open in -lgpm" >&5
6858 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6859 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6860   echo $ECHO_N "(cached) $ECHO_C" >&6
6861 else
6862   ac_check_lib_save_LIBS=$LIBS
6863 LIBS="-lgpm  $LIBS"
6864 cat >conftest.$ac_ext <<_ACEOF
6865 #line 6865 "configure"
6866 #include "confdefs.h"
6867
6868 /* Override any gcc2 internal prototype to avoid an error.  */
6869 #ifdef __cplusplus
6870 extern "C"
6871 #endif
6872 /* We use char because int might match the return type of a gcc2
6873    builtin and then its argument prototype would still apply.  */
6874 char Gpm_Open ();
6875 int
6876 main ()
6877 {
6878 Gpm_Open ();
6879   ;
6880   return 0;
6881 }
6882 _ACEOF
6883 rm -f conftest.$ac_objext conftest$ac_exeext
6884 if { (eval echo "$as_me:6884: \"$ac_link\"") >&5
6885   (eval $ac_link) 2>&5
6886   ac_status=$?
6887   echo "$as_me:6887: \$? = $ac_status" >&5
6888   (exit $ac_status); } &&
6889          { ac_try='test -s conftest$ac_exeext'
6890   { (eval echo "$as_me:6890: \"$ac_try\"") >&5
6891   (eval $ac_try) 2>&5
6892   ac_status=$?
6893   echo "$as_me:6893: \$? = $ac_status" >&5
6894   (exit $ac_status); }; }; then
6895   ac_cv_lib_gpm_Gpm_Open=yes
6896 else
6897   echo "$as_me: failed program was:" >&5
6898 cat conftest.$ac_ext >&5
6899 ac_cv_lib_gpm_Gpm_Open=no
6900 fi
6901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6902 LIBS=$ac_check_lib_save_LIBS
6903 fi
6904 echo "$as_me:6904: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6905 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6906 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6907   echo "$as_me:6907: checking for initscr in -lgpm" >&5
6908 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6909 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6910   echo $ECHO_N "(cached) $ECHO_C" >&6
6911 else
6912   ac_check_lib_save_LIBS=$LIBS
6913 LIBS="-lgpm  $LIBS"
6914 cat >conftest.$ac_ext <<_ACEOF
6915 #line 6915 "configure"
6916 #include "confdefs.h"
6917
6918 /* Override any gcc2 internal prototype to avoid an error.  */
6919 #ifdef __cplusplus
6920 extern "C"
6921 #endif
6922 /* We use char because int might match the return type of a gcc2
6923    builtin and then its argument prototype would still apply.  */
6924 char initscr ();
6925 int
6926 main ()
6927 {
6928 initscr ();
6929   ;
6930   return 0;
6931 }
6932 _ACEOF
6933 rm -f conftest.$ac_objext conftest$ac_exeext
6934 if { (eval echo "$as_me:6934: \"$ac_link\"") >&5
6935   (eval $ac_link) 2>&5
6936   ac_status=$?
6937   echo "$as_me:6937: \$? = $ac_status" >&5
6938   (exit $ac_status); } &&
6939          { ac_try='test -s conftest$ac_exeext'
6940   { (eval echo "$as_me:6940: \"$ac_try\"") >&5
6941   (eval $ac_try) 2>&5
6942   ac_status=$?
6943   echo "$as_me:6943: \$? = $ac_status" >&5
6944   (exit $ac_status); }; }; then
6945   ac_cv_lib_gpm_initscr=yes
6946 else
6947   echo "$as_me: failed program was:" >&5
6948 cat conftest.$ac_ext >&5
6949 ac_cv_lib_gpm_initscr=no
6950 fi
6951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6952 LIBS=$ac_check_lib_save_LIBS
6953 fi
6954 echo "$as_me:6954: result: $ac_cv_lib_gpm_initscr" >&5
6955 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6956 if test $ac_cv_lib_gpm_initscr = yes; then
6957   LIBS="$cf_ncurses_SAVE"
6958 else
6959   cf_ncurses_LIBS="-lgpm"
6960 fi
6961
6962 fi
6963
6964 case $host_os in
6965 (freebsd*)
6966         # This is only necessary if you are linking against an obsolete
6967         # version of ncurses (but it should do no harm, since it's static).
6968         if test "$cf_nculib_root" = ncurses ; then
6969                 echo "$as_me:6969: checking for tgoto in -lmytinfo" >&5
6970 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6971 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6972   echo $ECHO_N "(cached) $ECHO_C" >&6
6973 else
6974   ac_check_lib_save_LIBS=$LIBS
6975 LIBS="-lmytinfo  $LIBS"
6976 cat >conftest.$ac_ext <<_ACEOF
6977 #line 6977 "configure"
6978 #include "confdefs.h"
6979
6980 /* Override any gcc2 internal prototype to avoid an error.  */
6981 #ifdef __cplusplus
6982 extern "C"
6983 #endif
6984 /* We use char because int might match the return type of a gcc2
6985    builtin and then its argument prototype would still apply.  */
6986 char tgoto ();
6987 int
6988 main ()
6989 {
6990 tgoto ();
6991   ;
6992   return 0;
6993 }
6994 _ACEOF
6995 rm -f conftest.$ac_objext conftest$ac_exeext
6996 if { (eval echo "$as_me:6996: \"$ac_link\"") >&5
6997   (eval $ac_link) 2>&5
6998   ac_status=$?
6999   echo "$as_me:6999: \$? = $ac_status" >&5
7000   (exit $ac_status); } &&
7001          { ac_try='test -s conftest$ac_exeext'
7002   { (eval echo "$as_me:7002: \"$ac_try\"") >&5
7003   (eval $ac_try) 2>&5
7004   ac_status=$?
7005   echo "$as_me:7005: \$? = $ac_status" >&5
7006   (exit $ac_status); }; }; then
7007   ac_cv_lib_mytinfo_tgoto=yes
7008 else
7009   echo "$as_me: failed program was:" >&5
7010 cat conftest.$ac_ext >&5
7011 ac_cv_lib_mytinfo_tgoto=no
7012 fi
7013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7014 LIBS=$ac_check_lib_save_LIBS
7015 fi
7016 echo "$as_me:7016: result: $ac_cv_lib_mytinfo_tgoto" >&5
7017 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7018 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7019   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7020 fi
7021
7022         fi
7023         ;;
7024 esac
7025
7026 cf_add_libs="$cf_ncurses_LIBS"
7027 # Filter out duplicates - this happens with badly-designed ".pc" files...
7028 for cf_add_1lib in $LIBS
7029 do
7030         for cf_add_2lib in $cf_add_libs
7031         do
7032                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7033                 then
7034                         cf_add_1lib=
7035                         break
7036                 fi
7037         done
7038         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7039 done
7040 LIBS="$cf_add_libs"
7041
7042 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7043 then
7044
7045 cf_add_libs="-l$cf_nculib_root"
7046 # Filter out duplicates - this happens with badly-designed ".pc" files...
7047 for cf_add_1lib in $LIBS
7048 do
7049         for cf_add_2lib in $cf_add_libs
7050         do
7051                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7052                 then
7053                         cf_add_1lib=
7054                         break
7055                 fi
7056         done
7057         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7058 done
7059 LIBS="$cf_add_libs"
7060
7061 else
7062
7063         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7064         cf_libdir=""
7065         echo "$as_me:7065: checking for initscr" >&5
7066 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7067 if test "${ac_cv_func_initscr+set}" = set; then
7068   echo $ECHO_N "(cached) $ECHO_C" >&6
7069 else
7070   cat >conftest.$ac_ext <<_ACEOF
7071 #line 7071 "configure"
7072 #include "confdefs.h"
7073 /* System header to define __stub macros and hopefully few prototypes,
7074     which can conflict with char initscr (); below.  */
7075 #include <assert.h>
7076 /* Override any gcc2 internal prototype to avoid an error.  */
7077 #ifdef __cplusplus
7078 extern "C"
7079 #endif
7080 /* We use char because int might match the return type of a gcc2
7081    builtin and then its argument prototype would still apply.  */
7082 char initscr ();
7083 char (*f) ();
7084
7085 int
7086 main ()
7087 {
7088 /* The GNU C library defines this for functions which it implements
7089     to always fail with ENOSYS.  Some functions are actually named
7090     something starting with __ and the normal name is an alias.  */
7091 #if defined (__stub_initscr) || defined (__stub___initscr)
7092 choke me
7093 #else
7094 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7095 #endif
7096
7097   ;
7098   return 0;
7099 }
7100 _ACEOF
7101 rm -f conftest.$ac_objext conftest$ac_exeext
7102 if { (eval echo "$as_me:7102: \"$ac_link\"") >&5
7103   (eval $ac_link) 2>&5
7104   ac_status=$?
7105   echo "$as_me:7105: \$? = $ac_status" >&5
7106   (exit $ac_status); } &&
7107          { ac_try='test -s conftest$ac_exeext'
7108   { (eval echo "$as_me:7108: \"$ac_try\"") >&5
7109   (eval $ac_try) 2>&5
7110   ac_status=$?
7111   echo "$as_me:7111: \$? = $ac_status" >&5
7112   (exit $ac_status); }; }; then
7113   ac_cv_func_initscr=yes
7114 else
7115   echo "$as_me: failed program was:" >&5
7116 cat conftest.$ac_ext >&5
7117 ac_cv_func_initscr=no
7118 fi
7119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7120 fi
7121 echo "$as_me:7121: result: $ac_cv_func_initscr" >&5
7122 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7123 if test $ac_cv_func_initscr = yes; then
7124   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7125 else
7126
7127                 cf_save_LIBS="$LIBS"
7128                 echo "$as_me:7128: checking for initscr in -l$cf_nculib_root" >&5
7129 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7130                 LIBS="-l$cf_nculib_root $LIBS"
7131                 cat >conftest.$ac_ext <<_ACEOF
7132 #line 7132 "configure"
7133 #include "confdefs.h"
7134 #include <${cf_cv_ncurses_header:-curses.h}>
7135 int
7136 main ()
7137 {
7138 initscr()
7139   ;
7140   return 0;
7141 }
7142 _ACEOF
7143 rm -f conftest.$ac_objext conftest$ac_exeext
7144 if { (eval echo "$as_me:7144: \"$ac_link\"") >&5
7145   (eval $ac_link) 2>&5
7146   ac_status=$?
7147   echo "$as_me:7147: \$? = $ac_status" >&5
7148   (exit $ac_status); } &&
7149          { ac_try='test -s conftest$ac_exeext'
7150   { (eval echo "$as_me:7150: \"$ac_try\"") >&5
7151   (eval $ac_try) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); }; }; then
7155   echo "$as_me:7155: result: yes" >&5
7156 echo "${ECHO_T}yes" >&6
7157                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7158
7159 else
7160   echo "$as_me: failed program was:" >&5
7161 cat conftest.$ac_ext >&5
7162 echo "$as_me:7162: result: no" >&5
7163 echo "${ECHO_T}no" >&6
7164
7165 cf_search=
7166 cf_library_path_list=""
7167 if test -n "${LDFLAGS}${LIBS}" ; then
7168         for cf_library_path in $LDFLAGS $LIBS
7169         do
7170                 case $cf_library_path in
7171                 (-L*)
7172                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7173
7174 test "x$cf_library_path" != "xNONE" && \
7175 test -d "$cf_library_path" && \
7176  {
7177         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7178         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7179         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7180         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7181         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7182         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"
7183 }
7184
7185                         cf_library_path_list="$cf_library_path_list $cf_search"
7186                         ;;
7187                 esac
7188         done
7189 fi
7190
7191 cf_search=
7192
7193 test "x$prefix" != "xNONE" && \
7194 test -d "$prefix" && \
7195  {
7196         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7197         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7198         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7199         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7200         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7201         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7202 }
7203
7204 for cf_subdir_prefix in \
7205         /usr \
7206         /usr/local \
7207         /usr/pkg \
7208         /opt \
7209         /opt/local \
7210         $HOME
7211 do
7212
7213 test "x$cf_subdir_prefix" != "x$prefix" && \
7214 test -d "$cf_subdir_prefix" && \
7215 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7216         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7217         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7218         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7219         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7220         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7221         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"
7222 }
7223
7224 done
7225
7226 cf_search="$cf_library_path_list $cf_search"
7227
7228                         for cf_libdir in $cf_search
7229                         do
7230                                 echo "$as_me:7230: checking for -l$cf_nculib_root in $cf_libdir" >&5
7231 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7232                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7233                                 cat >conftest.$ac_ext <<_ACEOF
7234 #line 7234 "configure"
7235 #include "confdefs.h"
7236 #include <${cf_cv_ncurses_header:-curses.h}>
7237 int
7238 main ()
7239 {
7240 initscr()
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f conftest.$ac_objext conftest$ac_exeext
7246 if { (eval echo "$as_me:7246: \"$ac_link\"") >&5
7247   (eval $ac_link) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); } &&
7251          { ac_try='test -s conftest$ac_exeext'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit $ac_status); }; }; then
7257   echo "$as_me:7257: result: yes" >&5
7258 echo "${ECHO_T}yes" >&6
7259                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7260                                          break
7261 else
7262   echo "$as_me: failed program was:" >&5
7263 cat conftest.$ac_ext >&5
7264 echo "$as_me:7264: result: no" >&5
7265 echo "${ECHO_T}no" >&6
7266                                          LIBS="$cf_save_LIBS"
7267 fi
7268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7269                         done
7270
7271 fi
7272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7273
7274 fi
7275
7276 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7277
7278 if test $cf_found_library = no ; then
7279         { { echo "$as_me:7279: error: Cannot link $cf_nculib_root library" >&5
7280 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7281    { (exit 1); exit 1; }; }
7282 fi
7283
7284 fi
7285
7286 if test -n "$cf_ncurses_LIBS" ; then
7287         echo "$as_me:7287: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7288 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7289         cf_ncurses_SAVE="$LIBS"
7290         for p in $cf_ncurses_LIBS ; do
7291                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7292                 if test "$q" != "$LIBS" ; then
7293                         LIBS="$q"
7294                 fi
7295         done
7296         cat >conftest.$ac_ext <<_ACEOF
7297 #line 7297 "configure"
7298 #include "confdefs.h"
7299 #include <${cf_cv_ncurses_header:-curses.h}>
7300 int
7301 main ()
7302 {
7303 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7304   ;
7305   return 0;
7306 }
7307 _ACEOF
7308 rm -f conftest.$ac_objext conftest$ac_exeext
7309 if { (eval echo "$as_me:7309: \"$ac_link\"") >&5
7310   (eval $ac_link) 2>&5
7311   ac_status=$?
7312   echo "$as_me:7312: \$? = $ac_status" >&5
7313   (exit $ac_status); } &&
7314          { ac_try='test -s conftest$ac_exeext'
7315   { (eval echo "$as_me:7315: \"$ac_try\"") >&5
7316   (eval $ac_try) 2>&5
7317   ac_status=$?
7318   echo "$as_me:7318: \$? = $ac_status" >&5
7319   (exit $ac_status); }; }; then
7320   echo "$as_me:7320: result: yes" >&5
7321 echo "${ECHO_T}yes" >&6
7322 else
7323   echo "$as_me: failed program was:" >&5
7324 cat conftest.$ac_ext >&5
7325 echo "$as_me:7325: result: no" >&5
7326 echo "${ECHO_T}no" >&6
7327                  LIBS="$cf_ncurses_SAVE"
7328 fi
7329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7330 fi
7331
7332 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7333
7334 cat >>confdefs.h <<EOF
7335 #define $cf_nculib_ROOT 1
7336 EOF
7337
7338         fi
7339 else
7340         NCURSES_CONFIG=none
7341 fi
7342
7343 else
7344
7345 cf_ncuconfig_root=ncurses
7346 cf_have_ncuconfig=no
7347
7348 if test "x${PKG_CONFIG:=none}" != xnone; then
7349         echo "$as_me:7349: checking pkg-config for $cf_ncuconfig_root" >&5
7350 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7351         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7352                 echo "$as_me:7352: result: yes" >&5
7353 echo "${ECHO_T}yes" >&6
7354
7355                 echo "$as_me:7355: checking if the $cf_ncuconfig_root package files work" >&5
7356 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7357                 cf_have_ncuconfig=unknown
7358
7359                 cf_save_CPPFLAGS="$CPPFLAGS"
7360                 cf_save_LIBS="$LIBS"
7361
7362                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7363
7364 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7365 # Filter out duplicates - this happens with badly-designed ".pc" files...
7366 for cf_add_1lib in $LIBS
7367 do
7368         for cf_add_2lib in $cf_add_libs
7369         do
7370                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7371                 then
7372                         cf_add_1lib=
7373                         break
7374                 fi
7375         done
7376         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7377 done
7378 LIBS="$cf_add_libs"
7379
7380                 cat >conftest.$ac_ext <<_ACEOF
7381 #line 7381 "configure"
7382 #include "confdefs.h"
7383 #include <${cf_cv_ncurses_header:-curses.h}>
7384 int
7385 main ()
7386 {
7387 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7388   ;
7389   return 0;
7390 }
7391 _ACEOF
7392 rm -f conftest.$ac_objext conftest$ac_exeext
7393 if { (eval echo "$as_me:7393: \"$ac_link\"") >&5
7394   (eval $ac_link) 2>&5
7395   ac_status=$?
7396   echo "$as_me:7396: \$? = $ac_status" >&5
7397   (exit $ac_status); } &&
7398          { ac_try='test -s conftest$ac_exeext'
7399   { (eval echo "$as_me:7399: \"$ac_try\"") >&5
7400   (eval $ac_try) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); }; }; then
7404   if test "$cross_compiling" = yes; then
7405   cf_have_ncuconfig=maybe
7406 else
7407   cat >conftest.$ac_ext <<_ACEOF
7408 #line 7408 "configure"
7409 #include "confdefs.h"
7410 #include <${cf_cv_ncurses_header:-curses.h}>
7411                                 int main(void)
7412                                 { char *xx = curses_version(); return (xx == 0); }
7413 _ACEOF
7414 rm -f conftest$ac_exeext
7415 if { (eval echo "$as_me:7415: \"$ac_link\"") >&5
7416   (eval $ac_link) 2>&5
7417   ac_status=$?
7418   echo "$as_me:7418: \$? = $ac_status" >&5
7419   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7420   { (eval echo "$as_me:7420: \"$ac_try\"") >&5
7421   (eval $ac_try) 2>&5
7422   ac_status=$?
7423   echo "$as_me:7423: \$? = $ac_status" >&5
7424   (exit $ac_status); }; }; then
7425   cf_have_ncuconfig=yes
7426 else
7427   echo "$as_me: program exited with status $ac_status" >&5
7428 echo "$as_me: failed program was:" >&5
7429 cat conftest.$ac_ext >&5
7430 cf_have_ncuconfig=no
7431 fi
7432 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7433 fi
7434 else
7435   echo "$as_me: failed program was:" >&5
7436 cat conftest.$ac_ext >&5
7437 cf_have_ncuconfig=no
7438 fi
7439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7440                 echo "$as_me:7440: result: $cf_have_ncuconfig" >&5
7441 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7442                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7443                 if test "$cf_have_ncuconfig" != "yes"
7444                 then
7445                         CPPFLAGS="$cf_save_CPPFLAGS"
7446                         LIBS="$cf_save_LIBS"
7447                         NCURSES_CONFIG_PKG=none
7448                 else
7449
7450 cat >>confdefs.h <<\EOF
7451 #define NCURSES 1
7452 EOF
7453
7454                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7455                 fi
7456
7457         else
7458                 echo "$as_me:7458: result: no" >&5
7459 echo "${ECHO_T}no" >&6
7460                 NCURSES_CONFIG_PKG=none
7461         fi
7462 else
7463         NCURSES_CONFIG_PKG=none
7464 fi
7465
7466 if test "x$cf_have_ncuconfig" = "xno"; then
7467         echo "Looking for ${cf_ncuconfig_root}-config"
7468
7469 if test -n "$ac_tool_prefix"; then
7470   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7471   do
7472     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7473 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7474 echo "$as_me:7474: checking for $ac_word" >&5
7475 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7476 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7477   echo $ECHO_N "(cached) $ECHO_C" >&6
7478 else
7479   if test -n "$NCURSES_CONFIG"; then
7480   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7481 else
7482   ac_save_IFS=$IFS; IFS=$ac_path_separator
7483 ac_dummy="$PATH"
7484 for ac_dir in $ac_dummy; do
7485   IFS=$ac_save_IFS
7486   test -z "$ac_dir" && ac_dir=.
7487   $as_executable_p "$ac_dir/$ac_word" || continue
7488 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7489 echo "$as_me:7489: found $ac_dir/$ac_word" >&5
7490 break
7491 done
7492
7493 fi
7494 fi
7495 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7496 if test -n "$NCURSES_CONFIG"; then
7497   echo "$as_me:7497: result: $NCURSES_CONFIG" >&5
7498 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7499 else
7500   echo "$as_me:7500: result: no" >&5
7501 echo "${ECHO_T}no" >&6
7502 fi
7503
7504     test -n "$NCURSES_CONFIG" && break
7505   done
7506 fi
7507 if test -z "$NCURSES_CONFIG"; then
7508   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7509   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7510 do
7511   # Extract the first word of "$ac_prog", so it can be a program name with args.
7512 set dummy $ac_prog; ac_word=$2
7513 echo "$as_me:7513: checking for $ac_word" >&5
7514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7515 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7516   echo $ECHO_N "(cached) $ECHO_C" >&6
7517 else
7518   if test -n "$ac_ct_NCURSES_CONFIG"; then
7519   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7520 else
7521   ac_save_IFS=$IFS; IFS=$ac_path_separator
7522 ac_dummy="$PATH"
7523 for ac_dir in $ac_dummy; do
7524   IFS=$ac_save_IFS
7525   test -z "$ac_dir" && ac_dir=.
7526   $as_executable_p "$ac_dir/$ac_word" || continue
7527 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7528 echo "$as_me:7528: found $ac_dir/$ac_word" >&5
7529 break
7530 done
7531
7532 fi
7533 fi
7534 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7535 if test -n "$ac_ct_NCURSES_CONFIG"; then
7536   echo "$as_me:7536: result: $ac_ct_NCURSES_CONFIG" >&5
7537 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7538 else
7539   echo "$as_me:7539: result: no" >&5
7540 echo "${ECHO_T}no" >&6
7541 fi
7542
7543   test -n "$ac_ct_NCURSES_CONFIG" && break
7544 done
7545 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7546
7547   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7548 fi
7549
7550         if test "$NCURSES_CONFIG" != none ; then
7551
7552                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7553
7554 cf_add_libs="`$NCURSES_CONFIG --libs`"
7555 # Filter out duplicates - this happens with badly-designed ".pc" files...
7556 for cf_add_1lib in $LIBS
7557 do
7558         for cf_add_2lib in $cf_add_libs
7559         do
7560                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7561                 then
7562                         cf_add_1lib=
7563                         break
7564                 fi
7565         done
7566         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7567 done
7568 LIBS="$cf_add_libs"
7569
7570                 # even with config script, some packages use no-override for curses.h
7571
7572 echo "$as_me:7572: checking if we have identified curses headers" >&5
7573 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7574 if test "${cf_cv_ncurses_header+set}" = set; then
7575   echo $ECHO_N "(cached) $ECHO_C" >&6
7576 else
7577
7578 cf_cv_ncurses_header=none
7579 for cf_header in \
7580         ncurses.h ncurses/ncurses.h \
7581         curses.h ncurses/curses.h
7582 do
7583 cat >conftest.$ac_ext <<_ACEOF
7584 #line 7584 "configure"
7585 #include "confdefs.h"
7586 #include <${cf_header}>
7587 int
7588 main ()
7589 {
7590 initscr(); tgoto("?", 0,0)
7591   ;
7592   return 0;
7593 }
7594 _ACEOF
7595 rm -f conftest.$ac_objext
7596 if { (eval echo "$as_me:7596: \"$ac_compile\"") >&5
7597   (eval $ac_compile) 2>&5
7598   ac_status=$?
7599   echo "$as_me:7599: \$? = $ac_status" >&5
7600   (exit $ac_status); } &&
7601          { ac_try='test -s conftest.$ac_objext'
7602   { (eval echo "$as_me:7602: \"$ac_try\"") >&5
7603   (eval $ac_try) 2>&5
7604   ac_status=$?
7605   echo "$as_me:7605: \$? = $ac_status" >&5
7606   (exit $ac_status); }; }; then
7607   cf_cv_ncurses_header=$cf_header; break
7608 else
7609   echo "$as_me: failed program was:" >&5
7610 cat conftest.$ac_ext >&5
7611 fi
7612 rm -f conftest.$ac_objext conftest.$ac_ext
7613 done
7614
7615 fi
7616 echo "$as_me:7616: result: $cf_cv_ncurses_header" >&5
7617 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7618
7619 if test "$cf_cv_ncurses_header" = none ; then
7620         { { echo "$as_me:7620: error: No curses header-files found" >&5
7621 echo "$as_me: error: No curses header-files found" >&2;}
7622    { (exit 1); exit 1; }; }
7623 fi
7624
7625 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7626
7627 for ac_header in $cf_cv_ncurses_header
7628 do
7629 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7630 echo "$as_me:7630: checking for $ac_header" >&5
7631 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7632 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7633   echo $ECHO_N "(cached) $ECHO_C" >&6
7634 else
7635   cat >conftest.$ac_ext <<_ACEOF
7636 #line 7636 "configure"
7637 #include "confdefs.h"
7638 #include <$ac_header>
7639 _ACEOF
7640 if { (eval echo "$as_me:7640: \"$ac_cpp conftest.$ac_ext\"") >&5
7641   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7642   ac_status=$?
7643   egrep -v '^ *\+' conftest.er1 >conftest.err
7644   rm -f conftest.er1
7645   cat conftest.err >&5
7646   echo "$as_me:7646: \$? = $ac_status" >&5
7647   (exit $ac_status); } >/dev/null; then
7648   if test -s conftest.err; then
7649     ac_cpp_err=$ac_c_preproc_warn_flag
7650   else
7651     ac_cpp_err=
7652   fi
7653 else
7654   ac_cpp_err=yes
7655 fi
7656 if test -z "$ac_cpp_err"; then
7657   eval "$as_ac_Header=yes"
7658 else
7659   echo "$as_me: failed program was:" >&5
7660   cat conftest.$ac_ext >&5
7661   eval "$as_ac_Header=no"
7662 fi
7663 rm -f conftest.err conftest.$ac_ext
7664 fi
7665 echo "$as_me:7665: result: `eval echo '${'$as_ac_Header'}'`" >&5
7666 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7667 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7668   cat >>confdefs.h <<EOF
7669 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7670 EOF
7671
7672 fi
7673 done
7674
7675 cat >>confdefs.h <<\EOF
7676 #define NCURSES 1
7677 EOF
7678
7679 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7680
7681                 cat >>confdefs.h <<EOF
7682 #define $cf_nculib_ROOT 1
7683 EOF
7684
7685                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7686
7687         else
7688
7689 cf_ncuhdr_root=ncurses
7690
7691 test -n "$cf_cv_curses_dir" && \
7692 test "$cf_cv_curses_dir" != "no" && { \
7693
7694 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7695   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7696   do
7697         while test $cf_add_incdir != /usr/include
7698         do
7699           if test -d $cf_add_incdir
7700           then
7701                 cf_have_incdir=no
7702                 if test -n "$CFLAGS$CPPFLAGS" ; then
7703                   # a loop is needed to ensure we can add subdirs of existing dirs
7704                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7705                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7706                           cf_have_incdir=yes; break
7707                         fi
7708                   done
7709                 fi
7710
7711                 if test "$cf_have_incdir" = no ; then
7712                   if test "$cf_add_incdir" = /usr/local/include ; then
7713                         if test "$GCC" = yes
7714                         then
7715                           cf_save_CPPFLAGS=$CPPFLAGS
7716                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7717                           cat >conftest.$ac_ext <<_ACEOF
7718 #line 7718 "configure"
7719 #include "confdefs.h"
7720 #include <stdio.h>
7721 int
7722 main ()
7723 {
7724 printf("Hello")
7725   ;
7726   return 0;
7727 }
7728 _ACEOF
7729 rm -f conftest.$ac_objext
7730 if { (eval echo "$as_me:7730: \"$ac_compile\"") >&5
7731   (eval $ac_compile) 2>&5
7732   ac_status=$?
7733   echo "$as_me:7733: \$? = $ac_status" >&5
7734   (exit $ac_status); } &&
7735          { ac_try='test -s conftest.$ac_objext'
7736   { (eval echo "$as_me:7736: \"$ac_try\"") >&5
7737   (eval $ac_try) 2>&5
7738   ac_status=$?
7739   echo "$as_me:7739: \$? = $ac_status" >&5
7740   (exit $ac_status); }; }; then
7741   :
7742 else
7743   echo "$as_me: failed program was:" >&5
7744 cat conftest.$ac_ext >&5
7745 cf_have_incdir=yes
7746 fi
7747 rm -f conftest.$ac_objext conftest.$ac_ext
7748                           CPPFLAGS=$cf_save_CPPFLAGS
7749                         fi
7750                   fi
7751                 fi
7752
7753                 if test "$cf_have_incdir" = no ; then
7754                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7755
7756 echo "${as_me:-configure}:7756: testing adding $cf_add_incdir to include-path ..." 1>&5
7757
7758                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7759
7760                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7761                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7762                   cf_add_incdir="$cf_top_incdir"
7763                 else
7764                   break
7765                 fi
7766           else
7767                 break
7768           fi
7769         done
7770   done
7771 fi
7772
7773 }
7774
7775 echo "$as_me:7775: checking for $cf_ncuhdr_root header in include-path" >&5
7776 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7777 if test "${cf_cv_ncurses_h+set}" = set; then
7778   echo $ECHO_N "(cached) $ECHO_C" >&6
7779 else
7780
7781         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7782         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7783         for cf_header in $cf_header_list
7784         do
7785
7786         cat >conftest.$ac_ext <<_ACEOF
7787 #line 7787 "configure"
7788 #include "confdefs.h"
7789
7790 #include <$cf_header>
7791 int
7792 main ()
7793 {
7794
7795 #ifdef NCURSES_VERSION
7796
7797 printf("%s\n", NCURSES_VERSION);
7798 #else
7799 #ifdef __NCURSES_H
7800 printf("old\n");
7801 #else
7802         make an error
7803 #endif
7804 #endif
7805
7806   ;
7807   return 0;
7808 }
7809 _ACEOF
7810 rm -f conftest.$ac_objext
7811 if { (eval echo "$as_me:7811: \"$ac_compile\"") >&5
7812   (eval $ac_compile) 2>&5
7813   ac_status=$?
7814   echo "$as_me:7814: \$? = $ac_status" >&5
7815   (exit $ac_status); } &&
7816          { ac_try='test -s conftest.$ac_objext'
7817   { (eval echo "$as_me:7817: \"$ac_try\"") >&5
7818   (eval $ac_try) 2>&5
7819   ac_status=$?
7820   echo "$as_me:7820: \$? = $ac_status" >&5
7821   (exit $ac_status); }; }; then
7822   cf_cv_ncurses_h=$cf_header
7823
7824 else
7825   echo "$as_me: failed program was:" >&5
7826 cat conftest.$ac_ext >&5
7827 cf_cv_ncurses_h=no
7828 fi
7829 rm -f conftest.$ac_objext conftest.$ac_ext
7830
7831                 test "$cf_cv_ncurses_h" != no && break
7832         done
7833
7834 fi
7835 echo "$as_me:7835: result: $cf_cv_ncurses_h" >&5
7836 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7837
7838 if test "$cf_cv_ncurses_h" != no ; then
7839         cf_cv_ncurses_header=$cf_cv_ncurses_h
7840 else
7841
7842 echo "$as_me:7842: checking for $cf_ncuhdr_root include-path" >&5
7843 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7844 if test "${cf_cv_ncurses_h2+set}" = set; then
7845   echo $ECHO_N "(cached) $ECHO_C" >&6
7846 else
7847
7848         test -n "$verbose" && echo
7849
7850 cf_search=
7851
7852 # collect the current set of include-directories from compiler flags
7853 cf_header_path_list=""
7854 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7855         for cf_header_path in $CPPFLAGS $CFLAGS
7856         do
7857                 case $cf_header_path in
7858                 (-I*)
7859                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7860
7861 test "x$cf_header_path" != "xNONE" && \
7862 test -d "$cf_header_path" && \
7863  {
7864         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7865         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7866         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7867         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7868         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7869         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"
7870 }
7871
7872                         cf_header_path_list="$cf_header_path_list $cf_search"
7873                         ;;
7874                 esac
7875         done
7876 fi
7877
7878 # add the variations for the package we are looking for
7879
7880 cf_search=
7881
7882 test "x$prefix" != "xNONE" && \
7883 test -d "$prefix" && \
7884  {
7885         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7886         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7887         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7888         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7889         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7890         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7891 }
7892
7893 for cf_subdir_prefix in \
7894         /usr \
7895         /usr/local \
7896         /usr/pkg \
7897         /opt \
7898         /opt/local \
7899         $HOME
7900 do
7901
7902 test "x$cf_subdir_prefix" != "x$prefix" && \
7903 test -d "$cf_subdir_prefix" && \
7904 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7905         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7906         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7907         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7908         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7909         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7910         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"
7911 }
7912
7913 done
7914
7915 test "$includedir" != NONE && \
7916 test "$includedir" != "/usr/include" && \
7917 test -d "$includedir" && {
7918         test -d $includedir &&    cf_search="$cf_search $includedir"
7919         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7920 }
7921
7922 test "$oldincludedir" != NONE && \
7923 test "$oldincludedir" != "/usr/include" && \
7924 test -d "$oldincludedir" && {
7925         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7926         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7927 }
7928
7929 cf_search="$cf_search $cf_header_path_list"
7930
7931         test -n "$verbose" && echo search path $cf_search
7932         cf_save2_CPPFLAGS="$CPPFLAGS"
7933         for cf_incdir in $cf_search
7934         do
7935
7936 if test -n "$cf_incdir" ; then
7937   for cf_add_incdir in $cf_incdir
7938   do
7939         while test $cf_add_incdir != /usr/include
7940         do
7941           if test -d $cf_add_incdir
7942           then
7943                 cf_have_incdir=no
7944                 if test -n "$CFLAGS$CPPFLAGS" ; then
7945                   # a loop is needed to ensure we can add subdirs of existing dirs
7946                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7947                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7948                           cf_have_incdir=yes; break
7949                         fi
7950                   done
7951                 fi
7952
7953                 if test "$cf_have_incdir" = no ; then
7954                   if test "$cf_add_incdir" = /usr/local/include ; then
7955                         if test "$GCC" = yes
7956                         then
7957                           cf_save_CPPFLAGS=$CPPFLAGS
7958                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7959                           cat >conftest.$ac_ext <<_ACEOF
7960 #line 7960 "configure"
7961 #include "confdefs.h"
7962 #include <stdio.h>
7963 int
7964 main ()
7965 {
7966 printf("Hello")
7967   ;
7968   return 0;
7969 }
7970 _ACEOF
7971 rm -f conftest.$ac_objext
7972 if { (eval echo "$as_me:7972: \"$ac_compile\"") >&5
7973   (eval $ac_compile) 2>&5
7974   ac_status=$?
7975   echo "$as_me:7975: \$? = $ac_status" >&5
7976   (exit $ac_status); } &&
7977          { ac_try='test -s conftest.$ac_objext'
7978   { (eval echo "$as_me:7978: \"$ac_try\"") >&5
7979   (eval $ac_try) 2>&5
7980   ac_status=$?
7981   echo "$as_me:7981: \$? = $ac_status" >&5
7982   (exit $ac_status); }; }; then
7983   :
7984 else
7985   echo "$as_me: failed program was:" >&5
7986 cat conftest.$ac_ext >&5
7987 cf_have_incdir=yes
7988 fi
7989 rm -f conftest.$ac_objext conftest.$ac_ext
7990                           CPPFLAGS=$cf_save_CPPFLAGS
7991                         fi
7992                   fi
7993                 fi
7994
7995                 if test "$cf_have_incdir" = no ; then
7996                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7997
7998 echo "${as_me:-configure}:7998: testing adding $cf_add_incdir to include-path ..." 1>&5
7999
8000                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8001
8002                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8003                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8004                   cf_add_incdir="$cf_top_incdir"
8005                 else
8006                   break
8007                 fi
8008           else
8009                 break
8010           fi
8011         done
8012   done
8013 fi
8014
8015                 for cf_header in \
8016                         ncurses.h \
8017                         curses.h
8018                 do
8019
8020         cat >conftest.$ac_ext <<_ACEOF
8021 #line 8021 "configure"
8022 #include "confdefs.h"
8023
8024 #include <$cf_header>
8025 int
8026 main ()
8027 {
8028
8029 #ifdef NCURSES_VERSION
8030
8031 printf("%s\n", NCURSES_VERSION);
8032 #else
8033 #ifdef __NCURSES_H
8034 printf("old\n");
8035 #else
8036         make an error
8037 #endif
8038 #endif
8039
8040   ;
8041   return 0;
8042 }
8043 _ACEOF
8044 rm -f conftest.$ac_objext
8045 if { (eval echo "$as_me:8045: \"$ac_compile\"") >&5
8046   (eval $ac_compile) 2>&5
8047   ac_status=$?
8048   echo "$as_me:8048: \$? = $ac_status" >&5
8049   (exit $ac_status); } &&
8050          { ac_try='test -s conftest.$ac_objext'
8051   { (eval echo "$as_me:8051: \"$ac_try\"") >&5
8052   (eval $ac_try) 2>&5
8053   ac_status=$?
8054   echo "$as_me:8054: \$? = $ac_status" >&5
8055   (exit $ac_status); }; }; then
8056   cf_cv_ncurses_h2=$cf_header
8057
8058 else
8059   echo "$as_me: failed program was:" >&5
8060 cat conftest.$ac_ext >&5
8061 cf_cv_ncurses_h2=no
8062 fi
8063 rm -f conftest.$ac_objext conftest.$ac_ext
8064
8065                         if test "$cf_cv_ncurses_h2" != no ; then
8066                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8067                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8068                                 break
8069                         fi
8070                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8071                 done
8072                 CPPFLAGS="$cf_save2_CPPFLAGS"
8073                 test "$cf_cv_ncurses_h2" != no && break
8074         done
8075         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8075: error: not found" >&5
8076 echo "$as_me: error: not found" >&2;}
8077    { (exit 1); exit 1; }; }
8078
8079 fi
8080 echo "$as_me:8080: result: $cf_cv_ncurses_h2" >&5
8081 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8082
8083         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8084         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8085         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8086                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8087         fi
8088
8089 if test -n "$cf_1st_incdir" ; then
8090   for cf_add_incdir in $cf_1st_incdir
8091   do
8092         while test $cf_add_incdir != /usr/include
8093         do
8094           if test -d $cf_add_incdir
8095           then
8096                 cf_have_incdir=no
8097                 if test -n "$CFLAGS$CPPFLAGS" ; then
8098                   # a loop is needed to ensure we can add subdirs of existing dirs
8099                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8100                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8101                           cf_have_incdir=yes; break
8102                         fi
8103                   done
8104                 fi
8105
8106                 if test "$cf_have_incdir" = no ; then
8107                   if test "$cf_add_incdir" = /usr/local/include ; then
8108                         if test "$GCC" = yes
8109                         then
8110                           cf_save_CPPFLAGS=$CPPFLAGS
8111                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8112                           cat >conftest.$ac_ext <<_ACEOF
8113 #line 8113 "configure"
8114 #include "confdefs.h"
8115 #include <stdio.h>
8116 int
8117 main ()
8118 {
8119 printf("Hello")
8120   ;
8121   return 0;
8122 }
8123 _ACEOF
8124 rm -f conftest.$ac_objext
8125 if { (eval echo "$as_me:8125: \"$ac_compile\"") >&5
8126   (eval $ac_compile) 2>&5
8127   ac_status=$?
8128   echo "$as_me:8128: \$? = $ac_status" >&5
8129   (exit $ac_status); } &&
8130          { ac_try='test -s conftest.$ac_objext'
8131   { (eval echo "$as_me:8131: \"$ac_try\"") >&5
8132   (eval $ac_try) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); }; }; then
8136   :
8137 else
8138   echo "$as_me: failed program was:" >&5
8139 cat conftest.$ac_ext >&5
8140 cf_have_incdir=yes
8141 fi
8142 rm -f conftest.$ac_objext conftest.$ac_ext
8143                           CPPFLAGS=$cf_save_CPPFLAGS
8144                         fi
8145                   fi
8146                 fi
8147
8148                 if test "$cf_have_incdir" = no ; then
8149                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8150
8151 echo "${as_me:-configure}:8151: testing adding $cf_add_incdir to include-path ..." 1>&5
8152
8153                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8154
8155                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8156                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8157                   cf_add_incdir="$cf_top_incdir"
8158                 else
8159                   break
8160                 fi
8161           else
8162                 break
8163           fi
8164         done
8165   done
8166 fi
8167
8168 fi
8169
8170 # Set definitions to allow ifdef'ing for ncurses.h
8171
8172 case $cf_cv_ncurses_header in
8173 (*ncurses.h)
8174
8175 cat >>confdefs.h <<\EOF
8176 #define HAVE_NCURSES_H 1
8177 EOF
8178
8179         ;;
8180 esac
8181
8182 case $cf_cv_ncurses_header in
8183 (ncurses/curses.h|ncurses/ncurses.h)
8184
8185 cat >>confdefs.h <<\EOF
8186 #define HAVE_NCURSES_NCURSES_H 1
8187 EOF
8188
8189         ;;
8190 (ncursesw/curses.h|ncursesw/ncurses.h)
8191
8192 cat >>confdefs.h <<\EOF
8193 #define HAVE_NCURSESW_NCURSES_H 1
8194 EOF
8195
8196         ;;
8197 esac
8198
8199 echo "$as_me:8199: checking for terminfo header" >&5
8200 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8201 if test "${cf_cv_term_header+set}" = set; then
8202   echo $ECHO_N "(cached) $ECHO_C" >&6
8203 else
8204
8205 case ${cf_cv_ncurses_header} in
8206 (*/ncurses.h|*/ncursesw.h)
8207         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8208         ;;
8209 (*)
8210         cf_term_header=term.h
8211         ;;
8212 esac
8213
8214 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8215 do
8216 cat >conftest.$ac_ext <<_ACEOF
8217 #line 8217 "configure"
8218 #include "confdefs.h"
8219 #include <stdio.h>
8220 #include <${cf_cv_ncurses_header:-curses.h}>
8221 #include <$cf_test>
8222
8223 int
8224 main ()
8225 {
8226 int x = auto_left_margin
8227   ;
8228   return 0;
8229 }
8230 _ACEOF
8231 rm -f conftest.$ac_objext
8232 if { (eval echo "$as_me:8232: \"$ac_compile\"") >&5
8233   (eval $ac_compile) 2>&5
8234   ac_status=$?
8235   echo "$as_me:8235: \$? = $ac_status" >&5
8236   (exit $ac_status); } &&
8237          { ac_try='test -s conftest.$ac_objext'
8238   { (eval echo "$as_me:8238: \"$ac_try\"") >&5
8239   (eval $ac_try) 2>&5
8240   ac_status=$?
8241   echo "$as_me:8241: \$? = $ac_status" >&5
8242   (exit $ac_status); }; }; then
8243
8244         cf_cv_term_header="$cf_test"
8245 else
8246   echo "$as_me: failed program was:" >&5
8247 cat conftest.$ac_ext >&5
8248
8249         cf_cv_term_header=unknown
8250
8251 fi
8252 rm -f conftest.$ac_objext conftest.$ac_ext
8253         test "$cf_cv_term_header" != unknown && break
8254 done
8255
8256 fi
8257 echo "$as_me:8257: result: $cf_cv_term_header" >&5
8258 echo "${ECHO_T}$cf_cv_term_header" >&6
8259
8260 # Set definitions to allow ifdef'ing to accommodate subdirectories
8261
8262 case $cf_cv_term_header in
8263 (*term.h)
8264
8265 cat >>confdefs.h <<\EOF
8266 #define HAVE_TERM_H 1
8267 EOF
8268
8269         ;;
8270 esac
8271
8272 case $cf_cv_term_header in
8273 (ncurses/term.h)
8274
8275 cat >>confdefs.h <<\EOF
8276 #define HAVE_NCURSES_TERM_H 1
8277 EOF
8278
8279         ;;
8280 (ncursesw/term.h)
8281
8282 cat >>confdefs.h <<\EOF
8283 #define HAVE_NCURSESW_TERM_H 1
8284 EOF
8285
8286         ;;
8287 esac
8288
8289 # some applications need this, but should check for NCURSES_VERSION
8290
8291 cat >>confdefs.h <<\EOF
8292 #define NCURSES 1
8293 EOF
8294
8295 echo "$as_me:8295: checking for ncurses version" >&5
8296 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8297 if test "${cf_cv_ncurses_version+set}" = set; then
8298   echo $ECHO_N "(cached) $ECHO_C" >&6
8299 else
8300
8301         cf_cv_ncurses_version=no
8302         cf_tempfile=out$$
8303         rm -f $cf_tempfile
8304         if test "$cross_compiling" = yes; then
8305
8306         # This will not work if the preprocessor splits the line after the
8307         # Autoconf token.  The 'unproto' program does that.
8308         cat > conftest.$ac_ext <<EOF
8309 #include <${cf_cv_ncurses_header:-curses.h}>
8310 #undef Autoconf
8311 #ifdef NCURSES_VERSION
8312 Autoconf NCURSES_VERSION
8313 #else
8314 #ifdef __NCURSES_H
8315 Autoconf "old"
8316 #endif
8317 ;
8318 #endif
8319 EOF
8320         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8321         { (eval echo "$as_me:8321: \"$cf_try\"") >&5
8322   (eval $cf_try) 2>&5
8323   ac_status=$?
8324   echo "$as_me:8324: \$? = $ac_status" >&5
8325   (exit $ac_status); }
8326         if test -f conftest.out ; then
8327                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8328                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8329                 rm -f conftest.out
8330         fi
8331
8332 else
8333   cat >conftest.$ac_ext <<_ACEOF
8334 #line 8334 "configure"
8335 #include "confdefs.h"
8336
8337 #include <${cf_cv_ncurses_header:-curses.h}>
8338 #include <stdio.h>
8339 int main()
8340 {
8341         FILE *fp = fopen("$cf_tempfile", "w");
8342 #ifdef NCURSES_VERSION
8343 # ifdef NCURSES_VERSION_PATCH
8344         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8345 # else
8346         fprintf(fp, "%s\n", NCURSES_VERSION);
8347 # endif
8348 #else
8349 # ifdef __NCURSES_H
8350         fprintf(fp, "old\n");
8351 # else
8352         make an error
8353 # endif
8354 #endif
8355         ${cf_cv_main_return:-return}(0);
8356 }
8357 _ACEOF
8358 rm -f conftest$ac_exeext
8359 if { (eval echo "$as_me:8359: \"$ac_link\"") >&5
8360   (eval $ac_link) 2>&5
8361   ac_status=$?
8362   echo "$as_me:8362: \$? = $ac_status" >&5
8363   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8364   { (eval echo "$as_me:8364: \"$ac_try\"") >&5
8365   (eval $ac_try) 2>&5
8366   ac_status=$?
8367   echo "$as_me:8367: \$? = $ac_status" >&5
8368   (exit $ac_status); }; }; then
8369
8370         cf_cv_ncurses_version=`cat $cf_tempfile`
8371 else
8372   echo "$as_me: program exited with status $ac_status" >&5
8373 echo "$as_me: failed program was:" >&5
8374 cat conftest.$ac_ext >&5
8375 fi
8376 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8377 fi
8378         rm -f $cf_tempfile
8379
8380 fi
8381 echo "$as_me:8381: result: $cf_cv_ncurses_version" >&5
8382 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8383 test "$cf_cv_ncurses_version" = no ||
8384 cat >>confdefs.h <<\EOF
8385 #define NCURSES 1
8386 EOF
8387
8388 cf_nculib_root=ncurses
8389         # This works, except for the special case where we find gpm, but
8390         # ncurses is in a nonstandard location via $LIBS, and we really want
8391         # to link gpm.
8392 cf_ncurses_LIBS=""
8393 cf_ncurses_SAVE="$LIBS"
8394 echo "$as_me:8394: checking for Gpm_Open in -lgpm" >&5
8395 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8396 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8397   echo $ECHO_N "(cached) $ECHO_C" >&6
8398 else
8399   ac_check_lib_save_LIBS=$LIBS
8400 LIBS="-lgpm  $LIBS"
8401 cat >conftest.$ac_ext <<_ACEOF
8402 #line 8402 "configure"
8403 #include "confdefs.h"
8404
8405 /* Override any gcc2 internal prototype to avoid an error.  */
8406 #ifdef __cplusplus
8407 extern "C"
8408 #endif
8409 /* We use char because int might match the return type of a gcc2
8410    builtin and then its argument prototype would still apply.  */
8411 char Gpm_Open ();
8412 int
8413 main ()
8414 {
8415 Gpm_Open ();
8416   ;
8417   return 0;
8418 }
8419 _ACEOF
8420 rm -f conftest.$ac_objext conftest$ac_exeext
8421 if { (eval echo "$as_me:8421: \"$ac_link\"") >&5
8422   (eval $ac_link) 2>&5
8423   ac_status=$?
8424   echo "$as_me:8424: \$? = $ac_status" >&5
8425   (exit $ac_status); } &&
8426          { ac_try='test -s conftest$ac_exeext'
8427   { (eval echo "$as_me:8427: \"$ac_try\"") >&5
8428   (eval $ac_try) 2>&5
8429   ac_status=$?
8430   echo "$as_me:8430: \$? = $ac_status" >&5
8431   (exit $ac_status); }; }; then
8432   ac_cv_lib_gpm_Gpm_Open=yes
8433 else
8434   echo "$as_me: failed program was:" >&5
8435 cat conftest.$ac_ext >&5
8436 ac_cv_lib_gpm_Gpm_Open=no
8437 fi
8438 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8439 LIBS=$ac_check_lib_save_LIBS
8440 fi
8441 echo "$as_me:8441: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8442 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8443 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8444   echo "$as_me:8444: checking for initscr in -lgpm" >&5
8445 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8446 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8447   echo $ECHO_N "(cached) $ECHO_C" >&6
8448 else
8449   ac_check_lib_save_LIBS=$LIBS
8450 LIBS="-lgpm  $LIBS"
8451 cat >conftest.$ac_ext <<_ACEOF
8452 #line 8452 "configure"
8453 #include "confdefs.h"
8454
8455 /* Override any gcc2 internal prototype to avoid an error.  */
8456 #ifdef __cplusplus
8457 extern "C"
8458 #endif
8459 /* We use char because int might match the return type of a gcc2
8460    builtin and then its argument prototype would still apply.  */
8461 char initscr ();
8462 int
8463 main ()
8464 {
8465 initscr ();
8466   ;
8467   return 0;
8468 }
8469 _ACEOF
8470 rm -f conftest.$ac_objext conftest$ac_exeext
8471 if { (eval echo "$as_me:8471: \"$ac_link\"") >&5
8472   (eval $ac_link) 2>&5
8473   ac_status=$?
8474   echo "$as_me:8474: \$? = $ac_status" >&5
8475   (exit $ac_status); } &&
8476          { ac_try='test -s conftest$ac_exeext'
8477   { (eval echo "$as_me:8477: \"$ac_try\"") >&5
8478   (eval $ac_try) 2>&5
8479   ac_status=$?
8480   echo "$as_me:8480: \$? = $ac_status" >&5
8481   (exit $ac_status); }; }; then
8482   ac_cv_lib_gpm_initscr=yes
8483 else
8484   echo "$as_me: failed program was:" >&5
8485 cat conftest.$ac_ext >&5
8486 ac_cv_lib_gpm_initscr=no
8487 fi
8488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8489 LIBS=$ac_check_lib_save_LIBS
8490 fi
8491 echo "$as_me:8491: result: $ac_cv_lib_gpm_initscr" >&5
8492 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8493 if test $ac_cv_lib_gpm_initscr = yes; then
8494   LIBS="$cf_ncurses_SAVE"
8495 else
8496   cf_ncurses_LIBS="-lgpm"
8497 fi
8498
8499 fi
8500
8501 case $host_os in
8502 (freebsd*)
8503         # This is only necessary if you are linking against an obsolete
8504         # version of ncurses (but it should do no harm, since it's static).
8505         if test "$cf_nculib_root" = ncurses ; then
8506                 echo "$as_me:8506: checking for tgoto in -lmytinfo" >&5
8507 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8508 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8509   echo $ECHO_N "(cached) $ECHO_C" >&6
8510 else
8511   ac_check_lib_save_LIBS=$LIBS
8512 LIBS="-lmytinfo  $LIBS"
8513 cat >conftest.$ac_ext <<_ACEOF
8514 #line 8514 "configure"
8515 #include "confdefs.h"
8516
8517 /* Override any gcc2 internal prototype to avoid an error.  */
8518 #ifdef __cplusplus
8519 extern "C"
8520 #endif
8521 /* We use char because int might match the return type of a gcc2
8522    builtin and then its argument prototype would still apply.  */
8523 char tgoto ();
8524 int
8525 main ()
8526 {
8527 tgoto ();
8528   ;
8529   return 0;
8530 }
8531 _ACEOF
8532 rm -f conftest.$ac_objext conftest$ac_exeext
8533 if { (eval echo "$as_me:8533: \"$ac_link\"") >&5
8534   (eval $ac_link) 2>&5
8535   ac_status=$?
8536   echo "$as_me:8536: \$? = $ac_status" >&5
8537   (exit $ac_status); } &&
8538          { ac_try='test -s conftest$ac_exeext'
8539   { (eval echo "$as_me:8539: \"$ac_try\"") >&5
8540   (eval $ac_try) 2>&5
8541   ac_status=$?
8542   echo "$as_me:8542: \$? = $ac_status" >&5
8543   (exit $ac_status); }; }; then
8544   ac_cv_lib_mytinfo_tgoto=yes
8545 else
8546   echo "$as_me: failed program was:" >&5
8547 cat conftest.$ac_ext >&5
8548 ac_cv_lib_mytinfo_tgoto=no
8549 fi
8550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8551 LIBS=$ac_check_lib_save_LIBS
8552 fi
8553 echo "$as_me:8553: result: $ac_cv_lib_mytinfo_tgoto" >&5
8554 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8555 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8556   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8557 fi
8558
8559         fi
8560         ;;
8561 esac
8562
8563 cf_add_libs="$cf_ncurses_LIBS"
8564 # Filter out duplicates - this happens with badly-designed ".pc" files...
8565 for cf_add_1lib in $LIBS
8566 do
8567         for cf_add_2lib in $cf_add_libs
8568         do
8569                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8570                 then
8571                         cf_add_1lib=
8572                         break
8573                 fi
8574         done
8575         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8576 done
8577 LIBS="$cf_add_libs"
8578
8579 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8580 then
8581
8582 cf_add_libs="-l$cf_nculib_root"
8583 # Filter out duplicates - this happens with badly-designed ".pc" files...
8584 for cf_add_1lib in $LIBS
8585 do
8586         for cf_add_2lib in $cf_add_libs
8587         do
8588                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8589                 then
8590                         cf_add_1lib=
8591                         break
8592                 fi
8593         done
8594         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8595 done
8596 LIBS="$cf_add_libs"
8597
8598 else
8599
8600         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8601         cf_libdir=""
8602         echo "$as_me:8602: checking for initscr" >&5
8603 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8604 if test "${ac_cv_func_initscr+set}" = set; then
8605   echo $ECHO_N "(cached) $ECHO_C" >&6
8606 else
8607   cat >conftest.$ac_ext <<_ACEOF
8608 #line 8608 "configure"
8609 #include "confdefs.h"
8610 /* System header to define __stub macros and hopefully few prototypes,
8611     which can conflict with char initscr (); below.  */
8612 #include <assert.h>
8613 /* Override any gcc2 internal prototype to avoid an error.  */
8614 #ifdef __cplusplus
8615 extern "C"
8616 #endif
8617 /* We use char because int might match the return type of a gcc2
8618    builtin and then its argument prototype would still apply.  */
8619 char initscr ();
8620 char (*f) ();
8621
8622 int
8623 main ()
8624 {
8625 /* The GNU C library defines this for functions which it implements
8626     to always fail with ENOSYS.  Some functions are actually named
8627     something starting with __ and the normal name is an alias.  */
8628 #if defined (__stub_initscr) || defined (__stub___initscr)
8629 choke me
8630 #else
8631 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8632 #endif
8633
8634   ;
8635   return 0;
8636 }
8637 _ACEOF
8638 rm -f conftest.$ac_objext conftest$ac_exeext
8639 if { (eval echo "$as_me:8639: \"$ac_link\"") >&5
8640   (eval $ac_link) 2>&5
8641   ac_status=$?
8642   echo "$as_me:8642: \$? = $ac_status" >&5
8643   (exit $ac_status); } &&
8644          { ac_try='test -s conftest$ac_exeext'
8645   { (eval echo "$as_me:8645: \"$ac_try\"") >&5
8646   (eval $ac_try) 2>&5
8647   ac_status=$?
8648   echo "$as_me:8648: \$? = $ac_status" >&5
8649   (exit $ac_status); }; }; then
8650   ac_cv_func_initscr=yes
8651 else
8652   echo "$as_me: failed program was:" >&5
8653 cat conftest.$ac_ext >&5
8654 ac_cv_func_initscr=no
8655 fi
8656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8657 fi
8658 echo "$as_me:8658: result: $ac_cv_func_initscr" >&5
8659 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8660 if test $ac_cv_func_initscr = yes; then
8661   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8662 else
8663
8664                 cf_save_LIBS="$LIBS"
8665                 echo "$as_me:8665: checking for initscr in -l$cf_nculib_root" >&5
8666 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8667                 LIBS="-l$cf_nculib_root $LIBS"
8668                 cat >conftest.$ac_ext <<_ACEOF
8669 #line 8669 "configure"
8670 #include "confdefs.h"
8671 #include <${cf_cv_ncurses_header:-curses.h}>
8672 int
8673 main ()
8674 {
8675 initscr()
8676   ;
8677   return 0;
8678 }
8679 _ACEOF
8680 rm -f conftest.$ac_objext conftest$ac_exeext
8681 if { (eval echo "$as_me:8681: \"$ac_link\"") >&5
8682   (eval $ac_link) 2>&5
8683   ac_status=$?
8684   echo "$as_me:8684: \$? = $ac_status" >&5
8685   (exit $ac_status); } &&
8686          { ac_try='test -s conftest$ac_exeext'
8687   { (eval echo "$as_me:8687: \"$ac_try\"") >&5
8688   (eval $ac_try) 2>&5
8689   ac_status=$?
8690   echo "$as_me:8690: \$? = $ac_status" >&5
8691   (exit $ac_status); }; }; then
8692   echo "$as_me:8692: result: yes" >&5
8693 echo "${ECHO_T}yes" >&6
8694                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8695
8696 else
8697   echo "$as_me: failed program was:" >&5
8698 cat conftest.$ac_ext >&5
8699 echo "$as_me:8699: result: no" >&5
8700 echo "${ECHO_T}no" >&6
8701
8702 cf_search=
8703 cf_library_path_list=""
8704 if test -n "${LDFLAGS}${LIBS}" ; then
8705         for cf_library_path in $LDFLAGS $LIBS
8706         do
8707                 case $cf_library_path in
8708                 (-L*)
8709                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8710
8711 test "x$cf_library_path" != "xNONE" && \
8712 test -d "$cf_library_path" && \
8713  {
8714         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8715         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8716         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8717         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8718         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8719         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"
8720 }
8721
8722                         cf_library_path_list="$cf_library_path_list $cf_search"
8723                         ;;
8724                 esac
8725         done
8726 fi
8727
8728 cf_search=
8729
8730 test "x$prefix" != "xNONE" && \
8731 test -d "$prefix" && \
8732  {
8733         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8734         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8735         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8736         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8737         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8738         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8739 }
8740
8741 for cf_subdir_prefix in \
8742         /usr \
8743         /usr/local \
8744         /usr/pkg \
8745         /opt \
8746         /opt/local \
8747         $HOME
8748 do
8749
8750 test "x$cf_subdir_prefix" != "x$prefix" && \
8751 test -d "$cf_subdir_prefix" && \
8752 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8753         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8754         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8755         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8756         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8757         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8758         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"
8759 }
8760
8761 done
8762
8763 cf_search="$cf_library_path_list $cf_search"
8764
8765                         for cf_libdir in $cf_search
8766                         do
8767                                 echo "$as_me:8767: checking for -l$cf_nculib_root in $cf_libdir" >&5
8768 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8769                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8770                                 cat >conftest.$ac_ext <<_ACEOF
8771 #line 8771 "configure"
8772 #include "confdefs.h"
8773 #include <${cf_cv_ncurses_header:-curses.h}>
8774 int
8775 main ()
8776 {
8777 initscr()
8778   ;
8779   return 0;
8780 }
8781 _ACEOF
8782 rm -f conftest.$ac_objext conftest$ac_exeext
8783 if { (eval echo "$as_me:8783: \"$ac_link\"") >&5
8784   (eval $ac_link) 2>&5
8785   ac_status=$?
8786   echo "$as_me:8786: \$? = $ac_status" >&5
8787   (exit $ac_status); } &&
8788          { ac_try='test -s conftest$ac_exeext'
8789   { (eval echo "$as_me:8789: \"$ac_try\"") >&5
8790   (eval $ac_try) 2>&5
8791   ac_status=$?
8792   echo "$as_me:8792: \$? = $ac_status" >&5
8793   (exit $ac_status); }; }; then
8794   echo "$as_me:8794: result: yes" >&5
8795 echo "${ECHO_T}yes" >&6
8796                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8797                                          break
8798 else
8799   echo "$as_me: failed program was:" >&5
8800 cat conftest.$ac_ext >&5
8801 echo "$as_me:8801: result: no" >&5
8802 echo "${ECHO_T}no" >&6
8803                                          LIBS="$cf_save_LIBS"
8804 fi
8805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8806                         done
8807
8808 fi
8809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8810
8811 fi
8812
8813 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8814
8815 if test $cf_found_library = no ; then
8816         { { echo "$as_me:8816: error: Cannot link $cf_nculib_root library" >&5
8817 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8818    { (exit 1); exit 1; }; }
8819 fi
8820
8821 fi
8822
8823 if test -n "$cf_ncurses_LIBS" ; then
8824         echo "$as_me:8824: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8825 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8826         cf_ncurses_SAVE="$LIBS"
8827         for p in $cf_ncurses_LIBS ; do
8828                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8829                 if test "$q" != "$LIBS" ; then
8830                         LIBS="$q"
8831                 fi
8832         done
8833         cat >conftest.$ac_ext <<_ACEOF
8834 #line 8834 "configure"
8835 #include "confdefs.h"
8836 #include <${cf_cv_ncurses_header:-curses.h}>
8837 int
8838 main ()
8839 {
8840 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8841   ;
8842   return 0;
8843 }
8844 _ACEOF
8845 rm -f conftest.$ac_objext conftest$ac_exeext
8846 if { (eval echo "$as_me:8846: \"$ac_link\"") >&5
8847   (eval $ac_link) 2>&5
8848   ac_status=$?
8849   echo "$as_me:8849: \$? = $ac_status" >&5
8850   (exit $ac_status); } &&
8851          { ac_try='test -s conftest$ac_exeext'
8852   { (eval echo "$as_me:8852: \"$ac_try\"") >&5
8853   (eval $ac_try) 2>&5
8854   ac_status=$?
8855   echo "$as_me:8855: \$? = $ac_status" >&5
8856   (exit $ac_status); }; }; then
8857   echo "$as_me:8857: result: yes" >&5
8858 echo "${ECHO_T}yes" >&6
8859 else
8860   echo "$as_me: failed program was:" >&5
8861 cat conftest.$ac_ext >&5
8862 echo "$as_me:8862: result: no" >&5
8863 echo "${ECHO_T}no" >&6
8864                  LIBS="$cf_ncurses_SAVE"
8865 fi
8866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8867 fi
8868
8869 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8870
8871 cat >>confdefs.h <<EOF
8872 #define $cf_nculib_ROOT 1
8873 EOF
8874
8875         fi
8876 else
8877         NCURSES_CONFIG=none
8878 fi
8879
8880 fi
8881
8882 if test "$NCURSES_CONFIG_PKG" != none ; then
8883         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8884
8885         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8886         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8887         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8888
8889         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8890         if test -z "$cf_cv_abi_version"
8891         then
8892                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8893         fi
8894
8895 elif test "$NCURSES_CONFIG" != none ; then
8896
8897         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8898
8899         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8900         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8901         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8902
8903         # ABI version is not available from headers
8904         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8905
8906 else
8907
8908         for cf_name in MAJOR MINOR PATCH
8909         do
8910         cat >conftest.$ac_ext <<CF_EOF
8911         #include <${cf_cv_ncurses_header:-curses.h}>
8912         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8913 CF_EOF
8914                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8915                 { (eval echo "$as_me:8915: \"$cf_try\"") >&5
8916   (eval $cf_try) 2>&5
8917   ac_status=$?
8918   echo "$as_me:8918: \$? = $ac_status" >&5
8919   (exit $ac_status); }
8920                 if test -f conftest.out ; then
8921                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8922                         eval NCURSES_$cf_name=\"$cf_result\"
8923                         # cat conftest.$ac_ext
8924                         # cat conftest.out
8925                 fi
8926         done
8927
8928         cf_cv_abi_version=${NCURSES_MAJOR}
8929
8930 fi
8931
8932 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8933
8934 cf_cv_timestamp=`date`
8935
8936 echo "$as_me:8936: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8937 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8938
8939 echo "$as_me:8939: checking if you want to have a library-prefix" >&5
8940 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8941
8942 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8943 if test "${with_lib_prefix+set}" = set; then
8944   withval="$with_lib_prefix"
8945   with_lib_prefix=$withval
8946 else
8947   with_lib_prefix=auto
8948 fi;
8949 echo "$as_me:8949: result: $with_lib_prefix" >&5
8950 echo "${ECHO_T}$with_lib_prefix" >&6
8951
8952 if test $with_lib_prefix = auto
8953 then
8954
8955         case $cf_cv_system_name in
8956         (OS/2*|os2*)
8957                 if test "$DFT_LWR_MODEL" = libtool; then
8958                         LIB_PREFIX='lib'
8959                 else
8960                         LIB_PREFIX=''
8961                 fi
8962                 ;;
8963         (*)     LIB_PREFIX='lib'
8964                 ;;
8965         esac
8966 cf_prefix=$LIB_PREFIX
8967
8968 elif test $with_lib_prefix = no
8969 then
8970         LIB_PREFIX=
8971 else
8972         LIB_PREFIX=$with_lib_prefix
8973 fi
8974
8975 LIB_SUFFIX=
8976
8977 ###############################################################################
8978
8979 if test X"$CC_G_OPT" = X"" ; then
8980         CC_G_OPT='-g'
8981         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8982 fi
8983
8984 echo "$as_me:8984: checking for default loader flags" >&5
8985 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8986 case $DFT_LWR_MODEL in
8987 (normal)  LD_MODEL=''   ;;
8988 (debug)   LD_MODEL=$CC_G_OPT ;;
8989 (profile) LD_MODEL='-pg';;
8990 (shared)  LD_MODEL=''   ;;
8991 esac
8992 echo "$as_me:8992: result: $LD_MODEL" >&5
8993 echo "${ECHO_T}$LD_MODEL" >&6
8994
8995 LD_RPATH_OPT=
8996 echo "$as_me:8996: checking for an rpath option" >&5
8997 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
8998 case $cf_cv_system_name in
8999 (irix*)
9000         if test "$GCC" = yes; then
9001                 LD_RPATH_OPT="-Wl,-rpath,"
9002         else
9003                 LD_RPATH_OPT="-rpath "
9004         fi
9005         ;;
9006 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9007         LD_RPATH_OPT="-Wl,-rpath,"
9008         ;;
9009 (openbsd[2-9].*|mirbsd*)
9010         LD_RPATH_OPT="-Wl,-rpath,"
9011         ;;
9012 (dragonfly*)
9013         LD_RPATH_OPT="-rpath "
9014         ;;
9015 (netbsd*)
9016         LD_RPATH_OPT="-Wl,-rpath,"
9017         ;;
9018 (osf*|mls+*)
9019         LD_RPATH_OPT="-rpath "
9020         ;;
9021 (solaris2*)
9022         LD_RPATH_OPT="-R"
9023         ;;
9024 (*)
9025         ;;
9026 esac
9027 echo "$as_me:9027: result: $LD_RPATH_OPT" >&5
9028 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9029
9030 case "x$LD_RPATH_OPT" in
9031 (x-R*)
9032         echo "$as_me:9032: checking if we need a space after rpath option" >&5
9033 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9034         cf_save_LIBS="$LIBS"
9035
9036 cf_add_libs="${LD_RPATH_OPT}$libdir"
9037 # Filter out duplicates - this happens with badly-designed ".pc" files...
9038 for cf_add_1lib in $LIBS
9039 do
9040         for cf_add_2lib in $cf_add_libs
9041         do
9042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9043                 then
9044                         cf_add_1lib=
9045                         break
9046                 fi
9047         done
9048         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9049 done
9050 LIBS="$cf_add_libs"
9051
9052         cat >conftest.$ac_ext <<_ACEOF
9053 #line 9053 "configure"
9054 #include "confdefs.h"
9055
9056 int
9057 main ()
9058 {
9059
9060   ;
9061   return 0;
9062 }
9063 _ACEOF
9064 rm -f conftest.$ac_objext conftest$ac_exeext
9065 if { (eval echo "$as_me:9065: \"$ac_link\"") >&5
9066   (eval $ac_link) 2>&5
9067   ac_status=$?
9068   echo "$as_me:9068: \$? = $ac_status" >&5
9069   (exit $ac_status); } &&
9070          { ac_try='test -s conftest$ac_exeext'
9071   { (eval echo "$as_me:9071: \"$ac_try\"") >&5
9072   (eval $ac_try) 2>&5
9073   ac_status=$?
9074   echo "$as_me:9074: \$? = $ac_status" >&5
9075   (exit $ac_status); }; }; then
9076   cf_rpath_space=no
9077 else
9078   echo "$as_me: failed program was:" >&5
9079 cat conftest.$ac_ext >&5
9080 cf_rpath_space=yes
9081 fi
9082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9083         LIBS="$cf_save_LIBS"
9084         echo "$as_me:9084: result: $cf_rpath_space" >&5
9085 echo "${ECHO_T}$cf_rpath_space" >&6
9086         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9087         ;;
9088 esac
9089
9090         RM_SHARED_OPTS=
9091         LOCAL_LDFLAGS=
9092         LOCAL_LDFLAGS2=
9093         LD_SHARED_OPTS=
9094         INSTALL_LIB="-m 644"
9095         : ${rel_builddir:=.}
9096
9097         shlibdir=$libdir
9098
9099         MAKE_DLLS="#"
9100
9101         cf_cv_do_symlinks=no
9102         cf_ld_rpath_opt=
9103         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9104
9105         echo "$as_me:9105: checking if release/abi version should be used for shared libs" >&5
9106 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9107
9108 # Check whether --with-shlib-version or --without-shlib-version was given.
9109 if test "${with_shlib_version+set}" = set; then
9110   withval="$with_shlib_version"
9111   test -z "$withval" && withval=auto
9112         case $withval in
9113         (yes)
9114                 cf_cv_shlib_version=auto
9115                 ;;
9116         (rel|abi|auto)
9117                 cf_cv_shlib_version=$withval
9118                 ;;
9119         (*)
9120                 echo "$as_me:9120: result: $withval" >&5
9121 echo "${ECHO_T}$withval" >&6
9122                 { { echo "$as_me:9122: error: option value must be one of: rel, abi, or auto" >&5
9123 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9124    { (exit 1); exit 1; }; }
9125                 ;;
9126         esac
9127
9128 else
9129   cf_cv_shlib_version=auto
9130 fi;
9131         echo "$as_me:9131: result: $cf_cv_shlib_version" >&5
9132 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9133
9134         cf_cv_rm_so_locs=no
9135         cf_try_cflags=
9136
9137         # Some less-capable ports of gcc support only -fpic
9138         CC_SHARED_OPTS=
9139         if test "$GCC" = yes
9140         then
9141                 echo "$as_me:9141: checking which $CC option to use" >&5
9142 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9143                 cf_save_CFLAGS="$CFLAGS"
9144                 for CC_SHARED_OPTS in -fPIC -fpic ''
9145                 do
9146                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9147                         cat >conftest.$ac_ext <<_ACEOF
9148 #line 9148 "configure"
9149 #include "confdefs.h"
9150 #include <stdio.h>
9151 int
9152 main ()
9153 {
9154 int x = 1
9155   ;
9156   return 0;
9157 }
9158 _ACEOF
9159 rm -f conftest.$ac_objext
9160 if { (eval echo "$as_me:9160: \"$ac_compile\"") >&5
9161   (eval $ac_compile) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit $ac_status); } &&
9165          { ac_try='test -s conftest.$ac_objext'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit $ac_status); }; }; then
9171   break
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat conftest.$ac_ext >&5
9175 fi
9176 rm -f conftest.$ac_objext conftest.$ac_ext
9177                 done
9178                 echo "$as_me:9178: result: $CC_SHARED_OPTS" >&5
9179 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9180                 CFLAGS="$cf_save_CFLAGS"
9181         fi
9182
9183         cf_cv_shlib_version_infix=no
9184
9185         case $cf_cv_system_name in
9186         (aix4.3-9*|aix[5-7]*)
9187                 if test "$GCC" = yes; then
9188                         CC_SHARED_OPTS='-Wl,-brtl'
9189                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9190                 else
9191                         CC_SHARED_OPTS='-brtl'
9192                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9193                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9194                 fi
9195                 ;;
9196         (beos*)
9197                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9198                 ;;
9199         (cygwin*)
9200                 CC_SHARED_OPTS=
9201                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9202                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9203                 cf_cv_shlib_version=cygdll
9204                 cf_cv_shlib_version_infix=cygdll
9205                 shlibdir=$bindir
9206                 MAKE_DLLS=
9207                 cat >mk_shared_lib.sh <<-CF_EOF
9208                 #!$SHELL
9209                 SHARED_LIB=\$1
9210                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9211                 shift
9212                 cat <<-EOF
9213                 Linking shared library
9214                 ** SHARED_LIB \$SHARED_LIB
9215                 ** IMPORT_LIB \$IMPORT_LIB
9216 EOF
9217                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9218 CF_EOF
9219                 chmod +x mk_shared_lib.sh
9220                 ;;
9221         (msys*)
9222                 CC_SHARED_OPTS=
9223                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9224                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9225                 cf_cv_shlib_version=msysdll
9226                 cf_cv_shlib_version_infix=msysdll
9227                 shlibdir=$bindir
9228                 MAKE_DLLS=
9229                 cat >mk_shared_lib.sh <<-CF_EOF
9230                 #!$SHELL
9231                 SHARED_LIB=\$1
9232                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9233                 shift
9234                 cat <<-EOF
9235                 Linking shared library
9236                 ** SHARED_LIB \$SHARED_LIB
9237                 ** IMPORT_LIB \$IMPORT_LIB
9238 EOF
9239                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9240 CF_EOF
9241                 chmod +x mk_shared_lib.sh
9242                 ;;
9243         (darwin*)
9244                 cf_try_cflags="no-cpp-precomp"
9245                 CC_SHARED_OPTS="-dynamic"
9246                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9247                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9248                 cf_cv_shlib_version_infix=yes
9249                 echo "$as_me:9249: checking if ld -search_paths_first works" >&5
9250 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9251 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9252   echo $ECHO_N "(cached) $ECHO_C" >&6
9253 else
9254
9255                         cf_save_LDFLAGS=$LDFLAGS
9256                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9257                         cat >conftest.$ac_ext <<_ACEOF
9258 #line 9258 "configure"
9259 #include "confdefs.h"
9260
9261 int
9262 main ()
9263 {
9264 int i;
9265   ;
9266   return 0;
9267 }
9268 _ACEOF
9269 rm -f conftest.$ac_objext conftest$ac_exeext
9270 if { (eval echo "$as_me:9270: \"$ac_link\"") >&5
9271   (eval $ac_link) 2>&5
9272   ac_status=$?
9273   echo "$as_me:9273: \$? = $ac_status" >&5
9274   (exit $ac_status); } &&
9275          { ac_try='test -s conftest$ac_exeext'
9276   { (eval echo "$as_me:9276: \"$ac_try\"") >&5
9277   (eval $ac_try) 2>&5
9278   ac_status=$?
9279   echo "$as_me:9279: \$? = $ac_status" >&5
9280   (exit $ac_status); }; }; then
9281   cf_cv_ldflags_search_paths_first=yes
9282 else
9283   echo "$as_me: failed program was:" >&5
9284 cat conftest.$ac_ext >&5
9285 cf_cv_ldflags_search_paths_first=no
9286 fi
9287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9288                                 LDFLAGS=$cf_save_LDFLAGS
9289 fi
9290 echo "$as_me:9290: result: $cf_cv_ldflags_search_paths_first" >&5
9291 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9292                 if test $cf_cv_ldflags_search_paths_first = yes; then
9293                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9294                 fi
9295                 ;;
9296         (hpux[7-8]*)
9297                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9298                 if test "$GCC" != yes; then
9299                         CC_SHARED_OPTS='+Z'
9300                 fi
9301                 MK_SHARED_LIB='${LD} -b -o $@'
9302                 INSTALL_LIB="-m 555"
9303                 ;;
9304         (hpux*)
9305                 # (tested with gcc 2.7.2 -- I don't have c89)
9306                 if test "$GCC" = yes; then
9307                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9308                 else
9309                         CC_SHARED_OPTS='+Z'
9310                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9311                 fi
9312                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9313                 # HP-UX shared libraries must be executable, and should be
9314                 # readonly to exploit a quirk in the memory manager.
9315                 INSTALL_LIB="-m 555"
9316                 ;;
9317         (interix*)
9318                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9319                 if test "$cf_cv_shlib_version" = rel; then
9320                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9321                 else
9322                         cf_shared_soname='`basename `'
9323                 fi
9324                 CC_SHARED_OPTS=
9325                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9326                 ;;
9327         (irix*)
9328                 if test "$cf_cv_enable_rpath" = yes ; then
9329                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9330                 fi
9331                 # tested with IRIX 5.2 and 'cc'.
9332                 if test "$GCC" != yes; then
9333                         CC_SHARED_OPTS='-KPIC'
9334                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9335                 else
9336                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9337                 fi
9338                 cf_cv_rm_so_locs=yes
9339                 ;;
9340         (linux*|gnu*|k*bsd*-gnu)
9341                 if test "$DFT_LWR_MODEL" = "shared" ; then
9342                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9343                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9344                 fi
9345                 if test "$cf_cv_enable_rpath" = yes ; then
9346                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9347                 fi
9348
9349         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9350         if test "$cf_cv_shlib_version" = rel; then
9351                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9352         else
9353                 cf_cv_shared_soname='`basename $@`'
9354         fi
9355
9356                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9357                 ;;
9358         (mingw*)
9359                 cf_cv_shlib_version=mingw
9360                 cf_cv_shlib_version_infix=mingw
9361                 shlibdir=$bindir
9362                 MAKE_DLLS=
9363                 if test "$DFT_LWR_MODEL" = "shared" ; then
9364                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9365                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9366                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9367                 fi
9368                 CC_SHARED_OPTS=
9369                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9370                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9371                 cat >mk_shared_lib.sh <<-CF_EOF
9372                 #!$SHELL
9373                 SHARED_LIB=\$1
9374                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9375                 shift
9376                 cat <<-EOF
9377                 Linking shared library
9378                 ** SHARED_LIB \$SHARED_LIB
9379                 ** IMPORT_LIB \$IMPORT_LIB
9380 EOF
9381                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9382 CF_EOF
9383                 chmod +x mk_shared_lib.sh
9384                 ;;
9385         (openbsd[2-9].*|mirbsd*)
9386                 if test "$DFT_LWR_MODEL" = "shared" ; then
9387                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9388                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9389                 fi
9390                 if test "$cf_cv_enable_rpath" = yes ; then
9391                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9392                 fi
9393                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9394
9395         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9396         if test "$cf_cv_shlib_version" = rel; then
9397                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9398         else
9399                 cf_cv_shared_soname='`basename $@`'
9400         fi
9401
9402                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9403                 ;;
9404         (nto-qnx*|openbsd*|freebsd[12].*)
9405                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9406                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9407                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9408                 ;;
9409         (dragonfly*|freebsd*)
9410                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9411                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9412                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9413                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9414                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9415                 fi
9416
9417         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9418         if test "$cf_cv_shlib_version" = rel; then
9419                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9420         else
9421                 cf_cv_shared_soname='`basename $@`'
9422         fi
9423
9424                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9425                 ;;
9426         (netbsd*)
9427                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9428                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9429                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9430                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9431                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9432                         if test "$cf_cv_shlib_version" = auto; then
9433                         if test -f /usr/libexec/ld.elf_so; then
9434                                 cf_cv_shlib_version=abi
9435                         else
9436                                 cf_cv_shlib_version=rel
9437                         fi
9438                         fi
9439
9440         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9441         if test "$cf_cv_shlib_version" = rel; then
9442                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9443         else
9444                 cf_cv_shared_soname='`basename $@`'
9445         fi
9446
9447                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9448                 else
9449                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9450                 fi
9451                 ;;
9452         (osf*|mls+*)
9453                 # tested with OSF/1 V3.2 and 'cc'
9454                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9455                 # link with shared libs).
9456                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9457                 case $host_os in
9458                 (osf4*)
9459                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9460                         ;;
9461                 esac
9462                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9463                 if test "$DFT_LWR_MODEL" = "shared" ; then
9464                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9465                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9466                 fi
9467                 cf_cv_rm_so_locs=yes
9468                 ;;
9469         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9470                 # tested with osr5.0.5
9471                 if test "$GCC" != yes; then
9472                         CC_SHARED_OPTS='-belf -KPIC'
9473                 fi
9474                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9475                 if test "$cf_cv_enable_rpath" = yes ; then
9476                         # only way is to set LD_RUN_PATH but no switch for it
9477                         RUN_PATH=$libdir
9478                 fi
9479                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9480                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9481                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9482                 ;;
9483         (sunos4*)
9484                 # tested with SunOS 4.1.1 and gcc 2.7.0
9485                 if test "$GCC" != yes; then
9486                         CC_SHARED_OPTS='-KPIC'
9487                 fi
9488                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9489                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9490                 ;;
9491         (solaris2*)
9492                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9493                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9494                 if test "$DFT_LWR_MODEL" = "shared" ; then
9495                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9496                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9497                 fi
9498                 if test "$cf_cv_enable_rpath" = yes ; then
9499                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9500                 fi
9501
9502         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9503         if test "$cf_cv_shlib_version" = rel; then
9504                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9505         else
9506                 cf_cv_shared_soname='`basename $@`'
9507         fi
9508
9509                 if test "$GCC" != yes; then
9510                         cf_save_CFLAGS="$CFLAGS"
9511                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9512                         do
9513                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9514                                 cat >conftest.$ac_ext <<_ACEOF
9515 #line 9515 "configure"
9516 #include "confdefs.h"
9517 #include <stdio.h>
9518 int
9519 main ()
9520 {
9521 printf("Hello\n");
9522   ;
9523   return 0;
9524 }
9525 _ACEOF
9526 rm -f conftest.$ac_objext
9527 if { (eval echo "$as_me:9527: \"$ac_compile\"") >&5
9528   (eval $ac_compile) 2>&5
9529   ac_status=$?
9530   echo "$as_me:9530: \$? = $ac_status" >&5
9531   (exit $ac_status); } &&
9532          { ac_try='test -s conftest.$ac_objext'
9533   { (eval echo "$as_me:9533: \"$ac_try\"") >&5
9534   (eval $ac_try) 2>&5
9535   ac_status=$?
9536   echo "$as_me:9536: \$? = $ac_status" >&5
9537   (exit $ac_status); }; }; then
9538   break
9539 else
9540   echo "$as_me: failed program was:" >&5
9541 cat conftest.$ac_ext >&5
9542 fi
9543 rm -f conftest.$ac_objext conftest.$ac_ext
9544                         done
9545                         CFLAGS="$cf_save_CFLAGS"
9546                         CC_SHARED_OPTS=$cf_shared_opts
9547                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9548                 else
9549                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9550                 fi
9551                 ;;
9552         (sysv5uw7*|unix_sv*)
9553                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9554                 if test "$GCC" != yes; then
9555                         CC_SHARED_OPTS='-KPIC'
9556                 fi
9557                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9558                 ;;
9559         (*)
9560                 CC_SHARED_OPTS='unknown'
9561                 MK_SHARED_LIB='echo unknown'
9562                 ;;
9563         esac
9564
9565         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9566         case "$cf_cv_shlib_version" in
9567         (rel|abi)
9568                 case "$MK_SHARED_LIB" in
9569                 (*'-o $@')
9570                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9571                         ;;
9572                 (*)
9573                         { echo "$as_me:9573: WARNING: ignored --with-shlib-version" >&5
9574 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9575                         ;;
9576                 esac
9577                 ;;
9578         esac
9579
9580         if test -n "$cf_try_cflags"
9581         then
9582 cat > conftest.$ac_ext <<EOF
9583 #line 9583 "${as_me:-configure}"
9584 #include <stdio.h>
9585 int main(int argc, char *argv[])
9586 {
9587         printf("hello\n");
9588         return (argv[argc-1] == 0) ;
9589 }
9590 EOF
9591                 cf_save_CFLAGS="$CFLAGS"
9592                 for cf_opt in $cf_try_cflags
9593                 do
9594                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9595                         echo "$as_me:9595: checking if CFLAGS option -$cf_opt works" >&5
9596 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9597                         if { (eval echo "$as_me:9597: \"$ac_compile\"") >&5
9598   (eval $ac_compile) 2>&5
9599   ac_status=$?
9600   echo "$as_me:9600: \$? = $ac_status" >&5
9601   (exit $ac_status); }; then
9602                                 echo "$as_me:9602: result: yes" >&5
9603 echo "${ECHO_T}yes" >&6
9604                                 cf_save_CFLAGS="$CFLAGS"
9605                         else
9606                                 echo "$as_me:9606: result: no" >&5
9607 echo "${ECHO_T}no" >&6
9608                         fi
9609                 done
9610                 CFLAGS="$cf_save_CFLAGS"
9611         fi
9612
9613         # RPATH_LIST is a colon-separated list of directories
9614         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9615         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9616
9617         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9618
9619         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9620
9621 echo "${as_me:-configure}:9621: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9622
9623         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9624
9625 echo "${as_me:-configure}:9625: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9626
9627 # The test/sample programs in the original tree link using rpath option.
9628 # Make it optional for packagers.
9629 if test -n "$LOCAL_LDFLAGS"
9630 then
9631         echo "$as_me:9631: checking if you want to link sample programs with rpath option" >&5
9632 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9633
9634 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9635 if test "${enable_rpath_link+set}" = set; then
9636   enableval="$enable_rpath_link"
9637   with_rpath_link=$enableval
9638 else
9639   with_rpath_link=yes
9640 fi;
9641         echo "$as_me:9641: result: $with_rpath_link" >&5
9642 echo "${ECHO_T}$with_rpath_link" >&6
9643         if test "$with_rpath_link" = no
9644         then
9645                 LOCAL_LDFLAGS=
9646                 LOCAL_LDFLAGS2=
9647         fi
9648 fi
9649
9650 ###############################################################################
9651
9652 ###   use option --enable-broken-linker to force on use of broken-linker support
9653 echo "$as_me:9653: checking if you want broken-linker support code" >&5
9654 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9655
9656 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9657 if test "${enable_broken_linker+set}" = set; then
9658   enableval="$enable_broken_linker"
9659   with_broken_linker=$enableval
9660 else
9661   with_broken_linker=${BROKEN_LINKER:-no}
9662 fi;
9663 echo "$as_me:9663: result: $with_broken_linker" >&5
9664 echo "${ECHO_T}$with_broken_linker" >&6
9665
9666 BROKEN_LINKER=0
9667 if test "$with_broken_linker" = yes ; then
9668         cat >>confdefs.h <<\EOF
9669 #define BROKEN_LINKER 1
9670 EOF
9671
9672         BROKEN_LINKER=1
9673 elif test "$DFT_LWR_MODEL" = shared ; then
9674         case $cf_cv_system_name in
9675         (cygwin*)
9676                 cat >>confdefs.h <<\EOF
9677 #define BROKEN_LINKER 1
9678 EOF
9679
9680                 BROKEN_LINKER=1
9681                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9682
9683 echo "${as_me:-configure}:9683: testing cygwin linker is broken anyway ..." 1>&5
9684
9685                 ;;
9686         esac
9687 fi
9688
9689 # Check to define _XOPEN_SOURCE "automatically"
9690
9691 cf_XOPEN_SOURCE=500
9692 cf_POSIX_C_SOURCE=199506L
9693 cf_xopen_source=
9694
9695 case $host_os in
9696 (aix[4-7]*)
9697         cf_xopen_source="-D_ALL_SOURCE"
9698         ;;
9699 (cygwin|msys)
9700         cf_XOPEN_SOURCE=600
9701         ;;
9702 (darwin[0-8].*)
9703         cf_xopen_source="-D_APPLE_C_SOURCE"
9704         ;;
9705 (darwin*)
9706         cf_xopen_source="-D_DARWIN_C_SOURCE"
9707         cf_XOPEN_SOURCE=
9708         ;;
9709 (freebsd*|dragonfly*)
9710         # 5.x headers associate
9711         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9712         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9713         cf_POSIX_C_SOURCE=200112L
9714         cf_XOPEN_SOURCE=600
9715         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9716         ;;
9717 (hpux11*)
9718         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9719         ;;
9720 (hpux*)
9721         cf_xopen_source="-D_HPUX_SOURCE"
9722         ;;
9723 (irix[56].*)
9724         cf_xopen_source="-D_SGI_SOURCE"
9725         cf_XOPEN_SOURCE=
9726         ;;
9727 (linux*|gnu*|mint*|k*bsd*-gnu)
9728
9729 echo "$as_me:9729: checking if we must define _GNU_SOURCE" >&5
9730 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9731 if test "${cf_cv_gnu_source+set}" = set; then
9732   echo $ECHO_N "(cached) $ECHO_C" >&6
9733 else
9734
9735 cat >conftest.$ac_ext <<_ACEOF
9736 #line 9736 "configure"
9737 #include "confdefs.h"
9738 #include <sys/types.h>
9739 int
9740 main ()
9741 {
9742
9743 #ifndef _XOPEN_SOURCE
9744 make an error
9745 #endif
9746   ;
9747   return 0;
9748 }
9749 _ACEOF
9750 rm -f conftest.$ac_objext
9751 if { (eval echo "$as_me:9751: \"$ac_compile\"") >&5
9752   (eval $ac_compile) 2>&5
9753   ac_status=$?
9754   echo "$as_me:9754: \$? = $ac_status" >&5
9755   (exit $ac_status); } &&
9756          { ac_try='test -s conftest.$ac_objext'
9757   { (eval echo "$as_me:9757: \"$ac_try\"") >&5
9758   (eval $ac_try) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); }; }; then
9762   cf_cv_gnu_source=no
9763 else
9764   echo "$as_me: failed program was:" >&5
9765 cat conftest.$ac_ext >&5
9766 cf_save="$CPPFLAGS"
9767          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9768          cat >conftest.$ac_ext <<_ACEOF
9769 #line 9769 "configure"
9770 #include "confdefs.h"
9771 #include <sys/types.h>
9772 int
9773 main ()
9774 {
9775
9776 #ifdef _XOPEN_SOURCE
9777 make an error
9778 #endif
9779   ;
9780   return 0;
9781 }
9782 _ACEOF
9783 rm -f conftest.$ac_objext
9784 if { (eval echo "$as_me:9784: \"$ac_compile\"") >&5
9785   (eval $ac_compile) 2>&5
9786   ac_status=$?
9787   echo "$as_me:9787: \$? = $ac_status" >&5
9788   (exit $ac_status); } &&
9789          { ac_try='test -s conftest.$ac_objext'
9790   { (eval echo "$as_me:9790: \"$ac_try\"") >&5
9791   (eval $ac_try) 2>&5
9792   ac_status=$?
9793   echo "$as_me:9793: \$? = $ac_status" >&5
9794   (exit $ac_status); }; }; then
9795   cf_cv_gnu_source=no
9796 else
9797   echo "$as_me: failed program was:" >&5
9798 cat conftest.$ac_ext >&5
9799 cf_cv_gnu_source=yes
9800 fi
9801 rm -f conftest.$ac_objext conftest.$ac_ext
9802         CPPFLAGS="$cf_save"
9803
9804 fi
9805 rm -f conftest.$ac_objext conftest.$ac_ext
9806
9807 fi
9808 echo "$as_me:9808: result: $cf_cv_gnu_source" >&5
9809 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9810
9811 if test "$cf_cv_gnu_source" = yes
9812 then
9813 echo "$as_me:9813: checking if we should also define _DEFAULT_SOURCE" >&5
9814 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
9815 if test "${cf_cv_default_source+set}" = set; then
9816   echo $ECHO_N "(cached) $ECHO_C" >&6
9817 else
9818
9819 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9820         cat >conftest.$ac_ext <<_ACEOF
9821 #line 9821 "configure"
9822 #include "confdefs.h"
9823 #include <sys/types.h>
9824 int
9825 main ()
9826 {
9827
9828 #ifdef _DEFAULT_SOURCE
9829 make an error
9830 #endif
9831   ;
9832   return 0;
9833 }
9834 _ACEOF
9835 rm -f conftest.$ac_objext
9836 if { (eval echo "$as_me:9836: \"$ac_compile\"") >&5
9837   (eval $ac_compile) 2>&5
9838   ac_status=$?
9839   echo "$as_me:9839: \$? = $ac_status" >&5
9840   (exit $ac_status); } &&
9841          { ac_try='test -s conftest.$ac_objext'
9842   { (eval echo "$as_me:9842: \"$ac_try\"") >&5
9843   (eval $ac_try) 2>&5
9844   ac_status=$?
9845   echo "$as_me:9845: \$? = $ac_status" >&5
9846   (exit $ac_status); }; }; then
9847   cf_cv_default_source=no
9848 else
9849   echo "$as_me: failed program was:" >&5
9850 cat conftest.$ac_ext >&5
9851 cf_cv_default_source=yes
9852 fi
9853 rm -f conftest.$ac_objext conftest.$ac_ext
9854
9855 fi
9856 echo "$as_me:9856: result: $cf_cv_default_source" >&5
9857 echo "${ECHO_T}$cf_cv_default_source" >&6
9858 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
9859 fi
9860
9861         ;;
9862 (minix*)
9863         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9864         ;;
9865 (mirbsd*)
9866         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9867         cf_XOPEN_SOURCE=
9868
9869 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9870
9871 cf_save_CFLAGS="$CFLAGS"
9872 cf_save_CPPFLAGS="$CPPFLAGS"
9873
9874 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9875         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9876                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9877
9878 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9879         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9880                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9881
9882 echo "$as_me:9882: checking if we should define _POSIX_C_SOURCE" >&5
9883 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9884 if test "${cf_cv_posix_c_source+set}" = set; then
9885   echo $ECHO_N "(cached) $ECHO_C" >&6
9886 else
9887
9888 echo "${as_me:-configure}:9888: testing if the symbol is already defined go no further ..." 1>&5
9889
9890         cat >conftest.$ac_ext <<_ACEOF
9891 #line 9891 "configure"
9892 #include "confdefs.h"
9893 #include <sys/types.h>
9894 int
9895 main ()
9896 {
9897
9898 #ifndef _POSIX_C_SOURCE
9899 make an error
9900 #endif
9901   ;
9902   return 0;
9903 }
9904 _ACEOF
9905 rm -f conftest.$ac_objext
9906 if { (eval echo "$as_me:9906: \"$ac_compile\"") >&5
9907   (eval $ac_compile) 2>&5
9908   ac_status=$?
9909   echo "$as_me:9909: \$? = $ac_status" >&5
9910   (exit $ac_status); } &&
9911          { ac_try='test -s conftest.$ac_objext'
9912   { (eval echo "$as_me:9912: \"$ac_try\"") >&5
9913   (eval $ac_try) 2>&5
9914   ac_status=$?
9915   echo "$as_me:9915: \$? = $ac_status" >&5
9916   (exit $ac_status); }; }; then
9917   cf_cv_posix_c_source=no
9918 else
9919   echo "$as_me: failed program was:" >&5
9920 cat conftest.$ac_ext >&5
9921 cf_want_posix_source=no
9922          case .$cf_POSIX_C_SOURCE in
9923          (.[12]??*)
9924                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9925                 ;;
9926          (.2)
9927                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9928                 cf_want_posix_source=yes
9929                 ;;
9930          (.*)
9931                 cf_want_posix_source=yes
9932                 ;;
9933          esac
9934          if test "$cf_want_posix_source" = yes ; then
9935                 cat >conftest.$ac_ext <<_ACEOF
9936 #line 9936 "configure"
9937 #include "confdefs.h"
9938 #include <sys/types.h>
9939 int
9940 main ()
9941 {
9942
9943 #ifdef _POSIX_SOURCE
9944 make an error
9945 #endif
9946   ;
9947   return 0;
9948 }
9949 _ACEOF
9950 rm -f conftest.$ac_objext
9951 if { (eval echo "$as_me:9951: \"$ac_compile\"") >&5
9952   (eval $ac_compile) 2>&5
9953   ac_status=$?
9954   echo "$as_me:9954: \$? = $ac_status" >&5
9955   (exit $ac_status); } &&
9956          { ac_try='test -s conftest.$ac_objext'
9957   { (eval echo "$as_me:9957: \"$ac_try\"") >&5
9958   (eval $ac_try) 2>&5
9959   ac_status=$?
9960   echo "$as_me:9960: \$? = $ac_status" >&5
9961   (exit $ac_status); }; }; then
9962   :
9963 else
9964   echo "$as_me: failed program was:" >&5
9965 cat conftest.$ac_ext >&5
9966 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9967 fi
9968 rm -f conftest.$ac_objext conftest.$ac_ext
9969          fi
9970
9971 echo "${as_me:-configure}:9971: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9972
9973          CFLAGS="$cf_trim_CFLAGS"
9974          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9975
9976 echo "${as_me:-configure}:9976: testing if the second compile does not leave our definition intact error ..." 1>&5
9977
9978          cat >conftest.$ac_ext <<_ACEOF
9979 #line 9979 "configure"
9980 #include "confdefs.h"
9981 #include <sys/types.h>
9982 int
9983 main ()
9984 {
9985
9986 #ifndef _POSIX_C_SOURCE
9987 make an error
9988 #endif
9989   ;
9990   return 0;
9991 }
9992 _ACEOF
9993 rm -f conftest.$ac_objext
9994 if { (eval echo "$as_me:9994: \"$ac_compile\"") >&5
9995   (eval $ac_compile) 2>&5
9996   ac_status=$?
9997   echo "$as_me:9997: \$? = $ac_status" >&5
9998   (exit $ac_status); } &&
9999          { ac_try='test -s conftest.$ac_objext'
10000   { (eval echo "$as_me:10000: \"$ac_try\"") >&5
10001   (eval $ac_try) 2>&5
10002   ac_status=$?
10003   echo "$as_me:10003: \$? = $ac_status" >&5
10004   (exit $ac_status); }; }; then
10005   :
10006 else
10007   echo "$as_me: failed program was:" >&5
10008 cat conftest.$ac_ext >&5
10009 cf_cv_posix_c_source=no
10010 fi
10011 rm -f conftest.$ac_objext conftest.$ac_ext
10012          CFLAGS="$cf_save_CFLAGS"
10013          CPPFLAGS="$cf_save_CPPFLAGS"
10014
10015 fi
10016 rm -f conftest.$ac_objext conftest.$ac_ext
10017
10018 fi
10019 echo "$as_me:10019: result: $cf_cv_posix_c_source" >&5
10020 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10021
10022 if test "$cf_cv_posix_c_source" != no ; then
10023         CFLAGS="$cf_trim_CFLAGS"
10024         CPPFLAGS="$cf_trim_CPPFLAGS"
10025
10026 cf_fix_cppflags=no
10027 cf_new_cflags=
10028 cf_new_cppflags=
10029 cf_new_extra_cppflags=
10030
10031 for cf_add_cflags in $cf_cv_posix_c_source
10032 do
10033 case $cf_fix_cppflags in
10034 (no)
10035         case $cf_add_cflags in
10036         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10037                 case $cf_add_cflags in
10038                 (-D*)
10039                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10040
10041                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10042                                 && test -z "${cf_tst_cflags}" \
10043                                 && cf_fix_cppflags=yes
10044
10045                         if test $cf_fix_cppflags = yes ; then
10046                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10047                                 continue
10048                         elif test "${cf_tst_cflags}" = "\"'" ; then
10049                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10050                                 continue
10051                         fi
10052                         ;;
10053                 esac
10054                 case "$CPPFLAGS" in
10055                 (*$cf_add_cflags)
10056                         ;;
10057                 (*)
10058                         case $cf_add_cflags in
10059                         (-D*)
10060                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10061
10062 CPPFLAGS=`echo "$CPPFLAGS" | \
10063         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10064                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10065
10066                                 ;;
10067                         esac
10068                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10069                         ;;
10070                 esac
10071                 ;;
10072         (*)
10073                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10074                 ;;
10075         esac
10076         ;;
10077 (yes)
10078         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10079
10080         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10081
10082         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10083                 && test -z "${cf_tst_cflags}" \
10084                 && cf_fix_cppflags=no
10085         ;;
10086 esac
10087 done
10088
10089 if test -n "$cf_new_cflags" ; then
10090
10091         CFLAGS="$CFLAGS $cf_new_cflags"
10092 fi
10093
10094 if test -n "$cf_new_cppflags" ; then
10095
10096         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10097 fi
10098
10099 if test -n "$cf_new_extra_cppflags" ; then
10100
10101         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10102 fi
10103
10104 fi
10105
10106         ;;
10107 (netbsd*)
10108         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10109         ;;
10110 (openbsd[4-9]*)
10111         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10112         cf_xopen_source="-D_BSD_SOURCE"
10113         cf_XOPEN_SOURCE=600
10114         ;;
10115 (openbsd*)
10116         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10117         ;;
10118 (os2*)
10119         cf_XOPEN_SOURCE=
10120         ;;
10121 (osf[45]*)
10122         cf_xopen_source="-D_OSF_SOURCE"
10123         ;;
10124 (nto-qnx*)
10125         cf_xopen_source="-D_QNX_SOURCE"
10126         ;;
10127 (sco*)
10128         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10129         ;;
10130 (solaris2.*)
10131         cf_xopen_source="-D__EXTENSIONS__"
10132         cf_cv_xopen_source=broken
10133         ;;
10134 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10135         cf_XOPEN_SOURCE=
10136         cf_POSIX_C_SOURCE=
10137         ;;
10138 (*)
10139
10140 echo "$as_me:10140: checking if we should define _XOPEN_SOURCE" >&5
10141 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10142 if test "${cf_cv_xopen_source+set}" = set; then
10143   echo $ECHO_N "(cached) $ECHO_C" >&6
10144 else
10145
10146         cat >conftest.$ac_ext <<_ACEOF
10147 #line 10147 "configure"
10148 #include "confdefs.h"
10149
10150 #include <stdlib.h>
10151 #include <string.h>
10152 #include <sys/types.h>
10153
10154 int
10155 main ()
10156 {
10157
10158 #ifndef _XOPEN_SOURCE
10159 make an error
10160 #endif
10161   ;
10162   return 0;
10163 }
10164 _ACEOF
10165 rm -f conftest.$ac_objext
10166 if { (eval echo "$as_me:10166: \"$ac_compile\"") >&5
10167   (eval $ac_compile) 2>&5
10168   ac_status=$?
10169   echo "$as_me:10169: \$? = $ac_status" >&5
10170   (exit $ac_status); } &&
10171          { ac_try='test -s conftest.$ac_objext'
10172   { (eval echo "$as_me:10172: \"$ac_try\"") >&5
10173   (eval $ac_try) 2>&5
10174   ac_status=$?
10175   echo "$as_me:10175: \$? = $ac_status" >&5
10176   (exit $ac_status); }; }; then
10177   cf_cv_xopen_source=no
10178 else
10179   echo "$as_me: failed program was:" >&5
10180 cat conftest.$ac_ext >&5
10181 cf_save="$CPPFLAGS"
10182          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10183          cat >conftest.$ac_ext <<_ACEOF
10184 #line 10184 "configure"
10185 #include "confdefs.h"
10186
10187 #include <stdlib.h>
10188 #include <string.h>
10189 #include <sys/types.h>
10190
10191 int
10192 main ()
10193 {
10194
10195 #ifdef _XOPEN_SOURCE
10196 make an error
10197 #endif
10198   ;
10199   return 0;
10200 }
10201 _ACEOF
10202 rm -f conftest.$ac_objext
10203 if { (eval echo "$as_me:10203: \"$ac_compile\"") >&5
10204   (eval $ac_compile) 2>&5
10205   ac_status=$?
10206   echo "$as_me:10206: \$? = $ac_status" >&5
10207   (exit $ac_status); } &&
10208          { ac_try='test -s conftest.$ac_objext'
10209   { (eval echo "$as_me:10209: \"$ac_try\"") >&5
10210   (eval $ac_try) 2>&5
10211   ac_status=$?
10212   echo "$as_me:10212: \$? = $ac_status" >&5
10213   (exit $ac_status); }; }; then
10214   cf_cv_xopen_source=no
10215 else
10216   echo "$as_me: failed program was:" >&5
10217 cat conftest.$ac_ext >&5
10218 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10219 fi
10220 rm -f conftest.$ac_objext conftest.$ac_ext
10221         CPPFLAGS="$cf_save"
10222
10223 fi
10224 rm -f conftest.$ac_objext conftest.$ac_ext
10225
10226 fi
10227 echo "$as_me:10227: result: $cf_cv_xopen_source" >&5
10228 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10229
10230 if test "$cf_cv_xopen_source" != no ; then
10231
10232 CFLAGS=`echo "$CFLAGS" | \
10233         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10234                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10235
10236 CPPFLAGS=`echo "$CPPFLAGS" | \
10237         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10238                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10239
10240         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10241
10242 cf_fix_cppflags=no
10243 cf_new_cflags=
10244 cf_new_cppflags=
10245 cf_new_extra_cppflags=
10246
10247 for cf_add_cflags in $cf_temp_xopen_source
10248 do
10249 case $cf_fix_cppflags in
10250 (no)
10251         case $cf_add_cflags in
10252         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10253                 case $cf_add_cflags in
10254                 (-D*)
10255                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10256
10257                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10258                                 && test -z "${cf_tst_cflags}" \
10259                                 && cf_fix_cppflags=yes
10260
10261                         if test $cf_fix_cppflags = yes ; then
10262                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10263                                 continue
10264                         elif test "${cf_tst_cflags}" = "\"'" ; then
10265                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10266                                 continue
10267                         fi
10268                         ;;
10269                 esac
10270                 case "$CPPFLAGS" in
10271                 (*$cf_add_cflags)
10272                         ;;
10273                 (*)
10274                         case $cf_add_cflags in
10275                         (-D*)
10276                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10277
10278 CPPFLAGS=`echo "$CPPFLAGS" | \
10279         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10280                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10281
10282                                 ;;
10283                         esac
10284                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10285                         ;;
10286                 esac
10287                 ;;
10288         (*)
10289                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10290                 ;;
10291         esac
10292         ;;
10293 (yes)
10294         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10295
10296         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10297
10298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10299                 && test -z "${cf_tst_cflags}" \
10300                 && cf_fix_cppflags=no
10301         ;;
10302 esac
10303 done
10304
10305 if test -n "$cf_new_cflags" ; then
10306
10307         CFLAGS="$CFLAGS $cf_new_cflags"
10308 fi
10309
10310 if test -n "$cf_new_cppflags" ; then
10311
10312         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10313 fi
10314
10315 if test -n "$cf_new_extra_cppflags" ; then
10316
10317         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10318 fi
10319
10320 fi
10321
10322 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10323
10324 cf_save_CFLAGS="$CFLAGS"
10325 cf_save_CPPFLAGS="$CPPFLAGS"
10326
10327 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10328         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10329                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10330
10331 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10332         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10333                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10334
10335 echo "$as_me:10335: checking if we should define _POSIX_C_SOURCE" >&5
10336 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10337 if test "${cf_cv_posix_c_source+set}" = set; then
10338   echo $ECHO_N "(cached) $ECHO_C" >&6
10339 else
10340
10341 echo "${as_me:-configure}:10341: testing if the symbol is already defined go no further ..." 1>&5
10342
10343         cat >conftest.$ac_ext <<_ACEOF
10344 #line 10344 "configure"
10345 #include "confdefs.h"
10346 #include <sys/types.h>
10347 int
10348 main ()
10349 {
10350
10351 #ifndef _POSIX_C_SOURCE
10352 make an error
10353 #endif
10354   ;
10355   return 0;
10356 }
10357 _ACEOF
10358 rm -f conftest.$ac_objext
10359 if { (eval echo "$as_me:10359: \"$ac_compile\"") >&5
10360   (eval $ac_compile) 2>&5
10361   ac_status=$?
10362   echo "$as_me:10362: \$? = $ac_status" >&5
10363   (exit $ac_status); } &&
10364          { ac_try='test -s conftest.$ac_objext'
10365   { (eval echo "$as_me:10365: \"$ac_try\"") >&5
10366   (eval $ac_try) 2>&5
10367   ac_status=$?
10368   echo "$as_me:10368: \$? = $ac_status" >&5
10369   (exit $ac_status); }; }; then
10370   cf_cv_posix_c_source=no
10371 else
10372   echo "$as_me: failed program was:" >&5
10373 cat conftest.$ac_ext >&5
10374 cf_want_posix_source=no
10375          case .$cf_POSIX_C_SOURCE in
10376          (.[12]??*)
10377                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10378                 ;;
10379          (.2)
10380                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10381                 cf_want_posix_source=yes
10382                 ;;
10383          (.*)
10384                 cf_want_posix_source=yes
10385                 ;;
10386          esac
10387          if test "$cf_want_posix_source" = yes ; then
10388                 cat >conftest.$ac_ext <<_ACEOF
10389 #line 10389 "configure"
10390 #include "confdefs.h"
10391 #include <sys/types.h>
10392 int
10393 main ()
10394 {
10395
10396 #ifdef _POSIX_SOURCE
10397 make an error
10398 #endif
10399   ;
10400   return 0;
10401 }
10402 _ACEOF
10403 rm -f conftest.$ac_objext
10404 if { (eval echo "$as_me:10404: \"$ac_compile\"") >&5
10405   (eval $ac_compile) 2>&5
10406   ac_status=$?
10407   echo "$as_me:10407: \$? = $ac_status" >&5
10408   (exit $ac_status); } &&
10409          { ac_try='test -s conftest.$ac_objext'
10410   { (eval echo "$as_me:10410: \"$ac_try\"") >&5
10411   (eval $ac_try) 2>&5
10412   ac_status=$?
10413   echo "$as_me:10413: \$? = $ac_status" >&5
10414   (exit $ac_status); }; }; then
10415   :
10416 else
10417   echo "$as_me: failed program was:" >&5
10418 cat conftest.$ac_ext >&5
10419 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10420 fi
10421 rm -f conftest.$ac_objext conftest.$ac_ext
10422          fi
10423
10424 echo "${as_me:-configure}:10424: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10425
10426          CFLAGS="$cf_trim_CFLAGS"
10427          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10428
10429 echo "${as_me:-configure}:10429: testing if the second compile does not leave our definition intact error ..." 1>&5
10430
10431          cat >conftest.$ac_ext <<_ACEOF
10432 #line 10432 "configure"
10433 #include "confdefs.h"
10434 #include <sys/types.h>
10435 int
10436 main ()
10437 {
10438
10439 #ifndef _POSIX_C_SOURCE
10440 make an error
10441 #endif
10442   ;
10443   return 0;
10444 }
10445 _ACEOF
10446 rm -f conftest.$ac_objext
10447 if { (eval echo "$as_me:10447: \"$ac_compile\"") >&5
10448   (eval $ac_compile) 2>&5
10449   ac_status=$?
10450   echo "$as_me:10450: \$? = $ac_status" >&5
10451   (exit $ac_status); } &&
10452          { ac_try='test -s conftest.$ac_objext'
10453   { (eval echo "$as_me:10453: \"$ac_try\"") >&5
10454   (eval $ac_try) 2>&5
10455   ac_status=$?
10456   echo "$as_me:10456: \$? = $ac_status" >&5
10457   (exit $ac_status); }; }; then
10458   :
10459 else
10460   echo "$as_me: failed program was:" >&5
10461 cat conftest.$ac_ext >&5
10462 cf_cv_posix_c_source=no
10463 fi
10464 rm -f conftest.$ac_objext conftest.$ac_ext
10465          CFLAGS="$cf_save_CFLAGS"
10466          CPPFLAGS="$cf_save_CPPFLAGS"
10467
10468 fi
10469 rm -f conftest.$ac_objext conftest.$ac_ext
10470
10471 fi
10472 echo "$as_me:10472: result: $cf_cv_posix_c_source" >&5
10473 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10474
10475 if test "$cf_cv_posix_c_source" != no ; then
10476         CFLAGS="$cf_trim_CFLAGS"
10477         CPPFLAGS="$cf_trim_CPPFLAGS"
10478
10479 cf_fix_cppflags=no
10480 cf_new_cflags=
10481 cf_new_cppflags=
10482 cf_new_extra_cppflags=
10483
10484 for cf_add_cflags in $cf_cv_posix_c_source
10485 do
10486 case $cf_fix_cppflags in
10487 (no)
10488         case $cf_add_cflags in
10489         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10490                 case $cf_add_cflags in
10491                 (-D*)
10492                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10493
10494                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10495                                 && test -z "${cf_tst_cflags}" \
10496                                 && cf_fix_cppflags=yes
10497
10498                         if test $cf_fix_cppflags = yes ; then
10499                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10500                                 continue
10501                         elif test "${cf_tst_cflags}" = "\"'" ; then
10502                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10503                                 continue
10504                         fi
10505                         ;;
10506                 esac
10507                 case "$CPPFLAGS" in
10508                 (*$cf_add_cflags)
10509                         ;;
10510                 (*)
10511                         case $cf_add_cflags in
10512                         (-D*)
10513                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10514
10515 CPPFLAGS=`echo "$CPPFLAGS" | \
10516         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10517                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10518
10519                                 ;;
10520                         esac
10521                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10522                         ;;
10523                 esac
10524                 ;;
10525         (*)
10526                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10527                 ;;
10528         esac
10529         ;;
10530 (yes)
10531         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10532
10533         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10534
10535         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10536                 && test -z "${cf_tst_cflags}" \
10537                 && cf_fix_cppflags=no
10538         ;;
10539 esac
10540 done
10541
10542 if test -n "$cf_new_cflags" ; then
10543
10544         CFLAGS="$CFLAGS $cf_new_cflags"
10545 fi
10546
10547 if test -n "$cf_new_cppflags" ; then
10548
10549         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10550 fi
10551
10552 if test -n "$cf_new_extra_cppflags" ; then
10553
10554         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10555 fi
10556
10557 fi
10558
10559         ;;
10560 esac
10561
10562 if test -n "$cf_xopen_source" ; then
10563
10564 cf_fix_cppflags=no
10565 cf_new_cflags=
10566 cf_new_cppflags=
10567 cf_new_extra_cppflags=
10568
10569 for cf_add_cflags in $cf_xopen_source
10570 do
10571 case $cf_fix_cppflags in
10572 (no)
10573         case $cf_add_cflags in
10574         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10575                 case $cf_add_cflags in
10576                 (-D*)
10577                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10578
10579                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10580                                 && test -z "${cf_tst_cflags}" \
10581                                 && cf_fix_cppflags=yes
10582
10583                         if test $cf_fix_cppflags = yes ; then
10584                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10585                                 continue
10586                         elif test "${cf_tst_cflags}" = "\"'" ; then
10587                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10588                                 continue
10589                         fi
10590                         ;;
10591                 esac
10592                 case "$CPPFLAGS" in
10593                 (*$cf_add_cflags)
10594                         ;;
10595                 (*)
10596                         case $cf_add_cflags in
10597                         (-D*)
10598                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10599
10600 CPPFLAGS=`echo "$CPPFLAGS" | \
10601         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10602                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10603
10604                                 ;;
10605                         esac
10606                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10607                         ;;
10608                 esac
10609                 ;;
10610         (*)
10611                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10612                 ;;
10613         esac
10614         ;;
10615 (yes)
10616         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10617
10618         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10619
10620         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10621                 && test -z "${cf_tst_cflags}" \
10622                 && cf_fix_cppflags=no
10623         ;;
10624 esac
10625 done
10626
10627 if test -n "$cf_new_cflags" ; then
10628         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10629
10630 echo "${as_me:-configure}:10630: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10631
10632         CFLAGS="$CFLAGS $cf_new_cflags"
10633 fi
10634
10635 if test -n "$cf_new_cppflags" ; then
10636         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10637
10638 echo "${as_me:-configure}:10638: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10639
10640         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10641 fi
10642
10643 if test -n "$cf_new_extra_cppflags" ; then
10644         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10645
10646 echo "${as_me:-configure}:10646: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10647
10648         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10649 fi
10650
10651 fi
10652
10653 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10654         echo "$as_me:10654: checking if _XOPEN_SOURCE really is set" >&5
10655 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10656         cat >conftest.$ac_ext <<_ACEOF
10657 #line 10657 "configure"
10658 #include "confdefs.h"
10659 #include <stdlib.h>
10660 int
10661 main ()
10662 {
10663
10664 #ifndef _XOPEN_SOURCE
10665 make an error
10666 #endif
10667   ;
10668   return 0;
10669 }
10670 _ACEOF
10671 rm -f conftest.$ac_objext
10672 if { (eval echo "$as_me:10672: \"$ac_compile\"") >&5
10673   (eval $ac_compile) 2>&5
10674   ac_status=$?
10675   echo "$as_me:10675: \$? = $ac_status" >&5
10676   (exit $ac_status); } &&
10677          { ac_try='test -s conftest.$ac_objext'
10678   { (eval echo "$as_me:10678: \"$ac_try\"") >&5
10679   (eval $ac_try) 2>&5
10680   ac_status=$?
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit $ac_status); }; }; then
10683   cf_XOPEN_SOURCE_set=yes
10684 else
10685   echo "$as_me: failed program was:" >&5
10686 cat conftest.$ac_ext >&5
10687 cf_XOPEN_SOURCE_set=no
10688 fi
10689 rm -f conftest.$ac_objext conftest.$ac_ext
10690         echo "$as_me:10690: result: $cf_XOPEN_SOURCE_set" >&5
10691 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10692         if test $cf_XOPEN_SOURCE_set = yes
10693         then
10694                 cat >conftest.$ac_ext <<_ACEOF
10695 #line 10695 "configure"
10696 #include "confdefs.h"
10697 #include <stdlib.h>
10698 int
10699 main ()
10700 {
10701
10702 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10703 make an error
10704 #endif
10705   ;
10706   return 0;
10707 }
10708 _ACEOF
10709 rm -f conftest.$ac_objext
10710 if { (eval echo "$as_me:10710: \"$ac_compile\"") >&5
10711   (eval $ac_compile) 2>&5
10712   ac_status=$?
10713   echo "$as_me:10713: \$? = $ac_status" >&5
10714   (exit $ac_status); } &&
10715          { ac_try='test -s conftest.$ac_objext'
10716   { (eval echo "$as_me:10716: \"$ac_try\"") >&5
10717   (eval $ac_try) 2>&5
10718   ac_status=$?
10719   echo "$as_me:10719: \$? = $ac_status" >&5
10720   (exit $ac_status); }; }; then
10721   cf_XOPEN_SOURCE_set_ok=yes
10722 else
10723   echo "$as_me: failed program was:" >&5
10724 cat conftest.$ac_ext >&5
10725 cf_XOPEN_SOURCE_set_ok=no
10726 fi
10727 rm -f conftest.$ac_objext conftest.$ac_ext
10728                 if test $cf_XOPEN_SOURCE_set_ok = no
10729                 then
10730                         { echo "$as_me:10730: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10731 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10732                 fi
10733         else
10734
10735 echo "$as_me:10735: checking if we should define _XOPEN_SOURCE" >&5
10736 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10737 if test "${cf_cv_xopen_source+set}" = set; then
10738   echo $ECHO_N "(cached) $ECHO_C" >&6
10739 else
10740
10741         cat >conftest.$ac_ext <<_ACEOF
10742 #line 10742 "configure"
10743 #include "confdefs.h"
10744
10745 #include <stdlib.h>
10746 #include <string.h>
10747 #include <sys/types.h>
10748
10749 int
10750 main ()
10751 {
10752
10753 #ifndef _XOPEN_SOURCE
10754 make an error
10755 #endif
10756   ;
10757   return 0;
10758 }
10759 _ACEOF
10760 rm -f conftest.$ac_objext
10761 if { (eval echo "$as_me:10761: \"$ac_compile\"") >&5
10762   (eval $ac_compile) 2>&5
10763   ac_status=$?
10764   echo "$as_me:10764: \$? = $ac_status" >&5
10765   (exit $ac_status); } &&
10766          { ac_try='test -s conftest.$ac_objext'
10767   { (eval echo "$as_me:10767: \"$ac_try\"") >&5
10768   (eval $ac_try) 2>&5
10769   ac_status=$?
10770   echo "$as_me:10770: \$? = $ac_status" >&5
10771   (exit $ac_status); }; }; then
10772   cf_cv_xopen_source=no
10773 else
10774   echo "$as_me: failed program was:" >&5
10775 cat conftest.$ac_ext >&5
10776 cf_save="$CPPFLAGS"
10777          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10778          cat >conftest.$ac_ext <<_ACEOF
10779 #line 10779 "configure"
10780 #include "confdefs.h"
10781
10782 #include <stdlib.h>
10783 #include <string.h>
10784 #include <sys/types.h>
10785
10786 int
10787 main ()
10788 {
10789
10790 #ifdef _XOPEN_SOURCE
10791 make an error
10792 #endif
10793   ;
10794   return 0;
10795 }
10796 _ACEOF
10797 rm -f conftest.$ac_objext
10798 if { (eval echo "$as_me:10798: \"$ac_compile\"") >&5
10799   (eval $ac_compile) 2>&5
10800   ac_status=$?
10801   echo "$as_me:10801: \$? = $ac_status" >&5
10802   (exit $ac_status); } &&
10803          { ac_try='test -s conftest.$ac_objext'
10804   { (eval echo "$as_me:10804: \"$ac_try\"") >&5
10805   (eval $ac_try) 2>&5
10806   ac_status=$?
10807   echo "$as_me:10807: \$? = $ac_status" >&5
10808   (exit $ac_status); }; }; then
10809   cf_cv_xopen_source=no
10810 else
10811   echo "$as_me: failed program was:" >&5
10812 cat conftest.$ac_ext >&5
10813 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10814 fi
10815 rm -f conftest.$ac_objext conftest.$ac_ext
10816         CPPFLAGS="$cf_save"
10817
10818 fi
10819 rm -f conftest.$ac_objext conftest.$ac_ext
10820
10821 fi
10822 echo "$as_me:10822: result: $cf_cv_xopen_source" >&5
10823 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10824
10825 if test "$cf_cv_xopen_source" != no ; then
10826
10827 CFLAGS=`echo "$CFLAGS" | \
10828         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10829                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10830
10831 CPPFLAGS=`echo "$CPPFLAGS" | \
10832         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10833                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10834
10835         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10836
10837 cf_fix_cppflags=no
10838 cf_new_cflags=
10839 cf_new_cppflags=
10840 cf_new_extra_cppflags=
10841
10842 for cf_add_cflags in $cf_temp_xopen_source
10843 do
10844 case $cf_fix_cppflags in
10845 (no)
10846         case $cf_add_cflags in
10847         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10848                 case $cf_add_cflags in
10849                 (-D*)
10850                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10851
10852                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10853                                 && test -z "${cf_tst_cflags}" \
10854                                 && cf_fix_cppflags=yes
10855
10856                         if test $cf_fix_cppflags = yes ; then
10857                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10858                                 continue
10859                         elif test "${cf_tst_cflags}" = "\"'" ; then
10860                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10861                                 continue
10862                         fi
10863                         ;;
10864                 esac
10865                 case "$CPPFLAGS" in
10866                 (*$cf_add_cflags)
10867                         ;;
10868                 (*)
10869                         case $cf_add_cflags in
10870                         (-D*)
10871                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10872
10873 CPPFLAGS=`echo "$CPPFLAGS" | \
10874         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10875                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10876
10877                                 ;;
10878                         esac
10879                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10880                         ;;
10881                 esac
10882                 ;;
10883         (*)
10884                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10885                 ;;
10886         esac
10887         ;;
10888 (yes)
10889         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10890
10891         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10892
10893         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10894                 && test -z "${cf_tst_cflags}" \
10895                 && cf_fix_cppflags=no
10896         ;;
10897 esac
10898 done
10899
10900 if test -n "$cf_new_cflags" ; then
10901
10902         CFLAGS="$CFLAGS $cf_new_cflags"
10903 fi
10904
10905 if test -n "$cf_new_cppflags" ; then
10906
10907         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10908 fi
10909
10910 if test -n "$cf_new_extra_cppflags" ; then
10911
10912         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10913 fi
10914
10915 fi
10916
10917         fi
10918 fi
10919
10920 # Check whether --enable-largefile or --disable-largefile was given.
10921 if test "${enable_largefile+set}" = set; then
10922   enableval="$enable_largefile"
10923
10924 fi;
10925 if test "$enable_largefile" != no; then
10926
10927   echo "$as_me:10927: checking for special C compiler options needed for large files" >&5
10928 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10929 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10930   echo $ECHO_N "(cached) $ECHO_C" >&6
10931 else
10932   ac_cv_sys_largefile_CC=no
10933      if test "$GCC" != yes; then
10934        ac_save_CC=$CC
10935        while :; do
10936          # IRIX 6.2 and later do not support large files by default,
10937          # so use the C compiler's -n32 option if that helps.
10938          cat >conftest.$ac_ext <<_ACEOF
10939 #line 10939 "configure"
10940 #include "confdefs.h"
10941 #include <sys/types.h>
10942  /* Check that off_t can represent 2**63 - 1 correctly.
10943     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10944     since some C++ compilers masquerading as C compilers
10945     incorrectly reject 9223372036854775807.  */
10946 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10947   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10948                        && LARGE_OFF_T % 2147483647 == 1)
10949                       ? 1 : -1];
10950 int
10951 main ()
10952 {
10953
10954   ;
10955   return 0;
10956 }
10957 _ACEOF
10958          rm -f conftest.$ac_objext
10959 if { (eval echo "$as_me:10959: \"$ac_compile\"") >&5
10960   (eval $ac_compile) 2>&5
10961   ac_status=$?
10962   echo "$as_me:10962: \$? = $ac_status" >&5
10963   (exit $ac_status); } &&
10964          { ac_try='test -s conftest.$ac_objext'
10965   { (eval echo "$as_me:10965: \"$ac_try\"") >&5
10966   (eval $ac_try) 2>&5
10967   ac_status=$?
10968   echo "$as_me:10968: \$? = $ac_status" >&5
10969   (exit $ac_status); }; }; then
10970   break
10971 else
10972   echo "$as_me: failed program was:" >&5
10973 cat conftest.$ac_ext >&5
10974 fi
10975 rm -f conftest.$ac_objext
10976          CC="$CC -n32"
10977          rm -f conftest.$ac_objext
10978 if { (eval echo "$as_me:10978: \"$ac_compile\"") >&5
10979   (eval $ac_compile) 2>&5
10980   ac_status=$?
10981   echo "$as_me:10981: \$? = $ac_status" >&5
10982   (exit $ac_status); } &&
10983          { ac_try='test -s conftest.$ac_objext'
10984   { (eval echo "$as_me:10984: \"$ac_try\"") >&5
10985   (eval $ac_try) 2>&5
10986   ac_status=$?
10987   echo "$as_me:10987: \$? = $ac_status" >&5
10988   (exit $ac_status); }; }; then
10989   ac_cv_sys_largefile_CC=' -n32'; break
10990 else
10991   echo "$as_me: failed program was:" >&5
10992 cat conftest.$ac_ext >&5
10993 fi
10994 rm -f conftest.$ac_objext
10995          break
10996        done
10997        CC=$ac_save_CC
10998        rm -f conftest.$ac_ext
10999     fi
11000 fi
11001 echo "$as_me:11001: result: $ac_cv_sys_largefile_CC" >&5
11002 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11003   if test "$ac_cv_sys_largefile_CC" != no; then
11004     CC=$CC$ac_cv_sys_largefile_CC
11005   fi
11006
11007   echo "$as_me:11007: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11008 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11009 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11010   echo $ECHO_N "(cached) $ECHO_C" >&6
11011 else
11012   while :; do
11013   ac_cv_sys_file_offset_bits=no
11014   cat >conftest.$ac_ext <<_ACEOF
11015 #line 11015 "configure"
11016 #include "confdefs.h"
11017 #include <sys/types.h>
11018  /* Check that off_t can represent 2**63 - 1 correctly.
11019     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11020     since some C++ compilers masquerading as C compilers
11021     incorrectly reject 9223372036854775807.  */
11022 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11023   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11024                        && LARGE_OFF_T % 2147483647 == 1)
11025                       ? 1 : -1];
11026 int
11027 main ()
11028 {
11029
11030   ;
11031   return 0;
11032 }
11033 _ACEOF
11034 rm -f conftest.$ac_objext
11035 if { (eval echo "$as_me:11035: \"$ac_compile\"") >&5
11036   (eval $ac_compile) 2>&5
11037   ac_status=$?
11038   echo "$as_me:11038: \$? = $ac_status" >&5
11039   (exit $ac_status); } &&
11040          { ac_try='test -s conftest.$ac_objext'
11041   { (eval echo "$as_me:11041: \"$ac_try\"") >&5
11042   (eval $ac_try) 2>&5
11043   ac_status=$?
11044   echo "$as_me:11044: \$? = $ac_status" >&5
11045   (exit $ac_status); }; }; then
11046   break
11047 else
11048   echo "$as_me: failed program was:" >&5
11049 cat conftest.$ac_ext >&5
11050 fi
11051 rm -f conftest.$ac_objext conftest.$ac_ext
11052   cat >conftest.$ac_ext <<_ACEOF
11053 #line 11053 "configure"
11054 #include "confdefs.h"
11055 #define _FILE_OFFSET_BITS 64
11056 #include <sys/types.h>
11057  /* Check that off_t can represent 2**63 - 1 correctly.
11058     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11059     since some C++ compilers masquerading as C compilers
11060     incorrectly reject 9223372036854775807.  */
11061 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11062   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11063                        && LARGE_OFF_T % 2147483647 == 1)
11064                       ? 1 : -1];
11065 int
11066 main ()
11067 {
11068
11069   ;
11070   return 0;
11071 }
11072 _ACEOF
11073 rm -f conftest.$ac_objext
11074 if { (eval echo "$as_me:11074: \"$ac_compile\"") >&5
11075   (eval $ac_compile) 2>&5
11076   ac_status=$?
11077   echo "$as_me:11077: \$? = $ac_status" >&5
11078   (exit $ac_status); } &&
11079          { ac_try='test -s conftest.$ac_objext'
11080   { (eval echo "$as_me:11080: \"$ac_try\"") >&5
11081   (eval $ac_try) 2>&5
11082   ac_status=$?
11083   echo "$as_me:11083: \$? = $ac_status" >&5
11084   (exit $ac_status); }; }; then
11085   ac_cv_sys_file_offset_bits=64; break
11086 else
11087   echo "$as_me: failed program was:" >&5
11088 cat conftest.$ac_ext >&5
11089 fi
11090 rm -f conftest.$ac_objext conftest.$ac_ext
11091   break
11092 done
11093 fi
11094 echo "$as_me:11094: result: $ac_cv_sys_file_offset_bits" >&5
11095 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11096 if test "$ac_cv_sys_file_offset_bits" != no; then
11097
11098 cat >>confdefs.h <<EOF
11099 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11100 EOF
11101
11102 fi
11103 rm -rf conftest*
11104   echo "$as_me:11104: checking for _LARGE_FILES value needed for large files" >&5
11105 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11106 if test "${ac_cv_sys_large_files+set}" = set; then
11107   echo $ECHO_N "(cached) $ECHO_C" >&6
11108 else
11109   while :; do
11110   ac_cv_sys_large_files=no
11111   cat >conftest.$ac_ext <<_ACEOF
11112 #line 11112 "configure"
11113 #include "confdefs.h"
11114 #include <sys/types.h>
11115  /* Check that off_t can represent 2**63 - 1 correctly.
11116     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11117     since some C++ compilers masquerading as C compilers
11118     incorrectly reject 9223372036854775807.  */
11119 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11120   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11121                        && LARGE_OFF_T % 2147483647 == 1)
11122                       ? 1 : -1];
11123 int
11124 main ()
11125 {
11126
11127   ;
11128   return 0;
11129 }
11130 _ACEOF
11131 rm -f conftest.$ac_objext
11132 if { (eval echo "$as_me:11132: \"$ac_compile\"") >&5
11133   (eval $ac_compile) 2>&5
11134   ac_status=$?
11135   echo "$as_me:11135: \$? = $ac_status" >&5
11136   (exit $ac_status); } &&
11137          { ac_try='test -s conftest.$ac_objext'
11138   { (eval echo "$as_me:11138: \"$ac_try\"") >&5
11139   (eval $ac_try) 2>&5
11140   ac_status=$?
11141   echo "$as_me:11141: \$? = $ac_status" >&5
11142   (exit $ac_status); }; }; then
11143   break
11144 else
11145   echo "$as_me: failed program was:" >&5
11146 cat conftest.$ac_ext >&5
11147 fi
11148 rm -f conftest.$ac_objext conftest.$ac_ext
11149   cat >conftest.$ac_ext <<_ACEOF
11150 #line 11150 "configure"
11151 #include "confdefs.h"
11152 #define _LARGE_FILES 1
11153 #include <sys/types.h>
11154  /* Check that off_t can represent 2**63 - 1 correctly.
11155     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11156     since some C++ compilers masquerading as C compilers
11157     incorrectly reject 9223372036854775807.  */
11158 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11159   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11160                        && LARGE_OFF_T % 2147483647 == 1)
11161                       ? 1 : -1];
11162 int
11163 main ()
11164 {
11165
11166   ;
11167   return 0;
11168 }
11169 _ACEOF
11170 rm -f conftest.$ac_objext
11171 if { (eval echo "$as_me:11171: \"$ac_compile\"") >&5
11172   (eval $ac_compile) 2>&5
11173   ac_status=$?
11174   echo "$as_me:11174: \$? = $ac_status" >&5
11175   (exit $ac_status); } &&
11176          { ac_try='test -s conftest.$ac_objext'
11177   { (eval echo "$as_me:11177: \"$ac_try\"") >&5
11178   (eval $ac_try) 2>&5
11179   ac_status=$?
11180   echo "$as_me:11180: \$? = $ac_status" >&5
11181   (exit $ac_status); }; }; then
11182   ac_cv_sys_large_files=1; break
11183 else
11184   echo "$as_me: failed program was:" >&5
11185 cat conftest.$ac_ext >&5
11186 fi
11187 rm -f conftest.$ac_objext conftest.$ac_ext
11188   break
11189 done
11190 fi
11191 echo "$as_me:11191: result: $ac_cv_sys_large_files" >&5
11192 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11193 if test "$ac_cv_sys_large_files" != no; then
11194
11195 cat >>confdefs.h <<EOF
11196 #define _LARGE_FILES $ac_cv_sys_large_files
11197 EOF
11198
11199 fi
11200 rm -rf conftest*
11201 fi
11202
11203         if test "$enable_largefile" != no ; then
11204         echo "$as_me:11204: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11205 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11206 if test "${ac_cv_sys_largefile_source+set}" = set; then
11207   echo $ECHO_N "(cached) $ECHO_C" >&6
11208 else
11209   while :; do
11210   ac_cv_sys_largefile_source=no
11211   cat >conftest.$ac_ext <<_ACEOF
11212 #line 11212 "configure"
11213 #include "confdefs.h"
11214 #include <stdio.h>
11215 int
11216 main ()
11217 {
11218 return !fseeko;
11219   ;
11220   return 0;
11221 }
11222 _ACEOF
11223 rm -f conftest.$ac_objext
11224 if { (eval echo "$as_me:11224: \"$ac_compile\"") >&5
11225   (eval $ac_compile) 2>&5
11226   ac_status=$?
11227   echo "$as_me:11227: \$? = $ac_status" >&5
11228   (exit $ac_status); } &&
11229          { ac_try='test -s conftest.$ac_objext'
11230   { (eval echo "$as_me:11230: \"$ac_try\"") >&5
11231   (eval $ac_try) 2>&5
11232   ac_status=$?
11233   echo "$as_me:11233: \$? = $ac_status" >&5
11234   (exit $ac_status); }; }; then
11235   break
11236 else
11237   echo "$as_me: failed program was:" >&5
11238 cat conftest.$ac_ext >&5
11239 fi
11240 rm -f conftest.$ac_objext conftest.$ac_ext
11241   cat >conftest.$ac_ext <<_ACEOF
11242 #line 11242 "configure"
11243 #include "confdefs.h"
11244 #define _LARGEFILE_SOURCE 1
11245 #include <stdio.h>
11246 int
11247 main ()
11248 {
11249 return !fseeko;
11250   ;
11251   return 0;
11252 }
11253 _ACEOF
11254 rm -f conftest.$ac_objext
11255 if { (eval echo "$as_me:11255: \"$ac_compile\"") >&5
11256   (eval $ac_compile) 2>&5
11257   ac_status=$?
11258   echo "$as_me:11258: \$? = $ac_status" >&5
11259   (exit $ac_status); } &&
11260          { ac_try='test -s conftest.$ac_objext'
11261   { (eval echo "$as_me:11261: \"$ac_try\"") >&5
11262   (eval $ac_try) 2>&5
11263   ac_status=$?
11264   echo "$as_me:11264: \$? = $ac_status" >&5
11265   (exit $ac_status); }; }; then
11266   ac_cv_sys_largefile_source=1; break
11267 else
11268   echo "$as_me: failed program was:" >&5
11269 cat conftest.$ac_ext >&5
11270 fi
11271 rm -f conftest.$ac_objext conftest.$ac_ext
11272   break
11273 done
11274 fi
11275 echo "$as_me:11275: result: $ac_cv_sys_largefile_source" >&5
11276 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11277 if test "$ac_cv_sys_largefile_source" != no; then
11278
11279 cat >>confdefs.h <<EOF
11280 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11281 EOF
11282
11283 fi
11284 rm -rf conftest*
11285
11286 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11287 # in glibc 2.1.3, but that breaks too many other things.
11288 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11289 echo "$as_me:11289: checking for fseeko" >&5
11290 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11291 if test "${ac_cv_func_fseeko+set}" = set; then
11292   echo $ECHO_N "(cached) $ECHO_C" >&6
11293 else
11294   cat >conftest.$ac_ext <<_ACEOF
11295 #line 11295 "configure"
11296 #include "confdefs.h"
11297 #include <stdio.h>
11298 int
11299 main ()
11300 {
11301 return fseeko && fseeko (stdin, 0, 0);
11302   ;
11303   return 0;
11304 }
11305 _ACEOF
11306 rm -f conftest.$ac_objext conftest$ac_exeext
11307 if { (eval echo "$as_me:11307: \"$ac_link\"") >&5
11308   (eval $ac_link) 2>&5
11309   ac_status=$?
11310   echo "$as_me:11310: \$? = $ac_status" >&5
11311   (exit $ac_status); } &&
11312          { ac_try='test -s conftest$ac_exeext'
11313   { (eval echo "$as_me:11313: \"$ac_try\"") >&5
11314   (eval $ac_try) 2>&5
11315   ac_status=$?
11316   echo "$as_me:11316: \$? = $ac_status" >&5
11317   (exit $ac_status); }; }; then
11318   ac_cv_func_fseeko=yes
11319 else
11320   echo "$as_me: failed program was:" >&5
11321 cat conftest.$ac_ext >&5
11322 ac_cv_func_fseeko=no
11323 fi
11324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11325 fi
11326 echo "$as_me:11326: result: $ac_cv_func_fseeko" >&5
11327 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11328 if test $ac_cv_func_fseeko = yes; then
11329
11330 cat >>confdefs.h <<\EOF
11331 #define HAVE_FSEEKO 1
11332 EOF
11333
11334 fi
11335
11336         # Normally we would collect these definitions in the config.h,
11337         # but (like _XOPEN_SOURCE), some environments rely on having these
11338         # defined before any of the system headers are included.  Another
11339         # case comes up with C++, e.g., on AIX the compiler compiles the
11340         # header files by themselves before looking at the body files it is
11341         # told to compile.  For ncurses, those header files do not include
11342         # the config.h
11343         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11344         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11345         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11346
11347         echo "$as_me:11347: checking whether to use struct dirent64" >&5
11348 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11349 if test "${cf_cv_struct_dirent64+set}" = set; then
11350   echo $ECHO_N "(cached) $ECHO_C" >&6
11351 else
11352
11353                 cat >conftest.$ac_ext <<_ACEOF
11354 #line 11354 "configure"
11355 #include "confdefs.h"
11356
11357 #include <sys/types.h>
11358 #include <dirent.h>
11359
11360 int
11361 main ()
11362 {
11363
11364                 /* if transitional largefile support is setup, this is true */
11365                 extern struct dirent64 * readdir(DIR *);
11366                 struct dirent64 *x = readdir((DIR *)0);
11367                 struct dirent *y = readdir((DIR *)0);
11368                 int z = x - y;
11369
11370   ;
11371   return 0;
11372 }
11373 _ACEOF
11374 rm -f conftest.$ac_objext
11375 if { (eval echo "$as_me:11375: \"$ac_compile\"") >&5
11376   (eval $ac_compile) 2>&5
11377   ac_status=$?
11378   echo "$as_me:11378: \$? = $ac_status" >&5
11379   (exit $ac_status); } &&
11380          { ac_try='test -s conftest.$ac_objext'
11381   { (eval echo "$as_me:11381: \"$ac_try\"") >&5
11382   (eval $ac_try) 2>&5
11383   ac_status=$?
11384   echo "$as_me:11384: \$? = $ac_status" >&5
11385   (exit $ac_status); }; }; then
11386   cf_cv_struct_dirent64=yes
11387 else
11388   echo "$as_me: failed program was:" >&5
11389 cat conftest.$ac_ext >&5
11390 cf_cv_struct_dirent64=no
11391 fi
11392 rm -f conftest.$ac_objext conftest.$ac_ext
11393
11394 fi
11395 echo "$as_me:11395: result: $cf_cv_struct_dirent64" >&5
11396 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11397         test "$cf_cv_struct_dirent64" = yes &&
11398 cat >>confdefs.h <<\EOF
11399 #define HAVE_STRUCT_DIRENT64 1
11400 EOF
11401
11402         fi
11403
11404 ### Enable compiling-in rcs id's
11405 echo "$as_me:11405: checking if RCS identifiers should be compiled-in" >&5
11406 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11407
11408 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11409 if test "${with_rcs_ids+set}" = set; then
11410   withval="$with_rcs_ids"
11411   with_rcs_ids=$withval
11412 else
11413   with_rcs_ids=no
11414 fi;
11415 echo "$as_me:11415: result: $with_rcs_ids" >&5
11416 echo "${ECHO_T}$with_rcs_ids" >&6
11417 test "$with_rcs_ids" = yes &&
11418 cat >>confdefs.h <<\EOF
11419 #define USE_RCS_IDS 1
11420 EOF
11421
11422 ###############################################################################
11423
11424 ### Note that some functions (such as const) are normally disabled anyway.
11425 echo "$as_me:11425: checking if you want to build with function extensions" >&5
11426 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11427
11428 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11429 if test "${enable_ext_funcs+set}" = set; then
11430   enableval="$enable_ext_funcs"
11431   with_ext_funcs=$enableval
11432 else
11433   with_ext_funcs=yes
11434 fi;
11435 echo "$as_me:11435: result: $with_ext_funcs" >&5
11436 echo "${ECHO_T}$with_ext_funcs" >&6
11437 if test "$with_ext_funcs" = yes ; then
11438         NCURSES_EXT_FUNCS=1
11439
11440 cat >>confdefs.h <<\EOF
11441 #define HAVE_USE_DEFAULT_COLORS 1
11442 EOF
11443
11444 cat >>confdefs.h <<\EOF
11445 #define NCURSES_EXT_FUNCS 1
11446 EOF
11447
11448 else
11449         NCURSES_EXT_FUNCS=0
11450 fi
11451
11452 ###   use option --enable-const to turn on use of const beyond that in XSI.
11453 echo "$as_me:11453: checking for extended use of const keyword" >&5
11454 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11455
11456 # Check whether --enable-const or --disable-const was given.
11457 if test "${enable_const+set}" = set; then
11458   enableval="$enable_const"
11459   with_ext_const=$enableval
11460 else
11461   with_ext_const=no
11462 fi;
11463 echo "$as_me:11463: result: $with_ext_const" >&5
11464 echo "${ECHO_T}$with_ext_const" >&6
11465 NCURSES_CONST='/*nothing*/'
11466 if test "$with_ext_const" = yes ; then
11467         NCURSES_CONST=const
11468 fi
11469
11470 ###############################################################################
11471 # These options are relatively safe to experiment with.
11472
11473 echo "$as_me:11473: checking if you want all development code" >&5
11474 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11475
11476 # Check whether --with-develop or --without-develop was given.
11477 if test "${with_develop+set}" = set; then
11478   withval="$with_develop"
11479   with_develop=$withval
11480 else
11481   with_develop=no
11482 fi;
11483 echo "$as_me:11483: result: $with_develop" >&5
11484 echo "${ECHO_T}$with_develop" >&6
11485
11486 ###############################################################################
11487 # These are just experimental, probably should not be in a package:
11488
11489 # This is still experimental (20080329), but should ultimately be moved to
11490 # the script-block --with-normal, etc.
11491
11492 echo "$as_me:11492: checking if you want to link with the pthread library" >&5
11493 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11494
11495 # Check whether --with-pthread or --without-pthread was given.
11496 if test "${with_pthread+set}" = set; then
11497   withval="$with_pthread"
11498   with_pthread=$withval
11499 else
11500   with_pthread=no
11501 fi;
11502 echo "$as_me:11502: result: $with_pthread" >&5
11503 echo "${ECHO_T}$with_pthread" >&6
11504
11505 if test "$with_pthread" != no ; then
11506         echo "$as_me:11506: checking for pthread.h" >&5
11507 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11508 if test "${ac_cv_header_pthread_h+set}" = set; then
11509   echo $ECHO_N "(cached) $ECHO_C" >&6
11510 else
11511   cat >conftest.$ac_ext <<_ACEOF
11512 #line 11512 "configure"
11513 #include "confdefs.h"
11514 #include <pthread.h>
11515 _ACEOF
11516 if { (eval echo "$as_me:11516: \"$ac_cpp conftest.$ac_ext\"") >&5
11517   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11518   ac_status=$?
11519   egrep -v '^ *\+' conftest.er1 >conftest.err
11520   rm -f conftest.er1
11521   cat conftest.err >&5
11522   echo "$as_me:11522: \$? = $ac_status" >&5
11523   (exit $ac_status); } >/dev/null; then
11524   if test -s conftest.err; then
11525     ac_cpp_err=$ac_c_preproc_warn_flag
11526   else
11527     ac_cpp_err=
11528   fi
11529 else
11530   ac_cpp_err=yes
11531 fi
11532 if test -z "$ac_cpp_err"; then
11533   ac_cv_header_pthread_h=yes
11534 else
11535   echo "$as_me: failed program was:" >&5
11536   cat conftest.$ac_ext >&5
11537   ac_cv_header_pthread_h=no
11538 fi
11539 rm -f conftest.err conftest.$ac_ext
11540 fi
11541 echo "$as_me:11541: result: $ac_cv_header_pthread_h" >&5
11542 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11543 if test $ac_cv_header_pthread_h = yes; then
11544
11545 cat >>confdefs.h <<\EOF
11546 #define HAVE_PTHREADS_H 1
11547 EOF
11548
11549         for cf_lib_pthread in pthread c_r
11550         do
11551             echo "$as_me:11551: checking if we can link with the $cf_lib_pthread library" >&5
11552 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11553             cf_save_LIBS="$LIBS"
11554
11555 cf_add_libs="-l$cf_lib_pthread"
11556 # Filter out duplicates - this happens with badly-designed ".pc" files...
11557 for cf_add_1lib in $LIBS
11558 do
11559         for cf_add_2lib in $cf_add_libs
11560         do
11561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11562                 then
11563                         cf_add_1lib=
11564                         break
11565                 fi
11566         done
11567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11568 done
11569 LIBS="$cf_add_libs"
11570
11571             cat >conftest.$ac_ext <<_ACEOF
11572 #line 11572 "configure"
11573 #include "confdefs.h"
11574
11575 #include <pthread.h>
11576
11577 int
11578 main ()
11579 {
11580
11581                 int rc = pthread_create(0,0,0,0);
11582                 int r2 = pthread_mutexattr_settype(0, 0);
11583
11584   ;
11585   return 0;
11586 }
11587 _ACEOF
11588 rm -f conftest.$ac_objext conftest$ac_exeext
11589 if { (eval echo "$as_me:11589: \"$ac_link\"") >&5
11590   (eval $ac_link) 2>&5
11591   ac_status=$?
11592   echo "$as_me:11592: \$? = $ac_status" >&5
11593   (exit $ac_status); } &&
11594          { ac_try='test -s conftest$ac_exeext'
11595   { (eval echo "$as_me:11595: \"$ac_try\"") >&5
11596   (eval $ac_try) 2>&5
11597   ac_status=$?
11598   echo "$as_me:11598: \$? = $ac_status" >&5
11599   (exit $ac_status); }; }; then
11600   with_pthread=yes
11601 else
11602   echo "$as_me: failed program was:" >&5
11603 cat conftest.$ac_ext >&5
11604 with_pthread=no
11605 fi
11606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11607             LIBS="$cf_save_LIBS"
11608             echo "$as_me:11608: result: $with_pthread" >&5
11609 echo "${ECHO_T}$with_pthread" >&6
11610             test "$with_pthread" = yes && break
11611         done
11612
11613         if test "$with_pthread" = yes ; then
11614
11615 cf_add_libs="-l$cf_lib_pthread"
11616 # Filter out duplicates - this happens with badly-designed ".pc" files...
11617 for cf_add_1lib in $LIBS
11618 do
11619         for cf_add_2lib in $cf_add_libs
11620         do
11621                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11622                 then
11623                         cf_add_1lib=
11624                         break
11625                 fi
11626         done
11627         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11628 done
11629 LIBS="$cf_add_libs"
11630
11631 cat >>confdefs.h <<\EOF
11632 #define HAVE_LIBPTHREADS 1
11633 EOF
11634
11635         else
11636             { { echo "$as_me:11636: error: Cannot link with pthread library" >&5
11637 echo "$as_me: error: Cannot link with pthread library" >&2;}
11638    { (exit 1); exit 1; }; }
11639         fi
11640
11641 fi
11642
11643 fi
11644
11645 echo "$as_me:11645: checking if you want to use weak-symbols for pthreads" >&5
11646 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11647
11648 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11649 if test "${enable_weak_symbols+set}" = set; then
11650   enableval="$enable_weak_symbols"
11651   use_weak_symbols=$withval
11652 else
11653   use_weak_symbols=no
11654 fi;
11655 echo "$as_me:11655: result: $use_weak_symbols" >&5
11656 echo "${ECHO_T}$use_weak_symbols" >&6
11657 if test "$use_weak_symbols" = yes ; then
11658
11659 echo "$as_me:11659: checking if $CC supports weak symbols" >&5
11660 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11661 if test "${cf_cv_weak_symbols+set}" = set; then
11662   echo $ECHO_N "(cached) $ECHO_C" >&6
11663 else
11664
11665 cat >conftest.$ac_ext <<_ACEOF
11666 #line 11666 "configure"
11667 #include "confdefs.h"
11668
11669 #include <stdio.h>
11670 int
11671 main ()
11672 {
11673
11674 #if defined(__GNUC__)
11675 #  if defined __USE_ISOC99
11676 #    define _cat_pragma(exp)    _Pragma(#exp)
11677 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11678 #  else
11679 #    define _weak_pragma(exp)
11680 #  endif
11681 #  define _declare(name)        __extension__ extern __typeof__(name) name
11682 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11683 #endif
11684
11685 weak_symbol(fopen);
11686
11687   ;
11688   return 0;
11689 }
11690 _ACEOF
11691 rm -f conftest.$ac_objext
11692 if { (eval echo "$as_me:11692: \"$ac_compile\"") >&5
11693   (eval $ac_compile) 2>&5
11694   ac_status=$?
11695   echo "$as_me:11695: \$? = $ac_status" >&5
11696   (exit $ac_status); } &&
11697          { ac_try='test -s conftest.$ac_objext'
11698   { (eval echo "$as_me:11698: \"$ac_try\"") >&5
11699   (eval $ac_try) 2>&5
11700   ac_status=$?
11701   echo "$as_me:11701: \$? = $ac_status" >&5
11702   (exit $ac_status); }; }; then
11703   cf_cv_weak_symbols=yes
11704 else
11705   echo "$as_me: failed program was:" >&5
11706 cat conftest.$ac_ext >&5
11707 cf_cv_weak_symbols=no
11708 fi
11709 rm -f conftest.$ac_objext conftest.$ac_ext
11710
11711 fi
11712 echo "$as_me:11712: result: $cf_cv_weak_symbols" >&5
11713 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11714
11715 else
11716         cf_cv_weak_symbols=no
11717 fi
11718
11719 if test $cf_cv_weak_symbols = yes ; then
11720
11721 cat >>confdefs.h <<\EOF
11722 #define USE_WEAK_SYMBOLS 1
11723 EOF
11724
11725 fi
11726
11727 PTHREAD=
11728 if test "$with_pthread" = "yes" ; then
11729
11730 cat >>confdefs.h <<\EOF
11731 #define USE_PTHREADS 1
11732 EOF
11733
11734         enable_reentrant=yes
11735         if test $cf_cv_weak_symbols = yes ; then
11736                 PTHREAD=-lpthread
11737         fi
11738 fi
11739
11740 # OpenSUSE is installing ncurses6, using reentrant option.
11741 echo "$as_me:11741: checking for _nc_TABSIZE" >&5
11742 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11743 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11744   echo $ECHO_N "(cached) $ECHO_C" >&6
11745 else
11746   cat >conftest.$ac_ext <<_ACEOF
11747 #line 11747 "configure"
11748 #include "confdefs.h"
11749 /* System header to define __stub macros and hopefully few prototypes,
11750     which can conflict with char _nc_TABSIZE (); below.  */
11751 #include <assert.h>
11752 /* Override any gcc2 internal prototype to avoid an error.  */
11753 #ifdef __cplusplus
11754 extern "C"
11755 #endif
11756 /* We use char because int might match the return type of a gcc2
11757    builtin and then its argument prototype would still apply.  */
11758 char _nc_TABSIZE ();
11759 char (*f) ();
11760
11761 int
11762 main ()
11763 {
11764 /* The GNU C library defines this for functions which it implements
11765     to always fail with ENOSYS.  Some functions are actually named
11766     something starting with __ and the normal name is an alias.  */
11767 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11768 choke me
11769 #else
11770 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11771 #endif
11772
11773   ;
11774   return 0;
11775 }
11776 _ACEOF
11777 rm -f conftest.$ac_objext conftest$ac_exeext
11778 if { (eval echo "$as_me:11778: \"$ac_link\"") >&5
11779   (eval $ac_link) 2>&5
11780   ac_status=$?
11781   echo "$as_me:11781: \$? = $ac_status" >&5
11782   (exit $ac_status); } &&
11783          { ac_try='test -s conftest$ac_exeext'
11784   { (eval echo "$as_me:11784: \"$ac_try\"") >&5
11785   (eval $ac_try) 2>&5
11786   ac_status=$?
11787   echo "$as_me:11787: \$? = $ac_status" >&5
11788   (exit $ac_status); }; }; then
11789   ac_cv_func__nc_TABSIZE=yes
11790 else
11791   echo "$as_me: failed program was:" >&5
11792 cat conftest.$ac_ext >&5
11793 ac_cv_func__nc_TABSIZE=no
11794 fi
11795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11796 fi
11797 echo "$as_me:11797: result: $ac_cv_func__nc_TABSIZE" >&5
11798 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11799 if test $ac_cv_func__nc_TABSIZE = yes; then
11800   assume_reentrant=yes
11801 else
11802   assume_reentrant=no
11803 fi
11804
11805 # Reentrant code has to be opaque; there's little advantage to making ncurses
11806 # opaque outside of that, so there is no --enable-opaque option.  We can use
11807 # this option without --with-pthreads, but this will be always set for
11808 # pthreads.
11809 echo "$as_me:11809: checking if you want experimental reentrant code" >&5
11810 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11811
11812 # Check whether --enable-reentrant or --disable-reentrant was given.
11813 if test "${enable_reentrant+set}" = set; then
11814   enableval="$enable_reentrant"
11815   with_reentrant=$enableval
11816 else
11817   with_reentrant=$assume_reentrant
11818 fi;
11819 echo "$as_me:11819: result: $with_reentrant" >&5
11820 echo "${ECHO_T}$with_reentrant" >&6
11821 if test "$with_reentrant" = yes ; then
11822         cf_cv_enable_reentrant=1
11823         if test $cf_cv_weak_symbols = yes ; then
11824
11825 # remove pthread library from $LIBS
11826 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11827
11828         elif test "$assume_reentrant" = no ; then
11829                 LIB_SUFFIX="t${LIB_SUFFIX}"
11830         fi
11831
11832 cat >>confdefs.h <<\EOF
11833 #define USE_REENTRANT 1
11834 EOF
11835
11836 else
11837         cf_cv_enable_reentrant=0
11838 fi
11839
11840 ### Allow using a different wrap-prefix
11841 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11842         echo "$as_me:11842: checking for prefix used to wrap public variables" >&5
11843 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11844
11845 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11846 if test "${with_wrap_prefix+set}" = set; then
11847   withval="$with_wrap_prefix"
11848   NCURSES_WRAP_PREFIX=$withval
11849 else
11850   NCURSES_WRAP_PREFIX=_nc_
11851 fi;
11852         echo "$as_me:11852: result: $NCURSES_WRAP_PREFIX" >&5
11853 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11854 else
11855         NCURSES_WRAP_PREFIX=_nc_
11856 fi
11857
11858 cat >>confdefs.h <<EOF
11859 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11860 EOF
11861
11862 ###############################################################################
11863
11864 ###     use option --disable-echo to suppress full display compiling commands
11865
11866 echo "$as_me:11866: checking if you want to see long compiling messages" >&5
11867 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11868
11869 # Check whether --enable-echo or --disable-echo was given.
11870 if test "${enable_echo+set}" = set; then
11871   enableval="$enable_echo"
11872   test "$enableval" != no && enableval=yes
11873         if test "$enableval" != "yes" ; then
11874
11875         ECHO_LT='--silent'
11876         ECHO_LD='@echo linking $@;'
11877         RULE_CC='@echo compiling $<'
11878         SHOW_CC='@echo compiling $@'
11879         ECHO_CC='@'
11880
11881         else
11882
11883         ECHO_LT=''
11884         ECHO_LD=''
11885         RULE_CC=''
11886         SHOW_CC=''
11887         ECHO_CC=''
11888
11889         fi
11890 else
11891   enableval=yes
11892
11893         ECHO_LT=''
11894         ECHO_LD=''
11895         RULE_CC=''
11896         SHOW_CC=''
11897         ECHO_CC=''
11898
11899 fi;
11900 echo "$as_me:11900: result: $enableval" >&5
11901 echo "${ECHO_T}$enableval" >&6
11902
11903 ###     use option --enable-warnings to turn on all gcc warnings
11904 echo "$as_me:11904: checking if you want to see compiler warnings" >&5
11905 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11906
11907 # Check whether --enable-warnings or --disable-warnings was given.
11908 if test "${enable_warnings+set}" = set; then
11909   enableval="$enable_warnings"
11910   with_warnings=$enableval
11911 fi;
11912 echo "$as_me:11912: result: $with_warnings" >&5
11913 echo "${ECHO_T}$with_warnings" >&6
11914
11915 if test "x$with_warnings" = "xyes"; then
11916
11917         ADAFLAGS="$ADAFLAGS -gnatg"
11918
11919 INTEL_COMPILER=no
11920
11921 if test "$GCC" = yes ; then
11922         case $host_os in
11923         (linux*|gnu*)
11924                 echo "$as_me:11924: checking if this is really Intel C compiler" >&5
11925 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11926                 cf_save_CFLAGS="$CFLAGS"
11927                 CFLAGS="$CFLAGS -no-gcc"
11928                 cat >conftest.$ac_ext <<_ACEOF
11929 #line 11929 "configure"
11930 #include "confdefs.h"
11931
11932 int
11933 main ()
11934 {
11935
11936 #ifdef __INTEL_COMPILER
11937 #else
11938 make an error
11939 #endif
11940
11941   ;
11942   return 0;
11943 }
11944 _ACEOF
11945 rm -f conftest.$ac_objext
11946 if { (eval echo "$as_me:11946: \"$ac_compile\"") >&5
11947   (eval $ac_compile) 2>&5
11948   ac_status=$?
11949   echo "$as_me:11949: \$? = $ac_status" >&5
11950   (exit $ac_status); } &&
11951          { ac_try='test -s conftest.$ac_objext'
11952   { (eval echo "$as_me:11952: \"$ac_try\"") >&5
11953   (eval $ac_try) 2>&5
11954   ac_status=$?
11955   echo "$as_me:11955: \$? = $ac_status" >&5
11956   (exit $ac_status); }; }; then
11957   INTEL_COMPILER=yes
11958 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11959
11960 else
11961   echo "$as_me: failed program was:" >&5
11962 cat conftest.$ac_ext >&5
11963 fi
11964 rm -f conftest.$ac_objext conftest.$ac_ext
11965                 CFLAGS="$cf_save_CFLAGS"
11966                 echo "$as_me:11966: result: $INTEL_COMPILER" >&5
11967 echo "${ECHO_T}$INTEL_COMPILER" >&6
11968                 ;;
11969         esac
11970 fi
11971
11972 CLANG_COMPILER=no
11973
11974 if test "$GCC" = yes ; then
11975         echo "$as_me:11975: checking if this is really Clang C compiler" >&5
11976 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11977         cf_save_CFLAGS="$CFLAGS"
11978         CFLAGS="$CFLAGS -Qunused-arguments"
11979         cat >conftest.$ac_ext <<_ACEOF
11980 #line 11980 "configure"
11981 #include "confdefs.h"
11982
11983 int
11984 main ()
11985 {
11986
11987 #ifdef __clang__
11988 #else
11989 make an error
11990 #endif
11991
11992   ;
11993   return 0;
11994 }
11995 _ACEOF
11996 rm -f conftest.$ac_objext
11997 if { (eval echo "$as_me:11997: \"$ac_compile\"") >&5
11998   (eval $ac_compile) 2>&5
11999   ac_status=$?
12000   echo "$as_me:12000: \$? = $ac_status" >&5
12001   (exit $ac_status); } &&
12002          { ac_try='test -s conftest.$ac_objext'
12003   { (eval echo "$as_me:12003: \"$ac_try\"") >&5
12004   (eval $ac_try) 2>&5
12005   ac_status=$?
12006   echo "$as_me:12006: \$? = $ac_status" >&5
12007   (exit $ac_status); }; }; then
12008   CLANG_COMPILER=yes
12009 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12010
12011 else
12012   echo "$as_me: failed program was:" >&5
12013 cat conftest.$ac_ext >&5
12014 fi
12015 rm -f conftest.$ac_objext conftest.$ac_ext
12016         CFLAGS="$cf_save_CFLAGS"
12017         echo "$as_me:12017: result: $CLANG_COMPILER" >&5
12018 echo "${ECHO_T}$CLANG_COMPILER" >&6
12019 fi
12020
12021 cat > conftest.$ac_ext <<EOF
12022 #line 12022 "${as_me:-configure}"
12023 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12024 EOF
12025
12026 if test "$INTEL_COMPILER" = yes
12027 then
12028 # The "-wdXXX" options suppress warnings:
12029 # remark #1419: external declaration in primary source file
12030 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12031 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12032 # remark #193: zero used for undefined preprocessing identifier
12033 # remark #593: variable "curs_sb_left_arrow" was set but never used
12034 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12035 # remark #869: parameter "tw" was never referenced
12036 # remark #981: operands are evaluated in unspecified order
12037 # warning #279: controlling expression is constant
12038
12039         { echo "$as_me:12039: checking for $CC warning options..." >&5
12040 echo "$as_me: checking for $CC warning options..." >&6;}
12041         cf_save_CFLAGS="$CFLAGS"
12042         EXTRA_CFLAGS="-Wall"
12043         for cf_opt in \
12044                 wd1419 \
12045                 wd1683 \
12046                 wd1684 \
12047                 wd193 \
12048                 wd593 \
12049                 wd279 \
12050                 wd810 \
12051                 wd869 \
12052                 wd981
12053         do
12054                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12055                 if { (eval echo "$as_me:12055: \"$ac_compile\"") >&5
12056   (eval $ac_compile) 2>&5
12057   ac_status=$?
12058   echo "$as_me:12058: \$? = $ac_status" >&5
12059   (exit $ac_status); }; then
12060                         test -n "$verbose" && echo "$as_me:12060: result: ... -$cf_opt" >&5
12061 echo "${ECHO_T}... -$cf_opt" >&6
12062                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12063                 fi
12064         done
12065         CFLAGS="$cf_save_CFLAGS"
12066
12067 elif test "$GCC" = yes
12068 then
12069         { echo "$as_me:12069: checking for $CC warning options..." >&5
12070 echo "$as_me: checking for $CC warning options..." >&6;}
12071         cf_save_CFLAGS="$CFLAGS"
12072         EXTRA_CFLAGS=
12073         cf_warn_CONST=""
12074         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12075         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12076         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12077         for cf_opt in W Wall \
12078                 Wbad-function-cast \
12079                 Wcast-align \
12080                 Wcast-qual \
12081                 Wdeclaration-after-statement \
12082                 Wextra \
12083                 Winline \
12084                 Wmissing-declarations \
12085                 Wmissing-prototypes \
12086                 Wnested-externs \
12087                 Wpointer-arith \
12088                 Wshadow \
12089                 Wstrict-prototypes \
12090                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12091         do
12092                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12093                 if { (eval echo "$as_me:12093: \"$ac_compile\"") >&5
12094   (eval $ac_compile) 2>&5
12095   ac_status=$?
12096   echo "$as_me:12096: \$? = $ac_status" >&5
12097   (exit $ac_status); }; then
12098                         test -n "$verbose" && echo "$as_me:12098: result: ... -$cf_opt" >&5
12099 echo "${ECHO_T}... -$cf_opt" >&6
12100                         case $cf_opt in
12101                         (Wcast-qual)
12102                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12103                                 ;;
12104                         (Winline)
12105                                 case $GCC_VERSION in
12106                                 ([34].*)
12107                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12108
12109 echo "${as_me:-configure}:12109: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12110
12111                                         continue;;
12112                                 esac
12113                                 ;;
12114                         (Wpointer-arith)
12115                                 case $GCC_VERSION in
12116                                 ([12].*)
12117                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12118
12119 echo "${as_me:-configure}:12119: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12120
12121                                         continue;;
12122                                 esac
12123                                 ;;
12124                         esac
12125                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12126                 fi
12127         done
12128         CFLAGS="$cf_save_CFLAGS"
12129 fi
12130 rm -rf conftest*
12131
12132 fi
12133
12134 if test "$GCC" = yes
12135 then
12136 cat > conftest.i <<EOF
12137 #ifndef GCC_PRINTF
12138 #define GCC_PRINTF 0
12139 #endif
12140 #ifndef GCC_SCANF
12141 #define GCC_SCANF 0
12142 #endif
12143 #ifndef GCC_NORETURN
12144 #define GCC_NORETURN /* nothing */
12145 #endif
12146 #ifndef GCC_UNUSED
12147 #define GCC_UNUSED /* nothing */
12148 #endif
12149 EOF
12150 if test "$GCC" = yes
12151 then
12152         { echo "$as_me:12152: checking for $CC __attribute__ directives..." >&5
12153 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12154 cat > conftest.$ac_ext <<EOF
12155 #line 12155 "${as_me:-configure}"
12156 #include "confdefs.h"
12157 #include "conftest.h"
12158 #include "conftest.i"
12159 #if     GCC_PRINTF
12160 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12161 #else
12162 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12163 #endif
12164 #if     GCC_SCANF
12165 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12166 #else
12167 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12168 #endif
12169 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12170 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12171 extern void foo(void) GCC_NORETURN;
12172 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12173 EOF
12174         cf_printf_attribute=no
12175         cf_scanf_attribute=no
12176         for cf_attribute in scanf printf unused noreturn
12177         do
12178
12179 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12180
12181                 cf_directive="__attribute__(($cf_attribute))"
12182                 echo "checking for $CC $cf_directive" 1>&5
12183
12184                 case $cf_attribute in
12185                 (printf)
12186                         cf_printf_attribute=yes
12187                         cat >conftest.h <<EOF
12188 #define GCC_$cf_ATTRIBUTE 1
12189 EOF
12190                         ;;
12191                 (scanf)
12192                         cf_scanf_attribute=yes
12193                         cat >conftest.h <<EOF
12194 #define GCC_$cf_ATTRIBUTE 1
12195 EOF
12196                         ;;
12197                 (*)
12198                         cat >conftest.h <<EOF
12199 #define GCC_$cf_ATTRIBUTE $cf_directive
12200 EOF
12201                         ;;
12202                 esac
12203
12204                 if { (eval echo "$as_me:12204: \"$ac_compile\"") >&5
12205   (eval $ac_compile) 2>&5
12206   ac_status=$?
12207   echo "$as_me:12207: \$? = $ac_status" >&5
12208   (exit $ac_status); }; then
12209                         test -n "$verbose" && echo "$as_me:12209: result: ... $cf_attribute" >&5
12210 echo "${ECHO_T}... $cf_attribute" >&6
12211                         cat conftest.h >>confdefs.h
12212                         case $cf_attribute in
12213                         (noreturn)
12214
12215 cat >>confdefs.h <<EOF
12216 #define GCC_NORETURN $cf_directive
12217 EOF
12218
12219                                 ;;
12220                         (printf)
12221                                 cf_value='/* nothing */'
12222                                 if test "$cf_printf_attribute" != no ; then
12223                                         cf_value='__attribute__((format(printf,fmt,var)))'
12224
12225 cat >>confdefs.h <<\EOF
12226 #define GCC_PRINTF 1
12227 EOF
12228
12229                                 fi
12230
12231 cat >>confdefs.h <<EOF
12232 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12233 EOF
12234
12235                                 ;;
12236                         (scanf)
12237                                 cf_value='/* nothing */'
12238                                 if test "$cf_scanf_attribute" != no ; then
12239                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12240
12241 cat >>confdefs.h <<\EOF
12242 #define GCC_SCANF 1
12243 EOF
12244
12245                                 fi
12246
12247 cat >>confdefs.h <<EOF
12248 #define GCC_SCANFLIKE(fmt,var) $cf_value
12249 EOF
12250
12251                                 ;;
12252                         (unused)
12253
12254 cat >>confdefs.h <<EOF
12255 #define GCC_UNUSED $cf_directive
12256 EOF
12257
12258                                 ;;
12259                         esac
12260                 fi
12261         done
12262 else
12263         fgrep define conftest.i >>confdefs.h
12264 fi
12265 rm -rf conftest*
12266 fi
12267
12268 ###     use option --enable-assertions to turn on generation of assertion code
12269 echo "$as_me:12269: checking if you want to enable runtime assertions" >&5
12270 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12271
12272 # Check whether --enable-assertions or --disable-assertions was given.
12273 if test "${enable_assertions+set}" = set; then
12274   enableval="$enable_assertions"
12275   with_assertions=$enableval
12276 else
12277   with_assertions=no
12278 fi;
12279 echo "$as_me:12279: result: $with_assertions" >&5
12280 echo "${ECHO_T}$with_assertions" >&6
12281 if test -n "$GCC"
12282 then
12283         if test "$with_assertions" = no
12284         then
12285                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12286         else
12287
12288         ADAFLAGS="$ADAFLAGS -gnata"
12289
12290         fi
12291 fi
12292
12293 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12294
12295 cat >>confdefs.h <<\EOF
12296 #define HAVE_NC_ALLOC_H 1
12297 EOF
12298
12299 ###     use option --enable-expanded to generate certain macros as functions
12300
12301 # Check whether --enable-expanded or --disable-expanded was given.
12302 if test "${enable_expanded+set}" = set; then
12303   enableval="$enable_expanded"
12304   test "$enableval" = yes &&
12305 cat >>confdefs.h <<\EOF
12306 #define NCURSES_EXPANDED 1
12307 EOF
12308
12309 fi;
12310
12311 ###     use option --disable-macros to suppress macros in favor of functions
12312
12313 # Check whether --enable-macros or --disable-macros was given.
12314 if test "${enable_macros+set}" = set; then
12315   enableval="$enable_macros"
12316   test "$enableval" = no &&
12317 cat >>confdefs.h <<\EOF
12318 #define NCURSES_NOMACROS 1
12319 EOF
12320
12321 fi;
12322
12323 # Normally we only add trace() to the debug-library.  Allow this to be
12324 # extended to all models of the ncurses library:
12325 cf_all_traces=no
12326 case "$CFLAGS $CPPFLAGS" in
12327 (*-DTRACE*)
12328         cf_all_traces=yes
12329         ;;
12330 esac
12331
12332 echo "$as_me:12332: checking whether to add trace feature to all models" >&5
12333 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12334
12335 # Check whether --with-trace or --without-trace was given.
12336 if test "${with_trace+set}" = set; then
12337   withval="$with_trace"
12338   cf_with_trace=$withval
12339 else
12340   cf_with_trace=$cf_all_traces
12341 fi;
12342 echo "$as_me:12342: result: $cf_with_trace" >&5
12343 echo "${ECHO_T}$cf_with_trace" >&6
12344
12345 if test "$cf_with_trace" = yes ; then
12346         ADA_TRACE=TRUE
12347
12348 cf_fix_cppflags=no
12349 cf_new_cflags=
12350 cf_new_cppflags=
12351 cf_new_extra_cppflags=
12352
12353 for cf_add_cflags in -DTRACE
12354 do
12355 case $cf_fix_cppflags in
12356 (no)
12357         case $cf_add_cflags in
12358         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12359                 case $cf_add_cflags in
12360                 (-D*)
12361                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12362
12363                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12364                                 && test -z "${cf_tst_cflags}" \
12365                                 && cf_fix_cppflags=yes
12366
12367                         if test $cf_fix_cppflags = yes ; then
12368                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12369                                 continue
12370                         elif test "${cf_tst_cflags}" = "\"'" ; then
12371                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12372                                 continue
12373                         fi
12374                         ;;
12375                 esac
12376                 case "$CPPFLAGS" in
12377                 (*$cf_add_cflags)
12378                         ;;
12379                 (*)
12380                         case $cf_add_cflags in
12381                         (-D*)
12382                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12383
12384 CPPFLAGS=`echo "$CPPFLAGS" | \
12385         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12386                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12387
12388                                 ;;
12389                         esac
12390                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12391                         ;;
12392                 esac
12393                 ;;
12394         (*)
12395                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12396                 ;;
12397         esac
12398         ;;
12399 (yes)
12400         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12401
12402         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12403
12404         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12405                 && test -z "${cf_tst_cflags}" \
12406                 && cf_fix_cppflags=no
12407         ;;
12408 esac
12409 done
12410
12411 if test -n "$cf_new_cflags" ; then
12412
12413         CFLAGS="$CFLAGS $cf_new_cflags"
12414 fi
12415
12416 if test -n "$cf_new_cppflags" ; then
12417
12418         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12419 fi
12420
12421 if test -n "$cf_new_extra_cppflags" ; then
12422
12423         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12424 fi
12425
12426 else
12427         ADA_TRACE=FALSE
12428 fi
12429
12430 echo "$as_me:12430: checking if we want to use GNAT projects" >&5
12431 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12432
12433 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12434 if test "${enable_gnat_projects+set}" = set; then
12435   enableval="$enable_gnat_projects"
12436   test "$enableval" != no && enableval=yes
12437         if test "$enableval" != "yes" ; then
12438     enable_gnat_projects=no
12439         else
12440                 enable_gnat_projects=yes
12441         fi
12442 else
12443   enableval=yes
12444         enable_gnat_projects=yes
12445
12446 fi;
12447 echo "$as_me:12447: result: $enable_gnat_projects" >&5
12448 echo "${ECHO_T}$enable_gnat_projects" >&6
12449
12450 ###     Checks for libraries.
12451 case $cf_cv_system_name in
12452 (*mingw32*)
12453         ;;
12454 (*)
12455 echo "$as_me:12455: checking for gettimeofday" >&5
12456 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12457 if test "${ac_cv_func_gettimeofday+set}" = set; then
12458   echo $ECHO_N "(cached) $ECHO_C" >&6
12459 else
12460   cat >conftest.$ac_ext <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463 /* System header to define __stub macros and hopefully few prototypes,
12464     which can conflict with char gettimeofday (); below.  */
12465 #include <assert.h>
12466 /* Override any gcc2 internal prototype to avoid an error.  */
12467 #ifdef __cplusplus
12468 extern "C"
12469 #endif
12470 /* We use char because int might match the return type of a gcc2
12471    builtin and then its argument prototype would still apply.  */
12472 char gettimeofday ();
12473 char (*f) ();
12474
12475 int
12476 main ()
12477 {
12478 /* The GNU C library defines this for functions which it implements
12479     to always fail with ENOSYS.  Some functions are actually named
12480     something starting with __ and the normal name is an alias.  */
12481 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12482 choke me
12483 #else
12484 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12485 #endif
12486
12487   ;
12488   return 0;
12489 }
12490 _ACEOF
12491 rm -f conftest.$ac_objext conftest$ac_exeext
12492 if { (eval echo "$as_me:12492: \"$ac_link\"") >&5
12493   (eval $ac_link) 2>&5
12494   ac_status=$?
12495   echo "$as_me:12495: \$? = $ac_status" >&5
12496   (exit $ac_status); } &&
12497          { ac_try='test -s conftest$ac_exeext'
12498   { (eval echo "$as_me:12498: \"$ac_try\"") >&5
12499   (eval $ac_try) 2>&5
12500   ac_status=$?
12501   echo "$as_me:12501: \$? = $ac_status" >&5
12502   (exit $ac_status); }; }; then
12503   ac_cv_func_gettimeofday=yes
12504 else
12505   echo "$as_me: failed program was:" >&5
12506 cat conftest.$ac_ext >&5
12507 ac_cv_func_gettimeofday=no
12508 fi
12509 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12510 fi
12511 echo "$as_me:12511: result: $ac_cv_func_gettimeofday" >&5
12512 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12513 if test $ac_cv_func_gettimeofday = yes; then
12514   cat >>confdefs.h <<\EOF
12515 #define HAVE_GETTIMEOFDAY 1
12516 EOF
12517
12518 else
12519
12520 echo "$as_me:12520: checking for gettimeofday in -lbsd" >&5
12521 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12522 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12523   echo $ECHO_N "(cached) $ECHO_C" >&6
12524 else
12525   ac_check_lib_save_LIBS=$LIBS
12526 LIBS="-lbsd  $LIBS"
12527 cat >conftest.$ac_ext <<_ACEOF
12528 #line 12528 "configure"
12529 #include "confdefs.h"
12530
12531 /* Override any gcc2 internal prototype to avoid an error.  */
12532 #ifdef __cplusplus
12533 extern "C"
12534 #endif
12535 /* We use char because int might match the return type of a gcc2
12536    builtin and then its argument prototype would still apply.  */
12537 char gettimeofday ();
12538 int
12539 main ()
12540 {
12541 gettimeofday ();
12542   ;
12543   return 0;
12544 }
12545 _ACEOF
12546 rm -f conftest.$ac_objext conftest$ac_exeext
12547 if { (eval echo "$as_me:12547: \"$ac_link\"") >&5
12548   (eval $ac_link) 2>&5
12549   ac_status=$?
12550   echo "$as_me:12550: \$? = $ac_status" >&5
12551   (exit $ac_status); } &&
12552          { ac_try='test -s conftest$ac_exeext'
12553   { (eval echo "$as_me:12553: \"$ac_try\"") >&5
12554   (eval $ac_try) 2>&5
12555   ac_status=$?
12556   echo "$as_me:12556: \$? = $ac_status" >&5
12557   (exit $ac_status); }; }; then
12558   ac_cv_lib_bsd_gettimeofday=yes
12559 else
12560   echo "$as_me: failed program was:" >&5
12561 cat conftest.$ac_ext >&5
12562 ac_cv_lib_bsd_gettimeofday=no
12563 fi
12564 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12565 LIBS=$ac_check_lib_save_LIBS
12566 fi
12567 echo "$as_me:12567: result: $ac_cv_lib_bsd_gettimeofday" >&5
12568 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12569 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12570
12571 cat >>confdefs.h <<\EOF
12572 #define HAVE_GETTIMEOFDAY 1
12573 EOF
12574
12575         LIBS="$LIBS -lbsd"
12576 fi
12577
12578 fi
12579         ;;
12580 esac
12581
12582 ###     Checks for header files.
12583 echo "$as_me:12583: checking for ANSI C header files" >&5
12584 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12585 if test "${ac_cv_header_stdc+set}" = set; then
12586   echo $ECHO_N "(cached) $ECHO_C" >&6
12587 else
12588   cat >conftest.$ac_ext <<_ACEOF
12589 #line 12589 "configure"
12590 #include "confdefs.h"
12591 #include <stdlib.h>
12592 #include <stdarg.h>
12593 #include <string.h>
12594 #include <float.h>
12595
12596 _ACEOF
12597 if { (eval echo "$as_me:12597: \"$ac_cpp conftest.$ac_ext\"") >&5
12598   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12599   ac_status=$?
12600   egrep -v '^ *\+' conftest.er1 >conftest.err
12601   rm -f conftest.er1
12602   cat conftest.err >&5
12603   echo "$as_me:12603: \$? = $ac_status" >&5
12604   (exit $ac_status); } >/dev/null; then
12605   if test -s conftest.err; then
12606     ac_cpp_err=$ac_c_preproc_warn_flag
12607   else
12608     ac_cpp_err=
12609   fi
12610 else
12611   ac_cpp_err=yes
12612 fi
12613 if test -z "$ac_cpp_err"; then
12614   ac_cv_header_stdc=yes
12615 else
12616   echo "$as_me: failed program was:" >&5
12617   cat conftest.$ac_ext >&5
12618   ac_cv_header_stdc=no
12619 fi
12620 rm -f conftest.err conftest.$ac_ext
12621
12622 if test $ac_cv_header_stdc = yes; then
12623   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12624   cat >conftest.$ac_ext <<_ACEOF
12625 #line 12625 "configure"
12626 #include "confdefs.h"
12627 #include <string.h>
12628
12629 _ACEOF
12630 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12631   egrep "memchr" >/dev/null 2>&1; then
12632   :
12633 else
12634   ac_cv_header_stdc=no
12635 fi
12636 rm -rf conftest*
12637
12638 fi
12639
12640 if test $ac_cv_header_stdc = yes; then
12641   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12642   cat >conftest.$ac_ext <<_ACEOF
12643 #line 12643 "configure"
12644 #include "confdefs.h"
12645 #include <stdlib.h>
12646
12647 _ACEOF
12648 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12649   egrep "free" >/dev/null 2>&1; then
12650   :
12651 else
12652   ac_cv_header_stdc=no
12653 fi
12654 rm -rf conftest*
12655
12656 fi
12657
12658 if test $ac_cv_header_stdc = yes; then
12659   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12660   if test "$cross_compiling" = yes; then
12661   :
12662 else
12663   cat >conftest.$ac_ext <<_ACEOF
12664 #line 12664 "configure"
12665 #include "confdefs.h"
12666 #include <ctype.h>
12667 #if ((' ' & 0x0FF) == 0x020)
12668 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12669 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12670 #else
12671 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12672                      || ('j' <= (c) && (c) <= 'r') \
12673                      || ('s' <= (c) && (c) <= 'z'))
12674 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12675 #endif
12676
12677 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12678 int
12679 main ()
12680 {
12681   int i;
12682   for (i = 0; i < 256; i++)
12683     if (XOR (islower (i), ISLOWER (i))
12684         || toupper (i) != TOUPPER (i))
12685       $ac_main_return(2);
12686   $ac_main_return (0);
12687 }
12688 _ACEOF
12689 rm -f conftest$ac_exeext
12690 if { (eval echo "$as_me:12690: \"$ac_link\"") >&5
12691   (eval $ac_link) 2>&5
12692   ac_status=$?
12693   echo "$as_me:12693: \$? = $ac_status" >&5
12694   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12695   { (eval echo "$as_me:12695: \"$ac_try\"") >&5
12696   (eval $ac_try) 2>&5
12697   ac_status=$?
12698   echo "$as_me:12698: \$? = $ac_status" >&5
12699   (exit $ac_status); }; }; then
12700   :
12701 else
12702   echo "$as_me: program exited with status $ac_status" >&5
12703 echo "$as_me: failed program was:" >&5
12704 cat conftest.$ac_ext >&5
12705 ac_cv_header_stdc=no
12706 fi
12707 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12708 fi
12709 fi
12710 fi
12711 echo "$as_me:12711: result: $ac_cv_header_stdc" >&5
12712 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12713 if test $ac_cv_header_stdc = yes; then
12714
12715 cat >>confdefs.h <<\EOF
12716 #define STDC_HEADERS 1
12717 EOF
12718
12719 fi
12720
12721 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
12722
12723 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
12724                   inttypes.h stdint.h unistd.h
12725 do
12726 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12727 echo "$as_me:12727: checking for $ac_header" >&5
12728 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12729 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12730   echo $ECHO_N "(cached) $ECHO_C" >&6
12731 else
12732   cat >conftest.$ac_ext <<_ACEOF
12733 #line 12733 "configure"
12734 #include "confdefs.h"
12735 $ac_includes_default
12736 #include <$ac_header>
12737 _ACEOF
12738 rm -f conftest.$ac_objext
12739 if { (eval echo "$as_me:12739: \"$ac_compile\"") >&5
12740   (eval $ac_compile) 2>&5
12741   ac_status=$?
12742   echo "$as_me:12742: \$? = $ac_status" >&5
12743   (exit $ac_status); } &&
12744          { ac_try='test -s conftest.$ac_objext'
12745   { (eval echo "$as_me:12745: \"$ac_try\"") >&5
12746   (eval $ac_try) 2>&5
12747   ac_status=$?
12748   echo "$as_me:12748: \$? = $ac_status" >&5
12749   (exit $ac_status); }; }; then
12750   eval "$as_ac_Header=yes"
12751 else
12752   echo "$as_me: failed program was:" >&5
12753 cat conftest.$ac_ext >&5
12754 eval "$as_ac_Header=no"
12755 fi
12756 rm -f conftest.$ac_objext conftest.$ac_ext
12757 fi
12758 echo "$as_me:12758: result: `eval echo '${'$as_ac_Header'}'`" >&5
12759 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12760 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12761   cat >>confdefs.h <<EOF
12762 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12763 EOF
12764
12765 fi
12766 done
12767
12768 echo "$as_me:12768: checking for signed char" >&5
12769 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
12770 if test "${ac_cv_type_signed_char+set}" = set; then
12771   echo $ECHO_N "(cached) $ECHO_C" >&6
12772 else
12773   cat >conftest.$ac_ext <<_ACEOF
12774 #line 12774 "configure"
12775 #include "confdefs.h"
12776 $ac_includes_default
12777 int
12778 main ()
12779 {
12780 if ((signed char *) 0)
12781   return 0;
12782 if (sizeof (signed char))
12783   return 0;
12784   ;
12785   return 0;
12786 }
12787 _ACEOF
12788 rm -f conftest.$ac_objext
12789 if { (eval echo "$as_me:12789: \"$ac_compile\"") >&5
12790   (eval $ac_compile) 2>&5
12791   ac_status=$?
12792   echo "$as_me:12792: \$? = $ac_status" >&5
12793   (exit $ac_status); } &&
12794          { ac_try='test -s conftest.$ac_objext'
12795   { (eval echo "$as_me:12795: \"$ac_try\"") >&5
12796   (eval $ac_try) 2>&5
12797   ac_status=$?
12798   echo "$as_me:12798: \$? = $ac_status" >&5
12799   (exit $ac_status); }; }; then
12800   ac_cv_type_signed_char=yes
12801 else
12802   echo "$as_me: failed program was:" >&5
12803 cat conftest.$ac_ext >&5
12804 ac_cv_type_signed_char=no
12805 fi
12806 rm -f conftest.$ac_objext conftest.$ac_ext
12807 fi
12808 echo "$as_me:12808: result: $ac_cv_type_signed_char" >&5
12809 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
12810
12811 echo "$as_me:12811: checking size of signed char" >&5
12812 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
12813 if test "${ac_cv_sizeof_signed_char+set}" = set; then
12814   echo $ECHO_N "(cached) $ECHO_C" >&6
12815 else
12816   if test "$ac_cv_type_signed_char" = yes; then
12817   if test "$cross_compiling" = yes; then
12818   # Depending upon the size, compute the lo and hi bounds.
12819 cat >conftest.$ac_ext <<_ACEOF
12820 #line 12820 "configure"
12821 #include "confdefs.h"
12822 $ac_includes_default
12823 int
12824 main ()
12825 {
12826 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
12827   ;
12828   return 0;
12829 }
12830 _ACEOF
12831 rm -f conftest.$ac_objext
12832 if { (eval echo "$as_me:12832: \"$ac_compile\"") >&5
12833   (eval $ac_compile) 2>&5
12834   ac_status=$?
12835   echo "$as_me:12835: \$? = $ac_status" >&5
12836   (exit $ac_status); } &&
12837          { ac_try='test -s conftest.$ac_objext'
12838   { (eval echo "$as_me:12838: \"$ac_try\"") >&5
12839   (eval $ac_try) 2>&5
12840   ac_status=$?
12841   echo "$as_me:12841: \$? = $ac_status" >&5
12842   (exit $ac_status); }; }; then
12843   ac_lo=0 ac_mid=0
12844   while :; do
12845     cat >conftest.$ac_ext <<_ACEOF
12846 #line 12846 "configure"
12847 #include "confdefs.h"
12848 $ac_includes_default
12849 int
12850 main ()
12851 {
12852 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12853   ;
12854   return 0;
12855 }
12856 _ACEOF
12857 rm -f conftest.$ac_objext
12858 if { (eval echo "$as_me:12858: \"$ac_compile\"") >&5
12859   (eval $ac_compile) 2>&5
12860   ac_status=$?
12861   echo "$as_me:12861: \$? = $ac_status" >&5
12862   (exit $ac_status); } &&
12863          { ac_try='test -s conftest.$ac_objext'
12864   { (eval echo "$as_me:12864: \"$ac_try\"") >&5
12865   (eval $ac_try) 2>&5
12866   ac_status=$?
12867   echo "$as_me:12867: \$? = $ac_status" >&5
12868   (exit $ac_status); }; }; then
12869   ac_hi=$ac_mid; break
12870 else
12871   echo "$as_me: failed program was:" >&5
12872 cat conftest.$ac_ext >&5
12873 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
12874 fi
12875 rm -f conftest.$ac_objext conftest.$ac_ext
12876   done
12877 else
12878   echo "$as_me: failed program was:" >&5
12879 cat conftest.$ac_ext >&5
12880 ac_hi=-1 ac_mid=-1
12881   while :; do
12882     cat >conftest.$ac_ext <<_ACEOF
12883 #line 12883 "configure"
12884 #include "confdefs.h"
12885 $ac_includes_default
12886 int
12887 main ()
12888 {
12889 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
12890   ;
12891   return 0;
12892 }
12893 _ACEOF
12894 rm -f conftest.$ac_objext
12895 if { (eval echo "$as_me:12895: \"$ac_compile\"") >&5
12896   (eval $ac_compile) 2>&5
12897   ac_status=$?
12898   echo "$as_me:12898: \$? = $ac_status" >&5
12899   (exit $ac_status); } &&
12900          { ac_try='test -s conftest.$ac_objext'
12901   { (eval echo "$as_me:12901: \"$ac_try\"") >&5
12902   (eval $ac_try) 2>&5
12903   ac_status=$?
12904   echo "$as_me:12904: \$? = $ac_status" >&5
12905   (exit $ac_status); }; }; then
12906   ac_lo=$ac_mid; break
12907 else
12908   echo "$as_me: failed program was:" >&5
12909 cat conftest.$ac_ext >&5
12910 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12911 fi
12912 rm -f conftest.$ac_objext conftest.$ac_ext
12913   done
12914 fi
12915 rm -f conftest.$ac_objext conftest.$ac_ext
12916 # Binary search between lo and hi bounds.
12917 while test "x$ac_lo" != "x$ac_hi"; do
12918   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12919   cat >conftest.$ac_ext <<_ACEOF
12920 #line 12920 "configure"
12921 #include "confdefs.h"
12922 $ac_includes_default
12923 int
12924 main ()
12925 {
12926 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12927   ;
12928   return 0;
12929 }
12930 _ACEOF
12931 rm -f conftest.$ac_objext
12932 if { (eval echo "$as_me:12932: \"$ac_compile\"") >&5
12933   (eval $ac_compile) 2>&5
12934   ac_status=$?
12935   echo "$as_me:12935: \$? = $ac_status" >&5
12936   (exit $ac_status); } &&
12937          { ac_try='test -s conftest.$ac_objext'
12938   { (eval echo "$as_me:12938: \"$ac_try\"") >&5
12939   (eval $ac_try) 2>&5
12940   ac_status=$?
12941   echo "$as_me:12941: \$? = $ac_status" >&5
12942   (exit $ac_status); }; }; then
12943   ac_hi=$ac_mid
12944 else
12945   echo "$as_me: failed program was:" >&5
12946 cat conftest.$ac_ext >&5
12947 ac_lo=`expr $ac_mid + 1`
12948 fi
12949 rm -f conftest.$ac_objext conftest.$ac_ext
12950 done
12951 ac_cv_sizeof_signed_char=$ac_lo
12952 else
12953   if test "$cross_compiling" = yes; then
12954   { { echo "$as_me:12954: error: cannot run test program while cross compiling" >&5
12955 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12956    { (exit 1); exit 1; }; }
12957 else
12958   cat >conftest.$ac_ext <<_ACEOF
12959 #line 12959 "configure"
12960 #include "confdefs.h"
12961 $ac_includes_default
12962 int
12963 main ()
12964 {
12965 FILE *f = fopen ("conftest.val", "w");
12966 if (!f)
12967   $ac_main_return (1);
12968 fprintf (f, "%d", (sizeof (signed char)));
12969 fclose (f);
12970   ;
12971   return 0;
12972 }
12973 _ACEOF
12974 rm -f conftest$ac_exeext
12975 if { (eval echo "$as_me:12975: \"$ac_link\"") >&5
12976   (eval $ac_link) 2>&5
12977   ac_status=$?
12978   echo "$as_me:12978: \$? = $ac_status" >&5
12979   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12980   { (eval echo "$as_me:12980: \"$ac_try\"") >&5
12981   (eval $ac_try) 2>&5
12982   ac_status=$?
12983   echo "$as_me:12983: \$? = $ac_status" >&5
12984   (exit $ac_status); }; }; then
12985   ac_cv_sizeof_signed_char=`cat conftest.val`
12986 else
12987   echo "$as_me: program exited with status $ac_status" >&5
12988 echo "$as_me: failed program was:" >&5
12989 cat conftest.$ac_ext >&5
12990 fi
12991 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12992 fi
12993 fi
12994 rm -f conftest.val
12995 else
12996   ac_cv_sizeof_signed_char=0
12997 fi
12998 fi
12999 echo "$as_me:12999: result: $ac_cv_sizeof_signed_char" >&5
13000 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13001 cat >>confdefs.h <<EOF
13002 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13003 EOF
13004
13005 echo "$as_me:13005: checking for ANSI C header files" >&5
13006 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13007 if test "${ac_cv_header_stdc+set}" = set; then
13008   echo $ECHO_N "(cached) $ECHO_C" >&6
13009 else
13010   cat >conftest.$ac_ext <<_ACEOF
13011 #line 13011 "configure"
13012 #include "confdefs.h"
13013 #include <stdlib.h>
13014 #include <stdarg.h>
13015 #include <string.h>
13016 #include <float.h>
13017
13018 _ACEOF
13019 if { (eval echo "$as_me:13019: \"$ac_cpp conftest.$ac_ext\"") >&5
13020   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13021   ac_status=$?
13022   egrep -v '^ *\+' conftest.er1 >conftest.err
13023   rm -f conftest.er1
13024   cat conftest.err >&5
13025   echo "$as_me:13025: \$? = $ac_status" >&5
13026   (exit $ac_status); } >/dev/null; then
13027   if test -s conftest.err; then
13028     ac_cpp_err=$ac_c_preproc_warn_flag
13029   else
13030     ac_cpp_err=
13031   fi
13032 else
13033   ac_cpp_err=yes
13034 fi
13035 if test -z "$ac_cpp_err"; then
13036   ac_cv_header_stdc=yes
13037 else
13038   echo "$as_me: failed program was:" >&5
13039   cat conftest.$ac_ext >&5
13040   ac_cv_header_stdc=no
13041 fi
13042 rm -f conftest.err conftest.$ac_ext
13043
13044 if test $ac_cv_header_stdc = yes; then
13045   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13046   cat >conftest.$ac_ext <<_ACEOF
13047 #line 13047 "configure"
13048 #include "confdefs.h"
13049 #include <string.h>
13050
13051 _ACEOF
13052 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13053   egrep "memchr" >/dev/null 2>&1; then
13054   :
13055 else
13056   ac_cv_header_stdc=no
13057 fi
13058 rm -rf conftest*
13059
13060 fi
13061
13062 if test $ac_cv_header_stdc = yes; then
13063   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13064   cat >conftest.$ac_ext <<_ACEOF
13065 #line 13065 "configure"
13066 #include "confdefs.h"
13067 #include <stdlib.h>
13068
13069 _ACEOF
13070 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13071   egrep "free" >/dev/null 2>&1; then
13072   :
13073 else
13074   ac_cv_header_stdc=no
13075 fi
13076 rm -rf conftest*
13077
13078 fi
13079
13080 if test $ac_cv_header_stdc = yes; then
13081   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13082   if test "$cross_compiling" = yes; then
13083   :
13084 else
13085   cat >conftest.$ac_ext <<_ACEOF
13086 #line 13086 "configure"
13087 #include "confdefs.h"
13088 #include <ctype.h>
13089 #if ((' ' & 0x0FF) == 0x020)
13090 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13091 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13092 #else
13093 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13094                      || ('j' <= (c) && (c) <= 'r') \
13095                      || ('s' <= (c) && (c) <= 'z'))
13096 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13097 #endif
13098
13099 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13100 int
13101 main ()
13102 {
13103   int i;
13104   for (i = 0; i < 256; i++)
13105     if (XOR (islower (i), ISLOWER (i))
13106         || toupper (i) != TOUPPER (i))
13107       $ac_main_return(2);
13108   $ac_main_return (0);
13109 }
13110 _ACEOF
13111 rm -f conftest$ac_exeext
13112 if { (eval echo "$as_me:13112: \"$ac_link\"") >&5
13113   (eval $ac_link) 2>&5
13114   ac_status=$?
13115   echo "$as_me:13115: \$? = $ac_status" >&5
13116   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13117   { (eval echo "$as_me:13117: \"$ac_try\"") >&5
13118   (eval $ac_try) 2>&5
13119   ac_status=$?
13120   echo "$as_me:13120: \$? = $ac_status" >&5
13121   (exit $ac_status); }; }; then
13122   :
13123 else
13124   echo "$as_me: program exited with status $ac_status" >&5
13125 echo "$as_me: failed program was:" >&5
13126 cat conftest.$ac_ext >&5
13127 ac_cv_header_stdc=no
13128 fi
13129 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13130 fi
13131 fi
13132 fi
13133 echo "$as_me:13133: result: $ac_cv_header_stdc" >&5
13134 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13135 if test $ac_cv_header_stdc = yes; then
13136
13137 cat >>confdefs.h <<\EOF
13138 #define STDC_HEADERS 1
13139 EOF
13140
13141 fi
13142
13143 ac_header_dirent=no
13144 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13145   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13146 echo "$as_me:13146: checking for $ac_hdr that defines DIR" >&5
13147 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13148 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13149   echo $ECHO_N "(cached) $ECHO_C" >&6
13150 else
13151   cat >conftest.$ac_ext <<_ACEOF
13152 #line 13152 "configure"
13153 #include "confdefs.h"
13154 #include <sys/types.h>
13155 #include <$ac_hdr>
13156
13157 int
13158 main ()
13159 {
13160 if ((DIR *) 0)
13161 return 0;
13162   ;
13163   return 0;
13164 }
13165 _ACEOF
13166 rm -f conftest.$ac_objext
13167 if { (eval echo "$as_me:13167: \"$ac_compile\"") >&5
13168   (eval $ac_compile) 2>&5
13169   ac_status=$?
13170   echo "$as_me:13170: \$? = $ac_status" >&5
13171   (exit $ac_status); } &&
13172          { ac_try='test -s conftest.$ac_objext'
13173   { (eval echo "$as_me:13173: \"$ac_try\"") >&5
13174   (eval $ac_try) 2>&5
13175   ac_status=$?
13176   echo "$as_me:13176: \$? = $ac_status" >&5
13177   (exit $ac_status); }; }; then
13178   eval "$as_ac_Header=yes"
13179 else
13180   echo "$as_me: failed program was:" >&5
13181 cat conftest.$ac_ext >&5
13182 eval "$as_ac_Header=no"
13183 fi
13184 rm -f conftest.$ac_objext conftest.$ac_ext
13185 fi
13186 echo "$as_me:13186: result: `eval echo '${'$as_ac_Header'}'`" >&5
13187 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13188 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13189   cat >>confdefs.h <<EOF
13190 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13191 EOF
13192
13193 ac_header_dirent=$ac_hdr; break
13194 fi
13195
13196 done
13197 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13198 if test $ac_header_dirent = dirent.h; then
13199   echo "$as_me:13199: checking for opendir in -ldir" >&5
13200 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13201 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13202   echo $ECHO_N "(cached) $ECHO_C" >&6
13203 else
13204   ac_check_lib_save_LIBS=$LIBS
13205 LIBS="-ldir  $LIBS"
13206 cat >conftest.$ac_ext <<_ACEOF
13207 #line 13207 "configure"
13208 #include "confdefs.h"
13209
13210 /* Override any gcc2 internal prototype to avoid an error.  */
13211 #ifdef __cplusplus
13212 extern "C"
13213 #endif
13214 /* We use char because int might match the return type of a gcc2
13215    builtin and then its argument prototype would still apply.  */
13216 char opendir ();
13217 int
13218 main ()
13219 {
13220 opendir ();
13221   ;
13222   return 0;
13223 }
13224 _ACEOF
13225 rm -f conftest.$ac_objext conftest$ac_exeext
13226 if { (eval echo "$as_me:13226: \"$ac_link\"") >&5
13227   (eval $ac_link) 2>&5
13228   ac_status=$?
13229   echo "$as_me:13229: \$? = $ac_status" >&5
13230   (exit $ac_status); } &&
13231          { ac_try='test -s conftest$ac_exeext'
13232   { (eval echo "$as_me:13232: \"$ac_try\"") >&5
13233   (eval $ac_try) 2>&5
13234   ac_status=$?
13235   echo "$as_me:13235: \$? = $ac_status" >&5
13236   (exit $ac_status); }; }; then
13237   ac_cv_lib_dir_opendir=yes
13238 else
13239   echo "$as_me: failed program was:" >&5
13240 cat conftest.$ac_ext >&5
13241 ac_cv_lib_dir_opendir=no
13242 fi
13243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13244 LIBS=$ac_check_lib_save_LIBS
13245 fi
13246 echo "$as_me:13246: result: $ac_cv_lib_dir_opendir" >&5
13247 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13248 if test $ac_cv_lib_dir_opendir = yes; then
13249   LIBS="$LIBS -ldir"
13250 fi
13251
13252 else
13253   echo "$as_me:13253: checking for opendir in -lx" >&5
13254 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13255 if test "${ac_cv_lib_x_opendir+set}" = set; then
13256   echo $ECHO_N "(cached) $ECHO_C" >&6
13257 else
13258   ac_check_lib_save_LIBS=$LIBS
13259 LIBS="-lx  $LIBS"
13260 cat >conftest.$ac_ext <<_ACEOF
13261 #line 13261 "configure"
13262 #include "confdefs.h"
13263
13264 /* Override any gcc2 internal prototype to avoid an error.  */
13265 #ifdef __cplusplus
13266 extern "C"
13267 #endif
13268 /* We use char because int might match the return type of a gcc2
13269    builtin and then its argument prototype would still apply.  */
13270 char opendir ();
13271 int
13272 main ()
13273 {
13274 opendir ();
13275   ;
13276   return 0;
13277 }
13278 _ACEOF
13279 rm -f conftest.$ac_objext conftest$ac_exeext
13280 if { (eval echo "$as_me:13280: \"$ac_link\"") >&5
13281   (eval $ac_link) 2>&5
13282   ac_status=$?
13283   echo "$as_me:13283: \$? = $ac_status" >&5
13284   (exit $ac_status); } &&
13285          { ac_try='test -s conftest$ac_exeext'
13286   { (eval echo "$as_me:13286: \"$ac_try\"") >&5
13287   (eval $ac_try) 2>&5
13288   ac_status=$?
13289   echo "$as_me:13289: \$? = $ac_status" >&5
13290   (exit $ac_status); }; }; then
13291   ac_cv_lib_x_opendir=yes
13292 else
13293   echo "$as_me: failed program was:" >&5
13294 cat conftest.$ac_ext >&5
13295 ac_cv_lib_x_opendir=no
13296 fi
13297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13298 LIBS=$ac_check_lib_save_LIBS
13299 fi
13300 echo "$as_me:13300: result: $ac_cv_lib_x_opendir" >&5
13301 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13302 if test $ac_cv_lib_x_opendir = yes; then
13303   LIBS="$LIBS -lx"
13304 fi
13305
13306 fi
13307
13308 echo "$as_me:13308: checking whether time.h and sys/time.h may both be included" >&5
13309 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13310 if test "${ac_cv_header_time+set}" = set; then
13311   echo $ECHO_N "(cached) $ECHO_C" >&6
13312 else
13313   cat >conftest.$ac_ext <<_ACEOF
13314 #line 13314 "configure"
13315 #include "confdefs.h"
13316 #include <sys/types.h>
13317 #include <sys/time.h>
13318 #include <time.h>
13319
13320 int
13321 main ()
13322 {
13323 if ((struct tm *) 0)
13324 return 0;
13325   ;
13326   return 0;
13327 }
13328 _ACEOF
13329 rm -f conftest.$ac_objext
13330 if { (eval echo "$as_me:13330: \"$ac_compile\"") >&5
13331   (eval $ac_compile) 2>&5
13332   ac_status=$?
13333   echo "$as_me:13333: \$? = $ac_status" >&5
13334   (exit $ac_status); } &&
13335          { ac_try='test -s conftest.$ac_objext'
13336   { (eval echo "$as_me:13336: \"$ac_try\"") >&5
13337   (eval $ac_try) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); }; }; then
13341   ac_cv_header_time=yes
13342 else
13343   echo "$as_me: failed program was:" >&5
13344 cat conftest.$ac_ext >&5
13345 ac_cv_header_time=no
13346 fi
13347 rm -f conftest.$ac_objext conftest.$ac_ext
13348 fi
13349 echo "$as_me:13349: result: $ac_cv_header_time" >&5
13350 echo "${ECHO_T}$ac_cv_header_time" >&6
13351 if test $ac_cv_header_time = yes; then
13352
13353 cat >>confdefs.h <<\EOF
13354 #define TIME_WITH_SYS_TIME 1
13355 EOF
13356
13357 fi
13358
13359 ###     checks for compiler characteristics
13360 ac_ext=c
13361 ac_cpp='$CPP $CPPFLAGS'
13362 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13363 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13364 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13365 ac_main_return=return
13366
13367 echo "$as_me:13367: checking for an ANSI C-conforming const" >&5
13368 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13369 if test "${ac_cv_c_const+set}" = set; then
13370   echo $ECHO_N "(cached) $ECHO_C" >&6
13371 else
13372   cat >conftest.$ac_ext <<_ACEOF
13373 #line 13373 "configure"
13374 #include "confdefs.h"
13375
13376 int
13377 main ()
13378 {
13379 /* FIXME: Include the comments suggested by Paul. */
13380 #ifndef __cplusplus
13381   /* Ultrix mips cc rejects this.  */
13382   typedef int charset[2];
13383   const charset x;
13384   /* SunOS 4.1.1 cc rejects this.  */
13385   char const *const *ccp;
13386   char **p;
13387   /* NEC SVR4.0.2 mips cc rejects this.  */
13388   struct point {int x, y;};
13389   static struct point const zero = {0,0};
13390   /* AIX XL C 1.02.0.0 rejects this.
13391      It does not let you subtract one const X* pointer from another in
13392      an arm of an if-expression whose if-part is not a constant
13393      expression */
13394   const char *g = "string";
13395   ccp = &g + (g ? g-g : 0);
13396   /* HPUX 7.0 cc rejects these. */
13397   ++ccp;
13398   p = (char**) ccp;
13399   ccp = (char const *const *) p;
13400   { /* SCO 3.2v4 cc rejects this.  */
13401     char *t;
13402     char const *s = 0 ? (char *) 0 : (char const *) 0;
13403
13404     *t++ = 0;
13405   }
13406   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13407     int x[] = {25, 17};
13408     const int *foo = &x[0];
13409     ++foo;
13410   }
13411   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13412     typedef const int *iptr;
13413     iptr p = 0;
13414     ++p;
13415   }
13416   { /* AIX XL C 1.02.0.0 rejects this saying
13417        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13418     struct s { int j; const int *ap[3]; };
13419     struct s *b; b->j = 5;
13420   }
13421   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13422     const int foo = 10;
13423   }
13424 #endif
13425
13426   ;
13427   return 0;
13428 }
13429 _ACEOF
13430 rm -f conftest.$ac_objext
13431 if { (eval echo "$as_me:13431: \"$ac_compile\"") >&5
13432   (eval $ac_compile) 2>&5
13433   ac_status=$?
13434   echo "$as_me:13434: \$? = $ac_status" >&5
13435   (exit $ac_status); } &&
13436          { ac_try='test -s conftest.$ac_objext'
13437   { (eval echo "$as_me:13437: \"$ac_try\"") >&5
13438   (eval $ac_try) 2>&5
13439   ac_status=$?
13440   echo "$as_me:13440: \$? = $ac_status" >&5
13441   (exit $ac_status); }; }; then
13442   ac_cv_c_const=yes
13443 else
13444   echo "$as_me: failed program was:" >&5
13445 cat conftest.$ac_ext >&5
13446 ac_cv_c_const=no
13447 fi
13448 rm -f conftest.$ac_objext conftest.$ac_ext
13449 fi
13450 echo "$as_me:13450: result: $ac_cv_c_const" >&5
13451 echo "${ECHO_T}$ac_cv_c_const" >&6
13452 if test $ac_cv_c_const = no; then
13453
13454 cat >>confdefs.h <<\EOF
13455 #define const
13456 EOF
13457
13458 fi
13459
13460 ###     Checks for external-data
13461
13462 echo "$as_me:13462: checking if data-only library module links" >&5
13463 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13464 if test "${cf_cv_link_dataonly+set}" = set; then
13465   echo $ECHO_N "(cached) $ECHO_C" >&6
13466 else
13467
13468         rm -f conftest.a
13469         cat >conftest.$ac_ext <<EOF
13470 #line 13470 "configure"
13471 int     testdata[3] = { 123, 456, 789 };
13472 EOF
13473         if { (eval echo "$as_me:13473: \"$ac_compile\"") >&5
13474   (eval $ac_compile) 2>&5
13475   ac_status=$?
13476   echo "$as_me:13476: \$? = $ac_status" >&5
13477   (exit $ac_status); } ; then
13478                 mv conftest.o data.o && \
13479                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13480         fi
13481         rm -f conftest.$ac_ext data.o
13482         cat >conftest.$ac_ext <<EOF
13483 #line 13483 "configure"
13484 int     testfunc()
13485 {
13486 #if defined(NeXT)
13487         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13488 #else
13489         extern int testdata[3];
13490         return testdata[0] == 123
13491            &&  testdata[1] == 456
13492            &&  testdata[2] == 789;
13493 #endif
13494 }
13495 EOF
13496         if { (eval echo "$as_me:13496: \"$ac_compile\"") >&5
13497   (eval $ac_compile) 2>&5
13498   ac_status=$?
13499   echo "$as_me:13499: \$? = $ac_status" >&5
13500   (exit $ac_status); }; then
13501                 mv conftest.o func.o && \
13502                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13503         fi
13504         rm -f conftest.$ac_ext func.o
13505         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13506         cf_saveLIBS="$LIBS"
13507         LIBS="conftest.a $LIBS"
13508         if test "$cross_compiling" = yes; then
13509   cf_cv_link_dataonly=unknown
13510 else
13511   cat >conftest.$ac_ext <<_ACEOF
13512 #line 13512 "configure"
13513 #include "confdefs.h"
13514
13515         int main()
13516         {
13517                 extern int testfunc();
13518                 ${cf_cv_main_return:-return} (!testfunc());
13519         }
13520
13521 _ACEOF
13522 rm -f conftest$ac_exeext
13523 if { (eval echo "$as_me:13523: \"$ac_link\"") >&5
13524   (eval $ac_link) 2>&5
13525   ac_status=$?
13526   echo "$as_me:13526: \$? = $ac_status" >&5
13527   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13528   { (eval echo "$as_me:13528: \"$ac_try\"") >&5
13529   (eval $ac_try) 2>&5
13530   ac_status=$?
13531   echo "$as_me:13531: \$? = $ac_status" >&5
13532   (exit $ac_status); }; }; then
13533   cf_cv_link_dataonly=yes
13534 else
13535   echo "$as_me: program exited with status $ac_status" >&5
13536 echo "$as_me: failed program was:" >&5
13537 cat conftest.$ac_ext >&5
13538 cf_cv_link_dataonly=no
13539 fi
13540 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13541 fi
13542         LIBS="$cf_saveLIBS"
13543
13544 fi
13545
13546 echo "$as_me:13546: result: $cf_cv_link_dataonly" >&5
13547 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13548
13549 if test "$cf_cv_link_dataonly" = no ; then
13550
13551 cat >>confdefs.h <<\EOF
13552 #define BROKEN_LINKER 1
13553 EOF
13554
13555         BROKEN_LINKER=1
13556 fi
13557
13558 ###     Checks for library functions.
13559
13560 echo "$as_me:13560: checking for working mkstemp" >&5
13561 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13562 if test "${cf_cv_func_mkstemp+set}" = set; then
13563   echo $ECHO_N "(cached) $ECHO_C" >&6
13564 else
13565
13566 rm -rf conftest*
13567 if test "$cross_compiling" = yes; then
13568   cf_cv_func_mkstemp=maybe
13569 else
13570   cat >conftest.$ac_ext <<_ACEOF
13571 #line 13571 "configure"
13572 #include "confdefs.h"
13573
13574 #include <sys/types.h>
13575 #include <stdlib.h>
13576 #include <stdio.h>
13577 #include <string.h>
13578 #include <sys/stat.h>
13579 int main()
13580 {
13581         char *tmpl = "conftestXXXXXX";
13582         char name[2][80];
13583         int n;
13584         int result = 0;
13585         int fd;
13586         struct stat sb;
13587
13588         umask(077);
13589         for (n = 0; n < 2; ++n) {
13590                 strcpy(name[n], tmpl);
13591                 if ((fd = mkstemp(name[n])) >= 0) {
13592                         if (!strcmp(name[n], tmpl)
13593                          || stat(name[n], &sb) != 0
13594                          || (sb.st_mode & S_IFMT) != S_IFREG
13595                          || (sb.st_mode & 077) != 0) {
13596                                 result = 1;
13597                         }
13598                         close(fd);
13599                 }
13600         }
13601         if (result == 0
13602          && !strcmp(name[0], name[1]))
13603                 result = 1;
13604         ${cf_cv_main_return:-return}(result);
13605 }
13606
13607 _ACEOF
13608 rm -f conftest$ac_exeext
13609 if { (eval echo "$as_me:13609: \"$ac_link\"") >&5
13610   (eval $ac_link) 2>&5
13611   ac_status=$?
13612   echo "$as_me:13612: \$? = $ac_status" >&5
13613   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13614   { (eval echo "$as_me:13614: \"$ac_try\"") >&5
13615   (eval $ac_try) 2>&5
13616   ac_status=$?
13617   echo "$as_me:13617: \$? = $ac_status" >&5
13618   (exit $ac_status); }; }; then
13619   cf_cv_func_mkstemp=yes
13620
13621 else
13622   echo "$as_me: program exited with status $ac_status" >&5
13623 echo "$as_me: failed program was:" >&5
13624 cat conftest.$ac_ext >&5
13625 cf_cv_func_mkstemp=no
13626
13627 fi
13628 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13629 fi
13630
13631 fi
13632 echo "$as_me:13632: result: $cf_cv_func_mkstemp" >&5
13633 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13634 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13635         echo "$as_me:13635: checking for mkstemp" >&5
13636 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13637 if test "${ac_cv_func_mkstemp+set}" = set; then
13638   echo $ECHO_N "(cached) $ECHO_C" >&6
13639 else
13640   cat >conftest.$ac_ext <<_ACEOF
13641 #line 13641 "configure"
13642 #include "confdefs.h"
13643 /* System header to define __stub macros and hopefully few prototypes,
13644     which can conflict with char mkstemp (); below.  */
13645 #include <assert.h>
13646 /* Override any gcc2 internal prototype to avoid an error.  */
13647 #ifdef __cplusplus
13648 extern "C"
13649 #endif
13650 /* We use char because int might match the return type of a gcc2
13651    builtin and then its argument prototype would still apply.  */
13652 char mkstemp ();
13653 char (*f) ();
13654
13655 int
13656 main ()
13657 {
13658 /* The GNU C library defines this for functions which it implements
13659     to always fail with ENOSYS.  Some functions are actually named
13660     something starting with __ and the normal name is an alias.  */
13661 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13662 choke me
13663 #else
13664 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13665 #endif
13666
13667   ;
13668   return 0;
13669 }
13670 _ACEOF
13671 rm -f conftest.$ac_objext conftest$ac_exeext
13672 if { (eval echo "$as_me:13672: \"$ac_link\"") >&5
13673   (eval $ac_link) 2>&5
13674   ac_status=$?
13675   echo "$as_me:13675: \$? = $ac_status" >&5
13676   (exit $ac_status); } &&
13677          { ac_try='test -s conftest$ac_exeext'
13678   { (eval echo "$as_me:13678: \"$ac_try\"") >&5
13679   (eval $ac_try) 2>&5
13680   ac_status=$?
13681   echo "$as_me:13681: \$? = $ac_status" >&5
13682   (exit $ac_status); }; }; then
13683   ac_cv_func_mkstemp=yes
13684 else
13685   echo "$as_me: failed program was:" >&5
13686 cat conftest.$ac_ext >&5
13687 ac_cv_func_mkstemp=no
13688 fi
13689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13690 fi
13691 echo "$as_me:13691: result: $ac_cv_func_mkstemp" >&5
13692 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13693
13694 fi
13695 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13696
13697 cat >>confdefs.h <<\EOF
13698 #define HAVE_MKSTEMP 1
13699 EOF
13700
13701 fi
13702
13703 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13704         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13705         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13706 fi
13707
13708 cf_with_ada=yes
13709 if test "$cf_with_ada" != "no" ; then
13710
13711 cf_ada_make=gnatmake
13712 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13713 set dummy $cf_ada_make; ac_word=$2
13714 echo "$as_me:13714: checking for $ac_word" >&5
13715 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13716 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13717   echo $ECHO_N "(cached) $ECHO_C" >&6
13718 else
13719   if test -n "$gnat_exists"; then
13720   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13721 else
13722   ac_save_IFS=$IFS; IFS=$ac_path_separator
13723 ac_dummy="$PATH"
13724 for ac_dir in $ac_dummy; do
13725   IFS=$ac_save_IFS
13726   test -z "$ac_dir" && ac_dir=.
13727   $as_executable_p "$ac_dir/$ac_word" || continue
13728 ac_cv_prog_gnat_exists="yes"
13729 echo "$as_me:13729: found $ac_dir/$ac_word" >&5
13730 break
13731 done
13732
13733   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13734 fi
13735 fi
13736 gnat_exists=$ac_cv_prog_gnat_exists
13737 if test -n "$gnat_exists"; then
13738   echo "$as_me:13738: result: $gnat_exists" >&5
13739 echo "${ECHO_T}$gnat_exists" >&6
13740 else
13741   echo "$as_me:13741: result: no" >&5
13742 echo "${ECHO_T}no" >&6
13743 fi
13744
13745 if test "$ac_cv_prog_gnat_exists" = no; then
13746         cf_ada_make=
13747         cf_cv_prog_gnat_correct=no
13748 else
13749
13750 echo "$as_me:13750: checking for gnat version" >&5
13751 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13752 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13753         grep '[0-9].[0-9][0-9]*' |\
13754         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13755 echo "$as_me:13755: result: $cf_gnat_version" >&5
13756 echo "${ECHO_T}$cf_gnat_version" >&6
13757
13758 case $cf_gnat_version in
13759 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13760         cf_cv_prog_gnat_correct=yes
13761         ;;
13762 (*)
13763         { echo "$as_me:13763: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13764 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13765         cf_cv_prog_gnat_correct=no
13766         ;;
13767 esac
13768
13769         # Extract the first word of "m4", so it can be a program name with args.
13770 set dummy m4; ac_word=$2
13771 echo "$as_me:13771: checking for $ac_word" >&5
13772 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13773 if test "${ac_cv_prog_M4_exists+set}" = set; then
13774   echo $ECHO_N "(cached) $ECHO_C" >&6
13775 else
13776   if test -n "$M4_exists"; then
13777   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13778 else
13779   ac_save_IFS=$IFS; IFS=$ac_path_separator
13780 ac_dummy="$PATH"
13781 for ac_dir in $ac_dummy; do
13782   IFS=$ac_save_IFS
13783   test -z "$ac_dir" && ac_dir=.
13784   $as_executable_p "$ac_dir/$ac_word" || continue
13785 ac_cv_prog_M4_exists="yes"
13786 echo "$as_me:13786: found $ac_dir/$ac_word" >&5
13787 break
13788 done
13789
13790   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13791 fi
13792 fi
13793 M4_exists=$ac_cv_prog_M4_exists
13794 if test -n "$M4_exists"; then
13795   echo "$as_me:13795: result: $M4_exists" >&5
13796 echo "${ECHO_T}$M4_exists" >&6
13797 else
13798   echo "$as_me:13798: result: no" >&5
13799 echo "${ECHO_T}no" >&6
13800 fi
13801
13802         if test "$ac_cv_prog_M4_exists" = no; then
13803                 cf_cv_prog_gnat_correct=no
13804                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13805         fi
13806         if test "$cf_cv_prog_gnat_correct" = yes; then
13807                 echo "$as_me:13807: checking if GNAT works" >&5
13808 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13809
13810 rm -rf conftest* *~conftest*
13811 cat >>conftest.ads <<CF_EOF
13812 procedure conftest;
13813 CF_EOF
13814 cat >>conftest.adb <<CF_EOF
13815 with Text_IO;
13816 with GNAT.OS_Lib;
13817 procedure conftest is
13818 begin
13819    Text_IO.Put ("Hello World");
13820    Text_IO.New_Line;
13821    GNAT.OS_Lib.OS_Exit (0);
13822 end conftest;
13823 CF_EOF
13824 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13825    if ( ./conftest 1>&5 2>&1 ) ; then
13826       cf_cv_prog_gnat_correct=yes
13827    else
13828       cf_cv_prog_gnat_correct=no
13829    fi
13830 else
13831    cf_cv_prog_gnat_correct=no
13832 fi
13833 rm -rf conftest* *~conftest*
13834
13835                 echo "$as_me:13835: result: $cf_cv_prog_gnat_correct" >&5
13836 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13837         fi
13838 fi
13839
13840         if test "$cf_cv_prog_gnat_correct" = yes; then
13841
13842         echo "$as_me:13842: checking optimization options for ADAFLAGS" >&5
13843 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13844         case "$CFLAGS" in
13845         (*-g*)
13846
13847         ADAFLAGS="$ADAFLAGS -g"
13848
13849                 ;;
13850         esac
13851         case "$CFLAGS" in
13852         (*-O*)
13853                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13854
13855         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13856
13857                 ;;
13858         esac
13859         echo "$as_me:13859: result: $ADAFLAGS" >&5
13860 echo "${ECHO_T}$ADAFLAGS" >&6
13861
13862 echo "$as_me:13862: checking if GNATPREP supports -T option" >&5
13863 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13864 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13865   echo $ECHO_N "(cached) $ECHO_C" >&6
13866 else
13867
13868 cf_cv_gnatprep_opt_t=no
13869 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13870
13871 fi
13872 echo "$as_me:13872: result: $cf_cv_gnatprep_opt_t" >&5
13873 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13874 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13875
13876 echo "$as_me:13876: checking if GNAT supports generics" >&5
13877 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13878 case $cf_gnat_version in
13879 (3.[1-9]*|[4-9].*)
13880         cf_gnat_generics=yes
13881         ;;
13882 (*)
13883         cf_gnat_generics=no
13884         ;;
13885 esac
13886 echo "$as_me:13886: result: $cf_gnat_generics" >&5
13887 echo "${ECHO_T}$cf_gnat_generics" >&6
13888
13889 if test "$cf_gnat_generics" = yes
13890 then
13891         cf_compile_generics=generics
13892         cf_generic_objects="\${GENOBJS}"
13893 else
13894         cf_compile_generics=
13895         cf_generic_objects=
13896 fi
13897
13898 echo "$as_me:13898: checking if GNAT supports SIGINT" >&5
13899 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13900 if test "${cf_cv_gnat_sigint+set}" = set; then
13901   echo $ECHO_N "(cached) $ECHO_C" >&6
13902 else
13903
13904 rm -rf conftest* *~conftest*
13905 cat >>conftest.ads <<CF_EOF
13906 with Ada.Interrupts.Names;
13907
13908 package ConfTest is
13909
13910    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13911    pragma Unreserve_All_Interrupts;
13912    pragma Warnings (On);
13913
13914    protected Process is
13915       procedure Stop;
13916       function Continue return Boolean;
13917       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13918    private
13919       Done : Boolean := False;
13920    end Process;
13921
13922 end ConfTest;
13923 CF_EOF
13924 cat >>conftest.adb <<CF_EOF
13925 package body ConfTest is
13926    protected body Process is
13927       procedure Stop is
13928       begin
13929          Done := True;
13930       end Stop;
13931       function Continue return Boolean is
13932       begin
13933          return not Done;
13934       end Continue;
13935    end Process;
13936 end ConfTest;
13937 CF_EOF
13938 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13939       cf_cv_gnat_sigint=yes
13940 else
13941    cf_cv_gnat_sigint=no
13942 fi
13943 rm -rf conftest* *~conftest*
13944
13945 fi
13946 echo "$as_me:13946: result: $cf_cv_gnat_sigint" >&5
13947 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13948
13949 if test $cf_cv_gnat_sigint = yes ; then
13950         USE_GNAT_SIGINT=""
13951 else
13952         USE_GNAT_SIGINT="#"
13953 fi
13954
13955 cf_gnat_libraries=no
13956 cf_gnat_projects=no
13957
13958 if test "$enable_gnat_projects" != no ; then
13959 echo "$as_me:13959: checking if GNAT supports project files" >&5
13960 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13961 case $cf_gnat_version in
13962 (3.[0-9]*)
13963         ;;
13964 (*)
13965         case $cf_cv_system_name in
13966         (cygwin*|msys*)
13967                 ;;
13968         (*)
13969                 mkdir conftest.src conftest.bin conftest.lib
13970                 cd conftest.src
13971                 rm -rf conftest* *~conftest*
13972                 cat >>library.gpr <<CF_EOF
13973 project Library is
13974   Kind := External ("LIB_KIND");
13975   for Library_Name use "ConfTest";
13976   for Object_Dir use ".";
13977   for Library_ALI_Dir use External("LIBRARY_DIR");
13978   for Library_Version use External ("SONAME");
13979   for Library_Kind use Kind;
13980   for Library_Dir use External("BUILD_DIR");
13981   Source_Dir := External ("SOURCE_DIR");
13982   for Source_Dirs use (Source_Dir);
13983 end Library;
13984 CF_EOF
13985                 cat >>confpackage.ads <<CF_EOF
13986 package ConfPackage is
13987    procedure conftest;
13988 end ConfPackage;
13989 CF_EOF
13990                 cat >>confpackage.adb <<CF_EOF
13991 with Text_IO;
13992 package body ConfPackage is
13993    procedure conftest is
13994    begin
13995       Text_IO.Put ("Hello World");
13996       Text_IO.New_Line;
13997    end conftest;
13998 end ConfPackage;
13999 CF_EOF
14000                 if ( $cf_ada_make $ADAFLAGS \
14001                                 -Plibrary.gpr \
14002                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14003                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14004                                 -XSOURCE_DIR=`pwd` \
14005                                 -XSONAME=libConfTest.so.1 \
14006                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
14007                         cf_gnat_projects=yes
14008                 fi
14009                 cd ..
14010                 if test -f conftest.lib/confpackage.ali
14011                 then
14012                         cf_gnat_libraries=yes
14013                 fi
14014                 rm -rf conftest* *~conftest*
14015                 ;;
14016         esac
14017         ;;
14018 esac
14019 echo "$as_me:14019: result: $cf_gnat_projects" >&5
14020 echo "${ECHO_T}$cf_gnat_projects" >&6
14021 fi # enable_gnat_projects
14022
14023 if test $cf_gnat_projects = yes
14024 then
14025         echo "$as_me:14025: checking if GNAT supports libraries" >&5
14026 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14027         echo "$as_me:14027: result: $cf_gnat_libraries" >&5
14028 echo "${ECHO_T}$cf_gnat_libraries" >&6
14029 fi
14030
14031 if test "$cf_gnat_projects" = yes
14032 then
14033         USE_OLD_MAKERULES="#"
14034         USE_GNAT_PROJECTS=""
14035 else
14036         USE_OLD_MAKERULES=""
14037         USE_GNAT_PROJECTS="#"
14038 fi
14039
14040 if test "$cf_gnat_libraries" = yes
14041 then
14042         USE_GNAT_LIBRARIES=""
14043 else
14044         USE_GNAT_LIBRARIES="#"
14045 fi
14046
14047 echo "$as_me:14047: checking for ada-compiler" >&5
14048 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14049
14050 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14051 if test "${with_ada_compiler+set}" = set; then
14052   withval="$with_ada_compiler"
14053   cf_ada_compiler=$withval
14054 else
14055   cf_ada_compiler=gnatmake
14056 fi;
14057
14058 echo "$as_me:14058: result: $cf_ada_compiler" >&5
14059 echo "${ECHO_T}$cf_ada_compiler" >&6
14060
14061                 cf_ada_package=terminal_interface
14062
14063 echo "$as_me:14063: checking for ada-include" >&5
14064 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14065
14066 # Check whether --with-ada-include or --without-ada-include was given.
14067 if test "${with_ada_include+set}" = set; then
14068   withval="$with_ada_include"
14069
14070 else
14071   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14072 fi; if test -n "$prefix/share/ada/adainclude" ; then
14073
14074 if test "x$prefix" != xNONE; then
14075         cf_path_syntax="$prefix"
14076 else
14077         cf_path_syntax="$ac_default_prefix"
14078 fi
14079
14080 case ".$withval" in
14081 (.\$\(*\)*|.\'*\'*)
14082         ;;
14083 (..|./*|.\\*)
14084         ;;
14085 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14086         ;;
14087 (.\${*prefix}*|.\${*dir}*)
14088         eval withval="$withval"
14089         case ".$withval" in
14090         (.NONE/*)
14091                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14092                 ;;
14093         esac
14094         ;;
14095 (.no|.NONE/*)
14096         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14097         ;;
14098 (*)
14099         { { echo "$as_me:14099: error: expected a pathname, not \"$withval\"" >&5
14100 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14101    { (exit 1); exit 1; }; }
14102         ;;
14103 esac
14104
14105 fi
14106 eval ADA_INCLUDE="$withval"
14107
14108 echo "$as_me:14108: result: $ADA_INCLUDE" >&5
14109 echo "${ECHO_T}$ADA_INCLUDE" >&6
14110
14111 echo "$as_me:14111: checking for ada-objects" >&5
14112 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14113
14114 # Check whether --with-ada-objects or --without-ada-objects was given.
14115 if test "${with_ada_objects+set}" = set; then
14116   withval="$with_ada_objects"
14117
14118 else
14119   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14120 fi; if test -n "$prefix/lib/ada/adalib" ; then
14121
14122 if test "x$prefix" != xNONE; then
14123         cf_path_syntax="$prefix"
14124 else
14125         cf_path_syntax="$ac_default_prefix"
14126 fi
14127
14128 case ".$withval" in
14129 (.\$\(*\)*|.\'*\'*)
14130         ;;
14131 (..|./*|.\\*)
14132         ;;
14133 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14134         ;;
14135 (.\${*prefix}*|.\${*dir}*)
14136         eval withval="$withval"
14137         case ".$withval" in
14138         (.NONE/*)
14139                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14140                 ;;
14141         esac
14142         ;;
14143 (.no|.NONE/*)
14144         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14145         ;;
14146 (*)
14147         { { echo "$as_me:14147: error: expected a pathname, not \"$withval\"" >&5
14148 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14149    { (exit 1); exit 1; }; }
14150         ;;
14151 esac
14152
14153 fi
14154 eval ADA_OBJECTS="$withval"
14155
14156 echo "$as_me:14156: result: $ADA_OBJECTS" >&5
14157 echo "${ECHO_T}$ADA_OBJECTS" >&6
14158
14159 echo "$as_me:14159: checking if an Ada95 shared-library should be built" >&5
14160 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14161
14162 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14163 if test "${with_ada_sharedlib+set}" = set; then
14164   withval="$with_ada_sharedlib"
14165   with_ada_sharedlib=$withval
14166 else
14167   with_ada_sharedlib=no
14168 fi;
14169 echo "$as_me:14169: result: $with_ada_sharedlib" >&5
14170 echo "${ECHO_T}$with_ada_sharedlib" >&6
14171
14172 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14173 MAKE_ADA_SHAREDLIB="#"
14174
14175 if test "x$with_ada_sharedlib" != xno
14176 then
14177         MAKE_ADA_SHAREDLIB=
14178         if test "x$with_ada_sharedlib" != xyes
14179         then
14180                 ADA_SHAREDLIB="$with_ada_sharedlib"
14181         fi
14182 fi
14183
14184         else
14185                 { { echo "$as_me:14185: error: No usable Ada compiler found" >&5
14186 echo "$as_me: error: No usable Ada compiler found" >&2;}
14187    { (exit 1); exit 1; }; }
14188         fi
14189 else
14190         { { echo "$as_me:14190: error: The Ada compiler is needed for this package" >&5
14191 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14192    { (exit 1); exit 1; }; }
14193 fi
14194
14195 ################################################################################
14196
14197 # not needed
14198 TINFO_LDFLAGS2=
14199
14200 TINFO_LIBS=
14201
14202 ### Construct the list of include-directories to be generated
14203
14204 if test "$srcdir" != "."; then
14205         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14206 fi
14207 CPPFLAGS="-I../include $CPPFLAGS"
14208 if test "$srcdir" != "."; then
14209         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14210 fi
14211 CPPFLAGS="-I. $CPPFLAGS"
14212
14213 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14214 if test "$srcdir" != "."; then
14215         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14216 fi
14217 if test "$GCC" != yes; then
14218         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14219 elif test "$includedir" != "/usr/include"; then
14220         if test "$includedir" = '${prefix}/include' ; then
14221                 if test x$prefix != x/usr ; then
14222                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14223                 fi
14224         else
14225                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14226         fi
14227 fi
14228
14229 ### Build up pieces for makefile rules
14230 echo "$as_me:14230: checking default library suffix" >&5
14231 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14232
14233         case $DFT_LWR_MODEL in
14234         (libtool) DFT_ARG_SUFFIX=''   ;;
14235         (normal)  DFT_ARG_SUFFIX=''   ;;
14236         (debug)   DFT_ARG_SUFFIX='_g' ;;
14237         (profile) DFT_ARG_SUFFIX='_p' ;;
14238         (shared)  DFT_ARG_SUFFIX=''   ;;
14239         esac
14240         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14241 echo "$as_me:14241: result: $DFT_ARG_SUFFIX" >&5
14242 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14243
14244 echo "$as_me:14244: checking default library-dependency suffix" >&5
14245 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14246
14247         case X$DFT_LWR_MODEL in
14248         (Xlibtool)
14249                 DFT_LIB_SUFFIX='.la'
14250                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14251                 ;;
14252         (Xdebug)
14253                 DFT_LIB_SUFFIX='_g.a'
14254                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14255                 ;;
14256         (Xprofile)
14257                 DFT_LIB_SUFFIX='_p.a'
14258                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14259                 ;;
14260         (Xshared)
14261                 case $cf_cv_system_name in
14262                 (aix[5-7]*)
14263                         DFT_LIB_SUFFIX='.so'
14264                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14265                         ;;
14266                 (cygwin*|msys*|mingw*)
14267                         DFT_LIB_SUFFIX='.dll'
14268                         DFT_DEP_SUFFIX='.dll.a'
14269                         ;;
14270                 (darwin*)
14271                         DFT_LIB_SUFFIX='.dylib'
14272                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14273                         ;;
14274                 (hpux*)
14275                         case $target in
14276                         (ia64*)
14277                                 DFT_LIB_SUFFIX='.so'
14278                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14279                                 ;;
14280                         (*)
14281                                 DFT_LIB_SUFFIX='.sl'
14282                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14283                                 ;;
14284                         esac
14285                         ;;
14286                 (*)
14287                         DFT_LIB_SUFFIX='.so'
14288                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14289                         ;;
14290                 esac
14291                 ;;
14292         (*)
14293                 DFT_LIB_SUFFIX='.a'
14294                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14295                 ;;
14296         esac
14297         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14298         then
14299                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14300                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14301         fi
14302 echo "$as_me:14302: result: $DFT_DEP_SUFFIX" >&5
14303 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14304
14305 echo "$as_me:14305: checking default object directory" >&5
14306 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14307
14308         case $DFT_LWR_MODEL in
14309         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14310         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14311         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14312         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14313         (shared)
14314                 case $cf_cv_system_name in
14315                 (cygwin|msys)
14316                         DFT_OBJ_SUBDIR='objects' ;;
14317                 (*)
14318                         DFT_OBJ_SUBDIR='obj_s' ;;
14319                 esac
14320         esac
14321 echo "$as_me:14321: result: $DFT_OBJ_SUBDIR" >&5
14322 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14323
14324 ### Set up low-level terminfo dependencies for makefiles.
14325
14326 if test "$DFT_LWR_MODEL" = shared ; then
14327         case $cf_cv_system_name in
14328         (cygwin*)
14329                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14330                 ;;
14331         (msys*)
14332                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14333                 ;;
14334         esac
14335 fi
14336
14337 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14338
14339 ### Construct the list of subdirectories for which we'll customize makefiles
14340 ### with the appropriate compile-rules.
14341
14342 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14343
14344 cat >>confdefs.h <<EOF
14345 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14346 EOF
14347
14348 ### Now that we're done running tests, add the compiler-warnings, if any
14349
14350 cf_fix_cppflags=no
14351 cf_new_cflags=
14352 cf_new_cppflags=
14353 cf_new_extra_cppflags=
14354
14355 for cf_add_cflags in $EXTRA_CFLAGS
14356 do
14357 case $cf_fix_cppflags in
14358 (no)
14359         case $cf_add_cflags in
14360         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14361                 case $cf_add_cflags in
14362                 (-D*)
14363                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14364
14365                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14366                                 && test -z "${cf_tst_cflags}" \
14367                                 && cf_fix_cppflags=yes
14368
14369                         if test $cf_fix_cppflags = yes ; then
14370                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14371                                 continue
14372                         elif test "${cf_tst_cflags}" = "\"'" ; then
14373                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14374                                 continue
14375                         fi
14376                         ;;
14377                 esac
14378                 case "$CPPFLAGS" in
14379                 (*$cf_add_cflags)
14380                         ;;
14381                 (*)
14382                         case $cf_add_cflags in
14383                         (-D*)
14384                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14385
14386 CPPFLAGS=`echo "$CPPFLAGS" | \
14387         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14388                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14389
14390                                 ;;
14391                         esac
14392                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
14393                         ;;
14394                 esac
14395                 ;;
14396         (*)
14397                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
14398                 ;;
14399         esac
14400         ;;
14401 (yes)
14402         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14403
14404         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14405
14406         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14407                 && test -z "${cf_tst_cflags}" \
14408                 && cf_fix_cppflags=no
14409         ;;
14410 esac
14411 done
14412
14413 if test -n "$cf_new_cflags" ; then
14414
14415         CFLAGS="$CFLAGS $cf_new_cflags"
14416 fi
14417
14418 if test -n "$cf_new_cppflags" ; then
14419
14420         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
14421 fi
14422
14423 if test -n "$cf_new_extra_cppflags" ; then
14424
14425         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
14426 fi
14427
14428 ################################################################################
14429
14430 TEST_ARG2=
14431
14432 TEST_LIBS2=
14433
14434 NCURSES_SHLIB2="sh -c"
14435
14436 ADA_SUBDIRS="include gen src doc"
14437 if test "x$cf_with_tests" != "xno" ; then
14438         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14439 fi
14440 for cf_dir in $ADA_SUBDIRS
14441 do
14442         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14443 done
14444
14445 NCURSES_TREE="#"
14446
14447 EXTERNAL_TREE=
14448
14449 # match layout used by make-tar.sh
14450 ADAHTML_DIR=../doc/ada
14451
14452 if test "x$cross_compiling" = xyes ; then
14453         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14454 else
14455         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14456 fi
14457
14458 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14459 ac_config_commands="$ac_config_commands default"
14460 cat >confcache <<\_ACEOF
14461 # This file is a shell script that caches the results of configure
14462 # tests run on this system so they can be shared between configure
14463 # scripts and configure runs, see configure's option --config-cache.
14464 # It is not useful on other systems.  If it contains results you don't
14465 # want to keep, you may remove or edit it.
14466 #
14467 # config.status only pays attention to the cache file if you give it
14468 # the --recheck option to rerun configure.
14469 #
14470 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14471 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14472 # following values.
14473
14474 _ACEOF
14475
14476 # The following way of writing the cache mishandles newlines in values,
14477 # but we know of no workaround that is simple, portable, and efficient.
14478 # So, don't put newlines in cache variables' values.
14479 # Ultrix sh set writes to stderr and can't be redirected directly,
14480 # and sets the high bit in the cache file unless we assign to the vars.
14481 {
14482   (set) 2>&1 |
14483     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14484     *ac_space=\ *)
14485       # `set' does not quote correctly, so add quotes (double-quote
14486       # substitution turns \\\\ into \\, and sed turns \\ into \).
14487       sed -n \
14488         "s/'/'\\\\''/g;
14489           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14490       ;;
14491     *)
14492       # `set' quotes correctly as required by POSIX, so do not add quotes.
14493       sed -n \
14494         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14495       ;;
14496     esac;
14497 } |
14498   sed '
14499      t clear
14500      : clear
14501      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14502      t end
14503      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14504      : end' >>confcache
14505 if cmp -s $cache_file confcache; then :; else
14506   if test -w $cache_file; then
14507     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14508     cat confcache >$cache_file
14509   else
14510     echo "not updating unwritable cache $cache_file"
14511   fi
14512 fi
14513 rm -f confcache
14514
14515 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14516 # Let make expand exec_prefix.
14517 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14518
14519 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14520 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14521 # trailing colons and then remove the whole line if VPATH becomes empty
14522 # (actually we leave an empty line to preserve line numbers).
14523 if test "x$srcdir" = x.; then
14524   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14525 s/:*\$(srcdir):*/:/;
14526 s/:*\${srcdir}:*/:/;
14527 s/:*@srcdir@:*/:/;
14528 s/^\([^=]*=[    ]*\):*/\1/;
14529 s/:*$//;
14530 s/^[^=]*=[      ]*$//;
14531 }'
14532 fi
14533
14534 DEFS=-DHAVE_CONFIG_H
14535
14536 : ${CONFIG_STATUS=./config.status}
14537 ac_clean_files_save=$ac_clean_files
14538 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14539 { echo "$as_me:14539: creating $CONFIG_STATUS" >&5
14540 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14541 cat >$CONFIG_STATUS <<_ACEOF
14542 #! $SHELL
14543 # Generated automatically by configure.
14544 # Run this file to recreate the current configuration.
14545 # Compiler output produced by configure, useful for debugging
14546 # configure, is in config.log if it exists.
14547
14548 debug=false
14549 SHELL=\${CONFIG_SHELL-$SHELL}
14550 ac_cs_invocation="\$0 \$@"
14551
14552 _ACEOF
14553
14554 cat >>$CONFIG_STATUS <<\_ACEOF
14555 # Be Bourne compatible
14556 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14557   emulate sh
14558   NULLCMD=:
14559 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14560   set -o posix
14561 fi
14562
14563 # Name of the executable.
14564 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14565
14566 if expr a : '\(a\)' >/dev/null 2>&1; then
14567   as_expr=expr
14568 else
14569   as_expr=false
14570 fi
14571
14572 rm -f conf$$ conf$$.exe conf$$.file
14573 echo >conf$$.file
14574 if ln -s conf$$.file conf$$ 2>/dev/null; then
14575   # We could just check for DJGPP; but this test a) works b) is more generic
14576   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14577   if test -f conf$$.exe; then
14578     # Don't use ln at all; we don't have any links
14579     as_ln_s='cp -p'
14580   else
14581     as_ln_s='ln -s'
14582   fi
14583 elif ln conf$$.file conf$$ 2>/dev/null; then
14584   as_ln_s=ln
14585 else
14586   as_ln_s='cp -p'
14587 fi
14588 rm -f conf$$ conf$$.exe conf$$.file
14589
14590 as_executable_p="test -f"
14591
14592 # Support unset when possible.
14593 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14594   as_unset=unset
14595 else
14596   as_unset=false
14597 fi
14598
14599 # NLS nuisances.
14600 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14601 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14602 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14603 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14604 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14605 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14606 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14607 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14608
14609 # IFS
14610 # We need space, tab and new line, in precisely that order.
14611 as_nl='
14612 '
14613 IFS="   $as_nl"
14614
14615 # CDPATH.
14616 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14617
14618 exec 6>&1
14619
14620 _ACEOF
14621
14622 # Files that config.status was made for.
14623 if test -n "$ac_config_files"; then
14624   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14625 fi
14626
14627 if test -n "$ac_config_headers"; then
14628   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14629 fi
14630
14631 if test -n "$ac_config_links"; then
14632   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14633 fi
14634
14635 if test -n "$ac_config_commands"; then
14636   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14637 fi
14638
14639 cat >>$CONFIG_STATUS <<\EOF
14640
14641 ac_cs_usage="\
14642 \`$as_me' instantiates files from templates according to the
14643 current configuration.
14644
14645 Usage: $0 [OPTIONS] [FILE]...
14646
14647   -h, --help       print this help, then exit
14648   -V, --version    print version number, then exit
14649   -d, --debug      don't remove temporary files
14650       --recheck    update $as_me by reconfiguring in the same conditions
14651   --file=FILE[:TEMPLATE]
14652                    instantiate the configuration file FILE
14653   --header=FILE[:TEMPLATE]
14654                    instantiate the configuration header FILE
14655
14656 Configuration files:
14657 $config_files
14658
14659 Configuration headers:
14660 $config_headers
14661
14662 Configuration commands:
14663 $config_commands
14664
14665 Report bugs to <dickey@invisible-island.net>."
14666 EOF
14667
14668 cat >>$CONFIG_STATUS <<EOF
14669 ac_cs_version="\\
14670 config.status
14671 configured by $0, generated by GNU Autoconf 2.52.20150926,
14672   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14673
14674 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14675 Free Software Foundation, Inc.
14676 This config.status script is free software; the Free Software Foundation
14677 gives unlimited permission to copy, distribute and modify it."
14678 srcdir=$srcdir
14679 INSTALL="$INSTALL"
14680 EOF
14681
14682 cat >>$CONFIG_STATUS <<\EOF
14683 # If no file are specified by the user, then we need to provide default
14684 # value.  By we need to know if files were specified by the user.
14685 ac_need_defaults=:
14686 while test $# != 0
14687 do
14688   case $1 in
14689   --*=*)
14690     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14691     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14692     shift
14693     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14694     shift
14695     ;;
14696   -*);;
14697   *) # This is not an option, so the user has probably given explicit
14698      # arguments.
14699      ac_need_defaults=false;;
14700   esac
14701
14702   case $1 in
14703   # Handling of the options.
14704 EOF
14705 cat >>$CONFIG_STATUS <<EOF
14706   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14707     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14708     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14709 EOF
14710 cat >>$CONFIG_STATUS <<\EOF
14711   --version | --vers* | -V )
14712     echo "$ac_cs_version"; exit 0 ;;
14713   --he | --h)
14714     # Conflict between --help and --header
14715     { { echo "$as_me:14715: error: ambiguous option: $1
14716 Try \`$0 --help' for more information." >&5
14717 echo "$as_me: error: ambiguous option: $1
14718 Try \`$0 --help' for more information." >&2;}
14719    { (exit 1); exit 1; }; };;
14720   --help | --hel | -h )
14721     echo "$ac_cs_usage"; exit 0 ;;
14722   --debug | --d* | -d )
14723     debug=: ;;
14724   --file | --fil | --fi | --f )
14725     shift
14726     CONFIG_FILES="$CONFIG_FILES $1"
14727     ac_need_defaults=false;;
14728   --header | --heade | --head | --hea )
14729     shift
14730     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14731     ac_need_defaults=false;;
14732
14733   # This is an error.
14734   -*) { { echo "$as_me:14734: error: unrecognized option: $1
14735 Try \`$0 --help' for more information." >&5
14736 echo "$as_me: error: unrecognized option: $1
14737 Try \`$0 --help' for more information." >&2;}
14738    { (exit 1); exit 1; }; } ;;
14739
14740   *) ac_config_targets="$ac_config_targets $1" ;;
14741
14742   esac
14743   shift
14744 done
14745
14746 exec 5>>config.log
14747 cat >&5 << _ACEOF
14748
14749 ## ----------------------- ##
14750 ## Running config.status.  ##
14751 ## ----------------------- ##
14752
14753 This file was extended by $as_me 2.52.20150926, executed with
14754   CONFIG_FILES    = $CONFIG_FILES
14755   CONFIG_HEADERS  = $CONFIG_HEADERS
14756   CONFIG_LINKS    = $CONFIG_LINKS
14757   CONFIG_COMMANDS = $CONFIG_COMMANDS
14758   > $ac_cs_invocation
14759 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14760
14761 _ACEOF
14762 EOF
14763
14764 cat >>$CONFIG_STATUS <<EOF
14765 #
14766 # INIT-COMMANDS section.
14767 #
14768
14769 ### Special initialization commands, used to pass information from the
14770 ### configuration-run into config.status
14771
14772 AWK="$AWK"
14773 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14774 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14775 LIB_NAME="$LIB_NAME"
14776 LIB_PREFIX="$LIB_PREFIX"
14777 LIB_SUFFIX="$LIB_SUFFIX"
14778 LN_S="$LN_S"
14779 NCURSES_MAJOR="$NCURSES_MAJOR"
14780 NCURSES_MINOR="$NCURSES_MINOR"
14781 NCURSES_PATCH="$NCURSES_PATCH"
14782 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14783 cf_cv_abi_version="$cf_cv_abi_version"
14784 cf_cv_rel_version="$cf_cv_rel_version"
14785 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14786 cf_cv_shared_soname='$cf_cv_shared_soname'
14787 cf_cv_shlib_version="$cf_cv_shlib_version"
14788 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14789 cf_cv_system_name="$cf_cv_system_name"
14790 host="$host"
14791 target="$target"
14792
14793 EOF
14794
14795 cat >>$CONFIG_STATUS <<\EOF
14796 for ac_config_target in $ac_config_targets
14797 do
14798   case "$ac_config_target" in
14799   # Handling of arguments.
14800   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14801   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14802   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14803   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14804   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14805   *) { { echo "$as_me:14805: error: invalid argument: $ac_config_target" >&5
14806 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14807    { (exit 1); exit 1; }; };;
14808   esac
14809 done
14810
14811 # If the user did not use the arguments to specify the items to instantiate,
14812 # then the envvar interface is used.  Set only those that are not.
14813 # We use the long form for the default assignment because of an extremely
14814 # bizarre bug on SunOS 4.1.3.
14815 if $ac_need_defaults; then
14816   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14817   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14818   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14819 fi
14820
14821 # Create a temporary directory, and hook for its removal unless debugging.
14822 $debug ||
14823 {
14824   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14825   trap '{ (exit 1); exit 1; }' 1 2 13 15
14826 }
14827
14828 # Create a (secure) tmp directory for tmp files.
14829 : ${TMPDIR=/tmp}
14830 {
14831   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14832   test -n "$tmp" && test -d "$tmp"
14833 }  ||
14834 {
14835   tmp=$TMPDIR/cs$$-$RANDOM
14836   (umask 077 && mkdir $tmp)
14837 } ||
14838 {
14839    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14840    { (exit 1); exit 1; }
14841 }
14842
14843 EOF
14844
14845 cat >>$CONFIG_STATUS <<EOF
14846
14847 #
14848 # CONFIG_FILES section.
14849 #
14850
14851 # No need to generate the scripts if there are no CONFIG_FILES.
14852 # This happens for instance when ./config.status config.h
14853 if test -n "\$CONFIG_FILES"; then
14854   # Protect against being on the right side of a sed subst in config.status.
14855   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14856    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14857 s,@SHELL@,$SHELL,;t t
14858 s,@exec_prefix@,$exec_prefix,;t t
14859 s,@prefix@,$prefix,;t t
14860 s,@program_transform_name@,$program_transform_name,;t t
14861 s,@bindir@,$bindir,;t t
14862 s,@sbindir@,$sbindir,;t t
14863 s,@libexecdir@,$libexecdir,;t t
14864 s,@datarootdir@,$datarootdir,;t t
14865 s,@datadir@,$datadir,;t t
14866 s,@sysconfdir@,$sysconfdir,;t t
14867 s,@sharedstatedir@,$sharedstatedir,;t t
14868 s,@localstatedir@,$localstatedir,;t t
14869 s,@libdir@,$libdir,;t t
14870 s,@includedir@,$includedir,;t t
14871 s,@oldincludedir@,$oldincludedir,;t t
14872 s,@infodir@,$infodir,;t t
14873 s,@mandir@,$mandir,;t t
14874 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14875 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14876 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14877 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14878 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14879 s,@build_alias@,$build_alias,;t t
14880 s,@host_alias@,$host_alias,;t t
14881 s,@target_alias@,$target_alias,;t t
14882 s,@ECHO_C@,$ECHO_C,;t t
14883 s,@ECHO_N@,$ECHO_N,;t t
14884 s,@ECHO_T@,$ECHO_T,;t t
14885 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14886 s,@DEFS@,$DEFS,;t t
14887 s,@LIBS@,$LIBS,;t t
14888 s,@top_builddir@,$top_builddir,;t t
14889 s,@build@,$build,;t t
14890 s,@build_cpu@,$build_cpu,;t t
14891 s,@build_vendor@,$build_vendor,;t t
14892 s,@build_os@,$build_os,;t t
14893 s,@host@,$host,;t t
14894 s,@host_cpu@,$host_cpu,;t t
14895 s,@host_vendor@,$host_vendor,;t t
14896 s,@host_os@,$host_os,;t t
14897 s,@target@,$target,;t t
14898 s,@target_cpu@,$target_cpu,;t t
14899 s,@target_vendor@,$target_vendor,;t t
14900 s,@target_os@,$target_os,;t t
14901 s,@CC@,$CC,;t t
14902 s,@CFLAGS@,$CFLAGS,;t t
14903 s,@LDFLAGS@,$LDFLAGS,;t t
14904 s,@CPPFLAGS@,$CPPFLAGS,;t t
14905 s,@ac_ct_CC@,$ac_ct_CC,;t t
14906 s,@EXEEXT@,$EXEEXT,;t t
14907 s,@OBJEXT@,$OBJEXT,;t t
14908 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14909 s,@CPP@,$CPP,;t t
14910 s,@AWK@,$AWK,;t t
14911 s,@EGREP@,$EGREP,;t t
14912 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14913 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14914 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14915 s,@LN_S@,$LN_S,;t t
14916 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14917 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14918 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14919 s,@SET_MAKE@,$SET_MAKE,;t t
14920 s,@CTAGS@,$CTAGS,;t t
14921 s,@ETAGS@,$ETAGS,;t t
14922 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14923 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14924 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14925 s,@RANLIB@,$RANLIB,;t t
14926 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14927 s,@LD@,$LD,;t t
14928 s,@ac_ct_LD@,$ac_ct_LD,;t t
14929 s,@AR@,$AR,;t t
14930 s,@ac_ct_AR@,$ac_ct_AR,;t t
14931 s,@ARFLAGS@,$ARFLAGS,;t t
14932 s,@DESTDIR@,$DESTDIR,;t t
14933 s,@BUILD_CC@,$BUILD_CC,;t t
14934 s,@BUILD_CPP@,$BUILD_CPP,;t t
14935 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14936 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14937 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14938 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14939 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14940 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14941 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14942 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14943 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14944 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14945 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14946 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14947 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14948 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14949 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14950 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14951 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14952 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14953 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14954 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14955 s,@CC_G_OPT@,$CC_G_OPT,;t t
14956 s,@LD_MODEL@,$LD_MODEL,;t t
14957 s,@shlibdir@,$shlibdir,;t t
14958 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14959 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14960 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14961 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14962 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14963 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14964 s,@LINK_PROGS@,$LINK_PROGS,;t t
14965 s,@LINK_TESTS@,$LINK_TESTS,;t t
14966 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14967 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14968 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14969 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14970 s,@RPATH_LIST@,$RPATH_LIST,;t t
14971 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14972 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14973 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14974 s,@PTHREAD@,$PTHREAD,;t t
14975 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14976 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14977 s,@ECHO_LT@,$ECHO_LT,;t t
14978 s,@ECHO_LD@,$ECHO_LD,;t t
14979 s,@RULE_CC@,$RULE_CC,;t t
14980 s,@SHOW_CC@,$SHOW_CC,;t t
14981 s,@ECHO_CC@,$ECHO_CC,;t t
14982 s,@ADAFLAGS@,$ADAFLAGS,;t t
14983 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14984 s,@ADA_TRACE@,$ADA_TRACE,;t t
14985 s,@gnat_exists@,$gnat_exists,;t t
14986 s,@M4_exists@,$M4_exists,;t t
14987 s,@cf_ada_make@,$cf_ada_make,;t t
14988 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14989 s,@cf_compile_generics@,$cf_compile_generics,;t t
14990 s,@cf_generic_objects@,$cf_generic_objects,;t t
14991 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14992 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14993 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14994 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14995 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14996 s,@cf_ada_package@,$cf_ada_package,;t t
14997 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14998 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14999 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15000 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15001 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15002 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15003 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15004 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15005 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15006 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15007 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15008 s,@TEST_ARG2@,$TEST_ARG2,;t t
15009 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15010 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15011 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15012 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15013 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15014 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15015 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15016 CEOF
15017
15018 EOF
15019
15020   cat >>$CONFIG_STATUS <<\EOF
15021   # Split the substitutions into bite-sized pieces for seds with
15022   # small command number limits, like on Digital OSF/1 and HP-UX.
15023   ac_max_sed_lines=48
15024   ac_sed_frag=1 # Number of current file.
15025   ac_beg=1 # First line for current file.
15026   ac_end=$ac_max_sed_lines # Line after last line for current file.
15027   ac_more_lines=:
15028   ac_sed_cmds=
15029   while $ac_more_lines; do
15030     if test $ac_beg -gt 1; then
15031       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15032     else
15033       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15034     fi
15035     if test ! -s $tmp/subs.frag; then
15036       ac_more_lines=false
15037     else
15038       # The purpose of the label and of the branching condition is to
15039       # speed up the sed processing (if there are no `@' at all, there
15040       # is no need to browse any of the substitutions).
15041       # These are the two extra sed commands mentioned above.
15042       (echo ':t
15043   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15044       # It is possible to make a multiline substitution using escaped newlines.
15045       # Ensure that we do not split the substitution between script fragments.
15046       ac_BEG=$ac_end
15047       ac_END=`expr $ac_end + $ac_max_sed_lines`
15048       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15049       if test -s $tmp/subs.next; then
15050         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15051         if test ! -s $tmp/subs.edit; then
15052           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15053           if test ! -s $tmp/subs.edit; then
15054             if test $ac_beg -gt 1; then
15055               ac_end=`expr $ac_end - 1`
15056               continue
15057             fi
15058           fi
15059         fi
15060       fi
15061
15062       if test -z "$ac_sed_cmds"; then
15063         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15064       else
15065         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15066       fi
15067       ac_sed_frag=`expr $ac_sed_frag + 1`
15068       ac_beg=$ac_end
15069       ac_end=`expr $ac_end + $ac_max_sed_lines`
15070     fi
15071   done
15072   if test -z "$ac_sed_cmds"; then
15073     ac_sed_cmds=cat
15074   fi
15075 fi # test -n "$CONFIG_FILES"
15076
15077 EOF
15078 cat >>$CONFIG_STATUS <<\EOF
15079 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15080   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15081   case $ac_file in
15082   - | *:- | *:-:* ) # input from stdin
15083         cat >$tmp/stdin
15084         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15085         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15086   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15087         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15088   * )   ac_file_in=$ac_file.in ;;
15089   esac
15090
15091   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15092   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15093          X"$ac_file" : 'X\(//\)[^/]' \| \
15094          X"$ac_file" : 'X\(//\)$' \| \
15095          X"$ac_file" : 'X\(/\)' \| \
15096          .     : '\(.\)' 2>/dev/null ||
15097 echo X"$ac_file" |
15098     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15099           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15100           /^X\(\/\/\)$/{ s//\1/; q; }
15101           /^X\(\/\).*/{ s//\1/; q; }
15102           s/.*/./; q'`
15103   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15104     { case "$ac_dir" in
15105   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15106   *)                      as_incr_dir=.;;
15107 esac
15108 as_dummy="$ac_dir"
15109 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15110   case $as_mkdir_dir in
15111     # Skip DOS drivespec
15112     ?:) as_incr_dir=$as_mkdir_dir ;;
15113     *)
15114       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15115       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15116     ;;
15117   esac
15118 done; }
15119
15120     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15121     # A "../" for each directory in $ac_dir_suffix.
15122     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15123   else
15124     ac_dir_suffix= ac_dots=
15125   fi
15126
15127   case $srcdir in
15128   .)  ac_srcdir=.
15129       if test -z "$ac_dots"; then
15130          ac_top_srcdir=.
15131       else
15132          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15133       fi ;;
15134   [\\/]* | ?:[\\/]* )
15135       ac_srcdir=$srcdir$ac_dir_suffix;
15136       ac_top_srcdir=$srcdir ;;
15137   *) # Relative path.
15138     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15139     ac_top_srcdir=$ac_dots$srcdir ;;
15140   esac
15141
15142   case $INSTALL in
15143   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15144   *) ac_INSTALL=$ac_dots$INSTALL ;;
15145   esac
15146
15147   if test x"$ac_file" != x-; then
15148     { echo "$as_me:15148: creating $ac_file" >&5
15149 echo "$as_me: creating $ac_file" >&6;}
15150     rm -f "$ac_file"
15151   fi
15152   # Let's still pretend it is `configure' which instantiates (i.e., don't
15153   # use $as_me), people would be surprised to read:
15154   #    /* config.h.  Generated automatically by config.status.  */
15155   configure_input="Generated automatically from `echo $ac_file_in |
15156                                                  sed 's,.*/,,'` by configure."
15157
15158   # First look for the input files in the build tree, otherwise in the
15159   # src tree.
15160   ac_file_inputs=`IFS=:
15161     for f in $ac_file_in; do
15162       case $f in
15163       -) echo $tmp/stdin ;;
15164       [\\/$]*)
15165          # Absolute (can't be DOS-style, as IFS=:)
15166          test -f "$f" || { { echo "$as_me:15166: error: cannot find input file: $f" >&5
15167 echo "$as_me: error: cannot find input file: $f" >&2;}
15168    { (exit 1); exit 1; }; }
15169          echo $f;;
15170       *) # Relative
15171          if test -f "$f"; then
15172            # Build tree
15173            echo $f
15174          elif test -f "$srcdir/$f"; then
15175            # Source tree
15176            echo $srcdir/$f
15177          else
15178            # /dev/null tree
15179            { { echo "$as_me:15179: error: cannot find input file: $f" >&5
15180 echo "$as_me: error: cannot find input file: $f" >&2;}
15181    { (exit 1); exit 1; }; }
15182          fi;;
15183       esac
15184     done` || { (exit 1); exit 1; }
15185 EOF
15186 cat >>$CONFIG_STATUS <<\EOF
15187   ac_warn_datarootdir=no
15188   if test x"$ac_file" != x-; then
15189     for ac_item in $ac_file_inputs
15190     do
15191       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15192       if test -n "$ac_seen"; then
15193         ac_used=`grep '@datarootdir@' $ac_item`
15194         if test -z "$ac_used"; then
15195           { echo "$as_me:15195: WARNING: datarootdir was used implicitly but not set:
15196 $ac_seen" >&5
15197 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15198 $ac_seen" >&2;}
15199           ac_warn_datarootdir=yes
15200         fi
15201       fi
15202       ac_seen=`grep '${datarootdir}' $ac_item`
15203       if test -n "$ac_seen"; then
15204         { echo "$as_me:15204: WARNING: datarootdir was used explicitly but not set:
15205 $ac_seen" >&5
15206 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15207 $ac_seen" >&2;}
15208         ac_warn_datarootdir=yes
15209       fi
15210     done
15211   fi
15212
15213 if test "x$ac_warn_datarootdir" = xyes; then
15214   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15215 fi
15216
15217 EOF
15218 cat >>$CONFIG_STATUS <<EOF
15219   sed "$ac_vpsub
15220 $extrasub
15221 EOF
15222 cat >>$CONFIG_STATUS <<\EOF
15223 :t
15224 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15225 s,@configure_input@,$configure_input,;t t
15226 s,@srcdir@,$ac_srcdir,;t t
15227 s,@top_srcdir@,$ac_top_srcdir,;t t
15228 s,@INSTALL@,$ac_INSTALL,;t t
15229 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15230   rm -f $tmp/stdin
15231   if test x"$ac_file" != x-; then
15232     cp $tmp/out $ac_file
15233
15234     for ac_name in prefix exec_prefix datarootdir
15235     do
15236         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15237         if test -n "$ac_seen"; then
15238             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15239             if test -z "$ac_init"; then
15240               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15241               { echo "$as_me:15241: WARNING: Variable $ac_name is used but was not set:
15242 $ac_seen" >&5
15243 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15244 $ac_seen" >&2;}
15245             fi
15246         fi
15247     done
15248     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15249     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15250     if test -s $tmp/out; then
15251       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15252       { echo "$as_me:15252: WARNING: Some variables may not be substituted:
15253 $ac_seen" >&5
15254 echo "$as_me: WARNING: Some variables may not be substituted:
15255 $ac_seen" >&2;}
15256     fi
15257   else
15258     cat $tmp/out
15259   fi
15260   rm -f $tmp/out
15261
15262 done
15263 EOF
15264 cat >>$CONFIG_STATUS <<\EOF
15265
15266 #
15267 # CONFIG_HEADER section.
15268 #
15269
15270 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15271 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15272 #
15273 # ac_d sets the value in "#define NAME VALUE" lines.
15274 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15275 ac_dB='[        ].*$,\1#\2'
15276 ac_dC=' '
15277 ac_dD=',;t'
15278 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15279 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15280 ac_iB='\([      ]\),\1#\2define\3'
15281 ac_iC=' '
15282 ac_iD='\4,;t'
15283 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15284 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15285 ac_uB='$,\1#\2define\3'
15286 ac_uC=' '
15287 ac_uD=',;t'
15288
15289 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15290   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15291   case $ac_file in
15292   - | *:- | *:-:* ) # input from stdin
15293         cat >$tmp/stdin
15294         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15295         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15296   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15297         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15298   * )   ac_file_in=$ac_file.in ;;
15299   esac
15300
15301   test x"$ac_file" != x- && { echo "$as_me:15301: creating $ac_file" >&5
15302 echo "$as_me: creating $ac_file" >&6;}
15303
15304   # First look for the input files in the build tree, otherwise in the
15305   # src tree.
15306   ac_file_inputs=`IFS=:
15307     for f in $ac_file_in; do
15308       case $f in
15309       -) echo $tmp/stdin ;;
15310       [\\/$]*)
15311          # Absolute (can't be DOS-style, as IFS=:)
15312          test -f "$f" || { { echo "$as_me:15312: error: cannot find input file: $f" >&5
15313 echo "$as_me: error: cannot find input file: $f" >&2;}
15314    { (exit 1); exit 1; }; }
15315          echo $f;;
15316       *) # Relative
15317          if test -f "$f"; then
15318            # Build tree
15319            echo $f
15320          elif test -f "$srcdir/$f"; then
15321            # Source tree
15322            echo $srcdir/$f
15323          else
15324            # /dev/null tree
15325            { { echo "$as_me:15325: error: cannot find input file: $f" >&5
15326 echo "$as_me: error: cannot find input file: $f" >&2;}
15327    { (exit 1); exit 1; }; }
15328          fi;;
15329       esac
15330     done` || { (exit 1); exit 1; }
15331   # Remove the trailing spaces.
15332   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15333
15334 EOF
15335
15336 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15337 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15338 # be either 'cat' or 'sort'.
15339 cat confdefs.h | uniq >conftest.vals
15340
15341 # Break up conftest.vals because some shells have a limit on
15342 # the size of here documents, and old seds have small limits too.
15343
15344 rm -f conftest.tail
15345 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15346 while grep . conftest.vals >/dev/null
15347 do
15348   # Write chunks of a limited-size here document to conftest.frag.
15349   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15350   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15351   echo 'CEOF' >> $CONFIG_STATUS
15352   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15353   rm -f conftest.vals
15354   mv conftest.tail conftest.vals
15355 done
15356 rm -f conftest.vals
15357
15358 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15359 # marker @DEFS@.
15360 echo '  cat >> conftest.edit <<CEOF
15361 /@DEFS@/r conftest.frag
15362 /@DEFS@/d
15363 CEOF
15364 sed -f conftest.edit $tmp/in > $tmp/out
15365 rm -f $tmp/in
15366 mv $tmp/out $tmp/in
15367 rm -f conftest.edit conftest.frag
15368 ' >> $CONFIG_STATUS
15369
15370 cat >>$CONFIG_STATUS <<\EOF
15371   # Let's still pretend it is `configure' which instantiates (i.e., don't
15372   # use $as_me), people would be surprised to read:
15373   #    /* config.h.  Generated automatically by config.status.  */
15374   if test x"$ac_file" = x-; then
15375     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15376   else
15377     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15378   fi
15379   cat $tmp/in >>$tmp/config.h
15380   rm -f $tmp/in
15381   if test x"$ac_file" != x-; then
15382     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15383       { echo "$as_me:15383: $ac_file is unchanged" >&5
15384 echo "$as_me: $ac_file is unchanged" >&6;}
15385     else
15386       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15387          X"$ac_file" : 'X\(//\)[^/]' \| \
15388          X"$ac_file" : 'X\(//\)$' \| \
15389          X"$ac_file" : 'X\(/\)' \| \
15390          .     : '\(.\)' 2>/dev/null ||
15391 echo X"$ac_file" |
15392     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15393           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15394           /^X\(\/\/\)$/{ s//\1/; q; }
15395           /^X\(\/\).*/{ s//\1/; q; }
15396           s/.*/./; q'`
15397       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15398         { case "$ac_dir" in
15399   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15400   *)                      as_incr_dir=.;;
15401 esac
15402 as_dummy="$ac_dir"
15403 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15404   case $as_mkdir_dir in
15405     # Skip DOS drivespec
15406     ?:) as_incr_dir=$as_mkdir_dir ;;
15407     *)
15408       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15409       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15410     ;;
15411   esac
15412 done; }
15413
15414       fi
15415       rm -f $ac_file
15416       mv $tmp/config.h $ac_file
15417     fi
15418   else
15419     cat $tmp/config.h
15420     rm -f $tmp/config.h
15421   fi
15422 done
15423 EOF
15424 cat >>$CONFIG_STATUS <<\EOF
15425 #
15426 # CONFIG_COMMANDS section.
15427 #
15428 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15429   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15430   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15431
15432   case $ac_dest in
15433     default )
15434 if test -z "$USE_OLD_MAKERULES" ; then
15435         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15436 fi
15437  ;;
15438   esac
15439 done
15440 EOF
15441
15442 cat >>$CONFIG_STATUS <<\EOF
15443
15444 { (exit 0); exit 0; }
15445 EOF
15446 chmod +x $CONFIG_STATUS
15447 ac_clean_files=$ac_clean_files_save
15448
15449 # configure is writing to config.log, and then calls config.status.
15450 # config.status does its own redirection, appending to config.log.
15451 # Unfortunately, on DOS this fails, as config.log is still kept open
15452 # by configure, so config.status won't be able to write to it; its
15453 # output is simply discarded.  So we exec the FD to /dev/null,
15454 # effectively closing config.log, so it can be properly (re)opened and
15455 # appended to by config.status.  When coming back to configure, we
15456 # need to make the FD available again.
15457 if test "$no_create" != yes; then
15458   ac_cs_success=:
15459   exec 5>/dev/null
15460   $SHELL $CONFIG_STATUS || ac_cs_success=false
15461   exec 5>>config.log
15462   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15463   # would make configure fail if this is the last instruction.
15464   $ac_cs_success || { (exit 1); exit 1; }
15465 fi
15466 ${MAKE:-make} preinstall