]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20160625
[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 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9811
9812         ;;
9813 (minix*)
9814         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9815         ;;
9816 (mirbsd*)
9817         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9818         cf_XOPEN_SOURCE=
9819
9820 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9821
9822 cf_save_CFLAGS="$CFLAGS"
9823 cf_save_CPPFLAGS="$CPPFLAGS"
9824
9825 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9826         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9827                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9828
9829 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9830         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9831                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9832
9833 echo "$as_me:9833: checking if we should define _POSIX_C_SOURCE" >&5
9834 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9835 if test "${cf_cv_posix_c_source+set}" = set; then
9836   echo $ECHO_N "(cached) $ECHO_C" >&6
9837 else
9838
9839 echo "${as_me:-configure}:9839: testing if the symbol is already defined go no further ..." 1>&5
9840
9841         cat >conftest.$ac_ext <<_ACEOF
9842 #line 9842 "configure"
9843 #include "confdefs.h"
9844 #include <sys/types.h>
9845 int
9846 main ()
9847 {
9848
9849 #ifndef _POSIX_C_SOURCE
9850 make an error
9851 #endif
9852   ;
9853   return 0;
9854 }
9855 _ACEOF
9856 rm -f conftest.$ac_objext
9857 if { (eval echo "$as_me:9857: \"$ac_compile\"") >&5
9858   (eval $ac_compile) 2>&5
9859   ac_status=$?
9860   echo "$as_me:9860: \$? = $ac_status" >&5
9861   (exit $ac_status); } &&
9862          { ac_try='test -s conftest.$ac_objext'
9863   { (eval echo "$as_me:9863: \"$ac_try\"") >&5
9864   (eval $ac_try) 2>&5
9865   ac_status=$?
9866   echo "$as_me:9866: \$? = $ac_status" >&5
9867   (exit $ac_status); }; }; then
9868   cf_cv_posix_c_source=no
9869 else
9870   echo "$as_me: failed program was:" >&5
9871 cat conftest.$ac_ext >&5
9872 cf_want_posix_source=no
9873          case .$cf_POSIX_C_SOURCE in
9874          (.[12]??*)
9875                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9876                 ;;
9877          (.2)
9878                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9879                 cf_want_posix_source=yes
9880                 ;;
9881          (.*)
9882                 cf_want_posix_source=yes
9883                 ;;
9884          esac
9885          if test "$cf_want_posix_source" = yes ; then
9886                 cat >conftest.$ac_ext <<_ACEOF
9887 #line 9887 "configure"
9888 #include "confdefs.h"
9889 #include <sys/types.h>
9890 int
9891 main ()
9892 {
9893
9894 #ifdef _POSIX_SOURCE
9895 make an error
9896 #endif
9897   ;
9898   return 0;
9899 }
9900 _ACEOF
9901 rm -f conftest.$ac_objext
9902 if { (eval echo "$as_me:9902: \"$ac_compile\"") >&5
9903   (eval $ac_compile) 2>&5
9904   ac_status=$?
9905   echo "$as_me:9905: \$? = $ac_status" >&5
9906   (exit $ac_status); } &&
9907          { ac_try='test -s conftest.$ac_objext'
9908   { (eval echo "$as_me:9908: \"$ac_try\"") >&5
9909   (eval $ac_try) 2>&5
9910   ac_status=$?
9911   echo "$as_me:9911: \$? = $ac_status" >&5
9912   (exit $ac_status); }; }; then
9913   :
9914 else
9915   echo "$as_me: failed program was:" >&5
9916 cat conftest.$ac_ext >&5
9917 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9918 fi
9919 rm -f conftest.$ac_objext conftest.$ac_ext
9920          fi
9921
9922 echo "${as_me:-configure}:9922: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9923
9924          CFLAGS="$cf_trim_CFLAGS"
9925          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9926
9927 echo "${as_me:-configure}:9927: testing if the second compile does not leave our definition intact error ..." 1>&5
9928
9929          cat >conftest.$ac_ext <<_ACEOF
9930 #line 9930 "configure"
9931 #include "confdefs.h"
9932 #include <sys/types.h>
9933 int
9934 main ()
9935 {
9936
9937 #ifndef _POSIX_C_SOURCE
9938 make an error
9939 #endif
9940   ;
9941   return 0;
9942 }
9943 _ACEOF
9944 rm -f conftest.$ac_objext
9945 if { (eval echo "$as_me:9945: \"$ac_compile\"") >&5
9946   (eval $ac_compile) 2>&5
9947   ac_status=$?
9948   echo "$as_me:9948: \$? = $ac_status" >&5
9949   (exit $ac_status); } &&
9950          { ac_try='test -s conftest.$ac_objext'
9951   { (eval echo "$as_me:9951: \"$ac_try\"") >&5
9952   (eval $ac_try) 2>&5
9953   ac_status=$?
9954   echo "$as_me:9954: \$? = $ac_status" >&5
9955   (exit $ac_status); }; }; then
9956   :
9957 else
9958   echo "$as_me: failed program was:" >&5
9959 cat conftest.$ac_ext >&5
9960 cf_cv_posix_c_source=no
9961 fi
9962 rm -f conftest.$ac_objext conftest.$ac_ext
9963          CFLAGS="$cf_save_CFLAGS"
9964          CPPFLAGS="$cf_save_CPPFLAGS"
9965
9966 fi
9967 rm -f conftest.$ac_objext conftest.$ac_ext
9968
9969 fi
9970 echo "$as_me:9970: result: $cf_cv_posix_c_source" >&5
9971 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
9972
9973 if test "$cf_cv_posix_c_source" != no ; then
9974         CFLAGS="$cf_trim_CFLAGS"
9975         CPPFLAGS="$cf_trim_CPPFLAGS"
9976
9977 cf_fix_cppflags=no
9978 cf_new_cflags=
9979 cf_new_cppflags=
9980 cf_new_extra_cppflags=
9981
9982 for cf_add_cflags in $cf_cv_posix_c_source
9983 do
9984 case $cf_fix_cppflags in
9985 (no)
9986         case $cf_add_cflags in
9987         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9988                 case $cf_add_cflags in
9989                 (-D*)
9990                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9991
9992                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9993                                 && test -z "${cf_tst_cflags}" \
9994                                 && cf_fix_cppflags=yes
9995
9996                         if test $cf_fix_cppflags = yes ; then
9997                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9998                                 continue
9999                         elif test "${cf_tst_cflags}" = "\"'" ; then
10000                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10001                                 continue
10002                         fi
10003                         ;;
10004                 esac
10005                 case "$CPPFLAGS" in
10006                 (*$cf_add_cflags)
10007                         ;;
10008                 (*)
10009                         case $cf_add_cflags in
10010                         (-D*)
10011                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10012
10013 CPPFLAGS=`echo "$CPPFLAGS" | \
10014         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10015                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10016
10017                                 ;;
10018                         esac
10019                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10020                         ;;
10021                 esac
10022                 ;;
10023         (*)
10024                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10025                 ;;
10026         esac
10027         ;;
10028 (yes)
10029         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10030
10031         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10032
10033         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10034                 && test -z "${cf_tst_cflags}" \
10035                 && cf_fix_cppflags=no
10036         ;;
10037 esac
10038 done
10039
10040 if test -n "$cf_new_cflags" ; then
10041
10042         CFLAGS="$CFLAGS $cf_new_cflags"
10043 fi
10044
10045 if test -n "$cf_new_cppflags" ; then
10046
10047         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10048 fi
10049
10050 if test -n "$cf_new_extra_cppflags" ; then
10051
10052         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10053 fi
10054
10055 fi
10056
10057         ;;
10058 (netbsd*)
10059         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10060         ;;
10061 (openbsd[4-9]*)
10062         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10063         cf_xopen_source="-D_BSD_SOURCE"
10064         cf_XOPEN_SOURCE=600
10065         ;;
10066 (openbsd*)
10067         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10068         ;;
10069 (os2*)
10070         cf_XOPEN_SOURCE=
10071         ;;
10072 (osf[45]*)
10073         cf_xopen_source="-D_OSF_SOURCE"
10074         ;;
10075 (nto-qnx*)
10076         cf_xopen_source="-D_QNX_SOURCE"
10077         ;;
10078 (sco*)
10079         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10080         ;;
10081 (solaris2.*)
10082         cf_xopen_source="-D__EXTENSIONS__"
10083         cf_cv_xopen_source=broken
10084         ;;
10085 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10086         cf_XOPEN_SOURCE=
10087         cf_POSIX_C_SOURCE=
10088         ;;
10089 (*)
10090
10091 echo "$as_me:10091: checking if we should define _XOPEN_SOURCE" >&5
10092 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10093 if test "${cf_cv_xopen_source+set}" = set; then
10094   echo $ECHO_N "(cached) $ECHO_C" >&6
10095 else
10096
10097         cat >conftest.$ac_ext <<_ACEOF
10098 #line 10098 "configure"
10099 #include "confdefs.h"
10100
10101 #include <stdlib.h>
10102 #include <string.h>
10103 #include <sys/types.h>
10104
10105 int
10106 main ()
10107 {
10108
10109 #ifndef _XOPEN_SOURCE
10110 make an error
10111 #endif
10112   ;
10113   return 0;
10114 }
10115 _ACEOF
10116 rm -f conftest.$ac_objext
10117 if { (eval echo "$as_me:10117: \"$ac_compile\"") >&5
10118   (eval $ac_compile) 2>&5
10119   ac_status=$?
10120   echo "$as_me:10120: \$? = $ac_status" >&5
10121   (exit $ac_status); } &&
10122          { ac_try='test -s conftest.$ac_objext'
10123   { (eval echo "$as_me:10123: \"$ac_try\"") >&5
10124   (eval $ac_try) 2>&5
10125   ac_status=$?
10126   echo "$as_me:10126: \$? = $ac_status" >&5
10127   (exit $ac_status); }; }; then
10128   cf_cv_xopen_source=no
10129 else
10130   echo "$as_me: failed program was:" >&5
10131 cat conftest.$ac_ext >&5
10132 cf_save="$CPPFLAGS"
10133          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10134          cat >conftest.$ac_ext <<_ACEOF
10135 #line 10135 "configure"
10136 #include "confdefs.h"
10137
10138 #include <stdlib.h>
10139 #include <string.h>
10140 #include <sys/types.h>
10141
10142 int
10143 main ()
10144 {
10145
10146 #ifdef _XOPEN_SOURCE
10147 make an error
10148 #endif
10149   ;
10150   return 0;
10151 }
10152 _ACEOF
10153 rm -f conftest.$ac_objext
10154 if { (eval echo "$as_me:10154: \"$ac_compile\"") >&5
10155   (eval $ac_compile) 2>&5
10156   ac_status=$?
10157   echo "$as_me:10157: \$? = $ac_status" >&5
10158   (exit $ac_status); } &&
10159          { ac_try='test -s conftest.$ac_objext'
10160   { (eval echo "$as_me:10160: \"$ac_try\"") >&5
10161   (eval $ac_try) 2>&5
10162   ac_status=$?
10163   echo "$as_me:10163: \$? = $ac_status" >&5
10164   (exit $ac_status); }; }; then
10165   cf_cv_xopen_source=no
10166 else
10167   echo "$as_me: failed program was:" >&5
10168 cat conftest.$ac_ext >&5
10169 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10170 fi
10171 rm -f conftest.$ac_objext conftest.$ac_ext
10172         CPPFLAGS="$cf_save"
10173
10174 fi
10175 rm -f conftest.$ac_objext conftest.$ac_ext
10176
10177 fi
10178 echo "$as_me:10178: result: $cf_cv_xopen_source" >&5
10179 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10180
10181 if test "$cf_cv_xopen_source" != no ; then
10182
10183 CFLAGS=`echo "$CFLAGS" | \
10184         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10185                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10186
10187 CPPFLAGS=`echo "$CPPFLAGS" | \
10188         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10189                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10190
10191         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10192
10193 cf_fix_cppflags=no
10194 cf_new_cflags=
10195 cf_new_cppflags=
10196 cf_new_extra_cppflags=
10197
10198 for cf_add_cflags in $cf_temp_xopen_source
10199 do
10200 case $cf_fix_cppflags in
10201 (no)
10202         case $cf_add_cflags in
10203         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10204                 case $cf_add_cflags in
10205                 (-D*)
10206                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10207
10208                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10209                                 && test -z "${cf_tst_cflags}" \
10210                                 && cf_fix_cppflags=yes
10211
10212                         if test $cf_fix_cppflags = yes ; then
10213                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10214                                 continue
10215                         elif test "${cf_tst_cflags}" = "\"'" ; then
10216                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10217                                 continue
10218                         fi
10219                         ;;
10220                 esac
10221                 case "$CPPFLAGS" in
10222                 (*$cf_add_cflags)
10223                         ;;
10224                 (*)
10225                         case $cf_add_cflags in
10226                         (-D*)
10227                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10228
10229 CPPFLAGS=`echo "$CPPFLAGS" | \
10230         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10231                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10232
10233                                 ;;
10234                         esac
10235                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10236                         ;;
10237                 esac
10238                 ;;
10239         (*)
10240                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10241                 ;;
10242         esac
10243         ;;
10244 (yes)
10245         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10246
10247         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10248
10249         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10250                 && test -z "${cf_tst_cflags}" \
10251                 && cf_fix_cppflags=no
10252         ;;
10253 esac
10254 done
10255
10256 if test -n "$cf_new_cflags" ; then
10257
10258         CFLAGS="$CFLAGS $cf_new_cflags"
10259 fi
10260
10261 if test -n "$cf_new_cppflags" ; then
10262
10263         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10264 fi
10265
10266 if test -n "$cf_new_extra_cppflags" ; then
10267
10268         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10269 fi
10270
10271 fi
10272
10273 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10274
10275 cf_save_CFLAGS="$CFLAGS"
10276 cf_save_CPPFLAGS="$CPPFLAGS"
10277
10278 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10279         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10280                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10281
10282 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10283         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10284                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10285
10286 echo "$as_me:10286: checking if we should define _POSIX_C_SOURCE" >&5
10287 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10288 if test "${cf_cv_posix_c_source+set}" = set; then
10289   echo $ECHO_N "(cached) $ECHO_C" >&6
10290 else
10291
10292 echo "${as_me:-configure}:10292: testing if the symbol is already defined go no further ..." 1>&5
10293
10294         cat >conftest.$ac_ext <<_ACEOF
10295 #line 10295 "configure"
10296 #include "confdefs.h"
10297 #include <sys/types.h>
10298 int
10299 main ()
10300 {
10301
10302 #ifndef _POSIX_C_SOURCE
10303 make an error
10304 #endif
10305   ;
10306   return 0;
10307 }
10308 _ACEOF
10309 rm -f conftest.$ac_objext
10310 if { (eval echo "$as_me:10310: \"$ac_compile\"") >&5
10311   (eval $ac_compile) 2>&5
10312   ac_status=$?
10313   echo "$as_me:10313: \$? = $ac_status" >&5
10314   (exit $ac_status); } &&
10315          { ac_try='test -s conftest.$ac_objext'
10316   { (eval echo "$as_me:10316: \"$ac_try\"") >&5
10317   (eval $ac_try) 2>&5
10318   ac_status=$?
10319   echo "$as_me:10319: \$? = $ac_status" >&5
10320   (exit $ac_status); }; }; then
10321   cf_cv_posix_c_source=no
10322 else
10323   echo "$as_me: failed program was:" >&5
10324 cat conftest.$ac_ext >&5
10325 cf_want_posix_source=no
10326          case .$cf_POSIX_C_SOURCE in
10327          (.[12]??*)
10328                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10329                 ;;
10330          (.2)
10331                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10332                 cf_want_posix_source=yes
10333                 ;;
10334          (.*)
10335                 cf_want_posix_source=yes
10336                 ;;
10337          esac
10338          if test "$cf_want_posix_source" = yes ; then
10339                 cat >conftest.$ac_ext <<_ACEOF
10340 #line 10340 "configure"
10341 #include "confdefs.h"
10342 #include <sys/types.h>
10343 int
10344 main ()
10345 {
10346
10347 #ifdef _POSIX_SOURCE
10348 make an error
10349 #endif
10350   ;
10351   return 0;
10352 }
10353 _ACEOF
10354 rm -f conftest.$ac_objext
10355 if { (eval echo "$as_me:10355: \"$ac_compile\"") >&5
10356   (eval $ac_compile) 2>&5
10357   ac_status=$?
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); } &&
10360          { ac_try='test -s conftest.$ac_objext'
10361   { (eval echo "$as_me:10361: \"$ac_try\"") >&5
10362   (eval $ac_try) 2>&5
10363   ac_status=$?
10364   echo "$as_me:10364: \$? = $ac_status" >&5
10365   (exit $ac_status); }; }; then
10366   :
10367 else
10368   echo "$as_me: failed program was:" >&5
10369 cat conftest.$ac_ext >&5
10370 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10371 fi
10372 rm -f conftest.$ac_objext conftest.$ac_ext
10373          fi
10374
10375 echo "${as_me:-configure}:10375: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10376
10377          CFLAGS="$cf_trim_CFLAGS"
10378          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10379
10380 echo "${as_me:-configure}:10380: testing if the second compile does not leave our definition intact error ..." 1>&5
10381
10382          cat >conftest.$ac_ext <<_ACEOF
10383 #line 10383 "configure"
10384 #include "confdefs.h"
10385 #include <sys/types.h>
10386 int
10387 main ()
10388 {
10389
10390 #ifndef _POSIX_C_SOURCE
10391 make an error
10392 #endif
10393   ;
10394   return 0;
10395 }
10396 _ACEOF
10397 rm -f conftest.$ac_objext
10398 if { (eval echo "$as_me:10398: \"$ac_compile\"") >&5
10399   (eval $ac_compile) 2>&5
10400   ac_status=$?
10401   echo "$as_me:10401: \$? = $ac_status" >&5
10402   (exit $ac_status); } &&
10403          { ac_try='test -s conftest.$ac_objext'
10404   { (eval echo "$as_me:10404: \"$ac_try\"") >&5
10405   (eval $ac_try) 2>&5
10406   ac_status=$?
10407   echo "$as_me:10407: \$? = $ac_status" >&5
10408   (exit $ac_status); }; }; then
10409   :
10410 else
10411   echo "$as_me: failed program was:" >&5
10412 cat conftest.$ac_ext >&5
10413 cf_cv_posix_c_source=no
10414 fi
10415 rm -f conftest.$ac_objext conftest.$ac_ext
10416          CFLAGS="$cf_save_CFLAGS"
10417          CPPFLAGS="$cf_save_CPPFLAGS"
10418
10419 fi
10420 rm -f conftest.$ac_objext conftest.$ac_ext
10421
10422 fi
10423 echo "$as_me:10423: result: $cf_cv_posix_c_source" >&5
10424 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10425
10426 if test "$cf_cv_posix_c_source" != no ; then
10427         CFLAGS="$cf_trim_CFLAGS"
10428         CPPFLAGS="$cf_trim_CPPFLAGS"
10429
10430 cf_fix_cppflags=no
10431 cf_new_cflags=
10432 cf_new_cppflags=
10433 cf_new_extra_cppflags=
10434
10435 for cf_add_cflags in $cf_cv_posix_c_source
10436 do
10437 case $cf_fix_cppflags in
10438 (no)
10439         case $cf_add_cflags in
10440         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10441                 case $cf_add_cflags in
10442                 (-D*)
10443                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10444
10445                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10446                                 && test -z "${cf_tst_cflags}" \
10447                                 && cf_fix_cppflags=yes
10448
10449                         if test $cf_fix_cppflags = yes ; then
10450                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10451                                 continue
10452                         elif test "${cf_tst_cflags}" = "\"'" ; then
10453                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10454                                 continue
10455                         fi
10456                         ;;
10457                 esac
10458                 case "$CPPFLAGS" in
10459                 (*$cf_add_cflags)
10460                         ;;
10461                 (*)
10462                         case $cf_add_cflags in
10463                         (-D*)
10464                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10465
10466 CPPFLAGS=`echo "$CPPFLAGS" | \
10467         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10468                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10469
10470                                 ;;
10471                         esac
10472                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10473                         ;;
10474                 esac
10475                 ;;
10476         (*)
10477                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10478                 ;;
10479         esac
10480         ;;
10481 (yes)
10482         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10483
10484         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10485
10486         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10487                 && test -z "${cf_tst_cflags}" \
10488                 && cf_fix_cppflags=no
10489         ;;
10490 esac
10491 done
10492
10493 if test -n "$cf_new_cflags" ; then
10494
10495         CFLAGS="$CFLAGS $cf_new_cflags"
10496 fi
10497
10498 if test -n "$cf_new_cppflags" ; then
10499
10500         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10501 fi
10502
10503 if test -n "$cf_new_extra_cppflags" ; then
10504
10505         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10506 fi
10507
10508 fi
10509
10510         ;;
10511 esac
10512
10513 if test -n "$cf_xopen_source" ; then
10514
10515 cf_fix_cppflags=no
10516 cf_new_cflags=
10517 cf_new_cppflags=
10518 cf_new_extra_cppflags=
10519
10520 for cf_add_cflags in $cf_xopen_source
10521 do
10522 case $cf_fix_cppflags in
10523 (no)
10524         case $cf_add_cflags in
10525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10526                 case $cf_add_cflags in
10527                 (-D*)
10528                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10529
10530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10531                                 && test -z "${cf_tst_cflags}" \
10532                                 && cf_fix_cppflags=yes
10533
10534                         if test $cf_fix_cppflags = yes ; then
10535                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10536                                 continue
10537                         elif test "${cf_tst_cflags}" = "\"'" ; then
10538                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10539                                 continue
10540                         fi
10541                         ;;
10542                 esac
10543                 case "$CPPFLAGS" in
10544                 (*$cf_add_cflags)
10545                         ;;
10546                 (*)
10547                         case $cf_add_cflags in
10548                         (-D*)
10549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10550
10551 CPPFLAGS=`echo "$CPPFLAGS" | \
10552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10554
10555                                 ;;
10556                         esac
10557                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10558                         ;;
10559                 esac
10560                 ;;
10561         (*)
10562                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10563                 ;;
10564         esac
10565         ;;
10566 (yes)
10567         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10568
10569         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10570
10571         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10572                 && test -z "${cf_tst_cflags}" \
10573                 && cf_fix_cppflags=no
10574         ;;
10575 esac
10576 done
10577
10578 if test -n "$cf_new_cflags" ; then
10579         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10580
10581 echo "${as_me:-configure}:10581: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10582
10583         CFLAGS="$CFLAGS $cf_new_cflags"
10584 fi
10585
10586 if test -n "$cf_new_cppflags" ; then
10587         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10588
10589 echo "${as_me:-configure}:10589: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10590
10591         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10592 fi
10593
10594 if test -n "$cf_new_extra_cppflags" ; then
10595         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10596
10597 echo "${as_me:-configure}:10597: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10598
10599         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10600 fi
10601
10602 fi
10603
10604 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10605         echo "$as_me:10605: checking if _XOPEN_SOURCE really is set" >&5
10606 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10607         cat >conftest.$ac_ext <<_ACEOF
10608 #line 10608 "configure"
10609 #include "confdefs.h"
10610 #include <stdlib.h>
10611 int
10612 main ()
10613 {
10614
10615 #ifndef _XOPEN_SOURCE
10616 make an error
10617 #endif
10618   ;
10619   return 0;
10620 }
10621 _ACEOF
10622 rm -f conftest.$ac_objext
10623 if { (eval echo "$as_me:10623: \"$ac_compile\"") >&5
10624   (eval $ac_compile) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); } &&
10628          { ac_try='test -s conftest.$ac_objext'
10629   { (eval echo "$as_me:10629: \"$ac_try\"") >&5
10630   (eval $ac_try) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); }; }; then
10634   cf_XOPEN_SOURCE_set=yes
10635 else
10636   echo "$as_me: failed program was:" >&5
10637 cat conftest.$ac_ext >&5
10638 cf_XOPEN_SOURCE_set=no
10639 fi
10640 rm -f conftest.$ac_objext conftest.$ac_ext
10641         echo "$as_me:10641: result: $cf_XOPEN_SOURCE_set" >&5
10642 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10643         if test $cf_XOPEN_SOURCE_set = yes
10644         then
10645                 cat >conftest.$ac_ext <<_ACEOF
10646 #line 10646 "configure"
10647 #include "confdefs.h"
10648 #include <stdlib.h>
10649 int
10650 main ()
10651 {
10652
10653 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10654 make an error
10655 #endif
10656   ;
10657   return 0;
10658 }
10659 _ACEOF
10660 rm -f conftest.$ac_objext
10661 if { (eval echo "$as_me:10661: \"$ac_compile\"") >&5
10662   (eval $ac_compile) 2>&5
10663   ac_status=$?
10664   echo "$as_me:10664: \$? = $ac_status" >&5
10665   (exit $ac_status); } &&
10666          { ac_try='test -s conftest.$ac_objext'
10667   { (eval echo "$as_me:10667: \"$ac_try\"") >&5
10668   (eval $ac_try) 2>&5
10669   ac_status=$?
10670   echo "$as_me:10670: \$? = $ac_status" >&5
10671   (exit $ac_status); }; }; then
10672   cf_XOPEN_SOURCE_set_ok=yes
10673 else
10674   echo "$as_me: failed program was:" >&5
10675 cat conftest.$ac_ext >&5
10676 cf_XOPEN_SOURCE_set_ok=no
10677 fi
10678 rm -f conftest.$ac_objext conftest.$ac_ext
10679                 if test $cf_XOPEN_SOURCE_set_ok = no
10680                 then
10681                         { echo "$as_me:10681: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10682 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10683                 fi
10684         else
10685
10686 echo "$as_me:10686: checking if we should define _XOPEN_SOURCE" >&5
10687 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10688 if test "${cf_cv_xopen_source+set}" = set; then
10689   echo $ECHO_N "(cached) $ECHO_C" >&6
10690 else
10691
10692         cat >conftest.$ac_ext <<_ACEOF
10693 #line 10693 "configure"
10694 #include "confdefs.h"
10695
10696 #include <stdlib.h>
10697 #include <string.h>
10698 #include <sys/types.h>
10699
10700 int
10701 main ()
10702 {
10703
10704 #ifndef _XOPEN_SOURCE
10705 make an error
10706 #endif
10707   ;
10708   return 0;
10709 }
10710 _ACEOF
10711 rm -f conftest.$ac_objext
10712 if { (eval echo "$as_me:10712: \"$ac_compile\"") >&5
10713   (eval $ac_compile) 2>&5
10714   ac_status=$?
10715   echo "$as_me:10715: \$? = $ac_status" >&5
10716   (exit $ac_status); } &&
10717          { ac_try='test -s conftest.$ac_objext'
10718   { (eval echo "$as_me:10718: \"$ac_try\"") >&5
10719   (eval $ac_try) 2>&5
10720   ac_status=$?
10721   echo "$as_me:10721: \$? = $ac_status" >&5
10722   (exit $ac_status); }; }; then
10723   cf_cv_xopen_source=no
10724 else
10725   echo "$as_me: failed program was:" >&5
10726 cat conftest.$ac_ext >&5
10727 cf_save="$CPPFLAGS"
10728          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10729          cat >conftest.$ac_ext <<_ACEOF
10730 #line 10730 "configure"
10731 #include "confdefs.h"
10732
10733 #include <stdlib.h>
10734 #include <string.h>
10735 #include <sys/types.h>
10736
10737 int
10738 main ()
10739 {
10740
10741 #ifdef _XOPEN_SOURCE
10742 make an error
10743 #endif
10744   ;
10745   return 0;
10746 }
10747 _ACEOF
10748 rm -f conftest.$ac_objext
10749 if { (eval echo "$as_me:10749: \"$ac_compile\"") >&5
10750   (eval $ac_compile) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit $ac_status); } &&
10754          { ac_try='test -s conftest.$ac_objext'
10755   { (eval echo "$as_me:10755: \"$ac_try\"") >&5
10756   (eval $ac_try) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit $ac_status); }; }; then
10760   cf_cv_xopen_source=no
10761 else
10762   echo "$as_me: failed program was:" >&5
10763 cat conftest.$ac_ext >&5
10764 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10765 fi
10766 rm -f conftest.$ac_objext conftest.$ac_ext
10767         CPPFLAGS="$cf_save"
10768
10769 fi
10770 rm -f conftest.$ac_objext conftest.$ac_ext
10771
10772 fi
10773 echo "$as_me:10773: result: $cf_cv_xopen_source" >&5
10774 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10775
10776 if test "$cf_cv_xopen_source" != no ; then
10777
10778 CFLAGS=`echo "$CFLAGS" | \
10779         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10780                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10781
10782 CPPFLAGS=`echo "$CPPFLAGS" | \
10783         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10784                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10785
10786         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10787
10788 cf_fix_cppflags=no
10789 cf_new_cflags=
10790 cf_new_cppflags=
10791 cf_new_extra_cppflags=
10792
10793 for cf_add_cflags in $cf_temp_xopen_source
10794 do
10795 case $cf_fix_cppflags in
10796 (no)
10797         case $cf_add_cflags in
10798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10799                 case $cf_add_cflags in
10800                 (-D*)
10801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10802
10803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10804                                 && test -z "${cf_tst_cflags}" \
10805                                 && cf_fix_cppflags=yes
10806
10807                         if test $cf_fix_cppflags = yes ; then
10808                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10809                                 continue
10810                         elif test "${cf_tst_cflags}" = "\"'" ; then
10811                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10812                                 continue
10813                         fi
10814                         ;;
10815                 esac
10816                 case "$CPPFLAGS" in
10817                 (*$cf_add_cflags)
10818                         ;;
10819                 (*)
10820                         case $cf_add_cflags in
10821                         (-D*)
10822                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10823
10824 CPPFLAGS=`echo "$CPPFLAGS" | \
10825         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10826                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10827
10828                                 ;;
10829                         esac
10830                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10831                         ;;
10832                 esac
10833                 ;;
10834         (*)
10835                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10836                 ;;
10837         esac
10838         ;;
10839 (yes)
10840         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10841
10842         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10843
10844         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10845                 && test -z "${cf_tst_cflags}" \
10846                 && cf_fix_cppflags=no
10847         ;;
10848 esac
10849 done
10850
10851 if test -n "$cf_new_cflags" ; then
10852
10853         CFLAGS="$CFLAGS $cf_new_cflags"
10854 fi
10855
10856 if test -n "$cf_new_cppflags" ; then
10857
10858         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10859 fi
10860
10861 if test -n "$cf_new_extra_cppflags" ; then
10862
10863         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10864 fi
10865
10866 fi
10867
10868         fi
10869 fi
10870
10871 # Check whether --enable-largefile or --disable-largefile was given.
10872 if test "${enable_largefile+set}" = set; then
10873   enableval="$enable_largefile"
10874
10875 fi;
10876 if test "$enable_largefile" != no; then
10877
10878   echo "$as_me:10878: checking for special C compiler options needed for large files" >&5
10879 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10880 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10881   echo $ECHO_N "(cached) $ECHO_C" >&6
10882 else
10883   ac_cv_sys_largefile_CC=no
10884      if test "$GCC" != yes; then
10885        ac_save_CC=$CC
10886        while :; do
10887          # IRIX 6.2 and later do not support large files by default,
10888          # so use the C compiler's -n32 option if that helps.
10889          cat >conftest.$ac_ext <<_ACEOF
10890 #line 10890 "configure"
10891 #include "confdefs.h"
10892 #include <sys/types.h>
10893  /* Check that off_t can represent 2**63 - 1 correctly.
10894     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10895     since some C++ compilers masquerading as C compilers
10896     incorrectly reject 9223372036854775807.  */
10897 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10898   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10899                        && LARGE_OFF_T % 2147483647 == 1)
10900                       ? 1 : -1];
10901 int
10902 main ()
10903 {
10904
10905   ;
10906   return 0;
10907 }
10908 _ACEOF
10909          rm -f conftest.$ac_objext
10910 if { (eval echo "$as_me:10910: \"$ac_compile\"") >&5
10911   (eval $ac_compile) 2>&5
10912   ac_status=$?
10913   echo "$as_me:10913: \$? = $ac_status" >&5
10914   (exit $ac_status); } &&
10915          { ac_try='test -s conftest.$ac_objext'
10916   { (eval echo "$as_me:10916: \"$ac_try\"") >&5
10917   (eval $ac_try) 2>&5
10918   ac_status=$?
10919   echo "$as_me:10919: \$? = $ac_status" >&5
10920   (exit $ac_status); }; }; then
10921   break
10922 else
10923   echo "$as_me: failed program was:" >&5
10924 cat conftest.$ac_ext >&5
10925 fi
10926 rm -f conftest.$ac_objext
10927          CC="$CC -n32"
10928          rm -f conftest.$ac_objext
10929 if { (eval echo "$as_me:10929: \"$ac_compile\"") >&5
10930   (eval $ac_compile) 2>&5
10931   ac_status=$?
10932   echo "$as_me:10932: \$? = $ac_status" >&5
10933   (exit $ac_status); } &&
10934          { ac_try='test -s conftest.$ac_objext'
10935   { (eval echo "$as_me:10935: \"$ac_try\"") >&5
10936   (eval $ac_try) 2>&5
10937   ac_status=$?
10938   echo "$as_me:10938: \$? = $ac_status" >&5
10939   (exit $ac_status); }; }; then
10940   ac_cv_sys_largefile_CC=' -n32'; break
10941 else
10942   echo "$as_me: failed program was:" >&5
10943 cat conftest.$ac_ext >&5
10944 fi
10945 rm -f conftest.$ac_objext
10946          break
10947        done
10948        CC=$ac_save_CC
10949        rm -f conftest.$ac_ext
10950     fi
10951 fi
10952 echo "$as_me:10952: result: $ac_cv_sys_largefile_CC" >&5
10953 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
10954   if test "$ac_cv_sys_largefile_CC" != no; then
10955     CC=$CC$ac_cv_sys_largefile_CC
10956   fi
10957
10958   echo "$as_me:10958: checking for _FILE_OFFSET_BITS value needed for large files" >&5
10959 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
10960 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
10961   echo $ECHO_N "(cached) $ECHO_C" >&6
10962 else
10963   while :; do
10964   ac_cv_sys_file_offset_bits=no
10965   cat >conftest.$ac_ext <<_ACEOF
10966 #line 10966 "configure"
10967 #include "confdefs.h"
10968 #include <sys/types.h>
10969  /* Check that off_t can represent 2**63 - 1 correctly.
10970     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10971     since some C++ compilers masquerading as C compilers
10972     incorrectly reject 9223372036854775807.  */
10973 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10974   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10975                        && LARGE_OFF_T % 2147483647 == 1)
10976                       ? 1 : -1];
10977 int
10978 main ()
10979 {
10980
10981   ;
10982   return 0;
10983 }
10984 _ACEOF
10985 rm -f conftest.$ac_objext
10986 if { (eval echo "$as_me:10986: \"$ac_compile\"") >&5
10987   (eval $ac_compile) 2>&5
10988   ac_status=$?
10989   echo "$as_me:10989: \$? = $ac_status" >&5
10990   (exit $ac_status); } &&
10991          { ac_try='test -s conftest.$ac_objext'
10992   { (eval echo "$as_me:10992: \"$ac_try\"") >&5
10993   (eval $ac_try) 2>&5
10994   ac_status=$?
10995   echo "$as_me:10995: \$? = $ac_status" >&5
10996   (exit $ac_status); }; }; then
10997   break
10998 else
10999   echo "$as_me: failed program was:" >&5
11000 cat conftest.$ac_ext >&5
11001 fi
11002 rm -f conftest.$ac_objext conftest.$ac_ext
11003   cat >conftest.$ac_ext <<_ACEOF
11004 #line 11004 "configure"
11005 #include "confdefs.h"
11006 #define _FILE_OFFSET_BITS 64
11007 #include <sys/types.h>
11008  /* Check that off_t can represent 2**63 - 1 correctly.
11009     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11010     since some C++ compilers masquerading as C compilers
11011     incorrectly reject 9223372036854775807.  */
11012 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11013   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11014                        && LARGE_OFF_T % 2147483647 == 1)
11015                       ? 1 : -1];
11016 int
11017 main ()
11018 {
11019
11020   ;
11021   return 0;
11022 }
11023 _ACEOF
11024 rm -f conftest.$ac_objext
11025 if { (eval echo "$as_me:11025: \"$ac_compile\"") >&5
11026   (eval $ac_compile) 2>&5
11027   ac_status=$?
11028   echo "$as_me:11028: \$? = $ac_status" >&5
11029   (exit $ac_status); } &&
11030          { ac_try='test -s conftest.$ac_objext'
11031   { (eval echo "$as_me:11031: \"$ac_try\"") >&5
11032   (eval $ac_try) 2>&5
11033   ac_status=$?
11034   echo "$as_me:11034: \$? = $ac_status" >&5
11035   (exit $ac_status); }; }; then
11036   ac_cv_sys_file_offset_bits=64; break
11037 else
11038   echo "$as_me: failed program was:" >&5
11039 cat conftest.$ac_ext >&5
11040 fi
11041 rm -f conftest.$ac_objext conftest.$ac_ext
11042   break
11043 done
11044 fi
11045 echo "$as_me:11045: result: $ac_cv_sys_file_offset_bits" >&5
11046 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11047 if test "$ac_cv_sys_file_offset_bits" != no; then
11048
11049 cat >>confdefs.h <<EOF
11050 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11051 EOF
11052
11053 fi
11054 rm -rf conftest*
11055   echo "$as_me:11055: checking for _LARGE_FILES value needed for large files" >&5
11056 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11057 if test "${ac_cv_sys_large_files+set}" = set; then
11058   echo $ECHO_N "(cached) $ECHO_C" >&6
11059 else
11060   while :; do
11061   ac_cv_sys_large_files=no
11062   cat >conftest.$ac_ext <<_ACEOF
11063 #line 11063 "configure"
11064 #include "confdefs.h"
11065 #include <sys/types.h>
11066  /* Check that off_t can represent 2**63 - 1 correctly.
11067     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11068     since some C++ compilers masquerading as C compilers
11069     incorrectly reject 9223372036854775807.  */
11070 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11071   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11072                        && LARGE_OFF_T % 2147483647 == 1)
11073                       ? 1 : -1];
11074 int
11075 main ()
11076 {
11077
11078   ;
11079   return 0;
11080 }
11081 _ACEOF
11082 rm -f conftest.$ac_objext
11083 if { (eval echo "$as_me:11083: \"$ac_compile\"") >&5
11084   (eval $ac_compile) 2>&5
11085   ac_status=$?
11086   echo "$as_me:11086: \$? = $ac_status" >&5
11087   (exit $ac_status); } &&
11088          { ac_try='test -s conftest.$ac_objext'
11089   { (eval echo "$as_me:11089: \"$ac_try\"") >&5
11090   (eval $ac_try) 2>&5
11091   ac_status=$?
11092   echo "$as_me:11092: \$? = $ac_status" >&5
11093   (exit $ac_status); }; }; then
11094   break
11095 else
11096   echo "$as_me: failed program was:" >&5
11097 cat conftest.$ac_ext >&5
11098 fi
11099 rm -f conftest.$ac_objext conftest.$ac_ext
11100   cat >conftest.$ac_ext <<_ACEOF
11101 #line 11101 "configure"
11102 #include "confdefs.h"
11103 #define _LARGE_FILES 1
11104 #include <sys/types.h>
11105  /* Check that off_t can represent 2**63 - 1 correctly.
11106     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11107     since some C++ compilers masquerading as C compilers
11108     incorrectly reject 9223372036854775807.  */
11109 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11110   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11111                        && LARGE_OFF_T % 2147483647 == 1)
11112                       ? 1 : -1];
11113 int
11114 main ()
11115 {
11116
11117   ;
11118   return 0;
11119 }
11120 _ACEOF
11121 rm -f conftest.$ac_objext
11122 if { (eval echo "$as_me:11122: \"$ac_compile\"") >&5
11123   (eval $ac_compile) 2>&5
11124   ac_status=$?
11125   echo "$as_me:11125: \$? = $ac_status" >&5
11126   (exit $ac_status); } &&
11127          { ac_try='test -s conftest.$ac_objext'
11128   { (eval echo "$as_me:11128: \"$ac_try\"") >&5
11129   (eval $ac_try) 2>&5
11130   ac_status=$?
11131   echo "$as_me:11131: \$? = $ac_status" >&5
11132   (exit $ac_status); }; }; then
11133   ac_cv_sys_large_files=1; break
11134 else
11135   echo "$as_me: failed program was:" >&5
11136 cat conftest.$ac_ext >&5
11137 fi
11138 rm -f conftest.$ac_objext conftest.$ac_ext
11139   break
11140 done
11141 fi
11142 echo "$as_me:11142: result: $ac_cv_sys_large_files" >&5
11143 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11144 if test "$ac_cv_sys_large_files" != no; then
11145
11146 cat >>confdefs.h <<EOF
11147 #define _LARGE_FILES $ac_cv_sys_large_files
11148 EOF
11149
11150 fi
11151 rm -rf conftest*
11152 fi
11153
11154         if test "$enable_largefile" != no ; then
11155         echo "$as_me:11155: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11156 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11157 if test "${ac_cv_sys_largefile_source+set}" = set; then
11158   echo $ECHO_N "(cached) $ECHO_C" >&6
11159 else
11160   while :; do
11161   ac_cv_sys_largefile_source=no
11162   cat >conftest.$ac_ext <<_ACEOF
11163 #line 11163 "configure"
11164 #include "confdefs.h"
11165 #include <stdio.h>
11166 int
11167 main ()
11168 {
11169 return !fseeko;
11170   ;
11171   return 0;
11172 }
11173 _ACEOF
11174 rm -f conftest.$ac_objext
11175 if { (eval echo "$as_me:11175: \"$ac_compile\"") >&5
11176   (eval $ac_compile) 2>&5
11177   ac_status=$?
11178   echo "$as_me:11178: \$? = $ac_status" >&5
11179   (exit $ac_status); } &&
11180          { ac_try='test -s conftest.$ac_objext'
11181   { (eval echo "$as_me:11181: \"$ac_try\"") >&5
11182   (eval $ac_try) 2>&5
11183   ac_status=$?
11184   echo "$as_me:11184: \$? = $ac_status" >&5
11185   (exit $ac_status); }; }; then
11186   break
11187 else
11188   echo "$as_me: failed program was:" >&5
11189 cat conftest.$ac_ext >&5
11190 fi
11191 rm -f conftest.$ac_objext conftest.$ac_ext
11192   cat >conftest.$ac_ext <<_ACEOF
11193 #line 11193 "configure"
11194 #include "confdefs.h"
11195 #define _LARGEFILE_SOURCE 1
11196 #include <stdio.h>
11197 int
11198 main ()
11199 {
11200 return !fseeko;
11201   ;
11202   return 0;
11203 }
11204 _ACEOF
11205 rm -f conftest.$ac_objext
11206 if { (eval echo "$as_me:11206: \"$ac_compile\"") >&5
11207   (eval $ac_compile) 2>&5
11208   ac_status=$?
11209   echo "$as_me:11209: \$? = $ac_status" >&5
11210   (exit $ac_status); } &&
11211          { ac_try='test -s conftest.$ac_objext'
11212   { (eval echo "$as_me:11212: \"$ac_try\"") >&5
11213   (eval $ac_try) 2>&5
11214   ac_status=$?
11215   echo "$as_me:11215: \$? = $ac_status" >&5
11216   (exit $ac_status); }; }; then
11217   ac_cv_sys_largefile_source=1; break
11218 else
11219   echo "$as_me: failed program was:" >&5
11220 cat conftest.$ac_ext >&5
11221 fi
11222 rm -f conftest.$ac_objext conftest.$ac_ext
11223   break
11224 done
11225 fi
11226 echo "$as_me:11226: result: $ac_cv_sys_largefile_source" >&5
11227 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11228 if test "$ac_cv_sys_largefile_source" != no; then
11229
11230 cat >>confdefs.h <<EOF
11231 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11232 EOF
11233
11234 fi
11235 rm -rf conftest*
11236
11237 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11238 # in glibc 2.1.3, but that breaks too many other things.
11239 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11240 echo "$as_me:11240: checking for fseeko" >&5
11241 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11242 if test "${ac_cv_func_fseeko+set}" = set; then
11243   echo $ECHO_N "(cached) $ECHO_C" >&6
11244 else
11245   cat >conftest.$ac_ext <<_ACEOF
11246 #line 11246 "configure"
11247 #include "confdefs.h"
11248 #include <stdio.h>
11249 int
11250 main ()
11251 {
11252 return fseeko && fseeko (stdin, 0, 0);
11253   ;
11254   return 0;
11255 }
11256 _ACEOF
11257 rm -f conftest.$ac_objext conftest$ac_exeext
11258 if { (eval echo "$as_me:11258: \"$ac_link\"") >&5
11259   (eval $ac_link) 2>&5
11260   ac_status=$?
11261   echo "$as_me:11261: \$? = $ac_status" >&5
11262   (exit $ac_status); } &&
11263          { ac_try='test -s conftest$ac_exeext'
11264   { (eval echo "$as_me:11264: \"$ac_try\"") >&5
11265   (eval $ac_try) 2>&5
11266   ac_status=$?
11267   echo "$as_me:11267: \$? = $ac_status" >&5
11268   (exit $ac_status); }; }; then
11269   ac_cv_func_fseeko=yes
11270 else
11271   echo "$as_me: failed program was:" >&5
11272 cat conftest.$ac_ext >&5
11273 ac_cv_func_fseeko=no
11274 fi
11275 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11276 fi
11277 echo "$as_me:11277: result: $ac_cv_func_fseeko" >&5
11278 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11279 if test $ac_cv_func_fseeko = yes; then
11280
11281 cat >>confdefs.h <<\EOF
11282 #define HAVE_FSEEKO 1
11283 EOF
11284
11285 fi
11286
11287         # Normally we would collect these definitions in the config.h,
11288         # but (like _XOPEN_SOURCE), some environments rely on having these
11289         # defined before any of the system headers are included.  Another
11290         # case comes up with C++, e.g., on AIX the compiler compiles the
11291         # header files by themselves before looking at the body files it is
11292         # told to compile.  For ncurses, those header files do not include
11293         # the config.h
11294         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11295         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11296         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11297
11298         echo "$as_me:11298: checking whether to use struct dirent64" >&5
11299 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11300 if test "${cf_cv_struct_dirent64+set}" = set; then
11301   echo $ECHO_N "(cached) $ECHO_C" >&6
11302 else
11303
11304                 cat >conftest.$ac_ext <<_ACEOF
11305 #line 11305 "configure"
11306 #include "confdefs.h"
11307
11308 #include <sys/types.h>
11309 #include <dirent.h>
11310
11311 int
11312 main ()
11313 {
11314
11315                 /* if transitional largefile support is setup, this is true */
11316                 extern struct dirent64 * readdir(DIR *);
11317                 struct dirent64 *x = readdir((DIR *)0);
11318                 struct dirent *y = readdir((DIR *)0);
11319                 int z = x - y;
11320
11321   ;
11322   return 0;
11323 }
11324 _ACEOF
11325 rm -f conftest.$ac_objext
11326 if { (eval echo "$as_me:11326: \"$ac_compile\"") >&5
11327   (eval $ac_compile) 2>&5
11328   ac_status=$?
11329   echo "$as_me:11329: \$? = $ac_status" >&5
11330   (exit $ac_status); } &&
11331          { ac_try='test -s conftest.$ac_objext'
11332   { (eval echo "$as_me:11332: \"$ac_try\"") >&5
11333   (eval $ac_try) 2>&5
11334   ac_status=$?
11335   echo "$as_me:11335: \$? = $ac_status" >&5
11336   (exit $ac_status); }; }; then
11337   cf_cv_struct_dirent64=yes
11338 else
11339   echo "$as_me: failed program was:" >&5
11340 cat conftest.$ac_ext >&5
11341 cf_cv_struct_dirent64=no
11342 fi
11343 rm -f conftest.$ac_objext conftest.$ac_ext
11344
11345 fi
11346 echo "$as_me:11346: result: $cf_cv_struct_dirent64" >&5
11347 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11348         test "$cf_cv_struct_dirent64" = yes &&
11349 cat >>confdefs.h <<\EOF
11350 #define HAVE_STRUCT_DIRENT64 1
11351 EOF
11352
11353         fi
11354
11355 ### Enable compiling-in rcs id's
11356 echo "$as_me:11356: checking if RCS identifiers should be compiled-in" >&5
11357 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11358
11359 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11360 if test "${with_rcs_ids+set}" = set; then
11361   withval="$with_rcs_ids"
11362   with_rcs_ids=$withval
11363 else
11364   with_rcs_ids=no
11365 fi;
11366 echo "$as_me:11366: result: $with_rcs_ids" >&5
11367 echo "${ECHO_T}$with_rcs_ids" >&6
11368 test "$with_rcs_ids" = yes &&
11369 cat >>confdefs.h <<\EOF
11370 #define USE_RCS_IDS 1
11371 EOF
11372
11373 ###############################################################################
11374
11375 ### Note that some functions (such as const) are normally disabled anyway.
11376 echo "$as_me:11376: checking if you want to build with function extensions" >&5
11377 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11378
11379 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11380 if test "${enable_ext_funcs+set}" = set; then
11381   enableval="$enable_ext_funcs"
11382   with_ext_funcs=$enableval
11383 else
11384   with_ext_funcs=yes
11385 fi;
11386 echo "$as_me:11386: result: $with_ext_funcs" >&5
11387 echo "${ECHO_T}$with_ext_funcs" >&6
11388 if test "$with_ext_funcs" = yes ; then
11389         NCURSES_EXT_FUNCS=1
11390
11391 cat >>confdefs.h <<\EOF
11392 #define HAVE_USE_DEFAULT_COLORS 1
11393 EOF
11394
11395 cat >>confdefs.h <<\EOF
11396 #define NCURSES_EXT_FUNCS 1
11397 EOF
11398
11399 else
11400         NCURSES_EXT_FUNCS=0
11401 fi
11402
11403 ###   use option --enable-const to turn on use of const beyond that in XSI.
11404 echo "$as_me:11404: checking for extended use of const keyword" >&5
11405 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11406
11407 # Check whether --enable-const or --disable-const was given.
11408 if test "${enable_const+set}" = set; then
11409   enableval="$enable_const"
11410   with_ext_const=$enableval
11411 else
11412   with_ext_const=no
11413 fi;
11414 echo "$as_me:11414: result: $with_ext_const" >&5
11415 echo "${ECHO_T}$with_ext_const" >&6
11416 NCURSES_CONST='/*nothing*/'
11417 if test "$with_ext_const" = yes ; then
11418         NCURSES_CONST=const
11419 fi
11420
11421 ###############################################################################
11422 # These options are relatively safe to experiment with.
11423
11424 echo "$as_me:11424: checking if you want all development code" >&5
11425 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11426
11427 # Check whether --with-develop or --without-develop was given.
11428 if test "${with_develop+set}" = set; then
11429   withval="$with_develop"
11430   with_develop=$withval
11431 else
11432   with_develop=no
11433 fi;
11434 echo "$as_me:11434: result: $with_develop" >&5
11435 echo "${ECHO_T}$with_develop" >&6
11436
11437 ###############################################################################
11438 # These are just experimental, probably should not be in a package:
11439
11440 # This is still experimental (20080329), but should ultimately be moved to
11441 # the script-block --with-normal, etc.
11442
11443 echo "$as_me:11443: checking if you want to link with the pthread library" >&5
11444 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11445
11446 # Check whether --with-pthread or --without-pthread was given.
11447 if test "${with_pthread+set}" = set; then
11448   withval="$with_pthread"
11449   with_pthread=$withval
11450 else
11451   with_pthread=no
11452 fi;
11453 echo "$as_me:11453: result: $with_pthread" >&5
11454 echo "${ECHO_T}$with_pthread" >&6
11455
11456 if test "$with_pthread" != no ; then
11457         echo "$as_me:11457: checking for pthread.h" >&5
11458 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11459 if test "${ac_cv_header_pthread_h+set}" = set; then
11460   echo $ECHO_N "(cached) $ECHO_C" >&6
11461 else
11462   cat >conftest.$ac_ext <<_ACEOF
11463 #line 11463 "configure"
11464 #include "confdefs.h"
11465 #include <pthread.h>
11466 _ACEOF
11467 if { (eval echo "$as_me:11467: \"$ac_cpp conftest.$ac_ext\"") >&5
11468   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11469   ac_status=$?
11470   egrep -v '^ *\+' conftest.er1 >conftest.err
11471   rm -f conftest.er1
11472   cat conftest.err >&5
11473   echo "$as_me:11473: \$? = $ac_status" >&5
11474   (exit $ac_status); } >/dev/null; then
11475   if test -s conftest.err; then
11476     ac_cpp_err=$ac_c_preproc_warn_flag
11477   else
11478     ac_cpp_err=
11479   fi
11480 else
11481   ac_cpp_err=yes
11482 fi
11483 if test -z "$ac_cpp_err"; then
11484   ac_cv_header_pthread_h=yes
11485 else
11486   echo "$as_me: failed program was:" >&5
11487   cat conftest.$ac_ext >&5
11488   ac_cv_header_pthread_h=no
11489 fi
11490 rm -f conftest.err conftest.$ac_ext
11491 fi
11492 echo "$as_me:11492: result: $ac_cv_header_pthread_h" >&5
11493 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11494 if test $ac_cv_header_pthread_h = yes; then
11495
11496 cat >>confdefs.h <<\EOF
11497 #define HAVE_PTHREADS_H 1
11498 EOF
11499
11500         for cf_lib_pthread in pthread c_r
11501         do
11502             echo "$as_me:11502: checking if we can link with the $cf_lib_pthread library" >&5
11503 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11504             cf_save_LIBS="$LIBS"
11505
11506 cf_add_libs="-l$cf_lib_pthread"
11507 # Filter out duplicates - this happens with badly-designed ".pc" files...
11508 for cf_add_1lib in $LIBS
11509 do
11510         for cf_add_2lib in $cf_add_libs
11511         do
11512                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11513                 then
11514                         cf_add_1lib=
11515                         break
11516                 fi
11517         done
11518         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11519 done
11520 LIBS="$cf_add_libs"
11521
11522             cat >conftest.$ac_ext <<_ACEOF
11523 #line 11523 "configure"
11524 #include "confdefs.h"
11525
11526 #include <pthread.h>
11527
11528 int
11529 main ()
11530 {
11531
11532                 int rc = pthread_create(0,0,0,0);
11533                 int r2 = pthread_mutexattr_settype(0, 0);
11534
11535   ;
11536   return 0;
11537 }
11538 _ACEOF
11539 rm -f conftest.$ac_objext conftest$ac_exeext
11540 if { (eval echo "$as_me:11540: \"$ac_link\"") >&5
11541   (eval $ac_link) 2>&5
11542   ac_status=$?
11543   echo "$as_me:11543: \$? = $ac_status" >&5
11544   (exit $ac_status); } &&
11545          { ac_try='test -s conftest$ac_exeext'
11546   { (eval echo "$as_me:11546: \"$ac_try\"") >&5
11547   (eval $ac_try) 2>&5
11548   ac_status=$?
11549   echo "$as_me:11549: \$? = $ac_status" >&5
11550   (exit $ac_status); }; }; then
11551   with_pthread=yes
11552 else
11553   echo "$as_me: failed program was:" >&5
11554 cat conftest.$ac_ext >&5
11555 with_pthread=no
11556 fi
11557 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11558             LIBS="$cf_save_LIBS"
11559             echo "$as_me:11559: result: $with_pthread" >&5
11560 echo "${ECHO_T}$with_pthread" >&6
11561             test "$with_pthread" = yes && break
11562         done
11563
11564         if test "$with_pthread" = yes ; then
11565
11566 cf_add_libs="-l$cf_lib_pthread"
11567 # Filter out duplicates - this happens with badly-designed ".pc" files...
11568 for cf_add_1lib in $LIBS
11569 do
11570         for cf_add_2lib in $cf_add_libs
11571         do
11572                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11573                 then
11574                         cf_add_1lib=
11575                         break
11576                 fi
11577         done
11578         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11579 done
11580 LIBS="$cf_add_libs"
11581
11582 cat >>confdefs.h <<\EOF
11583 #define HAVE_LIBPTHREADS 1
11584 EOF
11585
11586         else
11587             { { echo "$as_me:11587: error: Cannot link with pthread library" >&5
11588 echo "$as_me: error: Cannot link with pthread library" >&2;}
11589    { (exit 1); exit 1; }; }
11590         fi
11591
11592 fi
11593
11594 fi
11595
11596 echo "$as_me:11596: checking if you want to use weak-symbols for pthreads" >&5
11597 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11598
11599 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11600 if test "${enable_weak_symbols+set}" = set; then
11601   enableval="$enable_weak_symbols"
11602   use_weak_symbols=$withval
11603 else
11604   use_weak_symbols=no
11605 fi;
11606 echo "$as_me:11606: result: $use_weak_symbols" >&5
11607 echo "${ECHO_T}$use_weak_symbols" >&6
11608 if test "$use_weak_symbols" = yes ; then
11609
11610 echo "$as_me:11610: checking if $CC supports weak symbols" >&5
11611 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11612 if test "${cf_cv_weak_symbols+set}" = set; then
11613   echo $ECHO_N "(cached) $ECHO_C" >&6
11614 else
11615
11616 cat >conftest.$ac_ext <<_ACEOF
11617 #line 11617 "configure"
11618 #include "confdefs.h"
11619
11620 #include <stdio.h>
11621 int
11622 main ()
11623 {
11624
11625 #if defined(__GNUC__)
11626 #  if defined __USE_ISOC99
11627 #    define _cat_pragma(exp)    _Pragma(#exp)
11628 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11629 #  else
11630 #    define _weak_pragma(exp)
11631 #  endif
11632 #  define _declare(name)        __extension__ extern __typeof__(name) name
11633 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11634 #endif
11635
11636 weak_symbol(fopen);
11637
11638   ;
11639   return 0;
11640 }
11641 _ACEOF
11642 rm -f conftest.$ac_objext
11643 if { (eval echo "$as_me:11643: \"$ac_compile\"") >&5
11644   (eval $ac_compile) 2>&5
11645   ac_status=$?
11646   echo "$as_me:11646: \$? = $ac_status" >&5
11647   (exit $ac_status); } &&
11648          { ac_try='test -s conftest.$ac_objext'
11649   { (eval echo "$as_me:11649: \"$ac_try\"") >&5
11650   (eval $ac_try) 2>&5
11651   ac_status=$?
11652   echo "$as_me:11652: \$? = $ac_status" >&5
11653   (exit $ac_status); }; }; then
11654   cf_cv_weak_symbols=yes
11655 else
11656   echo "$as_me: failed program was:" >&5
11657 cat conftest.$ac_ext >&5
11658 cf_cv_weak_symbols=no
11659 fi
11660 rm -f conftest.$ac_objext conftest.$ac_ext
11661
11662 fi
11663 echo "$as_me:11663: result: $cf_cv_weak_symbols" >&5
11664 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11665
11666 else
11667         cf_cv_weak_symbols=no
11668 fi
11669
11670 if test $cf_cv_weak_symbols = yes ; then
11671
11672 cat >>confdefs.h <<\EOF
11673 #define USE_WEAK_SYMBOLS 1
11674 EOF
11675
11676 fi
11677
11678 PTHREAD=
11679 if test "$with_pthread" = "yes" ; then
11680
11681 cat >>confdefs.h <<\EOF
11682 #define USE_PTHREADS 1
11683 EOF
11684
11685         enable_reentrant=yes
11686         if test $cf_cv_weak_symbols = yes ; then
11687                 PTHREAD=-lpthread
11688         fi
11689 fi
11690
11691 # OpenSUSE is installing ncurses6, using reentrant option.
11692 echo "$as_me:11692: checking for _nc_TABSIZE" >&5
11693 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11694 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11695   echo $ECHO_N "(cached) $ECHO_C" >&6
11696 else
11697   cat >conftest.$ac_ext <<_ACEOF
11698 #line 11698 "configure"
11699 #include "confdefs.h"
11700 /* System header to define __stub macros and hopefully few prototypes,
11701     which can conflict with char _nc_TABSIZE (); below.  */
11702 #include <assert.h>
11703 /* Override any gcc2 internal prototype to avoid an error.  */
11704 #ifdef __cplusplus
11705 extern "C"
11706 #endif
11707 /* We use char because int might match the return type of a gcc2
11708    builtin and then its argument prototype would still apply.  */
11709 char _nc_TABSIZE ();
11710 char (*f) ();
11711
11712 int
11713 main ()
11714 {
11715 /* The GNU C library defines this for functions which it implements
11716     to always fail with ENOSYS.  Some functions are actually named
11717     something starting with __ and the normal name is an alias.  */
11718 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11719 choke me
11720 #else
11721 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11722 #endif
11723
11724   ;
11725   return 0;
11726 }
11727 _ACEOF
11728 rm -f conftest.$ac_objext conftest$ac_exeext
11729 if { (eval echo "$as_me:11729: \"$ac_link\"") >&5
11730   (eval $ac_link) 2>&5
11731   ac_status=$?
11732   echo "$as_me:11732: \$? = $ac_status" >&5
11733   (exit $ac_status); } &&
11734          { ac_try='test -s conftest$ac_exeext'
11735   { (eval echo "$as_me:11735: \"$ac_try\"") >&5
11736   (eval $ac_try) 2>&5
11737   ac_status=$?
11738   echo "$as_me:11738: \$? = $ac_status" >&5
11739   (exit $ac_status); }; }; then
11740   ac_cv_func__nc_TABSIZE=yes
11741 else
11742   echo "$as_me: failed program was:" >&5
11743 cat conftest.$ac_ext >&5
11744 ac_cv_func__nc_TABSIZE=no
11745 fi
11746 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11747 fi
11748 echo "$as_me:11748: result: $ac_cv_func__nc_TABSIZE" >&5
11749 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11750 if test $ac_cv_func__nc_TABSIZE = yes; then
11751   assume_reentrant=yes
11752 else
11753   assume_reentrant=no
11754 fi
11755
11756 # Reentrant code has to be opaque; there's little advantage to making ncurses
11757 # opaque outside of that, so there is no --enable-opaque option.  We can use
11758 # this option without --with-pthreads, but this will be always set for
11759 # pthreads.
11760 echo "$as_me:11760: checking if you want experimental reentrant code" >&5
11761 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11762
11763 # Check whether --enable-reentrant or --disable-reentrant was given.
11764 if test "${enable_reentrant+set}" = set; then
11765   enableval="$enable_reentrant"
11766   with_reentrant=$enableval
11767 else
11768   with_reentrant=$assume_reentrant
11769 fi;
11770 echo "$as_me:11770: result: $with_reentrant" >&5
11771 echo "${ECHO_T}$with_reentrant" >&6
11772 if test "$with_reentrant" = yes ; then
11773         cf_cv_enable_reentrant=1
11774         if test $cf_cv_weak_symbols = yes ; then
11775
11776 # remove pthread library from $LIBS
11777 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11778
11779         elif test "$assume_reentrant" = no ; then
11780                 LIB_SUFFIX="t${LIB_SUFFIX}"
11781         fi
11782
11783 cat >>confdefs.h <<\EOF
11784 #define USE_REENTRANT 1
11785 EOF
11786
11787 else
11788         cf_cv_enable_reentrant=0
11789 fi
11790
11791 ### Allow using a different wrap-prefix
11792 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11793         echo "$as_me:11793: checking for prefix used to wrap public variables" >&5
11794 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11795
11796 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11797 if test "${with_wrap_prefix+set}" = set; then
11798   withval="$with_wrap_prefix"
11799   NCURSES_WRAP_PREFIX=$withval
11800 else
11801   NCURSES_WRAP_PREFIX=_nc_
11802 fi;
11803         echo "$as_me:11803: result: $NCURSES_WRAP_PREFIX" >&5
11804 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11805 else
11806         NCURSES_WRAP_PREFIX=_nc_
11807 fi
11808
11809 cat >>confdefs.h <<EOF
11810 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11811 EOF
11812
11813 ###############################################################################
11814
11815 ###     use option --disable-echo to suppress full display compiling commands
11816
11817 echo "$as_me:11817: checking if you want to see long compiling messages" >&5
11818 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11819
11820 # Check whether --enable-echo or --disable-echo was given.
11821 if test "${enable_echo+set}" = set; then
11822   enableval="$enable_echo"
11823   test "$enableval" != no && enableval=yes
11824         if test "$enableval" != "yes" ; then
11825
11826         ECHO_LT='--silent'
11827         ECHO_LD='@echo linking $@;'
11828         RULE_CC='@echo compiling $<'
11829         SHOW_CC='@echo compiling $@'
11830         ECHO_CC='@'
11831
11832         else
11833
11834         ECHO_LT=''
11835         ECHO_LD=''
11836         RULE_CC=''
11837         SHOW_CC=''
11838         ECHO_CC=''
11839
11840         fi
11841 else
11842   enableval=yes
11843
11844         ECHO_LT=''
11845         ECHO_LD=''
11846         RULE_CC=''
11847         SHOW_CC=''
11848         ECHO_CC=''
11849
11850 fi;
11851 echo "$as_me:11851: result: $enableval" >&5
11852 echo "${ECHO_T}$enableval" >&6
11853
11854 ###     use option --enable-warnings to turn on all gcc warnings
11855 echo "$as_me:11855: checking if you want to see compiler warnings" >&5
11856 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11857
11858 # Check whether --enable-warnings or --disable-warnings was given.
11859 if test "${enable_warnings+set}" = set; then
11860   enableval="$enable_warnings"
11861   with_warnings=$enableval
11862 fi;
11863 echo "$as_me:11863: result: $with_warnings" >&5
11864 echo "${ECHO_T}$with_warnings" >&6
11865
11866 if test "x$with_warnings" = "xyes"; then
11867
11868         ADAFLAGS="$ADAFLAGS -gnatg"
11869
11870 INTEL_COMPILER=no
11871
11872 if test "$GCC" = yes ; then
11873         case $host_os in
11874         (linux*|gnu*)
11875                 echo "$as_me:11875: checking if this is really Intel C compiler" >&5
11876 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11877                 cf_save_CFLAGS="$CFLAGS"
11878                 CFLAGS="$CFLAGS -no-gcc"
11879                 cat >conftest.$ac_ext <<_ACEOF
11880 #line 11880 "configure"
11881 #include "confdefs.h"
11882
11883 int
11884 main ()
11885 {
11886
11887 #ifdef __INTEL_COMPILER
11888 #else
11889 make an error
11890 #endif
11891
11892   ;
11893   return 0;
11894 }
11895 _ACEOF
11896 rm -f conftest.$ac_objext
11897 if { (eval echo "$as_me:11897: \"$ac_compile\"") >&5
11898   (eval $ac_compile) 2>&5
11899   ac_status=$?
11900   echo "$as_me:11900: \$? = $ac_status" >&5
11901   (exit $ac_status); } &&
11902          { ac_try='test -s conftest.$ac_objext'
11903   { (eval echo "$as_me:11903: \"$ac_try\"") >&5
11904   (eval $ac_try) 2>&5
11905   ac_status=$?
11906   echo "$as_me:11906: \$? = $ac_status" >&5
11907   (exit $ac_status); }; }; then
11908   INTEL_COMPILER=yes
11909 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11910
11911 else
11912   echo "$as_me: failed program was:" >&5
11913 cat conftest.$ac_ext >&5
11914 fi
11915 rm -f conftest.$ac_objext conftest.$ac_ext
11916                 CFLAGS="$cf_save_CFLAGS"
11917                 echo "$as_me:11917: result: $INTEL_COMPILER" >&5
11918 echo "${ECHO_T}$INTEL_COMPILER" >&6
11919                 ;;
11920         esac
11921 fi
11922
11923 CLANG_COMPILER=no
11924
11925 if test "$GCC" = yes ; then
11926         echo "$as_me:11926: checking if this is really Clang C compiler" >&5
11927 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11928         cf_save_CFLAGS="$CFLAGS"
11929         CFLAGS="$CFLAGS -Qunused-arguments"
11930         cat >conftest.$ac_ext <<_ACEOF
11931 #line 11931 "configure"
11932 #include "confdefs.h"
11933
11934 int
11935 main ()
11936 {
11937
11938 #ifdef __clang__
11939 #else
11940 make an error
11941 #endif
11942
11943   ;
11944   return 0;
11945 }
11946 _ACEOF
11947 rm -f conftest.$ac_objext
11948 if { (eval echo "$as_me:11948: \"$ac_compile\"") >&5
11949   (eval $ac_compile) 2>&5
11950   ac_status=$?
11951   echo "$as_me:11951: \$? = $ac_status" >&5
11952   (exit $ac_status); } &&
11953          { ac_try='test -s conftest.$ac_objext'
11954   { (eval echo "$as_me:11954: \"$ac_try\"") >&5
11955   (eval $ac_try) 2>&5
11956   ac_status=$?
11957   echo "$as_me:11957: \$? = $ac_status" >&5
11958   (exit $ac_status); }; }; then
11959   CLANG_COMPILER=yes
11960 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
11961
11962 else
11963   echo "$as_me: failed program was:" >&5
11964 cat conftest.$ac_ext >&5
11965 fi
11966 rm -f conftest.$ac_objext conftest.$ac_ext
11967         CFLAGS="$cf_save_CFLAGS"
11968         echo "$as_me:11968: result: $CLANG_COMPILER" >&5
11969 echo "${ECHO_T}$CLANG_COMPILER" >&6
11970 fi
11971
11972 cat > conftest.$ac_ext <<EOF
11973 #line 11973 "${as_me:-configure}"
11974 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
11975 EOF
11976
11977 if test "$INTEL_COMPILER" = yes
11978 then
11979 # The "-wdXXX" options suppress warnings:
11980 # remark #1419: external declaration in primary source file
11981 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
11982 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
11983 # remark #193: zero used for undefined preprocessing identifier
11984 # remark #593: variable "curs_sb_left_arrow" was set but never used
11985 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
11986 # remark #869: parameter "tw" was never referenced
11987 # remark #981: operands are evaluated in unspecified order
11988 # warning #279: controlling expression is constant
11989
11990         { echo "$as_me:11990: checking for $CC warning options..." >&5
11991 echo "$as_me: checking for $CC warning options..." >&6;}
11992         cf_save_CFLAGS="$CFLAGS"
11993         EXTRA_CFLAGS="-Wall"
11994         for cf_opt in \
11995                 wd1419 \
11996                 wd1683 \
11997                 wd1684 \
11998                 wd193 \
11999                 wd593 \
12000                 wd279 \
12001                 wd810 \
12002                 wd869 \
12003                 wd981
12004         do
12005                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12006                 if { (eval echo "$as_me:12006: \"$ac_compile\"") >&5
12007   (eval $ac_compile) 2>&5
12008   ac_status=$?
12009   echo "$as_me:12009: \$? = $ac_status" >&5
12010   (exit $ac_status); }; then
12011                         test -n "$verbose" && echo "$as_me:12011: result: ... -$cf_opt" >&5
12012 echo "${ECHO_T}... -$cf_opt" >&6
12013                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12014                 fi
12015         done
12016         CFLAGS="$cf_save_CFLAGS"
12017
12018 elif test "$GCC" = yes
12019 then
12020         { echo "$as_me:12020: checking for $CC warning options..." >&5
12021 echo "$as_me: checking for $CC warning options..." >&6;}
12022         cf_save_CFLAGS="$CFLAGS"
12023         EXTRA_CFLAGS=
12024         cf_warn_CONST=""
12025         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12026         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12027         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12028         for cf_opt in W Wall \
12029                 Wbad-function-cast \
12030                 Wcast-align \
12031                 Wcast-qual \
12032                 Wdeclaration-after-statement \
12033                 Wextra \
12034                 Winline \
12035                 Wmissing-declarations \
12036                 Wmissing-prototypes \
12037                 Wnested-externs \
12038                 Wpointer-arith \
12039                 Wshadow \
12040                 Wstrict-prototypes \
12041                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12042         do
12043                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12044                 if { (eval echo "$as_me:12044: \"$ac_compile\"") >&5
12045   (eval $ac_compile) 2>&5
12046   ac_status=$?
12047   echo "$as_me:12047: \$? = $ac_status" >&5
12048   (exit $ac_status); }; then
12049                         test -n "$verbose" && echo "$as_me:12049: result: ... -$cf_opt" >&5
12050 echo "${ECHO_T}... -$cf_opt" >&6
12051                         case $cf_opt in
12052                         (Wcast-qual)
12053                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12054                                 ;;
12055                         (Winline)
12056                                 case $GCC_VERSION in
12057                                 ([34].*)
12058                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12059
12060 echo "${as_me:-configure}:12060: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12061
12062                                         continue;;
12063                                 esac
12064                                 ;;
12065                         (Wpointer-arith)
12066                                 case $GCC_VERSION in
12067                                 ([12].*)
12068                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12069
12070 echo "${as_me:-configure}:12070: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12071
12072                                         continue;;
12073                                 esac
12074                                 ;;
12075                         esac
12076                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12077                 fi
12078         done
12079         CFLAGS="$cf_save_CFLAGS"
12080 fi
12081 rm -rf conftest*
12082
12083 fi
12084
12085 if test "$GCC" = yes
12086 then
12087 cat > conftest.i <<EOF
12088 #ifndef GCC_PRINTF
12089 #define GCC_PRINTF 0
12090 #endif
12091 #ifndef GCC_SCANF
12092 #define GCC_SCANF 0
12093 #endif
12094 #ifndef GCC_NORETURN
12095 #define GCC_NORETURN /* nothing */
12096 #endif
12097 #ifndef GCC_UNUSED
12098 #define GCC_UNUSED /* nothing */
12099 #endif
12100 EOF
12101 if test "$GCC" = yes
12102 then
12103         { echo "$as_me:12103: checking for $CC __attribute__ directives..." >&5
12104 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12105 cat > conftest.$ac_ext <<EOF
12106 #line 12106 "${as_me:-configure}"
12107 #include "confdefs.h"
12108 #include "conftest.h"
12109 #include "conftest.i"
12110 #if     GCC_PRINTF
12111 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12112 #else
12113 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12114 #endif
12115 #if     GCC_SCANF
12116 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12117 #else
12118 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12119 #endif
12120 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12121 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12122 extern void foo(void) GCC_NORETURN;
12123 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12124 EOF
12125         cf_printf_attribute=no
12126         cf_scanf_attribute=no
12127         for cf_attribute in scanf printf unused noreturn
12128         do
12129
12130 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12131
12132                 cf_directive="__attribute__(($cf_attribute))"
12133                 echo "checking for $CC $cf_directive" 1>&5
12134
12135                 case $cf_attribute in
12136                 (printf)
12137                         cf_printf_attribute=yes
12138                         cat >conftest.h <<EOF
12139 #define GCC_$cf_ATTRIBUTE 1
12140 EOF
12141                         ;;
12142                 (scanf)
12143                         cf_scanf_attribute=yes
12144                         cat >conftest.h <<EOF
12145 #define GCC_$cf_ATTRIBUTE 1
12146 EOF
12147                         ;;
12148                 (*)
12149                         cat >conftest.h <<EOF
12150 #define GCC_$cf_ATTRIBUTE $cf_directive
12151 EOF
12152                         ;;
12153                 esac
12154
12155                 if { (eval echo "$as_me:12155: \"$ac_compile\"") >&5
12156   (eval $ac_compile) 2>&5
12157   ac_status=$?
12158   echo "$as_me:12158: \$? = $ac_status" >&5
12159   (exit $ac_status); }; then
12160                         test -n "$verbose" && echo "$as_me:12160: result: ... $cf_attribute" >&5
12161 echo "${ECHO_T}... $cf_attribute" >&6
12162                         cat conftest.h >>confdefs.h
12163                         case $cf_attribute in
12164                         (noreturn)
12165
12166 cat >>confdefs.h <<EOF
12167 #define GCC_NORETURN $cf_directive
12168 EOF
12169
12170                                 ;;
12171                         (printf)
12172                                 cf_value='/* nothing */'
12173                                 if test "$cf_printf_attribute" != no ; then
12174                                         cf_value='__attribute__((format(printf,fmt,var)))'
12175
12176 cat >>confdefs.h <<\EOF
12177 #define GCC_PRINTF 1
12178 EOF
12179
12180                                 fi
12181
12182 cat >>confdefs.h <<EOF
12183 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12184 EOF
12185
12186                                 ;;
12187                         (scanf)
12188                                 cf_value='/* nothing */'
12189                                 if test "$cf_scanf_attribute" != no ; then
12190                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12191
12192 cat >>confdefs.h <<\EOF
12193 #define GCC_SCANF 1
12194 EOF
12195
12196                                 fi
12197
12198 cat >>confdefs.h <<EOF
12199 #define GCC_SCANFLIKE(fmt,var) $cf_value
12200 EOF
12201
12202                                 ;;
12203                         (unused)
12204
12205 cat >>confdefs.h <<EOF
12206 #define GCC_UNUSED $cf_directive
12207 EOF
12208
12209                                 ;;
12210                         esac
12211                 fi
12212         done
12213 else
12214         fgrep define conftest.i >>confdefs.h
12215 fi
12216 rm -rf conftest*
12217 fi
12218
12219 ###     use option --enable-assertions to turn on generation of assertion code
12220 echo "$as_me:12220: checking if you want to enable runtime assertions" >&5
12221 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12222
12223 # Check whether --enable-assertions or --disable-assertions was given.
12224 if test "${enable_assertions+set}" = set; then
12225   enableval="$enable_assertions"
12226   with_assertions=$enableval
12227 else
12228   with_assertions=no
12229 fi;
12230 echo "$as_me:12230: result: $with_assertions" >&5
12231 echo "${ECHO_T}$with_assertions" >&6
12232 if test -n "$GCC"
12233 then
12234         if test "$with_assertions" = no
12235         then
12236                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12237         else
12238
12239         ADAFLAGS="$ADAFLAGS -gnata"
12240
12241         fi
12242 fi
12243
12244 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12245
12246 cat >>confdefs.h <<\EOF
12247 #define HAVE_NC_ALLOC_H 1
12248 EOF
12249
12250 ###     use option --enable-expanded to generate certain macros as functions
12251
12252 # Check whether --enable-expanded or --disable-expanded was given.
12253 if test "${enable_expanded+set}" = set; then
12254   enableval="$enable_expanded"
12255   test "$enableval" = yes &&
12256 cat >>confdefs.h <<\EOF
12257 #define NCURSES_EXPANDED 1
12258 EOF
12259
12260 fi;
12261
12262 ###     use option --disable-macros to suppress macros in favor of functions
12263
12264 # Check whether --enable-macros or --disable-macros was given.
12265 if test "${enable_macros+set}" = set; then
12266   enableval="$enable_macros"
12267   test "$enableval" = no &&
12268 cat >>confdefs.h <<\EOF
12269 #define NCURSES_NOMACROS 1
12270 EOF
12271
12272 fi;
12273
12274 # Normally we only add trace() to the debug-library.  Allow this to be
12275 # extended to all models of the ncurses library:
12276 cf_all_traces=no
12277 case "$CFLAGS $CPPFLAGS" in
12278 (*-DTRACE*)
12279         cf_all_traces=yes
12280         ;;
12281 esac
12282
12283 echo "$as_me:12283: checking whether to add trace feature to all models" >&5
12284 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12285
12286 # Check whether --with-trace or --without-trace was given.
12287 if test "${with_trace+set}" = set; then
12288   withval="$with_trace"
12289   cf_with_trace=$withval
12290 else
12291   cf_with_trace=$cf_all_traces
12292 fi;
12293 echo "$as_me:12293: result: $cf_with_trace" >&5
12294 echo "${ECHO_T}$cf_with_trace" >&6
12295
12296 if test "$cf_with_trace" = yes ; then
12297         ADA_TRACE=TRUE
12298
12299 cf_fix_cppflags=no
12300 cf_new_cflags=
12301 cf_new_cppflags=
12302 cf_new_extra_cppflags=
12303
12304 for cf_add_cflags in -DTRACE
12305 do
12306 case $cf_fix_cppflags in
12307 (no)
12308         case $cf_add_cflags in
12309         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12310                 case $cf_add_cflags in
12311                 (-D*)
12312                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12313
12314                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12315                                 && test -z "${cf_tst_cflags}" \
12316                                 && cf_fix_cppflags=yes
12317
12318                         if test $cf_fix_cppflags = yes ; then
12319                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12320                                 continue
12321                         elif test "${cf_tst_cflags}" = "\"'" ; then
12322                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12323                                 continue
12324                         fi
12325                         ;;
12326                 esac
12327                 case "$CPPFLAGS" in
12328                 (*$cf_add_cflags)
12329                         ;;
12330                 (*)
12331                         case $cf_add_cflags in
12332                         (-D*)
12333                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12334
12335 CPPFLAGS=`echo "$CPPFLAGS" | \
12336         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12337                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12338
12339                                 ;;
12340                         esac
12341                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12342                         ;;
12343                 esac
12344                 ;;
12345         (*)
12346                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12347                 ;;
12348         esac
12349         ;;
12350 (yes)
12351         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12352
12353         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12354
12355         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12356                 && test -z "${cf_tst_cflags}" \
12357                 && cf_fix_cppflags=no
12358         ;;
12359 esac
12360 done
12361
12362 if test -n "$cf_new_cflags" ; then
12363
12364         CFLAGS="$CFLAGS $cf_new_cflags"
12365 fi
12366
12367 if test -n "$cf_new_cppflags" ; then
12368
12369         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12370 fi
12371
12372 if test -n "$cf_new_extra_cppflags" ; then
12373
12374         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12375 fi
12376
12377 else
12378         ADA_TRACE=FALSE
12379 fi
12380
12381 echo "$as_me:12381: checking if we want to use GNAT projects" >&5
12382 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12383
12384 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12385 if test "${enable_gnat_projects+set}" = set; then
12386   enableval="$enable_gnat_projects"
12387   test "$enableval" != no && enableval=yes
12388         if test "$enableval" != "yes" ; then
12389     enable_gnat_projects=no
12390         else
12391                 enable_gnat_projects=yes
12392         fi
12393 else
12394   enableval=yes
12395         enable_gnat_projects=yes
12396
12397 fi;
12398 echo "$as_me:12398: result: $enable_gnat_projects" >&5
12399 echo "${ECHO_T}$enable_gnat_projects" >&6
12400
12401 ###     Checks for libraries.
12402 case $cf_cv_system_name in
12403 (*mingw32*)
12404         ;;
12405 (*)
12406 echo "$as_me:12406: checking for gettimeofday" >&5
12407 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12408 if test "${ac_cv_func_gettimeofday+set}" = set; then
12409   echo $ECHO_N "(cached) $ECHO_C" >&6
12410 else
12411   cat >conftest.$ac_ext <<_ACEOF
12412 #line 12412 "configure"
12413 #include "confdefs.h"
12414 /* System header to define __stub macros and hopefully few prototypes,
12415     which can conflict with char gettimeofday (); below.  */
12416 #include <assert.h>
12417 /* Override any gcc2 internal prototype to avoid an error.  */
12418 #ifdef __cplusplus
12419 extern "C"
12420 #endif
12421 /* We use char because int might match the return type of a gcc2
12422    builtin and then its argument prototype would still apply.  */
12423 char gettimeofday ();
12424 char (*f) ();
12425
12426 int
12427 main ()
12428 {
12429 /* The GNU C library defines this for functions which it implements
12430     to always fail with ENOSYS.  Some functions are actually named
12431     something starting with __ and the normal name is an alias.  */
12432 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12433 choke me
12434 #else
12435 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12436 #endif
12437
12438   ;
12439   return 0;
12440 }
12441 _ACEOF
12442 rm -f conftest.$ac_objext conftest$ac_exeext
12443 if { (eval echo "$as_me:12443: \"$ac_link\"") >&5
12444   (eval $ac_link) 2>&5
12445   ac_status=$?
12446   echo "$as_me:12446: \$? = $ac_status" >&5
12447   (exit $ac_status); } &&
12448          { ac_try='test -s conftest$ac_exeext'
12449   { (eval echo "$as_me:12449: \"$ac_try\"") >&5
12450   (eval $ac_try) 2>&5
12451   ac_status=$?
12452   echo "$as_me:12452: \$? = $ac_status" >&5
12453   (exit $ac_status); }; }; then
12454   ac_cv_func_gettimeofday=yes
12455 else
12456   echo "$as_me: failed program was:" >&5
12457 cat conftest.$ac_ext >&5
12458 ac_cv_func_gettimeofday=no
12459 fi
12460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12461 fi
12462 echo "$as_me:12462: result: $ac_cv_func_gettimeofday" >&5
12463 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12464 if test $ac_cv_func_gettimeofday = yes; then
12465   cat >>confdefs.h <<\EOF
12466 #define HAVE_GETTIMEOFDAY 1
12467 EOF
12468
12469 else
12470
12471 echo "$as_me:12471: checking for gettimeofday in -lbsd" >&5
12472 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12473 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12474   echo $ECHO_N "(cached) $ECHO_C" >&6
12475 else
12476   ac_check_lib_save_LIBS=$LIBS
12477 LIBS="-lbsd  $LIBS"
12478 cat >conftest.$ac_ext <<_ACEOF
12479 #line 12479 "configure"
12480 #include "confdefs.h"
12481
12482 /* Override any gcc2 internal prototype to avoid an error.  */
12483 #ifdef __cplusplus
12484 extern "C"
12485 #endif
12486 /* We use char because int might match the return type of a gcc2
12487    builtin and then its argument prototype would still apply.  */
12488 char gettimeofday ();
12489 int
12490 main ()
12491 {
12492 gettimeofday ();
12493   ;
12494   return 0;
12495 }
12496 _ACEOF
12497 rm -f conftest.$ac_objext conftest$ac_exeext
12498 if { (eval echo "$as_me:12498: \"$ac_link\"") >&5
12499   (eval $ac_link) 2>&5
12500   ac_status=$?
12501   echo "$as_me:12501: \$? = $ac_status" >&5
12502   (exit $ac_status); } &&
12503          { ac_try='test -s conftest$ac_exeext'
12504   { (eval echo "$as_me:12504: \"$ac_try\"") >&5
12505   (eval $ac_try) 2>&5
12506   ac_status=$?
12507   echo "$as_me:12507: \$? = $ac_status" >&5
12508   (exit $ac_status); }; }; then
12509   ac_cv_lib_bsd_gettimeofday=yes
12510 else
12511   echo "$as_me: failed program was:" >&5
12512 cat conftest.$ac_ext >&5
12513 ac_cv_lib_bsd_gettimeofday=no
12514 fi
12515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12516 LIBS=$ac_check_lib_save_LIBS
12517 fi
12518 echo "$as_me:12518: result: $ac_cv_lib_bsd_gettimeofday" >&5
12519 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12520 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12521
12522 cat >>confdefs.h <<\EOF
12523 #define HAVE_GETTIMEOFDAY 1
12524 EOF
12525
12526         LIBS="$LIBS -lbsd"
12527 fi
12528
12529 fi
12530         ;;
12531 esac
12532
12533 ###     Checks for header files.
12534 echo "$as_me:12534: checking for ANSI C header files" >&5
12535 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12536 if test "${ac_cv_header_stdc+set}" = set; then
12537   echo $ECHO_N "(cached) $ECHO_C" >&6
12538 else
12539   cat >conftest.$ac_ext <<_ACEOF
12540 #line 12540 "configure"
12541 #include "confdefs.h"
12542 #include <stdlib.h>
12543 #include <stdarg.h>
12544 #include <string.h>
12545 #include <float.h>
12546
12547 _ACEOF
12548 if { (eval echo "$as_me:12548: \"$ac_cpp conftest.$ac_ext\"") >&5
12549   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12550   ac_status=$?
12551   egrep -v '^ *\+' conftest.er1 >conftest.err
12552   rm -f conftest.er1
12553   cat conftest.err >&5
12554   echo "$as_me:12554: \$? = $ac_status" >&5
12555   (exit $ac_status); } >/dev/null; then
12556   if test -s conftest.err; then
12557     ac_cpp_err=$ac_c_preproc_warn_flag
12558   else
12559     ac_cpp_err=
12560   fi
12561 else
12562   ac_cpp_err=yes
12563 fi
12564 if test -z "$ac_cpp_err"; then
12565   ac_cv_header_stdc=yes
12566 else
12567   echo "$as_me: failed program was:" >&5
12568   cat conftest.$ac_ext >&5
12569   ac_cv_header_stdc=no
12570 fi
12571 rm -f conftest.err conftest.$ac_ext
12572
12573 if test $ac_cv_header_stdc = yes; then
12574   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12575   cat >conftest.$ac_ext <<_ACEOF
12576 #line 12576 "configure"
12577 #include "confdefs.h"
12578 #include <string.h>
12579
12580 _ACEOF
12581 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12582   egrep "memchr" >/dev/null 2>&1; then
12583   :
12584 else
12585   ac_cv_header_stdc=no
12586 fi
12587 rm -rf conftest*
12588
12589 fi
12590
12591 if test $ac_cv_header_stdc = yes; then
12592   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12593   cat >conftest.$ac_ext <<_ACEOF
12594 #line 12594 "configure"
12595 #include "confdefs.h"
12596 #include <stdlib.h>
12597
12598 _ACEOF
12599 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12600   egrep "free" >/dev/null 2>&1; then
12601   :
12602 else
12603   ac_cv_header_stdc=no
12604 fi
12605 rm -rf conftest*
12606
12607 fi
12608
12609 if test $ac_cv_header_stdc = yes; then
12610   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12611   if test "$cross_compiling" = yes; then
12612   :
12613 else
12614   cat >conftest.$ac_ext <<_ACEOF
12615 #line 12615 "configure"
12616 #include "confdefs.h"
12617 #include <ctype.h>
12618 #if ((' ' & 0x0FF) == 0x020)
12619 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12620 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12621 #else
12622 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12623                      || ('j' <= (c) && (c) <= 'r') \
12624                      || ('s' <= (c) && (c) <= 'z'))
12625 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12626 #endif
12627
12628 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12629 int
12630 main ()
12631 {
12632   int i;
12633   for (i = 0; i < 256; i++)
12634     if (XOR (islower (i), ISLOWER (i))
12635         || toupper (i) != TOUPPER (i))
12636       $ac_main_return(2);
12637   $ac_main_return (0);
12638 }
12639 _ACEOF
12640 rm -f conftest$ac_exeext
12641 if { (eval echo "$as_me:12641: \"$ac_link\"") >&5
12642   (eval $ac_link) 2>&5
12643   ac_status=$?
12644   echo "$as_me:12644: \$? = $ac_status" >&5
12645   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12646   { (eval echo "$as_me:12646: \"$ac_try\"") >&5
12647   (eval $ac_try) 2>&5
12648   ac_status=$?
12649   echo "$as_me:12649: \$? = $ac_status" >&5
12650   (exit $ac_status); }; }; then
12651   :
12652 else
12653   echo "$as_me: program exited with status $ac_status" >&5
12654 echo "$as_me: failed program was:" >&5
12655 cat conftest.$ac_ext >&5
12656 ac_cv_header_stdc=no
12657 fi
12658 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12659 fi
12660 fi
12661 fi
12662 echo "$as_me:12662: result: $ac_cv_header_stdc" >&5
12663 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12664 if test $ac_cv_header_stdc = yes; then
12665
12666 cat >>confdefs.h <<\EOF
12667 #define STDC_HEADERS 1
12668 EOF
12669
12670 fi
12671
12672 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
12673
12674 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
12675                   inttypes.h stdint.h unistd.h
12676 do
12677 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12678 echo "$as_me:12678: checking for $ac_header" >&5
12679 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12680 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12681   echo $ECHO_N "(cached) $ECHO_C" >&6
12682 else
12683   cat >conftest.$ac_ext <<_ACEOF
12684 #line 12684 "configure"
12685 #include "confdefs.h"
12686 $ac_includes_default
12687 #include <$ac_header>
12688 _ACEOF
12689 rm -f conftest.$ac_objext
12690 if { (eval echo "$as_me:12690: \"$ac_compile\"") >&5
12691   (eval $ac_compile) 2>&5
12692   ac_status=$?
12693   echo "$as_me:12693: \$? = $ac_status" >&5
12694   (exit $ac_status); } &&
12695          { ac_try='test -s conftest.$ac_objext'
12696   { (eval echo "$as_me:12696: \"$ac_try\"") >&5
12697   (eval $ac_try) 2>&5
12698   ac_status=$?
12699   echo "$as_me:12699: \$? = $ac_status" >&5
12700   (exit $ac_status); }; }; then
12701   eval "$as_ac_Header=yes"
12702 else
12703   echo "$as_me: failed program was:" >&5
12704 cat conftest.$ac_ext >&5
12705 eval "$as_ac_Header=no"
12706 fi
12707 rm -f conftest.$ac_objext conftest.$ac_ext
12708 fi
12709 echo "$as_me:12709: result: `eval echo '${'$as_ac_Header'}'`" >&5
12710 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12711 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12712   cat >>confdefs.h <<EOF
12713 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12714 EOF
12715
12716 fi
12717 done
12718
12719 echo "$as_me:12719: checking for signed char" >&5
12720 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
12721 if test "${ac_cv_type_signed_char+set}" = set; then
12722   echo $ECHO_N "(cached) $ECHO_C" >&6
12723 else
12724   cat >conftest.$ac_ext <<_ACEOF
12725 #line 12725 "configure"
12726 #include "confdefs.h"
12727 $ac_includes_default
12728 int
12729 main ()
12730 {
12731 if ((signed char *) 0)
12732   return 0;
12733 if (sizeof (signed char))
12734   return 0;
12735   ;
12736   return 0;
12737 }
12738 _ACEOF
12739 rm -f conftest.$ac_objext
12740 if { (eval echo "$as_me:12740: \"$ac_compile\"") >&5
12741   (eval $ac_compile) 2>&5
12742   ac_status=$?
12743   echo "$as_me:12743: \$? = $ac_status" >&5
12744   (exit $ac_status); } &&
12745          { ac_try='test -s conftest.$ac_objext'
12746   { (eval echo "$as_me:12746: \"$ac_try\"") >&5
12747   (eval $ac_try) 2>&5
12748   ac_status=$?
12749   echo "$as_me:12749: \$? = $ac_status" >&5
12750   (exit $ac_status); }; }; then
12751   ac_cv_type_signed_char=yes
12752 else
12753   echo "$as_me: failed program was:" >&5
12754 cat conftest.$ac_ext >&5
12755 ac_cv_type_signed_char=no
12756 fi
12757 rm -f conftest.$ac_objext conftest.$ac_ext
12758 fi
12759 echo "$as_me:12759: result: $ac_cv_type_signed_char" >&5
12760 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
12761
12762 echo "$as_me:12762: checking size of signed char" >&5
12763 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
12764 if test "${ac_cv_sizeof_signed_char+set}" = set; then
12765   echo $ECHO_N "(cached) $ECHO_C" >&6
12766 else
12767   if test "$ac_cv_type_signed_char" = yes; then
12768   if test "$cross_compiling" = yes; then
12769   # Depending upon the size, compute the lo and hi bounds.
12770 cat >conftest.$ac_ext <<_ACEOF
12771 #line 12771 "configure"
12772 #include "confdefs.h"
12773 $ac_includes_default
12774 int
12775 main ()
12776 {
12777 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
12778   ;
12779   return 0;
12780 }
12781 _ACEOF
12782 rm -f conftest.$ac_objext
12783 if { (eval echo "$as_me:12783: \"$ac_compile\"") >&5
12784   (eval $ac_compile) 2>&5
12785   ac_status=$?
12786   echo "$as_me:12786: \$? = $ac_status" >&5
12787   (exit $ac_status); } &&
12788          { ac_try='test -s conftest.$ac_objext'
12789   { (eval echo "$as_me:12789: \"$ac_try\"") >&5
12790   (eval $ac_try) 2>&5
12791   ac_status=$?
12792   echo "$as_me:12792: \$? = $ac_status" >&5
12793   (exit $ac_status); }; }; then
12794   ac_lo=0 ac_mid=0
12795   while :; do
12796     cat >conftest.$ac_ext <<_ACEOF
12797 #line 12797 "configure"
12798 #include "confdefs.h"
12799 $ac_includes_default
12800 int
12801 main ()
12802 {
12803 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12804   ;
12805   return 0;
12806 }
12807 _ACEOF
12808 rm -f conftest.$ac_objext
12809 if { (eval echo "$as_me:12809: \"$ac_compile\"") >&5
12810   (eval $ac_compile) 2>&5
12811   ac_status=$?
12812   echo "$as_me:12812: \$? = $ac_status" >&5
12813   (exit $ac_status); } &&
12814          { ac_try='test -s conftest.$ac_objext'
12815   { (eval echo "$as_me:12815: \"$ac_try\"") >&5
12816   (eval $ac_try) 2>&5
12817   ac_status=$?
12818   echo "$as_me:12818: \$? = $ac_status" >&5
12819   (exit $ac_status); }; }; then
12820   ac_hi=$ac_mid; break
12821 else
12822   echo "$as_me: failed program was:" >&5
12823 cat conftest.$ac_ext >&5
12824 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
12825 fi
12826 rm -f conftest.$ac_objext conftest.$ac_ext
12827   done
12828 else
12829   echo "$as_me: failed program was:" >&5
12830 cat conftest.$ac_ext >&5
12831 ac_hi=-1 ac_mid=-1
12832   while :; do
12833     cat >conftest.$ac_ext <<_ACEOF
12834 #line 12834 "configure"
12835 #include "confdefs.h"
12836 $ac_includes_default
12837 int
12838 main ()
12839 {
12840 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
12841   ;
12842   return 0;
12843 }
12844 _ACEOF
12845 rm -f conftest.$ac_objext
12846 if { (eval echo "$as_me:12846: \"$ac_compile\"") >&5
12847   (eval $ac_compile) 2>&5
12848   ac_status=$?
12849   echo "$as_me:12849: \$? = $ac_status" >&5
12850   (exit $ac_status); } &&
12851          { ac_try='test -s conftest.$ac_objext'
12852   { (eval echo "$as_me:12852: \"$ac_try\"") >&5
12853   (eval $ac_try) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit $ac_status); }; }; then
12857   ac_lo=$ac_mid; break
12858 else
12859   echo "$as_me: failed program was:" >&5
12860 cat conftest.$ac_ext >&5
12861 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12862 fi
12863 rm -f conftest.$ac_objext conftest.$ac_ext
12864   done
12865 fi
12866 rm -f conftest.$ac_objext conftest.$ac_ext
12867 # Binary search between lo and hi bounds.
12868 while test "x$ac_lo" != "x$ac_hi"; do
12869   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12870   cat >conftest.$ac_ext <<_ACEOF
12871 #line 12871 "configure"
12872 #include "confdefs.h"
12873 $ac_includes_default
12874 int
12875 main ()
12876 {
12877 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12878   ;
12879   return 0;
12880 }
12881 _ACEOF
12882 rm -f conftest.$ac_objext
12883 if { (eval echo "$as_me:12883: \"$ac_compile\"") >&5
12884   (eval $ac_compile) 2>&5
12885   ac_status=$?
12886   echo "$as_me:12886: \$? = $ac_status" >&5
12887   (exit $ac_status); } &&
12888          { ac_try='test -s conftest.$ac_objext'
12889   { (eval echo "$as_me:12889: \"$ac_try\"") >&5
12890   (eval $ac_try) 2>&5
12891   ac_status=$?
12892   echo "$as_me:12892: \$? = $ac_status" >&5
12893   (exit $ac_status); }; }; then
12894   ac_hi=$ac_mid
12895 else
12896   echo "$as_me: failed program was:" >&5
12897 cat conftest.$ac_ext >&5
12898 ac_lo=`expr $ac_mid + 1`
12899 fi
12900 rm -f conftest.$ac_objext conftest.$ac_ext
12901 done
12902 ac_cv_sizeof_signed_char=$ac_lo
12903 else
12904   if test "$cross_compiling" = yes; then
12905   { { echo "$as_me:12905: error: cannot run test program while cross compiling" >&5
12906 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12907    { (exit 1); exit 1; }; }
12908 else
12909   cat >conftest.$ac_ext <<_ACEOF
12910 #line 12910 "configure"
12911 #include "confdefs.h"
12912 $ac_includes_default
12913 int
12914 main ()
12915 {
12916 FILE *f = fopen ("conftest.val", "w");
12917 if (!f)
12918   $ac_main_return (1);
12919 fprintf (f, "%d", (sizeof (signed char)));
12920 fclose (f);
12921   ;
12922   return 0;
12923 }
12924 _ACEOF
12925 rm -f conftest$ac_exeext
12926 if { (eval echo "$as_me:12926: \"$ac_link\"") >&5
12927   (eval $ac_link) 2>&5
12928   ac_status=$?
12929   echo "$as_me:12929: \$? = $ac_status" >&5
12930   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12931   { (eval echo "$as_me:12931: \"$ac_try\"") >&5
12932   (eval $ac_try) 2>&5
12933   ac_status=$?
12934   echo "$as_me:12934: \$? = $ac_status" >&5
12935   (exit $ac_status); }; }; then
12936   ac_cv_sizeof_signed_char=`cat conftest.val`
12937 else
12938   echo "$as_me: program exited with status $ac_status" >&5
12939 echo "$as_me: failed program was:" >&5
12940 cat conftest.$ac_ext >&5
12941 fi
12942 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12943 fi
12944 fi
12945 rm -f conftest.val
12946 else
12947   ac_cv_sizeof_signed_char=0
12948 fi
12949 fi
12950 echo "$as_me:12950: result: $ac_cv_sizeof_signed_char" >&5
12951 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
12952 cat >>confdefs.h <<EOF
12953 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
12954 EOF
12955
12956 echo "$as_me:12956: checking for ANSI C header files" >&5
12957 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12958 if test "${ac_cv_header_stdc+set}" = set; then
12959   echo $ECHO_N "(cached) $ECHO_C" >&6
12960 else
12961   cat >conftest.$ac_ext <<_ACEOF
12962 #line 12962 "configure"
12963 #include "confdefs.h"
12964 #include <stdlib.h>
12965 #include <stdarg.h>
12966 #include <string.h>
12967 #include <float.h>
12968
12969 _ACEOF
12970 if { (eval echo "$as_me:12970: \"$ac_cpp conftest.$ac_ext\"") >&5
12971   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12972   ac_status=$?
12973   egrep -v '^ *\+' conftest.er1 >conftest.err
12974   rm -f conftest.er1
12975   cat conftest.err >&5
12976   echo "$as_me:12976: \$? = $ac_status" >&5
12977   (exit $ac_status); } >/dev/null; then
12978   if test -s conftest.err; then
12979     ac_cpp_err=$ac_c_preproc_warn_flag
12980   else
12981     ac_cpp_err=
12982   fi
12983 else
12984   ac_cpp_err=yes
12985 fi
12986 if test -z "$ac_cpp_err"; then
12987   ac_cv_header_stdc=yes
12988 else
12989   echo "$as_me: failed program was:" >&5
12990   cat conftest.$ac_ext >&5
12991   ac_cv_header_stdc=no
12992 fi
12993 rm -f conftest.err conftest.$ac_ext
12994
12995 if test $ac_cv_header_stdc = yes; then
12996   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12997   cat >conftest.$ac_ext <<_ACEOF
12998 #line 12998 "configure"
12999 #include "confdefs.h"
13000 #include <string.h>
13001
13002 _ACEOF
13003 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13004   egrep "memchr" >/dev/null 2>&1; then
13005   :
13006 else
13007   ac_cv_header_stdc=no
13008 fi
13009 rm -rf conftest*
13010
13011 fi
13012
13013 if test $ac_cv_header_stdc = yes; then
13014   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13015   cat >conftest.$ac_ext <<_ACEOF
13016 #line 13016 "configure"
13017 #include "confdefs.h"
13018 #include <stdlib.h>
13019
13020 _ACEOF
13021 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13022   egrep "free" >/dev/null 2>&1; then
13023   :
13024 else
13025   ac_cv_header_stdc=no
13026 fi
13027 rm -rf conftest*
13028
13029 fi
13030
13031 if test $ac_cv_header_stdc = yes; then
13032   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13033   if test "$cross_compiling" = yes; then
13034   :
13035 else
13036   cat >conftest.$ac_ext <<_ACEOF
13037 #line 13037 "configure"
13038 #include "confdefs.h"
13039 #include <ctype.h>
13040 #if ((' ' & 0x0FF) == 0x020)
13041 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13042 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13043 #else
13044 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13045                      || ('j' <= (c) && (c) <= 'r') \
13046                      || ('s' <= (c) && (c) <= 'z'))
13047 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13048 #endif
13049
13050 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13051 int
13052 main ()
13053 {
13054   int i;
13055   for (i = 0; i < 256; i++)
13056     if (XOR (islower (i), ISLOWER (i))
13057         || toupper (i) != TOUPPER (i))
13058       $ac_main_return(2);
13059   $ac_main_return (0);
13060 }
13061 _ACEOF
13062 rm -f conftest$ac_exeext
13063 if { (eval echo "$as_me:13063: \"$ac_link\"") >&5
13064   (eval $ac_link) 2>&5
13065   ac_status=$?
13066   echo "$as_me:13066: \$? = $ac_status" >&5
13067   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13068   { (eval echo "$as_me:13068: \"$ac_try\"") >&5
13069   (eval $ac_try) 2>&5
13070   ac_status=$?
13071   echo "$as_me:13071: \$? = $ac_status" >&5
13072   (exit $ac_status); }; }; then
13073   :
13074 else
13075   echo "$as_me: program exited with status $ac_status" >&5
13076 echo "$as_me: failed program was:" >&5
13077 cat conftest.$ac_ext >&5
13078 ac_cv_header_stdc=no
13079 fi
13080 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13081 fi
13082 fi
13083 fi
13084 echo "$as_me:13084: result: $ac_cv_header_stdc" >&5
13085 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13086 if test $ac_cv_header_stdc = yes; then
13087
13088 cat >>confdefs.h <<\EOF
13089 #define STDC_HEADERS 1
13090 EOF
13091
13092 fi
13093
13094 ac_header_dirent=no
13095 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13096   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13097 echo "$as_me:13097: checking for $ac_hdr that defines DIR" >&5
13098 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13099 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13100   echo $ECHO_N "(cached) $ECHO_C" >&6
13101 else
13102   cat >conftest.$ac_ext <<_ACEOF
13103 #line 13103 "configure"
13104 #include "confdefs.h"
13105 #include <sys/types.h>
13106 #include <$ac_hdr>
13107
13108 int
13109 main ()
13110 {
13111 if ((DIR *) 0)
13112 return 0;
13113   ;
13114   return 0;
13115 }
13116 _ACEOF
13117 rm -f conftest.$ac_objext
13118 if { (eval echo "$as_me:13118: \"$ac_compile\"") >&5
13119   (eval $ac_compile) 2>&5
13120   ac_status=$?
13121   echo "$as_me:13121: \$? = $ac_status" >&5
13122   (exit $ac_status); } &&
13123          { ac_try='test -s conftest.$ac_objext'
13124   { (eval echo "$as_me:13124: \"$ac_try\"") >&5
13125   (eval $ac_try) 2>&5
13126   ac_status=$?
13127   echo "$as_me:13127: \$? = $ac_status" >&5
13128   (exit $ac_status); }; }; then
13129   eval "$as_ac_Header=yes"
13130 else
13131   echo "$as_me: failed program was:" >&5
13132 cat conftest.$ac_ext >&5
13133 eval "$as_ac_Header=no"
13134 fi
13135 rm -f conftest.$ac_objext conftest.$ac_ext
13136 fi
13137 echo "$as_me:13137: result: `eval echo '${'$as_ac_Header'}'`" >&5
13138 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13139 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13140   cat >>confdefs.h <<EOF
13141 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13142 EOF
13143
13144 ac_header_dirent=$ac_hdr; break
13145 fi
13146
13147 done
13148 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13149 if test $ac_header_dirent = dirent.h; then
13150   echo "$as_me:13150: checking for opendir in -ldir" >&5
13151 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13152 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13153   echo $ECHO_N "(cached) $ECHO_C" >&6
13154 else
13155   ac_check_lib_save_LIBS=$LIBS
13156 LIBS="-ldir  $LIBS"
13157 cat >conftest.$ac_ext <<_ACEOF
13158 #line 13158 "configure"
13159 #include "confdefs.h"
13160
13161 /* Override any gcc2 internal prototype to avoid an error.  */
13162 #ifdef __cplusplus
13163 extern "C"
13164 #endif
13165 /* We use char because int might match the return type of a gcc2
13166    builtin and then its argument prototype would still apply.  */
13167 char opendir ();
13168 int
13169 main ()
13170 {
13171 opendir ();
13172   ;
13173   return 0;
13174 }
13175 _ACEOF
13176 rm -f conftest.$ac_objext conftest$ac_exeext
13177 if { (eval echo "$as_me:13177: \"$ac_link\"") >&5
13178   (eval $ac_link) 2>&5
13179   ac_status=$?
13180   echo "$as_me:13180: \$? = $ac_status" >&5
13181   (exit $ac_status); } &&
13182          { ac_try='test -s conftest$ac_exeext'
13183   { (eval echo "$as_me:13183: \"$ac_try\"") >&5
13184   (eval $ac_try) 2>&5
13185   ac_status=$?
13186   echo "$as_me:13186: \$? = $ac_status" >&5
13187   (exit $ac_status); }; }; then
13188   ac_cv_lib_dir_opendir=yes
13189 else
13190   echo "$as_me: failed program was:" >&5
13191 cat conftest.$ac_ext >&5
13192 ac_cv_lib_dir_opendir=no
13193 fi
13194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13195 LIBS=$ac_check_lib_save_LIBS
13196 fi
13197 echo "$as_me:13197: result: $ac_cv_lib_dir_opendir" >&5
13198 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13199 if test $ac_cv_lib_dir_opendir = yes; then
13200   LIBS="$LIBS -ldir"
13201 fi
13202
13203 else
13204   echo "$as_me:13204: checking for opendir in -lx" >&5
13205 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13206 if test "${ac_cv_lib_x_opendir+set}" = set; then
13207   echo $ECHO_N "(cached) $ECHO_C" >&6
13208 else
13209   ac_check_lib_save_LIBS=$LIBS
13210 LIBS="-lx  $LIBS"
13211 cat >conftest.$ac_ext <<_ACEOF
13212 #line 13212 "configure"
13213 #include "confdefs.h"
13214
13215 /* Override any gcc2 internal prototype to avoid an error.  */
13216 #ifdef __cplusplus
13217 extern "C"
13218 #endif
13219 /* We use char because int might match the return type of a gcc2
13220    builtin and then its argument prototype would still apply.  */
13221 char opendir ();
13222 int
13223 main ()
13224 {
13225 opendir ();
13226   ;
13227   return 0;
13228 }
13229 _ACEOF
13230 rm -f conftest.$ac_objext conftest$ac_exeext
13231 if { (eval echo "$as_me:13231: \"$ac_link\"") >&5
13232   (eval $ac_link) 2>&5
13233   ac_status=$?
13234   echo "$as_me:13234: \$? = $ac_status" >&5
13235   (exit $ac_status); } &&
13236          { ac_try='test -s conftest$ac_exeext'
13237   { (eval echo "$as_me:13237: \"$ac_try\"") >&5
13238   (eval $ac_try) 2>&5
13239   ac_status=$?
13240   echo "$as_me:13240: \$? = $ac_status" >&5
13241   (exit $ac_status); }; }; then
13242   ac_cv_lib_x_opendir=yes
13243 else
13244   echo "$as_me: failed program was:" >&5
13245 cat conftest.$ac_ext >&5
13246 ac_cv_lib_x_opendir=no
13247 fi
13248 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13249 LIBS=$ac_check_lib_save_LIBS
13250 fi
13251 echo "$as_me:13251: result: $ac_cv_lib_x_opendir" >&5
13252 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13253 if test $ac_cv_lib_x_opendir = yes; then
13254   LIBS="$LIBS -lx"
13255 fi
13256
13257 fi
13258
13259 echo "$as_me:13259: checking whether time.h and sys/time.h may both be included" >&5
13260 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13261 if test "${ac_cv_header_time+set}" = set; then
13262   echo $ECHO_N "(cached) $ECHO_C" >&6
13263 else
13264   cat >conftest.$ac_ext <<_ACEOF
13265 #line 13265 "configure"
13266 #include "confdefs.h"
13267 #include <sys/types.h>
13268 #include <sys/time.h>
13269 #include <time.h>
13270
13271 int
13272 main ()
13273 {
13274 if ((struct tm *) 0)
13275 return 0;
13276   ;
13277   return 0;
13278 }
13279 _ACEOF
13280 rm -f conftest.$ac_objext
13281 if { (eval echo "$as_me:13281: \"$ac_compile\"") >&5
13282   (eval $ac_compile) 2>&5
13283   ac_status=$?
13284   echo "$as_me:13284: \$? = $ac_status" >&5
13285   (exit $ac_status); } &&
13286          { ac_try='test -s conftest.$ac_objext'
13287   { (eval echo "$as_me:13287: \"$ac_try\"") >&5
13288   (eval $ac_try) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit $ac_status); }; }; then
13292   ac_cv_header_time=yes
13293 else
13294   echo "$as_me: failed program was:" >&5
13295 cat conftest.$ac_ext >&5
13296 ac_cv_header_time=no
13297 fi
13298 rm -f conftest.$ac_objext conftest.$ac_ext
13299 fi
13300 echo "$as_me:13300: result: $ac_cv_header_time" >&5
13301 echo "${ECHO_T}$ac_cv_header_time" >&6
13302 if test $ac_cv_header_time = yes; then
13303
13304 cat >>confdefs.h <<\EOF
13305 #define TIME_WITH_SYS_TIME 1
13306 EOF
13307
13308 fi
13309
13310 ###     checks for compiler characteristics
13311 ac_ext=c
13312 ac_cpp='$CPP $CPPFLAGS'
13313 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13314 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13315 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13316 ac_main_return=return
13317
13318 echo "$as_me:13318: checking for an ANSI C-conforming const" >&5
13319 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13320 if test "${ac_cv_c_const+set}" = set; then
13321   echo $ECHO_N "(cached) $ECHO_C" >&6
13322 else
13323   cat >conftest.$ac_ext <<_ACEOF
13324 #line 13324 "configure"
13325 #include "confdefs.h"
13326
13327 int
13328 main ()
13329 {
13330 /* FIXME: Include the comments suggested by Paul. */
13331 #ifndef __cplusplus
13332   /* Ultrix mips cc rejects this.  */
13333   typedef int charset[2];
13334   const charset x;
13335   /* SunOS 4.1.1 cc rejects this.  */
13336   char const *const *ccp;
13337   char **p;
13338   /* NEC SVR4.0.2 mips cc rejects this.  */
13339   struct point {int x, y;};
13340   static struct point const zero = {0,0};
13341   /* AIX XL C 1.02.0.0 rejects this.
13342      It does not let you subtract one const X* pointer from another in
13343      an arm of an if-expression whose if-part is not a constant
13344      expression */
13345   const char *g = "string";
13346   ccp = &g + (g ? g-g : 0);
13347   /* HPUX 7.0 cc rejects these. */
13348   ++ccp;
13349   p = (char**) ccp;
13350   ccp = (char const *const *) p;
13351   { /* SCO 3.2v4 cc rejects this.  */
13352     char *t;
13353     char const *s = 0 ? (char *) 0 : (char const *) 0;
13354
13355     *t++ = 0;
13356   }
13357   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13358     int x[] = {25, 17};
13359     const int *foo = &x[0];
13360     ++foo;
13361   }
13362   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13363     typedef const int *iptr;
13364     iptr p = 0;
13365     ++p;
13366   }
13367   { /* AIX XL C 1.02.0.0 rejects this saying
13368        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13369     struct s { int j; const int *ap[3]; };
13370     struct s *b; b->j = 5;
13371   }
13372   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13373     const int foo = 10;
13374   }
13375 #endif
13376
13377   ;
13378   return 0;
13379 }
13380 _ACEOF
13381 rm -f conftest.$ac_objext
13382 if { (eval echo "$as_me:13382: \"$ac_compile\"") >&5
13383   (eval $ac_compile) 2>&5
13384   ac_status=$?
13385   echo "$as_me:13385: \$? = $ac_status" >&5
13386   (exit $ac_status); } &&
13387          { ac_try='test -s conftest.$ac_objext'
13388   { (eval echo "$as_me:13388: \"$ac_try\"") >&5
13389   (eval $ac_try) 2>&5
13390   ac_status=$?
13391   echo "$as_me:13391: \$? = $ac_status" >&5
13392   (exit $ac_status); }; }; then
13393   ac_cv_c_const=yes
13394 else
13395   echo "$as_me: failed program was:" >&5
13396 cat conftest.$ac_ext >&5
13397 ac_cv_c_const=no
13398 fi
13399 rm -f conftest.$ac_objext conftest.$ac_ext
13400 fi
13401 echo "$as_me:13401: result: $ac_cv_c_const" >&5
13402 echo "${ECHO_T}$ac_cv_c_const" >&6
13403 if test $ac_cv_c_const = no; then
13404
13405 cat >>confdefs.h <<\EOF
13406 #define const
13407 EOF
13408
13409 fi
13410
13411 ###     Checks for external-data
13412
13413 echo "$as_me:13413: checking if data-only library module links" >&5
13414 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13415 if test "${cf_cv_link_dataonly+set}" = set; then
13416   echo $ECHO_N "(cached) $ECHO_C" >&6
13417 else
13418
13419         rm -f conftest.a
13420         cat >conftest.$ac_ext <<EOF
13421 #line 13421 "configure"
13422 int     testdata[3] = { 123, 456, 789 };
13423 EOF
13424         if { (eval echo "$as_me:13424: \"$ac_compile\"") >&5
13425   (eval $ac_compile) 2>&5
13426   ac_status=$?
13427   echo "$as_me:13427: \$? = $ac_status" >&5
13428   (exit $ac_status); } ; then
13429                 mv conftest.o data.o && \
13430                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13431         fi
13432         rm -f conftest.$ac_ext data.o
13433         cat >conftest.$ac_ext <<EOF
13434 #line 13434 "configure"
13435 int     testfunc()
13436 {
13437 #if defined(NeXT)
13438         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13439 #else
13440         extern int testdata[3];
13441         return testdata[0] == 123
13442            &&  testdata[1] == 456
13443            &&  testdata[2] == 789;
13444 #endif
13445 }
13446 EOF
13447         if { (eval echo "$as_me:13447: \"$ac_compile\"") >&5
13448   (eval $ac_compile) 2>&5
13449   ac_status=$?
13450   echo "$as_me:13450: \$? = $ac_status" >&5
13451   (exit $ac_status); }; then
13452                 mv conftest.o func.o && \
13453                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13454         fi
13455         rm -f conftest.$ac_ext func.o
13456         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13457         cf_saveLIBS="$LIBS"
13458         LIBS="conftest.a $LIBS"
13459         if test "$cross_compiling" = yes; then
13460   cf_cv_link_dataonly=unknown
13461 else
13462   cat >conftest.$ac_ext <<_ACEOF
13463 #line 13463 "configure"
13464 #include "confdefs.h"
13465
13466         int main()
13467         {
13468                 extern int testfunc();
13469                 ${cf_cv_main_return:-return} (!testfunc());
13470         }
13471
13472 _ACEOF
13473 rm -f conftest$ac_exeext
13474 if { (eval echo "$as_me:13474: \"$ac_link\"") >&5
13475   (eval $ac_link) 2>&5
13476   ac_status=$?
13477   echo "$as_me:13477: \$? = $ac_status" >&5
13478   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13479   { (eval echo "$as_me:13479: \"$ac_try\"") >&5
13480   (eval $ac_try) 2>&5
13481   ac_status=$?
13482   echo "$as_me:13482: \$? = $ac_status" >&5
13483   (exit $ac_status); }; }; then
13484   cf_cv_link_dataonly=yes
13485 else
13486   echo "$as_me: program exited with status $ac_status" >&5
13487 echo "$as_me: failed program was:" >&5
13488 cat conftest.$ac_ext >&5
13489 cf_cv_link_dataonly=no
13490 fi
13491 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13492 fi
13493         LIBS="$cf_saveLIBS"
13494
13495 fi
13496
13497 echo "$as_me:13497: result: $cf_cv_link_dataonly" >&5
13498 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13499
13500 if test "$cf_cv_link_dataonly" = no ; then
13501
13502 cat >>confdefs.h <<\EOF
13503 #define BROKEN_LINKER 1
13504 EOF
13505
13506         BROKEN_LINKER=1
13507 fi
13508
13509 ###     Checks for library functions.
13510
13511 echo "$as_me:13511: checking for working mkstemp" >&5
13512 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13513 if test "${cf_cv_func_mkstemp+set}" = set; then
13514   echo $ECHO_N "(cached) $ECHO_C" >&6
13515 else
13516
13517 rm -rf conftest*
13518 if test "$cross_compiling" = yes; then
13519   cf_cv_func_mkstemp=maybe
13520 else
13521   cat >conftest.$ac_ext <<_ACEOF
13522 #line 13522 "configure"
13523 #include "confdefs.h"
13524
13525 #include <sys/types.h>
13526 #include <stdlib.h>
13527 #include <stdio.h>
13528 #include <string.h>
13529 #include <sys/stat.h>
13530 int main()
13531 {
13532         char *tmpl = "conftestXXXXXX";
13533         char name[2][80];
13534         int n;
13535         int result = 0;
13536         int fd;
13537         struct stat sb;
13538
13539         umask(077);
13540         for (n = 0; n < 2; ++n) {
13541                 strcpy(name[n], tmpl);
13542                 if ((fd = mkstemp(name[n])) >= 0) {
13543                         if (!strcmp(name[n], tmpl)
13544                          || stat(name[n], &sb) != 0
13545                          || (sb.st_mode & S_IFMT) != S_IFREG
13546                          || (sb.st_mode & 077) != 0) {
13547                                 result = 1;
13548                         }
13549                         close(fd);
13550                 }
13551         }
13552         if (result == 0
13553          && !strcmp(name[0], name[1]))
13554                 result = 1;
13555         ${cf_cv_main_return:-return}(result);
13556 }
13557
13558 _ACEOF
13559 rm -f conftest$ac_exeext
13560 if { (eval echo "$as_me:13560: \"$ac_link\"") >&5
13561   (eval $ac_link) 2>&5
13562   ac_status=$?
13563   echo "$as_me:13563: \$? = $ac_status" >&5
13564   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13565   { (eval echo "$as_me:13565: \"$ac_try\"") >&5
13566   (eval $ac_try) 2>&5
13567   ac_status=$?
13568   echo "$as_me:13568: \$? = $ac_status" >&5
13569   (exit $ac_status); }; }; then
13570   cf_cv_func_mkstemp=yes
13571
13572 else
13573   echo "$as_me: program exited with status $ac_status" >&5
13574 echo "$as_me: failed program was:" >&5
13575 cat conftest.$ac_ext >&5
13576 cf_cv_func_mkstemp=no
13577
13578 fi
13579 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13580 fi
13581
13582 fi
13583 echo "$as_me:13583: result: $cf_cv_func_mkstemp" >&5
13584 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13585 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13586         echo "$as_me:13586: checking for mkstemp" >&5
13587 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13588 if test "${ac_cv_func_mkstemp+set}" = set; then
13589   echo $ECHO_N "(cached) $ECHO_C" >&6
13590 else
13591   cat >conftest.$ac_ext <<_ACEOF
13592 #line 13592 "configure"
13593 #include "confdefs.h"
13594 /* System header to define __stub macros and hopefully few prototypes,
13595     which can conflict with char mkstemp (); below.  */
13596 #include <assert.h>
13597 /* Override any gcc2 internal prototype to avoid an error.  */
13598 #ifdef __cplusplus
13599 extern "C"
13600 #endif
13601 /* We use char because int might match the return type of a gcc2
13602    builtin and then its argument prototype would still apply.  */
13603 char mkstemp ();
13604 char (*f) ();
13605
13606 int
13607 main ()
13608 {
13609 /* The GNU C library defines this for functions which it implements
13610     to always fail with ENOSYS.  Some functions are actually named
13611     something starting with __ and the normal name is an alias.  */
13612 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13613 choke me
13614 #else
13615 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13616 #endif
13617
13618   ;
13619   return 0;
13620 }
13621 _ACEOF
13622 rm -f conftest.$ac_objext conftest$ac_exeext
13623 if { (eval echo "$as_me:13623: \"$ac_link\"") >&5
13624   (eval $ac_link) 2>&5
13625   ac_status=$?
13626   echo "$as_me:13626: \$? = $ac_status" >&5
13627   (exit $ac_status); } &&
13628          { ac_try='test -s conftest$ac_exeext'
13629   { (eval echo "$as_me:13629: \"$ac_try\"") >&5
13630   (eval $ac_try) 2>&5
13631   ac_status=$?
13632   echo "$as_me:13632: \$? = $ac_status" >&5
13633   (exit $ac_status); }; }; then
13634   ac_cv_func_mkstemp=yes
13635 else
13636   echo "$as_me: failed program was:" >&5
13637 cat conftest.$ac_ext >&5
13638 ac_cv_func_mkstemp=no
13639 fi
13640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13641 fi
13642 echo "$as_me:13642: result: $ac_cv_func_mkstemp" >&5
13643 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13644
13645 fi
13646 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13647
13648 cat >>confdefs.h <<\EOF
13649 #define HAVE_MKSTEMP 1
13650 EOF
13651
13652 fi
13653
13654 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13655         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13656         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13657 fi
13658
13659 cf_with_ada=yes
13660 if test "$cf_with_ada" != "no" ; then
13661
13662 cf_ada_make=gnatmake
13663 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13664 set dummy $cf_ada_make; ac_word=$2
13665 echo "$as_me:13665: checking for $ac_word" >&5
13666 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13667 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13668   echo $ECHO_N "(cached) $ECHO_C" >&6
13669 else
13670   if test -n "$gnat_exists"; then
13671   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13672 else
13673   ac_save_IFS=$IFS; IFS=$ac_path_separator
13674 ac_dummy="$PATH"
13675 for ac_dir in $ac_dummy; do
13676   IFS=$ac_save_IFS
13677   test -z "$ac_dir" && ac_dir=.
13678   $as_executable_p "$ac_dir/$ac_word" || continue
13679 ac_cv_prog_gnat_exists="yes"
13680 echo "$as_me:13680: found $ac_dir/$ac_word" >&5
13681 break
13682 done
13683
13684   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13685 fi
13686 fi
13687 gnat_exists=$ac_cv_prog_gnat_exists
13688 if test -n "$gnat_exists"; then
13689   echo "$as_me:13689: result: $gnat_exists" >&5
13690 echo "${ECHO_T}$gnat_exists" >&6
13691 else
13692   echo "$as_me:13692: result: no" >&5
13693 echo "${ECHO_T}no" >&6
13694 fi
13695
13696 if test "$ac_cv_prog_gnat_exists" = no; then
13697         cf_ada_make=
13698         cf_cv_prog_gnat_correct=no
13699 else
13700
13701 echo "$as_me:13701: checking for gnat version" >&5
13702 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13703 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13704         grep '[0-9].[0-9][0-9]*' |\
13705         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13706 echo "$as_me:13706: result: $cf_gnat_version" >&5
13707 echo "${ECHO_T}$cf_gnat_version" >&6
13708
13709 case $cf_gnat_version in
13710 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13711         cf_cv_prog_gnat_correct=yes
13712         ;;
13713 (*)
13714         { echo "$as_me:13714: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13715 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13716         cf_cv_prog_gnat_correct=no
13717         ;;
13718 esac
13719
13720         # Extract the first word of "m4", so it can be a program name with args.
13721 set dummy m4; ac_word=$2
13722 echo "$as_me:13722: checking for $ac_word" >&5
13723 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13724 if test "${ac_cv_prog_M4_exists+set}" = set; then
13725   echo $ECHO_N "(cached) $ECHO_C" >&6
13726 else
13727   if test -n "$M4_exists"; then
13728   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13729 else
13730   ac_save_IFS=$IFS; IFS=$ac_path_separator
13731 ac_dummy="$PATH"
13732 for ac_dir in $ac_dummy; do
13733   IFS=$ac_save_IFS
13734   test -z "$ac_dir" && ac_dir=.
13735   $as_executable_p "$ac_dir/$ac_word" || continue
13736 ac_cv_prog_M4_exists="yes"
13737 echo "$as_me:13737: found $ac_dir/$ac_word" >&5
13738 break
13739 done
13740
13741   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13742 fi
13743 fi
13744 M4_exists=$ac_cv_prog_M4_exists
13745 if test -n "$M4_exists"; then
13746   echo "$as_me:13746: result: $M4_exists" >&5
13747 echo "${ECHO_T}$M4_exists" >&6
13748 else
13749   echo "$as_me:13749: result: no" >&5
13750 echo "${ECHO_T}no" >&6
13751 fi
13752
13753         if test "$ac_cv_prog_M4_exists" = no; then
13754                 cf_cv_prog_gnat_correct=no
13755                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13756         fi
13757         if test "$cf_cv_prog_gnat_correct" = yes; then
13758                 echo "$as_me:13758: checking if GNAT works" >&5
13759 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13760
13761 rm -rf conftest* *~conftest*
13762 cat >>conftest.ads <<CF_EOF
13763 procedure conftest;
13764 CF_EOF
13765 cat >>conftest.adb <<CF_EOF
13766 with Text_IO;
13767 with GNAT.OS_Lib;
13768 procedure conftest is
13769 begin
13770    Text_IO.Put ("Hello World");
13771    Text_IO.New_Line;
13772    GNAT.OS_Lib.OS_Exit (0);
13773 end conftest;
13774 CF_EOF
13775 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13776    if ( ./conftest 1>&5 2>&1 ) ; then
13777       cf_cv_prog_gnat_correct=yes
13778    else
13779       cf_cv_prog_gnat_correct=no
13780    fi
13781 else
13782    cf_cv_prog_gnat_correct=no
13783 fi
13784 rm -rf conftest* *~conftest*
13785
13786                 echo "$as_me:13786: result: $cf_cv_prog_gnat_correct" >&5
13787 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13788         fi
13789 fi
13790
13791         if test "$cf_cv_prog_gnat_correct" = yes; then
13792
13793         echo "$as_me:13793: checking optimization options for ADAFLAGS" >&5
13794 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13795         case "$CFLAGS" in
13796         (*-g*)
13797
13798         ADAFLAGS="$ADAFLAGS -g"
13799
13800                 ;;
13801         esac
13802         case "$CFLAGS" in
13803         (*-O*)
13804                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13805
13806         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13807
13808                 ;;
13809         esac
13810         echo "$as_me:13810: result: $ADAFLAGS" >&5
13811 echo "${ECHO_T}$ADAFLAGS" >&6
13812
13813 echo "$as_me:13813: checking if GNATPREP supports -T option" >&5
13814 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13815 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13816   echo $ECHO_N "(cached) $ECHO_C" >&6
13817 else
13818
13819 cf_cv_gnatprep_opt_t=no
13820 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13821
13822 fi
13823 echo "$as_me:13823: result: $cf_cv_gnatprep_opt_t" >&5
13824 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13825 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13826
13827 echo "$as_me:13827: checking if GNAT supports generics" >&5
13828 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13829 case $cf_gnat_version in
13830 (3.[1-9]*|[4-9].*)
13831         cf_gnat_generics=yes
13832         ;;
13833 (*)
13834         cf_gnat_generics=no
13835         ;;
13836 esac
13837 echo "$as_me:13837: result: $cf_gnat_generics" >&5
13838 echo "${ECHO_T}$cf_gnat_generics" >&6
13839
13840 if test "$cf_gnat_generics" = yes
13841 then
13842         cf_compile_generics=generics
13843         cf_generic_objects="\${GENOBJS}"
13844 else
13845         cf_compile_generics=
13846         cf_generic_objects=
13847 fi
13848
13849 echo "$as_me:13849: checking if GNAT supports SIGINT" >&5
13850 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13851 if test "${cf_cv_gnat_sigint+set}" = set; then
13852   echo $ECHO_N "(cached) $ECHO_C" >&6
13853 else
13854
13855 rm -rf conftest* *~conftest*
13856 cat >>conftest.ads <<CF_EOF
13857 with Ada.Interrupts.Names;
13858
13859 package ConfTest is
13860
13861    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13862    pragma Unreserve_All_Interrupts;
13863    pragma Warnings (On);
13864
13865    protected Process is
13866       procedure Stop;
13867       function Continue return Boolean;
13868       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13869    private
13870       Done : Boolean := False;
13871    end Process;
13872
13873 end ConfTest;
13874 CF_EOF
13875 cat >>conftest.adb <<CF_EOF
13876 package body ConfTest is
13877    protected body Process is
13878       procedure Stop is
13879       begin
13880          Done := True;
13881       end Stop;
13882       function Continue return Boolean is
13883       begin
13884          return not Done;
13885       end Continue;
13886    end Process;
13887 end ConfTest;
13888 CF_EOF
13889 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13890       cf_cv_gnat_sigint=yes
13891 else
13892    cf_cv_gnat_sigint=no
13893 fi
13894 rm -rf conftest* *~conftest*
13895
13896 fi
13897 echo "$as_me:13897: result: $cf_cv_gnat_sigint" >&5
13898 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13899
13900 if test $cf_cv_gnat_sigint = yes ; then
13901         USE_GNAT_SIGINT=""
13902 else
13903         USE_GNAT_SIGINT="#"
13904 fi
13905
13906 cf_gnat_libraries=no
13907 cf_gnat_projects=no
13908
13909 if test "$enable_gnat_projects" != no ; then
13910 echo "$as_me:13910: checking if GNAT supports project files" >&5
13911 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13912 case $cf_gnat_version in
13913 (3.[0-9]*)
13914         ;;
13915 (*)
13916         case $cf_cv_system_name in
13917         (cygwin*|msys*)
13918                 ;;
13919         (*)
13920                 mkdir conftest.src conftest.bin conftest.lib
13921                 cd conftest.src
13922                 rm -rf conftest* *~conftest*
13923                 cat >>library.gpr <<CF_EOF
13924 project Library is
13925   Kind := External ("LIB_KIND");
13926   for Library_Name use "ConfTest";
13927   for Object_Dir use ".";
13928   for Library_ALI_Dir use External("LIBRARY_DIR");
13929   for Library_Version use External ("SONAME");
13930   for Library_Kind use Kind;
13931   for Library_Dir use External("BUILD_DIR");
13932   Source_Dir := External ("SOURCE_DIR");
13933   for Source_Dirs use (Source_Dir);
13934 end Library;
13935 CF_EOF
13936                 cat >>confpackage.ads <<CF_EOF
13937 package ConfPackage is
13938    procedure conftest;
13939 end ConfPackage;
13940 CF_EOF
13941                 cat >>confpackage.adb <<CF_EOF
13942 with Text_IO;
13943 package body ConfPackage is
13944    procedure conftest is
13945    begin
13946       Text_IO.Put ("Hello World");
13947       Text_IO.New_Line;
13948    end conftest;
13949 end ConfPackage;
13950 CF_EOF
13951                 if ( $cf_ada_make $ADAFLAGS \
13952                                 -Plibrary.gpr \
13953                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
13954                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
13955                                 -XSOURCE_DIR=`pwd` \
13956                                 -XSONAME=libConfTest.so.1 \
13957                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
13958                         cf_gnat_projects=yes
13959                 fi
13960                 cd ..
13961                 if test -f conftest.lib/confpackage.ali
13962                 then
13963                         cf_gnat_libraries=yes
13964                 fi
13965                 rm -rf conftest* *~conftest*
13966                 ;;
13967         esac
13968         ;;
13969 esac
13970 echo "$as_me:13970: result: $cf_gnat_projects" >&5
13971 echo "${ECHO_T}$cf_gnat_projects" >&6
13972 fi # enable_gnat_projects
13973
13974 if test $cf_gnat_projects = yes
13975 then
13976         echo "$as_me:13976: checking if GNAT supports libraries" >&5
13977 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
13978         echo "$as_me:13978: result: $cf_gnat_libraries" >&5
13979 echo "${ECHO_T}$cf_gnat_libraries" >&6
13980 fi
13981
13982 if test "$cf_gnat_projects" = yes
13983 then
13984         USE_OLD_MAKERULES="#"
13985         USE_GNAT_PROJECTS=""
13986 else
13987         USE_OLD_MAKERULES=""
13988         USE_GNAT_PROJECTS="#"
13989 fi
13990
13991 if test "$cf_gnat_libraries" = yes
13992 then
13993         USE_GNAT_LIBRARIES=""
13994 else
13995         USE_GNAT_LIBRARIES="#"
13996 fi
13997
13998 echo "$as_me:13998: checking for ada-compiler" >&5
13999 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14000
14001 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14002 if test "${with_ada_compiler+set}" = set; then
14003   withval="$with_ada_compiler"
14004   cf_ada_compiler=$withval
14005 else
14006   cf_ada_compiler=gnatmake
14007 fi;
14008
14009 echo "$as_me:14009: result: $cf_ada_compiler" >&5
14010 echo "${ECHO_T}$cf_ada_compiler" >&6
14011
14012                 cf_ada_package=terminal_interface
14013
14014 echo "$as_me:14014: checking for ada-include" >&5
14015 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14016
14017 # Check whether --with-ada-include or --without-ada-include was given.
14018 if test "${with_ada_include+set}" = set; then
14019   withval="$with_ada_include"
14020
14021 else
14022   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14023 fi; if test -n "$prefix/share/ada/adainclude" ; then
14024
14025 if test "x$prefix" != xNONE; then
14026         cf_path_syntax="$prefix"
14027 else
14028         cf_path_syntax="$ac_default_prefix"
14029 fi
14030
14031 case ".$withval" in
14032 (.\$\(*\)*|.\'*\'*)
14033         ;;
14034 (..|./*|.\\*)
14035         ;;
14036 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14037         ;;
14038 (.\${*prefix}*|.\${*dir}*)
14039         eval withval="$withval"
14040         case ".$withval" in
14041         (.NONE/*)
14042                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14043                 ;;
14044         esac
14045         ;;
14046 (.no|.NONE/*)
14047         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14048         ;;
14049 (*)
14050         { { echo "$as_me:14050: error: expected a pathname, not \"$withval\"" >&5
14051 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14052    { (exit 1); exit 1; }; }
14053         ;;
14054 esac
14055
14056 fi
14057 eval ADA_INCLUDE="$withval"
14058
14059 echo "$as_me:14059: result: $ADA_INCLUDE" >&5
14060 echo "${ECHO_T}$ADA_INCLUDE" >&6
14061
14062 echo "$as_me:14062: checking for ada-objects" >&5
14063 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14064
14065 # Check whether --with-ada-objects or --without-ada-objects was given.
14066 if test "${with_ada_objects+set}" = set; then
14067   withval="$with_ada_objects"
14068
14069 else
14070   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14071 fi; if test -n "$prefix/lib/ada/adalib" ; then
14072
14073 if test "x$prefix" != xNONE; then
14074         cf_path_syntax="$prefix"
14075 else
14076         cf_path_syntax="$ac_default_prefix"
14077 fi
14078
14079 case ".$withval" in
14080 (.\$\(*\)*|.\'*\'*)
14081         ;;
14082 (..|./*|.\\*)
14083         ;;
14084 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14085         ;;
14086 (.\${*prefix}*|.\${*dir}*)
14087         eval withval="$withval"
14088         case ".$withval" in
14089         (.NONE/*)
14090                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14091                 ;;
14092         esac
14093         ;;
14094 (.no|.NONE/*)
14095         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14096         ;;
14097 (*)
14098         { { echo "$as_me:14098: error: expected a pathname, not \"$withval\"" >&5
14099 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14100    { (exit 1); exit 1; }; }
14101         ;;
14102 esac
14103
14104 fi
14105 eval ADA_OBJECTS="$withval"
14106
14107 echo "$as_me:14107: result: $ADA_OBJECTS" >&5
14108 echo "${ECHO_T}$ADA_OBJECTS" >&6
14109
14110 echo "$as_me:14110: checking if an Ada95 shared-library should be built" >&5
14111 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14112
14113 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14114 if test "${with_ada_sharedlib+set}" = set; then
14115   withval="$with_ada_sharedlib"
14116   with_ada_sharedlib=$withval
14117 else
14118   with_ada_sharedlib=no
14119 fi;
14120 echo "$as_me:14120: result: $with_ada_sharedlib" >&5
14121 echo "${ECHO_T}$with_ada_sharedlib" >&6
14122
14123 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14124 MAKE_ADA_SHAREDLIB="#"
14125
14126 if test "x$with_ada_sharedlib" != xno
14127 then
14128         MAKE_ADA_SHAREDLIB=
14129         if test "x$with_ada_sharedlib" != xyes
14130         then
14131                 ADA_SHAREDLIB="$with_ada_sharedlib"
14132         fi
14133 fi
14134
14135         else
14136                 { { echo "$as_me:14136: error: No usable Ada compiler found" >&5
14137 echo "$as_me: error: No usable Ada compiler found" >&2;}
14138    { (exit 1); exit 1; }; }
14139         fi
14140 else
14141         { { echo "$as_me:14141: error: The Ada compiler is needed for this package" >&5
14142 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14143    { (exit 1); exit 1; }; }
14144 fi
14145
14146 ################################################################################
14147
14148 # not needed
14149 TINFO_LDFLAGS2=
14150
14151 TINFO_LIBS=
14152
14153 ### Construct the list of include-directories to be generated
14154
14155 if test "$srcdir" != "."; then
14156         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14157 fi
14158 CPPFLAGS="-I../include $CPPFLAGS"
14159 if test "$srcdir" != "."; then
14160         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14161 fi
14162 CPPFLAGS="-I. $CPPFLAGS"
14163
14164 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14165 if test "$srcdir" != "."; then
14166         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14167 fi
14168 if test "$GCC" != yes; then
14169         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14170 elif test "$includedir" != "/usr/include"; then
14171         if test "$includedir" = '${prefix}/include' ; then
14172                 if test x$prefix != x/usr ; then
14173                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14174                 fi
14175         else
14176                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14177         fi
14178 fi
14179
14180 ### Build up pieces for makefile rules
14181 echo "$as_me:14181: checking default library suffix" >&5
14182 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14183
14184         case $DFT_LWR_MODEL in
14185         (libtool) DFT_ARG_SUFFIX=''   ;;
14186         (normal)  DFT_ARG_SUFFIX=''   ;;
14187         (debug)   DFT_ARG_SUFFIX='_g' ;;
14188         (profile) DFT_ARG_SUFFIX='_p' ;;
14189         (shared)  DFT_ARG_SUFFIX=''   ;;
14190         esac
14191         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14192 echo "$as_me:14192: result: $DFT_ARG_SUFFIX" >&5
14193 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14194
14195 echo "$as_me:14195: checking default library-dependency suffix" >&5
14196 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14197
14198         case X$DFT_LWR_MODEL in
14199         (Xlibtool)
14200                 DFT_LIB_SUFFIX='.la'
14201                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14202                 ;;
14203         (Xdebug)
14204                 DFT_LIB_SUFFIX='_g.a'
14205                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14206                 ;;
14207         (Xprofile)
14208                 DFT_LIB_SUFFIX='_p.a'
14209                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14210                 ;;
14211         (Xshared)
14212                 case $cf_cv_system_name in
14213                 (aix[5-7]*)
14214                         DFT_LIB_SUFFIX='.so'
14215                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14216                         ;;
14217                 (cygwin*|msys*|mingw*)
14218                         DFT_LIB_SUFFIX='.dll'
14219                         DFT_DEP_SUFFIX='.dll.a'
14220                         ;;
14221                 (darwin*)
14222                         DFT_LIB_SUFFIX='.dylib'
14223                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14224                         ;;
14225                 (hpux*)
14226                         case $target in
14227                         (ia64*)
14228                                 DFT_LIB_SUFFIX='.so'
14229                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14230                                 ;;
14231                         (*)
14232                                 DFT_LIB_SUFFIX='.sl'
14233                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14234                                 ;;
14235                         esac
14236                         ;;
14237                 (*)
14238                         DFT_LIB_SUFFIX='.so'
14239                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14240                         ;;
14241                 esac
14242                 ;;
14243         (*)
14244                 DFT_LIB_SUFFIX='.a'
14245                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14246                 ;;
14247         esac
14248         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14249         then
14250                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14251                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14252         fi
14253 echo "$as_me:14253: result: $DFT_DEP_SUFFIX" >&5
14254 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14255
14256 echo "$as_me:14256: checking default object directory" >&5
14257 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14258
14259         case $DFT_LWR_MODEL in
14260         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14261         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14262         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14263         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14264         (shared)
14265                 case $cf_cv_system_name in
14266                 (cygwin|msys)
14267                         DFT_OBJ_SUBDIR='objects' ;;
14268                 (*)
14269                         DFT_OBJ_SUBDIR='obj_s' ;;
14270                 esac
14271         esac
14272 echo "$as_me:14272: result: $DFT_OBJ_SUBDIR" >&5
14273 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14274
14275 ### Set up low-level terminfo dependencies for makefiles.
14276
14277 if test "$DFT_LWR_MODEL" = shared ; then
14278         case $cf_cv_system_name in
14279         (cygwin*)
14280                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14281                 ;;
14282         (msys*)
14283                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14284                 ;;
14285         esac
14286 fi
14287
14288 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14289
14290 ### Construct the list of subdirectories for which we'll customize makefiles
14291 ### with the appropriate compile-rules.
14292
14293 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14294
14295 cat >>confdefs.h <<EOF
14296 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14297 EOF
14298
14299 ### Now that we're done running tests, add the compiler-warnings, if any
14300
14301 cf_fix_cppflags=no
14302 cf_new_cflags=
14303 cf_new_cppflags=
14304 cf_new_extra_cppflags=
14305
14306 for cf_add_cflags in $EXTRA_CFLAGS
14307 do
14308 case $cf_fix_cppflags in
14309 (no)
14310         case $cf_add_cflags in
14311         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14312                 case $cf_add_cflags in
14313                 (-D*)
14314                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14315
14316                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14317                                 && test -z "${cf_tst_cflags}" \
14318                                 && cf_fix_cppflags=yes
14319
14320                         if test $cf_fix_cppflags = yes ; then
14321                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14322                                 continue
14323                         elif test "${cf_tst_cflags}" = "\"'" ; then
14324                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14325                                 continue
14326                         fi
14327                         ;;
14328                 esac
14329                 case "$CPPFLAGS" in
14330                 (*$cf_add_cflags)
14331                         ;;
14332                 (*)
14333                         case $cf_add_cflags in
14334                         (-D*)
14335                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14336
14337 CPPFLAGS=`echo "$CPPFLAGS" | \
14338         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14339                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14340
14341                                 ;;
14342                         esac
14343                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
14344                         ;;
14345                 esac
14346                 ;;
14347         (*)
14348                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
14349                 ;;
14350         esac
14351         ;;
14352 (yes)
14353         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14354
14355         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14356
14357         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14358                 && test -z "${cf_tst_cflags}" \
14359                 && cf_fix_cppflags=no
14360         ;;
14361 esac
14362 done
14363
14364 if test -n "$cf_new_cflags" ; then
14365
14366         CFLAGS="$CFLAGS $cf_new_cflags"
14367 fi
14368
14369 if test -n "$cf_new_cppflags" ; then
14370
14371         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
14372 fi
14373
14374 if test -n "$cf_new_extra_cppflags" ; then
14375
14376         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
14377 fi
14378
14379 ################################################################################
14380
14381 TEST_ARG2=
14382
14383 TEST_LIBS2=
14384
14385 NCURSES_SHLIB2="sh -c"
14386
14387 ADA_SUBDIRS="include gen src doc"
14388 if test "x$cf_with_tests" != "xno" ; then
14389         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14390 fi
14391 for cf_dir in $ADA_SUBDIRS
14392 do
14393         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14394 done
14395
14396 NCURSES_TREE="#"
14397
14398 EXTERNAL_TREE=
14399
14400 # match layout used by make-tar.sh
14401 ADAHTML_DIR=../doc/ada
14402
14403 if test "x$cross_compiling" = xyes ; then
14404         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14405 else
14406         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14407 fi
14408
14409 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14410 ac_config_commands="$ac_config_commands default"
14411 cat >confcache <<\_ACEOF
14412 # This file is a shell script that caches the results of configure
14413 # tests run on this system so they can be shared between configure
14414 # scripts and configure runs, see configure's option --config-cache.
14415 # It is not useful on other systems.  If it contains results you don't
14416 # want to keep, you may remove or edit it.
14417 #
14418 # config.status only pays attention to the cache file if you give it
14419 # the --recheck option to rerun configure.
14420 #
14421 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14422 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14423 # following values.
14424
14425 _ACEOF
14426
14427 # The following way of writing the cache mishandles newlines in values,
14428 # but we know of no workaround that is simple, portable, and efficient.
14429 # So, don't put newlines in cache variables' values.
14430 # Ultrix sh set writes to stderr and can't be redirected directly,
14431 # and sets the high bit in the cache file unless we assign to the vars.
14432 {
14433   (set) 2>&1 |
14434     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14435     *ac_space=\ *)
14436       # `set' does not quote correctly, so add quotes (double-quote
14437       # substitution turns \\\\ into \\, and sed turns \\ into \).
14438       sed -n \
14439         "s/'/'\\\\''/g;
14440           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14441       ;;
14442     *)
14443       # `set' quotes correctly as required by POSIX, so do not add quotes.
14444       sed -n \
14445         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14446       ;;
14447     esac;
14448 } |
14449   sed '
14450      t clear
14451      : clear
14452      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14453      t end
14454      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14455      : end' >>confcache
14456 if cmp -s $cache_file confcache; then :; else
14457   if test -w $cache_file; then
14458     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14459     cat confcache >$cache_file
14460   else
14461     echo "not updating unwritable cache $cache_file"
14462   fi
14463 fi
14464 rm -f confcache
14465
14466 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14467 # Let make expand exec_prefix.
14468 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14469
14470 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14471 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14472 # trailing colons and then remove the whole line if VPATH becomes empty
14473 # (actually we leave an empty line to preserve line numbers).
14474 if test "x$srcdir" = x.; then
14475   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14476 s/:*\$(srcdir):*/:/;
14477 s/:*\${srcdir}:*/:/;
14478 s/:*@srcdir@:*/:/;
14479 s/^\([^=]*=[    ]*\):*/\1/;
14480 s/:*$//;
14481 s/^[^=]*=[      ]*$//;
14482 }'
14483 fi
14484
14485 DEFS=-DHAVE_CONFIG_H
14486
14487 : ${CONFIG_STATUS=./config.status}
14488 ac_clean_files_save=$ac_clean_files
14489 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14490 { echo "$as_me:14490: creating $CONFIG_STATUS" >&5
14491 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14492 cat >$CONFIG_STATUS <<_ACEOF
14493 #! $SHELL
14494 # Generated automatically by configure.
14495 # Run this file to recreate the current configuration.
14496 # Compiler output produced by configure, useful for debugging
14497 # configure, is in config.log if it exists.
14498
14499 debug=false
14500 SHELL=\${CONFIG_SHELL-$SHELL}
14501 ac_cs_invocation="\$0 \$@"
14502
14503 _ACEOF
14504
14505 cat >>$CONFIG_STATUS <<\_ACEOF
14506 # Be Bourne compatible
14507 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14508   emulate sh
14509   NULLCMD=:
14510 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14511   set -o posix
14512 fi
14513
14514 # Name of the executable.
14515 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14516
14517 if expr a : '\(a\)' >/dev/null 2>&1; then
14518   as_expr=expr
14519 else
14520   as_expr=false
14521 fi
14522
14523 rm -f conf$$ conf$$.exe conf$$.file
14524 echo >conf$$.file
14525 if ln -s conf$$.file conf$$ 2>/dev/null; then
14526   # We could just check for DJGPP; but this test a) works b) is more generic
14527   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14528   if test -f conf$$.exe; then
14529     # Don't use ln at all; we don't have any links
14530     as_ln_s='cp -p'
14531   else
14532     as_ln_s='ln -s'
14533   fi
14534 elif ln conf$$.file conf$$ 2>/dev/null; then
14535   as_ln_s=ln
14536 else
14537   as_ln_s='cp -p'
14538 fi
14539 rm -f conf$$ conf$$.exe conf$$.file
14540
14541 as_executable_p="test -f"
14542
14543 # Support unset when possible.
14544 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14545   as_unset=unset
14546 else
14547   as_unset=false
14548 fi
14549
14550 # NLS nuisances.
14551 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14552 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14553 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14554 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14555 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14556 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14557 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14558 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14559
14560 # IFS
14561 # We need space, tab and new line, in precisely that order.
14562 as_nl='
14563 '
14564 IFS="   $as_nl"
14565
14566 # CDPATH.
14567 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14568
14569 exec 6>&1
14570
14571 _ACEOF
14572
14573 # Files that config.status was made for.
14574 if test -n "$ac_config_files"; then
14575   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14576 fi
14577
14578 if test -n "$ac_config_headers"; then
14579   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14580 fi
14581
14582 if test -n "$ac_config_links"; then
14583   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14584 fi
14585
14586 if test -n "$ac_config_commands"; then
14587   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14588 fi
14589
14590 cat >>$CONFIG_STATUS <<\EOF
14591
14592 ac_cs_usage="\
14593 \`$as_me' instantiates files from templates according to the
14594 current configuration.
14595
14596 Usage: $0 [OPTIONS] [FILE]...
14597
14598   -h, --help       print this help, then exit
14599   -V, --version    print version number, then exit
14600   -d, --debug      don't remove temporary files
14601       --recheck    update $as_me by reconfiguring in the same conditions
14602   --file=FILE[:TEMPLATE]
14603                    instantiate the configuration file FILE
14604   --header=FILE[:TEMPLATE]
14605                    instantiate the configuration header FILE
14606
14607 Configuration files:
14608 $config_files
14609
14610 Configuration headers:
14611 $config_headers
14612
14613 Configuration commands:
14614 $config_commands
14615
14616 Report bugs to <dickey@invisible-island.net>."
14617 EOF
14618
14619 cat >>$CONFIG_STATUS <<EOF
14620 ac_cs_version="\\
14621 config.status
14622 configured by $0, generated by GNU Autoconf 2.52.20150926,
14623   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14624
14625 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14626 Free Software Foundation, Inc.
14627 This config.status script is free software; the Free Software Foundation
14628 gives unlimited permission to copy, distribute and modify it."
14629 srcdir=$srcdir
14630 INSTALL="$INSTALL"
14631 EOF
14632
14633 cat >>$CONFIG_STATUS <<\EOF
14634 # If no file are specified by the user, then we need to provide default
14635 # value.  By we need to know if files were specified by the user.
14636 ac_need_defaults=:
14637 while test $# != 0
14638 do
14639   case $1 in
14640   --*=*)
14641     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14642     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14643     shift
14644     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14645     shift
14646     ;;
14647   -*);;
14648   *) # This is not an option, so the user has probably given explicit
14649      # arguments.
14650      ac_need_defaults=false;;
14651   esac
14652
14653   case $1 in
14654   # Handling of the options.
14655 EOF
14656 cat >>$CONFIG_STATUS <<EOF
14657   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14658     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14659     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14660 EOF
14661 cat >>$CONFIG_STATUS <<\EOF
14662   --version | --vers* | -V )
14663     echo "$ac_cs_version"; exit 0 ;;
14664   --he | --h)
14665     # Conflict between --help and --header
14666     { { echo "$as_me:14666: error: ambiguous option: $1
14667 Try \`$0 --help' for more information." >&5
14668 echo "$as_me: error: ambiguous option: $1
14669 Try \`$0 --help' for more information." >&2;}
14670    { (exit 1); exit 1; }; };;
14671   --help | --hel | -h )
14672     echo "$ac_cs_usage"; exit 0 ;;
14673   --debug | --d* | -d )
14674     debug=: ;;
14675   --file | --fil | --fi | --f )
14676     shift
14677     CONFIG_FILES="$CONFIG_FILES $1"
14678     ac_need_defaults=false;;
14679   --header | --heade | --head | --hea )
14680     shift
14681     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14682     ac_need_defaults=false;;
14683
14684   # This is an error.
14685   -*) { { echo "$as_me:14685: error: unrecognized option: $1
14686 Try \`$0 --help' for more information." >&5
14687 echo "$as_me: error: unrecognized option: $1
14688 Try \`$0 --help' for more information." >&2;}
14689    { (exit 1); exit 1; }; } ;;
14690
14691   *) ac_config_targets="$ac_config_targets $1" ;;
14692
14693   esac
14694   shift
14695 done
14696
14697 exec 5>>config.log
14698 cat >&5 << _ACEOF
14699
14700 ## ----------------------- ##
14701 ## Running config.status.  ##
14702 ## ----------------------- ##
14703
14704 This file was extended by $as_me 2.52.20150926, executed with
14705   CONFIG_FILES    = $CONFIG_FILES
14706   CONFIG_HEADERS  = $CONFIG_HEADERS
14707   CONFIG_LINKS    = $CONFIG_LINKS
14708   CONFIG_COMMANDS = $CONFIG_COMMANDS
14709   > $ac_cs_invocation
14710 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14711
14712 _ACEOF
14713 EOF
14714
14715 cat >>$CONFIG_STATUS <<EOF
14716 #
14717 # INIT-COMMANDS section.
14718 #
14719
14720 ### Special initialization commands, used to pass information from the
14721 ### configuration-run into config.status
14722
14723 AWK="$AWK"
14724 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14725 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14726 LIB_NAME="$LIB_NAME"
14727 LIB_PREFIX="$LIB_PREFIX"
14728 LIB_SUFFIX="$LIB_SUFFIX"
14729 LN_S="$LN_S"
14730 NCURSES_MAJOR="$NCURSES_MAJOR"
14731 NCURSES_MINOR="$NCURSES_MINOR"
14732 NCURSES_PATCH="$NCURSES_PATCH"
14733 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14734 cf_cv_abi_version="$cf_cv_abi_version"
14735 cf_cv_rel_version="$cf_cv_rel_version"
14736 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14737 cf_cv_shared_soname='$cf_cv_shared_soname'
14738 cf_cv_shlib_version="$cf_cv_shlib_version"
14739 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14740 cf_cv_system_name="$cf_cv_system_name"
14741 host="$host"
14742 target="$target"
14743
14744 EOF
14745
14746 cat >>$CONFIG_STATUS <<\EOF
14747 for ac_config_target in $ac_config_targets
14748 do
14749   case "$ac_config_target" in
14750   # Handling of arguments.
14751   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14752   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14753   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14754   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14755   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14756   *) { { echo "$as_me:14756: error: invalid argument: $ac_config_target" >&5
14757 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14758    { (exit 1); exit 1; }; };;
14759   esac
14760 done
14761
14762 # If the user did not use the arguments to specify the items to instantiate,
14763 # then the envvar interface is used.  Set only those that are not.
14764 # We use the long form for the default assignment because of an extremely
14765 # bizarre bug on SunOS 4.1.3.
14766 if $ac_need_defaults; then
14767   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14768   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14769   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14770 fi
14771
14772 # Create a temporary directory, and hook for its removal unless debugging.
14773 $debug ||
14774 {
14775   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14776   trap '{ (exit 1); exit 1; }' 1 2 13 15
14777 }
14778
14779 # Create a (secure) tmp directory for tmp files.
14780 : ${TMPDIR=/tmp}
14781 {
14782   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14783   test -n "$tmp" && test -d "$tmp"
14784 }  ||
14785 {
14786   tmp=$TMPDIR/cs$$-$RANDOM
14787   (umask 077 && mkdir $tmp)
14788 } ||
14789 {
14790    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14791    { (exit 1); exit 1; }
14792 }
14793
14794 EOF
14795
14796 cat >>$CONFIG_STATUS <<EOF
14797
14798 #
14799 # CONFIG_FILES section.
14800 #
14801
14802 # No need to generate the scripts if there are no CONFIG_FILES.
14803 # This happens for instance when ./config.status config.h
14804 if test -n "\$CONFIG_FILES"; then
14805   # Protect against being on the right side of a sed subst in config.status.
14806   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14807    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14808 s,@SHELL@,$SHELL,;t t
14809 s,@exec_prefix@,$exec_prefix,;t t
14810 s,@prefix@,$prefix,;t t
14811 s,@program_transform_name@,$program_transform_name,;t t
14812 s,@bindir@,$bindir,;t t
14813 s,@sbindir@,$sbindir,;t t
14814 s,@libexecdir@,$libexecdir,;t t
14815 s,@datarootdir@,$datarootdir,;t t
14816 s,@datadir@,$datadir,;t t
14817 s,@sysconfdir@,$sysconfdir,;t t
14818 s,@sharedstatedir@,$sharedstatedir,;t t
14819 s,@localstatedir@,$localstatedir,;t t
14820 s,@libdir@,$libdir,;t t
14821 s,@includedir@,$includedir,;t t
14822 s,@oldincludedir@,$oldincludedir,;t t
14823 s,@infodir@,$infodir,;t t
14824 s,@mandir@,$mandir,;t t
14825 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14826 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14827 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14828 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14829 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14830 s,@build_alias@,$build_alias,;t t
14831 s,@host_alias@,$host_alias,;t t
14832 s,@target_alias@,$target_alias,;t t
14833 s,@ECHO_C@,$ECHO_C,;t t
14834 s,@ECHO_N@,$ECHO_N,;t t
14835 s,@ECHO_T@,$ECHO_T,;t t
14836 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14837 s,@DEFS@,$DEFS,;t t
14838 s,@LIBS@,$LIBS,;t t
14839 s,@top_builddir@,$top_builddir,;t t
14840 s,@build@,$build,;t t
14841 s,@build_cpu@,$build_cpu,;t t
14842 s,@build_vendor@,$build_vendor,;t t
14843 s,@build_os@,$build_os,;t t
14844 s,@host@,$host,;t t
14845 s,@host_cpu@,$host_cpu,;t t
14846 s,@host_vendor@,$host_vendor,;t t
14847 s,@host_os@,$host_os,;t t
14848 s,@target@,$target,;t t
14849 s,@target_cpu@,$target_cpu,;t t
14850 s,@target_vendor@,$target_vendor,;t t
14851 s,@target_os@,$target_os,;t t
14852 s,@CC@,$CC,;t t
14853 s,@CFLAGS@,$CFLAGS,;t t
14854 s,@LDFLAGS@,$LDFLAGS,;t t
14855 s,@CPPFLAGS@,$CPPFLAGS,;t t
14856 s,@ac_ct_CC@,$ac_ct_CC,;t t
14857 s,@EXEEXT@,$EXEEXT,;t t
14858 s,@OBJEXT@,$OBJEXT,;t t
14859 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14860 s,@CPP@,$CPP,;t t
14861 s,@AWK@,$AWK,;t t
14862 s,@EGREP@,$EGREP,;t t
14863 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14864 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14865 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14866 s,@LN_S@,$LN_S,;t t
14867 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14868 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14869 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14870 s,@SET_MAKE@,$SET_MAKE,;t t
14871 s,@CTAGS@,$CTAGS,;t t
14872 s,@ETAGS@,$ETAGS,;t t
14873 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14874 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14875 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14876 s,@RANLIB@,$RANLIB,;t t
14877 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14878 s,@LD@,$LD,;t t
14879 s,@ac_ct_LD@,$ac_ct_LD,;t t
14880 s,@AR@,$AR,;t t
14881 s,@ac_ct_AR@,$ac_ct_AR,;t t
14882 s,@ARFLAGS@,$ARFLAGS,;t t
14883 s,@DESTDIR@,$DESTDIR,;t t
14884 s,@BUILD_CC@,$BUILD_CC,;t t
14885 s,@BUILD_CPP@,$BUILD_CPP,;t t
14886 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14887 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14888 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14889 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14890 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14891 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14892 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14893 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14894 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14895 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14896 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14897 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14898 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14899 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14900 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14901 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14902 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14903 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14904 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14905 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14906 s,@CC_G_OPT@,$CC_G_OPT,;t t
14907 s,@LD_MODEL@,$LD_MODEL,;t t
14908 s,@shlibdir@,$shlibdir,;t t
14909 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14910 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14911 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14912 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14913 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14914 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14915 s,@LINK_PROGS@,$LINK_PROGS,;t t
14916 s,@LINK_TESTS@,$LINK_TESTS,;t t
14917 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14918 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14919 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14920 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14921 s,@RPATH_LIST@,$RPATH_LIST,;t t
14922 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14923 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14924 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14925 s,@PTHREAD@,$PTHREAD,;t t
14926 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14927 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14928 s,@ECHO_LT@,$ECHO_LT,;t t
14929 s,@ECHO_LD@,$ECHO_LD,;t t
14930 s,@RULE_CC@,$RULE_CC,;t t
14931 s,@SHOW_CC@,$SHOW_CC,;t t
14932 s,@ECHO_CC@,$ECHO_CC,;t t
14933 s,@ADAFLAGS@,$ADAFLAGS,;t t
14934 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14935 s,@ADA_TRACE@,$ADA_TRACE,;t t
14936 s,@gnat_exists@,$gnat_exists,;t t
14937 s,@M4_exists@,$M4_exists,;t t
14938 s,@cf_ada_make@,$cf_ada_make,;t t
14939 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14940 s,@cf_compile_generics@,$cf_compile_generics,;t t
14941 s,@cf_generic_objects@,$cf_generic_objects,;t t
14942 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14943 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14944 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14945 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14946 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14947 s,@cf_ada_package@,$cf_ada_package,;t t
14948 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14949 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14950 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
14951 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
14952 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
14953 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
14954 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
14955 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
14956 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
14957 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
14958 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
14959 s,@TEST_ARG2@,$TEST_ARG2,;t t
14960 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
14961 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
14962 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
14963 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
14964 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
14965 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
14966 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
14967 CEOF
14968
14969 EOF
14970
14971   cat >>$CONFIG_STATUS <<\EOF
14972   # Split the substitutions into bite-sized pieces for seds with
14973   # small command number limits, like on Digital OSF/1 and HP-UX.
14974   ac_max_sed_lines=48
14975   ac_sed_frag=1 # Number of current file.
14976   ac_beg=1 # First line for current file.
14977   ac_end=$ac_max_sed_lines # Line after last line for current file.
14978   ac_more_lines=:
14979   ac_sed_cmds=
14980   while $ac_more_lines; do
14981     if test $ac_beg -gt 1; then
14982       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14983     else
14984       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14985     fi
14986     if test ! -s $tmp/subs.frag; then
14987       ac_more_lines=false
14988     else
14989       # The purpose of the label and of the branching condition is to
14990       # speed up the sed processing (if there are no `@' at all, there
14991       # is no need to browse any of the substitutions).
14992       # These are the two extra sed commands mentioned above.
14993       (echo ':t
14994   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14995       # It is possible to make a multiline substitution using escaped newlines.
14996       # Ensure that we do not split the substitution between script fragments.
14997       ac_BEG=$ac_end
14998       ac_END=`expr $ac_end + $ac_max_sed_lines`
14999       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15000       if test -s $tmp/subs.next; then
15001         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15002         if test ! -s $tmp/subs.edit; then
15003           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15004           if test ! -s $tmp/subs.edit; then
15005             if test $ac_beg -gt 1; then
15006               ac_end=`expr $ac_end - 1`
15007               continue
15008             fi
15009           fi
15010         fi
15011       fi
15012
15013       if test -z "$ac_sed_cmds"; then
15014         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15015       else
15016         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15017       fi
15018       ac_sed_frag=`expr $ac_sed_frag + 1`
15019       ac_beg=$ac_end
15020       ac_end=`expr $ac_end + $ac_max_sed_lines`
15021     fi
15022   done
15023   if test -z "$ac_sed_cmds"; then
15024     ac_sed_cmds=cat
15025   fi
15026 fi # test -n "$CONFIG_FILES"
15027
15028 EOF
15029 cat >>$CONFIG_STATUS <<\EOF
15030 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15031   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15032   case $ac_file in
15033   - | *:- | *:-:* ) # input from stdin
15034         cat >$tmp/stdin
15035         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15036         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15037   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15038         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15039   * )   ac_file_in=$ac_file.in ;;
15040   esac
15041
15042   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15043   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15044          X"$ac_file" : 'X\(//\)[^/]' \| \
15045          X"$ac_file" : 'X\(//\)$' \| \
15046          X"$ac_file" : 'X\(/\)' \| \
15047          .     : '\(.\)' 2>/dev/null ||
15048 echo X"$ac_file" |
15049     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15050           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15051           /^X\(\/\/\)$/{ s//\1/; q; }
15052           /^X\(\/\).*/{ s//\1/; q; }
15053           s/.*/./; q'`
15054   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15055     { case "$ac_dir" in
15056   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15057   *)                      as_incr_dir=.;;
15058 esac
15059 as_dummy="$ac_dir"
15060 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15061   case $as_mkdir_dir in
15062     # Skip DOS drivespec
15063     ?:) as_incr_dir=$as_mkdir_dir ;;
15064     *)
15065       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15066       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15067     ;;
15068   esac
15069 done; }
15070
15071     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15072     # A "../" for each directory in $ac_dir_suffix.
15073     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15074   else
15075     ac_dir_suffix= ac_dots=
15076   fi
15077
15078   case $srcdir in
15079   .)  ac_srcdir=.
15080       if test -z "$ac_dots"; then
15081          ac_top_srcdir=.
15082       else
15083          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15084       fi ;;
15085   [\\/]* | ?:[\\/]* )
15086       ac_srcdir=$srcdir$ac_dir_suffix;
15087       ac_top_srcdir=$srcdir ;;
15088   *) # Relative path.
15089     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15090     ac_top_srcdir=$ac_dots$srcdir ;;
15091   esac
15092
15093   case $INSTALL in
15094   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15095   *) ac_INSTALL=$ac_dots$INSTALL ;;
15096   esac
15097
15098   if test x"$ac_file" != x-; then
15099     { echo "$as_me:15099: creating $ac_file" >&5
15100 echo "$as_me: creating $ac_file" >&6;}
15101     rm -f "$ac_file"
15102   fi
15103   # Let's still pretend it is `configure' which instantiates (i.e., don't
15104   # use $as_me), people would be surprised to read:
15105   #    /* config.h.  Generated automatically by config.status.  */
15106   configure_input="Generated automatically from `echo $ac_file_in |
15107                                                  sed 's,.*/,,'` by configure."
15108
15109   # First look for the input files in the build tree, otherwise in the
15110   # src tree.
15111   ac_file_inputs=`IFS=:
15112     for f in $ac_file_in; do
15113       case $f in
15114       -) echo $tmp/stdin ;;
15115       [\\/$]*)
15116          # Absolute (can't be DOS-style, as IFS=:)
15117          test -f "$f" || { { echo "$as_me:15117: error: cannot find input file: $f" >&5
15118 echo "$as_me: error: cannot find input file: $f" >&2;}
15119    { (exit 1); exit 1; }; }
15120          echo $f;;
15121       *) # Relative
15122          if test -f "$f"; then
15123            # Build tree
15124            echo $f
15125          elif test -f "$srcdir/$f"; then
15126            # Source tree
15127            echo $srcdir/$f
15128          else
15129            # /dev/null tree
15130            { { echo "$as_me:15130: error: cannot find input file: $f" >&5
15131 echo "$as_me: error: cannot find input file: $f" >&2;}
15132    { (exit 1); exit 1; }; }
15133          fi;;
15134       esac
15135     done` || { (exit 1); exit 1; }
15136 EOF
15137 cat >>$CONFIG_STATUS <<\EOF
15138   ac_warn_datarootdir=no
15139   if test x"$ac_file" != x-; then
15140     for ac_item in $ac_file_inputs
15141     do
15142       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15143       if test -n "$ac_seen"; then
15144         ac_used=`grep '@datarootdir@' $ac_item`
15145         if test -z "$ac_used"; then
15146           { echo "$as_me:15146: WARNING: datarootdir was used implicitly but not set:
15147 $ac_seen" >&5
15148 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15149 $ac_seen" >&2;}
15150           ac_warn_datarootdir=yes
15151         fi
15152       fi
15153       ac_seen=`grep '${datarootdir}' $ac_item`
15154       if test -n "$ac_seen"; then
15155         { echo "$as_me:15155: WARNING: datarootdir was used explicitly but not set:
15156 $ac_seen" >&5
15157 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15158 $ac_seen" >&2;}
15159         ac_warn_datarootdir=yes
15160       fi
15161     done
15162   fi
15163
15164 if test "x$ac_warn_datarootdir" = xyes; then
15165   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15166 fi
15167
15168 EOF
15169 cat >>$CONFIG_STATUS <<EOF
15170   sed "$ac_vpsub
15171 $extrasub
15172 EOF
15173 cat >>$CONFIG_STATUS <<\EOF
15174 :t
15175 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15176 s,@configure_input@,$configure_input,;t t
15177 s,@srcdir@,$ac_srcdir,;t t
15178 s,@top_srcdir@,$ac_top_srcdir,;t t
15179 s,@INSTALL@,$ac_INSTALL,;t t
15180 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15181   rm -f $tmp/stdin
15182   if test x"$ac_file" != x-; then
15183     cp $tmp/out $ac_file
15184
15185     for ac_name in prefix exec_prefix datarootdir
15186     do
15187         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15188         if test -n "$ac_seen"; then
15189             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15190             if test -z "$ac_init"; then
15191               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15192               { echo "$as_me:15192: WARNING: Variable $ac_name is used but was not set:
15193 $ac_seen" >&5
15194 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15195 $ac_seen" >&2;}
15196             fi
15197         fi
15198     done
15199     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15200     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15201     if test -s $tmp/out; then
15202       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15203       { echo "$as_me:15203: WARNING: Some variables may not be substituted:
15204 $ac_seen" >&5
15205 echo "$as_me: WARNING: Some variables may not be substituted:
15206 $ac_seen" >&2;}
15207     fi
15208   else
15209     cat $tmp/out
15210   fi
15211   rm -f $tmp/out
15212
15213 done
15214 EOF
15215 cat >>$CONFIG_STATUS <<\EOF
15216
15217 #
15218 # CONFIG_HEADER section.
15219 #
15220
15221 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15222 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15223 #
15224 # ac_d sets the value in "#define NAME VALUE" lines.
15225 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15226 ac_dB='[        ].*$,\1#\2'
15227 ac_dC=' '
15228 ac_dD=',;t'
15229 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15230 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15231 ac_iB='\([      ]\),\1#\2define\3'
15232 ac_iC=' '
15233 ac_iD='\4,;t'
15234 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15235 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15236 ac_uB='$,\1#\2define\3'
15237 ac_uC=' '
15238 ac_uD=',;t'
15239
15240 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15241   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15242   case $ac_file in
15243   - | *:- | *:-:* ) # input from stdin
15244         cat >$tmp/stdin
15245         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15246         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15247   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15248         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15249   * )   ac_file_in=$ac_file.in ;;
15250   esac
15251
15252   test x"$ac_file" != x- && { echo "$as_me:15252: creating $ac_file" >&5
15253 echo "$as_me: creating $ac_file" >&6;}
15254
15255   # First look for the input files in the build tree, otherwise in the
15256   # src tree.
15257   ac_file_inputs=`IFS=:
15258     for f in $ac_file_in; do
15259       case $f in
15260       -) echo $tmp/stdin ;;
15261       [\\/$]*)
15262          # Absolute (can't be DOS-style, as IFS=:)
15263          test -f "$f" || { { echo "$as_me:15263: error: cannot find input file: $f" >&5
15264 echo "$as_me: error: cannot find input file: $f" >&2;}
15265    { (exit 1); exit 1; }; }
15266          echo $f;;
15267       *) # Relative
15268          if test -f "$f"; then
15269            # Build tree
15270            echo $f
15271          elif test -f "$srcdir/$f"; then
15272            # Source tree
15273            echo $srcdir/$f
15274          else
15275            # /dev/null tree
15276            { { echo "$as_me:15276: error: cannot find input file: $f" >&5
15277 echo "$as_me: error: cannot find input file: $f" >&2;}
15278    { (exit 1); exit 1; }; }
15279          fi;;
15280       esac
15281     done` || { (exit 1); exit 1; }
15282   # Remove the trailing spaces.
15283   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15284
15285 EOF
15286
15287 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15288 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15289 # be either 'cat' or 'sort'.
15290 cat confdefs.h | uniq >conftest.vals
15291
15292 # Break up conftest.vals because some shells have a limit on
15293 # the size of here documents, and old seds have small limits too.
15294
15295 rm -f conftest.tail
15296 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15297 while grep . conftest.vals >/dev/null
15298 do
15299   # Write chunks of a limited-size here document to conftest.frag.
15300   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15301   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15302   echo 'CEOF' >> $CONFIG_STATUS
15303   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15304   rm -f conftest.vals
15305   mv conftest.tail conftest.vals
15306 done
15307 rm -f conftest.vals
15308
15309 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15310 # marker @DEFS@.
15311 echo '  cat >> conftest.edit <<CEOF
15312 /@DEFS@/r conftest.frag
15313 /@DEFS@/d
15314 CEOF
15315 sed -f conftest.edit $tmp/in > $tmp/out
15316 rm -f $tmp/in
15317 mv $tmp/out $tmp/in
15318 rm -f conftest.edit conftest.frag
15319 ' >> $CONFIG_STATUS
15320
15321 cat >>$CONFIG_STATUS <<\EOF
15322   # Let's still pretend it is `configure' which instantiates (i.e., don't
15323   # use $as_me), people would be surprised to read:
15324   #    /* config.h.  Generated automatically by config.status.  */
15325   if test x"$ac_file" = x-; then
15326     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15327   else
15328     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15329   fi
15330   cat $tmp/in >>$tmp/config.h
15331   rm -f $tmp/in
15332   if test x"$ac_file" != x-; then
15333     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15334       { echo "$as_me:15334: $ac_file is unchanged" >&5
15335 echo "$as_me: $ac_file is unchanged" >&6;}
15336     else
15337       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15338          X"$ac_file" : 'X\(//\)[^/]' \| \
15339          X"$ac_file" : 'X\(//\)$' \| \
15340          X"$ac_file" : 'X\(/\)' \| \
15341          .     : '\(.\)' 2>/dev/null ||
15342 echo X"$ac_file" |
15343     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15344           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15345           /^X\(\/\/\)$/{ s//\1/; q; }
15346           /^X\(\/\).*/{ s//\1/; q; }
15347           s/.*/./; q'`
15348       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15349         { case "$ac_dir" in
15350   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15351   *)                      as_incr_dir=.;;
15352 esac
15353 as_dummy="$ac_dir"
15354 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15355   case $as_mkdir_dir in
15356     # Skip DOS drivespec
15357     ?:) as_incr_dir=$as_mkdir_dir ;;
15358     *)
15359       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15360       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15361     ;;
15362   esac
15363 done; }
15364
15365       fi
15366       rm -f $ac_file
15367       mv $tmp/config.h $ac_file
15368     fi
15369   else
15370     cat $tmp/config.h
15371     rm -f $tmp/config.h
15372   fi
15373 done
15374 EOF
15375 cat >>$CONFIG_STATUS <<\EOF
15376 #
15377 # CONFIG_COMMANDS section.
15378 #
15379 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15380   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15381   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15382
15383   case $ac_dest in
15384     default )
15385 if test -z "$USE_OLD_MAKERULES" ; then
15386         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15387 fi
15388  ;;
15389   esac
15390 done
15391 EOF
15392
15393 cat >>$CONFIG_STATUS <<\EOF
15394
15395 { (exit 0); exit 0; }
15396 EOF
15397 chmod +x $CONFIG_STATUS
15398 ac_clean_files=$ac_clean_files_save
15399
15400 # configure is writing to config.log, and then calls config.status.
15401 # config.status does its own redirection, appending to config.log.
15402 # Unfortunately, on DOS this fails, as config.log is still kept open
15403 # by configure, so config.status won't be able to write to it; its
15404 # output is simply discarded.  So we exec the FD to /dev/null,
15405 # effectively closing config.log, so it can be properly (re)opened and
15406 # appended to by config.status.  When coming back to configure, we
15407 # need to make the FD available again.
15408 if test "$no_create" != yes; then
15409   ac_cs_success=:
15410   exec 5>/dev/null
15411   $SHELL $CONFIG_STATUS || ac_cs_success=false
15412   exec 5>>config.log
15413   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15414   # would make configure fail if this is the last instruction.
15415   $ac_cs_success || { (exit 1); exit 1; }
15416 fi
15417 ${MAKE:-make} preinstall