]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20151101
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.61 .
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 (*[\ \  ]-[IUD]*)
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/[    ].*//'`
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         ;;
1922 (*)
1923         echo "$as_me:1923: result: ok" >&5
1924 echo "${ECHO_T}ok" >&6
1925         ;;
1926 esac
1927
1928 ac_ext=c
1929 ac_cpp='$CPP $CPPFLAGS'
1930 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1931 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1932 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1933 ac_main_return=return
1934 echo "$as_me:1934: checking how to run the C preprocessor" >&5
1935 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1936 # On Suns, sometimes $CPP names a directory.
1937 if test -n "$CPP" && test -d "$CPP"; then
1938   CPP=
1939 fi
1940 if test -z "$CPP"; then
1941   if test "${ac_cv_prog_CPP+set}" = set; then
1942   echo $ECHO_N "(cached) $ECHO_C" >&6
1943 else
1944       # Double quotes because CPP needs to be expanded
1945     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1946     do
1947       ac_preproc_ok=false
1948 for ac_c_preproc_warn_flag in '' yes
1949 do
1950   # Use a header file that comes with gcc, so configuring glibc
1951   # with a fresh cross-compiler works.
1952   # On the NeXT, cc -E runs the code through the compiler's parser,
1953   # not just through cpp. "Syntax error" is here to catch this case.
1954   cat >conftest.$ac_ext <<_ACEOF
1955 #line 1955 "configure"
1956 #include "confdefs.h"
1957 #include <assert.h>
1958                      Syntax error
1959 _ACEOF
1960 if { (eval echo "$as_me:1960: \"$ac_cpp conftest.$ac_ext\"") >&5
1961   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1962   ac_status=$?
1963   egrep -v '^ *\+' conftest.er1 >conftest.err
1964   rm -f conftest.er1
1965   cat conftest.err >&5
1966   echo "$as_me:1966: \$? = $ac_status" >&5
1967   (exit $ac_status); } >/dev/null; then
1968   if test -s conftest.err; then
1969     ac_cpp_err=$ac_c_preproc_warn_flag
1970   else
1971     ac_cpp_err=
1972   fi
1973 else
1974   ac_cpp_err=yes
1975 fi
1976 if test -z "$ac_cpp_err"; then
1977   :
1978 else
1979   echo "$as_me: failed program was:" >&5
1980   cat conftest.$ac_ext >&5
1981   # Broken: fails on valid input.
1982 continue
1983 fi
1984 rm -f conftest.err conftest.$ac_ext
1985
1986   # OK, works on sane cases.  Now check whether non-existent headers
1987   # can be detected and how.
1988   cat >conftest.$ac_ext <<_ACEOF
1989 #line 1989 "configure"
1990 #include "confdefs.h"
1991 #include <ac_nonexistent.h>
1992 _ACEOF
1993 if { (eval echo "$as_me:1993: \"$ac_cpp conftest.$ac_ext\"") >&5
1994   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1995   ac_status=$?
1996   egrep -v '^ *\+' conftest.er1 >conftest.err
1997   rm -f conftest.er1
1998   cat conftest.err >&5
1999   echo "$as_me:1999: \$? = $ac_status" >&5
2000   (exit $ac_status); } >/dev/null; then
2001   if test -s conftest.err; then
2002     ac_cpp_err=$ac_c_preproc_warn_flag
2003   else
2004     ac_cpp_err=
2005   fi
2006 else
2007   ac_cpp_err=yes
2008 fi
2009 if test -z "$ac_cpp_err"; then
2010   # Broken: success on invalid input.
2011 continue
2012 else
2013   echo "$as_me: failed program was:" >&5
2014   cat conftest.$ac_ext >&5
2015   # Passes both tests.
2016 ac_preproc_ok=:
2017 break
2018 fi
2019 rm -f conftest.err conftest.$ac_ext
2020
2021 done
2022 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2023 rm -f conftest.err conftest.$ac_ext
2024 if $ac_preproc_ok; then
2025   break
2026 fi
2027
2028     done
2029     ac_cv_prog_CPP=$CPP
2030
2031 fi
2032   CPP=$ac_cv_prog_CPP
2033 else
2034   ac_cv_prog_CPP=$CPP
2035 fi
2036 echo "$as_me:2036: result: $CPP" >&5
2037 echo "${ECHO_T}$CPP" >&6
2038 ac_preproc_ok=false
2039 for ac_c_preproc_warn_flag in '' yes
2040 do
2041   # Use a header file that comes with gcc, so configuring glibc
2042   # with a fresh cross-compiler works.
2043   # On the NeXT, cc -E runs the code through the compiler's parser,
2044   # not just through cpp. "Syntax error" is here to catch this case.
2045   cat >conftest.$ac_ext <<_ACEOF
2046 #line 2046 "configure"
2047 #include "confdefs.h"
2048 #include <assert.h>
2049                      Syntax error
2050 _ACEOF
2051 if { (eval echo "$as_me:2051: \"$ac_cpp conftest.$ac_ext\"") >&5
2052   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2053   ac_status=$?
2054   egrep -v '^ *\+' conftest.er1 >conftest.err
2055   rm -f conftest.er1
2056   cat conftest.err >&5
2057   echo "$as_me:2057: \$? = $ac_status" >&5
2058   (exit $ac_status); } >/dev/null; then
2059   if test -s conftest.err; then
2060     ac_cpp_err=$ac_c_preproc_warn_flag
2061   else
2062     ac_cpp_err=
2063   fi
2064 else
2065   ac_cpp_err=yes
2066 fi
2067 if test -z "$ac_cpp_err"; then
2068   :
2069 else
2070   echo "$as_me: failed program was:" >&5
2071   cat conftest.$ac_ext >&5
2072   # Broken: fails on valid input.
2073 continue
2074 fi
2075 rm -f conftest.err conftest.$ac_ext
2076
2077   # OK, works on sane cases.  Now check whether non-existent headers
2078   # can be detected and how.
2079   cat >conftest.$ac_ext <<_ACEOF
2080 #line 2080 "configure"
2081 #include "confdefs.h"
2082 #include <ac_nonexistent.h>
2083 _ACEOF
2084 if { (eval echo "$as_me:2084: \"$ac_cpp conftest.$ac_ext\"") >&5
2085   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2086   ac_status=$?
2087   egrep -v '^ *\+' conftest.er1 >conftest.err
2088   rm -f conftest.er1
2089   cat conftest.err >&5
2090   echo "$as_me:2090: \$? = $ac_status" >&5
2091   (exit $ac_status); } >/dev/null; then
2092   if test -s conftest.err; then
2093     ac_cpp_err=$ac_c_preproc_warn_flag
2094   else
2095     ac_cpp_err=
2096   fi
2097 else
2098   ac_cpp_err=yes
2099 fi
2100 if test -z "$ac_cpp_err"; then
2101   # Broken: success on invalid input.
2102 continue
2103 else
2104   echo "$as_me: failed program was:" >&5
2105   cat conftest.$ac_ext >&5
2106   # Passes both tests.
2107 ac_preproc_ok=:
2108 break
2109 fi
2110 rm -f conftest.err conftest.$ac_ext
2111
2112 done
2113 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2114 rm -f conftest.err conftest.$ac_ext
2115 if $ac_preproc_ok; then
2116   :
2117 else
2118   { { echo "$as_me:2118: error: C preprocessor \"$CPP\" fails sanity check" >&5
2119 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2120    { (exit 1); exit 1; }; }
2121 fi
2122
2123 ac_ext=c
2124 ac_cpp='$CPP $CPPFLAGS'
2125 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2126 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2127 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2128 ac_main_return=return
2129
2130 if test $ac_cv_c_compiler_gnu = yes; then
2131     echo "$as_me:2131: checking whether $CC needs -traditional" >&5
2132 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2133 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2134   echo $ECHO_N "(cached) $ECHO_C" >&6
2135 else
2136     ac_pattern="Autoconf.*'x'"
2137   cat >conftest.$ac_ext <<_ACEOF
2138 #line 2138 "configure"
2139 #include "confdefs.h"
2140 #include <sgtty.h>
2141 int Autoconf = TIOCGETP;
2142 _ACEOF
2143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2144   egrep "$ac_pattern" >/dev/null 2>&1; then
2145   ac_cv_prog_gcc_traditional=yes
2146 else
2147   ac_cv_prog_gcc_traditional=no
2148 fi
2149 rm -rf conftest*
2150
2151   if test $ac_cv_prog_gcc_traditional = no; then
2152     cat >conftest.$ac_ext <<_ACEOF
2153 #line 2153 "configure"
2154 #include "confdefs.h"
2155 #include <termio.h>
2156 int Autoconf = TCGETA;
2157 _ACEOF
2158 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2159   egrep "$ac_pattern" >/dev/null 2>&1; then
2160   ac_cv_prog_gcc_traditional=yes
2161 fi
2162 rm -rf conftest*
2163
2164   fi
2165 fi
2166 echo "$as_me:2166: result: $ac_cv_prog_gcc_traditional" >&5
2167 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2168   if test $ac_cv_prog_gcc_traditional = yes; then
2169     CC="$CC -traditional"
2170   fi
2171 fi
2172
2173 echo "$as_me:2173: checking whether $CC understands -c and -o together" >&5
2174 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2175 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2176   echo $ECHO_N "(cached) $ECHO_C" >&6
2177 else
2178
2179 cat > conftest.$ac_ext <<CF_EOF
2180 #include <stdio.h>
2181 int main()
2182 {
2183         ${cf_cv_main_return:-return}(0);
2184 }
2185 CF_EOF
2186 # We do the test twice because some compilers refuse to overwrite an
2187 # existing .o file with -o, though they will create one.
2188 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2189 if { (eval echo "$as_me:2189: \"$ac_try\"") >&5
2190   (eval $ac_try) 2>&5
2191   ac_status=$?
2192   echo "$as_me:2192: \$? = $ac_status" >&5
2193   (exit $ac_status); } &&
2194   test -f conftest2.$ac_objext && { (eval echo "$as_me:2194: \"$ac_try\"") >&5
2195   (eval $ac_try) 2>&5
2196   ac_status=$?
2197   echo "$as_me:2197: \$? = $ac_status" >&5
2198   (exit $ac_status); };
2199 then
2200   eval cf_cv_prog_CC_c_o=yes
2201 else
2202   eval cf_cv_prog_CC_c_o=no
2203 fi
2204 rm -rf conftest*
2205
2206 fi
2207 if test $cf_cv_prog_CC_c_o = yes; then
2208   echo "$as_me:2208: result: yes" >&5
2209 echo "${ECHO_T}yes" >&6
2210 else
2211   echo "$as_me:2211: result: no" >&5
2212 echo "${ECHO_T}no" >&6
2213 fi
2214
2215 test "$program_prefix" != NONE &&
2216   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2217 # Use a double $ so make ignores it.
2218 test "$program_suffix" != NONE &&
2219   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2220 # Double any \ or $.  echo might interpret backslashes.
2221 # By default was `s,x,x', remove it if useless.
2222 cat <<\_ACEOF >conftest.sed
2223 s/[\\$]/&&/g;s/;s,x,x,$//
2224 _ACEOF
2225 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2226 rm conftest.sed
2227
2228 for ac_prog in mawk gawk nawk awk
2229 do
2230   # Extract the first word of "$ac_prog", so it can be a program name with args.
2231 set dummy $ac_prog; ac_word=$2
2232 echo "$as_me:2232: checking for $ac_word" >&5
2233 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2234 if test "${ac_cv_prog_AWK+set}" = set; then
2235   echo $ECHO_N "(cached) $ECHO_C" >&6
2236 else
2237   if test -n "$AWK"; then
2238   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2239 else
2240   ac_save_IFS=$IFS; IFS=$ac_path_separator
2241 ac_dummy="$PATH"
2242 for ac_dir in $ac_dummy; do
2243   IFS=$ac_save_IFS
2244   test -z "$ac_dir" && ac_dir=.
2245   $as_executable_p "$ac_dir/$ac_word" || continue
2246 ac_cv_prog_AWK="$ac_prog"
2247 echo "$as_me:2247: found $ac_dir/$ac_word" >&5
2248 break
2249 done
2250
2251 fi
2252 fi
2253 AWK=$ac_cv_prog_AWK
2254 if test -n "$AWK"; then
2255   echo "$as_me:2255: result: $AWK" >&5
2256 echo "${ECHO_T}$AWK" >&6
2257 else
2258   echo "$as_me:2258: result: no" >&5
2259 echo "${ECHO_T}no" >&6
2260 fi
2261
2262   test -n "$AWK" && break
2263 done
2264
2265 test -z "$AWK" && { { echo "$as_me:2265: error: No awk program found" >&5
2266 echo "$as_me: error: No awk program found" >&2;}
2267    { (exit 1); exit 1; }; }
2268
2269 echo "$as_me:2269: checking for egrep" >&5
2270 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2271 if test "${ac_cv_prog_egrep+set}" = set; then
2272   echo $ECHO_N "(cached) $ECHO_C" >&6
2273 else
2274   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2275                 then ac_cv_prog_egrep='grep -E'
2276                 else ac_cv_prog_egrep='egrep'
2277         fi
2278 fi
2279 echo "$as_me:2279: result: $ac_cv_prog_egrep" >&5
2280 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2281         EGREP=$ac_cv_prog_egrep
2282
2283         test -z "$EGREP" && { { echo "$as_me:2283: error: No egrep program found" >&5
2284 echo "$as_me: error: No egrep program found" >&2;}
2285    { (exit 1); exit 1; }; }
2286
2287 # Find a good install program.  We prefer a C program (faster),
2288 # so one script is as good as another.  But avoid the broken or
2289 # incompatible versions:
2290 # SysV /etc/install, /usr/sbin/install
2291 # SunOS /usr/etc/install
2292 # IRIX /sbin/install
2293 # AIX /bin/install
2294 # AmigaOS /C/install, which installs bootblocks on floppy discs
2295 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2296 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2297 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2298 # ./install, which can be erroneously created by make from ./install.sh.
2299 echo "$as_me:2299: checking for a BSD compatible install" >&5
2300 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2301 if test -z "$INSTALL"; then
2302 if test "${ac_cv_path_install+set}" = set; then
2303   echo $ECHO_N "(cached) $ECHO_C" >&6
2304 else
2305     ac_save_IFS=$IFS; IFS=$ac_path_separator
2306   for ac_dir in $PATH; do
2307     IFS=$ac_save_IFS
2308     # Account for people who put trailing slashes in PATH elements.
2309     case $ac_dir/ in
2310     / | ./ | .// | /cC/* \
2311     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2312     | /usr/ucb/* ) ;;
2313     *)
2314       # OSF1 and SCO ODT 3.0 have their own names for install.
2315       # Don't use installbsd from OSF since it installs stuff as root
2316       # by default.
2317       for ac_prog in ginstall scoinst install; do
2318         if $as_executable_p "$ac_dir/$ac_prog"; then
2319           if test $ac_prog = install &&
2320             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2321             # AIX install.  It has an incompatible calling convention.
2322             :
2323           elif test $ac_prog = install &&
2324             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2325             # program-specific install script used by HP pwplus--don't use.
2326             :
2327           else
2328             ac_cv_path_install="$ac_dir/$ac_prog -c"
2329             break 2
2330           fi
2331         fi
2332       done
2333       ;;
2334     esac
2335   done
2336
2337 fi
2338   if test "${ac_cv_path_install+set}" = set; then
2339     INSTALL=$ac_cv_path_install
2340   else
2341     # As a last resort, use the slow shell script.  We don't cache a
2342     # path for INSTALL within a source directory, because that will
2343     # break other packages using the cache if that directory is
2344     # removed, or if the path is relative.
2345     INSTALL=$ac_install_sh
2346   fi
2347 fi
2348 echo "$as_me:2348: result: $INSTALL" >&5
2349 echo "${ECHO_T}$INSTALL" >&6
2350
2351 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2352 # It thinks the first close brace ends the variable substitution.
2353 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2354
2355 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2356
2357 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2358
2359 echo "$as_me:2359: checking whether ln -s works" >&5
2360 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2361 LN_S=$as_ln_s
2362 if test "$LN_S" = "ln -s"; then
2363   echo "$as_me:2363: result: yes" >&5
2364 echo "${ECHO_T}yes" >&6
2365 else
2366   echo "$as_me:2366: result: no, using $LN_S" >&5
2367 echo "${ECHO_T}no, using $LN_S" >&6
2368 fi
2369
2370 echo "$as_me:2370: checking if $LN_S -f options work" >&5
2371 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2372
2373 rm -f conf$$.src conf$$dst
2374 echo >conf$$.dst
2375 echo first >conf$$.src
2376 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2377         cf_prog_ln_sf=yes
2378 else
2379         cf_prog_ln_sf=no
2380 fi
2381 rm -f conf$$.dst conf$$src
2382 echo "$as_me:2382: result: $cf_prog_ln_sf" >&5
2383 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2384
2385 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2386
2387 echo "$as_me:2387: checking for long file names" >&5
2388 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2389 if test "${ac_cv_sys_long_file_names+set}" = set; then
2390   echo $ECHO_N "(cached) $ECHO_C" >&6
2391 else
2392   ac_cv_sys_long_file_names=yes
2393 # Test for long file names in all the places we know might matter:
2394 #      .                the current directory, where building will happen
2395 #      $prefix/lib      where we will be installing things
2396 #      $exec_prefix/lib likewise
2397 # eval it to expand exec_prefix.
2398 #      $TMPDIR          if set, where it might want to write temporary files
2399 # if $TMPDIR is not set:
2400 #      /tmp             where it might want to write temporary files
2401 #      /var/tmp         likewise
2402 #      /usr/tmp         likewise
2403 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2404   ac_tmpdirs=$TMPDIR
2405 else
2406   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2407 fi
2408 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2409   test -d $ac_dir || continue
2410   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2411   ac_xdir=$ac_dir/cf$$
2412   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2413   ac_tf1=$ac_xdir/conftest9012345
2414   ac_tf2=$ac_xdir/conftest9012346
2415   (echo 1 >$ac_tf1) 2>/dev/null
2416   (echo 2 >$ac_tf2) 2>/dev/null
2417   ac_val=`cat $ac_tf1 2>/dev/null`
2418   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2419     ac_cv_sys_long_file_names=no
2420     rm -rf $ac_xdir 2>/dev/null
2421     break
2422   fi
2423   rm -rf $ac_xdir 2>/dev/null
2424 done
2425 fi
2426 echo "$as_me:2426: result: $ac_cv_sys_long_file_names" >&5
2427 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2428 if test $ac_cv_sys_long_file_names = yes; then
2429
2430 cat >>confdefs.h <<\EOF
2431 #define HAVE_LONG_FILE_NAMES 1
2432 EOF
2433
2434 fi
2435
2436 # if we find pkg-config, check if we should install the ".pc" files.
2437
2438 echo "$as_me:2438: checking if you want to use pkg-config" >&5
2439 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2440
2441 # Check whether --with-pkg-config or --without-pkg-config was given.
2442 if test "${with_pkg_config+set}" = set; then
2443   withval="$with_pkg_config"
2444   cf_pkg_config=$withval
2445 else
2446   cf_pkg_config=yes
2447 fi;
2448 echo "$as_me:2448: result: $cf_pkg_config" >&5
2449 echo "${ECHO_T}$cf_pkg_config" >&6
2450
2451 case $cf_pkg_config in
2452 (no)
2453         PKG_CONFIG=none
2454         ;;
2455 (yes)
2456
2457 if test -n "$ac_tool_prefix"; then
2458   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2459 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2460 echo "$as_me:2460: checking for $ac_word" >&5
2461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2462 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2463   echo $ECHO_N "(cached) $ECHO_C" >&6
2464 else
2465   case $PKG_CONFIG in
2466   [\\/]* | ?:[\\/]*)
2467   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2468   ;;
2469   *)
2470   ac_save_IFS=$IFS; IFS=$ac_path_separator
2471 ac_dummy="$PATH"
2472 for ac_dir in $ac_dummy; do
2473   IFS=$ac_save_IFS
2474   test -z "$ac_dir" && ac_dir=.
2475   if $as_executable_p "$ac_dir/$ac_word"; then
2476    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2477    echo "$as_me:2477: found $ac_dir/$ac_word" >&5
2478    break
2479 fi
2480 done
2481
2482   ;;
2483 esac
2484 fi
2485 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2486
2487 if test -n "$PKG_CONFIG"; then
2488   echo "$as_me:2488: result: $PKG_CONFIG" >&5
2489 echo "${ECHO_T}$PKG_CONFIG" >&6
2490 else
2491   echo "$as_me:2491: result: no" >&5
2492 echo "${ECHO_T}no" >&6
2493 fi
2494
2495 fi
2496 if test -z "$ac_cv_path_PKG_CONFIG"; then
2497   ac_pt_PKG_CONFIG=$PKG_CONFIG
2498   # Extract the first word of "pkg-config", so it can be a program name with args.
2499 set dummy pkg-config; ac_word=$2
2500 echo "$as_me:2500: checking for $ac_word" >&5
2501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2502 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2503   echo $ECHO_N "(cached) $ECHO_C" >&6
2504 else
2505   case $ac_pt_PKG_CONFIG in
2506   [\\/]* | ?:[\\/]*)
2507   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2508   ;;
2509   *)
2510   ac_save_IFS=$IFS; IFS=$ac_path_separator
2511 ac_dummy="$PATH"
2512 for ac_dir in $ac_dummy; do
2513   IFS=$ac_save_IFS
2514   test -z "$ac_dir" && ac_dir=.
2515   if $as_executable_p "$ac_dir/$ac_word"; then
2516    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2517    echo "$as_me:2517: found $ac_dir/$ac_word" >&5
2518    break
2519 fi
2520 done
2521
2522   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2523   ;;
2524 esac
2525 fi
2526 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2527
2528 if test -n "$ac_pt_PKG_CONFIG"; then
2529   echo "$as_me:2529: result: $ac_pt_PKG_CONFIG" >&5
2530 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2531 else
2532   echo "$as_me:2532: result: no" >&5
2533 echo "${ECHO_T}no" >&6
2534 fi
2535
2536   PKG_CONFIG=$ac_pt_PKG_CONFIG
2537 else
2538   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2539 fi
2540
2541         ;;
2542 (*)
2543         PKG_CONFIG=$withval
2544         ;;
2545 esac
2546
2547 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2548 if test "$PKG_CONFIG" != none ; then
2549
2550 if test "x$prefix" != xNONE; then
2551         cf_path_syntax="$prefix"
2552 else
2553         cf_path_syntax="$ac_default_prefix"
2554 fi
2555
2556 case ".$PKG_CONFIG" in
2557 (.\$\(*\)*|.\'*\'*)
2558         ;;
2559 (..|./*|.\\*)
2560         ;;
2561 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2562         ;;
2563 (.\${*prefix}*|.\${*dir}*)
2564         eval PKG_CONFIG="$PKG_CONFIG"
2565         case ".$PKG_CONFIG" in
2566         (.NONE/*)
2567                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2568                 ;;
2569         esac
2570         ;;
2571 (.no|.NONE/*)
2572         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2573         ;;
2574 (*)
2575         { { echo "$as_me:2575: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2576 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2577    { (exit 1); exit 1; }; }
2578         ;;
2579 esac
2580
2581 elif test "x$cf_pkg_config" != xno ; then
2582         { echo "$as_me:2582: WARNING: pkg-config is not installed" >&5
2583 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2584 fi
2585
2586 case $PKG_CONFIG in
2587 (no|none|yes)
2588         echo "$as_me:2588: checking for pkg-config library directory" >&5
2589 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2590         ;;
2591 (*)
2592         echo "$as_me:2592: checking for $PKG_CONFIG library directory" >&5
2593 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2594         ;;
2595 esac
2596
2597 PKG_CONFIG_LIBDIR=no
2598
2599 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2600 if test "${with_pkg_config_libdir+set}" = set; then
2601   withval="$with_pkg_config_libdir"
2602   PKG_CONFIG_LIBDIR=$withval
2603 else
2604   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2605 fi;
2606
2607 case x$PKG_CONFIG_LIBDIR in
2608 (x/*)
2609         ;;
2610 (xyes)
2611         # Look for the library directory using the same prefix as the executable
2612         if test "x$PKG_CONFIG" = xnone
2613         then
2614                 cf_path=$prefix
2615         else
2616                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2617         fi
2618
2619         # If you don't like using the default architecture, you have to specify the
2620         # intended library directory and corresponding compiler/linker options.
2621         #
2622         # This case allows for Debian's 2014-flavor of multiarch, along with the
2623         # most common variations before that point.  Some other variants spell the
2624         # directory differently, e.g., "pkg-config", and put it in unusual places.
2625         # pkg-config has always been poorly standardized, which is ironic...
2626         case x`(arch) 2>/dev/null` in
2627         (*64)
2628                 cf_search_path="\
2629                         $cf_path/lib/*64-linux-gnu \
2630                         $cf_path/share \
2631                         $cf_path/lib64 \
2632                         $cf_path/lib32 \
2633                         $cf_path/lib"
2634                 ;;
2635         (*)
2636                 cf_search_path="\
2637                         $cf_path/lib/*-linux-gnu \
2638                         $cf_path/share \
2639                         $cf_path/lib32 \
2640                         $cf_path/lib \
2641                         $cf_path/libdata"
2642                 ;;
2643         esac
2644
2645         test -n "$verbose" && echo "    list..." 1>&6
2646
2647 echo "${as_me:-configure}:2647: testing list... ..." 1>&5
2648
2649         for cf_config in $cf_search_path
2650         do
2651                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2652
2653 echo "${as_me:-configure}:2653: testing checking $cf_config/pkgconfig ..." 1>&5
2654
2655                 if test -d $cf_config/pkgconfig
2656                 then
2657                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2658                         echo "$as_me:2658: checking done" >&5
2659 echo $ECHO_N "checking done... $ECHO_C" >&6
2660                         break
2661                 fi
2662         done
2663         ;;
2664 (*)
2665         ;;
2666 esac
2667
2668 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2669         echo "$as_me:2669: result: $PKG_CONFIG_LIBDIR" >&5
2670 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2671 fi
2672
2673 echo "$as_me:2673: checking if you want to build test-programs" >&5
2674 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2675
2676 # Check whether --with-tests or --without-tests was given.
2677 if test "${with_tests+set}" = set; then
2678   withval="$with_tests"
2679   cf_with_tests=$withval
2680 else
2681   cf_with_tests=yes
2682 fi;
2683 echo "$as_me:2683: result: $cf_with_tests" >&5
2684 echo "${ECHO_T}$cf_with_tests" >&6
2685
2686 echo "$as_me:2686: checking if we should assume mixed-case filenames" >&5
2687 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2688
2689 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2690 if test "${enable_mixed_case+set}" = set; then
2691   enableval="$enable_mixed_case"
2692   enable_mixedcase=$enableval
2693 else
2694   enable_mixedcase=auto
2695 fi;
2696 echo "$as_me:2696: result: $enable_mixedcase" >&5
2697 echo "${ECHO_T}$enable_mixedcase" >&6
2698 if test "$enable_mixedcase" = "auto" ; then
2699
2700 echo "$as_me:2700: checking if filesystem supports mixed-case filenames" >&5
2701 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2702 if test "${cf_cv_mixedcase+set}" = set; then
2703   echo $ECHO_N "(cached) $ECHO_C" >&6
2704 else
2705
2706 if test "$cross_compiling" = yes ; then
2707         case $target_alias in
2708         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2709                 cf_cv_mixedcase=no
2710                 ;;
2711         (*)
2712                 cf_cv_mixedcase=yes
2713                 ;;
2714         esac
2715 else
2716         rm -f conftest CONFTEST
2717         echo test >conftest
2718         if test -f CONFTEST ; then
2719                 cf_cv_mixedcase=no
2720         else
2721                 cf_cv_mixedcase=yes
2722         fi
2723         rm -f conftest CONFTEST
2724 fi
2725
2726 fi
2727 echo "$as_me:2727: result: $cf_cv_mixedcase" >&5
2728 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2729 test "$cf_cv_mixedcase" = yes &&
2730 cat >>confdefs.h <<\EOF
2731 #define MIXEDCASE_FILENAMES 1
2732 EOF
2733
2734 else
2735         cf_cv_mixedcase=$enable_mixedcase
2736         if test "$enable_mixedcase" = "yes" ; then
2737                 cat >>confdefs.h <<\EOF
2738 #define MIXEDCASE_FILENAMES 1
2739 EOF
2740
2741         fi
2742 fi
2743
2744 # do this after mixed-case option (tags/TAGS is not as important as tic).
2745 echo "$as_me:2745: checking whether ${MAKE-make} sets \${MAKE}" >&5
2746 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2747 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2748 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2749   echo $ECHO_N "(cached) $ECHO_C" >&6
2750 else
2751   cat >conftest.make <<\EOF
2752 all:
2753         @echo 'ac_maketemp="${MAKE}"'
2754 EOF
2755 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2756 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2757 if test -n "$ac_maketemp"; then
2758   eval ac_cv_prog_make_${ac_make}_set=yes
2759 else
2760   eval ac_cv_prog_make_${ac_make}_set=no
2761 fi
2762 rm -f conftest.make
2763 fi
2764 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2765   echo "$as_me:2765: result: yes" >&5
2766 echo "${ECHO_T}yes" >&6
2767   SET_MAKE=
2768 else
2769   echo "$as_me:2769: result: no" >&5
2770 echo "${ECHO_T}no" >&6
2771   SET_MAKE="MAKE=${MAKE-make}"
2772 fi
2773
2774 for ac_prog in exctags ctags
2775 do
2776   # Extract the first word of "$ac_prog", so it can be a program name with args.
2777 set dummy $ac_prog; ac_word=$2
2778 echo "$as_me:2778: checking for $ac_word" >&5
2779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2780 if test "${ac_cv_prog_CTAGS+set}" = set; then
2781   echo $ECHO_N "(cached) $ECHO_C" >&6
2782 else
2783   if test -n "$CTAGS"; then
2784   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2785 else
2786   ac_save_IFS=$IFS; IFS=$ac_path_separator
2787 ac_dummy="$PATH"
2788 for ac_dir in $ac_dummy; do
2789   IFS=$ac_save_IFS
2790   test -z "$ac_dir" && ac_dir=.
2791   $as_executable_p "$ac_dir/$ac_word" || continue
2792 ac_cv_prog_CTAGS="$ac_prog"
2793 echo "$as_me:2793: found $ac_dir/$ac_word" >&5
2794 break
2795 done
2796
2797 fi
2798 fi
2799 CTAGS=$ac_cv_prog_CTAGS
2800 if test -n "$CTAGS"; then
2801   echo "$as_me:2801: result: $CTAGS" >&5
2802 echo "${ECHO_T}$CTAGS" >&6
2803 else
2804   echo "$as_me:2804: result: no" >&5
2805 echo "${ECHO_T}no" >&6
2806 fi
2807
2808   test -n "$CTAGS" && break
2809 done
2810
2811 for ac_prog in exetags etags
2812 do
2813   # Extract the first word of "$ac_prog", so it can be a program name with args.
2814 set dummy $ac_prog; ac_word=$2
2815 echo "$as_me:2815: checking for $ac_word" >&5
2816 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2817 if test "${ac_cv_prog_ETAGS+set}" = set; then
2818   echo $ECHO_N "(cached) $ECHO_C" >&6
2819 else
2820   if test -n "$ETAGS"; then
2821   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2822 else
2823   ac_save_IFS=$IFS; IFS=$ac_path_separator
2824 ac_dummy="$PATH"
2825 for ac_dir in $ac_dummy; do
2826   IFS=$ac_save_IFS
2827   test -z "$ac_dir" && ac_dir=.
2828   $as_executable_p "$ac_dir/$ac_word" || continue
2829 ac_cv_prog_ETAGS="$ac_prog"
2830 echo "$as_me:2830: found $ac_dir/$ac_word" >&5
2831 break
2832 done
2833
2834 fi
2835 fi
2836 ETAGS=$ac_cv_prog_ETAGS
2837 if test -n "$ETAGS"; then
2838   echo "$as_me:2838: result: $ETAGS" >&5
2839 echo "${ECHO_T}$ETAGS" >&6
2840 else
2841   echo "$as_me:2841: result: no" >&5
2842 echo "${ECHO_T}no" >&6
2843 fi
2844
2845   test -n "$ETAGS" && break
2846 done
2847
2848 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2849 set dummy ${CTAGS:-ctags}; ac_word=$2
2850 echo "$as_me:2850: checking for $ac_word" >&5
2851 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2852 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2853   echo $ECHO_N "(cached) $ECHO_C" >&6
2854 else
2855   if test -n "$MAKE_LOWER_TAGS"; then
2856   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2857 else
2858   ac_save_IFS=$IFS; IFS=$ac_path_separator
2859 ac_dummy="$PATH"
2860 for ac_dir in $ac_dummy; do
2861   IFS=$ac_save_IFS
2862   test -z "$ac_dir" && ac_dir=.
2863   $as_executable_p "$ac_dir/$ac_word" || continue
2864 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2865 echo "$as_me:2865: found $ac_dir/$ac_word" >&5
2866 break
2867 done
2868
2869   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2870 fi
2871 fi
2872 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2873 if test -n "$MAKE_LOWER_TAGS"; then
2874   echo "$as_me:2874: result: $MAKE_LOWER_TAGS" >&5
2875 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2876 else
2877   echo "$as_me:2877: result: no" >&5
2878 echo "${ECHO_T}no" >&6
2879 fi
2880
2881 if test "$cf_cv_mixedcase" = yes ; then
2882         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2883 set dummy ${ETAGS:-etags}; ac_word=$2
2884 echo "$as_me:2884: checking for $ac_word" >&5
2885 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2886 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2887   echo $ECHO_N "(cached) $ECHO_C" >&6
2888 else
2889   if test -n "$MAKE_UPPER_TAGS"; then
2890   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2891 else
2892   ac_save_IFS=$IFS; IFS=$ac_path_separator
2893 ac_dummy="$PATH"
2894 for ac_dir in $ac_dummy; do
2895   IFS=$ac_save_IFS
2896   test -z "$ac_dir" && ac_dir=.
2897   $as_executable_p "$ac_dir/$ac_word" || continue
2898 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2899 echo "$as_me:2899: found $ac_dir/$ac_word" >&5
2900 break
2901 done
2902
2903   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2904 fi
2905 fi
2906 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2907 if test -n "$MAKE_UPPER_TAGS"; then
2908   echo "$as_me:2908: result: $MAKE_UPPER_TAGS" >&5
2909 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2910 else
2911   echo "$as_me:2911: result: no" >&5
2912 echo "${ECHO_T}no" >&6
2913 fi
2914
2915 else
2916         MAKE_UPPER_TAGS=no
2917 fi
2918
2919 if test "$MAKE_UPPER_TAGS" = yes ; then
2920         MAKE_UPPER_TAGS=
2921 else
2922         MAKE_UPPER_TAGS="#"
2923 fi
2924
2925 if test "$MAKE_LOWER_TAGS" = yes ; then
2926         MAKE_LOWER_TAGS=
2927 else
2928         MAKE_LOWER_TAGS="#"
2929 fi
2930
2931 echo "$as_me:2931: checking for makeflags variable" >&5
2932 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2933 if test "${cf_cv_makeflags+set}" = set; then
2934   echo $ECHO_N "(cached) $ECHO_C" >&6
2935 else
2936
2937         cf_cv_makeflags=''
2938         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2939         do
2940                 cat >cf_makeflags.tmp <<CF_EOF
2941 SHELL = $SHELL
2942 all :
2943         @ echo '.$cf_option'
2944 CF_EOF
2945                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2946                 case "$cf_result" in
2947                 (.*k|.*kw)
2948                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2949                         case "$cf_result" in
2950                         (.*CC=*)        cf_cv_makeflags=
2951                                 ;;
2952                         (*)     cf_cv_makeflags=$cf_option
2953                                 ;;
2954                         esac
2955                         break
2956                         ;;
2957                 (.-)    ;;
2958                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
2959                         ;;
2960                 esac
2961         done
2962         rm -f cf_makeflags.tmp
2963
2964 fi
2965 echo "$as_me:2965: result: $cf_cv_makeflags" >&5
2966 echo "${ECHO_T}$cf_cv_makeflags" >&6
2967
2968 if test -n "$ac_tool_prefix"; then
2969   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2970 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2971 echo "$as_me:2971: checking for $ac_word" >&5
2972 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2973 if test "${ac_cv_prog_RANLIB+set}" = set; then
2974   echo $ECHO_N "(cached) $ECHO_C" >&6
2975 else
2976   if test -n "$RANLIB"; then
2977   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2978 else
2979   ac_save_IFS=$IFS; IFS=$ac_path_separator
2980 ac_dummy="$PATH"
2981 for ac_dir in $ac_dummy; do
2982   IFS=$ac_save_IFS
2983   test -z "$ac_dir" && ac_dir=.
2984   $as_executable_p "$ac_dir/$ac_word" || continue
2985 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2986 echo "$as_me:2986: found $ac_dir/$ac_word" >&5
2987 break
2988 done
2989
2990 fi
2991 fi
2992 RANLIB=$ac_cv_prog_RANLIB
2993 if test -n "$RANLIB"; then
2994   echo "$as_me:2994: result: $RANLIB" >&5
2995 echo "${ECHO_T}$RANLIB" >&6
2996 else
2997   echo "$as_me:2997: result: no" >&5
2998 echo "${ECHO_T}no" >&6
2999 fi
3000
3001 fi
3002 if test -z "$ac_cv_prog_RANLIB"; then
3003   ac_ct_RANLIB=$RANLIB
3004   # Extract the first word of "ranlib", so it can be a program name with args.
3005 set dummy ranlib; ac_word=$2
3006 echo "$as_me:3006: checking for $ac_word" >&5
3007 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3008 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3009   echo $ECHO_N "(cached) $ECHO_C" >&6
3010 else
3011   if test -n "$ac_ct_RANLIB"; then
3012   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3013 else
3014   ac_save_IFS=$IFS; IFS=$ac_path_separator
3015 ac_dummy="$PATH"
3016 for ac_dir in $ac_dummy; do
3017   IFS=$ac_save_IFS
3018   test -z "$ac_dir" && ac_dir=.
3019   $as_executable_p "$ac_dir/$ac_word" || continue
3020 ac_cv_prog_ac_ct_RANLIB="ranlib"
3021 echo "$as_me:3021: found $ac_dir/$ac_word" >&5
3022 break
3023 done
3024
3025   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3026 fi
3027 fi
3028 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3029 if test -n "$ac_ct_RANLIB"; then
3030   echo "$as_me:3030: result: $ac_ct_RANLIB" >&5
3031 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3032 else
3033   echo "$as_me:3033: result: no" >&5
3034 echo "${ECHO_T}no" >&6
3035 fi
3036
3037   RANLIB=$ac_ct_RANLIB
3038 else
3039   RANLIB="$ac_cv_prog_RANLIB"
3040 fi
3041
3042 if test -n "$ac_tool_prefix"; then
3043   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3044 set dummy ${ac_tool_prefix}ld; ac_word=$2
3045 echo "$as_me:3045: checking for $ac_word" >&5
3046 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3047 if test "${ac_cv_prog_LD+set}" = set; then
3048   echo $ECHO_N "(cached) $ECHO_C" >&6
3049 else
3050   if test -n "$LD"; then
3051   ac_cv_prog_LD="$LD" # Let the user override the test.
3052 else
3053   ac_save_IFS=$IFS; IFS=$ac_path_separator
3054 ac_dummy="$PATH"
3055 for ac_dir in $ac_dummy; do
3056   IFS=$ac_save_IFS
3057   test -z "$ac_dir" && ac_dir=.
3058   $as_executable_p "$ac_dir/$ac_word" || continue
3059 ac_cv_prog_LD="${ac_tool_prefix}ld"
3060 echo "$as_me:3060: found $ac_dir/$ac_word" >&5
3061 break
3062 done
3063
3064 fi
3065 fi
3066 LD=$ac_cv_prog_LD
3067 if test -n "$LD"; then
3068   echo "$as_me:3068: result: $LD" >&5
3069 echo "${ECHO_T}$LD" >&6
3070 else
3071   echo "$as_me:3071: result: no" >&5
3072 echo "${ECHO_T}no" >&6
3073 fi
3074
3075 fi
3076 if test -z "$ac_cv_prog_LD"; then
3077   ac_ct_LD=$LD
3078   # Extract the first word of "ld", so it can be a program name with args.
3079 set dummy ld; ac_word=$2
3080 echo "$as_me:3080: checking for $ac_word" >&5
3081 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3082 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3083   echo $ECHO_N "(cached) $ECHO_C" >&6
3084 else
3085   if test -n "$ac_ct_LD"; then
3086   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3087 else
3088   ac_save_IFS=$IFS; IFS=$ac_path_separator
3089 ac_dummy="$PATH"
3090 for ac_dir in $ac_dummy; do
3091   IFS=$ac_save_IFS
3092   test -z "$ac_dir" && ac_dir=.
3093   $as_executable_p "$ac_dir/$ac_word" || continue
3094 ac_cv_prog_ac_ct_LD="ld"
3095 echo "$as_me:3095: found $ac_dir/$ac_word" >&5
3096 break
3097 done
3098
3099   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3100 fi
3101 fi
3102 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3103 if test -n "$ac_ct_LD"; then
3104   echo "$as_me:3104: result: $ac_ct_LD" >&5
3105 echo "${ECHO_T}$ac_ct_LD" >&6
3106 else
3107   echo "$as_me:3107: result: no" >&5
3108 echo "${ECHO_T}no" >&6
3109 fi
3110
3111   LD=$ac_ct_LD
3112 else
3113   LD="$ac_cv_prog_LD"
3114 fi
3115
3116 if test -n "$ac_tool_prefix"; then
3117   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3118 set dummy ${ac_tool_prefix}ar; ac_word=$2
3119 echo "$as_me:3119: checking for $ac_word" >&5
3120 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3121 if test "${ac_cv_prog_AR+set}" = set; then
3122   echo $ECHO_N "(cached) $ECHO_C" >&6
3123 else
3124   if test -n "$AR"; then
3125   ac_cv_prog_AR="$AR" # Let the user override the test.
3126 else
3127   ac_save_IFS=$IFS; IFS=$ac_path_separator
3128 ac_dummy="$PATH"
3129 for ac_dir in $ac_dummy; do
3130   IFS=$ac_save_IFS
3131   test -z "$ac_dir" && ac_dir=.
3132   $as_executable_p "$ac_dir/$ac_word" || continue
3133 ac_cv_prog_AR="${ac_tool_prefix}ar"
3134 echo "$as_me:3134: found $ac_dir/$ac_word" >&5
3135 break
3136 done
3137
3138 fi
3139 fi
3140 AR=$ac_cv_prog_AR
3141 if test -n "$AR"; then
3142   echo "$as_me:3142: result: $AR" >&5
3143 echo "${ECHO_T}$AR" >&6
3144 else
3145   echo "$as_me:3145: result: no" >&5
3146 echo "${ECHO_T}no" >&6
3147 fi
3148
3149 fi
3150 if test -z "$ac_cv_prog_AR"; then
3151   ac_ct_AR=$AR
3152   # Extract the first word of "ar", so it can be a program name with args.
3153 set dummy ar; ac_word=$2
3154 echo "$as_me:3154: checking for $ac_word" >&5
3155 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3156 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3157   echo $ECHO_N "(cached) $ECHO_C" >&6
3158 else
3159   if test -n "$ac_ct_AR"; then
3160   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3161 else
3162   ac_save_IFS=$IFS; IFS=$ac_path_separator
3163 ac_dummy="$PATH"
3164 for ac_dir in $ac_dummy; do
3165   IFS=$ac_save_IFS
3166   test -z "$ac_dir" && ac_dir=.
3167   $as_executable_p "$ac_dir/$ac_word" || continue
3168 ac_cv_prog_ac_ct_AR="ar"
3169 echo "$as_me:3169: found $ac_dir/$ac_word" >&5
3170 break
3171 done
3172
3173   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3174 fi
3175 fi
3176 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3177 if test -n "$ac_ct_AR"; then
3178   echo "$as_me:3178: result: $ac_ct_AR" >&5
3179 echo "${ECHO_T}$ac_ct_AR" >&6
3180 else
3181   echo "$as_me:3181: result: no" >&5
3182 echo "${ECHO_T}no" >&6
3183 fi
3184
3185   AR=$ac_ct_AR
3186 else
3187   AR="$ac_cv_prog_AR"
3188 fi
3189
3190 if test -n "$ac_tool_prefix"; then
3191   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3192 set dummy ${ac_tool_prefix}ar; ac_word=$2
3193 echo "$as_me:3193: checking for $ac_word" >&5
3194 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3195 if test "${ac_cv_prog_AR+set}" = set; then
3196   echo $ECHO_N "(cached) $ECHO_C" >&6
3197 else
3198   if test -n "$AR"; then
3199   ac_cv_prog_AR="$AR" # Let the user override the test.
3200 else
3201   ac_save_IFS=$IFS; IFS=$ac_path_separator
3202 ac_dummy="$PATH"
3203 for ac_dir in $ac_dummy; do
3204   IFS=$ac_save_IFS
3205   test -z "$ac_dir" && ac_dir=.
3206   $as_executable_p "$ac_dir/$ac_word" || continue
3207 ac_cv_prog_AR="${ac_tool_prefix}ar"
3208 echo "$as_me:3208: found $ac_dir/$ac_word" >&5
3209 break
3210 done
3211
3212 fi
3213 fi
3214 AR=$ac_cv_prog_AR
3215 if test -n "$AR"; then
3216   echo "$as_me:3216: result: $AR" >&5
3217 echo "${ECHO_T}$AR" >&6
3218 else
3219   echo "$as_me:3219: result: no" >&5
3220 echo "${ECHO_T}no" >&6
3221 fi
3222
3223 fi
3224 if test -z "$ac_cv_prog_AR"; then
3225   ac_ct_AR=$AR
3226   # Extract the first word of "ar", so it can be a program name with args.
3227 set dummy ar; ac_word=$2
3228 echo "$as_me:3228: checking for $ac_word" >&5
3229 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3230 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3231   echo $ECHO_N "(cached) $ECHO_C" >&6
3232 else
3233   if test -n "$ac_ct_AR"; then
3234   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3235 else
3236   ac_save_IFS=$IFS; IFS=$ac_path_separator
3237 ac_dummy="$PATH"
3238 for ac_dir in $ac_dummy; do
3239   IFS=$ac_save_IFS
3240   test -z "$ac_dir" && ac_dir=.
3241   $as_executable_p "$ac_dir/$ac_word" || continue
3242 ac_cv_prog_ac_ct_AR="ar"
3243 echo "$as_me:3243: found $ac_dir/$ac_word" >&5
3244 break
3245 done
3246
3247   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3248 fi
3249 fi
3250 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3251 if test -n "$ac_ct_AR"; then
3252   echo "$as_me:3252: result: $ac_ct_AR" >&5
3253 echo "${ECHO_T}$ac_ct_AR" >&6
3254 else
3255   echo "$as_me:3255: result: no" >&5
3256 echo "${ECHO_T}no" >&6
3257 fi
3258
3259   AR=$ac_ct_AR
3260 else
3261   AR="$ac_cv_prog_AR"
3262 fi
3263
3264 echo "$as_me:3264: checking for options to update archives" >&5
3265 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3266 if test "${cf_cv_ar_flags+set}" = set; then
3267   echo $ECHO_N "(cached) $ECHO_C" >&6
3268 else
3269
3270         cf_cv_ar_flags=unknown
3271         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3272         do
3273
3274                 # check if $ARFLAGS already contains this choice
3275                 if test "x$ARFLAGS" != "x" ; then
3276                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3277                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3278                                 cf_cv_ar_flags=
3279                                 break
3280                         fi
3281                 fi
3282
3283                 rm -f conftest.$ac_cv_objext
3284                 rm -f conftest.a
3285
3286                 cat >conftest.$ac_ext <<EOF
3287 #line 3287 "configure"
3288 int     testdata[3] = { 123, 456, 789 };
3289 EOF
3290                 if { (eval echo "$as_me:3290: \"$ac_compile\"") >&5
3291   (eval $ac_compile) 2>&5
3292   ac_status=$?
3293   echo "$as_me:3293: \$? = $ac_status" >&5
3294   (exit $ac_status); } ; then
3295                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3296                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3297                         if test -f conftest.a ; then
3298                                 cf_cv_ar_flags=$cf_ar_flags
3299                                 break
3300                         fi
3301                 else
3302                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3303
3304 echo "${as_me:-configure}:3304: testing cannot compile test-program ..." 1>&5
3305
3306                         break
3307                 fi
3308         done
3309         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3310
3311 fi
3312 echo "$as_me:3312: result: $cf_cv_ar_flags" >&5
3313 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3314
3315 if test -n "$ARFLAGS" ; then
3316         if test -n "$cf_cv_ar_flags" ; then
3317                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3318         fi
3319 else
3320         ARFLAGS=$cf_cv_ar_flags
3321 fi
3322
3323         echo "$as_me:3323: checking for PATH separator" >&5
3324 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3325         case $cf_cv_system_name in
3326         (os2*)  PATH_SEPARATOR=';'  ;;
3327         (*)     ${PATH_SEPARATOR:=':'}  ;;
3328         esac
3329
3330         echo "$as_me:3330: result: $PATH_SEPARATOR" >&5
3331 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3332
3333 echo "$as_me:3333: checking if you have specified an install-prefix" >&5
3334 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3335
3336 # Check whether --with-install-prefix or --without-install-prefix was given.
3337 if test "${with_install_prefix+set}" = set; then
3338   withval="$with_install_prefix"
3339   case "$withval" in
3340         (yes|no)
3341                 ;;
3342         (*)     DESTDIR="$withval"
3343                 ;;
3344         esac
3345 fi;
3346 echo "$as_me:3346: result: $DESTDIR" >&5
3347 echo "${ECHO_T}$DESTDIR" >&6
3348
3349 ###############################################################################
3350
3351 # If we're cross-compiling, allow the user to override the tools and their
3352 # options.  The configure script is oriented toward identifying the host
3353 # compiler, etc., but we need a build compiler to generate parts of the source.
3354
3355 if test "$cross_compiling" = yes ; then
3356
3357         # defaults that we might want to override
3358         : ${BUILD_CFLAGS:=''}
3359         : ${BUILD_CPPFLAGS:=''}
3360         : ${BUILD_LDFLAGS:=''}
3361         : ${BUILD_LIBS:=''}
3362         : ${BUILD_EXEEXT:='$x'}
3363         : ${BUILD_OBJEXT:='o'}
3364
3365 # Check whether --with-build-cc or --without-build-cc was given.
3366 if test "${with_build_cc+set}" = set; then
3367   withval="$with_build_cc"
3368   BUILD_CC="$withval"
3369 else
3370   for ac_prog in gcc cc cl
3371 do
3372   # Extract the first word of "$ac_prog", so it can be a program name with args.
3373 set dummy $ac_prog; ac_word=$2
3374 echo "$as_me:3374: checking for $ac_word" >&5
3375 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3376 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3377   echo $ECHO_N "(cached) $ECHO_C" >&6
3378 else
3379   if test -n "$BUILD_CC"; then
3380   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3381 else
3382   ac_save_IFS=$IFS; IFS=$ac_path_separator
3383 ac_dummy="$PATH"
3384 for ac_dir in $ac_dummy; do
3385   IFS=$ac_save_IFS
3386   test -z "$ac_dir" && ac_dir=.
3387   $as_executable_p "$ac_dir/$ac_word" || continue
3388 ac_cv_prog_BUILD_CC="$ac_prog"
3389 echo "$as_me:3389: found $ac_dir/$ac_word" >&5
3390 break
3391 done
3392
3393 fi
3394 fi
3395 BUILD_CC=$ac_cv_prog_BUILD_CC
3396 if test -n "$BUILD_CC"; then
3397   echo "$as_me:3397: result: $BUILD_CC" >&5
3398 echo "${ECHO_T}$BUILD_CC" >&6
3399 else
3400   echo "$as_me:3400: result: no" >&5
3401 echo "${ECHO_T}no" >&6
3402 fi
3403
3404   test -n "$BUILD_CC" && break
3405 done
3406
3407 fi;
3408         echo "$as_me:3408: checking for native build C compiler" >&5
3409 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3410         echo "$as_me:3410: result: $BUILD_CC" >&5
3411 echo "${ECHO_T}$BUILD_CC" >&6
3412
3413         echo "$as_me:3413: checking for native build C preprocessor" >&5
3414 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3415
3416 # Check whether --with-build-cpp or --without-build-cpp was given.
3417 if test "${with_build_cpp+set}" = set; then
3418   withval="$with_build_cpp"
3419   BUILD_CPP="$withval"
3420 else
3421   BUILD_CPP='${BUILD_CC} -E'
3422 fi;
3423         echo "$as_me:3423: result: $BUILD_CPP" >&5
3424 echo "${ECHO_T}$BUILD_CPP" >&6
3425
3426         echo "$as_me:3426: checking for native build C flags" >&5
3427 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3428
3429 # Check whether --with-build-cflags or --without-build-cflags was given.
3430 if test "${with_build_cflags+set}" = set; then
3431   withval="$with_build_cflags"
3432   BUILD_CFLAGS="$withval"
3433 fi;
3434         echo "$as_me:3434: result: $BUILD_CFLAGS" >&5
3435 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3436
3437         echo "$as_me:3437: checking for native build C preprocessor-flags" >&5
3438 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3439
3440 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3441 if test "${with_build_cppflags+set}" = set; then
3442   withval="$with_build_cppflags"
3443   BUILD_CPPFLAGS="$withval"
3444 fi;
3445         echo "$as_me:3445: result: $BUILD_CPPFLAGS" >&5
3446 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3447
3448         echo "$as_me:3448: checking for native build linker-flags" >&5
3449 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3450
3451 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3452 if test "${with_build_ldflags+set}" = set; then
3453   withval="$with_build_ldflags"
3454   BUILD_LDFLAGS="$withval"
3455 fi;
3456         echo "$as_me:3456: result: $BUILD_LDFLAGS" >&5
3457 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3458
3459         echo "$as_me:3459: checking for native build linker-libraries" >&5
3460 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3461
3462 # Check whether --with-build-libs or --without-build-libs was given.
3463 if test "${with_build_libs+set}" = set; then
3464   withval="$with_build_libs"
3465   BUILD_LIBS="$withval"
3466 fi;
3467         echo "$as_me:3467: result: $BUILD_LIBS" >&5
3468 echo "${ECHO_T}$BUILD_LIBS" >&6
3469
3470         # this assumes we're on Unix.
3471         BUILD_EXEEXT=
3472         BUILD_OBJEXT=o
3473
3474         : ${BUILD_CC:='${CC}'}
3475
3476         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3477                 { { echo "$as_me:3477: error: Cross-build requires two compilers.
3478 Use --with-build-cc to specify the native compiler." >&5
3479 echo "$as_me: error: Cross-build requires two compilers.
3480 Use --with-build-cc to specify the native compiler." >&2;}
3481    { (exit 1); exit 1; }; }
3482         fi
3483
3484 else
3485         : ${BUILD_CC:='${CC}'}
3486         : ${BUILD_CPP:='${CPP}'}
3487         : ${BUILD_CFLAGS:='${CFLAGS}'}
3488         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3489         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3490         : ${BUILD_LIBS:='${LIBS}'}
3491         : ${BUILD_EXEEXT:='$x'}
3492         : ${BUILD_OBJEXT:='o'}
3493 fi
3494
3495 ###############################################################################
3496
3497 ### Options to allow the user to specify the set of libraries which are used.
3498 ### Use "--without-normal --with-shared" to allow the default model to be
3499 ### shared, for example.
3500 cf_list_models=""
3501
3502 echo "$as_me:3502: checking if you want to build shared C-objects" >&5
3503 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3504
3505 # Check whether --with-shared or --without-shared was given.
3506 if test "${with_shared+set}" = set; then
3507   withval="$with_shared"
3508   with_shared=$withval
3509 else
3510   with_shared=no
3511 fi;
3512 echo "$as_me:3512: result: $with_shared" >&5
3513 echo "${ECHO_T}$with_shared" >&6
3514 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3515
3516 echo "$as_me:3516: checking for specified models" >&5
3517 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3518 test -z "$cf_list_models" && cf_list_models=normal
3519 echo "$as_me:3519: result: $cf_list_models" >&5
3520 echo "${ECHO_T}$cf_list_models" >&6
3521
3522 ### Use the first model as the default, and save its suffix for use in building
3523 ### up test-applications.
3524 echo "$as_me:3524: checking for default model" >&5
3525 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3526 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3527 echo "$as_me:3527: result: $DFT_LWR_MODEL" >&5
3528 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3529
3530 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3531
3532 echo "$as_me:3532: checking for specific curses-directory" >&5
3533 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3534
3535 # Check whether --with-curses-dir or --without-curses-dir was given.
3536 if test "${with_curses_dir+set}" = set; then
3537   withval="$with_curses_dir"
3538   cf_cv_curses_dir=$withval
3539 else
3540   cf_cv_curses_dir=no
3541 fi;
3542 echo "$as_me:3542: result: $cf_cv_curses_dir" >&5
3543 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3544
3545 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3546 then
3547
3548 if test "x$prefix" != xNONE; then
3549         cf_path_syntax="$prefix"
3550 else
3551         cf_path_syntax="$ac_default_prefix"
3552 fi
3553
3554 case ".$withval" in
3555 (.\$\(*\)*|.\'*\'*)
3556         ;;
3557 (..|./*|.\\*)
3558         ;;
3559 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3560         ;;
3561 (.\${*prefix}*|.\${*dir}*)
3562         eval withval="$withval"
3563         case ".$withval" in
3564         (.NONE/*)
3565                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3566                 ;;
3567         esac
3568         ;;
3569 (.no|.NONE/*)
3570         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3571         ;;
3572 (*)
3573         { { echo "$as_me:3573: error: expected a pathname, not \"$withval\"" >&5
3574 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3575    { (exit 1); exit 1; }; }
3576         ;;
3577 esac
3578
3579         if test -d "$cf_cv_curses_dir"
3580         then
3581
3582 if test -n "$cf_cv_curses_dir/include" ; then
3583   for cf_add_incdir in $cf_cv_curses_dir/include
3584   do
3585         while test $cf_add_incdir != /usr/include
3586         do
3587           if test -d $cf_add_incdir
3588           then
3589                 cf_have_incdir=no
3590                 if test -n "$CFLAGS$CPPFLAGS" ; then
3591                   # a loop is needed to ensure we can add subdirs of existing dirs
3592                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3593                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3594                           cf_have_incdir=yes; break
3595                         fi
3596                   done
3597                 fi
3598
3599                 if test "$cf_have_incdir" = no ; then
3600                   if test "$cf_add_incdir" = /usr/local/include ; then
3601                         if test "$GCC" = yes
3602                         then
3603                           cf_save_CPPFLAGS=$CPPFLAGS
3604                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3605                           cat >conftest.$ac_ext <<_ACEOF
3606 #line 3606 "configure"
3607 #include "confdefs.h"
3608 #include <stdio.h>
3609 int
3610 main ()
3611 {
3612 printf("Hello")
3613   ;
3614   return 0;
3615 }
3616 _ACEOF
3617 rm -f conftest.$ac_objext
3618 if { (eval echo "$as_me:3618: \"$ac_compile\"") >&5
3619   (eval $ac_compile) 2>&5
3620   ac_status=$?
3621   echo "$as_me:3621: \$? = $ac_status" >&5
3622   (exit $ac_status); } &&
3623          { ac_try='test -s conftest.$ac_objext'
3624   { (eval echo "$as_me:3624: \"$ac_try\"") >&5
3625   (eval $ac_try) 2>&5
3626   ac_status=$?
3627   echo "$as_me:3627: \$? = $ac_status" >&5
3628   (exit $ac_status); }; }; then
3629   :
3630 else
3631   echo "$as_me: failed program was:" >&5
3632 cat conftest.$ac_ext >&5
3633 cf_have_incdir=yes
3634 fi
3635 rm -f conftest.$ac_objext conftest.$ac_ext
3636                           CPPFLAGS=$cf_save_CPPFLAGS
3637                         fi
3638                   fi
3639                 fi
3640
3641                 if test "$cf_have_incdir" = no ; then
3642                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3643
3644 echo "${as_me:-configure}:3644: testing adding $cf_add_incdir to include-path ..." 1>&5
3645
3646                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3647
3648                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3649                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3650                   cf_add_incdir="$cf_top_incdir"
3651                 else
3652                   break
3653                 fi
3654           else
3655                 break
3656           fi
3657         done
3658   done
3659 fi
3660
3661 if test -n "$cf_cv_curses_dir/lib" ; then
3662         for cf_add_libdir in $cf_cv_curses_dir/lib
3663         do
3664                 if test $cf_add_libdir = /usr/lib ; then
3665                         :
3666                 elif test -d $cf_add_libdir
3667                 then
3668                         cf_have_libdir=no
3669                         if test -n "$LDFLAGS$LIBS" ; then
3670                                 # a loop is needed to ensure we can add subdirs of existing dirs
3671                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3672                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3673                                                 cf_have_libdir=yes; break
3674                                         fi
3675                                 done
3676                         fi
3677                         if test "$cf_have_libdir" = no ; then
3678                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3679
3680 echo "${as_me:-configure}:3680: testing adding $cf_add_libdir to library-path ..." 1>&5
3681
3682                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3683                         fi
3684                 fi
3685         done
3686 fi
3687
3688         fi
3689 fi
3690
3691 cf_ncuconfig_root=ncurses
3692 cf_have_ncuconfig=no
3693
3694 if test "x${PKG_CONFIG:=none}" != xnone; then
3695         echo "$as_me:3695: checking pkg-config for $cf_ncuconfig_root" >&5
3696 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3697         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3698                 echo "$as_me:3698: result: yes" >&5
3699 echo "${ECHO_T}yes" >&6
3700
3701                 echo "$as_me:3701: checking if the $cf_ncuconfig_root package files work" >&5
3702 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3703                 cf_have_ncuconfig=unknown
3704
3705                 cf_save_CPPFLAGS="$CPPFLAGS"
3706                 cf_save_LIBS="$LIBS"
3707
3708                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3709
3710 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3711 # Filter out duplicates - this happens with badly-designed ".pc" files...
3712 for cf_add_1lib in $LIBS
3713 do
3714         for cf_add_2lib in $cf_add_libs
3715         do
3716                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3717                 then
3718                         cf_add_1lib=
3719                         break
3720                 fi
3721         done
3722         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3723 done
3724 LIBS="$cf_add_libs"
3725
3726                 cat >conftest.$ac_ext <<_ACEOF
3727 #line 3727 "configure"
3728 #include "confdefs.h"
3729 #include <${cf_cv_ncurses_header:-curses.h}>
3730 int
3731 main ()
3732 {
3733 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3734   ;
3735   return 0;
3736 }
3737 _ACEOF
3738 rm -f conftest.$ac_objext conftest$ac_exeext
3739 if { (eval echo "$as_me:3739: \"$ac_link\"") >&5
3740   (eval $ac_link) 2>&5
3741   ac_status=$?
3742   echo "$as_me:3742: \$? = $ac_status" >&5
3743   (exit $ac_status); } &&
3744          { ac_try='test -s conftest$ac_exeext'
3745   { (eval echo "$as_me:3745: \"$ac_try\"") >&5
3746   (eval $ac_try) 2>&5
3747   ac_status=$?
3748   echo "$as_me:3748: \$? = $ac_status" >&5
3749   (exit $ac_status); }; }; then
3750   if test "$cross_compiling" = yes; then
3751   cf_have_ncuconfig=maybe
3752 else
3753   cat >conftest.$ac_ext <<_ACEOF
3754 #line 3754 "configure"
3755 #include "confdefs.h"
3756 #include <${cf_cv_ncurses_header:-curses.h}>
3757                                 int main(void)
3758                                 { char *xx = curses_version(); return (xx == 0); }
3759 _ACEOF
3760 rm -f conftest$ac_exeext
3761 if { (eval echo "$as_me:3761: \"$ac_link\"") >&5
3762   (eval $ac_link) 2>&5
3763   ac_status=$?
3764   echo "$as_me:3764: \$? = $ac_status" >&5
3765   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3766   { (eval echo "$as_me:3766: \"$ac_try\"") >&5
3767   (eval $ac_try) 2>&5
3768   ac_status=$?
3769   echo "$as_me:3769: \$? = $ac_status" >&5
3770   (exit $ac_status); }; }; then
3771   cf_have_ncuconfig=yes
3772 else
3773   echo "$as_me: program exited with status $ac_status" >&5
3774 echo "$as_me: failed program was:" >&5
3775 cat conftest.$ac_ext >&5
3776 cf_have_ncuconfig=no
3777 fi
3778 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3779 fi
3780 else
3781   echo "$as_me: failed program was:" >&5
3782 cat conftest.$ac_ext >&5
3783 cf_have_ncuconfig=no
3784 fi
3785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3786                 echo "$as_me:3786: result: $cf_have_ncuconfig" >&5
3787 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3788                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3789                 if test "$cf_have_ncuconfig" != "yes"
3790                 then
3791                         CPPFLAGS="$cf_save_CPPFLAGS"
3792                         LIBS="$cf_save_LIBS"
3793                         NCURSES_CONFIG_PKG=none
3794                 else
3795
3796 cat >>confdefs.h <<\EOF
3797 #define NCURSES 1
3798 EOF
3799
3800                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3801                 fi
3802
3803         else
3804                 echo "$as_me:3804: result: no" >&5
3805 echo "${ECHO_T}no" >&6
3806                 NCURSES_CONFIG_PKG=none
3807         fi
3808 else
3809         NCURSES_CONFIG_PKG=none
3810 fi
3811
3812 if test "x$cf_have_ncuconfig" = "xno"; then
3813         echo "Looking for ${cf_ncuconfig_root}-config"
3814
3815 if test -n "$ac_tool_prefix"; then
3816   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3817   do
3818     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3819 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3820 echo "$as_me:3820: checking for $ac_word" >&5
3821 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3822 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3823   echo $ECHO_N "(cached) $ECHO_C" >&6
3824 else
3825   if test -n "$NCURSES_CONFIG"; then
3826   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3827 else
3828   ac_save_IFS=$IFS; IFS=$ac_path_separator
3829 ac_dummy="$PATH"
3830 for ac_dir in $ac_dummy; do
3831   IFS=$ac_save_IFS
3832   test -z "$ac_dir" && ac_dir=.
3833   $as_executable_p "$ac_dir/$ac_word" || continue
3834 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3835 echo "$as_me:3835: found $ac_dir/$ac_word" >&5
3836 break
3837 done
3838
3839 fi
3840 fi
3841 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3842 if test -n "$NCURSES_CONFIG"; then
3843   echo "$as_me:3843: result: $NCURSES_CONFIG" >&5
3844 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3845 else
3846   echo "$as_me:3846: result: no" >&5
3847 echo "${ECHO_T}no" >&6
3848 fi
3849
3850     test -n "$NCURSES_CONFIG" && break
3851   done
3852 fi
3853 if test -z "$NCURSES_CONFIG"; then
3854   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3855   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3856 do
3857   # Extract the first word of "$ac_prog", so it can be a program name with args.
3858 set dummy $ac_prog; ac_word=$2
3859 echo "$as_me:3859: checking for $ac_word" >&5
3860 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3861 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3862   echo $ECHO_N "(cached) $ECHO_C" >&6
3863 else
3864   if test -n "$ac_ct_NCURSES_CONFIG"; then
3865   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3866 else
3867   ac_save_IFS=$IFS; IFS=$ac_path_separator
3868 ac_dummy="$PATH"
3869 for ac_dir in $ac_dummy; do
3870   IFS=$ac_save_IFS
3871   test -z "$ac_dir" && ac_dir=.
3872   $as_executable_p "$ac_dir/$ac_word" || continue
3873 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3874 echo "$as_me:3874: found $ac_dir/$ac_word" >&5
3875 break
3876 done
3877
3878 fi
3879 fi
3880 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3881 if test -n "$ac_ct_NCURSES_CONFIG"; then
3882   echo "$as_me:3882: result: $ac_ct_NCURSES_CONFIG" >&5
3883 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3884 else
3885   echo "$as_me:3885: result: no" >&5
3886 echo "${ECHO_T}no" >&6
3887 fi
3888
3889   test -n "$ac_ct_NCURSES_CONFIG" && break
3890 done
3891 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3892
3893   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3894 fi
3895
3896         if test "$NCURSES_CONFIG" != none ; then
3897
3898                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3899
3900 cf_add_libs="`$NCURSES_CONFIG --libs`"
3901 # Filter out duplicates - this happens with badly-designed ".pc" files...
3902 for cf_add_1lib in $LIBS
3903 do
3904         for cf_add_2lib in $cf_add_libs
3905         do
3906                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3907                 then
3908                         cf_add_1lib=
3909                         break
3910                 fi
3911         done
3912         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3913 done
3914 LIBS="$cf_add_libs"
3915
3916                 # even with config script, some packages use no-override for curses.h
3917
3918 echo "$as_me:3918: checking if we have identified curses headers" >&5
3919 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3920 if test "${cf_cv_ncurses_header+set}" = set; then
3921   echo $ECHO_N "(cached) $ECHO_C" >&6
3922 else
3923
3924 cf_cv_ncurses_header=none
3925 for cf_header in \
3926         ncurses.h ncurses/ncurses.h \
3927         curses.h ncurses/curses.h
3928 do
3929 cat >conftest.$ac_ext <<_ACEOF
3930 #line 3930 "configure"
3931 #include "confdefs.h"
3932 #include <${cf_header}>
3933 int
3934 main ()
3935 {
3936 initscr(); tgoto("?", 0,0)
3937   ;
3938   return 0;
3939 }
3940 _ACEOF
3941 rm -f conftest.$ac_objext
3942 if { (eval echo "$as_me:3942: \"$ac_compile\"") >&5
3943   (eval $ac_compile) 2>&5
3944   ac_status=$?
3945   echo "$as_me:3945: \$? = $ac_status" >&5
3946   (exit $ac_status); } &&
3947          { ac_try='test -s conftest.$ac_objext'
3948   { (eval echo "$as_me:3948: \"$ac_try\"") >&5
3949   (eval $ac_try) 2>&5
3950   ac_status=$?
3951   echo "$as_me:3951: \$? = $ac_status" >&5
3952   (exit $ac_status); }; }; then
3953   cf_cv_ncurses_header=$cf_header; break
3954 else
3955   echo "$as_me: failed program was:" >&5
3956 cat conftest.$ac_ext >&5
3957 fi
3958 rm -f conftest.$ac_objext conftest.$ac_ext
3959 done
3960
3961 fi
3962 echo "$as_me:3962: result: $cf_cv_ncurses_header" >&5
3963 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
3964
3965 if test "$cf_cv_ncurses_header" = none ; then
3966         { { echo "$as_me:3966: error: No curses header-files found" >&5
3967 echo "$as_me: error: No curses header-files found" >&2;}
3968    { (exit 1); exit 1; }; }
3969 fi
3970
3971 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
3972
3973 for ac_header in $cf_cv_ncurses_header
3974 do
3975 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3976 echo "$as_me:3976: checking for $ac_header" >&5
3977 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3978 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3979   echo $ECHO_N "(cached) $ECHO_C" >&6
3980 else
3981   cat >conftest.$ac_ext <<_ACEOF
3982 #line 3982 "configure"
3983 #include "confdefs.h"
3984 #include <$ac_header>
3985 _ACEOF
3986 if { (eval echo "$as_me:3986: \"$ac_cpp conftest.$ac_ext\"") >&5
3987   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3988   ac_status=$?
3989   egrep -v '^ *\+' conftest.er1 >conftest.err
3990   rm -f conftest.er1
3991   cat conftest.err >&5
3992   echo "$as_me:3992: \$? = $ac_status" >&5
3993   (exit $ac_status); } >/dev/null; then
3994   if test -s conftest.err; then
3995     ac_cpp_err=$ac_c_preproc_warn_flag
3996   else
3997     ac_cpp_err=
3998   fi
3999 else
4000   ac_cpp_err=yes
4001 fi
4002 if test -z "$ac_cpp_err"; then
4003   eval "$as_ac_Header=yes"
4004 else
4005   echo "$as_me: failed program was:" >&5
4006   cat conftest.$ac_ext >&5
4007   eval "$as_ac_Header=no"
4008 fi
4009 rm -f conftest.err conftest.$ac_ext
4010 fi
4011 echo "$as_me:4011: result: `eval echo '${'$as_ac_Header'}'`" >&5
4012 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4013 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4014   cat >>confdefs.h <<EOF
4015 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4016 EOF
4017
4018 fi
4019 done
4020
4021 cat >>confdefs.h <<\EOF
4022 #define NCURSES 1
4023 EOF
4024
4025 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4026
4027                 cat >>confdefs.h <<EOF
4028 #define $cf_nculib_ROOT 1
4029 EOF
4030
4031                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4032
4033         else
4034
4035 cf_ncuhdr_root=ncurses
4036
4037 test -n "$cf_cv_curses_dir" && \
4038 test "$cf_cv_curses_dir" != "no" && { \
4039
4040 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4041   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4042   do
4043         while test $cf_add_incdir != /usr/include
4044         do
4045           if test -d $cf_add_incdir
4046           then
4047                 cf_have_incdir=no
4048                 if test -n "$CFLAGS$CPPFLAGS" ; then
4049                   # a loop is needed to ensure we can add subdirs of existing dirs
4050                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4051                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4052                           cf_have_incdir=yes; break
4053                         fi
4054                   done
4055                 fi
4056
4057                 if test "$cf_have_incdir" = no ; then
4058                   if test "$cf_add_incdir" = /usr/local/include ; then
4059                         if test "$GCC" = yes
4060                         then
4061                           cf_save_CPPFLAGS=$CPPFLAGS
4062                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4063                           cat >conftest.$ac_ext <<_ACEOF
4064 #line 4064 "configure"
4065 #include "confdefs.h"
4066 #include <stdio.h>
4067 int
4068 main ()
4069 {
4070 printf("Hello")
4071   ;
4072   return 0;
4073 }
4074 _ACEOF
4075 rm -f conftest.$ac_objext
4076 if { (eval echo "$as_me:4076: \"$ac_compile\"") >&5
4077   (eval $ac_compile) 2>&5
4078   ac_status=$?
4079   echo "$as_me:4079: \$? = $ac_status" >&5
4080   (exit $ac_status); } &&
4081          { ac_try='test -s conftest.$ac_objext'
4082   { (eval echo "$as_me:4082: \"$ac_try\"") >&5
4083   (eval $ac_try) 2>&5
4084   ac_status=$?
4085   echo "$as_me:4085: \$? = $ac_status" >&5
4086   (exit $ac_status); }; }; then
4087   :
4088 else
4089   echo "$as_me: failed program was:" >&5
4090 cat conftest.$ac_ext >&5
4091 cf_have_incdir=yes
4092 fi
4093 rm -f conftest.$ac_objext conftest.$ac_ext
4094                           CPPFLAGS=$cf_save_CPPFLAGS
4095                         fi
4096                   fi
4097                 fi
4098
4099                 if test "$cf_have_incdir" = no ; then
4100                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4101
4102 echo "${as_me:-configure}:4102: testing adding $cf_add_incdir to include-path ..." 1>&5
4103
4104                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4105
4106                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4107                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4108                   cf_add_incdir="$cf_top_incdir"
4109                 else
4110                   break
4111                 fi
4112           else
4113                 break
4114           fi
4115         done
4116   done
4117 fi
4118
4119 }
4120
4121 echo "$as_me:4121: checking for $cf_ncuhdr_root header in include-path" >&5
4122 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4123 if test "${cf_cv_ncurses_h+set}" = set; then
4124   echo $ECHO_N "(cached) $ECHO_C" >&6
4125 else
4126
4127         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4128         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4129         for cf_header in $cf_header_list
4130         do
4131
4132         cat >conftest.$ac_ext <<_ACEOF
4133 #line 4133 "configure"
4134 #include "confdefs.h"
4135
4136 #include <$cf_header>
4137 int
4138 main ()
4139 {
4140
4141 #ifdef NCURSES_VERSION
4142
4143 printf("%s\n", NCURSES_VERSION);
4144 #else
4145 #ifdef __NCURSES_H
4146 printf("old\n");
4147 #else
4148         make an error
4149 #endif
4150 #endif
4151
4152   ;
4153   return 0;
4154 }
4155 _ACEOF
4156 rm -f conftest.$ac_objext
4157 if { (eval echo "$as_me:4157: \"$ac_compile\"") >&5
4158   (eval $ac_compile) 2>&5
4159   ac_status=$?
4160   echo "$as_me:4160: \$? = $ac_status" >&5
4161   (exit $ac_status); } &&
4162          { ac_try='test -s conftest.$ac_objext'
4163   { (eval echo "$as_me:4163: \"$ac_try\"") >&5
4164   (eval $ac_try) 2>&5
4165   ac_status=$?
4166   echo "$as_me:4166: \$? = $ac_status" >&5
4167   (exit $ac_status); }; }; then
4168   cf_cv_ncurses_h=$cf_header
4169
4170 else
4171   echo "$as_me: failed program was:" >&5
4172 cat conftest.$ac_ext >&5
4173 cf_cv_ncurses_h=no
4174 fi
4175 rm -f conftest.$ac_objext conftest.$ac_ext
4176
4177                 test "$cf_cv_ncurses_h" != no && break
4178         done
4179
4180 fi
4181 echo "$as_me:4181: result: $cf_cv_ncurses_h" >&5
4182 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4183
4184 if test "$cf_cv_ncurses_h" != no ; then
4185         cf_cv_ncurses_header=$cf_cv_ncurses_h
4186 else
4187
4188 echo "$as_me:4188: checking for $cf_ncuhdr_root include-path" >&5
4189 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4190 if test "${cf_cv_ncurses_h2+set}" = set; then
4191   echo $ECHO_N "(cached) $ECHO_C" >&6
4192 else
4193
4194         test -n "$verbose" && echo
4195
4196 cf_search=
4197
4198 # collect the current set of include-directories from compiler flags
4199 cf_header_path_list=""
4200 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4201         for cf_header_path in $CPPFLAGS $CFLAGS
4202         do
4203                 case $cf_header_path in
4204                 (-I*)
4205                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4206
4207 test "x$cf_header_path" != "xNONE" && \
4208 test -d "$cf_header_path" && \
4209  {
4210         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4211         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4212         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4213         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4214         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4215         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"
4216 }
4217
4218                         cf_header_path_list="$cf_header_path_list $cf_search"
4219                         ;;
4220                 esac
4221         done
4222 fi
4223
4224 # add the variations for the package we are looking for
4225
4226 cf_search=
4227
4228 test "x$prefix" != "xNONE" && \
4229 test -d "$prefix" && \
4230  {
4231         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4232         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4233         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4234         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4235         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4236         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4237 }
4238
4239 for cf_subdir_prefix in \
4240         /usr \
4241         /usr/local \
4242         /usr/pkg \
4243         /opt \
4244         /opt/local \
4245         $HOME
4246 do
4247
4248 test "x$cf_subdir_prefix" != "x$prefix" && \
4249 test -d "$cf_subdir_prefix" && \
4250 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4251         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4252         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4253         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4254         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4255         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4256         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"
4257 }
4258
4259 done
4260
4261 test "$includedir" != NONE && \
4262 test "$includedir" != "/usr/include" && \
4263 test -d "$includedir" && {
4264         test -d $includedir &&    cf_search="$cf_search $includedir"
4265         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4266 }
4267
4268 test "$oldincludedir" != NONE && \
4269 test "$oldincludedir" != "/usr/include" && \
4270 test -d "$oldincludedir" && {
4271         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4272         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4273 }
4274
4275 cf_search="$cf_search $cf_header_path_list"
4276
4277         test -n "$verbose" && echo search path $cf_search
4278         cf_save2_CPPFLAGS="$CPPFLAGS"
4279         for cf_incdir in $cf_search
4280         do
4281
4282 if test -n "$cf_incdir" ; then
4283   for cf_add_incdir in $cf_incdir
4284   do
4285         while test $cf_add_incdir != /usr/include
4286         do
4287           if test -d $cf_add_incdir
4288           then
4289                 cf_have_incdir=no
4290                 if test -n "$CFLAGS$CPPFLAGS" ; then
4291                   # a loop is needed to ensure we can add subdirs of existing dirs
4292                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4293                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4294                           cf_have_incdir=yes; break
4295                         fi
4296                   done
4297                 fi
4298
4299                 if test "$cf_have_incdir" = no ; then
4300                   if test "$cf_add_incdir" = /usr/local/include ; then
4301                         if test "$GCC" = yes
4302                         then
4303                           cf_save_CPPFLAGS=$CPPFLAGS
4304                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4305                           cat >conftest.$ac_ext <<_ACEOF
4306 #line 4306 "configure"
4307 #include "confdefs.h"
4308 #include <stdio.h>
4309 int
4310 main ()
4311 {
4312 printf("Hello")
4313   ;
4314   return 0;
4315 }
4316 _ACEOF
4317 rm -f conftest.$ac_objext
4318 if { (eval echo "$as_me:4318: \"$ac_compile\"") >&5
4319   (eval $ac_compile) 2>&5
4320   ac_status=$?
4321   echo "$as_me:4321: \$? = $ac_status" >&5
4322   (exit $ac_status); } &&
4323          { ac_try='test -s conftest.$ac_objext'
4324   { (eval echo "$as_me:4324: \"$ac_try\"") >&5
4325   (eval $ac_try) 2>&5
4326   ac_status=$?
4327   echo "$as_me:4327: \$? = $ac_status" >&5
4328   (exit $ac_status); }; }; then
4329   :
4330 else
4331   echo "$as_me: failed program was:" >&5
4332 cat conftest.$ac_ext >&5
4333 cf_have_incdir=yes
4334 fi
4335 rm -f conftest.$ac_objext conftest.$ac_ext
4336                           CPPFLAGS=$cf_save_CPPFLAGS
4337                         fi
4338                   fi
4339                 fi
4340
4341                 if test "$cf_have_incdir" = no ; then
4342                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4343
4344 echo "${as_me:-configure}:4344: testing adding $cf_add_incdir to include-path ..." 1>&5
4345
4346                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4347
4348                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4349                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4350                   cf_add_incdir="$cf_top_incdir"
4351                 else
4352                   break
4353                 fi
4354           else
4355                 break
4356           fi
4357         done
4358   done
4359 fi
4360
4361                 for cf_header in \
4362                         ncurses.h \
4363                         curses.h
4364                 do
4365
4366         cat >conftest.$ac_ext <<_ACEOF
4367 #line 4367 "configure"
4368 #include "confdefs.h"
4369
4370 #include <$cf_header>
4371 int
4372 main ()
4373 {
4374
4375 #ifdef NCURSES_VERSION
4376
4377 printf("%s\n", NCURSES_VERSION);
4378 #else
4379 #ifdef __NCURSES_H
4380 printf("old\n");
4381 #else
4382         make an error
4383 #endif
4384 #endif
4385
4386   ;
4387   return 0;
4388 }
4389 _ACEOF
4390 rm -f conftest.$ac_objext
4391 if { (eval echo "$as_me:4391: \"$ac_compile\"") >&5
4392   (eval $ac_compile) 2>&5
4393   ac_status=$?
4394   echo "$as_me:4394: \$? = $ac_status" >&5
4395   (exit $ac_status); } &&
4396          { ac_try='test -s conftest.$ac_objext'
4397   { (eval echo "$as_me:4397: \"$ac_try\"") >&5
4398   (eval $ac_try) 2>&5
4399   ac_status=$?
4400   echo "$as_me:4400: \$? = $ac_status" >&5
4401   (exit $ac_status); }; }; then
4402   cf_cv_ncurses_h2=$cf_header
4403
4404 else
4405   echo "$as_me: failed program was:" >&5
4406 cat conftest.$ac_ext >&5
4407 cf_cv_ncurses_h2=no
4408 fi
4409 rm -f conftest.$ac_objext conftest.$ac_ext
4410
4411                         if test "$cf_cv_ncurses_h2" != no ; then
4412                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4413                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4414                                 break
4415                         fi
4416                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4417                 done
4418                 CPPFLAGS="$cf_save2_CPPFLAGS"
4419                 test "$cf_cv_ncurses_h2" != no && break
4420         done
4421         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4421: error: not found" >&5
4422 echo "$as_me: error: not found" >&2;}
4423    { (exit 1); exit 1; }; }
4424
4425 fi
4426 echo "$as_me:4426: result: $cf_cv_ncurses_h2" >&5
4427 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4428
4429         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4430         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4431         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4432                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4433         fi
4434
4435 if test -n "$cf_1st_incdir" ; then
4436   for cf_add_incdir in $cf_1st_incdir
4437   do
4438         while test $cf_add_incdir != /usr/include
4439         do
4440           if test -d $cf_add_incdir
4441           then
4442                 cf_have_incdir=no
4443                 if test -n "$CFLAGS$CPPFLAGS" ; then
4444                   # a loop is needed to ensure we can add subdirs of existing dirs
4445                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4446                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4447                           cf_have_incdir=yes; break
4448                         fi
4449                   done
4450                 fi
4451
4452                 if test "$cf_have_incdir" = no ; then
4453                   if test "$cf_add_incdir" = /usr/local/include ; then
4454                         if test "$GCC" = yes
4455                         then
4456                           cf_save_CPPFLAGS=$CPPFLAGS
4457                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4458                           cat >conftest.$ac_ext <<_ACEOF
4459 #line 4459 "configure"
4460 #include "confdefs.h"
4461 #include <stdio.h>
4462 int
4463 main ()
4464 {
4465 printf("Hello")
4466   ;
4467   return 0;
4468 }
4469 _ACEOF
4470 rm -f conftest.$ac_objext
4471 if { (eval echo "$as_me:4471: \"$ac_compile\"") >&5
4472   (eval $ac_compile) 2>&5
4473   ac_status=$?
4474   echo "$as_me:4474: \$? = $ac_status" >&5
4475   (exit $ac_status); } &&
4476          { ac_try='test -s conftest.$ac_objext'
4477   { (eval echo "$as_me:4477: \"$ac_try\"") >&5
4478   (eval $ac_try) 2>&5
4479   ac_status=$?
4480   echo "$as_me:4480: \$? = $ac_status" >&5
4481   (exit $ac_status); }; }; then
4482   :
4483 else
4484   echo "$as_me: failed program was:" >&5
4485 cat conftest.$ac_ext >&5
4486 cf_have_incdir=yes
4487 fi
4488 rm -f conftest.$ac_objext conftest.$ac_ext
4489                           CPPFLAGS=$cf_save_CPPFLAGS
4490                         fi
4491                   fi
4492                 fi
4493
4494                 if test "$cf_have_incdir" = no ; then
4495                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4496
4497 echo "${as_me:-configure}:4497: testing adding $cf_add_incdir to include-path ..." 1>&5
4498
4499                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4500
4501                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4502                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4503                   cf_add_incdir="$cf_top_incdir"
4504                 else
4505                   break
4506                 fi
4507           else
4508                 break
4509           fi
4510         done
4511   done
4512 fi
4513
4514 fi
4515
4516 # Set definitions to allow ifdef'ing for ncurses.h
4517
4518 case $cf_cv_ncurses_header in
4519 (*ncurses.h)
4520
4521 cat >>confdefs.h <<\EOF
4522 #define HAVE_NCURSES_H 1
4523 EOF
4524
4525         ;;
4526 esac
4527
4528 case $cf_cv_ncurses_header in
4529 (ncurses/curses.h|ncurses/ncurses.h)
4530
4531 cat >>confdefs.h <<\EOF
4532 #define HAVE_NCURSES_NCURSES_H 1
4533 EOF
4534
4535         ;;
4536 (ncursesw/curses.h|ncursesw/ncurses.h)
4537
4538 cat >>confdefs.h <<\EOF
4539 #define HAVE_NCURSESW_NCURSES_H 1
4540 EOF
4541
4542         ;;
4543 esac
4544
4545 echo "$as_me:4545: checking for terminfo header" >&5
4546 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4547 if test "${cf_cv_term_header+set}" = set; then
4548   echo $ECHO_N "(cached) $ECHO_C" >&6
4549 else
4550
4551 case ${cf_cv_ncurses_header} in
4552 (*/ncurses.h|*/ncursesw.h)
4553         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4554         ;;
4555 (*)
4556         cf_term_header=term.h
4557         ;;
4558 esac
4559
4560 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4561 do
4562 cat >conftest.$ac_ext <<_ACEOF
4563 #line 4563 "configure"
4564 #include "confdefs.h"
4565 #include <stdio.h>
4566 #include <${cf_cv_ncurses_header:-curses.h}>
4567 #include <$cf_test>
4568
4569 int
4570 main ()
4571 {
4572 int x = auto_left_margin
4573   ;
4574   return 0;
4575 }
4576 _ACEOF
4577 rm -f conftest.$ac_objext
4578 if { (eval echo "$as_me:4578: \"$ac_compile\"") >&5
4579   (eval $ac_compile) 2>&5
4580   ac_status=$?
4581   echo "$as_me:4581: \$? = $ac_status" >&5
4582   (exit $ac_status); } &&
4583          { ac_try='test -s conftest.$ac_objext'
4584   { (eval echo "$as_me:4584: \"$ac_try\"") >&5
4585   (eval $ac_try) 2>&5
4586   ac_status=$?
4587   echo "$as_me:4587: \$? = $ac_status" >&5
4588   (exit $ac_status); }; }; then
4589
4590         cf_cv_term_header="$cf_test"
4591 else
4592   echo "$as_me: failed program was:" >&5
4593 cat conftest.$ac_ext >&5
4594
4595         cf_cv_term_header=unknown
4596
4597 fi
4598 rm -f conftest.$ac_objext conftest.$ac_ext
4599         test "$cf_cv_term_header" != unknown && break
4600 done
4601
4602 fi
4603 echo "$as_me:4603: result: $cf_cv_term_header" >&5
4604 echo "${ECHO_T}$cf_cv_term_header" >&6
4605
4606 # Set definitions to allow ifdef'ing to accommodate subdirectories
4607
4608 case $cf_cv_term_header in
4609 (*term.h)
4610
4611 cat >>confdefs.h <<\EOF
4612 #define HAVE_TERM_H 1
4613 EOF
4614
4615         ;;
4616 esac
4617
4618 case $cf_cv_term_header in
4619 (ncurses/term.h)
4620
4621 cat >>confdefs.h <<\EOF
4622 #define HAVE_NCURSES_TERM_H 1
4623 EOF
4624
4625         ;;
4626 (ncursesw/term.h)
4627
4628 cat >>confdefs.h <<\EOF
4629 #define HAVE_NCURSESW_TERM_H 1
4630 EOF
4631
4632         ;;
4633 esac
4634
4635 # some applications need this, but should check for NCURSES_VERSION
4636
4637 cat >>confdefs.h <<\EOF
4638 #define NCURSES 1
4639 EOF
4640
4641 echo "$as_me:4641: checking for ncurses version" >&5
4642 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4643 if test "${cf_cv_ncurses_version+set}" = set; then
4644   echo $ECHO_N "(cached) $ECHO_C" >&6
4645 else
4646
4647         cf_cv_ncurses_version=no
4648         cf_tempfile=out$$
4649         rm -f $cf_tempfile
4650         if test "$cross_compiling" = yes; then
4651
4652         # This will not work if the preprocessor splits the line after the
4653         # Autoconf token.  The 'unproto' program does that.
4654         cat > conftest.$ac_ext <<EOF
4655 #include <${cf_cv_ncurses_header:-curses.h}>
4656 #undef Autoconf
4657 #ifdef NCURSES_VERSION
4658 Autoconf NCURSES_VERSION
4659 #else
4660 #ifdef __NCURSES_H
4661 Autoconf "old"
4662 #endif
4663 ;
4664 #endif
4665 EOF
4666         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4667         { (eval echo "$as_me:4667: \"$cf_try\"") >&5
4668   (eval $cf_try) 2>&5
4669   ac_status=$?
4670   echo "$as_me:4670: \$? = $ac_status" >&5
4671   (exit $ac_status); }
4672         if test -f conftest.out ; then
4673                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4674                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4675                 rm -f conftest.out
4676         fi
4677
4678 else
4679   cat >conftest.$ac_ext <<_ACEOF
4680 #line 4680 "configure"
4681 #include "confdefs.h"
4682
4683 #include <${cf_cv_ncurses_header:-curses.h}>
4684 #include <stdio.h>
4685 int main()
4686 {
4687         FILE *fp = fopen("$cf_tempfile", "w");
4688 #ifdef NCURSES_VERSION
4689 # ifdef NCURSES_VERSION_PATCH
4690         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4691 # else
4692         fprintf(fp, "%s\n", NCURSES_VERSION);
4693 # endif
4694 #else
4695 # ifdef __NCURSES_H
4696         fprintf(fp, "old\n");
4697 # else
4698         make an error
4699 # endif
4700 #endif
4701         ${cf_cv_main_return:-return}(0);
4702 }
4703 _ACEOF
4704 rm -f conftest$ac_exeext
4705 if { (eval echo "$as_me:4705: \"$ac_link\"") >&5
4706   (eval $ac_link) 2>&5
4707   ac_status=$?
4708   echo "$as_me:4708: \$? = $ac_status" >&5
4709   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4710   { (eval echo "$as_me:4710: \"$ac_try\"") >&5
4711   (eval $ac_try) 2>&5
4712   ac_status=$?
4713   echo "$as_me:4713: \$? = $ac_status" >&5
4714   (exit $ac_status); }; }; then
4715
4716         cf_cv_ncurses_version=`cat $cf_tempfile`
4717 else
4718   echo "$as_me: program exited with status $ac_status" >&5
4719 echo "$as_me: failed program was:" >&5
4720 cat conftest.$ac_ext >&5
4721 fi
4722 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4723 fi
4724         rm -f $cf_tempfile
4725
4726 fi
4727 echo "$as_me:4727: result: $cf_cv_ncurses_version" >&5
4728 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4729 test "$cf_cv_ncurses_version" = no ||
4730 cat >>confdefs.h <<\EOF
4731 #define NCURSES 1
4732 EOF
4733
4734 cf_nculib_root=ncurses
4735         # This works, except for the special case where we find gpm, but
4736         # ncurses is in a nonstandard location via $LIBS, and we really want
4737         # to link gpm.
4738 cf_ncurses_LIBS=""
4739 cf_ncurses_SAVE="$LIBS"
4740 echo "$as_me:4740: checking for Gpm_Open in -lgpm" >&5
4741 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4742 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4743   echo $ECHO_N "(cached) $ECHO_C" >&6
4744 else
4745   ac_check_lib_save_LIBS=$LIBS
4746 LIBS="-lgpm  $LIBS"
4747 cat >conftest.$ac_ext <<_ACEOF
4748 #line 4748 "configure"
4749 #include "confdefs.h"
4750
4751 /* Override any gcc2 internal prototype to avoid an error.  */
4752 #ifdef __cplusplus
4753 extern "C"
4754 #endif
4755 /* We use char because int might match the return type of a gcc2
4756    builtin and then its argument prototype would still apply.  */
4757 char Gpm_Open ();
4758 int
4759 main ()
4760 {
4761 Gpm_Open ();
4762   ;
4763   return 0;
4764 }
4765 _ACEOF
4766 rm -f conftest.$ac_objext conftest$ac_exeext
4767 if { (eval echo "$as_me:4767: \"$ac_link\"") >&5
4768   (eval $ac_link) 2>&5
4769   ac_status=$?
4770   echo "$as_me:4770: \$? = $ac_status" >&5
4771   (exit $ac_status); } &&
4772          { ac_try='test -s conftest$ac_exeext'
4773   { (eval echo "$as_me:4773: \"$ac_try\"") >&5
4774   (eval $ac_try) 2>&5
4775   ac_status=$?
4776   echo "$as_me:4776: \$? = $ac_status" >&5
4777   (exit $ac_status); }; }; then
4778   ac_cv_lib_gpm_Gpm_Open=yes
4779 else
4780   echo "$as_me: failed program was:" >&5
4781 cat conftest.$ac_ext >&5
4782 ac_cv_lib_gpm_Gpm_Open=no
4783 fi
4784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4785 LIBS=$ac_check_lib_save_LIBS
4786 fi
4787 echo "$as_me:4787: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4788 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4789 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4790   echo "$as_me:4790: checking for initscr in -lgpm" >&5
4791 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4792 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4793   echo $ECHO_N "(cached) $ECHO_C" >&6
4794 else
4795   ac_check_lib_save_LIBS=$LIBS
4796 LIBS="-lgpm  $LIBS"
4797 cat >conftest.$ac_ext <<_ACEOF
4798 #line 4798 "configure"
4799 #include "confdefs.h"
4800
4801 /* Override any gcc2 internal prototype to avoid an error.  */
4802 #ifdef __cplusplus
4803 extern "C"
4804 #endif
4805 /* We use char because int might match the return type of a gcc2
4806    builtin and then its argument prototype would still apply.  */
4807 char initscr ();
4808 int
4809 main ()
4810 {
4811 initscr ();
4812   ;
4813   return 0;
4814 }
4815 _ACEOF
4816 rm -f conftest.$ac_objext conftest$ac_exeext
4817 if { (eval echo "$as_me:4817: \"$ac_link\"") >&5
4818   (eval $ac_link) 2>&5
4819   ac_status=$?
4820   echo "$as_me:4820: \$? = $ac_status" >&5
4821   (exit $ac_status); } &&
4822          { ac_try='test -s conftest$ac_exeext'
4823   { (eval echo "$as_me:4823: \"$ac_try\"") >&5
4824   (eval $ac_try) 2>&5
4825   ac_status=$?
4826   echo "$as_me:4826: \$? = $ac_status" >&5
4827   (exit $ac_status); }; }; then
4828   ac_cv_lib_gpm_initscr=yes
4829 else
4830   echo "$as_me: failed program was:" >&5
4831 cat conftest.$ac_ext >&5
4832 ac_cv_lib_gpm_initscr=no
4833 fi
4834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4835 LIBS=$ac_check_lib_save_LIBS
4836 fi
4837 echo "$as_me:4837: result: $ac_cv_lib_gpm_initscr" >&5
4838 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4839 if test $ac_cv_lib_gpm_initscr = yes; then
4840   LIBS="$cf_ncurses_SAVE"
4841 else
4842   cf_ncurses_LIBS="-lgpm"
4843 fi
4844
4845 fi
4846
4847 case $host_os in
4848 (freebsd*)
4849         # This is only necessary if you are linking against an obsolete
4850         # version of ncurses (but it should do no harm, since it's static).
4851         if test "$cf_nculib_root" = ncurses ; then
4852                 echo "$as_me:4852: checking for tgoto in -lmytinfo" >&5
4853 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4854 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4855   echo $ECHO_N "(cached) $ECHO_C" >&6
4856 else
4857   ac_check_lib_save_LIBS=$LIBS
4858 LIBS="-lmytinfo  $LIBS"
4859 cat >conftest.$ac_ext <<_ACEOF
4860 #line 4860 "configure"
4861 #include "confdefs.h"
4862
4863 /* Override any gcc2 internal prototype to avoid an error.  */
4864 #ifdef __cplusplus
4865 extern "C"
4866 #endif
4867 /* We use char because int might match the return type of a gcc2
4868    builtin and then its argument prototype would still apply.  */
4869 char tgoto ();
4870 int
4871 main ()
4872 {
4873 tgoto ();
4874   ;
4875   return 0;
4876 }
4877 _ACEOF
4878 rm -f conftest.$ac_objext conftest$ac_exeext
4879 if { (eval echo "$as_me:4879: \"$ac_link\"") >&5
4880   (eval $ac_link) 2>&5
4881   ac_status=$?
4882   echo "$as_me:4882: \$? = $ac_status" >&5
4883   (exit $ac_status); } &&
4884          { ac_try='test -s conftest$ac_exeext'
4885   { (eval echo "$as_me:4885: \"$ac_try\"") >&5
4886   (eval $ac_try) 2>&5
4887   ac_status=$?
4888   echo "$as_me:4888: \$? = $ac_status" >&5
4889   (exit $ac_status); }; }; then
4890   ac_cv_lib_mytinfo_tgoto=yes
4891 else
4892   echo "$as_me: failed program was:" >&5
4893 cat conftest.$ac_ext >&5
4894 ac_cv_lib_mytinfo_tgoto=no
4895 fi
4896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4897 LIBS=$ac_check_lib_save_LIBS
4898 fi
4899 echo "$as_me:4899: result: $ac_cv_lib_mytinfo_tgoto" >&5
4900 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4901 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4902   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4903 fi
4904
4905         fi
4906         ;;
4907 esac
4908
4909 cf_add_libs="$cf_ncurses_LIBS"
4910 # Filter out duplicates - this happens with badly-designed ".pc" files...
4911 for cf_add_1lib in $LIBS
4912 do
4913         for cf_add_2lib in $cf_add_libs
4914         do
4915                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4916                 then
4917                         cf_add_1lib=
4918                         break
4919                 fi
4920         done
4921         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4922 done
4923 LIBS="$cf_add_libs"
4924
4925 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4926 then
4927
4928 cf_add_libs="-l$cf_nculib_root"
4929 # Filter out duplicates - this happens with badly-designed ".pc" files...
4930 for cf_add_1lib in $LIBS
4931 do
4932         for cf_add_2lib in $cf_add_libs
4933         do
4934                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4935                 then
4936                         cf_add_1lib=
4937                         break
4938                 fi
4939         done
4940         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4941 done
4942 LIBS="$cf_add_libs"
4943
4944 else
4945
4946         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4947         cf_libdir=""
4948         echo "$as_me:4948: checking for initscr" >&5
4949 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4950 if test "${ac_cv_func_initscr+set}" = set; then
4951   echo $ECHO_N "(cached) $ECHO_C" >&6
4952 else
4953   cat >conftest.$ac_ext <<_ACEOF
4954 #line 4954 "configure"
4955 #include "confdefs.h"
4956 /* System header to define __stub macros and hopefully few prototypes,
4957     which can conflict with char initscr (); below.  */
4958 #include <assert.h>
4959 /* Override any gcc2 internal prototype to avoid an error.  */
4960 #ifdef __cplusplus
4961 extern "C"
4962 #endif
4963 /* We use char because int might match the return type of a gcc2
4964    builtin and then its argument prototype would still apply.  */
4965 char initscr ();
4966 char (*f) ();
4967
4968 int
4969 main ()
4970 {
4971 /* The GNU C library defines this for functions which it implements
4972     to always fail with ENOSYS.  Some functions are actually named
4973     something starting with __ and the normal name is an alias.  */
4974 #if defined (__stub_initscr) || defined (__stub___initscr)
4975 choke me
4976 #else
4977 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
4978 #endif
4979
4980   ;
4981   return 0;
4982 }
4983 _ACEOF
4984 rm -f conftest.$ac_objext conftest$ac_exeext
4985 if { (eval echo "$as_me:4985: \"$ac_link\"") >&5
4986   (eval $ac_link) 2>&5
4987   ac_status=$?
4988   echo "$as_me:4988: \$? = $ac_status" >&5
4989   (exit $ac_status); } &&
4990          { ac_try='test -s conftest$ac_exeext'
4991   { (eval echo "$as_me:4991: \"$ac_try\"") >&5
4992   (eval $ac_try) 2>&5
4993   ac_status=$?
4994   echo "$as_me:4994: \$? = $ac_status" >&5
4995   (exit $ac_status); }; }; then
4996   ac_cv_func_initscr=yes
4997 else
4998   echo "$as_me: failed program was:" >&5
4999 cat conftest.$ac_ext >&5
5000 ac_cv_func_initscr=no
5001 fi
5002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5003 fi
5004 echo "$as_me:5004: result: $ac_cv_func_initscr" >&5
5005 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5006 if test $ac_cv_func_initscr = yes; then
5007   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5008 else
5009
5010                 cf_save_LIBS="$LIBS"
5011                 echo "$as_me:5011: checking for initscr in -l$cf_nculib_root" >&5
5012 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5013                 LIBS="-l$cf_nculib_root $LIBS"
5014                 cat >conftest.$ac_ext <<_ACEOF
5015 #line 5015 "configure"
5016 #include "confdefs.h"
5017 #include <${cf_cv_ncurses_header:-curses.h}>
5018 int
5019 main ()
5020 {
5021 initscr()
5022   ;
5023   return 0;
5024 }
5025 _ACEOF
5026 rm -f conftest.$ac_objext conftest$ac_exeext
5027 if { (eval echo "$as_me:5027: \"$ac_link\"") >&5
5028   (eval $ac_link) 2>&5
5029   ac_status=$?
5030   echo "$as_me:5030: \$? = $ac_status" >&5
5031   (exit $ac_status); } &&
5032          { ac_try='test -s conftest$ac_exeext'
5033   { (eval echo "$as_me:5033: \"$ac_try\"") >&5
5034   (eval $ac_try) 2>&5
5035   ac_status=$?
5036   echo "$as_me:5036: \$? = $ac_status" >&5
5037   (exit $ac_status); }; }; then
5038   echo "$as_me:5038: result: yes" >&5
5039 echo "${ECHO_T}yes" >&6
5040                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5041
5042 else
5043   echo "$as_me: failed program was:" >&5
5044 cat conftest.$ac_ext >&5
5045 echo "$as_me:5045: result: no" >&5
5046 echo "${ECHO_T}no" >&6
5047
5048 cf_search=
5049 cf_library_path_list=""
5050 if test -n "${LDFLAGS}${LIBS}" ; then
5051         for cf_library_path in $LDFLAGS $LIBS
5052         do
5053                 case $cf_library_path in
5054                 (-L*)
5055                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5056
5057 test "x$cf_library_path" != "xNONE" && \
5058 test -d "$cf_library_path" && \
5059  {
5060         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5061         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5062         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5063         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5064         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5065         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"
5066 }
5067
5068                         cf_library_path_list="$cf_library_path_list $cf_search"
5069                         ;;
5070                 esac
5071         done
5072 fi
5073
5074 cf_search=
5075
5076 test "x$prefix" != "xNONE" && \
5077 test -d "$prefix" && \
5078  {
5079         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5080         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5081         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5082         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5083         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5084         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5085 }
5086
5087 for cf_subdir_prefix in \
5088         /usr \
5089         /usr/local \
5090         /usr/pkg \
5091         /opt \
5092         /opt/local \
5093         $HOME
5094 do
5095
5096 test "x$cf_subdir_prefix" != "x$prefix" && \
5097 test -d "$cf_subdir_prefix" && \
5098 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5099         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5100         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5101         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5102         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5103         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5104         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"
5105 }
5106
5107 done
5108
5109 cf_search="$cf_library_path_list $cf_search"
5110
5111                         for cf_libdir in $cf_search
5112                         do
5113                                 echo "$as_me:5113: checking for -l$cf_nculib_root in $cf_libdir" >&5
5114 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5115                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5116                                 cat >conftest.$ac_ext <<_ACEOF
5117 #line 5117 "configure"
5118 #include "confdefs.h"
5119 #include <${cf_cv_ncurses_header:-curses.h}>
5120 int
5121 main ()
5122 {
5123 initscr()
5124   ;
5125   return 0;
5126 }
5127 _ACEOF
5128 rm -f conftest.$ac_objext conftest$ac_exeext
5129 if { (eval echo "$as_me:5129: \"$ac_link\"") >&5
5130   (eval $ac_link) 2>&5
5131   ac_status=$?
5132   echo "$as_me:5132: \$? = $ac_status" >&5
5133   (exit $ac_status); } &&
5134          { ac_try='test -s conftest$ac_exeext'
5135   { (eval echo "$as_me:5135: \"$ac_try\"") >&5
5136   (eval $ac_try) 2>&5
5137   ac_status=$?
5138   echo "$as_me:5138: \$? = $ac_status" >&5
5139   (exit $ac_status); }; }; then
5140   echo "$as_me:5140: result: yes" >&5
5141 echo "${ECHO_T}yes" >&6
5142                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5143                                          break
5144 else
5145   echo "$as_me: failed program was:" >&5
5146 cat conftest.$ac_ext >&5
5147 echo "$as_me:5147: result: no" >&5
5148 echo "${ECHO_T}no" >&6
5149                                          LIBS="$cf_save_LIBS"
5150 fi
5151 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5152                         done
5153
5154 fi
5155 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5156
5157 fi
5158
5159 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5160
5161 if test $cf_found_library = no ; then
5162         { { echo "$as_me:5162: error: Cannot link $cf_nculib_root library" >&5
5163 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5164    { (exit 1); exit 1; }; }
5165 fi
5166
5167 fi
5168
5169 if test -n "$cf_ncurses_LIBS" ; then
5170         echo "$as_me:5170: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5171 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5172         cf_ncurses_SAVE="$LIBS"
5173         for p in $cf_ncurses_LIBS ; do
5174                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5175                 if test "$q" != "$LIBS" ; then
5176                         LIBS="$q"
5177                 fi
5178         done
5179         cat >conftest.$ac_ext <<_ACEOF
5180 #line 5180 "configure"
5181 #include "confdefs.h"
5182 #include <${cf_cv_ncurses_header:-curses.h}>
5183 int
5184 main ()
5185 {
5186 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5187   ;
5188   return 0;
5189 }
5190 _ACEOF
5191 rm -f conftest.$ac_objext conftest$ac_exeext
5192 if { (eval echo "$as_me:5192: \"$ac_link\"") >&5
5193   (eval $ac_link) 2>&5
5194   ac_status=$?
5195   echo "$as_me:5195: \$? = $ac_status" >&5
5196   (exit $ac_status); } &&
5197          { ac_try='test -s conftest$ac_exeext'
5198   { (eval echo "$as_me:5198: \"$ac_try\"") >&5
5199   (eval $ac_try) 2>&5
5200   ac_status=$?
5201   echo "$as_me:5201: \$? = $ac_status" >&5
5202   (exit $ac_status); }; }; then
5203   echo "$as_me:5203: result: yes" >&5
5204 echo "${ECHO_T}yes" >&6
5205 else
5206   echo "$as_me: failed program was:" >&5
5207 cat conftest.$ac_ext >&5
5208 echo "$as_me:5208: result: no" >&5
5209 echo "${ECHO_T}no" >&6
5210                  LIBS="$cf_ncurses_SAVE"
5211 fi
5212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5213 fi
5214
5215 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5216
5217 cat >>confdefs.h <<EOF
5218 #define $cf_nculib_ROOT 1
5219 EOF
5220
5221         fi
5222 else
5223         NCURSES_CONFIG=none
5224 fi
5225
5226 echo "$as_me:5226: checking if you want wide-character code" >&5
5227 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5228
5229 # Check whether --enable-widec or --disable-widec was given.
5230 if test "${enable_widec+set}" = set; then
5231   enableval="$enable_widec"
5232   with_widec=$enableval
5233 else
5234   with_widec=no
5235 fi;
5236 echo "$as_me:5236: result: $with_widec" >&5
5237 echo "${ECHO_T}$with_widec" >&6
5238 if test "$with_widec" = yes ; then
5239
5240 echo "$as_me:5240: checking for multibyte character support" >&5
5241 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5242 if test "${cf_cv_utf8_lib+set}" = set; then
5243   echo $ECHO_N "(cached) $ECHO_C" >&6
5244 else
5245
5246         cf_save_LIBS="$LIBS"
5247         cat >conftest.$ac_ext <<_ACEOF
5248 #line 5248 "configure"
5249 #include "confdefs.h"
5250
5251 #include <stdlib.h>
5252 int
5253 main ()
5254 {
5255 putwc(0,0);
5256   ;
5257   return 0;
5258 }
5259 _ACEOF
5260 rm -f conftest.$ac_objext conftest$ac_exeext
5261 if { (eval echo "$as_me:5261: \"$ac_link\"") >&5
5262   (eval $ac_link) 2>&5
5263   ac_status=$?
5264   echo "$as_me:5264: \$? = $ac_status" >&5
5265   (exit $ac_status); } &&
5266          { ac_try='test -s conftest$ac_exeext'
5267   { (eval echo "$as_me:5267: \"$ac_try\"") >&5
5268   (eval $ac_try) 2>&5
5269   ac_status=$?
5270   echo "$as_me:5270: \$? = $ac_status" >&5
5271   (exit $ac_status); }; }; then
5272   cf_cv_utf8_lib=yes
5273 else
5274   echo "$as_me: failed program was:" >&5
5275 cat conftest.$ac_ext >&5
5276
5277 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5278 # will be set on completion of the AC_TRY_LINK below.
5279 cf_cv_header_path_utf8=
5280 cf_cv_library_path_utf8=
5281
5282 echo "${as_me:-configure}:5282: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5283
5284 cf_save_LIBS="$LIBS"
5285
5286 cat >conftest.$ac_ext <<_ACEOF
5287 #line 5287 "configure"
5288 #include "confdefs.h"
5289
5290 #include <libutf8.h>
5291 int
5292 main ()
5293 {
5294 putwc(0,0);
5295   ;
5296   return 0;
5297 }
5298 _ACEOF
5299 rm -f conftest.$ac_objext conftest$ac_exeext
5300 if { (eval echo "$as_me:5300: \"$ac_link\"") >&5
5301   (eval $ac_link) 2>&5
5302   ac_status=$?
5303   echo "$as_me:5303: \$? = $ac_status" >&5
5304   (exit $ac_status); } &&
5305          { ac_try='test -s conftest$ac_exeext'
5306   { (eval echo "$as_me:5306: \"$ac_try\"") >&5
5307   (eval $ac_try) 2>&5
5308   ac_status=$?
5309   echo "$as_me:5309: \$? = $ac_status" >&5
5310   (exit $ac_status); }; }; then
5311
5312         cf_cv_find_linkage_utf8=yes
5313         cf_cv_header_path_utf8=/usr/include
5314         cf_cv_library_path_utf8=/usr/lib
5315
5316 else
5317   echo "$as_me: failed program was:" >&5
5318 cat conftest.$ac_ext >&5
5319
5320 LIBS="-lutf8  $cf_save_LIBS"
5321
5322 cat >conftest.$ac_ext <<_ACEOF
5323 #line 5323 "configure"
5324 #include "confdefs.h"
5325
5326 #include <libutf8.h>
5327 int
5328 main ()
5329 {
5330 putwc(0,0);
5331   ;
5332   return 0;
5333 }
5334 _ACEOF
5335 rm -f conftest.$ac_objext conftest$ac_exeext
5336 if { (eval echo "$as_me:5336: \"$ac_link\"") >&5
5337   (eval $ac_link) 2>&5
5338   ac_status=$?
5339   echo "$as_me:5339: \$? = $ac_status" >&5
5340   (exit $ac_status); } &&
5341          { ac_try='test -s conftest$ac_exeext'
5342   { (eval echo "$as_me:5342: \"$ac_try\"") >&5
5343   (eval $ac_try) 2>&5
5344   ac_status=$?
5345   echo "$as_me:5345: \$? = $ac_status" >&5
5346   (exit $ac_status); }; }; then
5347
5348         cf_cv_find_linkage_utf8=yes
5349         cf_cv_header_path_utf8=/usr/include
5350         cf_cv_library_path_utf8=/usr/lib
5351         cf_cv_library_file_utf8="-lutf8"
5352
5353 else
5354   echo "$as_me: failed program was:" >&5
5355 cat conftest.$ac_ext >&5
5356
5357         cf_cv_find_linkage_utf8=no
5358         LIBS="$cf_save_LIBS"
5359
5360         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5361
5362 echo "${as_me:-configure}:5362: testing find linkage for utf8 library ..." 1>&5
5363
5364 echo "${as_me:-configure}:5364: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5365
5366         cf_save_CPPFLAGS="$CPPFLAGS"
5367         cf_test_CPPFLAGS="$CPPFLAGS"
5368
5369 cf_search=
5370
5371 # collect the current set of include-directories from compiler flags
5372 cf_header_path_list=""
5373 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5374         for cf_header_path in $CPPFLAGS $CFLAGS
5375         do
5376                 case $cf_header_path in
5377                 (-I*)
5378                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5379
5380 test "x$cf_header_path" != "xNONE" && \
5381 test -d "$cf_header_path" && \
5382  {
5383         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5384         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5385         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5386         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5387         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5388         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5389 }
5390
5391                         cf_header_path_list="$cf_header_path_list $cf_search"
5392                         ;;
5393                 esac
5394         done
5395 fi
5396
5397 # add the variations for the package we are looking for
5398
5399 cf_search=
5400
5401 test "x$prefix" != "xNONE" && \
5402 test -d "$prefix" && \
5403  {
5404         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5405         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5406         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5407         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5408         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5409         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5410 }
5411
5412 for cf_subdir_prefix in \
5413         /usr \
5414         /usr/local \
5415         /usr/pkg \
5416         /opt \
5417         /opt/local \
5418         $HOME
5419 do
5420
5421 test "x$cf_subdir_prefix" != "x$prefix" && \
5422 test -d "$cf_subdir_prefix" && \
5423 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5424         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5425         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5426         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5427         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5428         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5429         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5430 }
5431
5432 done
5433
5434 test "$includedir" != NONE && \
5435 test "$includedir" != "/usr/include" && \
5436 test -d "$includedir" && {
5437         test -d $includedir &&    cf_search="$cf_search $includedir"
5438         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5439 }
5440
5441 test "$oldincludedir" != NONE && \
5442 test "$oldincludedir" != "/usr/include" && \
5443 test -d "$oldincludedir" && {
5444         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5445         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5446 }
5447
5448 cf_search="$cf_search $cf_header_path_list"
5449
5450         for cf_cv_header_path_utf8 in $cf_search
5451         do
5452                 if test -d $cf_cv_header_path_utf8 ; then
5453                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5454
5455 echo "${as_me:-configure}:5455: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5456
5457                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5458                         cat >conftest.$ac_ext <<_ACEOF
5459 #line 5459 "configure"
5460 #include "confdefs.h"
5461
5462 #include <libutf8.h>
5463 int
5464 main ()
5465 {
5466 putwc(0,0);
5467   ;
5468   return 0;
5469 }
5470 _ACEOF
5471 rm -f conftest.$ac_objext
5472 if { (eval echo "$as_me:5472: \"$ac_compile\"") >&5
5473   (eval $ac_compile) 2>&5
5474   ac_status=$?
5475   echo "$as_me:5475: \$? = $ac_status" >&5
5476   (exit $ac_status); } &&
5477          { ac_try='test -s conftest.$ac_objext'
5478   { (eval echo "$as_me:5478: \"$ac_try\"") >&5
5479   (eval $ac_try) 2>&5
5480   ac_status=$?
5481   echo "$as_me:5481: \$? = $ac_status" >&5
5482   (exit $ac_status); }; }; then
5483
5484                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5485
5486 echo "${as_me:-configure}:5486: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5487
5488                                 cf_cv_find_linkage_utf8=maybe
5489                                 cf_test_CPPFLAGS="$CPPFLAGS"
5490                                 break
5491 else
5492   echo "$as_me: failed program was:" >&5
5493 cat conftest.$ac_ext >&5
5494
5495                                 CPPFLAGS="$cf_save_CPPFLAGS"
5496
5497 fi
5498 rm -f conftest.$ac_objext conftest.$ac_ext
5499                 fi
5500         done
5501
5502         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5503
5504 echo "${as_me:-configure}:5504: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5505
5506                 cf_save_LIBS="$LIBS"
5507                 cf_save_LDFLAGS="$LDFLAGS"
5508
5509                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5510
5511 cf_search=
5512 cf_library_path_list=""
5513 if test -n "${LDFLAGS}${LIBS}" ; then
5514         for cf_library_path in $LDFLAGS $LIBS
5515         do
5516                 case $cf_library_path in
5517                 (-L*)
5518                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5519
5520 test "x$cf_library_path" != "xNONE" && \
5521 test -d "$cf_library_path" && \
5522  {
5523         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5524         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5525         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5526         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5527         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5528         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5529 }
5530
5531                         cf_library_path_list="$cf_library_path_list $cf_search"
5532                         ;;
5533                 esac
5534         done
5535 fi
5536
5537 cf_search=
5538
5539 test "x$prefix" != "xNONE" && \
5540 test -d "$prefix" && \
5541  {
5542         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5543         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5544         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5545         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5546         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5547         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5548 }
5549
5550 for cf_subdir_prefix in \
5551         /usr \
5552         /usr/local \
5553         /usr/pkg \
5554         /opt \
5555         /opt/local \
5556         $HOME
5557 do
5558
5559 test "x$cf_subdir_prefix" != "x$prefix" && \
5560 test -d "$cf_subdir_prefix" && \
5561 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5562         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5563         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5564         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5565         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5566         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5567         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5568 }
5569
5570 done
5571
5572 cf_search="$cf_library_path_list $cf_search"
5573
5574                         for cf_cv_library_path_utf8 in $cf_search
5575                         do
5576                                 if test -d $cf_cv_library_path_utf8 ; then
5577                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5578
5579 echo "${as_me:-configure}:5579: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5580
5581                                         CPPFLAGS="$cf_test_CPPFLAGS"
5582                                         LIBS="-lutf8  $cf_save_LIBS"
5583                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5584                                         cat >conftest.$ac_ext <<_ACEOF
5585 #line 5585 "configure"
5586 #include "confdefs.h"
5587
5588 #include <libutf8.h>
5589 int
5590 main ()
5591 {
5592 putwc(0,0);
5593   ;
5594   return 0;
5595 }
5596 _ACEOF
5597 rm -f conftest.$ac_objext conftest$ac_exeext
5598 if { (eval echo "$as_me:5598: \"$ac_link\"") >&5
5599   (eval $ac_link) 2>&5
5600   ac_status=$?
5601   echo "$as_me:5601: \$? = $ac_status" >&5
5602   (exit $ac_status); } &&
5603          { ac_try='test -s conftest$ac_exeext'
5604   { (eval echo "$as_me:5604: \"$ac_try\"") >&5
5605   (eval $ac_try) 2>&5
5606   ac_status=$?
5607   echo "$as_me:5607: \$? = $ac_status" >&5
5608   (exit $ac_status); }; }; then
5609
5610                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5611
5612 echo "${as_me:-configure}:5612: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5613
5614                                         cf_cv_find_linkage_utf8=yes
5615                                         cf_cv_library_file_utf8="-lutf8"
5616                                         break
5617 else
5618   echo "$as_me: failed program was:" >&5
5619 cat conftest.$ac_ext >&5
5620
5621                                         CPPFLAGS="$cf_save_CPPFLAGS"
5622                                         LIBS="$cf_save_LIBS"
5623                                         LDFLAGS="$cf_save_LDFLAGS"
5624
5625 fi
5626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5627                                 fi
5628                         done
5629                         CPPFLAGS="$cf_save_CPPFLAGS"
5630                         LDFLAGS="$cf_save_LDFLAGS"
5631                 fi
5632
5633         else
5634                 cf_cv_find_linkage_utf8=no
5635         fi
5636
5637 fi
5638 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5639
5640 fi
5641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5642
5643 LIBS="$cf_save_LIBS"
5644
5645 if test "$cf_cv_find_linkage_utf8" = yes ; then
5646 cf_cv_utf8_lib=add-on
5647 else
5648 cf_cv_utf8_lib=no
5649 fi
5650
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653 fi
5654 echo "$as_me:5654: result: $cf_cv_utf8_lib" >&5
5655 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5656
5657 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5658 # ncurses/ncursesw:
5659 if test "$cf_cv_utf8_lib" = "add-on" ; then
5660
5661 cat >>confdefs.h <<\EOF
5662 #define HAVE_LIBUTF8_H 1
5663 EOF
5664
5665 if test -n "$cf_cv_header_path_utf8" ; then
5666   for cf_add_incdir in $cf_cv_header_path_utf8
5667   do
5668         while test $cf_add_incdir != /usr/include
5669         do
5670           if test -d $cf_add_incdir
5671           then
5672                 cf_have_incdir=no
5673                 if test -n "$CFLAGS$CPPFLAGS" ; then
5674                   # a loop is needed to ensure we can add subdirs of existing dirs
5675                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5676                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5677                           cf_have_incdir=yes; break
5678                         fi
5679                   done
5680                 fi
5681
5682                 if test "$cf_have_incdir" = no ; then
5683                   if test "$cf_add_incdir" = /usr/local/include ; then
5684                         if test "$GCC" = yes
5685                         then
5686                           cf_save_CPPFLAGS=$CPPFLAGS
5687                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5688                           cat >conftest.$ac_ext <<_ACEOF
5689 #line 5689 "configure"
5690 #include "confdefs.h"
5691 #include <stdio.h>
5692 int
5693 main ()
5694 {
5695 printf("Hello")
5696   ;
5697   return 0;
5698 }
5699 _ACEOF
5700 rm -f conftest.$ac_objext
5701 if { (eval echo "$as_me:5701: \"$ac_compile\"") >&5
5702   (eval $ac_compile) 2>&5
5703   ac_status=$?
5704   echo "$as_me:5704: \$? = $ac_status" >&5
5705   (exit $ac_status); } &&
5706          { ac_try='test -s conftest.$ac_objext'
5707   { (eval echo "$as_me:5707: \"$ac_try\"") >&5
5708   (eval $ac_try) 2>&5
5709   ac_status=$?
5710   echo "$as_me:5710: \$? = $ac_status" >&5
5711   (exit $ac_status); }; }; then
5712   :
5713 else
5714   echo "$as_me: failed program was:" >&5
5715 cat conftest.$ac_ext >&5
5716 cf_have_incdir=yes
5717 fi
5718 rm -f conftest.$ac_objext conftest.$ac_ext
5719                           CPPFLAGS=$cf_save_CPPFLAGS
5720                         fi
5721                   fi
5722                 fi
5723
5724                 if test "$cf_have_incdir" = no ; then
5725                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5726
5727 echo "${as_me:-configure}:5727: testing adding $cf_add_incdir to include-path ..." 1>&5
5728
5729                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5730
5731                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5732                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5733                   cf_add_incdir="$cf_top_incdir"
5734                 else
5735                   break
5736                 fi
5737           else
5738                 break
5739           fi
5740         done
5741   done
5742 fi
5743
5744 if test -n "$cf_cv_library_path_utf8" ; then
5745         for cf_add_libdir in $cf_cv_library_path_utf8
5746         do
5747                 if test $cf_add_libdir = /usr/lib ; then
5748                         :
5749                 elif test -d $cf_add_libdir
5750                 then
5751                         cf_have_libdir=no
5752                         if test -n "$LDFLAGS$LIBS" ; then
5753                                 # a loop is needed to ensure we can add subdirs of existing dirs
5754                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5755                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5756                                                 cf_have_libdir=yes; break
5757                                         fi
5758                                 done
5759                         fi
5760                         if test "$cf_have_libdir" = no ; then
5761                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5762
5763 echo "${as_me:-configure}:5763: testing adding $cf_add_libdir to library-path ..." 1>&5
5764
5765                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5766                         fi
5767                 fi
5768         done
5769 fi
5770
5771 cf_add_libs="$cf_cv_library_file_utf8"
5772 # Filter out duplicates - this happens with badly-designed ".pc" files...
5773 for cf_add_1lib in $LIBS
5774 do
5775         for cf_add_2lib in $cf_add_libs
5776         do
5777                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5778                 then
5779                         cf_add_1lib=
5780                         break
5781                 fi
5782         done
5783         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5784 done
5785 LIBS="$cf_add_libs"
5786
5787 fi
5788
5789 cf_ncuconfig_root=ncursesw
5790 cf_have_ncuconfig=no
5791
5792 if test "x${PKG_CONFIG:=none}" != xnone; then
5793         echo "$as_me:5793: checking pkg-config for $cf_ncuconfig_root" >&5
5794 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5795         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5796                 echo "$as_me:5796: result: yes" >&5
5797 echo "${ECHO_T}yes" >&6
5798
5799                 echo "$as_me:5799: checking if the $cf_ncuconfig_root package files work" >&5
5800 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5801                 cf_have_ncuconfig=unknown
5802
5803                 cf_save_CPPFLAGS="$CPPFLAGS"
5804                 cf_save_LIBS="$LIBS"
5805
5806                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5807
5808 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5809 # Filter out duplicates - this happens with badly-designed ".pc" files...
5810 for cf_add_1lib in $LIBS
5811 do
5812         for cf_add_2lib in $cf_add_libs
5813         do
5814                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5815                 then
5816                         cf_add_1lib=
5817                         break
5818                 fi
5819         done
5820         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5821 done
5822 LIBS="$cf_add_libs"
5823
5824                 cat >conftest.$ac_ext <<_ACEOF
5825 #line 5825 "configure"
5826 #include "confdefs.h"
5827 #include <${cf_cv_ncurses_header:-curses.h}>
5828 int
5829 main ()
5830 {
5831 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5832   ;
5833   return 0;
5834 }
5835 _ACEOF
5836 rm -f conftest.$ac_objext conftest$ac_exeext
5837 if { (eval echo "$as_me:5837: \"$ac_link\"") >&5
5838   (eval $ac_link) 2>&5
5839   ac_status=$?
5840   echo "$as_me:5840: \$? = $ac_status" >&5
5841   (exit $ac_status); } &&
5842          { ac_try='test -s conftest$ac_exeext'
5843   { (eval echo "$as_me:5843: \"$ac_try\"") >&5
5844   (eval $ac_try) 2>&5
5845   ac_status=$?
5846   echo "$as_me:5846: \$? = $ac_status" >&5
5847   (exit $ac_status); }; }; then
5848   if test "$cross_compiling" = yes; then
5849   cf_have_ncuconfig=maybe
5850 else
5851   cat >conftest.$ac_ext <<_ACEOF
5852 #line 5852 "configure"
5853 #include "confdefs.h"
5854 #include <${cf_cv_ncurses_header:-curses.h}>
5855                                 int main(void)
5856                                 { char *xx = curses_version(); return (xx == 0); }
5857 _ACEOF
5858 rm -f conftest$ac_exeext
5859 if { (eval echo "$as_me:5859: \"$ac_link\"") >&5
5860   (eval $ac_link) 2>&5
5861   ac_status=$?
5862   echo "$as_me:5862: \$? = $ac_status" >&5
5863   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5864   { (eval echo "$as_me:5864: \"$ac_try\"") >&5
5865   (eval $ac_try) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); }; }; then
5869   cf_have_ncuconfig=yes
5870 else
5871   echo "$as_me: program exited with status $ac_status" >&5
5872 echo "$as_me: failed program was:" >&5
5873 cat conftest.$ac_ext >&5
5874 cf_have_ncuconfig=no
5875 fi
5876 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5877 fi
5878 else
5879   echo "$as_me: failed program was:" >&5
5880 cat conftest.$ac_ext >&5
5881 cf_have_ncuconfig=no
5882 fi
5883 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5884                 echo "$as_me:5884: result: $cf_have_ncuconfig" >&5
5885 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5886                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5887                 if test "$cf_have_ncuconfig" != "yes"
5888                 then
5889                         CPPFLAGS="$cf_save_CPPFLAGS"
5890                         LIBS="$cf_save_LIBS"
5891                         NCURSES_CONFIG_PKG=none
5892                 else
5893
5894 cat >>confdefs.h <<\EOF
5895 #define NCURSES 1
5896 EOF
5897
5898                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5899                 fi
5900
5901         else
5902                 echo "$as_me:5902: result: no" >&5
5903 echo "${ECHO_T}no" >&6
5904                 NCURSES_CONFIG_PKG=none
5905         fi
5906 else
5907         NCURSES_CONFIG_PKG=none
5908 fi
5909
5910 if test "x$cf_have_ncuconfig" = "xno"; then
5911         echo "Looking for ${cf_ncuconfig_root}-config"
5912
5913 if test -n "$ac_tool_prefix"; then
5914   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5915   do
5916     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5917 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5918 echo "$as_me:5918: checking for $ac_word" >&5
5919 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5920 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5921   echo $ECHO_N "(cached) $ECHO_C" >&6
5922 else
5923   if test -n "$NCURSES_CONFIG"; then
5924   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5925 else
5926   ac_save_IFS=$IFS; IFS=$ac_path_separator
5927 ac_dummy="$PATH"
5928 for ac_dir in $ac_dummy; do
5929   IFS=$ac_save_IFS
5930   test -z "$ac_dir" && ac_dir=.
5931   $as_executable_p "$ac_dir/$ac_word" || continue
5932 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5933 echo "$as_me:5933: found $ac_dir/$ac_word" >&5
5934 break
5935 done
5936
5937 fi
5938 fi
5939 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5940 if test -n "$NCURSES_CONFIG"; then
5941   echo "$as_me:5941: result: $NCURSES_CONFIG" >&5
5942 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5943 else
5944   echo "$as_me:5944: result: no" >&5
5945 echo "${ECHO_T}no" >&6
5946 fi
5947
5948     test -n "$NCURSES_CONFIG" && break
5949   done
5950 fi
5951 if test -z "$NCURSES_CONFIG"; then
5952   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5953   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5954 do
5955   # Extract the first word of "$ac_prog", so it can be a program name with args.
5956 set dummy $ac_prog; ac_word=$2
5957 echo "$as_me:5957: checking for $ac_word" >&5
5958 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5959 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
5960   echo $ECHO_N "(cached) $ECHO_C" >&6
5961 else
5962   if test -n "$ac_ct_NCURSES_CONFIG"; then
5963   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
5964 else
5965   ac_save_IFS=$IFS; IFS=$ac_path_separator
5966 ac_dummy="$PATH"
5967 for ac_dir in $ac_dummy; do
5968   IFS=$ac_save_IFS
5969   test -z "$ac_dir" && ac_dir=.
5970   $as_executable_p "$ac_dir/$ac_word" || continue
5971 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
5972 echo "$as_me:5972: found $ac_dir/$ac_word" >&5
5973 break
5974 done
5975
5976 fi
5977 fi
5978 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
5979 if test -n "$ac_ct_NCURSES_CONFIG"; then
5980   echo "$as_me:5980: result: $ac_ct_NCURSES_CONFIG" >&5
5981 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
5982 else
5983   echo "$as_me:5983: result: no" >&5
5984 echo "${ECHO_T}no" >&6
5985 fi
5986
5987   test -n "$ac_ct_NCURSES_CONFIG" && break
5988 done
5989 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
5990
5991   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
5992 fi
5993
5994         if test "$NCURSES_CONFIG" != none ; then
5995
5996                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
5997
5998 cf_add_libs="`$NCURSES_CONFIG --libs`"
5999 # Filter out duplicates - this happens with badly-designed ".pc" files...
6000 for cf_add_1lib in $LIBS
6001 do
6002         for cf_add_2lib in $cf_add_libs
6003         do
6004                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6005                 then
6006                         cf_add_1lib=
6007                         break
6008                 fi
6009         done
6010         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6011 done
6012 LIBS="$cf_add_libs"
6013
6014                 # even with config script, some packages use no-override for curses.h
6015
6016 echo "$as_me:6016: checking if we have identified curses headers" >&5
6017 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6018 if test "${cf_cv_ncurses_header+set}" = set; then
6019   echo $ECHO_N "(cached) $ECHO_C" >&6
6020 else
6021
6022 cf_cv_ncurses_header=none
6023 for cf_header in \
6024         ncurses.h ncursesw/ncurses.h \
6025         curses.h ncursesw/curses.h
6026 do
6027 cat >conftest.$ac_ext <<_ACEOF
6028 #line 6028 "configure"
6029 #include "confdefs.h"
6030 #include <${cf_header}>
6031 int
6032 main ()
6033 {
6034 initscr(); tgoto("?", 0,0)
6035   ;
6036   return 0;
6037 }
6038 _ACEOF
6039 rm -f conftest.$ac_objext
6040 if { (eval echo "$as_me:6040: \"$ac_compile\"") >&5
6041   (eval $ac_compile) 2>&5
6042   ac_status=$?
6043   echo "$as_me:6043: \$? = $ac_status" >&5
6044   (exit $ac_status); } &&
6045          { ac_try='test -s conftest.$ac_objext'
6046   { (eval echo "$as_me:6046: \"$ac_try\"") >&5
6047   (eval $ac_try) 2>&5
6048   ac_status=$?
6049   echo "$as_me:6049: \$? = $ac_status" >&5
6050   (exit $ac_status); }; }; then
6051   cf_cv_ncurses_header=$cf_header; break
6052 else
6053   echo "$as_me: failed program was:" >&5
6054 cat conftest.$ac_ext >&5
6055 fi
6056 rm -f conftest.$ac_objext conftest.$ac_ext
6057 done
6058
6059 fi
6060 echo "$as_me:6060: result: $cf_cv_ncurses_header" >&5
6061 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6062
6063 if test "$cf_cv_ncurses_header" = none ; then
6064         { { echo "$as_me:6064: error: No curses header-files found" >&5
6065 echo "$as_me: error: No curses header-files found" >&2;}
6066    { (exit 1); exit 1; }; }
6067 fi
6068
6069 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6070
6071 for ac_header in $cf_cv_ncurses_header
6072 do
6073 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6074 echo "$as_me:6074: checking for $ac_header" >&5
6075 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6076 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6077   echo $ECHO_N "(cached) $ECHO_C" >&6
6078 else
6079   cat >conftest.$ac_ext <<_ACEOF
6080 #line 6080 "configure"
6081 #include "confdefs.h"
6082 #include <$ac_header>
6083 _ACEOF
6084 if { (eval echo "$as_me:6084: \"$ac_cpp conftest.$ac_ext\"") >&5
6085   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6086   ac_status=$?
6087   egrep -v '^ *\+' conftest.er1 >conftest.err
6088   rm -f conftest.er1
6089   cat conftest.err >&5
6090   echo "$as_me:6090: \$? = $ac_status" >&5
6091   (exit $ac_status); } >/dev/null; then
6092   if test -s conftest.err; then
6093     ac_cpp_err=$ac_c_preproc_warn_flag
6094   else
6095     ac_cpp_err=
6096   fi
6097 else
6098   ac_cpp_err=yes
6099 fi
6100 if test -z "$ac_cpp_err"; then
6101   eval "$as_ac_Header=yes"
6102 else
6103   echo "$as_me: failed program was:" >&5
6104   cat conftest.$ac_ext >&5
6105   eval "$as_ac_Header=no"
6106 fi
6107 rm -f conftest.err conftest.$ac_ext
6108 fi
6109 echo "$as_me:6109: result: `eval echo '${'$as_ac_Header'}'`" >&5
6110 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6111 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6112   cat >>confdefs.h <<EOF
6113 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6114 EOF
6115
6116 fi
6117 done
6118
6119 cat >>confdefs.h <<\EOF
6120 #define NCURSES 1
6121 EOF
6122
6123 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6124
6125                 cat >>confdefs.h <<EOF
6126 #define $cf_nculib_ROOT 1
6127 EOF
6128
6129                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6130
6131         else
6132
6133 cf_ncuhdr_root=ncursesw
6134
6135 test -n "$cf_cv_curses_dir" && \
6136 test "$cf_cv_curses_dir" != "no" && { \
6137
6138 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6139   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6140   do
6141         while test $cf_add_incdir != /usr/include
6142         do
6143           if test -d $cf_add_incdir
6144           then
6145                 cf_have_incdir=no
6146                 if test -n "$CFLAGS$CPPFLAGS" ; then
6147                   # a loop is needed to ensure we can add subdirs of existing dirs
6148                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6149                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6150                           cf_have_incdir=yes; break
6151                         fi
6152                   done
6153                 fi
6154
6155                 if test "$cf_have_incdir" = no ; then
6156                   if test "$cf_add_incdir" = /usr/local/include ; then
6157                         if test "$GCC" = yes
6158                         then
6159                           cf_save_CPPFLAGS=$CPPFLAGS
6160                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6161                           cat >conftest.$ac_ext <<_ACEOF
6162 #line 6162 "configure"
6163 #include "confdefs.h"
6164 #include <stdio.h>
6165 int
6166 main ()
6167 {
6168 printf("Hello")
6169   ;
6170   return 0;
6171 }
6172 _ACEOF
6173 rm -f conftest.$ac_objext
6174 if { (eval echo "$as_me:6174: \"$ac_compile\"") >&5
6175   (eval $ac_compile) 2>&5
6176   ac_status=$?
6177   echo "$as_me:6177: \$? = $ac_status" >&5
6178   (exit $ac_status); } &&
6179          { ac_try='test -s conftest.$ac_objext'
6180   { (eval echo "$as_me:6180: \"$ac_try\"") >&5
6181   (eval $ac_try) 2>&5
6182   ac_status=$?
6183   echo "$as_me:6183: \$? = $ac_status" >&5
6184   (exit $ac_status); }; }; then
6185   :
6186 else
6187   echo "$as_me: failed program was:" >&5
6188 cat conftest.$ac_ext >&5
6189 cf_have_incdir=yes
6190 fi
6191 rm -f conftest.$ac_objext conftest.$ac_ext
6192                           CPPFLAGS=$cf_save_CPPFLAGS
6193                         fi
6194                   fi
6195                 fi
6196
6197                 if test "$cf_have_incdir" = no ; then
6198                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6199
6200 echo "${as_me:-configure}:6200: testing adding $cf_add_incdir to include-path ..." 1>&5
6201
6202                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6203
6204                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6205                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6206                   cf_add_incdir="$cf_top_incdir"
6207                 else
6208                   break
6209                 fi
6210           else
6211                 break
6212           fi
6213         done
6214   done
6215 fi
6216
6217 }
6218
6219 echo "$as_me:6219: checking for $cf_ncuhdr_root header in include-path" >&5
6220 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6221 if test "${cf_cv_ncurses_h+set}" = set; then
6222   echo $ECHO_N "(cached) $ECHO_C" >&6
6223 else
6224
6225         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6226         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6227         for cf_header in $cf_header_list
6228         do
6229
6230         cat >conftest.$ac_ext <<_ACEOF
6231 #line 6231 "configure"
6232 #include "confdefs.h"
6233
6234 #define _XOPEN_SOURCE_EXTENDED
6235 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6236 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6237
6238 #include <$cf_header>
6239 int
6240 main ()
6241 {
6242
6243 #ifdef NCURSES_VERSION
6244
6245 #ifndef WACS_BSSB
6246         make an error
6247 #endif
6248
6249 printf("%s\n", NCURSES_VERSION);
6250 #else
6251 #ifdef __NCURSES_H
6252 printf("old\n");
6253 #else
6254         make an error
6255 #endif
6256 #endif
6257
6258   ;
6259   return 0;
6260 }
6261 _ACEOF
6262 rm -f conftest.$ac_objext
6263 if { (eval echo "$as_me:6263: \"$ac_compile\"") >&5
6264   (eval $ac_compile) 2>&5
6265   ac_status=$?
6266   echo "$as_me:6266: \$? = $ac_status" >&5
6267   (exit $ac_status); } &&
6268          { ac_try='test -s conftest.$ac_objext'
6269   { (eval echo "$as_me:6269: \"$ac_try\"") >&5
6270   (eval $ac_try) 2>&5
6271   ac_status=$?
6272   echo "$as_me:6272: \$? = $ac_status" >&5
6273   (exit $ac_status); }; }; then
6274   cf_cv_ncurses_h=$cf_header
6275
6276 else
6277   echo "$as_me: failed program was:" >&5
6278 cat conftest.$ac_ext >&5
6279 cf_cv_ncurses_h=no
6280 fi
6281 rm -f conftest.$ac_objext conftest.$ac_ext
6282
6283                 test "$cf_cv_ncurses_h" != no && break
6284         done
6285
6286 fi
6287 echo "$as_me:6287: result: $cf_cv_ncurses_h" >&5
6288 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6289
6290 if test "$cf_cv_ncurses_h" != no ; then
6291         cf_cv_ncurses_header=$cf_cv_ncurses_h
6292 else
6293
6294 echo "$as_me:6294: checking for $cf_ncuhdr_root include-path" >&5
6295 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6296 if test "${cf_cv_ncurses_h2+set}" = set; then
6297   echo $ECHO_N "(cached) $ECHO_C" >&6
6298 else
6299
6300         test -n "$verbose" && echo
6301
6302 cf_search=
6303
6304 # collect the current set of include-directories from compiler flags
6305 cf_header_path_list=""
6306 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6307         for cf_header_path in $CPPFLAGS $CFLAGS
6308         do
6309                 case $cf_header_path in
6310                 (-I*)
6311                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6312
6313 test "x$cf_header_path" != "xNONE" && \
6314 test -d "$cf_header_path" && \
6315  {
6316         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6317         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6318         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6319         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6320         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6321         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"
6322 }
6323
6324                         cf_header_path_list="$cf_header_path_list $cf_search"
6325                         ;;
6326                 esac
6327         done
6328 fi
6329
6330 # add the variations for the package we are looking for
6331
6332 cf_search=
6333
6334 test "x$prefix" != "xNONE" && \
6335 test -d "$prefix" && \
6336  {
6337         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6338         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6339         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6340         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6341         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6342         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6343 }
6344
6345 for cf_subdir_prefix in \
6346         /usr \
6347         /usr/local \
6348         /usr/pkg \
6349         /opt \
6350         /opt/local \
6351         $HOME
6352 do
6353
6354 test "x$cf_subdir_prefix" != "x$prefix" && \
6355 test -d "$cf_subdir_prefix" && \
6356 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6357         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6358         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6359         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6360         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6361         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6362         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"
6363 }
6364
6365 done
6366
6367 test "$includedir" != NONE && \
6368 test "$includedir" != "/usr/include" && \
6369 test -d "$includedir" && {
6370         test -d $includedir &&    cf_search="$cf_search $includedir"
6371         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6372 }
6373
6374 test "$oldincludedir" != NONE && \
6375 test "$oldincludedir" != "/usr/include" && \
6376 test -d "$oldincludedir" && {
6377         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6378         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6379 }
6380
6381 cf_search="$cf_search $cf_header_path_list"
6382
6383         test -n "$verbose" && echo search path $cf_search
6384         cf_save2_CPPFLAGS="$CPPFLAGS"
6385         for cf_incdir in $cf_search
6386         do
6387
6388 if test -n "$cf_incdir" ; then
6389   for cf_add_incdir in $cf_incdir
6390   do
6391         while test $cf_add_incdir != /usr/include
6392         do
6393           if test -d $cf_add_incdir
6394           then
6395                 cf_have_incdir=no
6396                 if test -n "$CFLAGS$CPPFLAGS" ; then
6397                   # a loop is needed to ensure we can add subdirs of existing dirs
6398                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6399                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6400                           cf_have_incdir=yes; break
6401                         fi
6402                   done
6403                 fi
6404
6405                 if test "$cf_have_incdir" = no ; then
6406                   if test "$cf_add_incdir" = /usr/local/include ; then
6407                         if test "$GCC" = yes
6408                         then
6409                           cf_save_CPPFLAGS=$CPPFLAGS
6410                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6411                           cat >conftest.$ac_ext <<_ACEOF
6412 #line 6412 "configure"
6413 #include "confdefs.h"
6414 #include <stdio.h>
6415 int
6416 main ()
6417 {
6418 printf("Hello")
6419   ;
6420   return 0;
6421 }
6422 _ACEOF
6423 rm -f conftest.$ac_objext
6424 if { (eval echo "$as_me:6424: \"$ac_compile\"") >&5
6425   (eval $ac_compile) 2>&5
6426   ac_status=$?
6427   echo "$as_me:6427: \$? = $ac_status" >&5
6428   (exit $ac_status); } &&
6429          { ac_try='test -s conftest.$ac_objext'
6430   { (eval echo "$as_me:6430: \"$ac_try\"") >&5
6431   (eval $ac_try) 2>&5
6432   ac_status=$?
6433   echo "$as_me:6433: \$? = $ac_status" >&5
6434   (exit $ac_status); }; }; then
6435   :
6436 else
6437   echo "$as_me: failed program was:" >&5
6438 cat conftest.$ac_ext >&5
6439 cf_have_incdir=yes
6440 fi
6441 rm -f conftest.$ac_objext conftest.$ac_ext
6442                           CPPFLAGS=$cf_save_CPPFLAGS
6443                         fi
6444                   fi
6445                 fi
6446
6447                 if test "$cf_have_incdir" = no ; then
6448                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6449
6450 echo "${as_me:-configure}:6450: testing adding $cf_add_incdir to include-path ..." 1>&5
6451
6452                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6453
6454                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6455                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6456                   cf_add_incdir="$cf_top_incdir"
6457                 else
6458                   break
6459                 fi
6460           else
6461                 break
6462           fi
6463         done
6464   done
6465 fi
6466
6467                 for cf_header in \
6468                         ncurses.h \
6469                         curses.h
6470                 do
6471
6472         cat >conftest.$ac_ext <<_ACEOF
6473 #line 6473 "configure"
6474 #include "confdefs.h"
6475
6476 #include <$cf_header>
6477 int
6478 main ()
6479 {
6480
6481 #ifdef NCURSES_VERSION
6482
6483 printf("%s\n", NCURSES_VERSION);
6484 #else
6485 #ifdef __NCURSES_H
6486 printf("old\n");
6487 #else
6488         make an error
6489 #endif
6490 #endif
6491
6492   ;
6493   return 0;
6494 }
6495 _ACEOF
6496 rm -f conftest.$ac_objext
6497 if { (eval echo "$as_me:6497: \"$ac_compile\"") >&5
6498   (eval $ac_compile) 2>&5
6499   ac_status=$?
6500   echo "$as_me:6500: \$? = $ac_status" >&5
6501   (exit $ac_status); } &&
6502          { ac_try='test -s conftest.$ac_objext'
6503   { (eval echo "$as_me:6503: \"$ac_try\"") >&5
6504   (eval $ac_try) 2>&5
6505   ac_status=$?
6506   echo "$as_me:6506: \$? = $ac_status" >&5
6507   (exit $ac_status); }; }; then
6508   cf_cv_ncurses_h2=$cf_header
6509
6510 else
6511   echo "$as_me: failed program was:" >&5
6512 cat conftest.$ac_ext >&5
6513 cf_cv_ncurses_h2=no
6514 fi
6515 rm -f conftest.$ac_objext conftest.$ac_ext
6516
6517                         if test "$cf_cv_ncurses_h2" != no ; then
6518                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6519                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6520                                 break
6521                         fi
6522                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6523                 done
6524                 CPPFLAGS="$cf_save2_CPPFLAGS"
6525                 test "$cf_cv_ncurses_h2" != no && break
6526         done
6527         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6527: error: not found" >&5
6528 echo "$as_me: error: not found" >&2;}
6529    { (exit 1); exit 1; }; }
6530
6531 fi
6532 echo "$as_me:6532: result: $cf_cv_ncurses_h2" >&5
6533 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6534
6535         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6536         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6537         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6538                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6539         fi
6540
6541 if test -n "$cf_1st_incdir" ; then
6542   for cf_add_incdir in $cf_1st_incdir
6543   do
6544         while test $cf_add_incdir != /usr/include
6545         do
6546           if test -d $cf_add_incdir
6547           then
6548                 cf_have_incdir=no
6549                 if test -n "$CFLAGS$CPPFLAGS" ; then
6550                   # a loop is needed to ensure we can add subdirs of existing dirs
6551                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6552                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6553                           cf_have_incdir=yes; break
6554                         fi
6555                   done
6556                 fi
6557
6558                 if test "$cf_have_incdir" = no ; then
6559                   if test "$cf_add_incdir" = /usr/local/include ; then
6560                         if test "$GCC" = yes
6561                         then
6562                           cf_save_CPPFLAGS=$CPPFLAGS
6563                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6564                           cat >conftest.$ac_ext <<_ACEOF
6565 #line 6565 "configure"
6566 #include "confdefs.h"
6567 #include <stdio.h>
6568 int
6569 main ()
6570 {
6571 printf("Hello")
6572   ;
6573   return 0;
6574 }
6575 _ACEOF
6576 rm -f conftest.$ac_objext
6577 if { (eval echo "$as_me:6577: \"$ac_compile\"") >&5
6578   (eval $ac_compile) 2>&5
6579   ac_status=$?
6580   echo "$as_me:6580: \$? = $ac_status" >&5
6581   (exit $ac_status); } &&
6582          { ac_try='test -s conftest.$ac_objext'
6583   { (eval echo "$as_me:6583: \"$ac_try\"") >&5
6584   (eval $ac_try) 2>&5
6585   ac_status=$?
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit $ac_status); }; }; then
6588   :
6589 else
6590   echo "$as_me: failed program was:" >&5
6591 cat conftest.$ac_ext >&5
6592 cf_have_incdir=yes
6593 fi
6594 rm -f conftest.$ac_objext conftest.$ac_ext
6595                           CPPFLAGS=$cf_save_CPPFLAGS
6596                         fi
6597                   fi
6598                 fi
6599
6600                 if test "$cf_have_incdir" = no ; then
6601                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6602
6603 echo "${as_me:-configure}:6603: testing adding $cf_add_incdir to include-path ..." 1>&5
6604
6605                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6606
6607                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6608                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6609                   cf_add_incdir="$cf_top_incdir"
6610                 else
6611                   break
6612                 fi
6613           else
6614                 break
6615           fi
6616         done
6617   done
6618 fi
6619
6620 fi
6621
6622 # Set definitions to allow ifdef'ing for ncurses.h
6623
6624 case $cf_cv_ncurses_header in
6625 (*ncurses.h)
6626
6627 cat >>confdefs.h <<\EOF
6628 #define HAVE_NCURSES_H 1
6629 EOF
6630
6631         ;;
6632 esac
6633
6634 case $cf_cv_ncurses_header in
6635 (ncurses/curses.h|ncurses/ncurses.h)
6636
6637 cat >>confdefs.h <<\EOF
6638 #define HAVE_NCURSES_NCURSES_H 1
6639 EOF
6640
6641         ;;
6642 (ncursesw/curses.h|ncursesw/ncurses.h)
6643
6644 cat >>confdefs.h <<\EOF
6645 #define HAVE_NCURSESW_NCURSES_H 1
6646 EOF
6647
6648         ;;
6649 esac
6650
6651 echo "$as_me:6651: checking for terminfo header" >&5
6652 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6653 if test "${cf_cv_term_header+set}" = set; then
6654   echo $ECHO_N "(cached) $ECHO_C" >&6
6655 else
6656
6657 case ${cf_cv_ncurses_header} in
6658 (*/ncurses.h|*/ncursesw.h)
6659         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6660         ;;
6661 (*)
6662         cf_term_header=term.h
6663         ;;
6664 esac
6665
6666 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6667 do
6668 cat >conftest.$ac_ext <<_ACEOF
6669 #line 6669 "configure"
6670 #include "confdefs.h"
6671 #include <stdio.h>
6672 #include <${cf_cv_ncurses_header:-curses.h}>
6673 #include <$cf_test>
6674
6675 int
6676 main ()
6677 {
6678 int x = auto_left_margin
6679   ;
6680   return 0;
6681 }
6682 _ACEOF
6683 rm -f conftest.$ac_objext
6684 if { (eval echo "$as_me:6684: \"$ac_compile\"") >&5
6685   (eval $ac_compile) 2>&5
6686   ac_status=$?
6687   echo "$as_me:6687: \$? = $ac_status" >&5
6688   (exit $ac_status); } &&
6689          { ac_try='test -s conftest.$ac_objext'
6690   { (eval echo "$as_me:6690: \"$ac_try\"") >&5
6691   (eval $ac_try) 2>&5
6692   ac_status=$?
6693   echo "$as_me:6693: \$? = $ac_status" >&5
6694   (exit $ac_status); }; }; then
6695
6696         cf_cv_term_header="$cf_test"
6697 else
6698   echo "$as_me: failed program was:" >&5
6699 cat conftest.$ac_ext >&5
6700
6701         cf_cv_term_header=unknown
6702
6703 fi
6704 rm -f conftest.$ac_objext conftest.$ac_ext
6705         test "$cf_cv_term_header" != unknown && break
6706 done
6707
6708 fi
6709 echo "$as_me:6709: result: $cf_cv_term_header" >&5
6710 echo "${ECHO_T}$cf_cv_term_header" >&6
6711
6712 # Set definitions to allow ifdef'ing to accommodate subdirectories
6713
6714 case $cf_cv_term_header in
6715 (*term.h)
6716
6717 cat >>confdefs.h <<\EOF
6718 #define HAVE_TERM_H 1
6719 EOF
6720
6721         ;;
6722 esac
6723
6724 case $cf_cv_term_header in
6725 (ncurses/term.h)
6726
6727 cat >>confdefs.h <<\EOF
6728 #define HAVE_NCURSES_TERM_H 1
6729 EOF
6730
6731         ;;
6732 (ncursesw/term.h)
6733
6734 cat >>confdefs.h <<\EOF
6735 #define HAVE_NCURSESW_TERM_H 1
6736 EOF
6737
6738         ;;
6739 esac
6740
6741 # some applications need this, but should check for NCURSES_VERSION
6742
6743 cat >>confdefs.h <<\EOF
6744 #define NCURSES 1
6745 EOF
6746
6747 echo "$as_me:6747: checking for ncurses version" >&5
6748 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6749 if test "${cf_cv_ncurses_version+set}" = set; then
6750   echo $ECHO_N "(cached) $ECHO_C" >&6
6751 else
6752
6753         cf_cv_ncurses_version=no
6754         cf_tempfile=out$$
6755         rm -f $cf_tempfile
6756         if test "$cross_compiling" = yes; then
6757
6758         # This will not work if the preprocessor splits the line after the
6759         # Autoconf token.  The 'unproto' program does that.
6760         cat > conftest.$ac_ext <<EOF
6761 #include <${cf_cv_ncurses_header:-curses.h}>
6762 #undef Autoconf
6763 #ifdef NCURSES_VERSION
6764 Autoconf NCURSES_VERSION
6765 #else
6766 #ifdef __NCURSES_H
6767 Autoconf "old"
6768 #endif
6769 ;
6770 #endif
6771 EOF
6772         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6773         { (eval echo "$as_me:6773: \"$cf_try\"") >&5
6774   (eval $cf_try) 2>&5
6775   ac_status=$?
6776   echo "$as_me:6776: \$? = $ac_status" >&5
6777   (exit $ac_status); }
6778         if test -f conftest.out ; then
6779                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6780                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6781                 rm -f conftest.out
6782         fi
6783
6784 else
6785   cat >conftest.$ac_ext <<_ACEOF
6786 #line 6786 "configure"
6787 #include "confdefs.h"
6788
6789 #include <${cf_cv_ncurses_header:-curses.h}>
6790 #include <stdio.h>
6791 int main()
6792 {
6793         FILE *fp = fopen("$cf_tempfile", "w");
6794 #ifdef NCURSES_VERSION
6795 # ifdef NCURSES_VERSION_PATCH
6796         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6797 # else
6798         fprintf(fp, "%s\n", NCURSES_VERSION);
6799 # endif
6800 #else
6801 # ifdef __NCURSES_H
6802         fprintf(fp, "old\n");
6803 # else
6804         make an error
6805 # endif
6806 #endif
6807         ${cf_cv_main_return:-return}(0);
6808 }
6809 _ACEOF
6810 rm -f conftest$ac_exeext
6811 if { (eval echo "$as_me:6811: \"$ac_link\"") >&5
6812   (eval $ac_link) 2>&5
6813   ac_status=$?
6814   echo "$as_me:6814: \$? = $ac_status" >&5
6815   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6816   { (eval echo "$as_me:6816: \"$ac_try\"") >&5
6817   (eval $ac_try) 2>&5
6818   ac_status=$?
6819   echo "$as_me:6819: \$? = $ac_status" >&5
6820   (exit $ac_status); }; }; then
6821
6822         cf_cv_ncurses_version=`cat $cf_tempfile`
6823 else
6824   echo "$as_me: program exited with status $ac_status" >&5
6825 echo "$as_me: failed program was:" >&5
6826 cat conftest.$ac_ext >&5
6827 fi
6828 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6829 fi
6830         rm -f $cf_tempfile
6831
6832 fi
6833 echo "$as_me:6833: result: $cf_cv_ncurses_version" >&5
6834 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6835 test "$cf_cv_ncurses_version" = no ||
6836 cat >>confdefs.h <<\EOF
6837 #define NCURSES 1
6838 EOF
6839
6840 cf_nculib_root=ncursesw
6841         # This works, except for the special case where we find gpm, but
6842         # ncurses is in a nonstandard location via $LIBS, and we really want
6843         # to link gpm.
6844 cf_ncurses_LIBS=""
6845 cf_ncurses_SAVE="$LIBS"
6846 echo "$as_me:6846: checking for Gpm_Open in -lgpm" >&5
6847 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6848 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6849   echo $ECHO_N "(cached) $ECHO_C" >&6
6850 else
6851   ac_check_lib_save_LIBS=$LIBS
6852 LIBS="-lgpm  $LIBS"
6853 cat >conftest.$ac_ext <<_ACEOF
6854 #line 6854 "configure"
6855 #include "confdefs.h"
6856
6857 /* Override any gcc2 internal prototype to avoid an error.  */
6858 #ifdef __cplusplus
6859 extern "C"
6860 #endif
6861 /* We use char because int might match the return type of a gcc2
6862    builtin and then its argument prototype would still apply.  */
6863 char Gpm_Open ();
6864 int
6865 main ()
6866 {
6867 Gpm_Open ();
6868   ;
6869   return 0;
6870 }
6871 _ACEOF
6872 rm -f conftest.$ac_objext conftest$ac_exeext
6873 if { (eval echo "$as_me:6873: \"$ac_link\"") >&5
6874   (eval $ac_link) 2>&5
6875   ac_status=$?
6876   echo "$as_me:6876: \$? = $ac_status" >&5
6877   (exit $ac_status); } &&
6878          { ac_try='test -s conftest$ac_exeext'
6879   { (eval echo "$as_me:6879: \"$ac_try\"") >&5
6880   (eval $ac_try) 2>&5
6881   ac_status=$?
6882   echo "$as_me:6882: \$? = $ac_status" >&5
6883   (exit $ac_status); }; }; then
6884   ac_cv_lib_gpm_Gpm_Open=yes
6885 else
6886   echo "$as_me: failed program was:" >&5
6887 cat conftest.$ac_ext >&5
6888 ac_cv_lib_gpm_Gpm_Open=no
6889 fi
6890 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6891 LIBS=$ac_check_lib_save_LIBS
6892 fi
6893 echo "$as_me:6893: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6894 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6895 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6896   echo "$as_me:6896: checking for initscr in -lgpm" >&5
6897 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6898 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6899   echo $ECHO_N "(cached) $ECHO_C" >&6
6900 else
6901   ac_check_lib_save_LIBS=$LIBS
6902 LIBS="-lgpm  $LIBS"
6903 cat >conftest.$ac_ext <<_ACEOF
6904 #line 6904 "configure"
6905 #include "confdefs.h"
6906
6907 /* Override any gcc2 internal prototype to avoid an error.  */
6908 #ifdef __cplusplus
6909 extern "C"
6910 #endif
6911 /* We use char because int might match the return type of a gcc2
6912    builtin and then its argument prototype would still apply.  */
6913 char initscr ();
6914 int
6915 main ()
6916 {
6917 initscr ();
6918   ;
6919   return 0;
6920 }
6921 _ACEOF
6922 rm -f conftest.$ac_objext conftest$ac_exeext
6923 if { (eval echo "$as_me:6923: \"$ac_link\"") >&5
6924   (eval $ac_link) 2>&5
6925   ac_status=$?
6926   echo "$as_me:6926: \$? = $ac_status" >&5
6927   (exit $ac_status); } &&
6928          { ac_try='test -s conftest$ac_exeext'
6929   { (eval echo "$as_me:6929: \"$ac_try\"") >&5
6930   (eval $ac_try) 2>&5
6931   ac_status=$?
6932   echo "$as_me:6932: \$? = $ac_status" >&5
6933   (exit $ac_status); }; }; then
6934   ac_cv_lib_gpm_initscr=yes
6935 else
6936   echo "$as_me: failed program was:" >&5
6937 cat conftest.$ac_ext >&5
6938 ac_cv_lib_gpm_initscr=no
6939 fi
6940 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6941 LIBS=$ac_check_lib_save_LIBS
6942 fi
6943 echo "$as_me:6943: result: $ac_cv_lib_gpm_initscr" >&5
6944 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6945 if test $ac_cv_lib_gpm_initscr = yes; then
6946   LIBS="$cf_ncurses_SAVE"
6947 else
6948   cf_ncurses_LIBS="-lgpm"
6949 fi
6950
6951 fi
6952
6953 case $host_os in
6954 (freebsd*)
6955         # This is only necessary if you are linking against an obsolete
6956         # version of ncurses (but it should do no harm, since it's static).
6957         if test "$cf_nculib_root" = ncurses ; then
6958                 echo "$as_me:6958: checking for tgoto in -lmytinfo" >&5
6959 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6960 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6961   echo $ECHO_N "(cached) $ECHO_C" >&6
6962 else
6963   ac_check_lib_save_LIBS=$LIBS
6964 LIBS="-lmytinfo  $LIBS"
6965 cat >conftest.$ac_ext <<_ACEOF
6966 #line 6966 "configure"
6967 #include "confdefs.h"
6968
6969 /* Override any gcc2 internal prototype to avoid an error.  */
6970 #ifdef __cplusplus
6971 extern "C"
6972 #endif
6973 /* We use char because int might match the return type of a gcc2
6974    builtin and then its argument prototype would still apply.  */
6975 char tgoto ();
6976 int
6977 main ()
6978 {
6979 tgoto ();
6980   ;
6981   return 0;
6982 }
6983 _ACEOF
6984 rm -f conftest.$ac_objext conftest$ac_exeext
6985 if { (eval echo "$as_me:6985: \"$ac_link\"") >&5
6986   (eval $ac_link) 2>&5
6987   ac_status=$?
6988   echo "$as_me:6988: \$? = $ac_status" >&5
6989   (exit $ac_status); } &&
6990          { ac_try='test -s conftest$ac_exeext'
6991   { (eval echo "$as_me:6991: \"$ac_try\"") >&5
6992   (eval $ac_try) 2>&5
6993   ac_status=$?
6994   echo "$as_me:6994: \$? = $ac_status" >&5
6995   (exit $ac_status); }; }; then
6996   ac_cv_lib_mytinfo_tgoto=yes
6997 else
6998   echo "$as_me: failed program was:" >&5
6999 cat conftest.$ac_ext >&5
7000 ac_cv_lib_mytinfo_tgoto=no
7001 fi
7002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7003 LIBS=$ac_check_lib_save_LIBS
7004 fi
7005 echo "$as_me:7005: result: $ac_cv_lib_mytinfo_tgoto" >&5
7006 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7007 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7008   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7009 fi
7010
7011         fi
7012         ;;
7013 esac
7014
7015 cf_add_libs="$cf_ncurses_LIBS"
7016 # Filter out duplicates - this happens with badly-designed ".pc" files...
7017 for cf_add_1lib in $LIBS
7018 do
7019         for cf_add_2lib in $cf_add_libs
7020         do
7021                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7022                 then
7023                         cf_add_1lib=
7024                         break
7025                 fi
7026         done
7027         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7028 done
7029 LIBS="$cf_add_libs"
7030
7031 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7032 then
7033
7034 cf_add_libs="-l$cf_nculib_root"
7035 # Filter out duplicates - this happens with badly-designed ".pc" files...
7036 for cf_add_1lib in $LIBS
7037 do
7038         for cf_add_2lib in $cf_add_libs
7039         do
7040                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7041                 then
7042                         cf_add_1lib=
7043                         break
7044                 fi
7045         done
7046         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7047 done
7048 LIBS="$cf_add_libs"
7049
7050 else
7051
7052         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7053         cf_libdir=""
7054         echo "$as_me:7054: checking for initscr" >&5
7055 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7056 if test "${ac_cv_func_initscr+set}" = set; then
7057   echo $ECHO_N "(cached) $ECHO_C" >&6
7058 else
7059   cat >conftest.$ac_ext <<_ACEOF
7060 #line 7060 "configure"
7061 #include "confdefs.h"
7062 /* System header to define __stub macros and hopefully few prototypes,
7063     which can conflict with char initscr (); below.  */
7064 #include <assert.h>
7065 /* Override any gcc2 internal prototype to avoid an error.  */
7066 #ifdef __cplusplus
7067 extern "C"
7068 #endif
7069 /* We use char because int might match the return type of a gcc2
7070    builtin and then its argument prototype would still apply.  */
7071 char initscr ();
7072 char (*f) ();
7073
7074 int
7075 main ()
7076 {
7077 /* The GNU C library defines this for functions which it implements
7078     to always fail with ENOSYS.  Some functions are actually named
7079     something starting with __ and the normal name is an alias.  */
7080 #if defined (__stub_initscr) || defined (__stub___initscr)
7081 choke me
7082 #else
7083 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7084 #endif
7085
7086   ;
7087   return 0;
7088 }
7089 _ACEOF
7090 rm -f conftest.$ac_objext conftest$ac_exeext
7091 if { (eval echo "$as_me:7091: \"$ac_link\"") >&5
7092   (eval $ac_link) 2>&5
7093   ac_status=$?
7094   echo "$as_me:7094: \$? = $ac_status" >&5
7095   (exit $ac_status); } &&
7096          { ac_try='test -s conftest$ac_exeext'
7097   { (eval echo "$as_me:7097: \"$ac_try\"") >&5
7098   (eval $ac_try) 2>&5
7099   ac_status=$?
7100   echo "$as_me:7100: \$? = $ac_status" >&5
7101   (exit $ac_status); }; }; then
7102   ac_cv_func_initscr=yes
7103 else
7104   echo "$as_me: failed program was:" >&5
7105 cat conftest.$ac_ext >&5
7106 ac_cv_func_initscr=no
7107 fi
7108 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7109 fi
7110 echo "$as_me:7110: result: $ac_cv_func_initscr" >&5
7111 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7112 if test $ac_cv_func_initscr = yes; then
7113   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7114 else
7115
7116                 cf_save_LIBS="$LIBS"
7117                 echo "$as_me:7117: checking for initscr in -l$cf_nculib_root" >&5
7118 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7119                 LIBS="-l$cf_nculib_root $LIBS"
7120                 cat >conftest.$ac_ext <<_ACEOF
7121 #line 7121 "configure"
7122 #include "confdefs.h"
7123 #include <${cf_cv_ncurses_header:-curses.h}>
7124 int
7125 main ()
7126 {
7127 initscr()
7128   ;
7129   return 0;
7130 }
7131 _ACEOF
7132 rm -f conftest.$ac_objext conftest$ac_exeext
7133 if { (eval echo "$as_me:7133: \"$ac_link\"") >&5
7134   (eval $ac_link) 2>&5
7135   ac_status=$?
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); } &&
7138          { ac_try='test -s conftest$ac_exeext'
7139   { (eval echo "$as_me:7139: \"$ac_try\"") >&5
7140   (eval $ac_try) 2>&5
7141   ac_status=$?
7142   echo "$as_me:7142: \$? = $ac_status" >&5
7143   (exit $ac_status); }; }; then
7144   echo "$as_me:7144: result: yes" >&5
7145 echo "${ECHO_T}yes" >&6
7146                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7147
7148 else
7149   echo "$as_me: failed program was:" >&5
7150 cat conftest.$ac_ext >&5
7151 echo "$as_me:7151: result: no" >&5
7152 echo "${ECHO_T}no" >&6
7153
7154 cf_search=
7155 cf_library_path_list=""
7156 if test -n "${LDFLAGS}${LIBS}" ; then
7157         for cf_library_path in $LDFLAGS $LIBS
7158         do
7159                 case $cf_library_path in
7160                 (-L*)
7161                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7162
7163 test "x$cf_library_path" != "xNONE" && \
7164 test -d "$cf_library_path" && \
7165  {
7166         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7167         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7168         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7169         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7170         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7171         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"
7172 }
7173
7174                         cf_library_path_list="$cf_library_path_list $cf_search"
7175                         ;;
7176                 esac
7177         done
7178 fi
7179
7180 cf_search=
7181
7182 test "x$prefix" != "xNONE" && \
7183 test -d "$prefix" && \
7184  {
7185         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7186         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7187         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7188         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7189         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7190         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7191 }
7192
7193 for cf_subdir_prefix in \
7194         /usr \
7195         /usr/local \
7196         /usr/pkg \
7197         /opt \
7198         /opt/local \
7199         $HOME
7200 do
7201
7202 test "x$cf_subdir_prefix" != "x$prefix" && \
7203 test -d "$cf_subdir_prefix" && \
7204 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7205         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7206         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7207         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7208         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7209         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7210         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"
7211 }
7212
7213 done
7214
7215 cf_search="$cf_library_path_list $cf_search"
7216
7217                         for cf_libdir in $cf_search
7218                         do
7219                                 echo "$as_me:7219: checking for -l$cf_nculib_root in $cf_libdir" >&5
7220 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7221                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7222                                 cat >conftest.$ac_ext <<_ACEOF
7223 #line 7223 "configure"
7224 #include "confdefs.h"
7225 #include <${cf_cv_ncurses_header:-curses.h}>
7226 int
7227 main ()
7228 {
7229 initscr()
7230   ;
7231   return 0;
7232 }
7233 _ACEOF
7234 rm -f conftest.$ac_objext conftest$ac_exeext
7235 if { (eval echo "$as_me:7235: \"$ac_link\"") >&5
7236   (eval $ac_link) 2>&5
7237   ac_status=$?
7238   echo "$as_me:7238: \$? = $ac_status" >&5
7239   (exit $ac_status); } &&
7240          { ac_try='test -s conftest$ac_exeext'
7241   { (eval echo "$as_me:7241: \"$ac_try\"") >&5
7242   (eval $ac_try) 2>&5
7243   ac_status=$?
7244   echo "$as_me:7244: \$? = $ac_status" >&5
7245   (exit $ac_status); }; }; then
7246   echo "$as_me:7246: result: yes" >&5
7247 echo "${ECHO_T}yes" >&6
7248                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7249                                          break
7250 else
7251   echo "$as_me: failed program was:" >&5
7252 cat conftest.$ac_ext >&5
7253 echo "$as_me:7253: result: no" >&5
7254 echo "${ECHO_T}no" >&6
7255                                          LIBS="$cf_save_LIBS"
7256 fi
7257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7258                         done
7259
7260 fi
7261 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7262
7263 fi
7264
7265 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7266
7267 if test $cf_found_library = no ; then
7268         { { echo "$as_me:7268: error: Cannot link $cf_nculib_root library" >&5
7269 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7270    { (exit 1); exit 1; }; }
7271 fi
7272
7273 fi
7274
7275 if test -n "$cf_ncurses_LIBS" ; then
7276         echo "$as_me:7276: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7277 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7278         cf_ncurses_SAVE="$LIBS"
7279         for p in $cf_ncurses_LIBS ; do
7280                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7281                 if test "$q" != "$LIBS" ; then
7282                         LIBS="$q"
7283                 fi
7284         done
7285         cat >conftest.$ac_ext <<_ACEOF
7286 #line 7286 "configure"
7287 #include "confdefs.h"
7288 #include <${cf_cv_ncurses_header:-curses.h}>
7289 int
7290 main ()
7291 {
7292 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7293   ;
7294   return 0;
7295 }
7296 _ACEOF
7297 rm -f conftest.$ac_objext conftest$ac_exeext
7298 if { (eval echo "$as_me:7298: \"$ac_link\"") >&5
7299   (eval $ac_link) 2>&5
7300   ac_status=$?
7301   echo "$as_me:7301: \$? = $ac_status" >&5
7302   (exit $ac_status); } &&
7303          { ac_try='test -s conftest$ac_exeext'
7304   { (eval echo "$as_me:7304: \"$ac_try\"") >&5
7305   (eval $ac_try) 2>&5
7306   ac_status=$?
7307   echo "$as_me:7307: \$? = $ac_status" >&5
7308   (exit $ac_status); }; }; then
7309   echo "$as_me:7309: result: yes" >&5
7310 echo "${ECHO_T}yes" >&6
7311 else
7312   echo "$as_me: failed program was:" >&5
7313 cat conftest.$ac_ext >&5
7314 echo "$as_me:7314: result: no" >&5
7315 echo "${ECHO_T}no" >&6
7316                  LIBS="$cf_ncurses_SAVE"
7317 fi
7318 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7319 fi
7320
7321 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7322
7323 cat >>confdefs.h <<EOF
7324 #define $cf_nculib_ROOT 1
7325 EOF
7326
7327         fi
7328 else
7329         NCURSES_CONFIG=none
7330 fi
7331
7332 else
7333
7334 cf_ncuconfig_root=ncurses
7335 cf_have_ncuconfig=no
7336
7337 if test "x${PKG_CONFIG:=none}" != xnone; then
7338         echo "$as_me:7338: checking pkg-config for $cf_ncuconfig_root" >&5
7339 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7340         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7341                 echo "$as_me:7341: result: yes" >&5
7342 echo "${ECHO_T}yes" >&6
7343
7344                 echo "$as_me:7344: checking if the $cf_ncuconfig_root package files work" >&5
7345 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7346                 cf_have_ncuconfig=unknown
7347
7348                 cf_save_CPPFLAGS="$CPPFLAGS"
7349                 cf_save_LIBS="$LIBS"
7350
7351                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7352
7353 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7354 # Filter out duplicates - this happens with badly-designed ".pc" files...
7355 for cf_add_1lib in $LIBS
7356 do
7357         for cf_add_2lib in $cf_add_libs
7358         do
7359                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7360                 then
7361                         cf_add_1lib=
7362                         break
7363                 fi
7364         done
7365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7366 done
7367 LIBS="$cf_add_libs"
7368
7369                 cat >conftest.$ac_ext <<_ACEOF
7370 #line 7370 "configure"
7371 #include "confdefs.h"
7372 #include <${cf_cv_ncurses_header:-curses.h}>
7373 int
7374 main ()
7375 {
7376 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7377   ;
7378   return 0;
7379 }
7380 _ACEOF
7381 rm -f conftest.$ac_objext conftest$ac_exeext
7382 if { (eval echo "$as_me:7382: \"$ac_link\"") >&5
7383   (eval $ac_link) 2>&5
7384   ac_status=$?
7385   echo "$as_me:7385: \$? = $ac_status" >&5
7386   (exit $ac_status); } &&
7387          { ac_try='test -s conftest$ac_exeext'
7388   { (eval echo "$as_me:7388: \"$ac_try\"") >&5
7389   (eval $ac_try) 2>&5
7390   ac_status=$?
7391   echo "$as_me:7391: \$? = $ac_status" >&5
7392   (exit $ac_status); }; }; then
7393   if test "$cross_compiling" = yes; then
7394   cf_have_ncuconfig=maybe
7395 else
7396   cat >conftest.$ac_ext <<_ACEOF
7397 #line 7397 "configure"
7398 #include "confdefs.h"
7399 #include <${cf_cv_ncurses_header:-curses.h}>
7400                                 int main(void)
7401                                 { char *xx = curses_version(); return (xx == 0); }
7402 _ACEOF
7403 rm -f conftest$ac_exeext
7404 if { (eval echo "$as_me:7404: \"$ac_link\"") >&5
7405   (eval $ac_link) 2>&5
7406   ac_status=$?
7407   echo "$as_me:7407: \$? = $ac_status" >&5
7408   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7409   { (eval echo "$as_me:7409: \"$ac_try\"") >&5
7410   (eval $ac_try) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit $ac_status); }; }; then
7414   cf_have_ncuconfig=yes
7415 else
7416   echo "$as_me: program exited with status $ac_status" >&5
7417 echo "$as_me: failed program was:" >&5
7418 cat conftest.$ac_ext >&5
7419 cf_have_ncuconfig=no
7420 fi
7421 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7422 fi
7423 else
7424   echo "$as_me: failed program was:" >&5
7425 cat conftest.$ac_ext >&5
7426 cf_have_ncuconfig=no
7427 fi
7428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7429                 echo "$as_me:7429: result: $cf_have_ncuconfig" >&5
7430 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7431                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7432                 if test "$cf_have_ncuconfig" != "yes"
7433                 then
7434                         CPPFLAGS="$cf_save_CPPFLAGS"
7435                         LIBS="$cf_save_LIBS"
7436                         NCURSES_CONFIG_PKG=none
7437                 else
7438
7439 cat >>confdefs.h <<\EOF
7440 #define NCURSES 1
7441 EOF
7442
7443                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7444                 fi
7445
7446         else
7447                 echo "$as_me:7447: result: no" >&5
7448 echo "${ECHO_T}no" >&6
7449                 NCURSES_CONFIG_PKG=none
7450         fi
7451 else
7452         NCURSES_CONFIG_PKG=none
7453 fi
7454
7455 if test "x$cf_have_ncuconfig" = "xno"; then
7456         echo "Looking for ${cf_ncuconfig_root}-config"
7457
7458 if test -n "$ac_tool_prefix"; then
7459   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7460   do
7461     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7462 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7463 echo "$as_me:7463: checking for $ac_word" >&5
7464 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7465 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7466   echo $ECHO_N "(cached) $ECHO_C" >&6
7467 else
7468   if test -n "$NCURSES_CONFIG"; then
7469   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7470 else
7471   ac_save_IFS=$IFS; IFS=$ac_path_separator
7472 ac_dummy="$PATH"
7473 for ac_dir in $ac_dummy; do
7474   IFS=$ac_save_IFS
7475   test -z "$ac_dir" && ac_dir=.
7476   $as_executable_p "$ac_dir/$ac_word" || continue
7477 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7478 echo "$as_me:7478: found $ac_dir/$ac_word" >&5
7479 break
7480 done
7481
7482 fi
7483 fi
7484 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7485 if test -n "$NCURSES_CONFIG"; then
7486   echo "$as_me:7486: result: $NCURSES_CONFIG" >&5
7487 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7488 else
7489   echo "$as_me:7489: result: no" >&5
7490 echo "${ECHO_T}no" >&6
7491 fi
7492
7493     test -n "$NCURSES_CONFIG" && break
7494   done
7495 fi
7496 if test -z "$NCURSES_CONFIG"; then
7497   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7498   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7499 do
7500   # Extract the first word of "$ac_prog", so it can be a program name with args.
7501 set dummy $ac_prog; ac_word=$2
7502 echo "$as_me:7502: checking for $ac_word" >&5
7503 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7504 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7505   echo $ECHO_N "(cached) $ECHO_C" >&6
7506 else
7507   if test -n "$ac_ct_NCURSES_CONFIG"; then
7508   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7509 else
7510   ac_save_IFS=$IFS; IFS=$ac_path_separator
7511 ac_dummy="$PATH"
7512 for ac_dir in $ac_dummy; do
7513   IFS=$ac_save_IFS
7514   test -z "$ac_dir" && ac_dir=.
7515   $as_executable_p "$ac_dir/$ac_word" || continue
7516 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7517 echo "$as_me:7517: found $ac_dir/$ac_word" >&5
7518 break
7519 done
7520
7521 fi
7522 fi
7523 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7524 if test -n "$ac_ct_NCURSES_CONFIG"; then
7525   echo "$as_me:7525: result: $ac_ct_NCURSES_CONFIG" >&5
7526 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7527 else
7528   echo "$as_me:7528: result: no" >&5
7529 echo "${ECHO_T}no" >&6
7530 fi
7531
7532   test -n "$ac_ct_NCURSES_CONFIG" && break
7533 done
7534 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7535
7536   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7537 fi
7538
7539         if test "$NCURSES_CONFIG" != none ; then
7540
7541                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7542
7543 cf_add_libs="`$NCURSES_CONFIG --libs`"
7544 # Filter out duplicates - this happens with badly-designed ".pc" files...
7545 for cf_add_1lib in $LIBS
7546 do
7547         for cf_add_2lib in $cf_add_libs
7548         do
7549                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7550                 then
7551                         cf_add_1lib=
7552                         break
7553                 fi
7554         done
7555         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7556 done
7557 LIBS="$cf_add_libs"
7558
7559                 # even with config script, some packages use no-override for curses.h
7560
7561 echo "$as_me:7561: checking if we have identified curses headers" >&5
7562 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7563 if test "${cf_cv_ncurses_header+set}" = set; then
7564   echo $ECHO_N "(cached) $ECHO_C" >&6
7565 else
7566
7567 cf_cv_ncurses_header=none
7568 for cf_header in \
7569         ncurses.h ncurses/ncurses.h \
7570         curses.h ncurses/curses.h
7571 do
7572 cat >conftest.$ac_ext <<_ACEOF
7573 #line 7573 "configure"
7574 #include "confdefs.h"
7575 #include <${cf_header}>
7576 int
7577 main ()
7578 {
7579 initscr(); tgoto("?", 0,0)
7580   ;
7581   return 0;
7582 }
7583 _ACEOF
7584 rm -f conftest.$ac_objext
7585 if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5
7586   (eval $ac_compile) 2>&5
7587   ac_status=$?
7588   echo "$as_me:7588: \$? = $ac_status" >&5
7589   (exit $ac_status); } &&
7590          { ac_try='test -s conftest.$ac_objext'
7591   { (eval echo "$as_me:7591: \"$ac_try\"") >&5
7592   (eval $ac_try) 2>&5
7593   ac_status=$?
7594   echo "$as_me:7594: \$? = $ac_status" >&5
7595   (exit $ac_status); }; }; then
7596   cf_cv_ncurses_header=$cf_header; break
7597 else
7598   echo "$as_me: failed program was:" >&5
7599 cat conftest.$ac_ext >&5
7600 fi
7601 rm -f conftest.$ac_objext conftest.$ac_ext
7602 done
7603
7604 fi
7605 echo "$as_me:7605: result: $cf_cv_ncurses_header" >&5
7606 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7607
7608 if test "$cf_cv_ncurses_header" = none ; then
7609         { { echo "$as_me:7609: error: No curses header-files found" >&5
7610 echo "$as_me: error: No curses header-files found" >&2;}
7611    { (exit 1); exit 1; }; }
7612 fi
7613
7614 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7615
7616 for ac_header in $cf_cv_ncurses_header
7617 do
7618 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7619 echo "$as_me:7619: checking for $ac_header" >&5
7620 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7621 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7622   echo $ECHO_N "(cached) $ECHO_C" >&6
7623 else
7624   cat >conftest.$ac_ext <<_ACEOF
7625 #line 7625 "configure"
7626 #include "confdefs.h"
7627 #include <$ac_header>
7628 _ACEOF
7629 if { (eval echo "$as_me:7629: \"$ac_cpp conftest.$ac_ext\"") >&5
7630   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7631   ac_status=$?
7632   egrep -v '^ *\+' conftest.er1 >conftest.err
7633   rm -f conftest.er1
7634   cat conftest.err >&5
7635   echo "$as_me:7635: \$? = $ac_status" >&5
7636   (exit $ac_status); } >/dev/null; then
7637   if test -s conftest.err; then
7638     ac_cpp_err=$ac_c_preproc_warn_flag
7639   else
7640     ac_cpp_err=
7641   fi
7642 else
7643   ac_cpp_err=yes
7644 fi
7645 if test -z "$ac_cpp_err"; then
7646   eval "$as_ac_Header=yes"
7647 else
7648   echo "$as_me: failed program was:" >&5
7649   cat conftest.$ac_ext >&5
7650   eval "$as_ac_Header=no"
7651 fi
7652 rm -f conftest.err conftest.$ac_ext
7653 fi
7654 echo "$as_me:7654: result: `eval echo '${'$as_ac_Header'}'`" >&5
7655 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7656 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7657   cat >>confdefs.h <<EOF
7658 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7659 EOF
7660
7661 fi
7662 done
7663
7664 cat >>confdefs.h <<\EOF
7665 #define NCURSES 1
7666 EOF
7667
7668 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7669
7670                 cat >>confdefs.h <<EOF
7671 #define $cf_nculib_ROOT 1
7672 EOF
7673
7674                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7675
7676         else
7677
7678 cf_ncuhdr_root=ncurses
7679
7680 test -n "$cf_cv_curses_dir" && \
7681 test "$cf_cv_curses_dir" != "no" && { \
7682
7683 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7684   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7685   do
7686         while test $cf_add_incdir != /usr/include
7687         do
7688           if test -d $cf_add_incdir
7689           then
7690                 cf_have_incdir=no
7691                 if test -n "$CFLAGS$CPPFLAGS" ; then
7692                   # a loop is needed to ensure we can add subdirs of existing dirs
7693                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7694                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7695                           cf_have_incdir=yes; break
7696                         fi
7697                   done
7698                 fi
7699
7700                 if test "$cf_have_incdir" = no ; then
7701                   if test "$cf_add_incdir" = /usr/local/include ; then
7702                         if test "$GCC" = yes
7703                         then
7704                           cf_save_CPPFLAGS=$CPPFLAGS
7705                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7706                           cat >conftest.$ac_ext <<_ACEOF
7707 #line 7707 "configure"
7708 #include "confdefs.h"
7709 #include <stdio.h>
7710 int
7711 main ()
7712 {
7713 printf("Hello")
7714   ;
7715   return 0;
7716 }
7717 _ACEOF
7718 rm -f conftest.$ac_objext
7719 if { (eval echo "$as_me:7719: \"$ac_compile\"") >&5
7720   (eval $ac_compile) 2>&5
7721   ac_status=$?
7722   echo "$as_me:7722: \$? = $ac_status" >&5
7723   (exit $ac_status); } &&
7724          { ac_try='test -s conftest.$ac_objext'
7725   { (eval echo "$as_me:7725: \"$ac_try\"") >&5
7726   (eval $ac_try) 2>&5
7727   ac_status=$?
7728   echo "$as_me:7728: \$? = $ac_status" >&5
7729   (exit $ac_status); }; }; then
7730   :
7731 else
7732   echo "$as_me: failed program was:" >&5
7733 cat conftest.$ac_ext >&5
7734 cf_have_incdir=yes
7735 fi
7736 rm -f conftest.$ac_objext conftest.$ac_ext
7737                           CPPFLAGS=$cf_save_CPPFLAGS
7738                         fi
7739                   fi
7740                 fi
7741
7742                 if test "$cf_have_incdir" = no ; then
7743                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7744
7745 echo "${as_me:-configure}:7745: testing adding $cf_add_incdir to include-path ..." 1>&5
7746
7747                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7748
7749                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7750                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7751                   cf_add_incdir="$cf_top_incdir"
7752                 else
7753                   break
7754                 fi
7755           else
7756                 break
7757           fi
7758         done
7759   done
7760 fi
7761
7762 }
7763
7764 echo "$as_me:7764: checking for $cf_ncuhdr_root header in include-path" >&5
7765 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7766 if test "${cf_cv_ncurses_h+set}" = set; then
7767   echo $ECHO_N "(cached) $ECHO_C" >&6
7768 else
7769
7770         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7771         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7772         for cf_header in $cf_header_list
7773         do
7774
7775         cat >conftest.$ac_ext <<_ACEOF
7776 #line 7776 "configure"
7777 #include "confdefs.h"
7778
7779 #include <$cf_header>
7780 int
7781 main ()
7782 {
7783
7784 #ifdef NCURSES_VERSION
7785
7786 printf("%s\n", NCURSES_VERSION);
7787 #else
7788 #ifdef __NCURSES_H
7789 printf("old\n");
7790 #else
7791         make an error
7792 #endif
7793 #endif
7794
7795   ;
7796   return 0;
7797 }
7798 _ACEOF
7799 rm -f conftest.$ac_objext
7800 if { (eval echo "$as_me:7800: \"$ac_compile\"") >&5
7801   (eval $ac_compile) 2>&5
7802   ac_status=$?
7803   echo "$as_me:7803: \$? = $ac_status" >&5
7804   (exit $ac_status); } &&
7805          { ac_try='test -s conftest.$ac_objext'
7806   { (eval echo "$as_me:7806: \"$ac_try\"") >&5
7807   (eval $ac_try) 2>&5
7808   ac_status=$?
7809   echo "$as_me:7809: \$? = $ac_status" >&5
7810   (exit $ac_status); }; }; then
7811   cf_cv_ncurses_h=$cf_header
7812
7813 else
7814   echo "$as_me: failed program was:" >&5
7815 cat conftest.$ac_ext >&5
7816 cf_cv_ncurses_h=no
7817 fi
7818 rm -f conftest.$ac_objext conftest.$ac_ext
7819
7820                 test "$cf_cv_ncurses_h" != no && break
7821         done
7822
7823 fi
7824 echo "$as_me:7824: result: $cf_cv_ncurses_h" >&5
7825 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7826
7827 if test "$cf_cv_ncurses_h" != no ; then
7828         cf_cv_ncurses_header=$cf_cv_ncurses_h
7829 else
7830
7831 echo "$as_me:7831: checking for $cf_ncuhdr_root include-path" >&5
7832 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7833 if test "${cf_cv_ncurses_h2+set}" = set; then
7834   echo $ECHO_N "(cached) $ECHO_C" >&6
7835 else
7836
7837         test -n "$verbose" && echo
7838
7839 cf_search=
7840
7841 # collect the current set of include-directories from compiler flags
7842 cf_header_path_list=""
7843 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7844         for cf_header_path in $CPPFLAGS $CFLAGS
7845         do
7846                 case $cf_header_path in
7847                 (-I*)
7848                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7849
7850 test "x$cf_header_path" != "xNONE" && \
7851 test -d "$cf_header_path" && \
7852  {
7853         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7854         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7855         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7856         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7857         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7858         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"
7859 }
7860
7861                         cf_header_path_list="$cf_header_path_list $cf_search"
7862                         ;;
7863                 esac
7864         done
7865 fi
7866
7867 # add the variations for the package we are looking for
7868
7869 cf_search=
7870
7871 test "x$prefix" != "xNONE" && \
7872 test -d "$prefix" && \
7873  {
7874         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7875         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7876         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7877         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7878         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7879         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7880 }
7881
7882 for cf_subdir_prefix in \
7883         /usr \
7884         /usr/local \
7885         /usr/pkg \
7886         /opt \
7887         /opt/local \
7888         $HOME
7889 do
7890
7891 test "x$cf_subdir_prefix" != "x$prefix" && \
7892 test -d "$cf_subdir_prefix" && \
7893 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7894         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7895         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7896         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7897         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7898         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7899         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"
7900 }
7901
7902 done
7903
7904 test "$includedir" != NONE && \
7905 test "$includedir" != "/usr/include" && \
7906 test -d "$includedir" && {
7907         test -d $includedir &&    cf_search="$cf_search $includedir"
7908         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7909 }
7910
7911 test "$oldincludedir" != NONE && \
7912 test "$oldincludedir" != "/usr/include" && \
7913 test -d "$oldincludedir" && {
7914         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7915         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7916 }
7917
7918 cf_search="$cf_search $cf_header_path_list"
7919
7920         test -n "$verbose" && echo search path $cf_search
7921         cf_save2_CPPFLAGS="$CPPFLAGS"
7922         for cf_incdir in $cf_search
7923         do
7924
7925 if test -n "$cf_incdir" ; then
7926   for cf_add_incdir in $cf_incdir
7927   do
7928         while test $cf_add_incdir != /usr/include
7929         do
7930           if test -d $cf_add_incdir
7931           then
7932                 cf_have_incdir=no
7933                 if test -n "$CFLAGS$CPPFLAGS" ; then
7934                   # a loop is needed to ensure we can add subdirs of existing dirs
7935                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7936                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7937                           cf_have_incdir=yes; break
7938                         fi
7939                   done
7940                 fi
7941
7942                 if test "$cf_have_incdir" = no ; then
7943                   if test "$cf_add_incdir" = /usr/local/include ; then
7944                         if test "$GCC" = yes
7945                         then
7946                           cf_save_CPPFLAGS=$CPPFLAGS
7947                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7948                           cat >conftest.$ac_ext <<_ACEOF
7949 #line 7949 "configure"
7950 #include "confdefs.h"
7951 #include <stdio.h>
7952 int
7953 main ()
7954 {
7955 printf("Hello")
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext
7961 if { (eval echo "$as_me:7961: \"$ac_compile\"") >&5
7962   (eval $ac_compile) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest.$ac_objext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   :
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 cf_have_incdir=yes
7977 fi
7978 rm -f conftest.$ac_objext conftest.$ac_ext
7979                           CPPFLAGS=$cf_save_CPPFLAGS
7980                         fi
7981                   fi
7982                 fi
7983
7984                 if test "$cf_have_incdir" = no ; then
7985                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7986
7987 echo "${as_me:-configure}:7987: testing adding $cf_add_incdir to include-path ..." 1>&5
7988
7989                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7990
7991                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7992                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7993                   cf_add_incdir="$cf_top_incdir"
7994                 else
7995                   break
7996                 fi
7997           else
7998                 break
7999           fi
8000         done
8001   done
8002 fi
8003
8004                 for cf_header in \
8005                         ncurses.h \
8006                         curses.h
8007                 do
8008
8009         cat >conftest.$ac_ext <<_ACEOF
8010 #line 8010 "configure"
8011 #include "confdefs.h"
8012
8013 #include <$cf_header>
8014 int
8015 main ()
8016 {
8017
8018 #ifdef NCURSES_VERSION
8019
8020 printf("%s\n", NCURSES_VERSION);
8021 #else
8022 #ifdef __NCURSES_H
8023 printf("old\n");
8024 #else
8025         make an error
8026 #endif
8027 #endif
8028
8029   ;
8030   return 0;
8031 }
8032 _ACEOF
8033 rm -f conftest.$ac_objext
8034 if { (eval echo "$as_me:8034: \"$ac_compile\"") >&5
8035   (eval $ac_compile) 2>&5
8036   ac_status=$?
8037   echo "$as_me:8037: \$? = $ac_status" >&5
8038   (exit $ac_status); } &&
8039          { ac_try='test -s conftest.$ac_objext'
8040   { (eval echo "$as_me:8040: \"$ac_try\"") >&5
8041   (eval $ac_try) 2>&5
8042   ac_status=$?
8043   echo "$as_me:8043: \$? = $ac_status" >&5
8044   (exit $ac_status); }; }; then
8045   cf_cv_ncurses_h2=$cf_header
8046
8047 else
8048   echo "$as_me: failed program was:" >&5
8049 cat conftest.$ac_ext >&5
8050 cf_cv_ncurses_h2=no
8051 fi
8052 rm -f conftest.$ac_objext conftest.$ac_ext
8053
8054                         if test "$cf_cv_ncurses_h2" != no ; then
8055                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8056                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8057                                 break
8058                         fi
8059                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8060                 done
8061                 CPPFLAGS="$cf_save2_CPPFLAGS"
8062                 test "$cf_cv_ncurses_h2" != no && break
8063         done
8064         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8064: error: not found" >&5
8065 echo "$as_me: error: not found" >&2;}
8066    { (exit 1); exit 1; }; }
8067
8068 fi
8069 echo "$as_me:8069: result: $cf_cv_ncurses_h2" >&5
8070 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8071
8072         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8073         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8074         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8075                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8076         fi
8077
8078 if test -n "$cf_1st_incdir" ; then
8079   for cf_add_incdir in $cf_1st_incdir
8080   do
8081         while test $cf_add_incdir != /usr/include
8082         do
8083           if test -d $cf_add_incdir
8084           then
8085                 cf_have_incdir=no
8086                 if test -n "$CFLAGS$CPPFLAGS" ; then
8087                   # a loop is needed to ensure we can add subdirs of existing dirs
8088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8090                           cf_have_incdir=yes; break
8091                         fi
8092                   done
8093                 fi
8094
8095                 if test "$cf_have_incdir" = no ; then
8096                   if test "$cf_add_incdir" = /usr/local/include ; then
8097                         if test "$GCC" = yes
8098                         then
8099                           cf_save_CPPFLAGS=$CPPFLAGS
8100                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8101                           cat >conftest.$ac_ext <<_ACEOF
8102 #line 8102 "configure"
8103 #include "confdefs.h"
8104 #include <stdio.h>
8105 int
8106 main ()
8107 {
8108 printf("Hello")
8109   ;
8110   return 0;
8111 }
8112 _ACEOF
8113 rm -f conftest.$ac_objext
8114 if { (eval echo "$as_me:8114: \"$ac_compile\"") >&5
8115   (eval $ac_compile) 2>&5
8116   ac_status=$?
8117   echo "$as_me:8117: \$? = $ac_status" >&5
8118   (exit $ac_status); } &&
8119          { ac_try='test -s conftest.$ac_objext'
8120   { (eval echo "$as_me:8120: \"$ac_try\"") >&5
8121   (eval $ac_try) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit $ac_status); }; }; then
8125   :
8126 else
8127   echo "$as_me: failed program was:" >&5
8128 cat conftest.$ac_ext >&5
8129 cf_have_incdir=yes
8130 fi
8131 rm -f conftest.$ac_objext conftest.$ac_ext
8132                           CPPFLAGS=$cf_save_CPPFLAGS
8133                         fi
8134                   fi
8135                 fi
8136
8137                 if test "$cf_have_incdir" = no ; then
8138                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8139
8140 echo "${as_me:-configure}:8140: testing adding $cf_add_incdir to include-path ..." 1>&5
8141
8142                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8143
8144                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8145                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8146                   cf_add_incdir="$cf_top_incdir"
8147                 else
8148                   break
8149                 fi
8150           else
8151                 break
8152           fi
8153         done
8154   done
8155 fi
8156
8157 fi
8158
8159 # Set definitions to allow ifdef'ing for ncurses.h
8160
8161 case $cf_cv_ncurses_header in
8162 (*ncurses.h)
8163
8164 cat >>confdefs.h <<\EOF
8165 #define HAVE_NCURSES_H 1
8166 EOF
8167
8168         ;;
8169 esac
8170
8171 case $cf_cv_ncurses_header in
8172 (ncurses/curses.h|ncurses/ncurses.h)
8173
8174 cat >>confdefs.h <<\EOF
8175 #define HAVE_NCURSES_NCURSES_H 1
8176 EOF
8177
8178         ;;
8179 (ncursesw/curses.h|ncursesw/ncurses.h)
8180
8181 cat >>confdefs.h <<\EOF
8182 #define HAVE_NCURSESW_NCURSES_H 1
8183 EOF
8184
8185         ;;
8186 esac
8187
8188 echo "$as_me:8188: checking for terminfo header" >&5
8189 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8190 if test "${cf_cv_term_header+set}" = set; then
8191   echo $ECHO_N "(cached) $ECHO_C" >&6
8192 else
8193
8194 case ${cf_cv_ncurses_header} in
8195 (*/ncurses.h|*/ncursesw.h)
8196         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8197         ;;
8198 (*)
8199         cf_term_header=term.h
8200         ;;
8201 esac
8202
8203 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8204 do
8205 cat >conftest.$ac_ext <<_ACEOF
8206 #line 8206 "configure"
8207 #include "confdefs.h"
8208 #include <stdio.h>
8209 #include <${cf_cv_ncurses_header:-curses.h}>
8210 #include <$cf_test>
8211
8212 int
8213 main ()
8214 {
8215 int x = auto_left_margin
8216   ;
8217   return 0;
8218 }
8219 _ACEOF
8220 rm -f conftest.$ac_objext
8221 if { (eval echo "$as_me:8221: \"$ac_compile\"") >&5
8222   (eval $ac_compile) 2>&5
8223   ac_status=$?
8224   echo "$as_me:8224: \$? = $ac_status" >&5
8225   (exit $ac_status); } &&
8226          { ac_try='test -s conftest.$ac_objext'
8227   { (eval echo "$as_me:8227: \"$ac_try\"") >&5
8228   (eval $ac_try) 2>&5
8229   ac_status=$?
8230   echo "$as_me:8230: \$? = $ac_status" >&5
8231   (exit $ac_status); }; }; then
8232
8233         cf_cv_term_header="$cf_test"
8234 else
8235   echo "$as_me: failed program was:" >&5
8236 cat conftest.$ac_ext >&5
8237
8238         cf_cv_term_header=unknown
8239
8240 fi
8241 rm -f conftest.$ac_objext conftest.$ac_ext
8242         test "$cf_cv_term_header" != unknown && break
8243 done
8244
8245 fi
8246 echo "$as_me:8246: result: $cf_cv_term_header" >&5
8247 echo "${ECHO_T}$cf_cv_term_header" >&6
8248
8249 # Set definitions to allow ifdef'ing to accommodate subdirectories
8250
8251 case $cf_cv_term_header in
8252 (*term.h)
8253
8254 cat >>confdefs.h <<\EOF
8255 #define HAVE_TERM_H 1
8256 EOF
8257
8258         ;;
8259 esac
8260
8261 case $cf_cv_term_header in
8262 (ncurses/term.h)
8263
8264 cat >>confdefs.h <<\EOF
8265 #define HAVE_NCURSES_TERM_H 1
8266 EOF
8267
8268         ;;
8269 (ncursesw/term.h)
8270
8271 cat >>confdefs.h <<\EOF
8272 #define HAVE_NCURSESW_TERM_H 1
8273 EOF
8274
8275         ;;
8276 esac
8277
8278 # some applications need this, but should check for NCURSES_VERSION
8279
8280 cat >>confdefs.h <<\EOF
8281 #define NCURSES 1
8282 EOF
8283
8284 echo "$as_me:8284: checking for ncurses version" >&5
8285 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8286 if test "${cf_cv_ncurses_version+set}" = set; then
8287   echo $ECHO_N "(cached) $ECHO_C" >&6
8288 else
8289
8290         cf_cv_ncurses_version=no
8291         cf_tempfile=out$$
8292         rm -f $cf_tempfile
8293         if test "$cross_compiling" = yes; then
8294
8295         # This will not work if the preprocessor splits the line after the
8296         # Autoconf token.  The 'unproto' program does that.
8297         cat > conftest.$ac_ext <<EOF
8298 #include <${cf_cv_ncurses_header:-curses.h}>
8299 #undef Autoconf
8300 #ifdef NCURSES_VERSION
8301 Autoconf NCURSES_VERSION
8302 #else
8303 #ifdef __NCURSES_H
8304 Autoconf "old"
8305 #endif
8306 ;
8307 #endif
8308 EOF
8309         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8310         { (eval echo "$as_me:8310: \"$cf_try\"") >&5
8311   (eval $cf_try) 2>&5
8312   ac_status=$?
8313   echo "$as_me:8313: \$? = $ac_status" >&5
8314   (exit $ac_status); }
8315         if test -f conftest.out ; then
8316                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8317                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8318                 rm -f conftest.out
8319         fi
8320
8321 else
8322   cat >conftest.$ac_ext <<_ACEOF
8323 #line 8323 "configure"
8324 #include "confdefs.h"
8325
8326 #include <${cf_cv_ncurses_header:-curses.h}>
8327 #include <stdio.h>
8328 int main()
8329 {
8330         FILE *fp = fopen("$cf_tempfile", "w");
8331 #ifdef NCURSES_VERSION
8332 # ifdef NCURSES_VERSION_PATCH
8333         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8334 # else
8335         fprintf(fp, "%s\n", NCURSES_VERSION);
8336 # endif
8337 #else
8338 # ifdef __NCURSES_H
8339         fprintf(fp, "old\n");
8340 # else
8341         make an error
8342 # endif
8343 #endif
8344         ${cf_cv_main_return:-return}(0);
8345 }
8346 _ACEOF
8347 rm -f conftest$ac_exeext
8348 if { (eval echo "$as_me:8348: \"$ac_link\"") >&5
8349   (eval $ac_link) 2>&5
8350   ac_status=$?
8351   echo "$as_me:8351: \$? = $ac_status" >&5
8352   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8353   { (eval echo "$as_me:8353: \"$ac_try\"") >&5
8354   (eval $ac_try) 2>&5
8355   ac_status=$?
8356   echo "$as_me:8356: \$? = $ac_status" >&5
8357   (exit $ac_status); }; }; then
8358
8359         cf_cv_ncurses_version=`cat $cf_tempfile`
8360 else
8361   echo "$as_me: program exited with status $ac_status" >&5
8362 echo "$as_me: failed program was:" >&5
8363 cat conftest.$ac_ext >&5
8364 fi
8365 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8366 fi
8367         rm -f $cf_tempfile
8368
8369 fi
8370 echo "$as_me:8370: result: $cf_cv_ncurses_version" >&5
8371 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8372 test "$cf_cv_ncurses_version" = no ||
8373 cat >>confdefs.h <<\EOF
8374 #define NCURSES 1
8375 EOF
8376
8377 cf_nculib_root=ncurses
8378         # This works, except for the special case where we find gpm, but
8379         # ncurses is in a nonstandard location via $LIBS, and we really want
8380         # to link gpm.
8381 cf_ncurses_LIBS=""
8382 cf_ncurses_SAVE="$LIBS"
8383 echo "$as_me:8383: checking for Gpm_Open in -lgpm" >&5
8384 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8385 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8386   echo $ECHO_N "(cached) $ECHO_C" >&6
8387 else
8388   ac_check_lib_save_LIBS=$LIBS
8389 LIBS="-lgpm  $LIBS"
8390 cat >conftest.$ac_ext <<_ACEOF
8391 #line 8391 "configure"
8392 #include "confdefs.h"
8393
8394 /* Override any gcc2 internal prototype to avoid an error.  */
8395 #ifdef __cplusplus
8396 extern "C"
8397 #endif
8398 /* We use char because int might match the return type of a gcc2
8399    builtin and then its argument prototype would still apply.  */
8400 char Gpm_Open ();
8401 int
8402 main ()
8403 {
8404 Gpm_Open ();
8405   ;
8406   return 0;
8407 }
8408 _ACEOF
8409 rm -f conftest.$ac_objext conftest$ac_exeext
8410 if { (eval echo "$as_me:8410: \"$ac_link\"") >&5
8411   (eval $ac_link) 2>&5
8412   ac_status=$?
8413   echo "$as_me:8413: \$? = $ac_status" >&5
8414   (exit $ac_status); } &&
8415          { ac_try='test -s conftest$ac_exeext'
8416   { (eval echo "$as_me:8416: \"$ac_try\"") >&5
8417   (eval $ac_try) 2>&5
8418   ac_status=$?
8419   echo "$as_me:8419: \$? = $ac_status" >&5
8420   (exit $ac_status); }; }; then
8421   ac_cv_lib_gpm_Gpm_Open=yes
8422 else
8423   echo "$as_me: failed program was:" >&5
8424 cat conftest.$ac_ext >&5
8425 ac_cv_lib_gpm_Gpm_Open=no
8426 fi
8427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8428 LIBS=$ac_check_lib_save_LIBS
8429 fi
8430 echo "$as_me:8430: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8431 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8432 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8433   echo "$as_me:8433: checking for initscr in -lgpm" >&5
8434 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8435 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8436   echo $ECHO_N "(cached) $ECHO_C" >&6
8437 else
8438   ac_check_lib_save_LIBS=$LIBS
8439 LIBS="-lgpm  $LIBS"
8440 cat >conftest.$ac_ext <<_ACEOF
8441 #line 8441 "configure"
8442 #include "confdefs.h"
8443
8444 /* Override any gcc2 internal prototype to avoid an error.  */
8445 #ifdef __cplusplus
8446 extern "C"
8447 #endif
8448 /* We use char because int might match the return type of a gcc2
8449    builtin and then its argument prototype would still apply.  */
8450 char initscr ();
8451 int
8452 main ()
8453 {
8454 initscr ();
8455   ;
8456   return 0;
8457 }
8458 _ACEOF
8459 rm -f conftest.$ac_objext conftest$ac_exeext
8460 if { (eval echo "$as_me:8460: \"$ac_link\"") >&5
8461   (eval $ac_link) 2>&5
8462   ac_status=$?
8463   echo "$as_me:8463: \$? = $ac_status" >&5
8464   (exit $ac_status); } &&
8465          { ac_try='test -s conftest$ac_exeext'
8466   { (eval echo "$as_me:8466: \"$ac_try\"") >&5
8467   (eval $ac_try) 2>&5
8468   ac_status=$?
8469   echo "$as_me:8469: \$? = $ac_status" >&5
8470   (exit $ac_status); }; }; then
8471   ac_cv_lib_gpm_initscr=yes
8472 else
8473   echo "$as_me: failed program was:" >&5
8474 cat conftest.$ac_ext >&5
8475 ac_cv_lib_gpm_initscr=no
8476 fi
8477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8478 LIBS=$ac_check_lib_save_LIBS
8479 fi
8480 echo "$as_me:8480: result: $ac_cv_lib_gpm_initscr" >&5
8481 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8482 if test $ac_cv_lib_gpm_initscr = yes; then
8483   LIBS="$cf_ncurses_SAVE"
8484 else
8485   cf_ncurses_LIBS="-lgpm"
8486 fi
8487
8488 fi
8489
8490 case $host_os in
8491 (freebsd*)
8492         # This is only necessary if you are linking against an obsolete
8493         # version of ncurses (but it should do no harm, since it's static).
8494         if test "$cf_nculib_root" = ncurses ; then
8495                 echo "$as_me:8495: checking for tgoto in -lmytinfo" >&5
8496 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8497 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8498   echo $ECHO_N "(cached) $ECHO_C" >&6
8499 else
8500   ac_check_lib_save_LIBS=$LIBS
8501 LIBS="-lmytinfo  $LIBS"
8502 cat >conftest.$ac_ext <<_ACEOF
8503 #line 8503 "configure"
8504 #include "confdefs.h"
8505
8506 /* Override any gcc2 internal prototype to avoid an error.  */
8507 #ifdef __cplusplus
8508 extern "C"
8509 #endif
8510 /* We use char because int might match the return type of a gcc2
8511    builtin and then its argument prototype would still apply.  */
8512 char tgoto ();
8513 int
8514 main ()
8515 {
8516 tgoto ();
8517   ;
8518   return 0;
8519 }
8520 _ACEOF
8521 rm -f conftest.$ac_objext conftest$ac_exeext
8522 if { (eval echo "$as_me:8522: \"$ac_link\"") >&5
8523   (eval $ac_link) 2>&5
8524   ac_status=$?
8525   echo "$as_me:8525: \$? = $ac_status" >&5
8526   (exit $ac_status); } &&
8527          { ac_try='test -s conftest$ac_exeext'
8528   { (eval echo "$as_me:8528: \"$ac_try\"") >&5
8529   (eval $ac_try) 2>&5
8530   ac_status=$?
8531   echo "$as_me:8531: \$? = $ac_status" >&5
8532   (exit $ac_status); }; }; then
8533   ac_cv_lib_mytinfo_tgoto=yes
8534 else
8535   echo "$as_me: failed program was:" >&5
8536 cat conftest.$ac_ext >&5
8537 ac_cv_lib_mytinfo_tgoto=no
8538 fi
8539 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8540 LIBS=$ac_check_lib_save_LIBS
8541 fi
8542 echo "$as_me:8542: result: $ac_cv_lib_mytinfo_tgoto" >&5
8543 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8544 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8545   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8546 fi
8547
8548         fi
8549         ;;
8550 esac
8551
8552 cf_add_libs="$cf_ncurses_LIBS"
8553 # Filter out duplicates - this happens with badly-designed ".pc" files...
8554 for cf_add_1lib in $LIBS
8555 do
8556         for cf_add_2lib in $cf_add_libs
8557         do
8558                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8559                 then
8560                         cf_add_1lib=
8561                         break
8562                 fi
8563         done
8564         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8565 done
8566 LIBS="$cf_add_libs"
8567
8568 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8569 then
8570
8571 cf_add_libs="-l$cf_nculib_root"
8572 # Filter out duplicates - this happens with badly-designed ".pc" files...
8573 for cf_add_1lib in $LIBS
8574 do
8575         for cf_add_2lib in $cf_add_libs
8576         do
8577                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8578                 then
8579                         cf_add_1lib=
8580                         break
8581                 fi
8582         done
8583         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8584 done
8585 LIBS="$cf_add_libs"
8586
8587 else
8588
8589         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8590         cf_libdir=""
8591         echo "$as_me:8591: checking for initscr" >&5
8592 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8593 if test "${ac_cv_func_initscr+set}" = set; then
8594   echo $ECHO_N "(cached) $ECHO_C" >&6
8595 else
8596   cat >conftest.$ac_ext <<_ACEOF
8597 #line 8597 "configure"
8598 #include "confdefs.h"
8599 /* System header to define __stub macros and hopefully few prototypes,
8600     which can conflict with char initscr (); below.  */
8601 #include <assert.h>
8602 /* Override any gcc2 internal prototype to avoid an error.  */
8603 #ifdef __cplusplus
8604 extern "C"
8605 #endif
8606 /* We use char because int might match the return type of a gcc2
8607    builtin and then its argument prototype would still apply.  */
8608 char initscr ();
8609 char (*f) ();
8610
8611 int
8612 main ()
8613 {
8614 /* The GNU C library defines this for functions which it implements
8615     to always fail with ENOSYS.  Some functions are actually named
8616     something starting with __ and the normal name is an alias.  */
8617 #if defined (__stub_initscr) || defined (__stub___initscr)
8618 choke me
8619 #else
8620 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8621 #endif
8622
8623   ;
8624   return 0;
8625 }
8626 _ACEOF
8627 rm -f conftest.$ac_objext conftest$ac_exeext
8628 if { (eval echo "$as_me:8628: \"$ac_link\"") >&5
8629   (eval $ac_link) 2>&5
8630   ac_status=$?
8631   echo "$as_me:8631: \$? = $ac_status" >&5
8632   (exit $ac_status); } &&
8633          { ac_try='test -s conftest$ac_exeext'
8634   { (eval echo "$as_me:8634: \"$ac_try\"") >&5
8635   (eval $ac_try) 2>&5
8636   ac_status=$?
8637   echo "$as_me:8637: \$? = $ac_status" >&5
8638   (exit $ac_status); }; }; then
8639   ac_cv_func_initscr=yes
8640 else
8641   echo "$as_me: failed program was:" >&5
8642 cat conftest.$ac_ext >&5
8643 ac_cv_func_initscr=no
8644 fi
8645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8646 fi
8647 echo "$as_me:8647: result: $ac_cv_func_initscr" >&5
8648 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8649 if test $ac_cv_func_initscr = yes; then
8650   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8651 else
8652
8653                 cf_save_LIBS="$LIBS"
8654                 echo "$as_me:8654: checking for initscr in -l$cf_nculib_root" >&5
8655 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8656                 LIBS="-l$cf_nculib_root $LIBS"
8657                 cat >conftest.$ac_ext <<_ACEOF
8658 #line 8658 "configure"
8659 #include "confdefs.h"
8660 #include <${cf_cv_ncurses_header:-curses.h}>
8661 int
8662 main ()
8663 {
8664 initscr()
8665   ;
8666   return 0;
8667 }
8668 _ACEOF
8669 rm -f conftest.$ac_objext conftest$ac_exeext
8670 if { (eval echo "$as_me:8670: \"$ac_link\"") >&5
8671   (eval $ac_link) 2>&5
8672   ac_status=$?
8673   echo "$as_me:8673: \$? = $ac_status" >&5
8674   (exit $ac_status); } &&
8675          { ac_try='test -s conftest$ac_exeext'
8676   { (eval echo "$as_me:8676: \"$ac_try\"") >&5
8677   (eval $ac_try) 2>&5
8678   ac_status=$?
8679   echo "$as_me:8679: \$? = $ac_status" >&5
8680   (exit $ac_status); }; }; then
8681   echo "$as_me:8681: result: yes" >&5
8682 echo "${ECHO_T}yes" >&6
8683                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8684
8685 else
8686   echo "$as_me: failed program was:" >&5
8687 cat conftest.$ac_ext >&5
8688 echo "$as_me:8688: result: no" >&5
8689 echo "${ECHO_T}no" >&6
8690
8691 cf_search=
8692 cf_library_path_list=""
8693 if test -n "${LDFLAGS}${LIBS}" ; then
8694         for cf_library_path in $LDFLAGS $LIBS
8695         do
8696                 case $cf_library_path in
8697                 (-L*)
8698                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8699
8700 test "x$cf_library_path" != "xNONE" && \
8701 test -d "$cf_library_path" && \
8702  {
8703         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8704         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8705         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8706         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8707         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8708         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"
8709 }
8710
8711                         cf_library_path_list="$cf_library_path_list $cf_search"
8712                         ;;
8713                 esac
8714         done
8715 fi
8716
8717 cf_search=
8718
8719 test "x$prefix" != "xNONE" && \
8720 test -d "$prefix" && \
8721  {
8722         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8723         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8724         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8725         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8726         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8727         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8728 }
8729
8730 for cf_subdir_prefix in \
8731         /usr \
8732         /usr/local \
8733         /usr/pkg \
8734         /opt \
8735         /opt/local \
8736         $HOME
8737 do
8738
8739 test "x$cf_subdir_prefix" != "x$prefix" && \
8740 test -d "$cf_subdir_prefix" && \
8741 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8742         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8743         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8744         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8745         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8746         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8747         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"
8748 }
8749
8750 done
8751
8752 cf_search="$cf_library_path_list $cf_search"
8753
8754                         for cf_libdir in $cf_search
8755                         do
8756                                 echo "$as_me:8756: checking for -l$cf_nculib_root in $cf_libdir" >&5
8757 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8758                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8759                                 cat >conftest.$ac_ext <<_ACEOF
8760 #line 8760 "configure"
8761 #include "confdefs.h"
8762 #include <${cf_cv_ncurses_header:-curses.h}>
8763 int
8764 main ()
8765 {
8766 initscr()
8767   ;
8768   return 0;
8769 }
8770 _ACEOF
8771 rm -f conftest.$ac_objext conftest$ac_exeext
8772 if { (eval echo "$as_me:8772: \"$ac_link\"") >&5
8773   (eval $ac_link) 2>&5
8774   ac_status=$?
8775   echo "$as_me:8775: \$? = $ac_status" >&5
8776   (exit $ac_status); } &&
8777          { ac_try='test -s conftest$ac_exeext'
8778   { (eval echo "$as_me:8778: \"$ac_try\"") >&5
8779   (eval $ac_try) 2>&5
8780   ac_status=$?
8781   echo "$as_me:8781: \$? = $ac_status" >&5
8782   (exit $ac_status); }; }; then
8783   echo "$as_me:8783: result: yes" >&5
8784 echo "${ECHO_T}yes" >&6
8785                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8786                                          break
8787 else
8788   echo "$as_me: failed program was:" >&5
8789 cat conftest.$ac_ext >&5
8790 echo "$as_me:8790: result: no" >&5
8791 echo "${ECHO_T}no" >&6
8792                                          LIBS="$cf_save_LIBS"
8793 fi
8794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8795                         done
8796
8797 fi
8798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8799
8800 fi
8801
8802 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8803
8804 if test $cf_found_library = no ; then
8805         { { echo "$as_me:8805: error: Cannot link $cf_nculib_root library" >&5
8806 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8807    { (exit 1); exit 1; }; }
8808 fi
8809
8810 fi
8811
8812 if test -n "$cf_ncurses_LIBS" ; then
8813         echo "$as_me:8813: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8814 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8815         cf_ncurses_SAVE="$LIBS"
8816         for p in $cf_ncurses_LIBS ; do
8817                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8818                 if test "$q" != "$LIBS" ; then
8819                         LIBS="$q"
8820                 fi
8821         done
8822         cat >conftest.$ac_ext <<_ACEOF
8823 #line 8823 "configure"
8824 #include "confdefs.h"
8825 #include <${cf_cv_ncurses_header:-curses.h}>
8826 int
8827 main ()
8828 {
8829 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8830   ;
8831   return 0;
8832 }
8833 _ACEOF
8834 rm -f conftest.$ac_objext conftest$ac_exeext
8835 if { (eval echo "$as_me:8835: \"$ac_link\"") >&5
8836   (eval $ac_link) 2>&5
8837   ac_status=$?
8838   echo "$as_me:8838: \$? = $ac_status" >&5
8839   (exit $ac_status); } &&
8840          { ac_try='test -s conftest$ac_exeext'
8841   { (eval echo "$as_me:8841: \"$ac_try\"") >&5
8842   (eval $ac_try) 2>&5
8843   ac_status=$?
8844   echo "$as_me:8844: \$? = $ac_status" >&5
8845   (exit $ac_status); }; }; then
8846   echo "$as_me:8846: result: yes" >&5
8847 echo "${ECHO_T}yes" >&6
8848 else
8849   echo "$as_me: failed program was:" >&5
8850 cat conftest.$ac_ext >&5
8851 echo "$as_me:8851: result: no" >&5
8852 echo "${ECHO_T}no" >&6
8853                  LIBS="$cf_ncurses_SAVE"
8854 fi
8855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8856 fi
8857
8858 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8859
8860 cat >>confdefs.h <<EOF
8861 #define $cf_nculib_ROOT 1
8862 EOF
8863
8864         fi
8865 else
8866         NCURSES_CONFIG=none
8867 fi
8868
8869 fi
8870
8871 if test "$NCURSES_CONFIG_PKG" != none ; then
8872         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8873
8874         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8875         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8876         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8877
8878         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8879         if test -z "$cf_cv_abi_version"
8880         then
8881                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8882         fi
8883
8884 elif test "$NCURSES_CONFIG" != none ; then
8885
8886         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8887
8888         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8889         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8890         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8891
8892         # ABI version is not available from headers
8893         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8894
8895 else
8896
8897         for cf_name in MAJOR MINOR PATCH
8898         do
8899         cat >conftest.$ac_ext <<CF_EOF
8900         #include <${cf_cv_ncurses_header:-curses.h}>
8901         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8902 CF_EOF
8903                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8904                 { (eval echo "$as_me:8904: \"$cf_try\"") >&5
8905   (eval $cf_try) 2>&5
8906   ac_status=$?
8907   echo "$as_me:8907: \$? = $ac_status" >&5
8908   (exit $ac_status); }
8909                 if test -f conftest.out ; then
8910                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8911                         eval NCURSES_$cf_name=\"$cf_result\"
8912                         # cat conftest.$ac_ext
8913                         # cat conftest.out
8914                 fi
8915         done
8916
8917         cf_cv_abi_version=${NCURSES_MAJOR}
8918
8919 fi
8920
8921 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8922
8923 cf_cv_timestamp=`date`
8924
8925 echo "$as_me:8925: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8926 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8927
8928 echo "$as_me:8928: checking if you want to have a library-prefix" >&5
8929 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8930
8931 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8932 if test "${with_lib_prefix+set}" = set; then
8933   withval="$with_lib_prefix"
8934   with_lib_prefix=$withval
8935 else
8936   with_lib_prefix=auto
8937 fi;
8938 echo "$as_me:8938: result: $with_lib_prefix" >&5
8939 echo "${ECHO_T}$with_lib_prefix" >&6
8940
8941 if test $with_lib_prefix = auto
8942 then
8943
8944         case $cf_cv_system_name in
8945         (OS/2*|os2*)
8946                 if test "$DFT_LWR_MODEL" = libtool; then
8947                         LIB_PREFIX='lib'
8948                 else
8949                         LIB_PREFIX=''
8950                 fi
8951                 ;;
8952         (*)     LIB_PREFIX='lib'
8953                 ;;
8954         esac
8955 cf_prefix=$LIB_PREFIX
8956
8957 elif test $with_lib_prefix = no
8958 then
8959         LIB_PREFIX=
8960 else
8961         LIB_PREFIX=$with_lib_prefix
8962 fi
8963
8964 LIB_SUFFIX=
8965
8966 ###############################################################################
8967
8968 if test X"$CC_G_OPT" = X"" ; then
8969         CC_G_OPT='-g'
8970         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
8971 fi
8972
8973 echo "$as_me:8973: checking for default loader flags" >&5
8974 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
8975 case $DFT_LWR_MODEL in
8976 (normal)  LD_MODEL=''   ;;
8977 (debug)   LD_MODEL=$CC_G_OPT ;;
8978 (profile) LD_MODEL='-pg';;
8979 (shared)  LD_MODEL=''   ;;
8980 esac
8981 echo "$as_me:8981: result: $LD_MODEL" >&5
8982 echo "${ECHO_T}$LD_MODEL" >&6
8983
8984 LD_RPATH_OPT=
8985 echo "$as_me:8985: checking for an rpath option" >&5
8986 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
8987 case $cf_cv_system_name in
8988 (irix*)
8989         if test "$GCC" = yes; then
8990                 LD_RPATH_OPT="-Wl,-rpath,"
8991         else
8992                 LD_RPATH_OPT="-rpath "
8993         fi
8994         ;;
8995 (linux*|gnu*|k*bsd*-gnu)
8996         LD_RPATH_OPT="-Wl,-rpath,"
8997         ;;
8998 (openbsd[2-9].*|mirbsd*)
8999         LD_RPATH_OPT="-Wl,-rpath,"
9000         ;;
9001 (dragonfly*|freebsd*)
9002         LD_RPATH_OPT="-rpath "
9003         ;;
9004 (netbsd*)
9005         LD_RPATH_OPT="-Wl,-rpath,"
9006         ;;
9007 (osf*|mls+*)
9008         LD_RPATH_OPT="-rpath "
9009         ;;
9010 (solaris2*)
9011         LD_RPATH_OPT="-R"
9012         ;;
9013 (*)
9014         ;;
9015 esac
9016 echo "$as_me:9016: result: $LD_RPATH_OPT" >&5
9017 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9018
9019 case "x$LD_RPATH_OPT" in
9020 (x-R*)
9021         echo "$as_me:9021: checking if we need a space after rpath option" >&5
9022 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9023         cf_save_LIBS="$LIBS"
9024
9025 cf_add_libs="${LD_RPATH_OPT}$libdir"
9026 # Filter out duplicates - this happens with badly-designed ".pc" files...
9027 for cf_add_1lib in $LIBS
9028 do
9029         for cf_add_2lib in $cf_add_libs
9030         do
9031                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9032                 then
9033                         cf_add_1lib=
9034                         break
9035                 fi
9036         done
9037         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9038 done
9039 LIBS="$cf_add_libs"
9040
9041         cat >conftest.$ac_ext <<_ACEOF
9042 #line 9042 "configure"
9043 #include "confdefs.h"
9044
9045 int
9046 main ()
9047 {
9048
9049   ;
9050   return 0;
9051 }
9052 _ACEOF
9053 rm -f conftest.$ac_objext conftest$ac_exeext
9054 if { (eval echo "$as_me:9054: \"$ac_link\"") >&5
9055   (eval $ac_link) 2>&5
9056   ac_status=$?
9057   echo "$as_me:9057: \$? = $ac_status" >&5
9058   (exit $ac_status); } &&
9059          { ac_try='test -s conftest$ac_exeext'
9060   { (eval echo "$as_me:9060: \"$ac_try\"") >&5
9061   (eval $ac_try) 2>&5
9062   ac_status=$?
9063   echo "$as_me:9063: \$? = $ac_status" >&5
9064   (exit $ac_status); }; }; then
9065   cf_rpath_space=no
9066 else
9067   echo "$as_me: failed program was:" >&5
9068 cat conftest.$ac_ext >&5
9069 cf_rpath_space=yes
9070 fi
9071 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9072         LIBS="$cf_save_LIBS"
9073         echo "$as_me:9073: result: $cf_rpath_space" >&5
9074 echo "${ECHO_T}$cf_rpath_space" >&6
9075         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9076         ;;
9077 esac
9078
9079         RM_SHARED_OPTS=
9080         LOCAL_LDFLAGS=
9081         LOCAL_LDFLAGS2=
9082         LD_SHARED_OPTS=
9083         INSTALL_LIB="-m 644"
9084         : ${rel_builddir:=.}
9085
9086         shlibdir=$libdir
9087
9088         MAKE_DLLS="#"
9089
9090         cf_cv_do_symlinks=no
9091         cf_ld_rpath_opt=
9092         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9093
9094         echo "$as_me:9094: checking if release/abi version should be used for shared libs" >&5
9095 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9096
9097 # Check whether --with-shlib-version or --without-shlib-version was given.
9098 if test "${with_shlib_version+set}" = set; then
9099   withval="$with_shlib_version"
9100   test -z "$withval" && withval=auto
9101         case $withval in
9102         (yes)
9103                 cf_cv_shlib_version=auto
9104                 ;;
9105         (rel|abi|auto)
9106                 cf_cv_shlib_version=$withval
9107                 ;;
9108         (*)
9109                 echo "$as_me:9109: result: $withval" >&5
9110 echo "${ECHO_T}$withval" >&6
9111                 { { echo "$as_me:9111: error: option value must be one of: rel, abi, or auto" >&5
9112 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9113    { (exit 1); exit 1; }; }
9114                 ;;
9115         esac
9116
9117 else
9118   cf_cv_shlib_version=auto
9119 fi;
9120         echo "$as_me:9120: result: $cf_cv_shlib_version" >&5
9121 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9122
9123         cf_cv_rm_so_locs=no
9124         cf_try_cflags=
9125
9126         # Some less-capable ports of gcc support only -fpic
9127         CC_SHARED_OPTS=
9128         if test "$GCC" = yes
9129         then
9130                 echo "$as_me:9130: checking which $CC option to use" >&5
9131 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9132                 cf_save_CFLAGS="$CFLAGS"
9133                 for CC_SHARED_OPTS in -fPIC -fpic ''
9134                 do
9135                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9136                         cat >conftest.$ac_ext <<_ACEOF
9137 #line 9137 "configure"
9138 #include "confdefs.h"
9139 #include <stdio.h>
9140 int
9141 main ()
9142 {
9143 int x = 1
9144   ;
9145   return 0;
9146 }
9147 _ACEOF
9148 rm -f conftest.$ac_objext
9149 if { (eval echo "$as_me:9149: \"$ac_compile\"") >&5
9150   (eval $ac_compile) 2>&5
9151   ac_status=$?
9152   echo "$as_me:9152: \$? = $ac_status" >&5
9153   (exit $ac_status); } &&
9154          { ac_try='test -s conftest.$ac_objext'
9155   { (eval echo "$as_me:9155: \"$ac_try\"") >&5
9156   (eval $ac_try) 2>&5
9157   ac_status=$?
9158   echo "$as_me:9158: \$? = $ac_status" >&5
9159   (exit $ac_status); }; }; then
9160   break
9161 else
9162   echo "$as_me: failed program was:" >&5
9163 cat conftest.$ac_ext >&5
9164 fi
9165 rm -f conftest.$ac_objext conftest.$ac_ext
9166                 done
9167                 echo "$as_me:9167: result: $CC_SHARED_OPTS" >&5
9168 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9169                 CFLAGS="$cf_save_CFLAGS"
9170         fi
9171
9172         cf_cv_shlib_version_infix=no
9173
9174         case $cf_cv_system_name in
9175         (aix4.3-9*|aix[5-7]*)
9176                 if test "$GCC" = yes; then
9177                         CC_SHARED_OPTS='-Wl,-brtl'
9178                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9179                 else
9180                         CC_SHARED_OPTS='-brtl'
9181                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9182                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9183                 fi
9184                 ;;
9185         (beos*)
9186                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9187                 ;;
9188         (cygwin*)
9189                 CC_SHARED_OPTS=
9190                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9191                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9192                 cf_cv_shlib_version=cygdll
9193                 cf_cv_shlib_version_infix=cygdll
9194                 shlibdir=$bindir
9195                 MAKE_DLLS=
9196                 cat >mk_shared_lib.sh <<-CF_EOF
9197                 #!$SHELL
9198                 SHARED_LIB=\$1
9199                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9200                 shift
9201                 cat <<-EOF
9202                 Linking shared library
9203                 ** SHARED_LIB \$SHARED_LIB
9204                 ** IMPORT_LIB \$IMPORT_LIB
9205 EOF
9206                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9207 CF_EOF
9208                 chmod +x mk_shared_lib.sh
9209                 ;;
9210         (msys*)
9211                 CC_SHARED_OPTS=
9212                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9213                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9214                 cf_cv_shlib_version=msysdll
9215                 cf_cv_shlib_version_infix=msysdll
9216                 shlibdir=$bindir
9217                 MAKE_DLLS=
9218                 cat >mk_shared_lib.sh <<-CF_EOF
9219                 #!$SHELL
9220                 SHARED_LIB=\$1
9221                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9222                 shift
9223                 cat <<-EOF
9224                 Linking shared library
9225                 ** SHARED_LIB \$SHARED_LIB
9226                 ** IMPORT_LIB \$IMPORT_LIB
9227 EOF
9228                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9229 CF_EOF
9230                 chmod +x mk_shared_lib.sh
9231                 ;;
9232         (darwin*)
9233                 cf_try_cflags="no-cpp-precomp"
9234                 CC_SHARED_OPTS="-dynamic"
9235                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9236                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9237                 cf_cv_shlib_version_infix=yes
9238                 echo "$as_me:9238: checking if ld -search_paths_first works" >&5
9239 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9240 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9241   echo $ECHO_N "(cached) $ECHO_C" >&6
9242 else
9243
9244                         cf_save_LDFLAGS=$LDFLAGS
9245                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9246                         cat >conftest.$ac_ext <<_ACEOF
9247 #line 9247 "configure"
9248 #include "confdefs.h"
9249
9250 int
9251 main ()
9252 {
9253 int i;
9254   ;
9255   return 0;
9256 }
9257 _ACEOF
9258 rm -f conftest.$ac_objext conftest$ac_exeext
9259 if { (eval echo "$as_me:9259: \"$ac_link\"") >&5
9260   (eval $ac_link) 2>&5
9261   ac_status=$?
9262   echo "$as_me:9262: \$? = $ac_status" >&5
9263   (exit $ac_status); } &&
9264          { ac_try='test -s conftest$ac_exeext'
9265   { (eval echo "$as_me:9265: \"$ac_try\"") >&5
9266   (eval $ac_try) 2>&5
9267   ac_status=$?
9268   echo "$as_me:9268: \$? = $ac_status" >&5
9269   (exit $ac_status); }; }; then
9270   cf_cv_ldflags_search_paths_first=yes
9271 else
9272   echo "$as_me: failed program was:" >&5
9273 cat conftest.$ac_ext >&5
9274 cf_cv_ldflags_search_paths_first=no
9275 fi
9276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9277                                 LDFLAGS=$cf_save_LDFLAGS
9278 fi
9279 echo "$as_me:9279: result: $cf_cv_ldflags_search_paths_first" >&5
9280 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9281                 if test $cf_cv_ldflags_search_paths_first = yes; then
9282                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9283                 fi
9284                 ;;
9285         (hpux[7-8]*)
9286                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9287                 if test "$GCC" != yes; then
9288                         CC_SHARED_OPTS='+Z'
9289                 fi
9290                 MK_SHARED_LIB='${LD} -b -o $@'
9291                 INSTALL_LIB="-m 555"
9292                 ;;
9293         (hpux*)
9294                 # (tested with gcc 2.7.2 -- I don't have c89)
9295                 if test "$GCC" = yes; then
9296                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9297                 else
9298                         CC_SHARED_OPTS='+Z'
9299                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9300                 fi
9301                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9302                 # HP-UX shared libraries must be executable, and should be
9303                 # readonly to exploit a quirk in the memory manager.
9304                 INSTALL_LIB="-m 555"
9305                 ;;
9306         (interix*)
9307                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9308                 if test "$cf_cv_shlib_version" = rel; then
9309                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9310                 else
9311                         cf_shared_soname='`basename `'
9312                 fi
9313                 CC_SHARED_OPTS=
9314                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9315                 ;;
9316         (irix*)
9317                 if test "$cf_cv_enable_rpath" = yes ; then
9318                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9319                 fi
9320                 # tested with IRIX 5.2 and 'cc'.
9321                 if test "$GCC" != yes; then
9322                         CC_SHARED_OPTS='-KPIC'
9323                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9324                 else
9325                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9326                 fi
9327                 cf_cv_rm_so_locs=yes
9328                 ;;
9329         (linux*|gnu*|k*bsd*-gnu)
9330                 if test "$DFT_LWR_MODEL" = "shared" ; then
9331                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9332                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9333                 fi
9334                 if test "$cf_cv_enable_rpath" = yes ; then
9335                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9336                 fi
9337
9338         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9339         if test "$cf_cv_shlib_version" = rel; then
9340                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9341         else
9342                 cf_cv_shared_soname='`basename $@`'
9343         fi
9344
9345                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9346                 ;;
9347         (mingw*)
9348                 cf_cv_shlib_version=mingw
9349                 cf_cv_shlib_version_infix=mingw
9350                 shlibdir=$bindir
9351                 MAKE_DLLS=
9352                 if test "$DFT_LWR_MODEL" = "shared" ; then
9353                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9354                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9355                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9356                 fi
9357                 CC_SHARED_OPTS=
9358                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9359                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9360                 cat >mk_shared_lib.sh <<-CF_EOF
9361                 #!$SHELL
9362                 SHARED_LIB=\$1
9363                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9364                 shift
9365                 cat <<-EOF
9366                 Linking shared library
9367                 ** SHARED_LIB \$SHARED_LIB
9368                 ** IMPORT_LIB \$IMPORT_LIB
9369 EOF
9370                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9371 CF_EOF
9372                 chmod +x mk_shared_lib.sh
9373                 ;;
9374         (openbsd[2-9].*|mirbsd*)
9375                 if test "$DFT_LWR_MODEL" = "shared" ; then
9376                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9377                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9378                 fi
9379                 if test "$cf_cv_enable_rpath" = yes ; then
9380                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9381                 fi
9382                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9383
9384         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9385         if test "$cf_cv_shlib_version" = rel; then
9386                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9387         else
9388                 cf_cv_shared_soname='`basename $@`'
9389         fi
9390
9391                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9392                 ;;
9393         (nto-qnx*|openbsd*|freebsd[12].*)
9394                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9395                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9396                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9397                 ;;
9398         (dragonfly*|freebsd*)
9399                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9400                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9401                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9402                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9403                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9404                 fi
9405
9406         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9407         if test "$cf_cv_shlib_version" = rel; then
9408                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9409         else
9410                 cf_cv_shared_soname='`basename $@`'
9411         fi
9412
9413                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9414                 ;;
9415         (netbsd*)
9416                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9417                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9418                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9419                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9420                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9421                         if test "$cf_cv_shlib_version" = auto; then
9422                         if test -f /usr/libexec/ld.elf_so; then
9423                                 cf_cv_shlib_version=abi
9424                         else
9425                                 cf_cv_shlib_version=rel
9426                         fi
9427                         fi
9428
9429         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9430         if test "$cf_cv_shlib_version" = rel; then
9431                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9432         else
9433                 cf_cv_shared_soname='`basename $@`'
9434         fi
9435
9436                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9437                 else
9438                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9439                 fi
9440                 ;;
9441         (osf*|mls+*)
9442                 # tested with OSF/1 V3.2 and 'cc'
9443                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9444                 # link with shared libs).
9445                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9446                 case $host_os in
9447                 (osf4*)
9448                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9449                         ;;
9450                 esac
9451                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9452                 if test "$DFT_LWR_MODEL" = "shared" ; then
9453                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9454                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9455                 fi
9456                 cf_cv_rm_so_locs=yes
9457                 ;;
9458         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9459                 # tested with osr5.0.5
9460                 if test "$GCC" != yes; then
9461                         CC_SHARED_OPTS='-belf -KPIC'
9462                 fi
9463                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9464                 if test "$cf_cv_enable_rpath" = yes ; then
9465                         # only way is to set LD_RUN_PATH but no switch for it
9466                         RUN_PATH=$libdir
9467                 fi
9468                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9469                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9470                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9471                 ;;
9472         (sunos4*)
9473                 # tested with SunOS 4.1.1 and gcc 2.7.0
9474                 if test "$GCC" != yes; then
9475                         CC_SHARED_OPTS='-KPIC'
9476                 fi
9477                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9478                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9479                 ;;
9480         (solaris2*)
9481                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9482                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9483                 if test "$DFT_LWR_MODEL" = "shared" ; then
9484                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9485                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9486                 fi
9487                 if test "$cf_cv_enable_rpath" = yes ; then
9488                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9489                 fi
9490
9491         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9492         if test "$cf_cv_shlib_version" = rel; then
9493                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9494         else
9495                 cf_cv_shared_soname='`basename $@`'
9496         fi
9497
9498                 if test "$GCC" != yes; then
9499                         cf_save_CFLAGS="$CFLAGS"
9500                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9501                         do
9502                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9503                                 cat >conftest.$ac_ext <<_ACEOF
9504 #line 9504 "configure"
9505 #include "confdefs.h"
9506 #include <stdio.h>
9507 int
9508 main ()
9509 {
9510 printf("Hello\n");
9511   ;
9512   return 0;
9513 }
9514 _ACEOF
9515 rm -f conftest.$ac_objext
9516 if { (eval echo "$as_me:9516: \"$ac_compile\"") >&5
9517   (eval $ac_compile) 2>&5
9518   ac_status=$?
9519   echo "$as_me:9519: \$? = $ac_status" >&5
9520   (exit $ac_status); } &&
9521          { ac_try='test -s conftest.$ac_objext'
9522   { (eval echo "$as_me:9522: \"$ac_try\"") >&5
9523   (eval $ac_try) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit $ac_status); }; }; then
9527   break
9528 else
9529   echo "$as_me: failed program was:" >&5
9530 cat conftest.$ac_ext >&5
9531 fi
9532 rm -f conftest.$ac_objext conftest.$ac_ext
9533                         done
9534                         CFLAGS="$cf_save_CFLAGS"
9535                         CC_SHARED_OPTS=$cf_shared_opts
9536                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9537                 else
9538                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9539                 fi
9540                 ;;
9541         (sysv5uw7*|unix_sv*)
9542                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9543                 if test "$GCC" != yes; then
9544                         CC_SHARED_OPTS='-KPIC'
9545                 fi
9546                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9547                 ;;
9548         (*)
9549                 CC_SHARED_OPTS='unknown'
9550                 MK_SHARED_LIB='echo unknown'
9551                 ;;
9552         esac
9553
9554         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9555         case "$cf_cv_shlib_version" in
9556         (rel|abi)
9557                 case "$MK_SHARED_LIB" in
9558                 (*'-o $@')
9559                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9560                         ;;
9561                 (*)
9562                         { echo "$as_me:9562: WARNING: ignored --with-shlib-version" >&5
9563 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9564                         ;;
9565                 esac
9566                 ;;
9567         esac
9568
9569         if test -n "$cf_try_cflags"
9570         then
9571 cat > conftest.$ac_ext <<EOF
9572 #line 9572 "${as_me:-configure}"
9573 #include <stdio.h>
9574 int main(int argc, char *argv[])
9575 {
9576         printf("hello\n");
9577         return (argv[argc-1] == 0) ;
9578 }
9579 EOF
9580                 cf_save_CFLAGS="$CFLAGS"
9581                 for cf_opt in $cf_try_cflags
9582                 do
9583                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9584                         echo "$as_me:9584: checking if CFLAGS option -$cf_opt works" >&5
9585 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9586                         if { (eval echo "$as_me:9586: \"$ac_compile\"") >&5
9587   (eval $ac_compile) 2>&5
9588   ac_status=$?
9589   echo "$as_me:9589: \$? = $ac_status" >&5
9590   (exit $ac_status); }; then
9591                                 echo "$as_me:9591: result: yes" >&5
9592 echo "${ECHO_T}yes" >&6
9593                                 cf_save_CFLAGS="$CFLAGS"
9594                         else
9595                                 echo "$as_me:9595: result: no" >&5
9596 echo "${ECHO_T}no" >&6
9597                         fi
9598                 done
9599                 CFLAGS="$cf_save_CFLAGS"
9600         fi
9601
9602         # RPATH_LIST is a colon-separated list of directories
9603         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9604         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9605
9606         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9607
9608         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9609
9610 echo "${as_me:-configure}:9610: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9611
9612         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9613
9614 echo "${as_me:-configure}:9614: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9615
9616 # The test/sample programs in the original tree link using rpath option.
9617 # Make it optional for packagers.
9618 if test -n "$LOCAL_LDFLAGS"
9619 then
9620         echo "$as_me:9620: checking if you want to link sample programs with rpath option" >&5
9621 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9622
9623 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9624 if test "${enable_rpath_link+set}" = set; then
9625   enableval="$enable_rpath_link"
9626   with_rpath_link=$enableval
9627 else
9628   with_rpath_link=yes
9629 fi;
9630         echo "$as_me:9630: result: $with_rpath_link" >&5
9631 echo "${ECHO_T}$with_rpath_link" >&6
9632         if test "$with_rpath_link" = no
9633         then
9634                 LOCAL_LDFLAGS=
9635                 LOCAL_LDFLAGS2=
9636         fi
9637 fi
9638
9639 ###############################################################################
9640
9641 ###   use option --enable-broken-linker to force on use of broken-linker support
9642 echo "$as_me:9642: checking if you want broken-linker support code" >&5
9643 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9644
9645 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9646 if test "${enable_broken_linker+set}" = set; then
9647   enableval="$enable_broken_linker"
9648   with_broken_linker=$enableval
9649 else
9650   with_broken_linker=${BROKEN_LINKER:-no}
9651 fi;
9652 echo "$as_me:9652: result: $with_broken_linker" >&5
9653 echo "${ECHO_T}$with_broken_linker" >&6
9654
9655 BROKEN_LINKER=0
9656 if test "$with_broken_linker" = yes ; then
9657         cat >>confdefs.h <<\EOF
9658 #define BROKEN_LINKER 1
9659 EOF
9660
9661         BROKEN_LINKER=1
9662 elif test "$DFT_LWR_MODEL" = shared ; then
9663         case $cf_cv_system_name in
9664         (cygwin*)
9665                 cat >>confdefs.h <<\EOF
9666 #define BROKEN_LINKER 1
9667 EOF
9668
9669                 BROKEN_LINKER=1
9670                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9671
9672 echo "${as_me:-configure}:9672: testing cygwin linker is broken anyway ..." 1>&5
9673
9674                 ;;
9675         esac
9676 fi
9677
9678 # Check to define _XOPEN_SOURCE "automatically"
9679
9680 cf_XOPEN_SOURCE=500
9681 cf_POSIX_C_SOURCE=199506L
9682 cf_xopen_source=
9683
9684 case $host_os in
9685 (aix[4-7]*)
9686         cf_xopen_source="-D_ALL_SOURCE"
9687         ;;
9688 (cygwin|msys)
9689         cf_XOPEN_SOURCE=600
9690         ;;
9691 (darwin[0-8].*)
9692         cf_xopen_source="-D_APPLE_C_SOURCE"
9693         ;;
9694 (darwin*)
9695         cf_xopen_source="-D_DARWIN_C_SOURCE"
9696         cf_XOPEN_SOURCE=
9697         ;;
9698 (freebsd*|dragonfly*)
9699         # 5.x headers associate
9700         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9701         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9702         cf_POSIX_C_SOURCE=200112L
9703         cf_XOPEN_SOURCE=600
9704         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9705         ;;
9706 (hpux11*)
9707         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9708         ;;
9709 (hpux*)
9710         cf_xopen_source="-D_HPUX_SOURCE"
9711         ;;
9712 (irix[56].*)
9713         cf_xopen_source="-D_SGI_SOURCE"
9714         cf_XOPEN_SOURCE=
9715         ;;
9716 (linux*|gnu*|mint*|k*bsd*-gnu)
9717
9718 echo "$as_me:9718: checking if we must define _GNU_SOURCE" >&5
9719 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9720 if test "${cf_cv_gnu_source+set}" = set; then
9721   echo $ECHO_N "(cached) $ECHO_C" >&6
9722 else
9723
9724 cat >conftest.$ac_ext <<_ACEOF
9725 #line 9725 "configure"
9726 #include "confdefs.h"
9727 #include <sys/types.h>
9728 int
9729 main ()
9730 {
9731
9732 #ifndef _XOPEN_SOURCE
9733 make an error
9734 #endif
9735   ;
9736   return 0;
9737 }
9738 _ACEOF
9739 rm -f conftest.$ac_objext
9740 if { (eval echo "$as_me:9740: \"$ac_compile\"") >&5
9741   (eval $ac_compile) 2>&5
9742   ac_status=$?
9743   echo "$as_me:9743: \$? = $ac_status" >&5
9744   (exit $ac_status); } &&
9745          { ac_try='test -s conftest.$ac_objext'
9746   { (eval echo "$as_me:9746: \"$ac_try\"") >&5
9747   (eval $ac_try) 2>&5
9748   ac_status=$?
9749   echo "$as_me:9749: \$? = $ac_status" >&5
9750   (exit $ac_status); }; }; then
9751   cf_cv_gnu_source=no
9752 else
9753   echo "$as_me: failed program was:" >&5
9754 cat conftest.$ac_ext >&5
9755 cf_save="$CPPFLAGS"
9756          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9757          cat >conftest.$ac_ext <<_ACEOF
9758 #line 9758 "configure"
9759 #include "confdefs.h"
9760 #include <sys/types.h>
9761 int
9762 main ()
9763 {
9764
9765 #ifdef _XOPEN_SOURCE
9766 make an error
9767 #endif
9768   ;
9769   return 0;
9770 }
9771 _ACEOF
9772 rm -f conftest.$ac_objext
9773 if { (eval echo "$as_me:9773: \"$ac_compile\"") >&5
9774   (eval $ac_compile) 2>&5
9775   ac_status=$?
9776   echo "$as_me:9776: \$? = $ac_status" >&5
9777   (exit $ac_status); } &&
9778          { ac_try='test -s conftest.$ac_objext'
9779   { (eval echo "$as_me:9779: \"$ac_try\"") >&5
9780   (eval $ac_try) 2>&5
9781   ac_status=$?
9782   echo "$as_me:9782: \$? = $ac_status" >&5
9783   (exit $ac_status); }; }; then
9784   cf_cv_gnu_source=no
9785 else
9786   echo "$as_me: failed program was:" >&5
9787 cat conftest.$ac_ext >&5
9788 cf_cv_gnu_source=yes
9789 fi
9790 rm -f conftest.$ac_objext conftest.$ac_ext
9791         CPPFLAGS="$cf_save"
9792
9793 fi
9794 rm -f conftest.$ac_objext conftest.$ac_ext
9795
9796 fi
9797 echo "$as_me:9797: result: $cf_cv_gnu_source" >&5
9798 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9799 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9800
9801         ;;
9802 (minix*)
9803         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9804         ;;
9805 (mirbsd*)
9806         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9807         cf_XOPEN_SOURCE=
9808
9809 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9810
9811 cf_save_CFLAGS="$CFLAGS"
9812 cf_save_CPPFLAGS="$CPPFLAGS"
9813
9814 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9815         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9816                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9817
9818 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9819         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9820                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9821
9822 echo "$as_me:9822: checking if we should define _POSIX_C_SOURCE" >&5
9823 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9824 if test "${cf_cv_posix_c_source+set}" = set; then
9825   echo $ECHO_N "(cached) $ECHO_C" >&6
9826 else
9827
9828 echo "${as_me:-configure}:9828: testing if the symbol is already defined go no further ..." 1>&5
9829
9830         cat >conftest.$ac_ext <<_ACEOF
9831 #line 9831 "configure"
9832 #include "confdefs.h"
9833 #include <sys/types.h>
9834 int
9835 main ()
9836 {
9837
9838 #ifndef _POSIX_C_SOURCE
9839 make an error
9840 #endif
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext
9846 if { (eval echo "$as_me:9846: \"$ac_compile\"") >&5
9847   (eval $ac_compile) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest.$ac_objext'
9852   { (eval echo "$as_me:9852: \"$ac_try\"") >&5
9853   (eval $ac_try) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); }; }; then
9857   cf_cv_posix_c_source=no
9858 else
9859   echo "$as_me: failed program was:" >&5
9860 cat conftest.$ac_ext >&5
9861 cf_want_posix_source=no
9862          case .$cf_POSIX_C_SOURCE in
9863          (.[12]??*)
9864                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9865                 ;;
9866          (.2)
9867                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9868                 cf_want_posix_source=yes
9869                 ;;
9870          (.*)
9871                 cf_want_posix_source=yes
9872                 ;;
9873          esac
9874          if test "$cf_want_posix_source" = yes ; then
9875                 cat >conftest.$ac_ext <<_ACEOF
9876 #line 9876 "configure"
9877 #include "confdefs.h"
9878 #include <sys/types.h>
9879 int
9880 main ()
9881 {
9882
9883 #ifdef _POSIX_SOURCE
9884 make an error
9885 #endif
9886   ;
9887   return 0;
9888 }
9889 _ACEOF
9890 rm -f conftest.$ac_objext
9891 if { (eval echo "$as_me:9891: \"$ac_compile\"") >&5
9892   (eval $ac_compile) 2>&5
9893   ac_status=$?
9894   echo "$as_me:9894: \$? = $ac_status" >&5
9895   (exit $ac_status); } &&
9896          { ac_try='test -s conftest.$ac_objext'
9897   { (eval echo "$as_me:9897: \"$ac_try\"") >&5
9898   (eval $ac_try) 2>&5
9899   ac_status=$?
9900   echo "$as_me:9900: \$? = $ac_status" >&5
9901   (exit $ac_status); }; }; then
9902   :
9903 else
9904   echo "$as_me: failed program was:" >&5
9905 cat conftest.$ac_ext >&5
9906 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
9907 fi
9908 rm -f conftest.$ac_objext conftest.$ac_ext
9909          fi
9910
9911 echo "${as_me:-configure}:9911: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
9912
9913          CFLAGS="$cf_trim_CFLAGS"
9914          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
9915
9916 echo "${as_me:-configure}:9916: testing if the second compile does not leave our definition intact error ..." 1>&5
9917
9918          cat >conftest.$ac_ext <<_ACEOF
9919 #line 9919 "configure"
9920 #include "confdefs.h"
9921 #include <sys/types.h>
9922 int
9923 main ()
9924 {
9925
9926 #ifndef _POSIX_C_SOURCE
9927 make an error
9928 #endif
9929   ;
9930   return 0;
9931 }
9932 _ACEOF
9933 rm -f conftest.$ac_objext
9934 if { (eval echo "$as_me:9934: \"$ac_compile\"") >&5
9935   (eval $ac_compile) 2>&5
9936   ac_status=$?
9937   echo "$as_me:9937: \$? = $ac_status" >&5
9938   (exit $ac_status); } &&
9939          { ac_try='test -s conftest.$ac_objext'
9940   { (eval echo "$as_me:9940: \"$ac_try\"") >&5
9941   (eval $ac_try) 2>&5
9942   ac_status=$?
9943   echo "$as_me:9943: \$? = $ac_status" >&5
9944   (exit $ac_status); }; }; then
9945   :
9946 else
9947   echo "$as_me: failed program was:" >&5
9948 cat conftest.$ac_ext >&5
9949 cf_cv_posix_c_source=no
9950 fi
9951 rm -f conftest.$ac_objext conftest.$ac_ext
9952          CFLAGS="$cf_save_CFLAGS"
9953          CPPFLAGS="$cf_save_CPPFLAGS"
9954
9955 fi
9956 rm -f conftest.$ac_objext conftest.$ac_ext
9957
9958 fi
9959 echo "$as_me:9959: result: $cf_cv_posix_c_source" >&5
9960 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
9961
9962 if test "$cf_cv_posix_c_source" != no ; then
9963         CFLAGS="$cf_trim_CFLAGS"
9964         CPPFLAGS="$cf_trim_CPPFLAGS"
9965
9966 cf_fix_cppflags=no
9967 cf_new_cflags=
9968 cf_new_cppflags=
9969 cf_new_extra_cppflags=
9970
9971 for cf_add_cflags in $cf_cv_posix_c_source
9972 do
9973 case $cf_fix_cppflags in
9974 (no)
9975         case $cf_add_cflags in
9976         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9977                 case $cf_add_cflags in
9978                 (-D*)
9979                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9980
9981                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9982                                 && test -z "${cf_tst_cflags}" \
9983                                 && cf_fix_cppflags=yes
9984
9985                         if test $cf_fix_cppflags = yes ; then
9986                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9987                                 continue
9988                         elif test "${cf_tst_cflags}" = "\"'" ; then
9989                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
9990                                 continue
9991                         fi
9992                         ;;
9993                 esac
9994                 case "$CPPFLAGS" in
9995                 (*$cf_add_cflags)
9996                         ;;
9997                 (*)
9998                         case $cf_add_cflags in
9999                         (-D*)
10000                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10001
10002 CPPFLAGS=`echo "$CPPFLAGS" | \
10003         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10004                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10005
10006                                 ;;
10007                         esac
10008                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10009                         ;;
10010                 esac
10011                 ;;
10012         (*)
10013                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10014                 ;;
10015         esac
10016         ;;
10017 (yes)
10018         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10019
10020         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10021
10022         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10023                 && test -z "${cf_tst_cflags}" \
10024                 && cf_fix_cppflags=no
10025         ;;
10026 esac
10027 done
10028
10029 if test -n "$cf_new_cflags" ; then
10030
10031         CFLAGS="$CFLAGS $cf_new_cflags"
10032 fi
10033
10034 if test -n "$cf_new_cppflags" ; then
10035
10036         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10037 fi
10038
10039 if test -n "$cf_new_extra_cppflags" ; then
10040
10041         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10042 fi
10043
10044 fi
10045
10046         ;;
10047 (netbsd*)
10048         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10049         ;;
10050 (openbsd[4-9]*)
10051         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10052         cf_xopen_source="-D_BSD_SOURCE"
10053         cf_XOPEN_SOURCE=600
10054         ;;
10055 (openbsd*)
10056         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10057         ;;
10058 (os2*)
10059         cf_XOPEN_SOURCE=
10060         ;;
10061 (osf[45]*)
10062         cf_xopen_source="-D_OSF_SOURCE"
10063         ;;
10064 (nto-qnx*)
10065         cf_xopen_source="-D_QNX_SOURCE"
10066         ;;
10067 (sco*)
10068         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10069         ;;
10070 (solaris2.*)
10071         cf_xopen_source="-D__EXTENSIONS__"
10072         cf_cv_xopen_source=broken
10073         ;;
10074 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10075         cf_XOPEN_SOURCE=
10076         cf_POSIX_C_SOURCE=
10077         ;;
10078 (*)
10079
10080 echo "$as_me:10080: checking if we should define _XOPEN_SOURCE" >&5
10081 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10082 if test "${cf_cv_xopen_source+set}" = set; then
10083   echo $ECHO_N "(cached) $ECHO_C" >&6
10084 else
10085
10086         cat >conftest.$ac_ext <<_ACEOF
10087 #line 10087 "configure"
10088 #include "confdefs.h"
10089
10090 #include <stdlib.h>
10091 #include <string.h>
10092 #include <sys/types.h>
10093
10094 int
10095 main ()
10096 {
10097
10098 #ifndef _XOPEN_SOURCE
10099 make an error
10100 #endif
10101   ;
10102   return 0;
10103 }
10104 _ACEOF
10105 rm -f conftest.$ac_objext
10106 if { (eval echo "$as_me:10106: \"$ac_compile\"") >&5
10107   (eval $ac_compile) 2>&5
10108   ac_status=$?
10109   echo "$as_me:10109: \$? = $ac_status" >&5
10110   (exit $ac_status); } &&
10111          { ac_try='test -s conftest.$ac_objext'
10112   { (eval echo "$as_me:10112: \"$ac_try\"") >&5
10113   (eval $ac_try) 2>&5
10114   ac_status=$?
10115   echo "$as_me:10115: \$? = $ac_status" >&5
10116   (exit $ac_status); }; }; then
10117   cf_cv_xopen_source=no
10118 else
10119   echo "$as_me: failed program was:" >&5
10120 cat conftest.$ac_ext >&5
10121 cf_save="$CPPFLAGS"
10122          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10123          cat >conftest.$ac_ext <<_ACEOF
10124 #line 10124 "configure"
10125 #include "confdefs.h"
10126
10127 #include <stdlib.h>
10128 #include <string.h>
10129 #include <sys/types.h>
10130
10131 int
10132 main ()
10133 {
10134
10135 #ifdef _XOPEN_SOURCE
10136 make an error
10137 #endif
10138   ;
10139   return 0;
10140 }
10141 _ACEOF
10142 rm -f conftest.$ac_objext
10143 if { (eval echo "$as_me:10143: \"$ac_compile\"") >&5
10144   (eval $ac_compile) 2>&5
10145   ac_status=$?
10146   echo "$as_me:10146: \$? = $ac_status" >&5
10147   (exit $ac_status); } &&
10148          { ac_try='test -s conftest.$ac_objext'
10149   { (eval echo "$as_me:10149: \"$ac_try\"") >&5
10150   (eval $ac_try) 2>&5
10151   ac_status=$?
10152   echo "$as_me:10152: \$? = $ac_status" >&5
10153   (exit $ac_status); }; }; then
10154   cf_cv_xopen_source=no
10155 else
10156   echo "$as_me: failed program was:" >&5
10157 cat conftest.$ac_ext >&5
10158 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10159 fi
10160 rm -f conftest.$ac_objext conftest.$ac_ext
10161         CPPFLAGS="$cf_save"
10162
10163 fi
10164 rm -f conftest.$ac_objext conftest.$ac_ext
10165
10166 fi
10167 echo "$as_me:10167: result: $cf_cv_xopen_source" >&5
10168 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10169
10170 if test "$cf_cv_xopen_source" != no ; then
10171
10172 CFLAGS=`echo "$CFLAGS" | \
10173         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10174                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10175
10176 CPPFLAGS=`echo "$CPPFLAGS" | \
10177         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10178                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10179
10180         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10181
10182 cf_fix_cppflags=no
10183 cf_new_cflags=
10184 cf_new_cppflags=
10185 cf_new_extra_cppflags=
10186
10187 for cf_add_cflags in $cf_temp_xopen_source
10188 do
10189 case $cf_fix_cppflags in
10190 (no)
10191         case $cf_add_cflags in
10192         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10193                 case $cf_add_cflags in
10194                 (-D*)
10195                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10196
10197                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10198                                 && test -z "${cf_tst_cflags}" \
10199                                 && cf_fix_cppflags=yes
10200
10201                         if test $cf_fix_cppflags = yes ; then
10202                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10203                                 continue
10204                         elif test "${cf_tst_cflags}" = "\"'" ; then
10205                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10206                                 continue
10207                         fi
10208                         ;;
10209                 esac
10210                 case "$CPPFLAGS" in
10211                 (*$cf_add_cflags)
10212                         ;;
10213                 (*)
10214                         case $cf_add_cflags in
10215                         (-D*)
10216                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10217
10218 CPPFLAGS=`echo "$CPPFLAGS" | \
10219         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10220                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10221
10222                                 ;;
10223                         esac
10224                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10225                         ;;
10226                 esac
10227                 ;;
10228         (*)
10229                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10230                 ;;
10231         esac
10232         ;;
10233 (yes)
10234         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10235
10236         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10237
10238         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10239                 && test -z "${cf_tst_cflags}" \
10240                 && cf_fix_cppflags=no
10241         ;;
10242 esac
10243 done
10244
10245 if test -n "$cf_new_cflags" ; then
10246
10247         CFLAGS="$CFLAGS $cf_new_cflags"
10248 fi
10249
10250 if test -n "$cf_new_cppflags" ; then
10251
10252         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10253 fi
10254
10255 if test -n "$cf_new_extra_cppflags" ; then
10256
10257         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10258 fi
10259
10260 fi
10261
10262 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10263
10264 cf_save_CFLAGS="$CFLAGS"
10265 cf_save_CPPFLAGS="$CPPFLAGS"
10266
10267 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10268         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10269                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10270
10271 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10272         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10273                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10274
10275 echo "$as_me:10275: checking if we should define _POSIX_C_SOURCE" >&5
10276 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10277 if test "${cf_cv_posix_c_source+set}" = set; then
10278   echo $ECHO_N "(cached) $ECHO_C" >&6
10279 else
10280
10281 echo "${as_me:-configure}:10281: testing if the symbol is already defined go no further ..." 1>&5
10282
10283         cat >conftest.$ac_ext <<_ACEOF
10284 #line 10284 "configure"
10285 #include "confdefs.h"
10286 #include <sys/types.h>
10287 int
10288 main ()
10289 {
10290
10291 #ifndef _POSIX_C_SOURCE
10292 make an error
10293 #endif
10294   ;
10295   return 0;
10296 }
10297 _ACEOF
10298 rm -f conftest.$ac_objext
10299 if { (eval echo "$as_me:10299: \"$ac_compile\"") >&5
10300   (eval $ac_compile) 2>&5
10301   ac_status=$?
10302   echo "$as_me:10302: \$? = $ac_status" >&5
10303   (exit $ac_status); } &&
10304          { ac_try='test -s conftest.$ac_objext'
10305   { (eval echo "$as_me:10305: \"$ac_try\"") >&5
10306   (eval $ac_try) 2>&5
10307   ac_status=$?
10308   echo "$as_me:10308: \$? = $ac_status" >&5
10309   (exit $ac_status); }; }; then
10310   cf_cv_posix_c_source=no
10311 else
10312   echo "$as_me: failed program was:" >&5
10313 cat conftest.$ac_ext >&5
10314 cf_want_posix_source=no
10315          case .$cf_POSIX_C_SOURCE in
10316          (.[12]??*)
10317                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10318                 ;;
10319          (.2)
10320                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10321                 cf_want_posix_source=yes
10322                 ;;
10323          (.*)
10324                 cf_want_posix_source=yes
10325                 ;;
10326          esac
10327          if test "$cf_want_posix_source" = yes ; then
10328                 cat >conftest.$ac_ext <<_ACEOF
10329 #line 10329 "configure"
10330 #include "confdefs.h"
10331 #include <sys/types.h>
10332 int
10333 main ()
10334 {
10335
10336 #ifdef _POSIX_SOURCE
10337 make an error
10338 #endif
10339   ;
10340   return 0;
10341 }
10342 _ACEOF
10343 rm -f conftest.$ac_objext
10344 if { (eval echo "$as_me:10344: \"$ac_compile\"") >&5
10345   (eval $ac_compile) 2>&5
10346   ac_status=$?
10347   echo "$as_me:10347: \$? = $ac_status" >&5
10348   (exit $ac_status); } &&
10349          { ac_try='test -s conftest.$ac_objext'
10350   { (eval echo "$as_me:10350: \"$ac_try\"") >&5
10351   (eval $ac_try) 2>&5
10352   ac_status=$?
10353   echo "$as_me:10353: \$? = $ac_status" >&5
10354   (exit $ac_status); }; }; then
10355   :
10356 else
10357   echo "$as_me: failed program was:" >&5
10358 cat conftest.$ac_ext >&5
10359 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10360 fi
10361 rm -f conftest.$ac_objext conftest.$ac_ext
10362          fi
10363
10364 echo "${as_me:-configure}:10364: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10365
10366          CFLAGS="$cf_trim_CFLAGS"
10367          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10368
10369 echo "${as_me:-configure}:10369: testing if the second compile does not leave our definition intact error ..." 1>&5
10370
10371          cat >conftest.$ac_ext <<_ACEOF
10372 #line 10372 "configure"
10373 #include "confdefs.h"
10374 #include <sys/types.h>
10375 int
10376 main ()
10377 {
10378
10379 #ifndef _POSIX_C_SOURCE
10380 make an error
10381 #endif
10382   ;
10383   return 0;
10384 }
10385 _ACEOF
10386 rm -f conftest.$ac_objext
10387 if { (eval echo "$as_me:10387: \"$ac_compile\"") >&5
10388   (eval $ac_compile) 2>&5
10389   ac_status=$?
10390   echo "$as_me:10390: \$? = $ac_status" >&5
10391   (exit $ac_status); } &&
10392          { ac_try='test -s conftest.$ac_objext'
10393   { (eval echo "$as_me:10393: \"$ac_try\"") >&5
10394   (eval $ac_try) 2>&5
10395   ac_status=$?
10396   echo "$as_me:10396: \$? = $ac_status" >&5
10397   (exit $ac_status); }; }; then
10398   :
10399 else
10400   echo "$as_me: failed program was:" >&5
10401 cat conftest.$ac_ext >&5
10402 cf_cv_posix_c_source=no
10403 fi
10404 rm -f conftest.$ac_objext conftest.$ac_ext
10405          CFLAGS="$cf_save_CFLAGS"
10406          CPPFLAGS="$cf_save_CPPFLAGS"
10407
10408 fi
10409 rm -f conftest.$ac_objext conftest.$ac_ext
10410
10411 fi
10412 echo "$as_me:10412: result: $cf_cv_posix_c_source" >&5
10413 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10414
10415 if test "$cf_cv_posix_c_source" != no ; then
10416         CFLAGS="$cf_trim_CFLAGS"
10417         CPPFLAGS="$cf_trim_CPPFLAGS"
10418
10419 cf_fix_cppflags=no
10420 cf_new_cflags=
10421 cf_new_cppflags=
10422 cf_new_extra_cppflags=
10423
10424 for cf_add_cflags in $cf_cv_posix_c_source
10425 do
10426 case $cf_fix_cppflags in
10427 (no)
10428         case $cf_add_cflags in
10429         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10430                 case $cf_add_cflags in
10431                 (-D*)
10432                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10433
10434                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10435                                 && test -z "${cf_tst_cflags}" \
10436                                 && cf_fix_cppflags=yes
10437
10438                         if test $cf_fix_cppflags = yes ; then
10439                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10440                                 continue
10441                         elif test "${cf_tst_cflags}" = "\"'" ; then
10442                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10443                                 continue
10444                         fi
10445                         ;;
10446                 esac
10447                 case "$CPPFLAGS" in
10448                 (*$cf_add_cflags)
10449                         ;;
10450                 (*)
10451                         case $cf_add_cflags in
10452                         (-D*)
10453                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10454
10455 CPPFLAGS=`echo "$CPPFLAGS" | \
10456         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10457                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10458
10459                                 ;;
10460                         esac
10461                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10462                         ;;
10463                 esac
10464                 ;;
10465         (*)
10466                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10467                 ;;
10468         esac
10469         ;;
10470 (yes)
10471         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10472
10473         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10474
10475         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10476                 && test -z "${cf_tst_cflags}" \
10477                 && cf_fix_cppflags=no
10478         ;;
10479 esac
10480 done
10481
10482 if test -n "$cf_new_cflags" ; then
10483
10484         CFLAGS="$CFLAGS $cf_new_cflags"
10485 fi
10486
10487 if test -n "$cf_new_cppflags" ; then
10488
10489         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10490 fi
10491
10492 if test -n "$cf_new_extra_cppflags" ; then
10493
10494         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10495 fi
10496
10497 fi
10498
10499         ;;
10500 esac
10501
10502 if test -n "$cf_xopen_source" ; then
10503
10504 cf_fix_cppflags=no
10505 cf_new_cflags=
10506 cf_new_cppflags=
10507 cf_new_extra_cppflags=
10508
10509 for cf_add_cflags in $cf_xopen_source
10510 do
10511 case $cf_fix_cppflags in
10512 (no)
10513         case $cf_add_cflags in
10514         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10515                 case $cf_add_cflags in
10516                 (-D*)
10517                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10518
10519                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10520                                 && test -z "${cf_tst_cflags}" \
10521                                 && cf_fix_cppflags=yes
10522
10523                         if test $cf_fix_cppflags = yes ; then
10524                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10525                                 continue
10526                         elif test "${cf_tst_cflags}" = "\"'" ; then
10527                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10528                                 continue
10529                         fi
10530                         ;;
10531                 esac
10532                 case "$CPPFLAGS" in
10533                 (*$cf_add_cflags)
10534                         ;;
10535                 (*)
10536                         case $cf_add_cflags in
10537                         (-D*)
10538                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10539
10540 CPPFLAGS=`echo "$CPPFLAGS" | \
10541         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10542                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10543
10544                                 ;;
10545                         esac
10546                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10547                         ;;
10548                 esac
10549                 ;;
10550         (*)
10551                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10552                 ;;
10553         esac
10554         ;;
10555 (yes)
10556         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10557
10558         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10559
10560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10561                 && test -z "${cf_tst_cflags}" \
10562                 && cf_fix_cppflags=no
10563         ;;
10564 esac
10565 done
10566
10567 if test -n "$cf_new_cflags" ; then
10568         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10569
10570 echo "${as_me:-configure}:10570: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10571
10572         CFLAGS="$CFLAGS $cf_new_cflags"
10573 fi
10574
10575 if test -n "$cf_new_cppflags" ; then
10576         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10577
10578 echo "${as_me:-configure}:10578: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10579
10580         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10581 fi
10582
10583 if test -n "$cf_new_extra_cppflags" ; then
10584         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10585
10586 echo "${as_me:-configure}:10586: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10587
10588         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10589 fi
10590
10591 fi
10592
10593 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10594         echo "$as_me:10594: checking if _XOPEN_SOURCE really is set" >&5
10595 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10596         cat >conftest.$ac_ext <<_ACEOF
10597 #line 10597 "configure"
10598 #include "confdefs.h"
10599 #include <stdlib.h>
10600 int
10601 main ()
10602 {
10603
10604 #ifndef _XOPEN_SOURCE
10605 make an error
10606 #endif
10607   ;
10608   return 0;
10609 }
10610 _ACEOF
10611 rm -f conftest.$ac_objext
10612 if { (eval echo "$as_me:10612: \"$ac_compile\"") >&5
10613   (eval $ac_compile) 2>&5
10614   ac_status=$?
10615   echo "$as_me:10615: \$? = $ac_status" >&5
10616   (exit $ac_status); } &&
10617          { ac_try='test -s conftest.$ac_objext'
10618   { (eval echo "$as_me:10618: \"$ac_try\"") >&5
10619   (eval $ac_try) 2>&5
10620   ac_status=$?
10621   echo "$as_me:10621: \$? = $ac_status" >&5
10622   (exit $ac_status); }; }; then
10623   cf_XOPEN_SOURCE_set=yes
10624 else
10625   echo "$as_me: failed program was:" >&5
10626 cat conftest.$ac_ext >&5
10627 cf_XOPEN_SOURCE_set=no
10628 fi
10629 rm -f conftest.$ac_objext conftest.$ac_ext
10630         echo "$as_me:10630: result: $cf_XOPEN_SOURCE_set" >&5
10631 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10632         if test $cf_XOPEN_SOURCE_set = yes
10633         then
10634                 cat >conftest.$ac_ext <<_ACEOF
10635 #line 10635 "configure"
10636 #include "confdefs.h"
10637 #include <stdlib.h>
10638 int
10639 main ()
10640 {
10641
10642 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10643 make an error
10644 #endif
10645   ;
10646   return 0;
10647 }
10648 _ACEOF
10649 rm -f conftest.$ac_objext
10650 if { (eval echo "$as_me:10650: \"$ac_compile\"") >&5
10651   (eval $ac_compile) 2>&5
10652   ac_status=$?
10653   echo "$as_me:10653: \$? = $ac_status" >&5
10654   (exit $ac_status); } &&
10655          { ac_try='test -s conftest.$ac_objext'
10656   { (eval echo "$as_me:10656: \"$ac_try\"") >&5
10657   (eval $ac_try) 2>&5
10658   ac_status=$?
10659   echo "$as_me:10659: \$? = $ac_status" >&5
10660   (exit $ac_status); }; }; then
10661   cf_XOPEN_SOURCE_set_ok=yes
10662 else
10663   echo "$as_me: failed program was:" >&5
10664 cat conftest.$ac_ext >&5
10665 cf_XOPEN_SOURCE_set_ok=no
10666 fi
10667 rm -f conftest.$ac_objext conftest.$ac_ext
10668                 if test $cf_XOPEN_SOURCE_set_ok = no
10669                 then
10670                         { echo "$as_me:10670: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10671 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10672                 fi
10673         else
10674
10675 echo "$as_me:10675: checking if we should define _XOPEN_SOURCE" >&5
10676 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10677 if test "${cf_cv_xopen_source+set}" = set; then
10678   echo $ECHO_N "(cached) $ECHO_C" >&6
10679 else
10680
10681         cat >conftest.$ac_ext <<_ACEOF
10682 #line 10682 "configure"
10683 #include "confdefs.h"
10684
10685 #include <stdlib.h>
10686 #include <string.h>
10687 #include <sys/types.h>
10688
10689 int
10690 main ()
10691 {
10692
10693 #ifndef _XOPEN_SOURCE
10694 make an error
10695 #endif
10696   ;
10697   return 0;
10698 }
10699 _ACEOF
10700 rm -f conftest.$ac_objext
10701 if { (eval echo "$as_me:10701: \"$ac_compile\"") >&5
10702   (eval $ac_compile) 2>&5
10703   ac_status=$?
10704   echo "$as_me:10704: \$? = $ac_status" >&5
10705   (exit $ac_status); } &&
10706          { ac_try='test -s conftest.$ac_objext'
10707   { (eval echo "$as_me:10707: \"$ac_try\"") >&5
10708   (eval $ac_try) 2>&5
10709   ac_status=$?
10710   echo "$as_me:10710: \$? = $ac_status" >&5
10711   (exit $ac_status); }; }; then
10712   cf_cv_xopen_source=no
10713 else
10714   echo "$as_me: failed program was:" >&5
10715 cat conftest.$ac_ext >&5
10716 cf_save="$CPPFLAGS"
10717          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10718          cat >conftest.$ac_ext <<_ACEOF
10719 #line 10719 "configure"
10720 #include "confdefs.h"
10721
10722 #include <stdlib.h>
10723 #include <string.h>
10724 #include <sys/types.h>
10725
10726 int
10727 main ()
10728 {
10729
10730 #ifdef _XOPEN_SOURCE
10731 make an error
10732 #endif
10733   ;
10734   return 0;
10735 }
10736 _ACEOF
10737 rm -f conftest.$ac_objext
10738 if { (eval echo "$as_me:10738: \"$ac_compile\"") >&5
10739   (eval $ac_compile) 2>&5
10740   ac_status=$?
10741   echo "$as_me:10741: \$? = $ac_status" >&5
10742   (exit $ac_status); } &&
10743          { ac_try='test -s conftest.$ac_objext'
10744   { (eval echo "$as_me:10744: \"$ac_try\"") >&5
10745   (eval $ac_try) 2>&5
10746   ac_status=$?
10747   echo "$as_me:10747: \$? = $ac_status" >&5
10748   (exit $ac_status); }; }; then
10749   cf_cv_xopen_source=no
10750 else
10751   echo "$as_me: failed program was:" >&5
10752 cat conftest.$ac_ext >&5
10753 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10754 fi
10755 rm -f conftest.$ac_objext conftest.$ac_ext
10756         CPPFLAGS="$cf_save"
10757
10758 fi
10759 rm -f conftest.$ac_objext conftest.$ac_ext
10760
10761 fi
10762 echo "$as_me:10762: result: $cf_cv_xopen_source" >&5
10763 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10764
10765 if test "$cf_cv_xopen_source" != no ; then
10766
10767 CFLAGS=`echo "$CFLAGS" | \
10768         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10769                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10770
10771 CPPFLAGS=`echo "$CPPFLAGS" | \
10772         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10773                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10774
10775         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10776
10777 cf_fix_cppflags=no
10778 cf_new_cflags=
10779 cf_new_cppflags=
10780 cf_new_extra_cppflags=
10781
10782 for cf_add_cflags in $cf_temp_xopen_source
10783 do
10784 case $cf_fix_cppflags in
10785 (no)
10786         case $cf_add_cflags in
10787         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10788                 case $cf_add_cflags in
10789                 (-D*)
10790                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10791
10792                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10793                                 && test -z "${cf_tst_cflags}" \
10794                                 && cf_fix_cppflags=yes
10795
10796                         if test $cf_fix_cppflags = yes ; then
10797                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10798                                 continue
10799                         elif test "${cf_tst_cflags}" = "\"'" ; then
10800                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10801                                 continue
10802                         fi
10803                         ;;
10804                 esac
10805                 case "$CPPFLAGS" in
10806                 (*$cf_add_cflags)
10807                         ;;
10808                 (*)
10809                         case $cf_add_cflags in
10810                         (-D*)
10811                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10812
10813 CPPFLAGS=`echo "$CPPFLAGS" | \
10814         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10815                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10816
10817                                 ;;
10818                         esac
10819                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10820                         ;;
10821                 esac
10822                 ;;
10823         (*)
10824                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10825                 ;;
10826         esac
10827         ;;
10828 (yes)
10829         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10830
10831         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10832
10833         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10834                 && test -z "${cf_tst_cflags}" \
10835                 && cf_fix_cppflags=no
10836         ;;
10837 esac
10838 done
10839
10840 if test -n "$cf_new_cflags" ; then
10841
10842         CFLAGS="$CFLAGS $cf_new_cflags"
10843 fi
10844
10845 if test -n "$cf_new_cppflags" ; then
10846
10847         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10848 fi
10849
10850 if test -n "$cf_new_extra_cppflags" ; then
10851
10852         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10853 fi
10854
10855 fi
10856
10857         fi
10858 fi
10859
10860 # Check whether --enable-largefile or --disable-largefile was given.
10861 if test "${enable_largefile+set}" = set; then
10862   enableval="$enable_largefile"
10863
10864 fi;
10865 if test "$enable_largefile" != no; then
10866
10867   echo "$as_me:10867: checking for special C compiler options needed for large files" >&5
10868 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
10869 if test "${ac_cv_sys_largefile_CC+set}" = set; then
10870   echo $ECHO_N "(cached) $ECHO_C" >&6
10871 else
10872   ac_cv_sys_largefile_CC=no
10873      if test "$GCC" != yes; then
10874        ac_save_CC=$CC
10875        while :; do
10876          # IRIX 6.2 and later do not support large files by default,
10877          # so use the C compiler's -n32 option if that helps.
10878          cat >conftest.$ac_ext <<_ACEOF
10879 #line 10879 "configure"
10880 #include "confdefs.h"
10881 #include <sys/types.h>
10882  /* Check that off_t can represent 2**63 - 1 correctly.
10883     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10884     since some C++ compilers masquerading as C compilers
10885     incorrectly reject 9223372036854775807.  */
10886 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10887   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10888                        && LARGE_OFF_T % 2147483647 == 1)
10889                       ? 1 : -1];
10890 int
10891 main ()
10892 {
10893
10894   ;
10895   return 0;
10896 }
10897 _ACEOF
10898          rm -f conftest.$ac_objext
10899 if { (eval echo "$as_me:10899: \"$ac_compile\"") >&5
10900   (eval $ac_compile) 2>&5
10901   ac_status=$?
10902   echo "$as_me:10902: \$? = $ac_status" >&5
10903   (exit $ac_status); } &&
10904          { ac_try='test -s conftest.$ac_objext'
10905   { (eval echo "$as_me:10905: \"$ac_try\"") >&5
10906   (eval $ac_try) 2>&5
10907   ac_status=$?
10908   echo "$as_me:10908: \$? = $ac_status" >&5
10909   (exit $ac_status); }; }; then
10910   break
10911 else
10912   echo "$as_me: failed program was:" >&5
10913 cat conftest.$ac_ext >&5
10914 fi
10915 rm -f conftest.$ac_objext
10916          CC="$CC -n32"
10917          rm -f conftest.$ac_objext
10918 if { (eval echo "$as_me:10918: \"$ac_compile\"") >&5
10919   (eval $ac_compile) 2>&5
10920   ac_status=$?
10921   echo "$as_me:10921: \$? = $ac_status" >&5
10922   (exit $ac_status); } &&
10923          { ac_try='test -s conftest.$ac_objext'
10924   { (eval echo "$as_me:10924: \"$ac_try\"") >&5
10925   (eval $ac_try) 2>&5
10926   ac_status=$?
10927   echo "$as_me:10927: \$? = $ac_status" >&5
10928   (exit $ac_status); }; }; then
10929   ac_cv_sys_largefile_CC=' -n32'; break
10930 else
10931   echo "$as_me: failed program was:" >&5
10932 cat conftest.$ac_ext >&5
10933 fi
10934 rm -f conftest.$ac_objext
10935          break
10936        done
10937        CC=$ac_save_CC
10938        rm -f conftest.$ac_ext
10939     fi
10940 fi
10941 echo "$as_me:10941: result: $ac_cv_sys_largefile_CC" >&5
10942 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
10943   if test "$ac_cv_sys_largefile_CC" != no; then
10944     CC=$CC$ac_cv_sys_largefile_CC
10945   fi
10946
10947   echo "$as_me:10947: checking for _FILE_OFFSET_BITS value needed for large files" >&5
10948 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
10949 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
10950   echo $ECHO_N "(cached) $ECHO_C" >&6
10951 else
10952   while :; do
10953   ac_cv_sys_file_offset_bits=no
10954   cat >conftest.$ac_ext <<_ACEOF
10955 #line 10955 "configure"
10956 #include "confdefs.h"
10957 #include <sys/types.h>
10958  /* Check that off_t can represent 2**63 - 1 correctly.
10959     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10960     since some C++ compilers masquerading as C compilers
10961     incorrectly reject 9223372036854775807.  */
10962 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
10963   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
10964                        && LARGE_OFF_T % 2147483647 == 1)
10965                       ? 1 : -1];
10966 int
10967 main ()
10968 {
10969
10970   ;
10971   return 0;
10972 }
10973 _ACEOF
10974 rm -f conftest.$ac_objext
10975 if { (eval echo "$as_me:10975: \"$ac_compile\"") >&5
10976   (eval $ac_compile) 2>&5
10977   ac_status=$?
10978   echo "$as_me:10978: \$? = $ac_status" >&5
10979   (exit $ac_status); } &&
10980          { ac_try='test -s conftest.$ac_objext'
10981   { (eval echo "$as_me:10981: \"$ac_try\"") >&5
10982   (eval $ac_try) 2>&5
10983   ac_status=$?
10984   echo "$as_me:10984: \$? = $ac_status" >&5
10985   (exit $ac_status); }; }; then
10986   break
10987 else
10988   echo "$as_me: failed program was:" >&5
10989 cat conftest.$ac_ext >&5
10990 fi
10991 rm -f conftest.$ac_objext conftest.$ac_ext
10992   cat >conftest.$ac_ext <<_ACEOF
10993 #line 10993 "configure"
10994 #include "confdefs.h"
10995 #define _FILE_OFFSET_BITS 64
10996 #include <sys/types.h>
10997  /* Check that off_t can represent 2**63 - 1 correctly.
10998     We can't simply define LARGE_OFF_T to be 9223372036854775807,
10999     since some C++ compilers masquerading as C compilers
11000     incorrectly reject 9223372036854775807.  */
11001 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11002   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11003                        && LARGE_OFF_T % 2147483647 == 1)
11004                       ? 1 : -1];
11005 int
11006 main ()
11007 {
11008
11009   ;
11010   return 0;
11011 }
11012 _ACEOF
11013 rm -f conftest.$ac_objext
11014 if { (eval echo "$as_me:11014: \"$ac_compile\"") >&5
11015   (eval $ac_compile) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit $ac_status); } &&
11019          { ac_try='test -s conftest.$ac_objext'
11020   { (eval echo "$as_me:11020: \"$ac_try\"") >&5
11021   (eval $ac_try) 2>&5
11022   ac_status=$?
11023   echo "$as_me:11023: \$? = $ac_status" >&5
11024   (exit $ac_status); }; }; then
11025   ac_cv_sys_file_offset_bits=64; break
11026 else
11027   echo "$as_me: failed program was:" >&5
11028 cat conftest.$ac_ext >&5
11029 fi
11030 rm -f conftest.$ac_objext conftest.$ac_ext
11031   break
11032 done
11033 fi
11034 echo "$as_me:11034: result: $ac_cv_sys_file_offset_bits" >&5
11035 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11036 if test "$ac_cv_sys_file_offset_bits" != no; then
11037
11038 cat >>confdefs.h <<EOF
11039 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11040 EOF
11041
11042 fi
11043 rm -rf conftest*
11044   echo "$as_me:11044: checking for _LARGE_FILES value needed for large files" >&5
11045 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11046 if test "${ac_cv_sys_large_files+set}" = set; then
11047   echo $ECHO_N "(cached) $ECHO_C" >&6
11048 else
11049   while :; do
11050   ac_cv_sys_large_files=no
11051   cat >conftest.$ac_ext <<_ACEOF
11052 #line 11052 "configure"
11053 #include "confdefs.h"
11054 #include <sys/types.h>
11055  /* Check that off_t can represent 2**63 - 1 correctly.
11056     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11057     since some C++ compilers masquerading as C compilers
11058     incorrectly reject 9223372036854775807.  */
11059 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11060   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11061                        && LARGE_OFF_T % 2147483647 == 1)
11062                       ? 1 : -1];
11063 int
11064 main ()
11065 {
11066
11067   ;
11068   return 0;
11069 }
11070 _ACEOF
11071 rm -f conftest.$ac_objext
11072 if { (eval echo "$as_me:11072: \"$ac_compile\"") >&5
11073   (eval $ac_compile) 2>&5
11074   ac_status=$?
11075   echo "$as_me:11075: \$? = $ac_status" >&5
11076   (exit $ac_status); } &&
11077          { ac_try='test -s conftest.$ac_objext'
11078   { (eval echo "$as_me:11078: \"$ac_try\"") >&5
11079   (eval $ac_try) 2>&5
11080   ac_status=$?
11081   echo "$as_me:11081: \$? = $ac_status" >&5
11082   (exit $ac_status); }; }; then
11083   break
11084 else
11085   echo "$as_me: failed program was:" >&5
11086 cat conftest.$ac_ext >&5
11087 fi
11088 rm -f conftest.$ac_objext conftest.$ac_ext
11089   cat >conftest.$ac_ext <<_ACEOF
11090 #line 11090 "configure"
11091 #include "confdefs.h"
11092 #define _LARGE_FILES 1
11093 #include <sys/types.h>
11094  /* Check that off_t can represent 2**63 - 1 correctly.
11095     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11096     since some C++ compilers masquerading as C compilers
11097     incorrectly reject 9223372036854775807.  */
11098 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11099   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11100                        && LARGE_OFF_T % 2147483647 == 1)
11101                       ? 1 : -1];
11102 int
11103 main ()
11104 {
11105
11106   ;
11107   return 0;
11108 }
11109 _ACEOF
11110 rm -f conftest.$ac_objext
11111 if { (eval echo "$as_me:11111: \"$ac_compile\"") >&5
11112   (eval $ac_compile) 2>&5
11113   ac_status=$?
11114   echo "$as_me:11114: \$? = $ac_status" >&5
11115   (exit $ac_status); } &&
11116          { ac_try='test -s conftest.$ac_objext'
11117   { (eval echo "$as_me:11117: \"$ac_try\"") >&5
11118   (eval $ac_try) 2>&5
11119   ac_status=$?
11120   echo "$as_me:11120: \$? = $ac_status" >&5
11121   (exit $ac_status); }; }; then
11122   ac_cv_sys_large_files=1; break
11123 else
11124   echo "$as_me: failed program was:" >&5
11125 cat conftest.$ac_ext >&5
11126 fi
11127 rm -f conftest.$ac_objext conftest.$ac_ext
11128   break
11129 done
11130 fi
11131 echo "$as_me:11131: result: $ac_cv_sys_large_files" >&5
11132 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11133 if test "$ac_cv_sys_large_files" != no; then
11134
11135 cat >>confdefs.h <<EOF
11136 #define _LARGE_FILES $ac_cv_sys_large_files
11137 EOF
11138
11139 fi
11140 rm -rf conftest*
11141 fi
11142
11143         if test "$enable_largefile" != no ; then
11144         echo "$as_me:11144: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11145 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11146 if test "${ac_cv_sys_largefile_source+set}" = set; then
11147   echo $ECHO_N "(cached) $ECHO_C" >&6
11148 else
11149   while :; do
11150   ac_cv_sys_largefile_source=no
11151   cat >conftest.$ac_ext <<_ACEOF
11152 #line 11152 "configure"
11153 #include "confdefs.h"
11154 #include <stdio.h>
11155 int
11156 main ()
11157 {
11158 return !fseeko;
11159   ;
11160   return 0;
11161 }
11162 _ACEOF
11163 rm -f conftest.$ac_objext
11164 if { (eval echo "$as_me:11164: \"$ac_compile\"") >&5
11165   (eval $ac_compile) 2>&5
11166   ac_status=$?
11167   echo "$as_me:11167: \$? = $ac_status" >&5
11168   (exit $ac_status); } &&
11169          { ac_try='test -s conftest.$ac_objext'
11170   { (eval echo "$as_me:11170: \"$ac_try\"") >&5
11171   (eval $ac_try) 2>&5
11172   ac_status=$?
11173   echo "$as_me:11173: \$? = $ac_status" >&5
11174   (exit $ac_status); }; }; then
11175   break
11176 else
11177   echo "$as_me: failed program was:" >&5
11178 cat conftest.$ac_ext >&5
11179 fi
11180 rm -f conftest.$ac_objext conftest.$ac_ext
11181   cat >conftest.$ac_ext <<_ACEOF
11182 #line 11182 "configure"
11183 #include "confdefs.h"
11184 #define _LARGEFILE_SOURCE 1
11185 #include <stdio.h>
11186 int
11187 main ()
11188 {
11189 return !fseeko;
11190   ;
11191   return 0;
11192 }
11193 _ACEOF
11194 rm -f conftest.$ac_objext
11195 if { (eval echo "$as_me:11195: \"$ac_compile\"") >&5
11196   (eval $ac_compile) 2>&5
11197   ac_status=$?
11198   echo "$as_me:11198: \$? = $ac_status" >&5
11199   (exit $ac_status); } &&
11200          { ac_try='test -s conftest.$ac_objext'
11201   { (eval echo "$as_me:11201: \"$ac_try\"") >&5
11202   (eval $ac_try) 2>&5
11203   ac_status=$?
11204   echo "$as_me:11204: \$? = $ac_status" >&5
11205   (exit $ac_status); }; }; then
11206   ac_cv_sys_largefile_source=1; break
11207 else
11208   echo "$as_me: failed program was:" >&5
11209 cat conftest.$ac_ext >&5
11210 fi
11211 rm -f conftest.$ac_objext conftest.$ac_ext
11212   break
11213 done
11214 fi
11215 echo "$as_me:11215: result: $ac_cv_sys_largefile_source" >&5
11216 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11217 if test "$ac_cv_sys_largefile_source" != no; then
11218
11219 cat >>confdefs.h <<EOF
11220 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11221 EOF
11222
11223 fi
11224 rm -rf conftest*
11225
11226 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11227 # in glibc 2.1.3, but that breaks too many other things.
11228 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11229 echo "$as_me:11229: checking for fseeko" >&5
11230 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11231 if test "${ac_cv_func_fseeko+set}" = set; then
11232   echo $ECHO_N "(cached) $ECHO_C" >&6
11233 else
11234   cat >conftest.$ac_ext <<_ACEOF
11235 #line 11235 "configure"
11236 #include "confdefs.h"
11237 #include <stdio.h>
11238 int
11239 main ()
11240 {
11241 return fseeko && fseeko (stdin, 0, 0);
11242   ;
11243   return 0;
11244 }
11245 _ACEOF
11246 rm -f conftest.$ac_objext conftest$ac_exeext
11247 if { (eval echo "$as_me:11247: \"$ac_link\"") >&5
11248   (eval $ac_link) 2>&5
11249   ac_status=$?
11250   echo "$as_me:11250: \$? = $ac_status" >&5
11251   (exit $ac_status); } &&
11252          { ac_try='test -s conftest$ac_exeext'
11253   { (eval echo "$as_me:11253: \"$ac_try\"") >&5
11254   (eval $ac_try) 2>&5
11255   ac_status=$?
11256   echo "$as_me:11256: \$? = $ac_status" >&5
11257   (exit $ac_status); }; }; then
11258   ac_cv_func_fseeko=yes
11259 else
11260   echo "$as_me: failed program was:" >&5
11261 cat conftest.$ac_ext >&5
11262 ac_cv_func_fseeko=no
11263 fi
11264 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11265 fi
11266 echo "$as_me:11266: result: $ac_cv_func_fseeko" >&5
11267 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11268 if test $ac_cv_func_fseeko = yes; then
11269
11270 cat >>confdefs.h <<\EOF
11271 #define HAVE_FSEEKO 1
11272 EOF
11273
11274 fi
11275
11276         # Normally we would collect these definitions in the config.h,
11277         # but (like _XOPEN_SOURCE), some environments rely on having these
11278         # defined before any of the system headers are included.  Another
11279         # case comes up with C++, e.g., on AIX the compiler compiles the
11280         # header files by themselves before looking at the body files it is
11281         # told to compile.  For ncurses, those header files do not include
11282         # the config.h
11283         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11284         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11285         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11286
11287         echo "$as_me:11287: checking whether to use struct dirent64" >&5
11288 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11289 if test "${cf_cv_struct_dirent64+set}" = set; then
11290   echo $ECHO_N "(cached) $ECHO_C" >&6
11291 else
11292
11293                 cat >conftest.$ac_ext <<_ACEOF
11294 #line 11294 "configure"
11295 #include "confdefs.h"
11296
11297 #include <sys/types.h>
11298 #include <dirent.h>
11299
11300 int
11301 main ()
11302 {
11303
11304                 /* if transitional largefile support is setup, this is true */
11305                 extern struct dirent64 * readdir(DIR *);
11306                 struct dirent64 *x = readdir((DIR *)0);
11307                 struct dirent *y = readdir((DIR *)0);
11308                 int z = x - y;
11309
11310   ;
11311   return 0;
11312 }
11313 _ACEOF
11314 rm -f conftest.$ac_objext
11315 if { (eval echo "$as_me:11315: \"$ac_compile\"") >&5
11316   (eval $ac_compile) 2>&5
11317   ac_status=$?
11318   echo "$as_me:11318: \$? = $ac_status" >&5
11319   (exit $ac_status); } &&
11320          { ac_try='test -s conftest.$ac_objext'
11321   { (eval echo "$as_me:11321: \"$ac_try\"") >&5
11322   (eval $ac_try) 2>&5
11323   ac_status=$?
11324   echo "$as_me:11324: \$? = $ac_status" >&5
11325   (exit $ac_status); }; }; then
11326   cf_cv_struct_dirent64=yes
11327 else
11328   echo "$as_me: failed program was:" >&5
11329 cat conftest.$ac_ext >&5
11330 cf_cv_struct_dirent64=no
11331 fi
11332 rm -f conftest.$ac_objext conftest.$ac_ext
11333
11334 fi
11335 echo "$as_me:11335: result: $cf_cv_struct_dirent64" >&5
11336 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11337         test "$cf_cv_struct_dirent64" = yes &&
11338 cat >>confdefs.h <<\EOF
11339 #define HAVE_STRUCT_DIRENT64 1
11340 EOF
11341
11342         fi
11343
11344 ### Enable compiling-in rcs id's
11345 echo "$as_me:11345: checking if RCS identifiers should be compiled-in" >&5
11346 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11347
11348 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11349 if test "${with_rcs_ids+set}" = set; then
11350   withval="$with_rcs_ids"
11351   with_rcs_ids=$withval
11352 else
11353   with_rcs_ids=no
11354 fi;
11355 echo "$as_me:11355: result: $with_rcs_ids" >&5
11356 echo "${ECHO_T}$with_rcs_ids" >&6
11357 test "$with_rcs_ids" = yes &&
11358 cat >>confdefs.h <<\EOF
11359 #define USE_RCS_IDS 1
11360 EOF
11361
11362 ###############################################################################
11363
11364 ### Note that some functions (such as const) are normally disabled anyway.
11365 echo "$as_me:11365: checking if you want to build with function extensions" >&5
11366 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11367
11368 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11369 if test "${enable_ext_funcs+set}" = set; then
11370   enableval="$enable_ext_funcs"
11371   with_ext_funcs=$enableval
11372 else
11373   with_ext_funcs=yes
11374 fi;
11375 echo "$as_me:11375: result: $with_ext_funcs" >&5
11376 echo "${ECHO_T}$with_ext_funcs" >&6
11377 if test "$with_ext_funcs" = yes ; then
11378         NCURSES_EXT_FUNCS=1
11379
11380 cat >>confdefs.h <<\EOF
11381 #define HAVE_USE_DEFAULT_COLORS 1
11382 EOF
11383
11384 cat >>confdefs.h <<\EOF
11385 #define NCURSES_EXT_FUNCS 1
11386 EOF
11387
11388 else
11389         NCURSES_EXT_FUNCS=0
11390 fi
11391
11392 ###   use option --enable-const to turn on use of const beyond that in XSI.
11393 echo "$as_me:11393: checking for extended use of const keyword" >&5
11394 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11395
11396 # Check whether --enable-const or --disable-const was given.
11397 if test "${enable_const+set}" = set; then
11398   enableval="$enable_const"
11399   with_ext_const=$enableval
11400 else
11401   with_ext_const=no
11402 fi;
11403 echo "$as_me:11403: result: $with_ext_const" >&5
11404 echo "${ECHO_T}$with_ext_const" >&6
11405 NCURSES_CONST='/*nothing*/'
11406 if test "$with_ext_const" = yes ; then
11407         NCURSES_CONST=const
11408 fi
11409
11410 ###############################################################################
11411 # These options are relatively safe to experiment with.
11412
11413 echo "$as_me:11413: checking if you want all development code" >&5
11414 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11415
11416 # Check whether --with-develop or --without-develop was given.
11417 if test "${with_develop+set}" = set; then
11418   withval="$with_develop"
11419   with_develop=$withval
11420 else
11421   with_develop=no
11422 fi;
11423 echo "$as_me:11423: result: $with_develop" >&5
11424 echo "${ECHO_T}$with_develop" >&6
11425
11426 ###############################################################################
11427 # These are just experimental, probably should not be in a package:
11428
11429 # This is still experimental (20080329), but should ultimately be moved to
11430 # the script-block --with-normal, etc.
11431
11432 echo "$as_me:11432: checking if you want to link with the pthread library" >&5
11433 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11434
11435 # Check whether --with-pthread or --without-pthread was given.
11436 if test "${with_pthread+set}" = set; then
11437   withval="$with_pthread"
11438   with_pthread=$withval
11439 else
11440   with_pthread=no
11441 fi;
11442 echo "$as_me:11442: result: $with_pthread" >&5
11443 echo "${ECHO_T}$with_pthread" >&6
11444
11445 if test "$with_pthread" != no ; then
11446         echo "$as_me:11446: checking for pthread.h" >&5
11447 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11448 if test "${ac_cv_header_pthread_h+set}" = set; then
11449   echo $ECHO_N "(cached) $ECHO_C" >&6
11450 else
11451   cat >conftest.$ac_ext <<_ACEOF
11452 #line 11452 "configure"
11453 #include "confdefs.h"
11454 #include <pthread.h>
11455 _ACEOF
11456 if { (eval echo "$as_me:11456: \"$ac_cpp conftest.$ac_ext\"") >&5
11457   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11458   ac_status=$?
11459   egrep -v '^ *\+' conftest.er1 >conftest.err
11460   rm -f conftest.er1
11461   cat conftest.err >&5
11462   echo "$as_me:11462: \$? = $ac_status" >&5
11463   (exit $ac_status); } >/dev/null; then
11464   if test -s conftest.err; then
11465     ac_cpp_err=$ac_c_preproc_warn_flag
11466   else
11467     ac_cpp_err=
11468   fi
11469 else
11470   ac_cpp_err=yes
11471 fi
11472 if test -z "$ac_cpp_err"; then
11473   ac_cv_header_pthread_h=yes
11474 else
11475   echo "$as_me: failed program was:" >&5
11476   cat conftest.$ac_ext >&5
11477   ac_cv_header_pthread_h=no
11478 fi
11479 rm -f conftest.err conftest.$ac_ext
11480 fi
11481 echo "$as_me:11481: result: $ac_cv_header_pthread_h" >&5
11482 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11483 if test $ac_cv_header_pthread_h = yes; then
11484
11485 cat >>confdefs.h <<\EOF
11486 #define HAVE_PTHREADS_H 1
11487 EOF
11488
11489         for cf_lib_pthread in pthread c_r
11490         do
11491             echo "$as_me:11491: checking if we can link with the $cf_lib_pthread library" >&5
11492 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11493             cf_save_LIBS="$LIBS"
11494
11495 cf_add_libs="-l$cf_lib_pthread"
11496 # Filter out duplicates - this happens with badly-designed ".pc" files...
11497 for cf_add_1lib in $LIBS
11498 do
11499         for cf_add_2lib in $cf_add_libs
11500         do
11501                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11502                 then
11503                         cf_add_1lib=
11504                         break
11505                 fi
11506         done
11507         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11508 done
11509 LIBS="$cf_add_libs"
11510
11511             cat >conftest.$ac_ext <<_ACEOF
11512 #line 11512 "configure"
11513 #include "confdefs.h"
11514
11515 #include <pthread.h>
11516
11517 int
11518 main ()
11519 {
11520
11521                 int rc = pthread_create(0,0,0,0);
11522                 int r2 = pthread_mutexattr_settype(0, 0);
11523
11524   ;
11525   return 0;
11526 }
11527 _ACEOF
11528 rm -f conftest.$ac_objext conftest$ac_exeext
11529 if { (eval echo "$as_me:11529: \"$ac_link\"") >&5
11530   (eval $ac_link) 2>&5
11531   ac_status=$?
11532   echo "$as_me:11532: \$? = $ac_status" >&5
11533   (exit $ac_status); } &&
11534          { ac_try='test -s conftest$ac_exeext'
11535   { (eval echo "$as_me:11535: \"$ac_try\"") >&5
11536   (eval $ac_try) 2>&5
11537   ac_status=$?
11538   echo "$as_me:11538: \$? = $ac_status" >&5
11539   (exit $ac_status); }; }; then
11540   with_pthread=yes
11541 else
11542   echo "$as_me: failed program was:" >&5
11543 cat conftest.$ac_ext >&5
11544 with_pthread=no
11545 fi
11546 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11547             LIBS="$cf_save_LIBS"
11548             echo "$as_me:11548: result: $with_pthread" >&5
11549 echo "${ECHO_T}$with_pthread" >&6
11550             test "$with_pthread" = yes && break
11551         done
11552
11553         if test "$with_pthread" = yes ; then
11554
11555 cf_add_libs="-l$cf_lib_pthread"
11556 # Filter out duplicates - this happens with badly-designed ".pc" files...
11557 for cf_add_1lib in $LIBS
11558 do
11559         for cf_add_2lib in $cf_add_libs
11560         do
11561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11562                 then
11563                         cf_add_1lib=
11564                         break
11565                 fi
11566         done
11567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11568 done
11569 LIBS="$cf_add_libs"
11570
11571 cat >>confdefs.h <<\EOF
11572 #define HAVE_LIBPTHREADS 1
11573 EOF
11574
11575         else
11576             { { echo "$as_me:11576: error: Cannot link with pthread library" >&5
11577 echo "$as_me: error: Cannot link with pthread library" >&2;}
11578    { (exit 1); exit 1; }; }
11579         fi
11580
11581 fi
11582
11583 fi
11584
11585 echo "$as_me:11585: checking if you want to use weak-symbols for pthreads" >&5
11586 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11587
11588 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11589 if test "${enable_weak_symbols+set}" = set; then
11590   enableval="$enable_weak_symbols"
11591   use_weak_symbols=$withval
11592 else
11593   use_weak_symbols=no
11594 fi;
11595 echo "$as_me:11595: result: $use_weak_symbols" >&5
11596 echo "${ECHO_T}$use_weak_symbols" >&6
11597 if test "$use_weak_symbols" = yes ; then
11598
11599 echo "$as_me:11599: checking if $CC supports weak symbols" >&5
11600 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11601 if test "${cf_cv_weak_symbols+set}" = set; then
11602   echo $ECHO_N "(cached) $ECHO_C" >&6
11603 else
11604
11605 cat >conftest.$ac_ext <<_ACEOF
11606 #line 11606 "configure"
11607 #include "confdefs.h"
11608
11609 #include <stdio.h>
11610 int
11611 main ()
11612 {
11613
11614 #if defined(__GNUC__)
11615 #  if defined __USE_ISOC99
11616 #    define _cat_pragma(exp)    _Pragma(#exp)
11617 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11618 #  else
11619 #    define _weak_pragma(exp)
11620 #  endif
11621 #  define _declare(name)        __extension__ extern __typeof__(name) name
11622 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11623 #endif
11624
11625 weak_symbol(fopen);
11626
11627   ;
11628   return 0;
11629 }
11630 _ACEOF
11631 rm -f conftest.$ac_objext
11632 if { (eval echo "$as_me:11632: \"$ac_compile\"") >&5
11633   (eval $ac_compile) 2>&5
11634   ac_status=$?
11635   echo "$as_me:11635: \$? = $ac_status" >&5
11636   (exit $ac_status); } &&
11637          { ac_try='test -s conftest.$ac_objext'
11638   { (eval echo "$as_me:11638: \"$ac_try\"") >&5
11639   (eval $ac_try) 2>&5
11640   ac_status=$?
11641   echo "$as_me:11641: \$? = $ac_status" >&5
11642   (exit $ac_status); }; }; then
11643   cf_cv_weak_symbols=yes
11644 else
11645   echo "$as_me: failed program was:" >&5
11646 cat conftest.$ac_ext >&5
11647 cf_cv_weak_symbols=no
11648 fi
11649 rm -f conftest.$ac_objext conftest.$ac_ext
11650
11651 fi
11652 echo "$as_me:11652: result: $cf_cv_weak_symbols" >&5
11653 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11654
11655 else
11656         cf_cv_weak_symbols=no
11657 fi
11658
11659 if test $cf_cv_weak_symbols = yes ; then
11660
11661 cat >>confdefs.h <<\EOF
11662 #define USE_WEAK_SYMBOLS 1
11663 EOF
11664
11665 fi
11666
11667 PTHREAD=
11668 if test "$with_pthread" = "yes" ; then
11669
11670 cat >>confdefs.h <<\EOF
11671 #define USE_PTHREADS 1
11672 EOF
11673
11674         enable_reentrant=yes
11675         if test $cf_cv_weak_symbols = yes ; then
11676                 PTHREAD=-lpthread
11677         fi
11678 fi
11679
11680 # OpenSUSE is installing ncurses6, using reentrant option.
11681 echo "$as_me:11681: checking for _nc_TABSIZE" >&5
11682 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11683 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11684   echo $ECHO_N "(cached) $ECHO_C" >&6
11685 else
11686   cat >conftest.$ac_ext <<_ACEOF
11687 #line 11687 "configure"
11688 #include "confdefs.h"
11689 /* System header to define __stub macros and hopefully few prototypes,
11690     which can conflict with char _nc_TABSIZE (); below.  */
11691 #include <assert.h>
11692 /* Override any gcc2 internal prototype to avoid an error.  */
11693 #ifdef __cplusplus
11694 extern "C"
11695 #endif
11696 /* We use char because int might match the return type of a gcc2
11697    builtin and then its argument prototype would still apply.  */
11698 char _nc_TABSIZE ();
11699 char (*f) ();
11700
11701 int
11702 main ()
11703 {
11704 /* The GNU C library defines this for functions which it implements
11705     to always fail with ENOSYS.  Some functions are actually named
11706     something starting with __ and the normal name is an alias.  */
11707 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11708 choke me
11709 #else
11710 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11711 #endif
11712
11713   ;
11714   return 0;
11715 }
11716 _ACEOF
11717 rm -f conftest.$ac_objext conftest$ac_exeext
11718 if { (eval echo "$as_me:11718: \"$ac_link\"") >&5
11719   (eval $ac_link) 2>&5
11720   ac_status=$?
11721   echo "$as_me:11721: \$? = $ac_status" >&5
11722   (exit $ac_status); } &&
11723          { ac_try='test -s conftest$ac_exeext'
11724   { (eval echo "$as_me:11724: \"$ac_try\"") >&5
11725   (eval $ac_try) 2>&5
11726   ac_status=$?
11727   echo "$as_me:11727: \$? = $ac_status" >&5
11728   (exit $ac_status); }; }; then
11729   ac_cv_func__nc_TABSIZE=yes
11730 else
11731   echo "$as_me: failed program was:" >&5
11732 cat conftest.$ac_ext >&5
11733 ac_cv_func__nc_TABSIZE=no
11734 fi
11735 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11736 fi
11737 echo "$as_me:11737: result: $ac_cv_func__nc_TABSIZE" >&5
11738 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11739 if test $ac_cv_func__nc_TABSIZE = yes; then
11740   assume_reentrant=yes
11741 else
11742   assume_reentrant=no
11743 fi
11744
11745 # Reentrant code has to be opaque; there's little advantage to making ncurses
11746 # opaque outside of that, so there is no --enable-opaque option.  We can use
11747 # this option without --with-pthreads, but this will be always set for
11748 # pthreads.
11749 echo "$as_me:11749: checking if you want experimental reentrant code" >&5
11750 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11751
11752 # Check whether --enable-reentrant or --disable-reentrant was given.
11753 if test "${enable_reentrant+set}" = set; then
11754   enableval="$enable_reentrant"
11755   with_reentrant=$enableval
11756 else
11757   with_reentrant=$assume_reentrant
11758 fi;
11759 echo "$as_me:11759: result: $with_reentrant" >&5
11760 echo "${ECHO_T}$with_reentrant" >&6
11761 if test "$with_reentrant" = yes ; then
11762         cf_cv_enable_reentrant=1
11763         if test $cf_cv_weak_symbols = yes ; then
11764
11765 # remove pthread library from $LIBS
11766 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11767
11768         elif test "$assume_reentrant" = no ; then
11769                 LIB_SUFFIX="t${LIB_SUFFIX}"
11770         fi
11771
11772 cat >>confdefs.h <<\EOF
11773 #define USE_REENTRANT 1
11774 EOF
11775
11776 else
11777         cf_cv_enable_reentrant=0
11778 fi
11779
11780 ### Allow using a different wrap-prefix
11781 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11782         echo "$as_me:11782: checking for prefix used to wrap public variables" >&5
11783 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11784
11785 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11786 if test "${with_wrap_prefix+set}" = set; then
11787   withval="$with_wrap_prefix"
11788   NCURSES_WRAP_PREFIX=$withval
11789 else
11790   NCURSES_WRAP_PREFIX=_nc_
11791 fi;
11792         echo "$as_me:11792: result: $NCURSES_WRAP_PREFIX" >&5
11793 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11794 else
11795         NCURSES_WRAP_PREFIX=_nc_
11796 fi
11797
11798 cat >>confdefs.h <<EOF
11799 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
11800 EOF
11801
11802 ###############################################################################
11803
11804 ###     use option --disable-echo to suppress full display compiling commands
11805
11806 echo "$as_me:11806: checking if you want to see long compiling messages" >&5
11807 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
11808
11809 # Check whether --enable-echo or --disable-echo was given.
11810 if test "${enable_echo+set}" = set; then
11811   enableval="$enable_echo"
11812   test "$enableval" != no && enableval=yes
11813         if test "$enableval" != "yes" ; then
11814
11815         ECHO_LT='--silent'
11816         ECHO_LD='@echo linking $@;'
11817         RULE_CC='@echo compiling $<'
11818         SHOW_CC='@echo compiling $@'
11819         ECHO_CC='@'
11820
11821         else
11822
11823         ECHO_LT=''
11824         ECHO_LD=''
11825         RULE_CC=''
11826         SHOW_CC=''
11827         ECHO_CC=''
11828
11829         fi
11830 else
11831   enableval=yes
11832
11833         ECHO_LT=''
11834         ECHO_LD=''
11835         RULE_CC=''
11836         SHOW_CC=''
11837         ECHO_CC=''
11838
11839 fi;
11840 echo "$as_me:11840: result: $enableval" >&5
11841 echo "${ECHO_T}$enableval" >&6
11842
11843 ###     use option --enable-warnings to turn on all gcc warnings
11844 echo "$as_me:11844: checking if you want to see compiler warnings" >&5
11845 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
11846
11847 # Check whether --enable-warnings or --disable-warnings was given.
11848 if test "${enable_warnings+set}" = set; then
11849   enableval="$enable_warnings"
11850   with_warnings=$enableval
11851 fi;
11852 echo "$as_me:11852: result: $with_warnings" >&5
11853 echo "${ECHO_T}$with_warnings" >&6
11854
11855 if test "x$with_warnings" = "xyes"; then
11856
11857         ADAFLAGS="$ADAFLAGS -gnatg"
11858
11859 INTEL_COMPILER=no
11860
11861 if test "$GCC" = yes ; then
11862         case $host_os in
11863         (linux*|gnu*)
11864                 echo "$as_me:11864: checking if this is really Intel C compiler" >&5
11865 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
11866                 cf_save_CFLAGS="$CFLAGS"
11867                 CFLAGS="$CFLAGS -no-gcc"
11868                 cat >conftest.$ac_ext <<_ACEOF
11869 #line 11869 "configure"
11870 #include "confdefs.h"
11871
11872 int
11873 main ()
11874 {
11875
11876 #ifdef __INTEL_COMPILER
11877 #else
11878 make an error
11879 #endif
11880
11881   ;
11882   return 0;
11883 }
11884 _ACEOF
11885 rm -f conftest.$ac_objext
11886 if { (eval echo "$as_me:11886: \"$ac_compile\"") >&5
11887   (eval $ac_compile) 2>&5
11888   ac_status=$?
11889   echo "$as_me:11889: \$? = $ac_status" >&5
11890   (exit $ac_status); } &&
11891          { ac_try='test -s conftest.$ac_objext'
11892   { (eval echo "$as_me:11892: \"$ac_try\"") >&5
11893   (eval $ac_try) 2>&5
11894   ac_status=$?
11895   echo "$as_me:11895: \$? = $ac_status" >&5
11896   (exit $ac_status); }; }; then
11897   INTEL_COMPILER=yes
11898 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
11899
11900 else
11901   echo "$as_me: failed program was:" >&5
11902 cat conftest.$ac_ext >&5
11903 fi
11904 rm -f conftest.$ac_objext conftest.$ac_ext
11905                 CFLAGS="$cf_save_CFLAGS"
11906                 echo "$as_me:11906: result: $INTEL_COMPILER" >&5
11907 echo "${ECHO_T}$INTEL_COMPILER" >&6
11908                 ;;
11909         esac
11910 fi
11911
11912 CLANG_COMPILER=no
11913
11914 if test "$GCC" = yes ; then
11915         echo "$as_me:11915: checking if this is really Clang C compiler" >&5
11916 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
11917         cf_save_CFLAGS="$CFLAGS"
11918         CFLAGS="$CFLAGS -Qunused-arguments"
11919         cat >conftest.$ac_ext <<_ACEOF
11920 #line 11920 "configure"
11921 #include "confdefs.h"
11922
11923 int
11924 main ()
11925 {
11926
11927 #ifdef __clang__
11928 #else
11929 make an error
11930 #endif
11931
11932   ;
11933   return 0;
11934 }
11935 _ACEOF
11936 rm -f conftest.$ac_objext
11937 if { (eval echo "$as_me:11937: \"$ac_compile\"") >&5
11938   (eval $ac_compile) 2>&5
11939   ac_status=$?
11940   echo "$as_me:11940: \$? = $ac_status" >&5
11941   (exit $ac_status); } &&
11942          { ac_try='test -s conftest.$ac_objext'
11943   { (eval echo "$as_me:11943: \"$ac_try\"") >&5
11944   (eval $ac_try) 2>&5
11945   ac_status=$?
11946   echo "$as_me:11946: \$? = $ac_status" >&5
11947   (exit $ac_status); }; }; then
11948   CLANG_COMPILER=yes
11949 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
11950
11951 else
11952   echo "$as_me: failed program was:" >&5
11953 cat conftest.$ac_ext >&5
11954 fi
11955 rm -f conftest.$ac_objext conftest.$ac_ext
11956         CFLAGS="$cf_save_CFLAGS"
11957         echo "$as_me:11957: result: $CLANG_COMPILER" >&5
11958 echo "${ECHO_T}$CLANG_COMPILER" >&6
11959 fi
11960
11961 cat > conftest.$ac_ext <<EOF
11962 #line 11962 "${as_me:-configure}"
11963 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
11964 EOF
11965
11966 if test "$INTEL_COMPILER" = yes
11967 then
11968 # The "-wdXXX" options suppress warnings:
11969 # remark #1419: external declaration in primary source file
11970 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
11971 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
11972 # remark #193: zero used for undefined preprocessing identifier
11973 # remark #593: variable "curs_sb_left_arrow" was set but never used
11974 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
11975 # remark #869: parameter "tw" was never referenced
11976 # remark #981: operands are evaluated in unspecified order
11977 # warning #279: controlling expression is constant
11978
11979         { echo "$as_me:11979: checking for $CC warning options..." >&5
11980 echo "$as_me: checking for $CC warning options..." >&6;}
11981         cf_save_CFLAGS="$CFLAGS"
11982         EXTRA_CFLAGS="-Wall"
11983         for cf_opt in \
11984                 wd1419 \
11985                 wd1683 \
11986                 wd1684 \
11987                 wd193 \
11988                 wd593 \
11989                 wd279 \
11990                 wd810 \
11991                 wd869 \
11992                 wd981
11993         do
11994                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
11995                 if { (eval echo "$as_me:11995: \"$ac_compile\"") >&5
11996   (eval $ac_compile) 2>&5
11997   ac_status=$?
11998   echo "$as_me:11998: \$? = $ac_status" >&5
11999   (exit $ac_status); }; then
12000                         test -n "$verbose" && echo "$as_me:12000: result: ... -$cf_opt" >&5
12001 echo "${ECHO_T}... -$cf_opt" >&6
12002                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12003                 fi
12004         done
12005         CFLAGS="$cf_save_CFLAGS"
12006
12007 elif test "$GCC" = yes
12008 then
12009         { echo "$as_me:12009: checking for $CC warning options..." >&5
12010 echo "$as_me: checking for $CC warning options..." >&6;}
12011         cf_save_CFLAGS="$CFLAGS"
12012         EXTRA_CFLAGS=
12013         cf_warn_CONST=""
12014         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12015         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12016         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12017         for cf_opt in W Wall \
12018                 Wbad-function-cast \
12019                 Wcast-align \
12020                 Wcast-qual \
12021                 Wdeclaration-after-statement \
12022                 Wextra \
12023                 Winline \
12024                 Wmissing-declarations \
12025                 Wmissing-prototypes \
12026                 Wnested-externs \
12027                 Wpointer-arith \
12028                 Wshadow \
12029                 Wstrict-prototypes \
12030                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12031         do
12032                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12033                 if { (eval echo "$as_me:12033: \"$ac_compile\"") >&5
12034   (eval $ac_compile) 2>&5
12035   ac_status=$?
12036   echo "$as_me:12036: \$? = $ac_status" >&5
12037   (exit $ac_status); }; then
12038                         test -n "$verbose" && echo "$as_me:12038: result: ... -$cf_opt" >&5
12039 echo "${ECHO_T}... -$cf_opt" >&6
12040                         case $cf_opt in
12041                         (Wcast-qual)
12042                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12043                                 ;;
12044                         (Winline)
12045                                 case $GCC_VERSION in
12046                                 ([34].*)
12047                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12048
12049 echo "${as_me:-configure}:12049: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12050
12051                                         continue;;
12052                                 esac
12053                                 ;;
12054                         (Wpointer-arith)
12055                                 case $GCC_VERSION in
12056                                 ([12].*)
12057                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12058
12059 echo "${as_me:-configure}:12059: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12060
12061                                         continue;;
12062                                 esac
12063                                 ;;
12064                         esac
12065                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12066                 fi
12067         done
12068         CFLAGS="$cf_save_CFLAGS"
12069 fi
12070 rm -rf conftest*
12071
12072 fi
12073
12074 if test "$GCC" = yes
12075 then
12076 cat > conftest.i <<EOF
12077 #ifndef GCC_PRINTF
12078 #define GCC_PRINTF 0
12079 #endif
12080 #ifndef GCC_SCANF
12081 #define GCC_SCANF 0
12082 #endif
12083 #ifndef GCC_NORETURN
12084 #define GCC_NORETURN /* nothing */
12085 #endif
12086 #ifndef GCC_UNUSED
12087 #define GCC_UNUSED /* nothing */
12088 #endif
12089 EOF
12090 if test "$GCC" = yes
12091 then
12092         { echo "$as_me:12092: checking for $CC __attribute__ directives..." >&5
12093 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12094 cat > conftest.$ac_ext <<EOF
12095 #line 12095 "${as_me:-configure}"
12096 #include "confdefs.h"
12097 #include "conftest.h"
12098 #include "conftest.i"
12099 #if     GCC_PRINTF
12100 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12101 #else
12102 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12103 #endif
12104 #if     GCC_SCANF
12105 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12106 #else
12107 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12108 #endif
12109 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12110 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12111 extern void foo(void) GCC_NORETURN;
12112 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12113 EOF
12114         cf_printf_attribute=no
12115         cf_scanf_attribute=no
12116         for cf_attribute in scanf printf unused noreturn
12117         do
12118
12119 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12120
12121                 cf_directive="__attribute__(($cf_attribute))"
12122                 echo "checking for $CC $cf_directive" 1>&5
12123
12124                 case $cf_attribute in
12125                 (printf)
12126                         cf_printf_attribute=yes
12127                         cat >conftest.h <<EOF
12128 #define GCC_$cf_ATTRIBUTE 1
12129 EOF
12130                         ;;
12131                 (scanf)
12132                         cf_scanf_attribute=yes
12133                         cat >conftest.h <<EOF
12134 #define GCC_$cf_ATTRIBUTE 1
12135 EOF
12136                         ;;
12137                 (*)
12138                         cat >conftest.h <<EOF
12139 #define GCC_$cf_ATTRIBUTE $cf_directive
12140 EOF
12141                         ;;
12142                 esac
12143
12144                 if { (eval echo "$as_me:12144: \"$ac_compile\"") >&5
12145   (eval $ac_compile) 2>&5
12146   ac_status=$?
12147   echo "$as_me:12147: \$? = $ac_status" >&5
12148   (exit $ac_status); }; then
12149                         test -n "$verbose" && echo "$as_me:12149: result: ... $cf_attribute" >&5
12150 echo "${ECHO_T}... $cf_attribute" >&6
12151                         cat conftest.h >>confdefs.h
12152                         case $cf_attribute in
12153                         (noreturn)
12154
12155 cat >>confdefs.h <<EOF
12156 #define GCC_NORETURN $cf_directive
12157 EOF
12158
12159                                 ;;
12160                         (printf)
12161                                 cf_value='/* nothing */'
12162                                 if test "$cf_printf_attribute" != no ; then
12163                                         cf_value='__attribute__((format(printf,fmt,var)))'
12164
12165 cat >>confdefs.h <<\EOF
12166 #define GCC_PRINTF 1
12167 EOF
12168
12169                                 fi
12170
12171 cat >>confdefs.h <<EOF
12172 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12173 EOF
12174
12175                                 ;;
12176                         (scanf)
12177                                 cf_value='/* nothing */'
12178                                 if test "$cf_scanf_attribute" != no ; then
12179                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12180
12181 cat >>confdefs.h <<\EOF
12182 #define GCC_SCANF 1
12183 EOF
12184
12185                                 fi
12186
12187 cat >>confdefs.h <<EOF
12188 #define GCC_SCANFLIKE(fmt,var) $cf_value
12189 EOF
12190
12191                                 ;;
12192                         (unused)
12193
12194 cat >>confdefs.h <<EOF
12195 #define GCC_UNUSED $cf_directive
12196 EOF
12197
12198                                 ;;
12199                         esac
12200                 fi
12201         done
12202 else
12203         fgrep define conftest.i >>confdefs.h
12204 fi
12205 rm -rf conftest*
12206 fi
12207
12208 ###     use option --enable-assertions to turn on generation of assertion code
12209 echo "$as_me:12209: checking if you want to enable runtime assertions" >&5
12210 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12211
12212 # Check whether --enable-assertions or --disable-assertions was given.
12213 if test "${enable_assertions+set}" = set; then
12214   enableval="$enable_assertions"
12215   with_assertions=$enableval
12216 else
12217   with_assertions=no
12218 fi;
12219 echo "$as_me:12219: result: $with_assertions" >&5
12220 echo "${ECHO_T}$with_assertions" >&6
12221 if test -n "$GCC"
12222 then
12223         if test "$with_assertions" = no
12224         then
12225                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12226         else
12227
12228         ADAFLAGS="$ADAFLAGS -gnata"
12229
12230         fi
12231 fi
12232
12233 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12234
12235 cat >>confdefs.h <<\EOF
12236 #define HAVE_NC_ALLOC_H 1
12237 EOF
12238
12239 ###     use option --enable-expanded to generate certain macros as functions
12240
12241 # Check whether --enable-expanded or --disable-expanded was given.
12242 if test "${enable_expanded+set}" = set; then
12243   enableval="$enable_expanded"
12244   test "$enableval" = yes &&
12245 cat >>confdefs.h <<\EOF
12246 #define NCURSES_EXPANDED 1
12247 EOF
12248
12249 fi;
12250
12251 ###     use option --disable-macros to suppress macros in favor of functions
12252
12253 # Check whether --enable-macros or --disable-macros was given.
12254 if test "${enable_macros+set}" = set; then
12255   enableval="$enable_macros"
12256   test "$enableval" = no &&
12257 cat >>confdefs.h <<\EOF
12258 #define NCURSES_NOMACROS 1
12259 EOF
12260
12261 fi;
12262
12263 # Normally we only add trace() to the debug-library.  Allow this to be
12264 # extended to all models of the ncurses library:
12265 cf_all_traces=no
12266 case "$CFLAGS $CPPFLAGS" in
12267 (*-DTRACE*)
12268         cf_all_traces=yes
12269         ;;
12270 esac
12271
12272 echo "$as_me:12272: checking whether to add trace feature to all models" >&5
12273 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12274
12275 # Check whether --with-trace or --without-trace was given.
12276 if test "${with_trace+set}" = set; then
12277   withval="$with_trace"
12278   cf_with_trace=$withval
12279 else
12280   cf_with_trace=$cf_all_traces
12281 fi;
12282 echo "$as_me:12282: result: $cf_with_trace" >&5
12283 echo "${ECHO_T}$cf_with_trace" >&6
12284
12285 if test "$cf_with_trace" = yes ; then
12286         ADA_TRACE=TRUE
12287
12288 cf_fix_cppflags=no
12289 cf_new_cflags=
12290 cf_new_cppflags=
12291 cf_new_extra_cppflags=
12292
12293 for cf_add_cflags in -DTRACE
12294 do
12295 case $cf_fix_cppflags in
12296 (no)
12297         case $cf_add_cflags in
12298         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12299                 case $cf_add_cflags in
12300                 (-D*)
12301                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12302
12303                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12304                                 && test -z "${cf_tst_cflags}" \
12305                                 && cf_fix_cppflags=yes
12306
12307                         if test $cf_fix_cppflags = yes ; then
12308                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12309                                 continue
12310                         elif test "${cf_tst_cflags}" = "\"'" ; then
12311                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12312                                 continue
12313                         fi
12314                         ;;
12315                 esac
12316                 case "$CPPFLAGS" in
12317                 (*$cf_add_cflags)
12318                         ;;
12319                 (*)
12320                         case $cf_add_cflags in
12321                         (-D*)
12322                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12323
12324 CPPFLAGS=`echo "$CPPFLAGS" | \
12325         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12326                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12327
12328                                 ;;
12329                         esac
12330                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12331                         ;;
12332                 esac
12333                 ;;
12334         (*)
12335                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12336                 ;;
12337         esac
12338         ;;
12339 (yes)
12340         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12341
12342         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12343
12344         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12345                 && test -z "${cf_tst_cflags}" \
12346                 && cf_fix_cppflags=no
12347         ;;
12348 esac
12349 done
12350
12351 if test -n "$cf_new_cflags" ; then
12352
12353         CFLAGS="$CFLAGS $cf_new_cflags"
12354 fi
12355
12356 if test -n "$cf_new_cppflags" ; then
12357
12358         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12359 fi
12360
12361 if test -n "$cf_new_extra_cppflags" ; then
12362
12363         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12364 fi
12365
12366 else
12367         ADA_TRACE=FALSE
12368 fi
12369
12370 echo "$as_me:12370: checking if we want to use GNAT projects" >&5
12371 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12372
12373 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12374 if test "${enable_gnat_projects+set}" = set; then
12375   enableval="$enable_gnat_projects"
12376   test "$enableval" != no && enableval=yes
12377         if test "$enableval" != "yes" ; then
12378     enable_gnat_projects=no
12379         else
12380                 enable_gnat_projects=yes
12381         fi
12382 else
12383   enableval=yes
12384         enable_gnat_projects=yes
12385
12386 fi;
12387 echo "$as_me:12387: result: $enable_gnat_projects" >&5
12388 echo "${ECHO_T}$enable_gnat_projects" >&6
12389
12390 ###     Checks for libraries.
12391 case $cf_cv_system_name in
12392 (*mingw32*)
12393         ;;
12394 (*)
12395 echo "$as_me:12395: checking for gettimeofday" >&5
12396 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12397 if test "${ac_cv_func_gettimeofday+set}" = set; then
12398   echo $ECHO_N "(cached) $ECHO_C" >&6
12399 else
12400   cat >conftest.$ac_ext <<_ACEOF
12401 #line 12401 "configure"
12402 #include "confdefs.h"
12403 /* System header to define __stub macros and hopefully few prototypes,
12404     which can conflict with char gettimeofday (); below.  */
12405 #include <assert.h>
12406 /* Override any gcc2 internal prototype to avoid an error.  */
12407 #ifdef __cplusplus
12408 extern "C"
12409 #endif
12410 /* We use char because int might match the return type of a gcc2
12411    builtin and then its argument prototype would still apply.  */
12412 char gettimeofday ();
12413 char (*f) ();
12414
12415 int
12416 main ()
12417 {
12418 /* The GNU C library defines this for functions which it implements
12419     to always fail with ENOSYS.  Some functions are actually named
12420     something starting with __ and the normal name is an alias.  */
12421 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12422 choke me
12423 #else
12424 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12425 #endif
12426
12427   ;
12428   return 0;
12429 }
12430 _ACEOF
12431 rm -f conftest.$ac_objext conftest$ac_exeext
12432 if { (eval echo "$as_me:12432: \"$ac_link\"") >&5
12433   (eval $ac_link) 2>&5
12434   ac_status=$?
12435   echo "$as_me:12435: \$? = $ac_status" >&5
12436   (exit $ac_status); } &&
12437          { ac_try='test -s conftest$ac_exeext'
12438   { (eval echo "$as_me:12438: \"$ac_try\"") >&5
12439   (eval $ac_try) 2>&5
12440   ac_status=$?
12441   echo "$as_me:12441: \$? = $ac_status" >&5
12442   (exit $ac_status); }; }; then
12443   ac_cv_func_gettimeofday=yes
12444 else
12445   echo "$as_me: failed program was:" >&5
12446 cat conftest.$ac_ext >&5
12447 ac_cv_func_gettimeofday=no
12448 fi
12449 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12450 fi
12451 echo "$as_me:12451: result: $ac_cv_func_gettimeofday" >&5
12452 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12453 if test $ac_cv_func_gettimeofday = yes; then
12454   cat >>confdefs.h <<\EOF
12455 #define HAVE_GETTIMEOFDAY 1
12456 EOF
12457
12458 else
12459
12460 echo "$as_me:12460: checking for gettimeofday in -lbsd" >&5
12461 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12462 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12463   echo $ECHO_N "(cached) $ECHO_C" >&6
12464 else
12465   ac_check_lib_save_LIBS=$LIBS
12466 LIBS="-lbsd  $LIBS"
12467 cat >conftest.$ac_ext <<_ACEOF
12468 #line 12468 "configure"
12469 #include "confdefs.h"
12470
12471 /* Override any gcc2 internal prototype to avoid an error.  */
12472 #ifdef __cplusplus
12473 extern "C"
12474 #endif
12475 /* We use char because int might match the return type of a gcc2
12476    builtin and then its argument prototype would still apply.  */
12477 char gettimeofday ();
12478 int
12479 main ()
12480 {
12481 gettimeofday ();
12482   ;
12483   return 0;
12484 }
12485 _ACEOF
12486 rm -f conftest.$ac_objext conftest$ac_exeext
12487 if { (eval echo "$as_me:12487: \"$ac_link\"") >&5
12488   (eval $ac_link) 2>&5
12489   ac_status=$?
12490   echo "$as_me:12490: \$? = $ac_status" >&5
12491   (exit $ac_status); } &&
12492          { ac_try='test -s conftest$ac_exeext'
12493   { (eval echo "$as_me:12493: \"$ac_try\"") >&5
12494   (eval $ac_try) 2>&5
12495   ac_status=$?
12496   echo "$as_me:12496: \$? = $ac_status" >&5
12497   (exit $ac_status); }; }; then
12498   ac_cv_lib_bsd_gettimeofday=yes
12499 else
12500   echo "$as_me: failed program was:" >&5
12501 cat conftest.$ac_ext >&5
12502 ac_cv_lib_bsd_gettimeofday=no
12503 fi
12504 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12505 LIBS=$ac_check_lib_save_LIBS
12506 fi
12507 echo "$as_me:12507: result: $ac_cv_lib_bsd_gettimeofday" >&5
12508 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12509 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12510
12511 cat >>confdefs.h <<\EOF
12512 #define HAVE_GETTIMEOFDAY 1
12513 EOF
12514
12515         LIBS="$LIBS -lbsd"
12516 fi
12517
12518 fi
12519         ;;
12520 esac
12521
12522 ###     Checks for header files.
12523 echo "$as_me:12523: checking for ANSI C header files" >&5
12524 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12525 if test "${ac_cv_header_stdc+set}" = set; then
12526   echo $ECHO_N "(cached) $ECHO_C" >&6
12527 else
12528   cat >conftest.$ac_ext <<_ACEOF
12529 #line 12529 "configure"
12530 #include "confdefs.h"
12531 #include <stdlib.h>
12532 #include <stdarg.h>
12533 #include <string.h>
12534 #include <float.h>
12535
12536 _ACEOF
12537 if { (eval echo "$as_me:12537: \"$ac_cpp conftest.$ac_ext\"") >&5
12538   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12539   ac_status=$?
12540   egrep -v '^ *\+' conftest.er1 >conftest.err
12541   rm -f conftest.er1
12542   cat conftest.err >&5
12543   echo "$as_me:12543: \$? = $ac_status" >&5
12544   (exit $ac_status); } >/dev/null; then
12545   if test -s conftest.err; then
12546     ac_cpp_err=$ac_c_preproc_warn_flag
12547   else
12548     ac_cpp_err=
12549   fi
12550 else
12551   ac_cpp_err=yes
12552 fi
12553 if test -z "$ac_cpp_err"; then
12554   ac_cv_header_stdc=yes
12555 else
12556   echo "$as_me: failed program was:" >&5
12557   cat conftest.$ac_ext >&5
12558   ac_cv_header_stdc=no
12559 fi
12560 rm -f conftest.err conftest.$ac_ext
12561
12562 if test $ac_cv_header_stdc = yes; then
12563   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12564   cat >conftest.$ac_ext <<_ACEOF
12565 #line 12565 "configure"
12566 #include "confdefs.h"
12567 #include <string.h>
12568
12569 _ACEOF
12570 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12571   egrep "memchr" >/dev/null 2>&1; then
12572   :
12573 else
12574   ac_cv_header_stdc=no
12575 fi
12576 rm -rf conftest*
12577
12578 fi
12579
12580 if test $ac_cv_header_stdc = yes; then
12581   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12582   cat >conftest.$ac_ext <<_ACEOF
12583 #line 12583 "configure"
12584 #include "confdefs.h"
12585 #include <stdlib.h>
12586
12587 _ACEOF
12588 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12589   egrep "free" >/dev/null 2>&1; then
12590   :
12591 else
12592   ac_cv_header_stdc=no
12593 fi
12594 rm -rf conftest*
12595
12596 fi
12597
12598 if test $ac_cv_header_stdc = yes; then
12599   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12600   if test "$cross_compiling" = yes; then
12601   :
12602 else
12603   cat >conftest.$ac_ext <<_ACEOF
12604 #line 12604 "configure"
12605 #include "confdefs.h"
12606 #include <ctype.h>
12607 #if ((' ' & 0x0FF) == 0x020)
12608 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12609 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12610 #else
12611 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12612                      || ('j' <= (c) && (c) <= 'r') \
12613                      || ('s' <= (c) && (c) <= 'z'))
12614 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12615 #endif
12616
12617 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12618 int
12619 main ()
12620 {
12621   int i;
12622   for (i = 0; i < 256; i++)
12623     if (XOR (islower (i), ISLOWER (i))
12624         || toupper (i) != TOUPPER (i))
12625       $ac_main_return(2);
12626   $ac_main_return (0);
12627 }
12628 _ACEOF
12629 rm -f conftest$ac_exeext
12630 if { (eval echo "$as_me:12630: \"$ac_link\"") >&5
12631   (eval $ac_link) 2>&5
12632   ac_status=$?
12633   echo "$as_me:12633: \$? = $ac_status" >&5
12634   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12635   { (eval echo "$as_me:12635: \"$ac_try\"") >&5
12636   (eval $ac_try) 2>&5
12637   ac_status=$?
12638   echo "$as_me:12638: \$? = $ac_status" >&5
12639   (exit $ac_status); }; }; then
12640   :
12641 else
12642   echo "$as_me: program exited with status $ac_status" >&5
12643 echo "$as_me: failed program was:" >&5
12644 cat conftest.$ac_ext >&5
12645 ac_cv_header_stdc=no
12646 fi
12647 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12648 fi
12649 fi
12650 fi
12651 echo "$as_me:12651: result: $ac_cv_header_stdc" >&5
12652 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12653 if test $ac_cv_header_stdc = yes; then
12654
12655 cat >>confdefs.h <<\EOF
12656 #define STDC_HEADERS 1
12657 EOF
12658
12659 fi
12660
12661 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
12662
12663 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
12664                   inttypes.h stdint.h unistd.h
12665 do
12666 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12667 echo "$as_me:12667: checking for $ac_header" >&5
12668 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12669 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12670   echo $ECHO_N "(cached) $ECHO_C" >&6
12671 else
12672   cat >conftest.$ac_ext <<_ACEOF
12673 #line 12673 "configure"
12674 #include "confdefs.h"
12675 $ac_includes_default
12676 #include <$ac_header>
12677 _ACEOF
12678 rm -f conftest.$ac_objext
12679 if { (eval echo "$as_me:12679: \"$ac_compile\"") >&5
12680   (eval $ac_compile) 2>&5
12681   ac_status=$?
12682   echo "$as_me:12682: \$? = $ac_status" >&5
12683   (exit $ac_status); } &&
12684          { ac_try='test -s conftest.$ac_objext'
12685   { (eval echo "$as_me:12685: \"$ac_try\"") >&5
12686   (eval $ac_try) 2>&5
12687   ac_status=$?
12688   echo "$as_me:12688: \$? = $ac_status" >&5
12689   (exit $ac_status); }; }; then
12690   eval "$as_ac_Header=yes"
12691 else
12692   echo "$as_me: failed program was:" >&5
12693 cat conftest.$ac_ext >&5
12694 eval "$as_ac_Header=no"
12695 fi
12696 rm -f conftest.$ac_objext conftest.$ac_ext
12697 fi
12698 echo "$as_me:12698: result: `eval echo '${'$as_ac_Header'}'`" >&5
12699 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12700 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12701   cat >>confdefs.h <<EOF
12702 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12703 EOF
12704
12705 fi
12706 done
12707
12708 echo "$as_me:12708: checking for signed char" >&5
12709 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
12710 if test "${ac_cv_type_signed_char+set}" = set; then
12711   echo $ECHO_N "(cached) $ECHO_C" >&6
12712 else
12713   cat >conftest.$ac_ext <<_ACEOF
12714 #line 12714 "configure"
12715 #include "confdefs.h"
12716 $ac_includes_default
12717 int
12718 main ()
12719 {
12720 if ((signed char *) 0)
12721   return 0;
12722 if (sizeof (signed char))
12723   return 0;
12724   ;
12725   return 0;
12726 }
12727 _ACEOF
12728 rm -f conftest.$ac_objext
12729 if { (eval echo "$as_me:12729: \"$ac_compile\"") >&5
12730   (eval $ac_compile) 2>&5
12731   ac_status=$?
12732   echo "$as_me:12732: \$? = $ac_status" >&5
12733   (exit $ac_status); } &&
12734          { ac_try='test -s conftest.$ac_objext'
12735   { (eval echo "$as_me:12735: \"$ac_try\"") >&5
12736   (eval $ac_try) 2>&5
12737   ac_status=$?
12738   echo "$as_me:12738: \$? = $ac_status" >&5
12739   (exit $ac_status); }; }; then
12740   ac_cv_type_signed_char=yes
12741 else
12742   echo "$as_me: failed program was:" >&5
12743 cat conftest.$ac_ext >&5
12744 ac_cv_type_signed_char=no
12745 fi
12746 rm -f conftest.$ac_objext conftest.$ac_ext
12747 fi
12748 echo "$as_me:12748: result: $ac_cv_type_signed_char" >&5
12749 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
12750
12751 echo "$as_me:12751: checking size of signed char" >&5
12752 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
12753 if test "${ac_cv_sizeof_signed_char+set}" = set; then
12754   echo $ECHO_N "(cached) $ECHO_C" >&6
12755 else
12756   if test "$ac_cv_type_signed_char" = yes; then
12757   if test "$cross_compiling" = yes; then
12758   # Depending upon the size, compute the lo and hi bounds.
12759 cat >conftest.$ac_ext <<_ACEOF
12760 #line 12760 "configure"
12761 #include "confdefs.h"
12762 $ac_includes_default
12763 int
12764 main ()
12765 {
12766 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
12767   ;
12768   return 0;
12769 }
12770 _ACEOF
12771 rm -f conftest.$ac_objext
12772 if { (eval echo "$as_me:12772: \"$ac_compile\"") >&5
12773   (eval $ac_compile) 2>&5
12774   ac_status=$?
12775   echo "$as_me:12775: \$? = $ac_status" >&5
12776   (exit $ac_status); } &&
12777          { ac_try='test -s conftest.$ac_objext'
12778   { (eval echo "$as_me:12778: \"$ac_try\"") >&5
12779   (eval $ac_try) 2>&5
12780   ac_status=$?
12781   echo "$as_me:12781: \$? = $ac_status" >&5
12782   (exit $ac_status); }; }; then
12783   ac_lo=0 ac_mid=0
12784   while :; do
12785     cat >conftest.$ac_ext <<_ACEOF
12786 #line 12786 "configure"
12787 #include "confdefs.h"
12788 $ac_includes_default
12789 int
12790 main ()
12791 {
12792 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12793   ;
12794   return 0;
12795 }
12796 _ACEOF
12797 rm -f conftest.$ac_objext
12798 if { (eval echo "$as_me:12798: \"$ac_compile\"") >&5
12799   (eval $ac_compile) 2>&5
12800   ac_status=$?
12801   echo "$as_me:12801: \$? = $ac_status" >&5
12802   (exit $ac_status); } &&
12803          { ac_try='test -s conftest.$ac_objext'
12804   { (eval echo "$as_me:12804: \"$ac_try\"") >&5
12805   (eval $ac_try) 2>&5
12806   ac_status=$?
12807   echo "$as_me:12807: \$? = $ac_status" >&5
12808   (exit $ac_status); }; }; then
12809   ac_hi=$ac_mid; break
12810 else
12811   echo "$as_me: failed program was:" >&5
12812 cat conftest.$ac_ext >&5
12813 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
12814 fi
12815 rm -f conftest.$ac_objext conftest.$ac_ext
12816   done
12817 else
12818   echo "$as_me: failed program was:" >&5
12819 cat conftest.$ac_ext >&5
12820 ac_hi=-1 ac_mid=-1
12821   while :; do
12822     cat >conftest.$ac_ext <<_ACEOF
12823 #line 12823 "configure"
12824 #include "confdefs.h"
12825 $ac_includes_default
12826 int
12827 main ()
12828 {
12829 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
12830   ;
12831   return 0;
12832 }
12833 _ACEOF
12834 rm -f conftest.$ac_objext
12835 if { (eval echo "$as_me:12835: \"$ac_compile\"") >&5
12836   (eval $ac_compile) 2>&5
12837   ac_status=$?
12838   echo "$as_me:12838: \$? = $ac_status" >&5
12839   (exit $ac_status); } &&
12840          { ac_try='test -s conftest.$ac_objext'
12841   { (eval echo "$as_me:12841: \"$ac_try\"") >&5
12842   (eval $ac_try) 2>&5
12843   ac_status=$?
12844   echo "$as_me:12844: \$? = $ac_status" >&5
12845   (exit $ac_status); }; }; then
12846   ac_lo=$ac_mid; break
12847 else
12848   echo "$as_me: failed program was:" >&5
12849 cat conftest.$ac_ext >&5
12850 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12851 fi
12852 rm -f conftest.$ac_objext conftest.$ac_ext
12853   done
12854 fi
12855 rm -f conftest.$ac_objext conftest.$ac_ext
12856 # Binary search between lo and hi bounds.
12857 while test "x$ac_lo" != "x$ac_hi"; do
12858   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12859   cat >conftest.$ac_ext <<_ACEOF
12860 #line 12860 "configure"
12861 #include "confdefs.h"
12862 $ac_includes_default
12863 int
12864 main ()
12865 {
12866 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
12867   ;
12868   return 0;
12869 }
12870 _ACEOF
12871 rm -f conftest.$ac_objext
12872 if { (eval echo "$as_me:12872: \"$ac_compile\"") >&5
12873   (eval $ac_compile) 2>&5
12874   ac_status=$?
12875   echo "$as_me:12875: \$? = $ac_status" >&5
12876   (exit $ac_status); } &&
12877          { ac_try='test -s conftest.$ac_objext'
12878   { (eval echo "$as_me:12878: \"$ac_try\"") >&5
12879   (eval $ac_try) 2>&5
12880   ac_status=$?
12881   echo "$as_me:12881: \$? = $ac_status" >&5
12882   (exit $ac_status); }; }; then
12883   ac_hi=$ac_mid
12884 else
12885   echo "$as_me: failed program was:" >&5
12886 cat conftest.$ac_ext >&5
12887 ac_lo=`expr $ac_mid + 1`
12888 fi
12889 rm -f conftest.$ac_objext conftest.$ac_ext
12890 done
12891 ac_cv_sizeof_signed_char=$ac_lo
12892 else
12893   if test "$cross_compiling" = yes; then
12894   { { echo "$as_me:12894: error: cannot run test program while cross compiling" >&5
12895 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12896    { (exit 1); exit 1; }; }
12897 else
12898   cat >conftest.$ac_ext <<_ACEOF
12899 #line 12899 "configure"
12900 #include "confdefs.h"
12901 $ac_includes_default
12902 int
12903 main ()
12904 {
12905 FILE *f = fopen ("conftest.val", "w");
12906 if (!f)
12907   $ac_main_return (1);
12908 fprintf (f, "%d", (sizeof (signed char)));
12909 fclose (f);
12910   ;
12911   return 0;
12912 }
12913 _ACEOF
12914 rm -f conftest$ac_exeext
12915 if { (eval echo "$as_me:12915: \"$ac_link\"") >&5
12916   (eval $ac_link) 2>&5
12917   ac_status=$?
12918   echo "$as_me:12918: \$? = $ac_status" >&5
12919   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12920   { (eval echo "$as_me:12920: \"$ac_try\"") >&5
12921   (eval $ac_try) 2>&5
12922   ac_status=$?
12923   echo "$as_me:12923: \$? = $ac_status" >&5
12924   (exit $ac_status); }; }; then
12925   ac_cv_sizeof_signed_char=`cat conftest.val`
12926 else
12927   echo "$as_me: program exited with status $ac_status" >&5
12928 echo "$as_me: failed program was:" >&5
12929 cat conftest.$ac_ext >&5
12930 fi
12931 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12932 fi
12933 fi
12934 rm -f conftest.val
12935 else
12936   ac_cv_sizeof_signed_char=0
12937 fi
12938 fi
12939 echo "$as_me:12939: result: $ac_cv_sizeof_signed_char" >&5
12940 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
12941 cat >>confdefs.h <<EOF
12942 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
12943 EOF
12944
12945 echo "$as_me:12945: checking for ANSI C header files" >&5
12946 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12947 if test "${ac_cv_header_stdc+set}" = set; then
12948   echo $ECHO_N "(cached) $ECHO_C" >&6
12949 else
12950   cat >conftest.$ac_ext <<_ACEOF
12951 #line 12951 "configure"
12952 #include "confdefs.h"
12953 #include <stdlib.h>
12954 #include <stdarg.h>
12955 #include <string.h>
12956 #include <float.h>
12957
12958 _ACEOF
12959 if { (eval echo "$as_me:12959: \"$ac_cpp conftest.$ac_ext\"") >&5
12960   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12961   ac_status=$?
12962   egrep -v '^ *\+' conftest.er1 >conftest.err
12963   rm -f conftest.er1
12964   cat conftest.err >&5
12965   echo "$as_me:12965: \$? = $ac_status" >&5
12966   (exit $ac_status); } >/dev/null; then
12967   if test -s conftest.err; then
12968     ac_cpp_err=$ac_c_preproc_warn_flag
12969   else
12970     ac_cpp_err=
12971   fi
12972 else
12973   ac_cpp_err=yes
12974 fi
12975 if test -z "$ac_cpp_err"; then
12976   ac_cv_header_stdc=yes
12977 else
12978   echo "$as_me: failed program was:" >&5
12979   cat conftest.$ac_ext >&5
12980   ac_cv_header_stdc=no
12981 fi
12982 rm -f conftest.err conftest.$ac_ext
12983
12984 if test $ac_cv_header_stdc = yes; then
12985   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12986   cat >conftest.$ac_ext <<_ACEOF
12987 #line 12987 "configure"
12988 #include "confdefs.h"
12989 #include <string.h>
12990
12991 _ACEOF
12992 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12993   egrep "memchr" >/dev/null 2>&1; then
12994   :
12995 else
12996   ac_cv_header_stdc=no
12997 fi
12998 rm -rf conftest*
12999
13000 fi
13001
13002 if test $ac_cv_header_stdc = yes; then
13003   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13004   cat >conftest.$ac_ext <<_ACEOF
13005 #line 13005 "configure"
13006 #include "confdefs.h"
13007 #include <stdlib.h>
13008
13009 _ACEOF
13010 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13011   egrep "free" >/dev/null 2>&1; then
13012   :
13013 else
13014   ac_cv_header_stdc=no
13015 fi
13016 rm -rf conftest*
13017
13018 fi
13019
13020 if test $ac_cv_header_stdc = yes; then
13021   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13022   if test "$cross_compiling" = yes; then
13023   :
13024 else
13025   cat >conftest.$ac_ext <<_ACEOF
13026 #line 13026 "configure"
13027 #include "confdefs.h"
13028 #include <ctype.h>
13029 #if ((' ' & 0x0FF) == 0x020)
13030 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13031 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13032 #else
13033 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13034                      || ('j' <= (c) && (c) <= 'r') \
13035                      || ('s' <= (c) && (c) <= 'z'))
13036 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13037 #endif
13038
13039 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13040 int
13041 main ()
13042 {
13043   int i;
13044   for (i = 0; i < 256; i++)
13045     if (XOR (islower (i), ISLOWER (i))
13046         || toupper (i) != TOUPPER (i))
13047       $ac_main_return(2);
13048   $ac_main_return (0);
13049 }
13050 _ACEOF
13051 rm -f conftest$ac_exeext
13052 if { (eval echo "$as_me:13052: \"$ac_link\"") >&5
13053   (eval $ac_link) 2>&5
13054   ac_status=$?
13055   echo "$as_me:13055: \$? = $ac_status" >&5
13056   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13057   { (eval echo "$as_me:13057: \"$ac_try\"") >&5
13058   (eval $ac_try) 2>&5
13059   ac_status=$?
13060   echo "$as_me:13060: \$? = $ac_status" >&5
13061   (exit $ac_status); }; }; then
13062   :
13063 else
13064   echo "$as_me: program exited with status $ac_status" >&5
13065 echo "$as_me: failed program was:" >&5
13066 cat conftest.$ac_ext >&5
13067 ac_cv_header_stdc=no
13068 fi
13069 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13070 fi
13071 fi
13072 fi
13073 echo "$as_me:13073: result: $ac_cv_header_stdc" >&5
13074 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13075 if test $ac_cv_header_stdc = yes; then
13076
13077 cat >>confdefs.h <<\EOF
13078 #define STDC_HEADERS 1
13079 EOF
13080
13081 fi
13082
13083 ac_header_dirent=no
13084 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13085   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13086 echo "$as_me:13086: checking for $ac_hdr that defines DIR" >&5
13087 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13088 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13089   echo $ECHO_N "(cached) $ECHO_C" >&6
13090 else
13091   cat >conftest.$ac_ext <<_ACEOF
13092 #line 13092 "configure"
13093 #include "confdefs.h"
13094 #include <sys/types.h>
13095 #include <$ac_hdr>
13096
13097 int
13098 main ()
13099 {
13100 if ((DIR *) 0)
13101 return 0;
13102   ;
13103   return 0;
13104 }
13105 _ACEOF
13106 rm -f conftest.$ac_objext
13107 if { (eval echo "$as_me:13107: \"$ac_compile\"") >&5
13108   (eval $ac_compile) 2>&5
13109   ac_status=$?
13110   echo "$as_me:13110: \$? = $ac_status" >&5
13111   (exit $ac_status); } &&
13112          { ac_try='test -s conftest.$ac_objext'
13113   { (eval echo "$as_me:13113: \"$ac_try\"") >&5
13114   (eval $ac_try) 2>&5
13115   ac_status=$?
13116   echo "$as_me:13116: \$? = $ac_status" >&5
13117   (exit $ac_status); }; }; then
13118   eval "$as_ac_Header=yes"
13119 else
13120   echo "$as_me: failed program was:" >&5
13121 cat conftest.$ac_ext >&5
13122 eval "$as_ac_Header=no"
13123 fi
13124 rm -f conftest.$ac_objext conftest.$ac_ext
13125 fi
13126 echo "$as_me:13126: result: `eval echo '${'$as_ac_Header'}'`" >&5
13127 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13128 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13129   cat >>confdefs.h <<EOF
13130 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13131 EOF
13132
13133 ac_header_dirent=$ac_hdr; break
13134 fi
13135
13136 done
13137 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13138 if test $ac_header_dirent = dirent.h; then
13139   echo "$as_me:13139: checking for opendir in -ldir" >&5
13140 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13141 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13142   echo $ECHO_N "(cached) $ECHO_C" >&6
13143 else
13144   ac_check_lib_save_LIBS=$LIBS
13145 LIBS="-ldir  $LIBS"
13146 cat >conftest.$ac_ext <<_ACEOF
13147 #line 13147 "configure"
13148 #include "confdefs.h"
13149
13150 /* Override any gcc2 internal prototype to avoid an error.  */
13151 #ifdef __cplusplus
13152 extern "C"
13153 #endif
13154 /* We use char because int might match the return type of a gcc2
13155    builtin and then its argument prototype would still apply.  */
13156 char opendir ();
13157 int
13158 main ()
13159 {
13160 opendir ();
13161   ;
13162   return 0;
13163 }
13164 _ACEOF
13165 rm -f conftest.$ac_objext conftest$ac_exeext
13166 if { (eval echo "$as_me:13166: \"$ac_link\"") >&5
13167   (eval $ac_link) 2>&5
13168   ac_status=$?
13169   echo "$as_me:13169: \$? = $ac_status" >&5
13170   (exit $ac_status); } &&
13171          { ac_try='test -s conftest$ac_exeext'
13172   { (eval echo "$as_me:13172: \"$ac_try\"") >&5
13173   (eval $ac_try) 2>&5
13174   ac_status=$?
13175   echo "$as_me:13175: \$? = $ac_status" >&5
13176   (exit $ac_status); }; }; then
13177   ac_cv_lib_dir_opendir=yes
13178 else
13179   echo "$as_me: failed program was:" >&5
13180 cat conftest.$ac_ext >&5
13181 ac_cv_lib_dir_opendir=no
13182 fi
13183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13184 LIBS=$ac_check_lib_save_LIBS
13185 fi
13186 echo "$as_me:13186: result: $ac_cv_lib_dir_opendir" >&5
13187 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13188 if test $ac_cv_lib_dir_opendir = yes; then
13189   LIBS="$LIBS -ldir"
13190 fi
13191
13192 else
13193   echo "$as_me:13193: checking for opendir in -lx" >&5
13194 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13195 if test "${ac_cv_lib_x_opendir+set}" = set; then
13196   echo $ECHO_N "(cached) $ECHO_C" >&6
13197 else
13198   ac_check_lib_save_LIBS=$LIBS
13199 LIBS="-lx  $LIBS"
13200 cat >conftest.$ac_ext <<_ACEOF
13201 #line 13201 "configure"
13202 #include "confdefs.h"
13203
13204 /* Override any gcc2 internal prototype to avoid an error.  */
13205 #ifdef __cplusplus
13206 extern "C"
13207 #endif
13208 /* We use char because int might match the return type of a gcc2
13209    builtin and then its argument prototype would still apply.  */
13210 char opendir ();
13211 int
13212 main ()
13213 {
13214 opendir ();
13215   ;
13216   return 0;
13217 }
13218 _ACEOF
13219 rm -f conftest.$ac_objext conftest$ac_exeext
13220 if { (eval echo "$as_me:13220: \"$ac_link\"") >&5
13221   (eval $ac_link) 2>&5
13222   ac_status=$?
13223   echo "$as_me:13223: \$? = $ac_status" >&5
13224   (exit $ac_status); } &&
13225          { ac_try='test -s conftest$ac_exeext'
13226   { (eval echo "$as_me:13226: \"$ac_try\"") >&5
13227   (eval $ac_try) 2>&5
13228   ac_status=$?
13229   echo "$as_me:13229: \$? = $ac_status" >&5
13230   (exit $ac_status); }; }; then
13231   ac_cv_lib_x_opendir=yes
13232 else
13233   echo "$as_me: failed program was:" >&5
13234 cat conftest.$ac_ext >&5
13235 ac_cv_lib_x_opendir=no
13236 fi
13237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13238 LIBS=$ac_check_lib_save_LIBS
13239 fi
13240 echo "$as_me:13240: result: $ac_cv_lib_x_opendir" >&5
13241 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13242 if test $ac_cv_lib_x_opendir = yes; then
13243   LIBS="$LIBS -lx"
13244 fi
13245
13246 fi
13247
13248 echo "$as_me:13248: checking whether time.h and sys/time.h may both be included" >&5
13249 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13250 if test "${ac_cv_header_time+set}" = set; then
13251   echo $ECHO_N "(cached) $ECHO_C" >&6
13252 else
13253   cat >conftest.$ac_ext <<_ACEOF
13254 #line 13254 "configure"
13255 #include "confdefs.h"
13256 #include <sys/types.h>
13257 #include <sys/time.h>
13258 #include <time.h>
13259
13260 int
13261 main ()
13262 {
13263 if ((struct tm *) 0)
13264 return 0;
13265   ;
13266   return 0;
13267 }
13268 _ACEOF
13269 rm -f conftest.$ac_objext
13270 if { (eval echo "$as_me:13270: \"$ac_compile\"") >&5
13271   (eval $ac_compile) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit $ac_status); } &&
13275          { ac_try='test -s conftest.$ac_objext'
13276   { (eval echo "$as_me:13276: \"$ac_try\"") >&5
13277   (eval $ac_try) 2>&5
13278   ac_status=$?
13279   echo "$as_me:13279: \$? = $ac_status" >&5
13280   (exit $ac_status); }; }; then
13281   ac_cv_header_time=yes
13282 else
13283   echo "$as_me: failed program was:" >&5
13284 cat conftest.$ac_ext >&5
13285 ac_cv_header_time=no
13286 fi
13287 rm -f conftest.$ac_objext conftest.$ac_ext
13288 fi
13289 echo "$as_me:13289: result: $ac_cv_header_time" >&5
13290 echo "${ECHO_T}$ac_cv_header_time" >&6
13291 if test $ac_cv_header_time = yes; then
13292
13293 cat >>confdefs.h <<\EOF
13294 #define TIME_WITH_SYS_TIME 1
13295 EOF
13296
13297 fi
13298
13299 ###     checks for compiler characteristics
13300 ac_ext=c
13301 ac_cpp='$CPP $CPPFLAGS'
13302 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13303 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13304 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13305 ac_main_return=return
13306
13307 echo "$as_me:13307: checking for an ANSI C-conforming const" >&5
13308 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13309 if test "${ac_cv_c_const+set}" = set; then
13310   echo $ECHO_N "(cached) $ECHO_C" >&6
13311 else
13312   cat >conftest.$ac_ext <<_ACEOF
13313 #line 13313 "configure"
13314 #include "confdefs.h"
13315
13316 int
13317 main ()
13318 {
13319 /* FIXME: Include the comments suggested by Paul. */
13320 #ifndef __cplusplus
13321   /* Ultrix mips cc rejects this.  */
13322   typedef int charset[2];
13323   const charset x;
13324   /* SunOS 4.1.1 cc rejects this.  */
13325   char const *const *ccp;
13326   char **p;
13327   /* NEC SVR4.0.2 mips cc rejects this.  */
13328   struct point {int x, y;};
13329   static struct point const zero = {0,0};
13330   /* AIX XL C 1.02.0.0 rejects this.
13331      It does not let you subtract one const X* pointer from another in
13332      an arm of an if-expression whose if-part is not a constant
13333      expression */
13334   const char *g = "string";
13335   ccp = &g + (g ? g-g : 0);
13336   /* HPUX 7.0 cc rejects these. */
13337   ++ccp;
13338   p = (char**) ccp;
13339   ccp = (char const *const *) p;
13340   { /* SCO 3.2v4 cc rejects this.  */
13341     char *t;
13342     char const *s = 0 ? (char *) 0 : (char const *) 0;
13343
13344     *t++ = 0;
13345   }
13346   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13347     int x[] = {25, 17};
13348     const int *foo = &x[0];
13349     ++foo;
13350   }
13351   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13352     typedef const int *iptr;
13353     iptr p = 0;
13354     ++p;
13355   }
13356   { /* AIX XL C 1.02.0.0 rejects this saying
13357        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13358     struct s { int j; const int *ap[3]; };
13359     struct s *b; b->j = 5;
13360   }
13361   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13362     const int foo = 10;
13363   }
13364 #endif
13365
13366   ;
13367   return 0;
13368 }
13369 _ACEOF
13370 rm -f conftest.$ac_objext
13371 if { (eval echo "$as_me:13371: \"$ac_compile\"") >&5
13372   (eval $ac_compile) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit $ac_status); } &&
13376          { ac_try='test -s conftest.$ac_objext'
13377   { (eval echo "$as_me:13377: \"$ac_try\"") >&5
13378   (eval $ac_try) 2>&5
13379   ac_status=$?
13380   echo "$as_me:13380: \$? = $ac_status" >&5
13381   (exit $ac_status); }; }; then
13382   ac_cv_c_const=yes
13383 else
13384   echo "$as_me: failed program was:" >&5
13385 cat conftest.$ac_ext >&5
13386 ac_cv_c_const=no
13387 fi
13388 rm -f conftest.$ac_objext conftest.$ac_ext
13389 fi
13390 echo "$as_me:13390: result: $ac_cv_c_const" >&5
13391 echo "${ECHO_T}$ac_cv_c_const" >&6
13392 if test $ac_cv_c_const = no; then
13393
13394 cat >>confdefs.h <<\EOF
13395 #define const
13396 EOF
13397
13398 fi
13399
13400 ###     Checks for external-data
13401
13402 echo "$as_me:13402: checking if data-only library module links" >&5
13403 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13404 if test "${cf_cv_link_dataonly+set}" = set; then
13405   echo $ECHO_N "(cached) $ECHO_C" >&6
13406 else
13407
13408         rm -f conftest.a
13409         cat >conftest.$ac_ext <<EOF
13410 #line 13410 "configure"
13411 int     testdata[3] = { 123, 456, 789 };
13412 EOF
13413         if { (eval echo "$as_me:13413: \"$ac_compile\"") >&5
13414   (eval $ac_compile) 2>&5
13415   ac_status=$?
13416   echo "$as_me:13416: \$? = $ac_status" >&5
13417   (exit $ac_status); } ; then
13418                 mv conftest.o data.o && \
13419                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13420         fi
13421         rm -f conftest.$ac_ext data.o
13422         cat >conftest.$ac_ext <<EOF
13423 #line 13423 "configure"
13424 int     testfunc()
13425 {
13426 #if defined(NeXT)
13427         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13428 #else
13429         extern int testdata[3];
13430         return testdata[0] == 123
13431            &&  testdata[1] == 456
13432            &&  testdata[2] == 789;
13433 #endif
13434 }
13435 EOF
13436         if { (eval echo "$as_me:13436: \"$ac_compile\"") >&5
13437   (eval $ac_compile) 2>&5
13438   ac_status=$?
13439   echo "$as_me:13439: \$? = $ac_status" >&5
13440   (exit $ac_status); }; then
13441                 mv conftest.o func.o && \
13442                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13443         fi
13444         rm -f conftest.$ac_ext func.o
13445         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13446         cf_saveLIBS="$LIBS"
13447         LIBS="conftest.a $LIBS"
13448         if test "$cross_compiling" = yes; then
13449   cf_cv_link_dataonly=unknown
13450 else
13451   cat >conftest.$ac_ext <<_ACEOF
13452 #line 13452 "configure"
13453 #include "confdefs.h"
13454
13455         int main()
13456         {
13457                 extern int testfunc();
13458                 ${cf_cv_main_return:-return} (!testfunc());
13459         }
13460
13461 _ACEOF
13462 rm -f conftest$ac_exeext
13463 if { (eval echo "$as_me:13463: \"$ac_link\"") >&5
13464   (eval $ac_link) 2>&5
13465   ac_status=$?
13466   echo "$as_me:13466: \$? = $ac_status" >&5
13467   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13468   { (eval echo "$as_me:13468: \"$ac_try\"") >&5
13469   (eval $ac_try) 2>&5
13470   ac_status=$?
13471   echo "$as_me:13471: \$? = $ac_status" >&5
13472   (exit $ac_status); }; }; then
13473   cf_cv_link_dataonly=yes
13474 else
13475   echo "$as_me: program exited with status $ac_status" >&5
13476 echo "$as_me: failed program was:" >&5
13477 cat conftest.$ac_ext >&5
13478 cf_cv_link_dataonly=no
13479 fi
13480 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13481 fi
13482         LIBS="$cf_saveLIBS"
13483
13484 fi
13485
13486 echo "$as_me:13486: result: $cf_cv_link_dataonly" >&5
13487 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13488
13489 if test "$cf_cv_link_dataonly" = no ; then
13490
13491 cat >>confdefs.h <<\EOF
13492 #define BROKEN_LINKER 1
13493 EOF
13494
13495         BROKEN_LINKER=1
13496 fi
13497
13498 ###     Checks for library functions.
13499
13500 echo "$as_me:13500: checking for working mkstemp" >&5
13501 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13502 if test "${cf_cv_func_mkstemp+set}" = set; then
13503   echo $ECHO_N "(cached) $ECHO_C" >&6
13504 else
13505
13506 rm -rf conftest*
13507 if test "$cross_compiling" = yes; then
13508   cf_cv_func_mkstemp=maybe
13509 else
13510   cat >conftest.$ac_ext <<_ACEOF
13511 #line 13511 "configure"
13512 #include "confdefs.h"
13513
13514 #include <sys/types.h>
13515 #include <stdlib.h>
13516 #include <stdio.h>
13517 #include <string.h>
13518 #include <sys/stat.h>
13519 int main()
13520 {
13521         char *tmpl = "conftestXXXXXX";
13522         char name[2][80];
13523         int n;
13524         int result = 0;
13525         int fd;
13526         struct stat sb;
13527
13528         umask(077);
13529         for (n = 0; n < 2; ++n) {
13530                 strcpy(name[n], tmpl);
13531                 if ((fd = mkstemp(name[n])) >= 0) {
13532                         if (!strcmp(name[n], tmpl)
13533                          || stat(name[n], &sb) != 0
13534                          || (sb.st_mode & S_IFMT) != S_IFREG
13535                          || (sb.st_mode & 077) != 0) {
13536                                 result = 1;
13537                         }
13538                         close(fd);
13539                 }
13540         }
13541         if (result == 0
13542          && !strcmp(name[0], name[1]))
13543                 result = 1;
13544         ${cf_cv_main_return:-return}(result);
13545 }
13546
13547 _ACEOF
13548 rm -f conftest$ac_exeext
13549 if { (eval echo "$as_me:13549: \"$ac_link\"") >&5
13550   (eval $ac_link) 2>&5
13551   ac_status=$?
13552   echo "$as_me:13552: \$? = $ac_status" >&5
13553   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13554   { (eval echo "$as_me:13554: \"$ac_try\"") >&5
13555   (eval $ac_try) 2>&5
13556   ac_status=$?
13557   echo "$as_me:13557: \$? = $ac_status" >&5
13558   (exit $ac_status); }; }; then
13559   cf_cv_func_mkstemp=yes
13560
13561 else
13562   echo "$as_me: program exited with status $ac_status" >&5
13563 echo "$as_me: failed program was:" >&5
13564 cat conftest.$ac_ext >&5
13565 cf_cv_func_mkstemp=no
13566
13567 fi
13568 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13569 fi
13570
13571 fi
13572 echo "$as_me:13572: result: $cf_cv_func_mkstemp" >&5
13573 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13574 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13575         echo "$as_me:13575: checking for mkstemp" >&5
13576 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13577 if test "${ac_cv_func_mkstemp+set}" = set; then
13578   echo $ECHO_N "(cached) $ECHO_C" >&6
13579 else
13580   cat >conftest.$ac_ext <<_ACEOF
13581 #line 13581 "configure"
13582 #include "confdefs.h"
13583 /* System header to define __stub macros and hopefully few prototypes,
13584     which can conflict with char mkstemp (); below.  */
13585 #include <assert.h>
13586 /* Override any gcc2 internal prototype to avoid an error.  */
13587 #ifdef __cplusplus
13588 extern "C"
13589 #endif
13590 /* We use char because int might match the return type of a gcc2
13591    builtin and then its argument prototype would still apply.  */
13592 char mkstemp ();
13593 char (*f) ();
13594
13595 int
13596 main ()
13597 {
13598 /* The GNU C library defines this for functions which it implements
13599     to always fail with ENOSYS.  Some functions are actually named
13600     something starting with __ and the normal name is an alias.  */
13601 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13602 choke me
13603 #else
13604 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13605 #endif
13606
13607   ;
13608   return 0;
13609 }
13610 _ACEOF
13611 rm -f conftest.$ac_objext conftest$ac_exeext
13612 if { (eval echo "$as_me:13612: \"$ac_link\"") >&5
13613   (eval $ac_link) 2>&5
13614   ac_status=$?
13615   echo "$as_me:13615: \$? = $ac_status" >&5
13616   (exit $ac_status); } &&
13617          { ac_try='test -s conftest$ac_exeext'
13618   { (eval echo "$as_me:13618: \"$ac_try\"") >&5
13619   (eval $ac_try) 2>&5
13620   ac_status=$?
13621   echo "$as_me:13621: \$? = $ac_status" >&5
13622   (exit $ac_status); }; }; then
13623   ac_cv_func_mkstemp=yes
13624 else
13625   echo "$as_me: failed program was:" >&5
13626 cat conftest.$ac_ext >&5
13627 ac_cv_func_mkstemp=no
13628 fi
13629 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13630 fi
13631 echo "$as_me:13631: result: $ac_cv_func_mkstemp" >&5
13632 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13633
13634 fi
13635 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13636
13637 cat >>confdefs.h <<\EOF
13638 #define HAVE_MKSTEMP 1
13639 EOF
13640
13641 fi
13642
13643 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13644         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13645         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13646 fi
13647
13648 cf_with_ada=yes
13649 if test "$cf_with_ada" != "no" ; then
13650
13651 cf_ada_make=gnatmake
13652 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13653 set dummy $cf_ada_make; ac_word=$2
13654 echo "$as_me:13654: checking for $ac_word" >&5
13655 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13656 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13657   echo $ECHO_N "(cached) $ECHO_C" >&6
13658 else
13659   if test -n "$gnat_exists"; then
13660   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13661 else
13662   ac_save_IFS=$IFS; IFS=$ac_path_separator
13663 ac_dummy="$PATH"
13664 for ac_dir in $ac_dummy; do
13665   IFS=$ac_save_IFS
13666   test -z "$ac_dir" && ac_dir=.
13667   $as_executable_p "$ac_dir/$ac_word" || continue
13668 ac_cv_prog_gnat_exists="yes"
13669 echo "$as_me:13669: found $ac_dir/$ac_word" >&5
13670 break
13671 done
13672
13673   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13674 fi
13675 fi
13676 gnat_exists=$ac_cv_prog_gnat_exists
13677 if test -n "$gnat_exists"; then
13678   echo "$as_me:13678: result: $gnat_exists" >&5
13679 echo "${ECHO_T}$gnat_exists" >&6
13680 else
13681   echo "$as_me:13681: result: no" >&5
13682 echo "${ECHO_T}no" >&6
13683 fi
13684
13685 if test "$ac_cv_prog_gnat_exists" = no; then
13686         cf_ada_make=
13687         cf_cv_prog_gnat_correct=no
13688 else
13689
13690 echo "$as_me:13690: checking for gnat version" >&5
13691 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13692 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13693         grep '[0-9].[0-9][0-9]*' |\
13694         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13695 echo "$as_me:13695: result: $cf_gnat_version" >&5
13696 echo "${ECHO_T}$cf_gnat_version" >&6
13697
13698 case $cf_gnat_version in
13699 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13700         cf_cv_prog_gnat_correct=yes
13701         ;;
13702 (*)
13703         { echo "$as_me:13703: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13704 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13705         cf_cv_prog_gnat_correct=no
13706         ;;
13707 esac
13708
13709         # Extract the first word of "m4", so it can be a program name with args.
13710 set dummy m4; ac_word=$2
13711 echo "$as_me:13711: checking for $ac_word" >&5
13712 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13713 if test "${ac_cv_prog_M4_exists+set}" = set; then
13714   echo $ECHO_N "(cached) $ECHO_C" >&6
13715 else
13716   if test -n "$M4_exists"; then
13717   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13718 else
13719   ac_save_IFS=$IFS; IFS=$ac_path_separator
13720 ac_dummy="$PATH"
13721 for ac_dir in $ac_dummy; do
13722   IFS=$ac_save_IFS
13723   test -z "$ac_dir" && ac_dir=.
13724   $as_executable_p "$ac_dir/$ac_word" || continue
13725 ac_cv_prog_M4_exists="yes"
13726 echo "$as_me:13726: found $ac_dir/$ac_word" >&5
13727 break
13728 done
13729
13730   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
13731 fi
13732 fi
13733 M4_exists=$ac_cv_prog_M4_exists
13734 if test -n "$M4_exists"; then
13735   echo "$as_me:13735: result: $M4_exists" >&5
13736 echo "${ECHO_T}$M4_exists" >&6
13737 else
13738   echo "$as_me:13738: result: no" >&5
13739 echo "${ECHO_T}no" >&6
13740 fi
13741
13742         if test "$ac_cv_prog_M4_exists" = no; then
13743                 cf_cv_prog_gnat_correct=no
13744                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
13745         fi
13746         if test "$cf_cv_prog_gnat_correct" = yes; then
13747                 echo "$as_me:13747: checking if GNAT works" >&5
13748 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
13749
13750 rm -rf conftest* *~conftest*
13751 cat >>conftest.ads <<CF_EOF
13752 procedure conftest;
13753 CF_EOF
13754 cat >>conftest.adb <<CF_EOF
13755 with Text_IO;
13756 with GNAT.OS_Lib;
13757 procedure conftest is
13758 begin
13759    Text_IO.Put ("Hello World");
13760    Text_IO.New_Line;
13761    GNAT.OS_Lib.OS_Exit (0);
13762 end conftest;
13763 CF_EOF
13764 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13765    if ( ./conftest 1>&5 2>&1 ) ; then
13766       cf_cv_prog_gnat_correct=yes
13767    else
13768       cf_cv_prog_gnat_correct=no
13769    fi
13770 else
13771    cf_cv_prog_gnat_correct=no
13772 fi
13773 rm -rf conftest* *~conftest*
13774
13775                 echo "$as_me:13775: result: $cf_cv_prog_gnat_correct" >&5
13776 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
13777         fi
13778 fi
13779
13780         if test "$cf_cv_prog_gnat_correct" = yes; then
13781
13782         echo "$as_me:13782: checking optimization options for ADAFLAGS" >&5
13783 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
13784         case "$CFLAGS" in
13785         (*-g*)
13786
13787         ADAFLAGS="$ADAFLAGS -g"
13788
13789                 ;;
13790         esac
13791         case "$CFLAGS" in
13792         (*-O*)
13793                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
13794
13795         ADAFLAGS="$ADAFLAGS $cf_O_flag"
13796
13797                 ;;
13798         esac
13799         echo "$as_me:13799: result: $ADAFLAGS" >&5
13800 echo "${ECHO_T}$ADAFLAGS" >&6
13801
13802 echo "$as_me:13802: checking if GNATPREP supports -T option" >&5
13803 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
13804 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
13805   echo $ECHO_N "(cached) $ECHO_C" >&6
13806 else
13807
13808 cf_cv_gnatprep_opt_t=no
13809 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
13810
13811 fi
13812 echo "$as_me:13812: result: $cf_cv_gnatprep_opt_t" >&5
13813 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
13814 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
13815
13816 echo "$as_me:13816: checking if GNAT supports generics" >&5
13817 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
13818 case $cf_gnat_version in
13819 (3.[1-9]*|[4-9].*)
13820         cf_gnat_generics=yes
13821         ;;
13822 (*)
13823         cf_gnat_generics=no
13824         ;;
13825 esac
13826 echo "$as_me:13826: result: $cf_gnat_generics" >&5
13827 echo "${ECHO_T}$cf_gnat_generics" >&6
13828
13829 if test "$cf_gnat_generics" = yes
13830 then
13831         cf_compile_generics=generics
13832         cf_generic_objects="\${GENOBJS}"
13833 else
13834         cf_compile_generics=
13835         cf_generic_objects=
13836 fi
13837
13838 echo "$as_me:13838: checking if GNAT supports SIGINT" >&5
13839 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
13840 if test "${cf_cv_gnat_sigint+set}" = set; then
13841   echo $ECHO_N "(cached) $ECHO_C" >&6
13842 else
13843
13844 rm -rf conftest* *~conftest*
13845 cat >>conftest.ads <<CF_EOF
13846 with Ada.Interrupts.Names;
13847
13848 package ConfTest is
13849
13850    pragma Warnings (Off);  --  the next pragma exists since 3.11p
13851    pragma Unreserve_All_Interrupts;
13852    pragma Warnings (On);
13853
13854    protected Process is
13855       procedure Stop;
13856       function Continue return Boolean;
13857       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
13858    private
13859       Done : Boolean := False;
13860    end Process;
13861
13862 end ConfTest;
13863 CF_EOF
13864 cat >>conftest.adb <<CF_EOF
13865 package body ConfTest is
13866    protected body Process is
13867       procedure Stop is
13868       begin
13869          Done := True;
13870       end Stop;
13871       function Continue return Boolean is
13872       begin
13873          return not Done;
13874       end Continue;
13875    end Process;
13876 end ConfTest;
13877 CF_EOF
13878 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
13879       cf_cv_gnat_sigint=yes
13880 else
13881    cf_cv_gnat_sigint=no
13882 fi
13883 rm -rf conftest* *~conftest*
13884
13885 fi
13886 echo "$as_me:13886: result: $cf_cv_gnat_sigint" >&5
13887 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
13888
13889 if test $cf_cv_gnat_sigint = yes ; then
13890         USE_GNAT_SIGINT=""
13891 else
13892         USE_GNAT_SIGINT="#"
13893 fi
13894
13895 cf_gnat_libraries=no
13896 cf_gnat_projects=no
13897
13898 if test "$enable_gnat_projects" != no ; then
13899 echo "$as_me:13899: checking if GNAT supports project files" >&5
13900 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
13901 case $cf_gnat_version in
13902 (3.[0-9]*)
13903         ;;
13904 (*)
13905         case $cf_cv_system_name in
13906         (cygwin*|msys*)
13907                 ;;
13908         (*)
13909                 mkdir conftest.src conftest.bin conftest.lib
13910                 cd conftest.src
13911                 rm -rf conftest* *~conftest*
13912                 cat >>library.gpr <<CF_EOF
13913 project Library is
13914   Kind := External ("LIB_KIND");
13915   for Library_Name use "ConfTest";
13916   for Object_Dir use ".";
13917   for Library_ALI_Dir use External("LIBRARY_DIR");
13918   for Library_Version use External ("SONAME");
13919   for Library_Kind use Kind;
13920   for Library_Dir use External("BUILD_DIR");
13921   Source_Dir := External ("SOURCE_DIR");
13922   for Source_Dirs use (Source_Dir);
13923 end Library;
13924 CF_EOF
13925                 cat >>confpackage.ads <<CF_EOF
13926 package ConfPackage is
13927    procedure conftest;
13928 end ConfPackage;
13929 CF_EOF
13930                 cat >>confpackage.adb <<CF_EOF
13931 with Text_IO;
13932 package body ConfPackage is
13933    procedure conftest is
13934    begin
13935       Text_IO.Put ("Hello World");
13936       Text_IO.New_Line;
13937    end conftest;
13938 end ConfPackage;
13939 CF_EOF
13940                 if ( $cf_ada_make $ADAFLAGS \
13941                                 -Plibrary.gpr \
13942                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
13943                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
13944                                 -XSOURCE_DIR=`pwd` \
13945                                 -XSONAME=libConfTest.so.1 \
13946                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
13947                         cf_gnat_projects=yes
13948                 fi
13949                 cd ..
13950                 if test -f conftest.lib/confpackage.ali
13951                 then
13952                         cf_gnat_libraries=yes
13953                 fi
13954                 rm -rf conftest* *~conftest*
13955                 ;;
13956         esac
13957         ;;
13958 esac
13959 echo "$as_me:13959: result: $cf_gnat_projects" >&5
13960 echo "${ECHO_T}$cf_gnat_projects" >&6
13961 fi # enable_gnat_projects
13962
13963 if test $cf_gnat_projects = yes
13964 then
13965         echo "$as_me:13965: checking if GNAT supports libraries" >&5
13966 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
13967         echo "$as_me:13967: result: $cf_gnat_libraries" >&5
13968 echo "${ECHO_T}$cf_gnat_libraries" >&6
13969 fi
13970
13971 if test "$cf_gnat_projects" = yes
13972 then
13973         USE_OLD_MAKERULES="#"
13974         USE_GNAT_PROJECTS=""
13975 else
13976         USE_OLD_MAKERULES=""
13977         USE_GNAT_PROJECTS="#"
13978 fi
13979
13980 if test "$cf_gnat_libraries" = yes
13981 then
13982         USE_GNAT_LIBRARIES=""
13983 else
13984         USE_GNAT_LIBRARIES="#"
13985 fi
13986
13987 echo "$as_me:13987: checking for ada-compiler" >&5
13988 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
13989
13990 # Check whether --with-ada-compiler or --without-ada-compiler was given.
13991 if test "${with_ada_compiler+set}" = set; then
13992   withval="$with_ada_compiler"
13993   cf_ada_compiler=$withval
13994 else
13995   cf_ada_compiler=gnatmake
13996 fi;
13997
13998 echo "$as_me:13998: result: $cf_ada_compiler" >&5
13999 echo "${ECHO_T}$cf_ada_compiler" >&6
14000
14001                 cf_ada_package=terminal_interface
14002
14003 echo "$as_me:14003: checking for ada-include" >&5
14004 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14005
14006 # Check whether --with-ada-include or --without-ada-include was given.
14007 if test "${with_ada_include+set}" = set; then
14008   withval="$with_ada_include"
14009
14010 else
14011   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14012 fi; if test -n "$prefix/share/ada/adainclude" ; then
14013
14014 if test "x$prefix" != xNONE; then
14015         cf_path_syntax="$prefix"
14016 else
14017         cf_path_syntax="$ac_default_prefix"
14018 fi
14019
14020 case ".$withval" in
14021 (.\$\(*\)*|.\'*\'*)
14022         ;;
14023 (..|./*|.\\*)
14024         ;;
14025 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14026         ;;
14027 (.\${*prefix}*|.\${*dir}*)
14028         eval withval="$withval"
14029         case ".$withval" in
14030         (.NONE/*)
14031                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14032                 ;;
14033         esac
14034         ;;
14035 (.no|.NONE/*)
14036         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14037         ;;
14038 (*)
14039         { { echo "$as_me:14039: error: expected a pathname, not \"$withval\"" >&5
14040 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14041    { (exit 1); exit 1; }; }
14042         ;;
14043 esac
14044
14045 fi
14046 eval ADA_INCLUDE="$withval"
14047
14048 echo "$as_me:14048: result: $ADA_INCLUDE" >&5
14049 echo "${ECHO_T}$ADA_INCLUDE" >&6
14050
14051 echo "$as_me:14051: checking for ada-objects" >&5
14052 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14053
14054 # Check whether --with-ada-objects or --without-ada-objects was given.
14055 if test "${with_ada_objects+set}" = set; then
14056   withval="$with_ada_objects"
14057
14058 else
14059   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14060 fi; if test -n "$prefix/lib/ada/adalib" ; then
14061
14062 if test "x$prefix" != xNONE; then
14063         cf_path_syntax="$prefix"
14064 else
14065         cf_path_syntax="$ac_default_prefix"
14066 fi
14067
14068 case ".$withval" in
14069 (.\$\(*\)*|.\'*\'*)
14070         ;;
14071 (..|./*|.\\*)
14072         ;;
14073 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14074         ;;
14075 (.\${*prefix}*|.\${*dir}*)
14076         eval withval="$withval"
14077         case ".$withval" in
14078         (.NONE/*)
14079                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14080                 ;;
14081         esac
14082         ;;
14083 (.no|.NONE/*)
14084         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14085         ;;
14086 (*)
14087         { { echo "$as_me:14087: error: expected a pathname, not \"$withval\"" >&5
14088 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14089    { (exit 1); exit 1; }; }
14090         ;;
14091 esac
14092
14093 fi
14094 eval ADA_OBJECTS="$withval"
14095
14096 echo "$as_me:14096: result: $ADA_OBJECTS" >&5
14097 echo "${ECHO_T}$ADA_OBJECTS" >&6
14098
14099 echo "$as_me:14099: checking if an Ada95 shared-library should be built" >&5
14100 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14101
14102 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14103 if test "${with_ada_sharedlib+set}" = set; then
14104   withval="$with_ada_sharedlib"
14105   with_ada_sharedlib=$withval
14106 else
14107   with_ada_sharedlib=no
14108 fi;
14109 echo "$as_me:14109: result: $with_ada_sharedlib" >&5
14110 echo "${ECHO_T}$with_ada_sharedlib" >&6
14111
14112 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14113 MAKE_ADA_SHAREDLIB="#"
14114
14115 if test "x$with_ada_sharedlib" != xno
14116 then
14117         MAKE_ADA_SHAREDLIB=
14118         if test "x$with_ada_sharedlib" != xyes
14119         then
14120                 ADA_SHAREDLIB="$with_ada_sharedlib"
14121         fi
14122 fi
14123
14124         else
14125                 { { echo "$as_me:14125: error: No usable Ada compiler found" >&5
14126 echo "$as_me: error: No usable Ada compiler found" >&2;}
14127    { (exit 1); exit 1; }; }
14128         fi
14129 else
14130         { { echo "$as_me:14130: error: The Ada compiler is needed for this package" >&5
14131 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14132    { (exit 1); exit 1; }; }
14133 fi
14134
14135 ################################################################################
14136
14137 # not needed
14138 TINFO_LDFLAGS2=
14139
14140 TINFO_LIBS=
14141
14142 ### Construct the list of include-directories to be generated
14143
14144 if test "$srcdir" != "."; then
14145         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14146 fi
14147 CPPFLAGS="-I../include $CPPFLAGS"
14148 if test "$srcdir" != "."; then
14149         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14150 fi
14151 CPPFLAGS="-I. $CPPFLAGS"
14152
14153 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14154 if test "$srcdir" != "."; then
14155         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14156 fi
14157 if test "$GCC" != yes; then
14158         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14159 elif test "$includedir" != "/usr/include"; then
14160         if test "$includedir" = '${prefix}/include' ; then
14161                 if test x$prefix != x/usr ; then
14162                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14163                 fi
14164         else
14165                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14166         fi
14167 fi
14168
14169 ### Build up pieces for makefile rules
14170 echo "$as_me:14170: checking default library suffix" >&5
14171 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14172
14173         case $DFT_LWR_MODEL in
14174         (libtool) DFT_ARG_SUFFIX=''   ;;
14175         (normal)  DFT_ARG_SUFFIX=''   ;;
14176         (debug)   DFT_ARG_SUFFIX='_g' ;;
14177         (profile) DFT_ARG_SUFFIX='_p' ;;
14178         (shared)  DFT_ARG_SUFFIX=''   ;;
14179         esac
14180         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14181 echo "$as_me:14181: result: $DFT_ARG_SUFFIX" >&5
14182 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14183
14184 echo "$as_me:14184: checking default library-dependency suffix" >&5
14185 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14186
14187         case X$DFT_LWR_MODEL in
14188         (Xlibtool)
14189                 DFT_LIB_SUFFIX='.la'
14190                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14191                 ;;
14192         (Xdebug)
14193                 DFT_LIB_SUFFIX='_g.a'
14194                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14195                 ;;
14196         (Xprofile)
14197                 DFT_LIB_SUFFIX='_p.a'
14198                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14199                 ;;
14200         (Xshared)
14201                 case $cf_cv_system_name in
14202                 (aix[5-7]*)
14203                         DFT_LIB_SUFFIX='.so'
14204                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14205                         ;;
14206                 (cygwin*|msys*|mingw*)
14207                         DFT_LIB_SUFFIX='.dll'
14208                         DFT_DEP_SUFFIX='.dll.a'
14209                         ;;
14210                 (darwin*)
14211                         DFT_LIB_SUFFIX='.dylib'
14212                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14213                         ;;
14214                 (hpux*)
14215                         case $target in
14216                         (ia64*)
14217                                 DFT_LIB_SUFFIX='.so'
14218                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14219                                 ;;
14220                         (*)
14221                                 DFT_LIB_SUFFIX='.sl'
14222                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14223                                 ;;
14224                         esac
14225                         ;;
14226                 (*)
14227                         DFT_LIB_SUFFIX='.so'
14228                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14229                         ;;
14230                 esac
14231                 ;;
14232         (*)
14233                 DFT_LIB_SUFFIX='.a'
14234                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14235                 ;;
14236         esac
14237         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14238         then
14239                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14240                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14241         fi
14242 echo "$as_me:14242: result: $DFT_DEP_SUFFIX" >&5
14243 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14244
14245 echo "$as_me:14245: checking default object directory" >&5
14246 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14247
14248         case $DFT_LWR_MODEL in
14249         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14250         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14251         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14252         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14253         (shared)
14254                 case $cf_cv_system_name in
14255                 (cygwin|msys)
14256                         DFT_OBJ_SUBDIR='objects' ;;
14257                 (*)
14258                         DFT_OBJ_SUBDIR='obj_s' ;;
14259                 esac
14260         esac
14261 echo "$as_me:14261: result: $DFT_OBJ_SUBDIR" >&5
14262 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14263
14264 ### Set up low-level terminfo dependencies for makefiles.
14265
14266 if test "$DFT_LWR_MODEL" = shared ; then
14267         case $cf_cv_system_name in
14268         (cygwin*)
14269                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14270                 ;;
14271         (msys*)
14272                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14273                 ;;
14274         esac
14275 fi
14276
14277 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14278
14279 ### Construct the list of subdirectories for which we'll customize makefiles
14280 ### with the appropriate compile-rules.
14281
14282 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14283
14284 cat >>confdefs.h <<EOF
14285 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14286 EOF
14287
14288 ### Now that we're done running tests, add the compiler-warnings, if any
14289
14290 cf_fix_cppflags=no
14291 cf_new_cflags=
14292 cf_new_cppflags=
14293 cf_new_extra_cppflags=
14294
14295 for cf_add_cflags in $EXTRA_CFLAGS
14296 do
14297 case $cf_fix_cppflags in
14298 (no)
14299         case $cf_add_cflags in
14300         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14301                 case $cf_add_cflags in
14302                 (-D*)
14303                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14304
14305                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14306                                 && test -z "${cf_tst_cflags}" \
14307                                 && cf_fix_cppflags=yes
14308
14309                         if test $cf_fix_cppflags = yes ; then
14310                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14311                                 continue
14312                         elif test "${cf_tst_cflags}" = "\"'" ; then
14313                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14314                                 continue
14315                         fi
14316                         ;;
14317                 esac
14318                 case "$CPPFLAGS" in
14319                 (*$cf_add_cflags)
14320                         ;;
14321                 (*)
14322                         case $cf_add_cflags in
14323                         (-D*)
14324                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14325
14326 CPPFLAGS=`echo "$CPPFLAGS" | \
14327         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14328                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14329
14330                                 ;;
14331                         esac
14332                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
14333                         ;;
14334                 esac
14335                 ;;
14336         (*)
14337                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
14338                 ;;
14339         esac
14340         ;;
14341 (yes)
14342         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
14343
14344         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14345
14346         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14347                 && test -z "${cf_tst_cflags}" \
14348                 && cf_fix_cppflags=no
14349         ;;
14350 esac
14351 done
14352
14353 if test -n "$cf_new_cflags" ; then
14354
14355         CFLAGS="$CFLAGS $cf_new_cflags"
14356 fi
14357
14358 if test -n "$cf_new_cppflags" ; then
14359
14360         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
14361 fi
14362
14363 if test -n "$cf_new_extra_cppflags" ; then
14364
14365         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
14366 fi
14367
14368 ################################################################################
14369
14370 TEST_ARG2=
14371
14372 TEST_LIBS2=
14373
14374 NCURSES_SHLIB2="sh -c"
14375
14376 ADA_SUBDIRS="include gen src doc"
14377 if test "x$cf_with_tests" != "xno" ; then
14378         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14379 fi
14380 for cf_dir in $ADA_SUBDIRS
14381 do
14382         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14383 done
14384
14385 NCURSES_TREE="#"
14386
14387 EXTERNAL_TREE=
14388
14389 # match layout used by make-tar.sh
14390 ADAHTML_DIR=../doc/ada
14391
14392 if test "x$cross_compiling" = xyes ; then
14393         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14394 else
14395         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14396 fi
14397
14398 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14399 ac_config_commands="$ac_config_commands default"
14400 cat >confcache <<\_ACEOF
14401 # This file is a shell script that caches the results of configure
14402 # tests run on this system so they can be shared between configure
14403 # scripts and configure runs, see configure's option --config-cache.
14404 # It is not useful on other systems.  If it contains results you don't
14405 # want to keep, you may remove or edit it.
14406 #
14407 # config.status only pays attention to the cache file if you give it
14408 # the --recheck option to rerun configure.
14409 #
14410 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14411 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14412 # following values.
14413
14414 _ACEOF
14415
14416 # The following way of writing the cache mishandles newlines in values,
14417 # but we know of no workaround that is simple, portable, and efficient.
14418 # So, don't put newlines in cache variables' values.
14419 # Ultrix sh set writes to stderr and can't be redirected directly,
14420 # and sets the high bit in the cache file unless we assign to the vars.
14421 {
14422   (set) 2>&1 |
14423     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14424     *ac_space=\ *)
14425       # `set' does not quote correctly, so add quotes (double-quote
14426       # substitution turns \\\\ into \\, and sed turns \\ into \).
14427       sed -n \
14428         "s/'/'\\\\''/g;
14429           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14430       ;;
14431     *)
14432       # `set' quotes correctly as required by POSIX, so do not add quotes.
14433       sed -n \
14434         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14435       ;;
14436     esac;
14437 } |
14438   sed '
14439      t clear
14440      : clear
14441      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14442      t end
14443      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14444      : end' >>confcache
14445 if cmp -s $cache_file confcache; then :; else
14446   if test -w $cache_file; then
14447     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14448     cat confcache >$cache_file
14449   else
14450     echo "not updating unwritable cache $cache_file"
14451   fi
14452 fi
14453 rm -f confcache
14454
14455 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14456 # Let make expand exec_prefix.
14457 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14458
14459 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14460 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14461 # trailing colons and then remove the whole line if VPATH becomes empty
14462 # (actually we leave an empty line to preserve line numbers).
14463 if test "x$srcdir" = x.; then
14464   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14465 s/:*\$(srcdir):*/:/;
14466 s/:*\${srcdir}:*/:/;
14467 s/:*@srcdir@:*/:/;
14468 s/^\([^=]*=[    ]*\):*/\1/;
14469 s/:*$//;
14470 s/^[^=]*=[      ]*$//;
14471 }'
14472 fi
14473
14474 DEFS=-DHAVE_CONFIG_H
14475
14476 : ${CONFIG_STATUS=./config.status}
14477 ac_clean_files_save=$ac_clean_files
14478 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14479 { echo "$as_me:14479: creating $CONFIG_STATUS" >&5
14480 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14481 cat >$CONFIG_STATUS <<_ACEOF
14482 #! $SHELL
14483 # Generated automatically by configure.
14484 # Run this file to recreate the current configuration.
14485 # Compiler output produced by configure, useful for debugging
14486 # configure, is in config.log if it exists.
14487
14488 debug=false
14489 SHELL=\${CONFIG_SHELL-$SHELL}
14490 ac_cs_invocation="\$0 \$@"
14491
14492 _ACEOF
14493
14494 cat >>$CONFIG_STATUS <<\_ACEOF
14495 # Be Bourne compatible
14496 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14497   emulate sh
14498   NULLCMD=:
14499 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14500   set -o posix
14501 fi
14502
14503 # Name of the executable.
14504 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14505
14506 if expr a : '\(a\)' >/dev/null 2>&1; then
14507   as_expr=expr
14508 else
14509   as_expr=false
14510 fi
14511
14512 rm -f conf$$ conf$$.exe conf$$.file
14513 echo >conf$$.file
14514 if ln -s conf$$.file conf$$ 2>/dev/null; then
14515   # We could just check for DJGPP; but this test a) works b) is more generic
14516   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14517   if test -f conf$$.exe; then
14518     # Don't use ln at all; we don't have any links
14519     as_ln_s='cp -p'
14520   else
14521     as_ln_s='ln -s'
14522   fi
14523 elif ln conf$$.file conf$$ 2>/dev/null; then
14524   as_ln_s=ln
14525 else
14526   as_ln_s='cp -p'
14527 fi
14528 rm -f conf$$ conf$$.exe conf$$.file
14529
14530 as_executable_p="test -f"
14531
14532 # Support unset when possible.
14533 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14534   as_unset=unset
14535 else
14536   as_unset=false
14537 fi
14538
14539 # NLS nuisances.
14540 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14541 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14542 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14543 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14544 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14545 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14546 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14547 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14548
14549 # IFS
14550 # We need space, tab and new line, in precisely that order.
14551 as_nl='
14552 '
14553 IFS="   $as_nl"
14554
14555 # CDPATH.
14556 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14557
14558 exec 6>&1
14559
14560 _ACEOF
14561
14562 # Files that config.status was made for.
14563 if test -n "$ac_config_files"; then
14564   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14565 fi
14566
14567 if test -n "$ac_config_headers"; then
14568   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14569 fi
14570
14571 if test -n "$ac_config_links"; then
14572   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14573 fi
14574
14575 if test -n "$ac_config_commands"; then
14576   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14577 fi
14578
14579 cat >>$CONFIG_STATUS <<\EOF
14580
14581 ac_cs_usage="\
14582 \`$as_me' instantiates files from templates according to the
14583 current configuration.
14584
14585 Usage: $0 [OPTIONS] [FILE]...
14586
14587   -h, --help       print this help, then exit
14588   -V, --version    print version number, then exit
14589   -d, --debug      don't remove temporary files
14590       --recheck    update $as_me by reconfiguring in the same conditions
14591   --file=FILE[:TEMPLATE]
14592                    instantiate the configuration file FILE
14593   --header=FILE[:TEMPLATE]
14594                    instantiate the configuration header FILE
14595
14596 Configuration files:
14597 $config_files
14598
14599 Configuration headers:
14600 $config_headers
14601
14602 Configuration commands:
14603 $config_commands
14604
14605 Report bugs to <dickey@invisible-island.net>."
14606 EOF
14607
14608 cat >>$CONFIG_STATUS <<EOF
14609 ac_cs_version="\\
14610 config.status
14611 configured by $0, generated by GNU Autoconf 2.52.20150926,
14612   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14613
14614 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14615 Free Software Foundation, Inc.
14616 This config.status script is free software; the Free Software Foundation
14617 gives unlimited permission to copy, distribute and modify it."
14618 srcdir=$srcdir
14619 INSTALL="$INSTALL"
14620 EOF
14621
14622 cat >>$CONFIG_STATUS <<\EOF
14623 # If no file are specified by the user, then we need to provide default
14624 # value.  By we need to know if files were specified by the user.
14625 ac_need_defaults=:
14626 while test $# != 0
14627 do
14628   case $1 in
14629   --*=*)
14630     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14631     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14632     shift
14633     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14634     shift
14635     ;;
14636   -*);;
14637   *) # This is not an option, so the user has probably given explicit
14638      # arguments.
14639      ac_need_defaults=false;;
14640   esac
14641
14642   case $1 in
14643   # Handling of the options.
14644 EOF
14645 cat >>$CONFIG_STATUS <<EOF
14646   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14647     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14648     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14649 EOF
14650 cat >>$CONFIG_STATUS <<\EOF
14651   --version | --vers* | -V )
14652     echo "$ac_cs_version"; exit 0 ;;
14653   --he | --h)
14654     # Conflict between --help and --header
14655     { { echo "$as_me:14655: error: ambiguous option: $1
14656 Try \`$0 --help' for more information." >&5
14657 echo "$as_me: error: ambiguous option: $1
14658 Try \`$0 --help' for more information." >&2;}
14659    { (exit 1); exit 1; }; };;
14660   --help | --hel | -h )
14661     echo "$ac_cs_usage"; exit 0 ;;
14662   --debug | --d* | -d )
14663     debug=: ;;
14664   --file | --fil | --fi | --f )
14665     shift
14666     CONFIG_FILES="$CONFIG_FILES $1"
14667     ac_need_defaults=false;;
14668   --header | --heade | --head | --hea )
14669     shift
14670     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14671     ac_need_defaults=false;;
14672
14673   # This is an error.
14674   -*) { { echo "$as_me:14674: error: unrecognized option: $1
14675 Try \`$0 --help' for more information." >&5
14676 echo "$as_me: error: unrecognized option: $1
14677 Try \`$0 --help' for more information." >&2;}
14678    { (exit 1); exit 1; }; } ;;
14679
14680   *) ac_config_targets="$ac_config_targets $1" ;;
14681
14682   esac
14683   shift
14684 done
14685
14686 exec 5>>config.log
14687 cat >&5 << _ACEOF
14688
14689 ## ----------------------- ##
14690 ## Running config.status.  ##
14691 ## ----------------------- ##
14692
14693 This file was extended by $as_me 2.52.20150926, executed with
14694   CONFIG_FILES    = $CONFIG_FILES
14695   CONFIG_HEADERS  = $CONFIG_HEADERS
14696   CONFIG_LINKS    = $CONFIG_LINKS
14697   CONFIG_COMMANDS = $CONFIG_COMMANDS
14698   > $ac_cs_invocation
14699 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14700
14701 _ACEOF
14702 EOF
14703
14704 cat >>$CONFIG_STATUS <<EOF
14705 #
14706 # INIT-COMMANDS section.
14707 #
14708
14709 ### Special initialization commands, used to pass information from the
14710 ### configuration-run into config.status
14711
14712 AWK="$AWK"
14713 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
14714 DFT_LWR_MODEL="$DFT_LWR_MODEL"
14715 LIB_NAME="$LIB_NAME"
14716 LIB_PREFIX="$LIB_PREFIX"
14717 LIB_SUFFIX="$LIB_SUFFIX"
14718 LN_S="$LN_S"
14719 NCURSES_MAJOR="$NCURSES_MAJOR"
14720 NCURSES_MINOR="$NCURSES_MINOR"
14721 NCURSES_PATCH="$NCURSES_PATCH"
14722 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
14723 cf_cv_abi_version="$cf_cv_abi_version"
14724 cf_cv_rel_version="$cf_cv_rel_version"
14725 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
14726 cf_cv_shared_soname='$cf_cv_shared_soname'
14727 cf_cv_shlib_version="$cf_cv_shlib_version"
14728 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
14729 cf_cv_system_name="$cf_cv_system_name"
14730 host="$host"
14731 target="$target"
14732
14733 EOF
14734
14735 cat >>$CONFIG_STATUS <<\EOF
14736 for ac_config_target in $ac_config_targets
14737 do
14738   case "$ac_config_target" in
14739   # Handling of arguments.
14740   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
14741   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
14742   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
14743   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
14744   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
14745   *) { { echo "$as_me:14745: error: invalid argument: $ac_config_target" >&5
14746 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
14747    { (exit 1); exit 1; }; };;
14748   esac
14749 done
14750
14751 # If the user did not use the arguments to specify the items to instantiate,
14752 # then the envvar interface is used.  Set only those that are not.
14753 # We use the long form for the default assignment because of an extremely
14754 # bizarre bug on SunOS 4.1.3.
14755 if $ac_need_defaults; then
14756   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
14757   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
14758   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
14759 fi
14760
14761 # Create a temporary directory, and hook for its removal unless debugging.
14762 $debug ||
14763 {
14764   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
14765   trap '{ (exit 1); exit 1; }' 1 2 13 15
14766 }
14767
14768 # Create a (secure) tmp directory for tmp files.
14769 : ${TMPDIR=/tmp}
14770 {
14771   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
14772   test -n "$tmp" && test -d "$tmp"
14773 }  ||
14774 {
14775   tmp=$TMPDIR/cs$$-$RANDOM
14776   (umask 077 && mkdir $tmp)
14777 } ||
14778 {
14779    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
14780    { (exit 1); exit 1; }
14781 }
14782
14783 EOF
14784
14785 cat >>$CONFIG_STATUS <<EOF
14786
14787 #
14788 # CONFIG_FILES section.
14789 #
14790
14791 # No need to generate the scripts if there are no CONFIG_FILES.
14792 # This happens for instance when ./config.status config.h
14793 if test -n "\$CONFIG_FILES"; then
14794   # Protect against being on the right side of a sed subst in config.status.
14795   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
14796    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
14797 s,@SHELL@,$SHELL,;t t
14798 s,@exec_prefix@,$exec_prefix,;t t
14799 s,@prefix@,$prefix,;t t
14800 s,@program_transform_name@,$program_transform_name,;t t
14801 s,@bindir@,$bindir,;t t
14802 s,@sbindir@,$sbindir,;t t
14803 s,@libexecdir@,$libexecdir,;t t
14804 s,@datarootdir@,$datarootdir,;t t
14805 s,@datadir@,$datadir,;t t
14806 s,@sysconfdir@,$sysconfdir,;t t
14807 s,@sharedstatedir@,$sharedstatedir,;t t
14808 s,@localstatedir@,$localstatedir,;t t
14809 s,@libdir@,$libdir,;t t
14810 s,@includedir@,$includedir,;t t
14811 s,@oldincludedir@,$oldincludedir,;t t
14812 s,@infodir@,$infodir,;t t
14813 s,@mandir@,$mandir,;t t
14814 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
14815 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
14816 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
14817 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
14818 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
14819 s,@build_alias@,$build_alias,;t t
14820 s,@host_alias@,$host_alias,;t t
14821 s,@target_alias@,$target_alias,;t t
14822 s,@ECHO_C@,$ECHO_C,;t t
14823 s,@ECHO_N@,$ECHO_N,;t t
14824 s,@ECHO_T@,$ECHO_T,;t t
14825 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
14826 s,@DEFS@,$DEFS,;t t
14827 s,@LIBS@,$LIBS,;t t
14828 s,@top_builddir@,$top_builddir,;t t
14829 s,@build@,$build,;t t
14830 s,@build_cpu@,$build_cpu,;t t
14831 s,@build_vendor@,$build_vendor,;t t
14832 s,@build_os@,$build_os,;t t
14833 s,@host@,$host,;t t
14834 s,@host_cpu@,$host_cpu,;t t
14835 s,@host_vendor@,$host_vendor,;t t
14836 s,@host_os@,$host_os,;t t
14837 s,@target@,$target,;t t
14838 s,@target_cpu@,$target_cpu,;t t
14839 s,@target_vendor@,$target_vendor,;t t
14840 s,@target_os@,$target_os,;t t
14841 s,@CC@,$CC,;t t
14842 s,@CFLAGS@,$CFLAGS,;t t
14843 s,@LDFLAGS@,$LDFLAGS,;t t
14844 s,@CPPFLAGS@,$CPPFLAGS,;t t
14845 s,@ac_ct_CC@,$ac_ct_CC,;t t
14846 s,@EXEEXT@,$EXEEXT,;t t
14847 s,@OBJEXT@,$OBJEXT,;t t
14848 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
14849 s,@CPP@,$CPP,;t t
14850 s,@AWK@,$AWK,;t t
14851 s,@EGREP@,$EGREP,;t t
14852 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
14853 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
14854 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
14855 s,@LN_S@,$LN_S,;t t
14856 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
14857 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
14858 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
14859 s,@SET_MAKE@,$SET_MAKE,;t t
14860 s,@CTAGS@,$CTAGS,;t t
14861 s,@ETAGS@,$ETAGS,;t t
14862 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
14863 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
14864 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
14865 s,@RANLIB@,$RANLIB,;t t
14866 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
14867 s,@LD@,$LD,;t t
14868 s,@ac_ct_LD@,$ac_ct_LD,;t t
14869 s,@AR@,$AR,;t t
14870 s,@ac_ct_AR@,$ac_ct_AR,;t t
14871 s,@ARFLAGS@,$ARFLAGS,;t t
14872 s,@DESTDIR@,$DESTDIR,;t t
14873 s,@BUILD_CC@,$BUILD_CC,;t t
14874 s,@BUILD_CPP@,$BUILD_CPP,;t t
14875 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
14876 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
14877 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
14878 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
14879 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
14880 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
14881 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
14882 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
14883 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
14884 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
14885 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
14886 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
14887 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
14888 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
14889 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
14890 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
14891 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
14892 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
14893 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
14894 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
14895 s,@CC_G_OPT@,$CC_G_OPT,;t t
14896 s,@LD_MODEL@,$LD_MODEL,;t t
14897 s,@shlibdir@,$shlibdir,;t t
14898 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
14899 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
14900 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
14901 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
14902 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
14903 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
14904 s,@LINK_PROGS@,$LINK_PROGS,;t t
14905 s,@LINK_TESTS@,$LINK_TESTS,;t t
14906 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
14907 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
14908 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
14909 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
14910 s,@RPATH_LIST@,$RPATH_LIST,;t t
14911 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
14912 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
14913 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
14914 s,@PTHREAD@,$PTHREAD,;t t
14915 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
14916 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
14917 s,@ECHO_LT@,$ECHO_LT,;t t
14918 s,@ECHO_LD@,$ECHO_LD,;t t
14919 s,@RULE_CC@,$RULE_CC,;t t
14920 s,@SHOW_CC@,$SHOW_CC,;t t
14921 s,@ECHO_CC@,$ECHO_CC,;t t
14922 s,@ADAFLAGS@,$ADAFLAGS,;t t
14923 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
14924 s,@ADA_TRACE@,$ADA_TRACE,;t t
14925 s,@gnat_exists@,$gnat_exists,;t t
14926 s,@M4_exists@,$M4_exists,;t t
14927 s,@cf_ada_make@,$cf_ada_make,;t t
14928 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
14929 s,@cf_compile_generics@,$cf_compile_generics,;t t
14930 s,@cf_generic_objects@,$cf_generic_objects,;t t
14931 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
14932 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
14933 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
14934 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
14935 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
14936 s,@cf_ada_package@,$cf_ada_package,;t t
14937 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
14938 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
14939 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
14940 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
14941 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
14942 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
14943 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
14944 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
14945 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
14946 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
14947 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
14948 s,@TEST_ARG2@,$TEST_ARG2,;t t
14949 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
14950 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
14951 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
14952 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
14953 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
14954 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
14955 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
14956 CEOF
14957
14958 EOF
14959
14960   cat >>$CONFIG_STATUS <<\EOF
14961   # Split the substitutions into bite-sized pieces for seds with
14962   # small command number limits, like on Digital OSF/1 and HP-UX.
14963   ac_max_sed_lines=48
14964   ac_sed_frag=1 # Number of current file.
14965   ac_beg=1 # First line for current file.
14966   ac_end=$ac_max_sed_lines # Line after last line for current file.
14967   ac_more_lines=:
14968   ac_sed_cmds=
14969   while $ac_more_lines; do
14970     if test $ac_beg -gt 1; then
14971       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14972     else
14973       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
14974     fi
14975     if test ! -s $tmp/subs.frag; then
14976       ac_more_lines=false
14977     else
14978       # The purpose of the label and of the branching condition is to
14979       # speed up the sed processing (if there are no `@' at all, there
14980       # is no need to browse any of the substitutions).
14981       # These are the two extra sed commands mentioned above.
14982       (echo ':t
14983   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
14984       # It is possible to make a multiline substitution using escaped newlines.
14985       # Ensure that we do not split the substitution between script fragments.
14986       ac_BEG=$ac_end
14987       ac_END=`expr $ac_end + $ac_max_sed_lines`
14988       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
14989       if test -s $tmp/subs.next; then
14990         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
14991         if test ! -s $tmp/subs.edit; then
14992           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
14993           if test ! -s $tmp/subs.edit; then
14994             if test $ac_beg -gt 1; then
14995               ac_end=`expr $ac_end - 1`
14996               continue
14997             fi
14998           fi
14999         fi
15000       fi
15001
15002       if test -z "$ac_sed_cmds"; then
15003         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15004       else
15005         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15006       fi
15007       ac_sed_frag=`expr $ac_sed_frag + 1`
15008       ac_beg=$ac_end
15009       ac_end=`expr $ac_end + $ac_max_sed_lines`
15010     fi
15011   done
15012   if test -z "$ac_sed_cmds"; then
15013     ac_sed_cmds=cat
15014   fi
15015 fi # test -n "$CONFIG_FILES"
15016
15017 EOF
15018 cat >>$CONFIG_STATUS <<\EOF
15019 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15020   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15021   case $ac_file in
15022   - | *:- | *:-:* ) # input from stdin
15023         cat >$tmp/stdin
15024         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15025         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15026   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15027         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15028   * )   ac_file_in=$ac_file.in ;;
15029   esac
15030
15031   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15032   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15033          X"$ac_file" : 'X\(//\)[^/]' \| \
15034          X"$ac_file" : 'X\(//\)$' \| \
15035          X"$ac_file" : 'X\(/\)' \| \
15036          .     : '\(.\)' 2>/dev/null ||
15037 echo X"$ac_file" |
15038     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15039           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15040           /^X\(\/\/\)$/{ s//\1/; q; }
15041           /^X\(\/\).*/{ s//\1/; q; }
15042           s/.*/./; q'`
15043   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15044     { case "$ac_dir" in
15045   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15046   *)                      as_incr_dir=.;;
15047 esac
15048 as_dummy="$ac_dir"
15049 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15050   case $as_mkdir_dir in
15051     # Skip DOS drivespec
15052     ?:) as_incr_dir=$as_mkdir_dir ;;
15053     *)
15054       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15055       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15056     ;;
15057   esac
15058 done; }
15059
15060     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15061     # A "../" for each directory in $ac_dir_suffix.
15062     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15063   else
15064     ac_dir_suffix= ac_dots=
15065   fi
15066
15067   case $srcdir in
15068   .)  ac_srcdir=.
15069       if test -z "$ac_dots"; then
15070          ac_top_srcdir=.
15071       else
15072          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15073       fi ;;
15074   [\\/]* | ?:[\\/]* )
15075       ac_srcdir=$srcdir$ac_dir_suffix;
15076       ac_top_srcdir=$srcdir ;;
15077   *) # Relative path.
15078     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15079     ac_top_srcdir=$ac_dots$srcdir ;;
15080   esac
15081
15082   case $INSTALL in
15083   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15084   *) ac_INSTALL=$ac_dots$INSTALL ;;
15085   esac
15086
15087   if test x"$ac_file" != x-; then
15088     { echo "$as_me:15088: creating $ac_file" >&5
15089 echo "$as_me: creating $ac_file" >&6;}
15090     rm -f "$ac_file"
15091   fi
15092   # Let's still pretend it is `configure' which instantiates (i.e., don't
15093   # use $as_me), people would be surprised to read:
15094   #    /* config.h.  Generated automatically by config.status.  */
15095   configure_input="Generated automatically from `echo $ac_file_in |
15096                                                  sed 's,.*/,,'` by configure."
15097
15098   # First look for the input files in the build tree, otherwise in the
15099   # src tree.
15100   ac_file_inputs=`IFS=:
15101     for f in $ac_file_in; do
15102       case $f in
15103       -) echo $tmp/stdin ;;
15104       [\\/$]*)
15105          # Absolute (can't be DOS-style, as IFS=:)
15106          test -f "$f" || { { echo "$as_me:15106: error: cannot find input file: $f" >&5
15107 echo "$as_me: error: cannot find input file: $f" >&2;}
15108    { (exit 1); exit 1; }; }
15109          echo $f;;
15110       *) # Relative
15111          if test -f "$f"; then
15112            # Build tree
15113            echo $f
15114          elif test -f "$srcdir/$f"; then
15115            # Source tree
15116            echo $srcdir/$f
15117          else
15118            # /dev/null tree
15119            { { echo "$as_me:15119: error: cannot find input file: $f" >&5
15120 echo "$as_me: error: cannot find input file: $f" >&2;}
15121    { (exit 1); exit 1; }; }
15122          fi;;
15123       esac
15124     done` || { (exit 1); exit 1; }
15125 EOF
15126 cat >>$CONFIG_STATUS <<\EOF
15127   ac_warn_datarootdir=no
15128   if test x"$ac_file" != x-; then
15129     for ac_item in $ac_file_inputs
15130     do
15131       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15132       if test -n "$ac_seen"; then
15133         ac_used=`grep '@datarootdir@' $ac_item`
15134         if test -z "$ac_used"; then
15135           { echo "$as_me:15135: WARNING: datarootdir was used implicitly but not set:
15136 $ac_seen" >&5
15137 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15138 $ac_seen" >&2;}
15139           ac_warn_datarootdir=yes
15140         fi
15141       fi
15142       ac_seen=`grep '${datarootdir}' $ac_item`
15143       if test -n "$ac_seen"; then
15144         { echo "$as_me:15144: WARNING: datarootdir was used explicitly but not set:
15145 $ac_seen" >&5
15146 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15147 $ac_seen" >&2;}
15148         ac_warn_datarootdir=yes
15149       fi
15150     done
15151   fi
15152
15153 if test "x$ac_warn_datarootdir" = xyes; then
15154   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15155 fi
15156
15157 EOF
15158 cat >>$CONFIG_STATUS <<EOF
15159   sed "$ac_vpsub
15160 $extrasub
15161 EOF
15162 cat >>$CONFIG_STATUS <<\EOF
15163 :t
15164 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15165 s,@configure_input@,$configure_input,;t t
15166 s,@srcdir@,$ac_srcdir,;t t
15167 s,@top_srcdir@,$ac_top_srcdir,;t t
15168 s,@INSTALL@,$ac_INSTALL,;t t
15169 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15170   rm -f $tmp/stdin
15171   if test x"$ac_file" != x-; then
15172     cp $tmp/out $ac_file
15173
15174     for ac_name in prefix exec_prefix datarootdir
15175     do
15176         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15177         if test -n "$ac_seen"; then
15178             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15179             if test -z "$ac_init"; then
15180               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15181               { echo "$as_me:15181: WARNING: Variable $ac_name is used but was not set:
15182 $ac_seen" >&5
15183 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15184 $ac_seen" >&2;}
15185             fi
15186         fi
15187     done
15188     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15189     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15190     if test -s $tmp/out; then
15191       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15192       { echo "$as_me:15192: WARNING: Some variables may not be substituted:
15193 $ac_seen" >&5
15194 echo "$as_me: WARNING: Some variables may not be substituted:
15195 $ac_seen" >&2;}
15196     fi
15197   else
15198     cat $tmp/out
15199   fi
15200   rm -f $tmp/out
15201
15202 done
15203 EOF
15204 cat >>$CONFIG_STATUS <<\EOF
15205
15206 #
15207 # CONFIG_HEADER section.
15208 #
15209
15210 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15211 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15212 #
15213 # ac_d sets the value in "#define NAME VALUE" lines.
15214 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15215 ac_dB='[        ].*$,\1#\2'
15216 ac_dC=' '
15217 ac_dD=',;t'
15218 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15219 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15220 ac_iB='\([      ]\),\1#\2define\3'
15221 ac_iC=' '
15222 ac_iD='\4,;t'
15223 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15224 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15225 ac_uB='$,\1#\2define\3'
15226 ac_uC=' '
15227 ac_uD=',;t'
15228
15229 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15230   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15231   case $ac_file in
15232   - | *:- | *:-:* ) # input from stdin
15233         cat >$tmp/stdin
15234         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15235         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15236   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15237         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15238   * )   ac_file_in=$ac_file.in ;;
15239   esac
15240
15241   test x"$ac_file" != x- && { echo "$as_me:15241: creating $ac_file" >&5
15242 echo "$as_me: creating $ac_file" >&6;}
15243
15244   # First look for the input files in the build tree, otherwise in the
15245   # src tree.
15246   ac_file_inputs=`IFS=:
15247     for f in $ac_file_in; do
15248       case $f in
15249       -) echo $tmp/stdin ;;
15250       [\\/$]*)
15251          # Absolute (can't be DOS-style, as IFS=:)
15252          test -f "$f" || { { echo "$as_me:15252: error: cannot find input file: $f" >&5
15253 echo "$as_me: error: cannot find input file: $f" >&2;}
15254    { (exit 1); exit 1; }; }
15255          echo $f;;
15256       *) # Relative
15257          if test -f "$f"; then
15258            # Build tree
15259            echo $f
15260          elif test -f "$srcdir/$f"; then
15261            # Source tree
15262            echo $srcdir/$f
15263          else
15264            # /dev/null tree
15265            { { echo "$as_me:15265: error: cannot find input file: $f" >&5
15266 echo "$as_me: error: cannot find input file: $f" >&2;}
15267    { (exit 1); exit 1; }; }
15268          fi;;
15269       esac
15270     done` || { (exit 1); exit 1; }
15271   # Remove the trailing spaces.
15272   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15273
15274 EOF
15275
15276 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15277 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15278 # be either 'cat' or 'sort'.
15279 cat confdefs.h | uniq >conftest.vals
15280
15281 # Break up conftest.vals because some shells have a limit on
15282 # the size of here documents, and old seds have small limits too.
15283
15284 rm -f conftest.tail
15285 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15286 while grep . conftest.vals >/dev/null
15287 do
15288   # Write chunks of a limited-size here document to conftest.frag.
15289   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15290   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15291   echo 'CEOF' >> $CONFIG_STATUS
15292   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15293   rm -f conftest.vals
15294   mv conftest.tail conftest.vals
15295 done
15296 rm -f conftest.vals
15297
15298 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15299 # marker @DEFS@.
15300 echo '  cat >> conftest.edit <<CEOF
15301 /@DEFS@/r conftest.frag
15302 /@DEFS@/d
15303 CEOF
15304 sed -f conftest.edit $tmp/in > $tmp/out
15305 rm -f $tmp/in
15306 mv $tmp/out $tmp/in
15307 rm -f conftest.edit conftest.frag
15308 ' >> $CONFIG_STATUS
15309
15310 cat >>$CONFIG_STATUS <<\EOF
15311   # Let's still pretend it is `configure' which instantiates (i.e., don't
15312   # use $as_me), people would be surprised to read:
15313   #    /* config.h.  Generated automatically by config.status.  */
15314   if test x"$ac_file" = x-; then
15315     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15316   else
15317     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15318   fi
15319   cat $tmp/in >>$tmp/config.h
15320   rm -f $tmp/in
15321   if test x"$ac_file" != x-; then
15322     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15323       { echo "$as_me:15323: $ac_file is unchanged" >&5
15324 echo "$as_me: $ac_file is unchanged" >&6;}
15325     else
15326       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15327          X"$ac_file" : 'X\(//\)[^/]' \| \
15328          X"$ac_file" : 'X\(//\)$' \| \
15329          X"$ac_file" : 'X\(/\)' \| \
15330          .     : '\(.\)' 2>/dev/null ||
15331 echo X"$ac_file" |
15332     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15333           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15334           /^X\(\/\/\)$/{ s//\1/; q; }
15335           /^X\(\/\).*/{ s//\1/; q; }
15336           s/.*/./; q'`
15337       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15338         { case "$ac_dir" in
15339   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15340   *)                      as_incr_dir=.;;
15341 esac
15342 as_dummy="$ac_dir"
15343 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15344   case $as_mkdir_dir in
15345     # Skip DOS drivespec
15346     ?:) as_incr_dir=$as_mkdir_dir ;;
15347     *)
15348       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15349       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15350     ;;
15351   esac
15352 done; }
15353
15354       fi
15355       rm -f $ac_file
15356       mv $tmp/config.h $ac_file
15357     fi
15358   else
15359     cat $tmp/config.h
15360     rm -f $tmp/config.h
15361   fi
15362 done
15363 EOF
15364 cat >>$CONFIG_STATUS <<\EOF
15365 #
15366 # CONFIG_COMMANDS section.
15367 #
15368 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15369   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15370   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15371
15372   case $ac_dest in
15373     default )
15374 if test -z "$USE_OLD_MAKERULES" ; then
15375         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15376 fi
15377  ;;
15378   esac
15379 done
15380 EOF
15381
15382 cat >>$CONFIG_STATUS <<\EOF
15383
15384 { (exit 0); exit 0; }
15385 EOF
15386 chmod +x $CONFIG_STATUS
15387 ac_clean_files=$ac_clean_files_save
15388
15389 # configure is writing to config.log, and then calls config.status.
15390 # config.status does its own redirection, appending to config.log.
15391 # Unfortunately, on DOS this fails, as config.log is still kept open
15392 # by configure, so config.status won't be able to write to it; its
15393 # output is simply discarded.  So we exec the FD to /dev/null,
15394 # effectively closing config.log, so it can be properly (re)opened and
15395 # appended to by config.status.  When coming back to configure, we
15396 # need to make the FD available again.
15397 if test "$no_create" != yes; then
15398   ac_cs_success=:
15399   exec 5>/dev/null
15400   $SHELL $CONFIG_STATUS || ac_cs_success=false
15401   exec 5>>config.log
15402   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15403   # would make configure fail if this is the last instruction.
15404   $ac_cs_success || { (exit 1); exit 1; }
15405 fi
15406 ${MAKE:-make} preinstall