]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.1 - patch 20180818
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.66 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20170501.
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 General Options:
692   --with-system-type=XXX  test: override derived host system-type
693   --disable-stripping     do not strip (debug info) installed executables
694   --with-pkg-config{=path} enable/disable use of pkg-config
695   --with-pkg-config-libdir=XXX use given directory for installing pc-files
696   --without-tests         suppress build with test-programs
697   --enable-mixed-case     tic should assume mixed-case filenames
698   --with-install-prefix   prefixes actual install-location ($DESTDIR)
699 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
700   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
701   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
702   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
703   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
704   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
705   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
706 Options to Specify the Libraries Built/Used:
707   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
708   --with-curses-dir=DIR   directory in which (n)curses is installed
709   --enable-widec          compile with wide-char/UTF-8 code
710   --with-lib-prefix       override library-prefix
711   --with-shlib-version=X  Specify rel or abi version for shared libs
712   --enable-rpath-link     link sample programs with rpath option
713 Fine-Tuning Your Configuration:
714   --enable-broken_linker  compile with broken-linker support code
715   --disable-largefile     omit support for large files
716   --with-rcs-ids          compile-in RCS identifiers
717 Extensions:
718   --disable-ext-funcs     disable function-extensions
719   --enable-const          compile with extra/non-standard const
720 Development Code:
721   --without-develop       disable development options
722 Experimental Code:
723   --with-pthread          use POSIX thread library
724   --enable-weak-symbols   enable weak-symbols for pthreads
725   --enable-reentrant      compile with experimental reentrant code
726   --with-wrap-prefix=XXX  override prefix used for public variables
727 Testing/development Options:
728   --disable-echo          do not display "compiling" commands
729   --enable-warnings       build: turn on GCC compiler warnings
730   --enable-assertions     test: turn on generation of assertion code
731   --enable-expanded       test: generate functions for certain macros
732   --disable-macros        test: use functions rather than macros
733   --with-trace            test: add trace() function to all models of ncurses
734   --disable-gnat-projects test: disable GNAT projects even if usable
735 Ada95 Binding Options:
736   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
737   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
738   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
739   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
740
741 Some influential environment variables:
742   CC          C compiler command
743   CFLAGS      C compiler flags
744   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
745               nonstandard directory <lib dir>
746   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
747               headers in a nonstandard directory <include dir>
748   CPP         C preprocessor
749
750 Use these variables to override the choices made by `configure' or to help
751 it to find libraries and programs with nonstandard names/locations.
752
753 EOF
754 fi
755
756 if test "$ac_init_help" = "recursive"; then
757   # If there are subdirs, report their specific --help.
758   ac_popdir=`pwd`
759   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
760     cd $ac_subdir
761     # A "../" for each directory in /$ac_subdir.
762     ac_dots=`echo $ac_subdir |
763              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
764
765     case $srcdir in
766     .) # No --srcdir option.  We are building in place.
767       ac_sub_srcdir=$srcdir ;;
768     [\\/]* | ?:[\\/]* ) # Absolute path.
769       ac_sub_srcdir=$srcdir/$ac_subdir ;;
770     *) # Relative path.
771       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
772     esac
773
774     # Check for guested configure; otherwise get Cygnus style configure.
775     if test -f $ac_sub_srcdir/configure.gnu; then
776       echo
777       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
778     elif test -f $ac_sub_srcdir/configure; then
779       echo
780       $SHELL $ac_sub_srcdir/configure  --help=recursive
781     elif test -f $ac_sub_srcdir/configure.ac ||
782            test -f $ac_sub_srcdir/configure.in; then
783       echo
784       $ac_configure --help
785     else
786       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
787     fi
788     cd $ac_popdir
789   done
790 fi
791
792 test -n "$ac_init_help" && exit 0
793 if $ac_init_version; then
794   cat <<\EOF
795
796 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
797 Free Software Foundation, Inc.
798 This configure script is free software; the Free Software Foundation
799 gives unlimited permission to copy, distribute and modify it.
800 EOF
801   exit 0
802 fi
803 exec 5>config.log
804 cat >&5 <<EOF
805 This file contains any messages produced by compilers while
806 running configure, to aid debugging if configure makes a mistake.
807
808 It was created by $as_me, which was
809 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
810
811   $ $0 $@
812
813 EOF
814 {
815 cat <<_ASUNAME
816 ## ---------- ##
817 ## Platform.  ##
818 ## ---------- ##
819
820 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
821 uname -m = `(uname -m) 2>/dev/null || echo unknown`
822 uname -r = `(uname -r) 2>/dev/null || echo unknown`
823 uname -s = `(uname -s) 2>/dev/null || echo unknown`
824 uname -v = `(uname -v) 2>/dev/null || echo unknown`
825
826 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
827 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
828
829 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
830 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
831 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
832 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
833 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
834 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
835 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
836
837 PATH = $PATH
838
839 _ASUNAME
840 } >&5
841
842 cat >&5 <<EOF
843 ## ------------ ##
844 ## Core tests.  ##
845 ## ------------ ##
846
847 EOF
848
849 # Keep a trace of the command line.
850 # Strip out --no-create and --no-recursion so they do not pile up.
851 # Also quote any args containing shell meta-characters.
852 ac_configure_args=
853 ac_sep=
854 for ac_arg
855 do
856   case $ac_arg in
857   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
858   | --no-cr | --no-c) ;;
859   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
860   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
861   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
862     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
863     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
864     ac_sep=" " ;;
865   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
866      ac_sep=" " ;;
867   esac
868   # Get rid of the leading space.
869 done
870
871 # When interrupted or exit'd, cleanup temporary files, and complete
872 # config.log.  We remove comments because anyway the quotes in there
873 # would cause problems or look ugly.
874 trap 'exit_status=$?
875   # Save into config.log some information that might help in debugging.
876   echo >&5
877   echo "## ----------------- ##" >&5
878   echo "## Cache variables.  ##" >&5
879   echo "## ----------------- ##" >&5
880   echo >&5
881   # The following way of writing the cache mishandles newlines in values,
882 {
883   (set) 2>&1 |
884     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
885     *ac_space=\ *)
886       sed -n \
887         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
888           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
889       ;;
890     *)
891       sed -n \
892         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
893       ;;
894     esac;
895 } >&5
896   sed "/^$/d" confdefs.h >conftest.log
897   if test -s conftest.log; then
898     echo >&5
899     echo "## ------------ ##" >&5
900     echo "## confdefs.h.  ##" >&5
901     echo "## ------------ ##" >&5
902     echo >&5
903     cat conftest.log >&5
904   fi
905   (echo; echo) >&5
906   test "$ac_signal" != 0 &&
907     echo "$as_me: caught signal $ac_signal" >&5
908   echo "$as_me: exit $exit_status" >&5
909   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
910     exit $exit_status
911      ' 0
912 for ac_signal in 1 2 13 15; do
913   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
914 done
915 ac_signal=0
916
917 # confdefs.h avoids OS command line length limits that DEFS can exceed.
918 rm -rf conftest* confdefs.h
919 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
920 echo >confdefs.h
921
922 # Let the site file select an alternate cache file if it wants to.
923 # Prefer explicitly selected file to automatically selected ones.
924 if test -z "$CONFIG_SITE"; then
925   if test "x$prefix" != xNONE; then
926     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
927   else
928     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
929   fi
930 fi
931 for ac_site_file in $CONFIG_SITE; do
932   if test -r "$ac_site_file"; then
933     { echo "$as_me:933: loading site script $ac_site_file" >&5
934 echo "$as_me: loading site script $ac_site_file" >&6;}
935     cat "$ac_site_file" >&5
936     . "$ac_site_file"
937   fi
938 done
939
940 if test -r "$cache_file"; then
941   # Some versions of bash will fail to source /dev/null (special
942   # files actually), so we avoid doing that.
943   if test -f "$cache_file"; then
944     { echo "$as_me:944: loading cache $cache_file" >&5
945 echo "$as_me: loading cache $cache_file" >&6;}
946     case $cache_file in
947       [\\/]* | ?:[\\/]* ) . $cache_file;;
948       *)                      . ./$cache_file;;
949     esac
950   fi
951 else
952   { echo "$as_me:952: creating cache $cache_file" >&5
953 echo "$as_me: creating cache $cache_file" >&6;}
954   >$cache_file
955 fi
956
957 # Check that the precious variables saved in the cache have kept the same
958 # value.
959 ac_cache_corrupted=false
960 for ac_var in `(set) 2>&1 |
961                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
962   eval ac_old_set=\$ac_cv_env_${ac_var}_set
963   eval ac_new_set=\$ac_env_${ac_var}_set
964   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
965   eval ac_new_val="\$ac_env_${ac_var}_value"
966   case $ac_old_set,$ac_new_set in
967     set,)
968       { echo "$as_me:968: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
969 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
970       ac_cache_corrupted=: ;;
971     ,set)
972       { echo "$as_me:972: error: \`$ac_var' was not set in the previous run" >&5
973 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
974       ac_cache_corrupted=: ;;
975     ,);;
976     *)
977       if test "x$ac_old_val" != "x$ac_new_val"; then
978         { echo "$as_me:978: error: \`$ac_var' has changed since the previous run:" >&5
979 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
980         { echo "$as_me:980:   former value:  $ac_old_val" >&5
981 echo "$as_me:   former value:  $ac_old_val" >&2;}
982         { echo "$as_me:982:   current value: $ac_new_val" >&5
983 echo "$as_me:   current value: $ac_new_val" >&2;}
984         ac_cache_corrupted=:
985       fi;;
986   esac
987   # Pass precious variables to config.status.  It doesn't matter if
988   # we pass some twice (in addition to the command line arguments).
989   if test "$ac_new_set" = set; then
990     case $ac_new_val in
991     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
992       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
993       ac_configure_args="$ac_configure_args '$ac_arg'"
994       ;;
995     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
996        ;;
997     esac
998   fi
999 done
1000 if $ac_cache_corrupted; then
1001   { echo "$as_me:1001: error: changes in the environment can compromise the build" >&5
1002 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1003   { { echo "$as_me:1003: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1004 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1005    { (exit 1); exit 1; }; }
1006 fi
1007
1008 ac_ext=c
1009 ac_cpp='$CPP $CPPFLAGS'
1010 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1011 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1012 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1013 ac_main_return=return
1014
1015 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1016   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1017                    ECHO_T='     ' ;;
1018   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1019   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1020 esac
1021 echo "#! $SHELL" >conftest.sh
1022 echo  "exit 0"   >>conftest.sh
1023 chmod +x conftest.sh
1024 if { (echo "$as_me:1024: PATH=\".;.\"; conftest.sh") >&5
1025   (PATH=".;."; conftest.sh) 2>&5
1026   ac_status=$?
1027   echo "$as_me:1027: \$? = $ac_status" >&5
1028   (exit $ac_status); }; then
1029   ac_path_separator=';'
1030 else
1031   ac_path_separator=:
1032 fi
1033 PATH_SEPARATOR="$ac_path_separator"
1034 rm -f conftest.sh
1035
1036 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1037
1038 top_builddir=`pwd`
1039
1040 ac_aux_dir=
1041 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1042   if test -f $ac_dir/install-sh; then
1043     ac_aux_dir=$ac_dir
1044     ac_install_sh="$ac_aux_dir/install-sh -c"
1045     break
1046   elif test -f $ac_dir/install.sh; then
1047     ac_aux_dir=$ac_dir
1048     ac_install_sh="$ac_aux_dir/install.sh -c"
1049     break
1050   elif test -f $ac_dir/shtool; then
1051     ac_aux_dir=$ac_dir
1052     ac_install_sh="$ac_aux_dir/shtool install -c"
1053     break
1054   fi
1055 done
1056 if test -z "$ac_aux_dir"; then
1057   { { echo "$as_me:1057: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1058 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1059    { (exit 1); exit 1; }; }
1060 fi
1061 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1062 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1063 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1064
1065 # Make sure we can run config.sub.
1066 $ac_config_sub sun4 >/dev/null 2>&1 ||
1067   { { echo "$as_me:1067: error: cannot run $ac_config_sub" >&5
1068 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 echo "$as_me:1071: checking build system type" >&5
1072 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1073 if test "${ac_cv_build+set}" = set; then
1074   echo $ECHO_N "(cached) $ECHO_C" >&6
1075 else
1076   ac_cv_build_alias=$build_alias
1077 test -z "$ac_cv_build_alias" &&
1078   ac_cv_build_alias=`$ac_config_guess`
1079 test -z "$ac_cv_build_alias" &&
1080   { { echo "$as_me:1080: error: cannot guess build type; you must specify one" >&5
1081 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1082    { (exit 1); exit 1; }; }
1083 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1084   { { echo "$as_me:1084: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1085 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1086    { (exit 1); exit 1; }; }
1087
1088 fi
1089 echo "$as_me:1089: result: $ac_cv_build" >&5
1090 echo "${ECHO_T}$ac_cv_build" >&6
1091 build=$ac_cv_build
1092 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1093 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1094 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1095
1096 echo "$as_me:1096: checking host system type" >&5
1097 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1098 if test "${ac_cv_host+set}" = set; then
1099   echo $ECHO_N "(cached) $ECHO_C" >&6
1100 else
1101   ac_cv_host_alias=$host_alias
1102 test -z "$ac_cv_host_alias" &&
1103   ac_cv_host_alias=$ac_cv_build_alias
1104 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1105   { { echo "$as_me:1105: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1106 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1107    { (exit 1); exit 1; }; }
1108
1109 fi
1110 echo "$as_me:1110: result: $ac_cv_host" >&5
1111 echo "${ECHO_T}$ac_cv_host" >&6
1112 host=$ac_cv_host
1113 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1114 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1115 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1116
1117 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1118         echo "$as_me:1118: checking target system type" >&5
1119 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1120 if test "${ac_cv_target+set}" = set; then
1121   echo $ECHO_N "(cached) $ECHO_C" >&6
1122 else
1123   ac_cv_target_alias=$target_alias
1124 test "x$ac_cv_target_alias" = "x" &&
1125   ac_cv_target_alias=$ac_cv_host_alias
1126 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1127   { { echo "$as_me:1127: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1128 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1129    { (exit 1); exit 1; }; }
1130
1131 fi
1132 echo "$as_me:1132: result: $ac_cv_target" >&5
1133 echo "${ECHO_T}$ac_cv_target" >&6
1134 target=$ac_cv_target
1135 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1136 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1137 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1138
1139 # The aliases save the names the user supplied, while $host etc.
1140 # will get canonicalized.
1141 test -n "$target_alias" &&
1142   test "$program_prefix$program_suffix$program_transform_name" = \
1143     NONENONEs,x,x, &&
1144   program_prefix=${target_alias}-
1145         system_name="$host_os"
1146 else
1147         system_name="`(uname -s -r) 2>/dev/null`"
1148         if test -z "$system_name" ; then
1149                 system_name="`(hostname) 2>/dev/null`"
1150         fi
1151 fi
1152 test -n "$system_name" &&
1153 cat >>confdefs.h <<EOF
1154 #define SYSTEM_NAME "$system_name"
1155 EOF
1156
1157 if test "${cf_cv_system_name+set}" = set; then
1158   echo $ECHO_N "(cached) $ECHO_C" >&6
1159 else
1160   cf_cv_system_name="$system_name"
1161 fi
1162
1163 test -z "$system_name" && system_name="$cf_cv_system_name"
1164 test -n "$cf_cv_system_name" && echo "$as_me:1164: result: Configuring for $cf_cv_system_name" >&5
1165 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1166
1167 if test ".$system_name" != ".$cf_cv_system_name" ; then
1168         echo "$as_me:1168: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1169 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1170         { { echo "$as_me:1170: error: \"Please remove config.cache and try again.\"" >&5
1171 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1172    { (exit 1); exit 1; }; }
1173 fi
1174
1175 # Check whether --with-system-type or --without-system-type was given.
1176 if test "${with_system_type+set}" = set; then
1177   withval="$with_system_type"
1178   { echo "$as_me:1178: WARNING: overriding system type to $withval" >&5
1179 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1180         cf_cv_system_name=$withval
1181         host_os=$withval
1182
1183 fi;
1184
1185 ###     Save the given $CFLAGS to allow user-override.
1186 cf_user_CFLAGS="$CFLAGS"
1187
1188 ###     Default install-location
1189
1190 echo "$as_me:1190: checking for prefix" >&5
1191 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1192 if test "x$prefix" = "xNONE" ; then
1193         case "$cf_cv_system_name" in
1194                 # non-vendor systems don't have a conflict
1195         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1196                 prefix=/usr
1197                 ;;
1198         (*)     prefix=$ac_default_prefix
1199                 ;;
1200         esac
1201 fi
1202 echo "$as_me:1202: result: $prefix" >&5
1203 echo "${ECHO_T}$prefix" >&6
1204
1205 if test "x$prefix" = "xNONE" ; then
1206 echo "$as_me:1206: checking for default include-directory" >&5
1207 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1208 test -n "$verbose" && echo 1>&6
1209 for cf_symbol in \
1210         $includedir \
1211         $includedir/ncurses \
1212         $prefix/include \
1213         $prefix/include/ncurses \
1214         /usr/local/include \
1215         /usr/local/include/ncurses \
1216         /usr/include \
1217         /usr/include/ncurses
1218 do
1219         cf_dir=`eval echo $cf_symbol`
1220         if test -f $cf_dir/curses.h ; then
1221         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1222                 includedir="$cf_symbol"
1223                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1224                 break
1225         fi
1226         fi
1227         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1228 done
1229 echo "$as_me:1229: result: $includedir" >&5
1230 echo "${ECHO_T}$includedir" >&6
1231 fi
1232
1233 ###     Checks for programs.
1234
1235 ac_ext=c
1236 ac_cpp='$CPP $CPPFLAGS'
1237 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1238 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1239 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1240 ac_main_return=return
1241 if test -n "$ac_tool_prefix"; then
1242   for ac_prog in gnatgcc gcc cc
1243   do
1244     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1245 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1246 echo "$as_me:1246: checking for $ac_word" >&5
1247 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1248 if test "${ac_cv_prog_CC+set}" = set; then
1249   echo $ECHO_N "(cached) $ECHO_C" >&6
1250 else
1251   if test -n "$CC"; then
1252   ac_cv_prog_CC="$CC" # Let the user override the test.
1253 else
1254   ac_save_IFS=$IFS; IFS=$ac_path_separator
1255 ac_dummy="$PATH"
1256 for ac_dir in $ac_dummy; do
1257   IFS=$ac_save_IFS
1258   test -z "$ac_dir" && ac_dir=.
1259   $as_executable_p "$ac_dir/$ac_word" || continue
1260 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1261 echo "$as_me:1261: found $ac_dir/$ac_word" >&5
1262 break
1263 done
1264
1265 fi
1266 fi
1267 CC=$ac_cv_prog_CC
1268 if test -n "$CC"; then
1269   echo "$as_me:1269: result: $CC" >&5
1270 echo "${ECHO_T}$CC" >&6
1271 else
1272   echo "$as_me:1272: result: no" >&5
1273 echo "${ECHO_T}no" >&6
1274 fi
1275
1276     test -n "$CC" && break
1277   done
1278 fi
1279 if test -z "$CC"; then
1280   ac_ct_CC=$CC
1281   for ac_prog in gnatgcc gcc cc
1282 do
1283   # Extract the first word of "$ac_prog", so it can be a program name with args.
1284 set dummy $ac_prog; ac_word=$2
1285 echo "$as_me:1285: checking for $ac_word" >&5
1286 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1287 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1288   echo $ECHO_N "(cached) $ECHO_C" >&6
1289 else
1290   if test -n "$ac_ct_CC"; then
1291   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1292 else
1293   ac_save_IFS=$IFS; IFS=$ac_path_separator
1294 ac_dummy="$PATH"
1295 for ac_dir in $ac_dummy; do
1296   IFS=$ac_save_IFS
1297   test -z "$ac_dir" && ac_dir=.
1298   $as_executable_p "$ac_dir/$ac_word" || continue
1299 ac_cv_prog_ac_ct_CC="$ac_prog"
1300 echo "$as_me:1300: found $ac_dir/$ac_word" >&5
1301 break
1302 done
1303
1304 fi
1305 fi
1306 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1307 if test -n "$ac_ct_CC"; then
1308   echo "$as_me:1308: result: $ac_ct_CC" >&5
1309 echo "${ECHO_T}$ac_ct_CC" >&6
1310 else
1311   echo "$as_me:1311: result: no" >&5
1312 echo "${ECHO_T}no" >&6
1313 fi
1314
1315   test -n "$ac_ct_CC" && break
1316 done
1317
1318   CC=$ac_ct_CC
1319 fi
1320
1321 test -z "$CC" && { { echo "$as_me:1321: error: no acceptable cc found in \$PATH" >&5
1322 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1323    { (exit 1); exit 1; }; }
1324
1325 # Provide some information about the compiler.
1326 echo "$as_me:1326:" \
1327      "checking for C compiler version" >&5
1328 ac_compiler=`set X $ac_compile; echo $2`
1329 { (eval echo "$as_me:1329: \"$ac_compiler --version </dev/null >&5\"") >&5
1330   (eval $ac_compiler --version </dev/null >&5) 2>&5
1331   ac_status=$?
1332   echo "$as_me:1332: \$? = $ac_status" >&5
1333   (exit $ac_status); }
1334 { (eval echo "$as_me:1334: \"$ac_compiler -v </dev/null >&5\"") >&5
1335   (eval $ac_compiler -v </dev/null >&5) 2>&5
1336   ac_status=$?
1337   echo "$as_me:1337: \$? = $ac_status" >&5
1338   (exit $ac_status); }
1339 { (eval echo "$as_me:1339: \"$ac_compiler -V </dev/null >&5\"") >&5
1340   (eval $ac_compiler -V </dev/null >&5) 2>&5
1341   ac_status=$?
1342   echo "$as_me:1342: \$? = $ac_status" >&5
1343   (exit $ac_status); }
1344
1345 cat >conftest.$ac_ext <<_ACEOF
1346 #line 1346 "configure"
1347 #include "confdefs.h"
1348
1349 int
1350 main (void)
1351 {
1352
1353   ;
1354   return 0;
1355 }
1356 _ACEOF
1357 ac_clean_files_save=$ac_clean_files
1358 ac_clean_files="$ac_clean_files a.out a.exe"
1359 # Try to create an executable without -o first, disregard a.out.
1360 # It will help us diagnose broken compilers, and finding out an intuition
1361 # of exeext.
1362 echo "$as_me:1362: checking for C compiler default output" >&5
1363 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1364 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1365 if { (eval echo "$as_me:1365: \"$ac_link_default\"") >&5
1366   (eval $ac_link_default) 2>&5
1367   ac_status=$?
1368   echo "$as_me:1368: \$? = $ac_status" >&5
1369   (exit $ac_status); }; then
1370   # Find the output, starting from the most likely.  This scheme is
1371 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1372 # resort.
1373 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1374                 ls a.out conftest 2>/dev/null;
1375                 ls a.* conftest.* 2>/dev/null`; do
1376   case $ac_file in
1377     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1378     a.out ) # We found the default executable, but exeext='' is most
1379             # certainly right.
1380             break;;
1381     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1382           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1383           export ac_cv_exeext
1384           break;;
1385     * ) break;;
1386   esac
1387 done
1388 else
1389   echo "$as_me: failed program was:" >&5
1390 cat conftest.$ac_ext >&5
1391 { { echo "$as_me:1391: error: C compiler cannot create executables" >&5
1392 echo "$as_me: error: C compiler cannot create executables" >&2;}
1393    { (exit 77); exit 77; }; }
1394 fi
1395
1396 ac_exeext=$ac_cv_exeext
1397 echo "$as_me:1397: result: $ac_file" >&5
1398 echo "${ECHO_T}$ac_file" >&6
1399
1400 # Check the compiler produces executables we can run.  If not, either
1401 # the compiler is broken, or we cross compile.
1402 echo "$as_me:1402: checking whether the C compiler works" >&5
1403 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1404 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1405 # If not cross compiling, check that we can run a simple program.
1406 if test "$cross_compiling" != yes; then
1407   if { ac_try='./$ac_file'
1408   { (eval echo "$as_me:1408: \"$ac_try\"") >&5
1409   (eval $ac_try) 2>&5
1410   ac_status=$?
1411   echo "$as_me:1411: \$? = $ac_status" >&5
1412   (exit $ac_status); }; }; then
1413     cross_compiling=no
1414   else
1415     if test "$cross_compiling" = maybe; then
1416         cross_compiling=yes
1417     else
1418         { { echo "$as_me:1418: error: cannot run C compiled programs.
1419 If you meant to cross compile, use \`--host'." >&5
1420 echo "$as_me: error: cannot run C compiled programs.
1421 If you meant to cross compile, use \`--host'." >&2;}
1422    { (exit 1); exit 1; }; }
1423     fi
1424   fi
1425 fi
1426 echo "$as_me:1426: result: yes" >&5
1427 echo "${ECHO_T}yes" >&6
1428
1429 rm -f a.out a.exe conftest$ac_cv_exeext
1430 ac_clean_files=$ac_clean_files_save
1431 # Check the compiler produces executables we can run.  If not, either
1432 # the compiler is broken, or we cross compile.
1433 echo "$as_me:1433: checking whether we are cross compiling" >&5
1434 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1435 echo "$as_me:1435: result: $cross_compiling" >&5
1436 echo "${ECHO_T}$cross_compiling" >&6
1437
1438 echo "$as_me:1438: checking for executable suffix" >&5
1439 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1440 if { (eval echo "$as_me:1440: \"$ac_link\"") >&5
1441   (eval $ac_link) 2>&5
1442   ac_status=$?
1443   echo "$as_me:1443: \$? = $ac_status" >&5
1444   (exit $ac_status); }; then
1445   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1446 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1447 # work properly (i.e., refer to `conftest.exe'), while it won't with
1448 # `rm'.
1449 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1450   case $ac_file in
1451     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1452     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1453           export ac_cv_exeext
1454           break;;
1455     * ) break;;
1456   esac
1457 done
1458 else
1459   { { echo "$as_me:1459: error: cannot compute EXEEXT: cannot compile and link" >&5
1460 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1461    { (exit 1); exit 1; }; }
1462 fi
1463
1464 rm -f conftest$ac_cv_exeext
1465 echo "$as_me:1465: result: $ac_cv_exeext" >&5
1466 echo "${ECHO_T}$ac_cv_exeext" >&6
1467
1468 rm -f conftest.$ac_ext
1469 EXEEXT=$ac_cv_exeext
1470 ac_exeext=$EXEEXT
1471 echo "$as_me:1471: checking for object suffix" >&5
1472 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1473 if test "${ac_cv_objext+set}" = set; then
1474   echo $ECHO_N "(cached) $ECHO_C" >&6
1475 else
1476   cat >conftest.$ac_ext <<_ACEOF
1477 #line 1477 "configure"
1478 #include "confdefs.h"
1479
1480 int
1481 main (void)
1482 {
1483
1484   ;
1485   return 0;
1486 }
1487 _ACEOF
1488 rm -f conftest.o conftest.obj
1489 if { (eval echo "$as_me:1489: \"$ac_compile\"") >&5
1490   (eval $ac_compile) 2>&5
1491   ac_status=$?
1492   echo "$as_me:1492: \$? = $ac_status" >&5
1493   (exit $ac_status); }; then
1494   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1495   case $ac_file in
1496     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1497     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1498        break;;
1499   esac
1500 done
1501 else
1502   echo "$as_me: failed program was:" >&5
1503 cat conftest.$ac_ext >&5
1504 { { echo "$as_me:1504: error: cannot compute OBJEXT: cannot compile" >&5
1505 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1506    { (exit 1); exit 1; }; }
1507 fi
1508
1509 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1510 fi
1511 echo "$as_me:1511: result: $ac_cv_objext" >&5
1512 echo "${ECHO_T}$ac_cv_objext" >&6
1513 OBJEXT=$ac_cv_objext
1514 ac_objext=$OBJEXT
1515 echo "$as_me:1515: checking whether we are using the GNU C compiler" >&5
1516 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1517 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1518   echo $ECHO_N "(cached) $ECHO_C" >&6
1519 else
1520   cat >conftest.$ac_ext <<_ACEOF
1521 #line 1521 "configure"
1522 #include "confdefs.h"
1523
1524 int
1525 main (void)
1526 {
1527 #ifndef __GNUC__
1528        choke me
1529 #endif
1530
1531   ;
1532   return 0;
1533 }
1534 _ACEOF
1535 rm -f conftest.$ac_objext
1536 if { (eval echo "$as_me:1536: \"$ac_compile\"") >&5
1537   (eval $ac_compile) 2>&5
1538   ac_status=$?
1539   echo "$as_me:1539: \$? = $ac_status" >&5
1540   (exit $ac_status); } &&
1541          { ac_try='test -s conftest.$ac_objext'
1542   { (eval echo "$as_me:1542: \"$ac_try\"") >&5
1543   (eval $ac_try) 2>&5
1544   ac_status=$?
1545   echo "$as_me:1545: \$? = $ac_status" >&5
1546   (exit $ac_status); }; }; then
1547   ac_compiler_gnu=yes
1548 else
1549   echo "$as_me: failed program was:" >&5
1550 cat conftest.$ac_ext >&5
1551 ac_compiler_gnu=no
1552 fi
1553 rm -f conftest.$ac_objext conftest.$ac_ext
1554 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1555
1556 fi
1557 echo "$as_me:1557: result: $ac_cv_c_compiler_gnu" >&5
1558 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1559 GCC=`test $ac_compiler_gnu = yes && echo yes`
1560 ac_test_CFLAGS=${CFLAGS+set}
1561 ac_save_CFLAGS=$CFLAGS
1562 CFLAGS="-g"
1563 echo "$as_me:1563: checking whether $CC accepts -g" >&5
1564 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1565 if test "${ac_cv_prog_cc_g+set}" = set; then
1566   echo $ECHO_N "(cached) $ECHO_C" >&6
1567 else
1568   cat >conftest.$ac_ext <<_ACEOF
1569 #line 1569 "configure"
1570 #include "confdefs.h"
1571
1572 int
1573 main (void)
1574 {
1575
1576   ;
1577   return 0;
1578 }
1579 _ACEOF
1580 rm -f conftest.$ac_objext
1581 if { (eval echo "$as_me:1581: \"$ac_compile\"") >&5
1582   (eval $ac_compile) 2>&5
1583   ac_status=$?
1584   echo "$as_me:1584: \$? = $ac_status" >&5
1585   (exit $ac_status); } &&
1586          { ac_try='test -s conftest.$ac_objext'
1587   { (eval echo "$as_me:1587: \"$ac_try\"") >&5
1588   (eval $ac_try) 2>&5
1589   ac_status=$?
1590   echo "$as_me:1590: \$? = $ac_status" >&5
1591   (exit $ac_status); }; }; then
1592   ac_cv_prog_cc_g=yes
1593 else
1594   echo "$as_me: failed program was:" >&5
1595 cat conftest.$ac_ext >&5
1596 ac_cv_prog_cc_g=no
1597 fi
1598 rm -f conftest.$ac_objext conftest.$ac_ext
1599 fi
1600 echo "$as_me:1600: result: $ac_cv_prog_cc_g" >&5
1601 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1602 if test "$ac_test_CFLAGS" = set; then
1603   CFLAGS=$ac_save_CFLAGS
1604 elif test $ac_cv_prog_cc_g = yes; then
1605   if test "$GCC" = yes; then
1606     CFLAGS="-g -O2"
1607   else
1608     CFLAGS="-g"
1609   fi
1610 else
1611   if test "$GCC" = yes; then
1612     CFLAGS="-O2"
1613   else
1614     CFLAGS=
1615   fi
1616 fi
1617 # Some people use a C++ compiler to compile C.  Since we use `exit',
1618 # in C++ we need to declare it.  In case someone uses the same compiler
1619 # for both compiling C and C++ we need to have the C++ compiler decide
1620 # the declaration of exit, since it's the most demanding environment.
1621 cat >conftest.$ac_ext <<_ACEOF
1622 #ifndef __cplusplus
1623   choke me
1624 #endif
1625 _ACEOF
1626 rm -f conftest.$ac_objext
1627 if { (eval echo "$as_me:1627: \"$ac_compile\"") >&5
1628   (eval $ac_compile) 2>&5
1629   ac_status=$?
1630   echo "$as_me:1630: \$? = $ac_status" >&5
1631   (exit $ac_status); } &&
1632          { ac_try='test -s conftest.$ac_objext'
1633   { (eval echo "$as_me:1633: \"$ac_try\"") >&5
1634   (eval $ac_try) 2>&5
1635   ac_status=$?
1636   echo "$as_me:1636: \$? = $ac_status" >&5
1637   (exit $ac_status); }; }; then
1638   for ac_declaration in \
1639    ''\
1640    '#include <stdlib.h>' \
1641    'extern "C" void std::exit (int) throw (); using std::exit;' \
1642    'extern "C" void std::exit (int); using std::exit;' \
1643    'extern "C" void exit (int) throw ();' \
1644    'extern "C" void exit (int);' \
1645    'void exit (int);'
1646 do
1647   cat >conftest.$ac_ext <<_ACEOF
1648 #line 1648 "configure"
1649 #include "confdefs.h"
1650 #include <stdlib.h>
1651 $ac_declaration
1652 int
1653 main (void)
1654 {
1655 exit (42);
1656   ;
1657   return 0;
1658 }
1659 _ACEOF
1660 rm -f conftest.$ac_objext
1661 if { (eval echo "$as_me:1661: \"$ac_compile\"") >&5
1662   (eval $ac_compile) 2>&5
1663   ac_status=$?
1664   echo "$as_me:1664: \$? = $ac_status" >&5
1665   (exit $ac_status); } &&
1666          { ac_try='test -s conftest.$ac_objext'
1667   { (eval echo "$as_me:1667: \"$ac_try\"") >&5
1668   (eval $ac_try) 2>&5
1669   ac_status=$?
1670   echo "$as_me:1670: \$? = $ac_status" >&5
1671   (exit $ac_status); }; }; then
1672   :
1673 else
1674   echo "$as_me: failed program was:" >&5
1675 cat conftest.$ac_ext >&5
1676 continue
1677 fi
1678 rm -f conftest.$ac_objext conftest.$ac_ext
1679   cat >conftest.$ac_ext <<_ACEOF
1680 #line 1680 "configure"
1681 #include "confdefs.h"
1682 $ac_declaration
1683 int
1684 main (void)
1685 {
1686 exit (42);
1687   ;
1688   return 0;
1689 }
1690 _ACEOF
1691 rm -f conftest.$ac_objext
1692 if { (eval echo "$as_me:1692: \"$ac_compile\"") >&5
1693   (eval $ac_compile) 2>&5
1694   ac_status=$?
1695   echo "$as_me:1695: \$? = $ac_status" >&5
1696   (exit $ac_status); } &&
1697          { ac_try='test -s conftest.$ac_objext'
1698   { (eval echo "$as_me:1698: \"$ac_try\"") >&5
1699   (eval $ac_try) 2>&5
1700   ac_status=$?
1701   echo "$as_me:1701: \$? = $ac_status" >&5
1702   (exit $ac_status); }; }; then
1703   break
1704 else
1705   echo "$as_me: failed program was:" >&5
1706 cat conftest.$ac_ext >&5
1707 fi
1708 rm -f conftest.$ac_objext conftest.$ac_ext
1709 done
1710 rm -rf conftest*
1711 if test -n "$ac_declaration"; then
1712   echo '#ifdef __cplusplus' >>confdefs.h
1713   echo $ac_declaration      >>confdefs.h
1714   echo '#endif'             >>confdefs.h
1715 fi
1716
1717 else
1718   echo "$as_me: failed program was:" >&5
1719 cat conftest.$ac_ext >&5
1720 fi
1721 rm -f conftest.$ac_objext conftest.$ac_ext
1722 ac_ext=c
1723 ac_cpp='$CPP $CPPFLAGS'
1724 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1725 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1726 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1727 ac_main_return=return
1728
1729 GCC_VERSION=none
1730 if test "$GCC" = yes ; then
1731         echo "$as_me:1731: checking version of $CC" >&5
1732 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1733         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.].*//'`"
1734         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1735         echo "$as_me:1735: result: $GCC_VERSION" >&5
1736 echo "${ECHO_T}$GCC_VERSION" >&6
1737 fi
1738
1739 echo "$as_me:1739: checking for $CC option to accept ANSI C" >&5
1740 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1741 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1742   echo $ECHO_N "(cached) $ECHO_C" >&6
1743 else
1744   ac_cv_prog_cc_stdc=no
1745 ac_save_CC=$CC
1746 cat >conftest.$ac_ext <<_ACEOF
1747 #line 1747 "configure"
1748 #include "confdefs.h"
1749 #include <stdarg.h>
1750 #include <stdio.h>
1751 #include <sys/types.h>
1752 #include <sys/stat.h>
1753 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1754 struct buf { int x; };
1755 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1756 static char *e (p, i)
1757      char **p;
1758      int i;
1759 {
1760   return p[i];
1761 }
1762 static char *f (char * (*g) (char **, int), char **p, ...)
1763 {
1764   char *s;
1765   va_list v;
1766   va_start (v,p);
1767   s = g (p, va_arg (v,int));
1768   va_end (v);
1769   return s;
1770 }
1771 int test (int i, double x);
1772 struct s1 {int (*f) (int a);};
1773 struct s2 {int (*f) (double a);};
1774 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1775 int argc;
1776 char **argv;
1777 int
1778 main (void)
1779 {
1780 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1781   ;
1782   return 0;
1783 }
1784 _ACEOF
1785 # Don't try gcc -ansi; that turns off useful extensions and
1786 # breaks some systems' header files.
1787 # AIX                   -qlanglvl=ansi
1788 # Ultrix and OSF/1      -std1
1789 # HP-UX 10.20 and later -Ae
1790 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1791 # SVR4                  -Xc -D__EXTENSIONS__
1792 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1793 do
1794   CC="$ac_save_CC $ac_arg"
1795   rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   ac_cv_prog_cc_stdc=$ac_arg
1808 break
1809 else
1810   echo "$as_me: failed program was:" >&5
1811 cat conftest.$ac_ext >&5
1812 fi
1813 rm -f conftest.$ac_objext
1814 done
1815 rm -f conftest.$ac_ext conftest.$ac_objext
1816 CC=$ac_save_CC
1817
1818 fi
1819
1820 case "x$ac_cv_prog_cc_stdc" in
1821   x|xno)
1822     echo "$as_me:1822: result: none needed" >&5
1823 echo "${ECHO_T}none needed" >&6 ;;
1824   *)
1825     echo "$as_me:1825: result: $ac_cv_prog_cc_stdc" >&5
1826 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1827     CC="$CC $ac_cv_prog_cc_stdc" ;;
1828 esac
1829
1830 # This should have been defined by AC_PROG_CC
1831 : ${CC:=cc}
1832
1833 echo "$as_me:1833: checking \$CFLAGS variable" >&5
1834 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1835 case "x$CFLAGS" in
1836 (*-[IUD]*)
1837         echo "$as_me:1837: result: broken" >&5
1838 echo "${ECHO_T}broken" >&6
1839         { echo "$as_me:1839: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1840 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1841         cf_flags="$CFLAGS"
1842         CFLAGS=
1843         for cf_arg in $cf_flags
1844         do
1845
1846 cf_fix_cppflags=no
1847 cf_new_cflags=
1848 cf_new_cppflags=
1849 cf_new_extra_cppflags=
1850
1851 for cf_add_cflags in $cf_arg
1852 do
1853 case $cf_fix_cppflags in
1854 (no)
1855         case $cf_add_cflags in
1856         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1857                 case $cf_add_cflags in
1858                 (-D*)
1859                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1860
1861                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1862                                 && test -z "${cf_tst_cflags}" \
1863                                 && cf_fix_cppflags=yes
1864
1865                         if test $cf_fix_cppflags = yes ; then
1866
1867         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1868         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1869
1870                                 continue
1871                         elif test "${cf_tst_cflags}" = "\"'" ; then
1872
1873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1875
1876                                 continue
1877                         fi
1878                         ;;
1879                 esac
1880                 case "$CPPFLAGS" in
1881                 (*$cf_add_cflags)
1882                         ;;
1883                 (*)
1884                         case $cf_add_cflags in
1885                         (-D*)
1886                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1887
1888 CPPFLAGS=`echo "$CPPFLAGS" | \
1889         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1890                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1891
1892                                 ;;
1893                         esac
1894
1895         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
1896         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
1897
1898                         ;;
1899                 esac
1900                 ;;
1901         (*)
1902
1903         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
1904         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
1905
1906                 ;;
1907         esac
1908         ;;
1909 (yes)
1910
1911         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1912         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1913
1914         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1915
1916         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1917                 && test -z "${cf_tst_cflags}" \
1918                 && cf_fix_cppflags=no
1919         ;;
1920 esac
1921 done
1922
1923 if test -n "$cf_new_cflags" ; then
1924
1925         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1926         CFLAGS="${CFLAGS}$cf_new_cflags"
1927
1928 fi
1929
1930 if test -n "$cf_new_cppflags" ; then
1931
1932         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
1933         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
1934
1935 fi
1936
1937 if test -n "$cf_new_extra_cppflags" ; then
1938
1939         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
1940         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
1941
1942 fi
1943
1944         done
1945         ;;
1946 (*)
1947         echo "$as_me:1947: result: ok" >&5
1948 echo "${ECHO_T}ok" >&6
1949         ;;
1950 esac
1951
1952 echo "$as_me:1952: checking \$CC variable" >&5
1953 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1954 case "$CC" in
1955 (*[\ \  ]-*)
1956         echo "$as_me:1956: result: broken" >&5
1957 echo "${ECHO_T}broken" >&6
1958         { echo "$as_me:1958: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1959 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1960         # humor him...
1961         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1962         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1963         CC="$cf_prog"
1964         for cf_arg in $cf_flags
1965         do
1966                 case "x$cf_arg" in
1967                 (x-[IUDfgOW]*)
1968
1969 cf_fix_cppflags=no
1970 cf_new_cflags=
1971 cf_new_cppflags=
1972 cf_new_extra_cppflags=
1973
1974 for cf_add_cflags in $cf_arg
1975 do
1976 case $cf_fix_cppflags in
1977 (no)
1978         case $cf_add_cflags in
1979         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1980                 case $cf_add_cflags in
1981                 (-D*)
1982                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1983
1984                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1985                                 && test -z "${cf_tst_cflags}" \
1986                                 && cf_fix_cppflags=yes
1987
1988                         if test $cf_fix_cppflags = yes ; then
1989
1990         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1991         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1992
1993                                 continue
1994                         elif test "${cf_tst_cflags}" = "\"'" ; then
1995
1996         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1997         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1998
1999                                 continue
2000                         fi
2001                         ;;
2002                 esac
2003                 case "$CPPFLAGS" in
2004                 (*$cf_add_cflags)
2005                         ;;
2006                 (*)
2007                         case $cf_add_cflags in
2008                         (-D*)
2009                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2010
2011 CPPFLAGS=`echo "$CPPFLAGS" | \
2012         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2013                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2014
2015                                 ;;
2016                         esac
2017
2018         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2019         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2020
2021                         ;;
2022                 esac
2023                 ;;
2024         (*)
2025
2026         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2027         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2028
2029                 ;;
2030         esac
2031         ;;
2032 (yes)
2033
2034         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2035         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2036
2037         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2038
2039         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2040                 && test -z "${cf_tst_cflags}" \
2041                 && cf_fix_cppflags=no
2042         ;;
2043 esac
2044 done
2045
2046 if test -n "$cf_new_cflags" ; then
2047
2048         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2049         CFLAGS="${CFLAGS}$cf_new_cflags"
2050
2051 fi
2052
2053 if test -n "$cf_new_cppflags" ; then
2054
2055         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2056         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2057
2058 fi
2059
2060 if test -n "$cf_new_extra_cppflags" ; then
2061
2062         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2063         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2064
2065 fi
2066
2067                         ;;
2068                 (*)
2069                         CC="$CC $cf_arg"
2070                         ;;
2071                 esac
2072         done
2073         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2074
2075 echo "${as_me:-configure}:2075: testing resulting CC: '$CC' ..." 1>&5
2076
2077         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2078
2079 echo "${as_me:-configure}:2079: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2080
2081         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2082
2083 echo "${as_me:-configure}:2083: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2084
2085         ;;
2086 (*)
2087         echo "$as_me:2087: result: ok" >&5
2088 echo "${ECHO_T}ok" >&6
2089         ;;
2090 esac
2091
2092 ac_ext=c
2093 ac_cpp='$CPP $CPPFLAGS'
2094 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2095 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2096 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2097 ac_main_return=return
2098 echo "$as_me:2098: checking how to run the C preprocessor" >&5
2099 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2100 # On Suns, sometimes $CPP names a directory.
2101 if test -n "$CPP" && test -d "$CPP"; then
2102   CPP=
2103 fi
2104 if test -z "$CPP"; then
2105   if test "${ac_cv_prog_CPP+set}" = set; then
2106   echo $ECHO_N "(cached) $ECHO_C" >&6
2107 else
2108       # Double quotes because CPP needs to be expanded
2109     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2110     do
2111       ac_preproc_ok=false
2112 for ac_c_preproc_warn_flag in '' yes
2113 do
2114   # Use a header file that comes with gcc, so configuring glibc
2115   # with a fresh cross-compiler works.
2116   # On the NeXT, cc -E runs the code through the compiler's parser,
2117   # not just through cpp. "Syntax error" is here to catch this case.
2118   cat >conftest.$ac_ext <<_ACEOF
2119 #line 2119 "configure"
2120 #include "confdefs.h"
2121 #include <assert.h>
2122                      Syntax error
2123 _ACEOF
2124 if { (eval echo "$as_me:2124: \"$ac_cpp conftest.$ac_ext\"") >&5
2125   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2126   ac_status=$?
2127   egrep -v '^ *\+' conftest.er1 >conftest.err
2128   rm -f conftest.er1
2129   cat conftest.err >&5
2130   echo "$as_me:2130: \$? = $ac_status" >&5
2131   (exit $ac_status); } >/dev/null; then
2132   if test -s conftest.err; then
2133     ac_cpp_err=$ac_c_preproc_warn_flag
2134   else
2135     ac_cpp_err=
2136   fi
2137 else
2138   ac_cpp_err=yes
2139 fi
2140 if test -z "$ac_cpp_err"; then
2141   :
2142 else
2143   echo "$as_me: failed program was:" >&5
2144   cat conftest.$ac_ext >&5
2145   # Broken: fails on valid input.
2146 continue
2147 fi
2148 rm -f conftest.err conftest.$ac_ext
2149
2150   # OK, works on sane cases.  Now check whether non-existent headers
2151   # can be detected and how.
2152   cat >conftest.$ac_ext <<_ACEOF
2153 #line 2153 "configure"
2154 #include "confdefs.h"
2155 #include <ac_nonexistent.h>
2156 _ACEOF
2157 if { (eval echo "$as_me:2157: \"$ac_cpp conftest.$ac_ext\"") >&5
2158   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2159   ac_status=$?
2160   egrep -v '^ *\+' conftest.er1 >conftest.err
2161   rm -f conftest.er1
2162   cat conftest.err >&5
2163   echo "$as_me:2163: \$? = $ac_status" >&5
2164   (exit $ac_status); } >/dev/null; then
2165   if test -s conftest.err; then
2166     ac_cpp_err=$ac_c_preproc_warn_flag
2167   else
2168     ac_cpp_err=
2169   fi
2170 else
2171   ac_cpp_err=yes
2172 fi
2173 if test -z "$ac_cpp_err"; then
2174   # Broken: success on invalid input.
2175 continue
2176 else
2177   echo "$as_me: failed program was:" >&5
2178   cat conftest.$ac_ext >&5
2179   # Passes both tests.
2180 ac_preproc_ok=:
2181 break
2182 fi
2183 rm -f conftest.err conftest.$ac_ext
2184
2185 done
2186 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2187 rm -f conftest.err conftest.$ac_ext
2188 if $ac_preproc_ok; then
2189   break
2190 fi
2191
2192     done
2193     ac_cv_prog_CPP=$CPP
2194
2195 fi
2196   CPP=$ac_cv_prog_CPP
2197 else
2198   ac_cv_prog_CPP=$CPP
2199 fi
2200 echo "$as_me:2200: result: $CPP" >&5
2201 echo "${ECHO_T}$CPP" >&6
2202 ac_preproc_ok=false
2203 for ac_c_preproc_warn_flag in '' yes
2204 do
2205   # Use a header file that comes with gcc, so configuring glibc
2206   # with a fresh cross-compiler works.
2207   # On the NeXT, cc -E runs the code through the compiler's parser,
2208   # not just through cpp. "Syntax error" is here to catch this case.
2209   cat >conftest.$ac_ext <<_ACEOF
2210 #line 2210 "configure"
2211 #include "confdefs.h"
2212 #include <assert.h>
2213                      Syntax error
2214 _ACEOF
2215 if { (eval echo "$as_me:2215: \"$ac_cpp conftest.$ac_ext\"") >&5
2216   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2217   ac_status=$?
2218   egrep -v '^ *\+' conftest.er1 >conftest.err
2219   rm -f conftest.er1
2220   cat conftest.err >&5
2221   echo "$as_me:2221: \$? = $ac_status" >&5
2222   (exit $ac_status); } >/dev/null; then
2223   if test -s conftest.err; then
2224     ac_cpp_err=$ac_c_preproc_warn_flag
2225   else
2226     ac_cpp_err=
2227   fi
2228 else
2229   ac_cpp_err=yes
2230 fi
2231 if test -z "$ac_cpp_err"; then
2232   :
2233 else
2234   echo "$as_me: failed program was:" >&5
2235   cat conftest.$ac_ext >&5
2236   # Broken: fails on valid input.
2237 continue
2238 fi
2239 rm -f conftest.err conftest.$ac_ext
2240
2241   # OK, works on sane cases.  Now check whether non-existent headers
2242   # can be detected and how.
2243   cat >conftest.$ac_ext <<_ACEOF
2244 #line 2244 "configure"
2245 #include "confdefs.h"
2246 #include <ac_nonexistent.h>
2247 _ACEOF
2248 if { (eval echo "$as_me:2248: \"$ac_cpp conftest.$ac_ext\"") >&5
2249   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2250   ac_status=$?
2251   egrep -v '^ *\+' conftest.er1 >conftest.err
2252   rm -f conftest.er1
2253   cat conftest.err >&5
2254   echo "$as_me:2254: \$? = $ac_status" >&5
2255   (exit $ac_status); } >/dev/null; then
2256   if test -s conftest.err; then
2257     ac_cpp_err=$ac_c_preproc_warn_flag
2258   else
2259     ac_cpp_err=
2260   fi
2261 else
2262   ac_cpp_err=yes
2263 fi
2264 if test -z "$ac_cpp_err"; then
2265   # Broken: success on invalid input.
2266 continue
2267 else
2268   echo "$as_me: failed program was:" >&5
2269   cat conftest.$ac_ext >&5
2270   # Passes both tests.
2271 ac_preproc_ok=:
2272 break
2273 fi
2274 rm -f conftest.err conftest.$ac_ext
2275
2276 done
2277 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2278 rm -f conftest.err conftest.$ac_ext
2279 if $ac_preproc_ok; then
2280   :
2281 else
2282   { { echo "$as_me:2282: error: C preprocessor \"$CPP\" fails sanity check" >&5
2283 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2284    { (exit 1); exit 1; }; }
2285 fi
2286
2287 ac_ext=c
2288 ac_cpp='$CPP $CPPFLAGS'
2289 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2290 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2291 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2292 ac_main_return=return
2293
2294 if test $ac_cv_c_compiler_gnu = yes; then
2295     echo "$as_me:2295: checking whether $CC needs -traditional" >&5
2296 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2297 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2298   echo $ECHO_N "(cached) $ECHO_C" >&6
2299 else
2300     ac_pattern="Autoconf.*'x'"
2301   cat >conftest.$ac_ext <<_ACEOF
2302 #line 2302 "configure"
2303 #include "confdefs.h"
2304 #include <sgtty.h>
2305 int Autoconf = TIOCGETP;
2306 _ACEOF
2307 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2308   egrep "$ac_pattern" >/dev/null 2>&1; then
2309   ac_cv_prog_gcc_traditional=yes
2310 else
2311   ac_cv_prog_gcc_traditional=no
2312 fi
2313 rm -rf conftest*
2314
2315   if test $ac_cv_prog_gcc_traditional = no; then
2316     cat >conftest.$ac_ext <<_ACEOF
2317 #line 2317 "configure"
2318 #include "confdefs.h"
2319 #include <termio.h>
2320 int Autoconf = TCGETA;
2321 _ACEOF
2322 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2323   egrep "$ac_pattern" >/dev/null 2>&1; then
2324   ac_cv_prog_gcc_traditional=yes
2325 fi
2326 rm -rf conftest*
2327
2328   fi
2329 fi
2330 echo "$as_me:2330: result: $ac_cv_prog_gcc_traditional" >&5
2331 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2332   if test $ac_cv_prog_gcc_traditional = yes; then
2333     CC="$CC -traditional"
2334   fi
2335 fi
2336
2337 echo "$as_me:2337: checking whether $CC understands -c and -o together" >&5
2338 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2339 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2340   echo $ECHO_N "(cached) $ECHO_C" >&6
2341 else
2342
2343 cat > conftest.$ac_ext <<CF_EOF
2344 int main(void)
2345 {
2346         ${cf_cv_main_return:-return}(0);
2347 }
2348 CF_EOF
2349 # We do the test twice because some compilers refuse to overwrite an
2350 # existing .o file with -o, though they will create one.
2351 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2352 if { (eval echo "$as_me:2352: \"$ac_try\"") >&5
2353   (eval $ac_try) 2>&5
2354   ac_status=$?
2355   echo "$as_me:2355: \$? = $ac_status" >&5
2356   (exit $ac_status); } &&
2357   test -f conftest2.$ac_objext && { (eval echo "$as_me:2357: \"$ac_try\"") >&5
2358   (eval $ac_try) 2>&5
2359   ac_status=$?
2360   echo "$as_me:2360: \$? = $ac_status" >&5
2361   (exit $ac_status); };
2362 then
2363   eval cf_cv_prog_CC_c_o=yes
2364 else
2365   eval cf_cv_prog_CC_c_o=no
2366 fi
2367 rm -rf conftest*
2368
2369 fi
2370 if test $cf_cv_prog_CC_c_o = yes; then
2371   echo "$as_me:2371: result: yes" >&5
2372 echo "${ECHO_T}yes" >&6
2373 else
2374   echo "$as_me:2374: result: no" >&5
2375 echo "${ECHO_T}no" >&6
2376 fi
2377
2378 test "$program_prefix" != NONE &&
2379   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2380 # Use a double $ so make ignores it.
2381 test "$program_suffix" != NONE &&
2382   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2383 # Double any \ or $.  echo might interpret backslashes.
2384 # By default was `s,x,x', remove it if useless.
2385 cat <<\_ACEOF >conftest.sed
2386 s/[\\$]/&&/g;s/;s,x,x,$//
2387 _ACEOF
2388 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2389 rm conftest.sed
2390
2391 for ac_prog in mawk gawk nawk awk
2392 do
2393   # Extract the first word of "$ac_prog", so it can be a program name with args.
2394 set dummy $ac_prog; ac_word=$2
2395 echo "$as_me:2395: checking for $ac_word" >&5
2396 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2397 if test "${ac_cv_prog_AWK+set}" = set; then
2398   echo $ECHO_N "(cached) $ECHO_C" >&6
2399 else
2400   if test -n "$AWK"; then
2401   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2402 else
2403   ac_save_IFS=$IFS; IFS=$ac_path_separator
2404 ac_dummy="$PATH"
2405 for ac_dir in $ac_dummy; do
2406   IFS=$ac_save_IFS
2407   test -z "$ac_dir" && ac_dir=.
2408   $as_executable_p "$ac_dir/$ac_word" || continue
2409 ac_cv_prog_AWK="$ac_prog"
2410 echo "$as_me:2410: found $ac_dir/$ac_word" >&5
2411 break
2412 done
2413
2414 fi
2415 fi
2416 AWK=$ac_cv_prog_AWK
2417 if test -n "$AWK"; then
2418   echo "$as_me:2418: result: $AWK" >&5
2419 echo "${ECHO_T}$AWK" >&6
2420 else
2421   echo "$as_me:2421: result: no" >&5
2422 echo "${ECHO_T}no" >&6
2423 fi
2424
2425   test -n "$AWK" && break
2426 done
2427
2428 test -z "$AWK" && { { echo "$as_me:2428: error: No awk program found" >&5
2429 echo "$as_me: error: No awk program found" >&2;}
2430    { (exit 1); exit 1; }; }
2431
2432 echo "$as_me:2432: checking for egrep" >&5
2433 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2434 if test "${ac_cv_prog_egrep+set}" = set; then
2435   echo $ECHO_N "(cached) $ECHO_C" >&6
2436 else
2437   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2438                 then ac_cv_prog_egrep='grep -E'
2439                 else ac_cv_prog_egrep='egrep'
2440         fi
2441 fi
2442 echo "$as_me:2442: result: $ac_cv_prog_egrep" >&5
2443 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2444         EGREP=$ac_cv_prog_egrep
2445
2446         test -z "$EGREP" && { { echo "$as_me:2446: error: No egrep program found" >&5
2447 echo "$as_me: error: No egrep program found" >&2;}
2448    { (exit 1); exit 1; }; }
2449
2450 # Find a good install program.  We prefer a C program (faster),
2451 # so one script is as good as another.  But avoid the broken or
2452 # incompatible versions:
2453 # SysV /etc/install, /usr/sbin/install
2454 # SunOS /usr/etc/install
2455 # IRIX /sbin/install
2456 # AIX /bin/install
2457 # AmigaOS /C/install, which installs bootblocks on floppy discs
2458 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2459 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2460 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2461 # ./install, which can be erroneously created by make from ./install.sh.
2462 echo "$as_me:2462: checking for a BSD compatible install" >&5
2463 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2464 if test -z "$INSTALL"; then
2465 if test "${ac_cv_path_install+set}" = set; then
2466   echo $ECHO_N "(cached) $ECHO_C" >&6
2467 else
2468     ac_save_IFS=$IFS; IFS=$ac_path_separator
2469   for ac_dir in $PATH; do
2470     IFS=$ac_save_IFS
2471     # Account for people who put trailing slashes in PATH elements.
2472     case $ac_dir/ in
2473     / | ./ | .// | /cC/* \
2474     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2475     | /usr/ucb/* ) ;;
2476     *)
2477       # OSF1 and SCO ODT 3.0 have their own names for install.
2478       # Don't use installbsd from OSF since it installs stuff as root
2479       # by default.
2480       for ac_prog in ginstall scoinst install; do
2481         if $as_executable_p "$ac_dir/$ac_prog"; then
2482           if test $ac_prog = install &&
2483             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2484             # AIX install.  It has an incompatible calling convention.
2485             :
2486           elif test $ac_prog = install &&
2487             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2488             # program-specific install script used by HP pwplus--don't use.
2489             :
2490           else
2491             ac_cv_path_install="$ac_dir/$ac_prog -c"
2492             break 2
2493           fi
2494         fi
2495       done
2496       ;;
2497     esac
2498   done
2499
2500 fi
2501   if test "${ac_cv_path_install+set}" = set; then
2502     INSTALL=$ac_cv_path_install
2503   else
2504     # As a last resort, use the slow shell script.  We don't cache a
2505     # path for INSTALL within a source directory, because that will
2506     # break other packages using the cache if that directory is
2507     # removed, or if the path is relative.
2508     INSTALL=$ac_install_sh
2509   fi
2510 fi
2511 echo "$as_me:2511: result: $INSTALL" >&5
2512 echo "${ECHO_T}$INSTALL" >&6
2513
2514 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2515 # It thinks the first close brace ends the variable substitution.
2516 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2517
2518 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2519
2520 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2521
2522 echo "$as_me:2522: checking whether ln -s works" >&5
2523 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2524 LN_S=$as_ln_s
2525 if test "$LN_S" = "ln -s"; then
2526   echo "$as_me:2526: result: yes" >&5
2527 echo "${ECHO_T}yes" >&6
2528 else
2529   echo "$as_me:2529: result: no, using $LN_S" >&5
2530 echo "${ECHO_T}no, using $LN_S" >&6
2531 fi
2532
2533 echo "$as_me:2533: checking if $LN_S -f options work" >&5
2534 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2535
2536 rm -f conf$$.src conf$$dst
2537 echo >conf$$.dst
2538 echo first >conf$$.src
2539 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2540         cf_prog_ln_sf=yes
2541 else
2542         cf_prog_ln_sf=no
2543 fi
2544 rm -f conf$$.dst conf$$src
2545 echo "$as_me:2545: result: $cf_prog_ln_sf" >&5
2546 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2547
2548 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2549
2550 # Find a good install program.  We prefer a C program (faster),
2551 # so one script is as good as another.  But avoid the broken or
2552 # incompatible versions:
2553 # SysV /etc/install, /usr/sbin/install
2554 # SunOS /usr/etc/install
2555 # IRIX /sbin/install
2556 # AIX /bin/install
2557 # AmigaOS /C/install, which installs bootblocks on floppy discs
2558 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2559 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2560 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2561 # ./install, which can be erroneously created by make from ./install.sh.
2562 echo "$as_me:2562: checking for a BSD compatible install" >&5
2563 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2564 if test -z "$INSTALL"; then
2565 if test "${ac_cv_path_install+set}" = set; then
2566   echo $ECHO_N "(cached) $ECHO_C" >&6
2567 else
2568     ac_save_IFS=$IFS; IFS=$ac_path_separator
2569   for ac_dir in $PATH; do
2570     IFS=$ac_save_IFS
2571     # Account for people who put trailing slashes in PATH elements.
2572     case $ac_dir/ in
2573     / | ./ | .// | /cC/* \
2574     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2575     | /usr/ucb/* ) ;;
2576     *)
2577       # OSF1 and SCO ODT 3.0 have their own names for install.
2578       # Don't use installbsd from OSF since it installs stuff as root
2579       # by default.
2580       for ac_prog in ginstall scoinst install; do
2581         if $as_executable_p "$ac_dir/$ac_prog"; then
2582           if test $ac_prog = install &&
2583             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2584             # AIX install.  It has an incompatible calling convention.
2585             :
2586           elif test $ac_prog = install &&
2587             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2588             # program-specific install script used by HP pwplus--don't use.
2589             :
2590           else
2591             ac_cv_path_install="$ac_dir/$ac_prog -c"
2592             break 2
2593           fi
2594         fi
2595       done
2596       ;;
2597     esac
2598   done
2599
2600 fi
2601   if test "${ac_cv_path_install+set}" = set; then
2602     INSTALL=$ac_cv_path_install
2603   else
2604     # As a last resort, use the slow shell script.  We don't cache a
2605     # path for INSTALL within a source directory, because that will
2606     # break other packages using the cache if that directory is
2607     # removed, or if the path is relative.
2608     INSTALL=$ac_install_sh
2609   fi
2610 fi
2611 echo "$as_me:2611: result: $INSTALL" >&5
2612 echo "${ECHO_T}$INSTALL" >&6
2613
2614 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2615 # It thinks the first close brace ends the variable substitution.
2616 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2617
2618 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2619
2620 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2621
2622 case $INSTALL in
2623 (/*)
2624         ;;
2625 (*)
2626         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2627         test -z "$cf_dir" && cf_dir=.
2628         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2629         ;;
2630 esac
2631
2632 echo "$as_me:2632: checking if you want to install stripped executables" >&5
2633 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2634
2635 # Check whether --enable-stripping or --disable-stripping was given.
2636 if test "${enable_stripping+set}" = set; then
2637   enableval="$enable_stripping"
2638   test "$enableval" != no && enableval=yes
2639         if test "$enableval" != "yes" ; then
2640     with_stripping=no
2641         else
2642                 with_stripping=yes
2643         fi
2644 else
2645   enableval=yes
2646         with_stripping=yes
2647
2648 fi;
2649 echo "$as_me:2649: result: $with_stripping" >&5
2650 echo "${ECHO_T}$with_stripping" >&6
2651
2652 if test "$with_stripping" = yes
2653 then
2654         INSTALL_OPT_S="-s"
2655 else
2656         INSTALL_OPT_S=
2657 fi
2658
2659 : ${INSTALL:=install}
2660 echo "$as_me:2660: checking if install accepts -p option" >&5
2661 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2662 if test "${cf_cv_install_p+set}" = set; then
2663   echo $ECHO_N "(cached) $ECHO_C" >&6
2664 else
2665
2666         rm -rf conftest*
2667         date >conftest.in
2668         mkdir conftest.out
2669         sleep 3
2670         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2671         then
2672                 if test -f conftest.out/conftest.in
2673                 then
2674                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2675                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2676                         if test -s conftest.err
2677                         then
2678                                 cf_cv_install_p=no
2679                         else
2680                                 cf_cv_install_p=yes
2681                         fi
2682                 else
2683                         cf_cv_install_p=no
2684                 fi
2685         else
2686                 cf_cv_install_p=no
2687         fi
2688         rm -rf conftest*
2689
2690 fi
2691 echo "$as_me:2691: result: $cf_cv_install_p" >&5
2692 echo "${ECHO_T}$cf_cv_install_p" >&6
2693
2694 echo "$as_me:2694: checking if install needs to be told about ownership" >&5
2695 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2696 case `$ac_config_guess` in
2697 (*minix)
2698         with_install_o=yes
2699         ;;
2700 (*)
2701         with_install_o=no
2702         ;;
2703 esac
2704
2705 echo "$as_me:2705: result: $with_install_o" >&5
2706 echo "${ECHO_T}$with_install_o" >&6
2707 if test "x$with_install_o" = xyes
2708 then
2709         INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
2710 else
2711         INSTALL_OPT_O=
2712 fi
2713
2714 echo "$as_me:2714: checking for long file names" >&5
2715 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2716 if test "${ac_cv_sys_long_file_names+set}" = set; then
2717   echo $ECHO_N "(cached) $ECHO_C" >&6
2718 else
2719   ac_cv_sys_long_file_names=yes
2720 # Test for long file names in all the places we know might matter:
2721 #      .                the current directory, where building will happen
2722 #      $prefix/lib      where we will be installing things
2723 #      $exec_prefix/lib likewise
2724 # eval it to expand exec_prefix.
2725 #      $TMPDIR          if set, where it might want to write temporary files
2726 # if $TMPDIR is not set:
2727 #      /tmp             where it might want to write temporary files
2728 #      /var/tmp         likewise
2729 #      /usr/tmp         likewise
2730 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2731   ac_tmpdirs=$TMPDIR
2732 else
2733   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2734 fi
2735 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2736   test -d $ac_dir || continue
2737   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2738   ac_xdir=$ac_dir/cf$$
2739   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2740   ac_tf1=$ac_xdir/conftest9012345
2741   ac_tf2=$ac_xdir/conftest9012346
2742   (echo 1 >$ac_tf1) 2>/dev/null
2743   (echo 2 >$ac_tf2) 2>/dev/null
2744   ac_val=`cat $ac_tf1 2>/dev/null`
2745   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2746     ac_cv_sys_long_file_names=no
2747     rm -rf $ac_xdir 2>/dev/null
2748     break
2749   fi
2750   rm -rf $ac_xdir 2>/dev/null
2751 done
2752 fi
2753 echo "$as_me:2753: result: $ac_cv_sys_long_file_names" >&5
2754 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2755 if test $ac_cv_sys_long_file_names = yes; then
2756
2757 cat >>confdefs.h <<\EOF
2758 #define HAVE_LONG_FILE_NAMES 1
2759 EOF
2760
2761 fi
2762
2763 # if we find pkg-config, check if we should install the ".pc" files.
2764
2765 echo "$as_me:2765: checking if you want to use pkg-config" >&5
2766 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2767
2768 # Check whether --with-pkg-config or --without-pkg-config was given.
2769 if test "${with_pkg_config+set}" = set; then
2770   withval="$with_pkg_config"
2771   cf_pkg_config=$withval
2772 else
2773   cf_pkg_config=yes
2774 fi;
2775 echo "$as_me:2775: result: $cf_pkg_config" >&5
2776 echo "${ECHO_T}$cf_pkg_config" >&6
2777
2778 case $cf_pkg_config in
2779 (no)
2780         PKG_CONFIG=none
2781         ;;
2782 (yes)
2783
2784 if test -n "$ac_tool_prefix"; then
2785   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2786 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2787 echo "$as_me:2787: checking for $ac_word" >&5
2788 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2789 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2790   echo $ECHO_N "(cached) $ECHO_C" >&6
2791 else
2792   case $PKG_CONFIG in
2793   [\\/]* | ?:[\\/]*)
2794   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2795   ;;
2796   *)
2797   ac_save_IFS=$IFS; IFS=$ac_path_separator
2798 ac_dummy="$PATH"
2799 for ac_dir in $ac_dummy; do
2800   IFS=$ac_save_IFS
2801   test -z "$ac_dir" && ac_dir=.
2802   if $as_executable_p "$ac_dir/$ac_word"; then
2803    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2804    echo "$as_me:2804: found $ac_dir/$ac_word" >&5
2805    break
2806 fi
2807 done
2808
2809   ;;
2810 esac
2811 fi
2812 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2813
2814 if test -n "$PKG_CONFIG"; then
2815   echo "$as_me:2815: result: $PKG_CONFIG" >&5
2816 echo "${ECHO_T}$PKG_CONFIG" >&6
2817 else
2818   echo "$as_me:2818: result: no" >&5
2819 echo "${ECHO_T}no" >&6
2820 fi
2821
2822 fi
2823 if test -z "$ac_cv_path_PKG_CONFIG"; then
2824   ac_pt_PKG_CONFIG=$PKG_CONFIG
2825   # Extract the first word of "pkg-config", so it can be a program name with args.
2826 set dummy pkg-config; ac_word=$2
2827 echo "$as_me:2827: checking for $ac_word" >&5
2828 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2829 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2830   echo $ECHO_N "(cached) $ECHO_C" >&6
2831 else
2832   case $ac_pt_PKG_CONFIG in
2833   [\\/]* | ?:[\\/]*)
2834   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2835   ;;
2836   *)
2837   ac_save_IFS=$IFS; IFS=$ac_path_separator
2838 ac_dummy="$PATH"
2839 for ac_dir in $ac_dummy; do
2840   IFS=$ac_save_IFS
2841   test -z "$ac_dir" && ac_dir=.
2842   if $as_executable_p "$ac_dir/$ac_word"; then
2843    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2844    echo "$as_me:2844: found $ac_dir/$ac_word" >&5
2845    break
2846 fi
2847 done
2848
2849   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2850   ;;
2851 esac
2852 fi
2853 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2854
2855 if test -n "$ac_pt_PKG_CONFIG"; then
2856   echo "$as_me:2856: result: $ac_pt_PKG_CONFIG" >&5
2857 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2858 else
2859   echo "$as_me:2859: result: no" >&5
2860 echo "${ECHO_T}no" >&6
2861 fi
2862
2863   PKG_CONFIG=$ac_pt_PKG_CONFIG
2864 else
2865   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2866 fi
2867
2868         ;;
2869 (*)
2870         PKG_CONFIG=$withval
2871         ;;
2872 esac
2873
2874 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2875 if test "$PKG_CONFIG" != none ; then
2876
2877 if test "x$prefix" != xNONE; then
2878         cf_path_syntax="$prefix"
2879 else
2880         cf_path_syntax="$ac_default_prefix"
2881 fi
2882
2883 case ".$PKG_CONFIG" in
2884 (.\$\(*\)*|.\'*\'*)
2885         ;;
2886 (..|./*|.\\*)
2887         ;;
2888 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2889         ;;
2890 (.\${*prefix}*|.\${*dir}*)
2891         eval PKG_CONFIG="$PKG_CONFIG"
2892         case ".$PKG_CONFIG" in
2893         (.NONE/*)
2894                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2895                 ;;
2896         esac
2897         ;;
2898 (.no|.NONE/*)
2899         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2900         ;;
2901 (*)
2902         { { echo "$as_me:2902: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2903 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2904    { (exit 1); exit 1; }; }
2905         ;;
2906 esac
2907
2908 elif test "x$cf_pkg_config" != xno ; then
2909         { echo "$as_me:2909: WARNING: pkg-config is not installed" >&5
2910 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2911 fi
2912
2913 case $PKG_CONFIG in
2914 (no|none|yes)
2915         echo "$as_me:2915: checking for pkg-config library directory" >&5
2916 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2917         ;;
2918 (*)
2919         echo "$as_me:2919: checking for $PKG_CONFIG library directory" >&5
2920 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2921         ;;
2922 esac
2923
2924 PKG_CONFIG_LIBDIR=no
2925
2926 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2927 if test "${with_pkg_config_libdir+set}" = set; then
2928   withval="$with_pkg_config_libdir"
2929   PKG_CONFIG_LIBDIR=$withval
2930 else
2931   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2932 fi;
2933
2934 case x$PKG_CONFIG_LIBDIR in
2935 (x/*)
2936         ;;
2937 (xyes)
2938         # Look for the library directory using the same prefix as the executable
2939         if test "x$PKG_CONFIG" = xnone
2940         then
2941                 cf_path=$prefix
2942         else
2943                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2944         fi
2945
2946         # If you don't like using the default architecture, you have to specify the
2947         # intended library directory and corresponding compiler/linker options.
2948         #
2949         # This case allows for Debian's 2014-flavor of multiarch, along with the
2950         # most common variations before that point.  Some other variants spell the
2951         # directory differently, e.g., "pkg-config", and put it in unusual places.
2952         # pkg-config has always been poorly standardized, which is ironic...
2953         case x`(arch) 2>/dev/null` in
2954         (*64)
2955                 cf_search_path="\
2956                         $cf_path/lib/*64-linux-gnu \
2957                         $cf_path/share \
2958                         $cf_path/lib64 \
2959                         $cf_path/lib32 \
2960                         $cf_path/lib"
2961                 ;;
2962         (*)
2963                 cf_search_path="\
2964                         $cf_path/lib/*-linux-gnu \
2965                         $cf_path/share \
2966                         $cf_path/lib32 \
2967                         $cf_path/lib \
2968                         $cf_path/libdata"
2969                 ;;
2970         esac
2971
2972         test -n "$verbose" && echo "    list..." 1>&6
2973
2974 echo "${as_me:-configure}:2974: testing list... ..." 1>&5
2975
2976         for cf_config in $cf_search_path
2977         do
2978                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2979
2980 echo "${as_me:-configure}:2980: testing checking $cf_config/pkgconfig ..." 1>&5
2981
2982                 if test -d $cf_config/pkgconfig
2983                 then
2984                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2985                         echo "$as_me:2985: checking done" >&5
2986 echo $ECHO_N "checking done... $ECHO_C" >&6
2987                         break
2988                 fi
2989         done
2990         ;;
2991 (*)
2992         ;;
2993 esac
2994
2995 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2996         echo "$as_me:2996: result: $PKG_CONFIG_LIBDIR" >&5
2997 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2998 fi
2999
3000 echo "$as_me:3000: checking if you want to build test-programs" >&5
3001 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
3002
3003 # Check whether --with-tests or --without-tests was given.
3004 if test "${with_tests+set}" = set; then
3005   withval="$with_tests"
3006   cf_with_tests=$withval
3007 else
3008   cf_with_tests=yes
3009 fi;
3010 echo "$as_me:3010: result: $cf_with_tests" >&5
3011 echo "${ECHO_T}$cf_with_tests" >&6
3012
3013 echo "$as_me:3013: checking if we should assume mixed-case filenames" >&5
3014 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
3015
3016 # Check whether --enable-mixed-case or --disable-mixed-case was given.
3017 if test "${enable_mixed_case+set}" = set; then
3018   enableval="$enable_mixed_case"
3019   enable_mixedcase=$enableval
3020 else
3021   enable_mixedcase=auto
3022 fi;
3023 echo "$as_me:3023: result: $enable_mixedcase" >&5
3024 echo "${ECHO_T}$enable_mixedcase" >&6
3025 if test "$enable_mixedcase" = "auto" ; then
3026
3027 echo "$as_me:3027: checking if filesystem supports mixed-case filenames" >&5
3028 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
3029 if test "${cf_cv_mixedcase+set}" = set; then
3030   echo $ECHO_N "(cached) $ECHO_C" >&6
3031 else
3032
3033 if test "$cross_compiling" = yes ; then
3034         case $target_alias in
3035         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3036                 cf_cv_mixedcase=no
3037                 ;;
3038         (*)
3039                 cf_cv_mixedcase=yes
3040                 ;;
3041         esac
3042 else
3043         rm -f conftest CONFTEST
3044         echo test >conftest
3045         if test -f CONFTEST ; then
3046                 cf_cv_mixedcase=no
3047         else
3048                 cf_cv_mixedcase=yes
3049         fi
3050         rm -f conftest CONFTEST
3051 fi
3052
3053 fi
3054 echo "$as_me:3054: result: $cf_cv_mixedcase" >&5
3055 echo "${ECHO_T}$cf_cv_mixedcase" >&6
3056 test "$cf_cv_mixedcase" = yes &&
3057 cat >>confdefs.h <<\EOF
3058 #define MIXEDCASE_FILENAMES 1
3059 EOF
3060
3061 else
3062         cf_cv_mixedcase=$enable_mixedcase
3063         if test "$enable_mixedcase" = "yes" ; then
3064                 cat >>confdefs.h <<\EOF
3065 #define MIXEDCASE_FILENAMES 1
3066 EOF
3067
3068         fi
3069 fi
3070
3071 # do this after mixed-case option (tags/TAGS is not as important as tic).
3072 echo "$as_me:3072: checking whether ${MAKE-make} sets \${MAKE}" >&5
3073 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
3074 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
3075 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
3076   echo $ECHO_N "(cached) $ECHO_C" >&6
3077 else
3078   cat >conftest.make <<\EOF
3079 all:
3080         @echo 'ac_maketemp="${MAKE}"'
3081 EOF
3082 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3083 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
3084 if test -n "$ac_maketemp"; then
3085   eval ac_cv_prog_make_${ac_make}_set=yes
3086 else
3087   eval ac_cv_prog_make_${ac_make}_set=no
3088 fi
3089 rm -f conftest.make
3090 fi
3091 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3092   echo "$as_me:3092: result: yes" >&5
3093 echo "${ECHO_T}yes" >&6
3094   SET_MAKE=
3095 else
3096   echo "$as_me:3096: result: no" >&5
3097 echo "${ECHO_T}no" >&6
3098   SET_MAKE="MAKE=${MAKE-make}"
3099 fi
3100
3101 for ac_prog in exctags ctags
3102 do
3103   # Extract the first word of "$ac_prog", so it can be a program name with args.
3104 set dummy $ac_prog; ac_word=$2
3105 echo "$as_me:3105: checking for $ac_word" >&5
3106 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3107 if test "${ac_cv_prog_CTAGS+set}" = set; then
3108   echo $ECHO_N "(cached) $ECHO_C" >&6
3109 else
3110   if test -n "$CTAGS"; then
3111   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
3112 else
3113   ac_save_IFS=$IFS; IFS=$ac_path_separator
3114 ac_dummy="$PATH"
3115 for ac_dir in $ac_dummy; do
3116   IFS=$ac_save_IFS
3117   test -z "$ac_dir" && ac_dir=.
3118   $as_executable_p "$ac_dir/$ac_word" || continue
3119 ac_cv_prog_CTAGS="$ac_prog"
3120 echo "$as_me:3120: found $ac_dir/$ac_word" >&5
3121 break
3122 done
3123
3124 fi
3125 fi
3126 CTAGS=$ac_cv_prog_CTAGS
3127 if test -n "$CTAGS"; then
3128   echo "$as_me:3128: result: $CTAGS" >&5
3129 echo "${ECHO_T}$CTAGS" >&6
3130 else
3131   echo "$as_me:3131: result: no" >&5
3132 echo "${ECHO_T}no" >&6
3133 fi
3134
3135   test -n "$CTAGS" && break
3136 done
3137
3138 for ac_prog in exetags etags
3139 do
3140   # Extract the first word of "$ac_prog", so it can be a program name with args.
3141 set dummy $ac_prog; ac_word=$2
3142 echo "$as_me:3142: checking for $ac_word" >&5
3143 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3144 if test "${ac_cv_prog_ETAGS+set}" = set; then
3145   echo $ECHO_N "(cached) $ECHO_C" >&6
3146 else
3147   if test -n "$ETAGS"; then
3148   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
3149 else
3150   ac_save_IFS=$IFS; IFS=$ac_path_separator
3151 ac_dummy="$PATH"
3152 for ac_dir in $ac_dummy; do
3153   IFS=$ac_save_IFS
3154   test -z "$ac_dir" && ac_dir=.
3155   $as_executable_p "$ac_dir/$ac_word" || continue
3156 ac_cv_prog_ETAGS="$ac_prog"
3157 echo "$as_me:3157: found $ac_dir/$ac_word" >&5
3158 break
3159 done
3160
3161 fi
3162 fi
3163 ETAGS=$ac_cv_prog_ETAGS
3164 if test -n "$ETAGS"; then
3165   echo "$as_me:3165: result: $ETAGS" >&5
3166 echo "${ECHO_T}$ETAGS" >&6
3167 else
3168   echo "$as_me:3168: result: no" >&5
3169 echo "${ECHO_T}no" >&6
3170 fi
3171
3172   test -n "$ETAGS" && break
3173 done
3174
3175 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3176 set dummy ${CTAGS:-ctags}; ac_word=$2
3177 echo "$as_me:3177: checking for $ac_word" >&5
3178 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3179 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3180   echo $ECHO_N "(cached) $ECHO_C" >&6
3181 else
3182   if test -n "$MAKE_LOWER_TAGS"; then
3183   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3184 else
3185   ac_save_IFS=$IFS; IFS=$ac_path_separator
3186 ac_dummy="$PATH"
3187 for ac_dir in $ac_dummy; do
3188   IFS=$ac_save_IFS
3189   test -z "$ac_dir" && ac_dir=.
3190   $as_executable_p "$ac_dir/$ac_word" || continue
3191 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3192 echo "$as_me:3192: found $ac_dir/$ac_word" >&5
3193 break
3194 done
3195
3196   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3197 fi
3198 fi
3199 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3200 if test -n "$MAKE_LOWER_TAGS"; then
3201   echo "$as_me:3201: result: $MAKE_LOWER_TAGS" >&5
3202 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3203 else
3204   echo "$as_me:3204: result: no" >&5
3205 echo "${ECHO_T}no" >&6
3206 fi
3207
3208 if test "$cf_cv_mixedcase" = yes ; then
3209         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3210 set dummy ${ETAGS:-etags}; ac_word=$2
3211 echo "$as_me:3211: checking for $ac_word" >&5
3212 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3213 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3214   echo $ECHO_N "(cached) $ECHO_C" >&6
3215 else
3216   if test -n "$MAKE_UPPER_TAGS"; then
3217   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3218 else
3219   ac_save_IFS=$IFS; IFS=$ac_path_separator
3220 ac_dummy="$PATH"
3221 for ac_dir in $ac_dummy; do
3222   IFS=$ac_save_IFS
3223   test -z "$ac_dir" && ac_dir=.
3224   $as_executable_p "$ac_dir/$ac_word" || continue
3225 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3226 echo "$as_me:3226: found $ac_dir/$ac_word" >&5
3227 break
3228 done
3229
3230   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3231 fi
3232 fi
3233 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3234 if test -n "$MAKE_UPPER_TAGS"; then
3235   echo "$as_me:3235: result: $MAKE_UPPER_TAGS" >&5
3236 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3237 else
3238   echo "$as_me:3238: result: no" >&5
3239 echo "${ECHO_T}no" >&6
3240 fi
3241
3242 else
3243         MAKE_UPPER_TAGS=no
3244 fi
3245
3246 if test "$MAKE_UPPER_TAGS" = yes ; then
3247         MAKE_UPPER_TAGS=
3248 else
3249         MAKE_UPPER_TAGS="#"
3250 fi
3251
3252 if test "$MAKE_LOWER_TAGS" = yes ; then
3253         MAKE_LOWER_TAGS=
3254 else
3255         MAKE_LOWER_TAGS="#"
3256 fi
3257
3258 echo "$as_me:3258: checking for makeflags variable" >&5
3259 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3260 if test "${cf_cv_makeflags+set}" = set; then
3261   echo $ECHO_N "(cached) $ECHO_C" >&6
3262 else
3263
3264         cf_cv_makeflags=''
3265         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3266         do
3267                 cat >cf_makeflags.tmp <<CF_EOF
3268 SHELL = $SHELL
3269 all :
3270         @ echo '.$cf_option'
3271 CF_EOF
3272                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3273                 case "$cf_result" in
3274                 (.*k|.*kw)
3275                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3276                         case "$cf_result" in
3277                         (.*CC=*)        cf_cv_makeflags=
3278                                 ;;
3279                         (*)     cf_cv_makeflags=$cf_option
3280                                 ;;
3281                         esac
3282                         break
3283                         ;;
3284                 (.-)
3285                         ;;
3286                 (*)
3287
3288 echo "${as_me:-configure}:3288: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3289
3290                         ;;
3291                 esac
3292         done
3293         rm -f cf_makeflags.tmp
3294
3295 fi
3296 echo "$as_me:3296: result: $cf_cv_makeflags" >&5
3297 echo "${ECHO_T}$cf_cv_makeflags" >&6
3298
3299 if test -n "$ac_tool_prefix"; then
3300   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3301 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3302 echo "$as_me:3302: checking for $ac_word" >&5
3303 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3304 if test "${ac_cv_prog_RANLIB+set}" = set; then
3305   echo $ECHO_N "(cached) $ECHO_C" >&6
3306 else
3307   if test -n "$RANLIB"; then
3308   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3309 else
3310   ac_save_IFS=$IFS; IFS=$ac_path_separator
3311 ac_dummy="$PATH"
3312 for ac_dir in $ac_dummy; do
3313   IFS=$ac_save_IFS
3314   test -z "$ac_dir" && ac_dir=.
3315   $as_executable_p "$ac_dir/$ac_word" || continue
3316 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3317 echo "$as_me:3317: found $ac_dir/$ac_word" >&5
3318 break
3319 done
3320
3321 fi
3322 fi
3323 RANLIB=$ac_cv_prog_RANLIB
3324 if test -n "$RANLIB"; then
3325   echo "$as_me:3325: result: $RANLIB" >&5
3326 echo "${ECHO_T}$RANLIB" >&6
3327 else
3328   echo "$as_me:3328: result: no" >&5
3329 echo "${ECHO_T}no" >&6
3330 fi
3331
3332 fi
3333 if test -z "$ac_cv_prog_RANLIB"; then
3334   ac_ct_RANLIB=$RANLIB
3335   # Extract the first word of "ranlib", so it can be a program name with args.
3336 set dummy ranlib; ac_word=$2
3337 echo "$as_me:3337: checking for $ac_word" >&5
3338 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3339 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3340   echo $ECHO_N "(cached) $ECHO_C" >&6
3341 else
3342   if test -n "$ac_ct_RANLIB"; then
3343   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3344 else
3345   ac_save_IFS=$IFS; IFS=$ac_path_separator
3346 ac_dummy="$PATH"
3347 for ac_dir in $ac_dummy; do
3348   IFS=$ac_save_IFS
3349   test -z "$ac_dir" && ac_dir=.
3350   $as_executable_p "$ac_dir/$ac_word" || continue
3351 ac_cv_prog_ac_ct_RANLIB="ranlib"
3352 echo "$as_me:3352: found $ac_dir/$ac_word" >&5
3353 break
3354 done
3355
3356   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3357 fi
3358 fi
3359 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3360 if test -n "$ac_ct_RANLIB"; then
3361   echo "$as_me:3361: result: $ac_ct_RANLIB" >&5
3362 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3363 else
3364   echo "$as_me:3364: result: no" >&5
3365 echo "${ECHO_T}no" >&6
3366 fi
3367
3368   RANLIB=$ac_ct_RANLIB
3369 else
3370   RANLIB="$ac_cv_prog_RANLIB"
3371 fi
3372
3373 if test -n "$ac_tool_prefix"; then
3374   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3375 set dummy ${ac_tool_prefix}ld; ac_word=$2
3376 echo "$as_me:3376: checking for $ac_word" >&5
3377 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3378 if test "${ac_cv_prog_LD+set}" = set; then
3379   echo $ECHO_N "(cached) $ECHO_C" >&6
3380 else
3381   if test -n "$LD"; then
3382   ac_cv_prog_LD="$LD" # Let the user override the test.
3383 else
3384   ac_save_IFS=$IFS; IFS=$ac_path_separator
3385 ac_dummy="$PATH"
3386 for ac_dir in $ac_dummy; do
3387   IFS=$ac_save_IFS
3388   test -z "$ac_dir" && ac_dir=.
3389   $as_executable_p "$ac_dir/$ac_word" || continue
3390 ac_cv_prog_LD="${ac_tool_prefix}ld"
3391 echo "$as_me:3391: found $ac_dir/$ac_word" >&5
3392 break
3393 done
3394
3395 fi
3396 fi
3397 LD=$ac_cv_prog_LD
3398 if test -n "$LD"; then
3399   echo "$as_me:3399: result: $LD" >&5
3400 echo "${ECHO_T}$LD" >&6
3401 else
3402   echo "$as_me:3402: result: no" >&5
3403 echo "${ECHO_T}no" >&6
3404 fi
3405
3406 fi
3407 if test -z "$ac_cv_prog_LD"; then
3408   ac_ct_LD=$LD
3409   # Extract the first word of "ld", so it can be a program name with args.
3410 set dummy ld; ac_word=$2
3411 echo "$as_me:3411: checking for $ac_word" >&5
3412 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3413 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3414   echo $ECHO_N "(cached) $ECHO_C" >&6
3415 else
3416   if test -n "$ac_ct_LD"; then
3417   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3418 else
3419   ac_save_IFS=$IFS; IFS=$ac_path_separator
3420 ac_dummy="$PATH"
3421 for ac_dir in $ac_dummy; do
3422   IFS=$ac_save_IFS
3423   test -z "$ac_dir" && ac_dir=.
3424   $as_executable_p "$ac_dir/$ac_word" || continue
3425 ac_cv_prog_ac_ct_LD="ld"
3426 echo "$as_me:3426: found $ac_dir/$ac_word" >&5
3427 break
3428 done
3429
3430   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3431 fi
3432 fi
3433 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3434 if test -n "$ac_ct_LD"; then
3435   echo "$as_me:3435: result: $ac_ct_LD" >&5
3436 echo "${ECHO_T}$ac_ct_LD" >&6
3437 else
3438   echo "$as_me:3438: result: no" >&5
3439 echo "${ECHO_T}no" >&6
3440 fi
3441
3442   LD=$ac_ct_LD
3443 else
3444   LD="$ac_cv_prog_LD"
3445 fi
3446
3447 if test -n "$ac_tool_prefix"; then
3448   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3449 set dummy ${ac_tool_prefix}ar; ac_word=$2
3450 echo "$as_me:3450: checking for $ac_word" >&5
3451 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3452 if test "${ac_cv_prog_AR+set}" = set; then
3453   echo $ECHO_N "(cached) $ECHO_C" >&6
3454 else
3455   if test -n "$AR"; then
3456   ac_cv_prog_AR="$AR" # Let the user override the test.
3457 else
3458   ac_save_IFS=$IFS; IFS=$ac_path_separator
3459 ac_dummy="$PATH"
3460 for ac_dir in $ac_dummy; do
3461   IFS=$ac_save_IFS
3462   test -z "$ac_dir" && ac_dir=.
3463   $as_executable_p "$ac_dir/$ac_word" || continue
3464 ac_cv_prog_AR="${ac_tool_prefix}ar"
3465 echo "$as_me:3465: found $ac_dir/$ac_word" >&5
3466 break
3467 done
3468
3469 fi
3470 fi
3471 AR=$ac_cv_prog_AR
3472 if test -n "$AR"; then
3473   echo "$as_me:3473: result: $AR" >&5
3474 echo "${ECHO_T}$AR" >&6
3475 else
3476   echo "$as_me:3476: result: no" >&5
3477 echo "${ECHO_T}no" >&6
3478 fi
3479
3480 fi
3481 if test -z "$ac_cv_prog_AR"; then
3482   ac_ct_AR=$AR
3483   # Extract the first word of "ar", so it can be a program name with args.
3484 set dummy ar; ac_word=$2
3485 echo "$as_me:3485: checking for $ac_word" >&5
3486 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3487 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3488   echo $ECHO_N "(cached) $ECHO_C" >&6
3489 else
3490   if test -n "$ac_ct_AR"; then
3491   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3492 else
3493   ac_save_IFS=$IFS; IFS=$ac_path_separator
3494 ac_dummy="$PATH"
3495 for ac_dir in $ac_dummy; do
3496   IFS=$ac_save_IFS
3497   test -z "$ac_dir" && ac_dir=.
3498   $as_executable_p "$ac_dir/$ac_word" || continue
3499 ac_cv_prog_ac_ct_AR="ar"
3500 echo "$as_me:3500: found $ac_dir/$ac_word" >&5
3501 break
3502 done
3503
3504   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3505 fi
3506 fi
3507 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3508 if test -n "$ac_ct_AR"; then
3509   echo "$as_me:3509: result: $ac_ct_AR" >&5
3510 echo "${ECHO_T}$ac_ct_AR" >&6
3511 else
3512   echo "$as_me:3512: result: no" >&5
3513 echo "${ECHO_T}no" >&6
3514 fi
3515
3516   AR=$ac_ct_AR
3517 else
3518   AR="$ac_cv_prog_AR"
3519 fi
3520
3521 if test -n "$ac_tool_prefix"; then
3522   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3523 set dummy ${ac_tool_prefix}ar; ac_word=$2
3524 echo "$as_me:3524: checking for $ac_word" >&5
3525 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3526 if test "${ac_cv_prog_AR+set}" = set; then
3527   echo $ECHO_N "(cached) $ECHO_C" >&6
3528 else
3529   if test -n "$AR"; then
3530   ac_cv_prog_AR="$AR" # Let the user override the test.
3531 else
3532   ac_save_IFS=$IFS; IFS=$ac_path_separator
3533 ac_dummy="$PATH"
3534 for ac_dir in $ac_dummy; do
3535   IFS=$ac_save_IFS
3536   test -z "$ac_dir" && ac_dir=.
3537   $as_executable_p "$ac_dir/$ac_word" || continue
3538 ac_cv_prog_AR="${ac_tool_prefix}ar"
3539 echo "$as_me:3539: found $ac_dir/$ac_word" >&5
3540 break
3541 done
3542
3543 fi
3544 fi
3545 AR=$ac_cv_prog_AR
3546 if test -n "$AR"; then
3547   echo "$as_me:3547: result: $AR" >&5
3548 echo "${ECHO_T}$AR" >&6
3549 else
3550   echo "$as_me:3550: result: no" >&5
3551 echo "${ECHO_T}no" >&6
3552 fi
3553
3554 fi
3555 if test -z "$ac_cv_prog_AR"; then
3556   ac_ct_AR=$AR
3557   # Extract the first word of "ar", so it can be a program name with args.
3558 set dummy ar; ac_word=$2
3559 echo "$as_me:3559: checking for $ac_word" >&5
3560 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3561 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3562   echo $ECHO_N "(cached) $ECHO_C" >&6
3563 else
3564   if test -n "$ac_ct_AR"; then
3565   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3566 else
3567   ac_save_IFS=$IFS; IFS=$ac_path_separator
3568 ac_dummy="$PATH"
3569 for ac_dir in $ac_dummy; do
3570   IFS=$ac_save_IFS
3571   test -z "$ac_dir" && ac_dir=.
3572   $as_executable_p "$ac_dir/$ac_word" || continue
3573 ac_cv_prog_ac_ct_AR="ar"
3574 echo "$as_me:3574: found $ac_dir/$ac_word" >&5
3575 break
3576 done
3577
3578   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3579 fi
3580 fi
3581 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3582 if test -n "$ac_ct_AR"; then
3583   echo "$as_me:3583: result: $ac_ct_AR" >&5
3584 echo "${ECHO_T}$ac_ct_AR" >&6
3585 else
3586   echo "$as_me:3586: result: no" >&5
3587 echo "${ECHO_T}no" >&6
3588 fi
3589
3590   AR=$ac_ct_AR
3591 else
3592   AR="$ac_cv_prog_AR"
3593 fi
3594
3595 echo "$as_me:3595: checking for options to update archives" >&5
3596 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3597 if test "${cf_cv_ar_flags+set}" = set; then
3598   echo $ECHO_N "(cached) $ECHO_C" >&6
3599 else
3600
3601         cf_cv_ar_flags=unknown
3602         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3603         do
3604
3605                 # check if $ARFLAGS already contains this choice
3606                 if test "x$ARFLAGS" != "x" ; then
3607                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3608                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3609                                 cf_cv_ar_flags=
3610                                 break
3611                         fi
3612                 fi
3613
3614                 rm -f conftest.$ac_cv_objext
3615                 rm -f conftest.a
3616
3617                 cat >conftest.$ac_ext <<EOF
3618 #line 3618 "configure"
3619 int     testdata[3] = { 123, 456, 789 };
3620 EOF
3621                 if { (eval echo "$as_me:3621: \"$ac_compile\"") >&5
3622   (eval $ac_compile) 2>&5
3623   ac_status=$?
3624   echo "$as_me:3624: \$? = $ac_status" >&5
3625   (exit $ac_status); } ; then
3626                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3627                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3628                         if test -f conftest.a ; then
3629                                 cf_cv_ar_flags=$cf_ar_flags
3630                                 break
3631                         fi
3632                 else
3633                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3634
3635 echo "${as_me:-configure}:3635: testing cannot compile test-program ..." 1>&5
3636
3637                         break
3638                 fi
3639         done
3640         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3641
3642 fi
3643 echo "$as_me:3643: result: $cf_cv_ar_flags" >&5
3644 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3645
3646 if test -n "$ARFLAGS" ; then
3647         if test -n "$cf_cv_ar_flags" ; then
3648                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3649         fi
3650 else
3651         ARFLAGS=$cf_cv_ar_flags
3652 fi
3653
3654         echo "$as_me:3654: checking for PATH separator" >&5
3655 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3656         case $cf_cv_system_name in
3657         (os2*)  PATH_SEPARATOR=';'  ;;
3658         (*)     ${PATH_SEPARATOR:=':'}  ;;
3659         esac
3660
3661         echo "$as_me:3661: result: $PATH_SEPARATOR" >&5
3662 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3663
3664 echo "$as_me:3664: checking if you have specified an install-prefix" >&5
3665 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3666
3667 # Check whether --with-install-prefix or --without-install-prefix was given.
3668 if test "${with_install_prefix+set}" = set; then
3669   withval="$with_install_prefix"
3670   case "$withval" in
3671         (yes|no)
3672                 ;;
3673         (*)     DESTDIR="$withval"
3674                 ;;
3675         esac
3676 fi;
3677 echo "$as_me:3677: result: $DESTDIR" >&5
3678 echo "${ECHO_T}$DESTDIR" >&6
3679
3680 ###############################################################################
3681
3682 # If we're cross-compiling, allow the user to override the tools and their
3683 # options.  The configure script is oriented toward identifying the host
3684 # compiler, etc., but we need a build compiler to generate parts of the source.
3685
3686 if test "$cross_compiling" = yes ; then
3687
3688         # defaults that we might want to override
3689         : ${BUILD_CFLAGS:=''}
3690         : ${BUILD_CPPFLAGS:=''}
3691         : ${BUILD_LDFLAGS:=''}
3692         : ${BUILD_LIBS:=''}
3693         : ${BUILD_EXEEXT:='$x'}
3694         : ${BUILD_OBJEXT:='o'}
3695
3696 # Check whether --with-build-cc or --without-build-cc was given.
3697 if test "${with_build_cc+set}" = set; then
3698   withval="$with_build_cc"
3699   BUILD_CC="$withval"
3700 else
3701   for ac_prog in gcc clang c99 c89 cc cl
3702 do
3703   # Extract the first word of "$ac_prog", so it can be a program name with args.
3704 set dummy $ac_prog; ac_word=$2
3705 echo "$as_me:3705: checking for $ac_word" >&5
3706 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3707 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3708   echo $ECHO_N "(cached) $ECHO_C" >&6
3709 else
3710   if test -n "$BUILD_CC"; then
3711   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3712 else
3713   ac_save_IFS=$IFS; IFS=$ac_path_separator
3714 ac_dummy="$PATH"
3715 for ac_dir in $ac_dummy; do
3716   IFS=$ac_save_IFS
3717   test -z "$ac_dir" && ac_dir=.
3718   $as_executable_p "$ac_dir/$ac_word" || continue
3719 ac_cv_prog_BUILD_CC="$ac_prog"
3720 echo "$as_me:3720: found $ac_dir/$ac_word" >&5
3721 break
3722 done
3723
3724 fi
3725 fi
3726 BUILD_CC=$ac_cv_prog_BUILD_CC
3727 if test -n "$BUILD_CC"; then
3728   echo "$as_me:3728: result: $BUILD_CC" >&5
3729 echo "${ECHO_T}$BUILD_CC" >&6
3730 else
3731   echo "$as_me:3731: result: no" >&5
3732 echo "${ECHO_T}no" >&6
3733 fi
3734
3735   test -n "$BUILD_CC" && break
3736 done
3737 test -n "$BUILD_CC" || BUILD_CC="none"
3738
3739 fi;
3740         echo "$as_me:3740: checking for native build C compiler" >&5
3741 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3742         echo "$as_me:3742: result: $BUILD_CC" >&5
3743 echo "${ECHO_T}$BUILD_CC" >&6
3744
3745         echo "$as_me:3745: checking for native build C preprocessor" >&5
3746 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3747
3748 # Check whether --with-build-cpp or --without-build-cpp was given.
3749 if test "${with_build_cpp+set}" = set; then
3750   withval="$with_build_cpp"
3751   BUILD_CPP="$withval"
3752 else
3753   BUILD_CPP='${BUILD_CC} -E'
3754 fi;
3755         echo "$as_me:3755: result: $BUILD_CPP" >&5
3756 echo "${ECHO_T}$BUILD_CPP" >&6
3757
3758         echo "$as_me:3758: checking for native build C flags" >&5
3759 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3760
3761 # Check whether --with-build-cflags or --without-build-cflags was given.
3762 if test "${with_build_cflags+set}" = set; then
3763   withval="$with_build_cflags"
3764   BUILD_CFLAGS="$withval"
3765 fi;
3766         echo "$as_me:3766: result: $BUILD_CFLAGS" >&5
3767 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3768
3769         echo "$as_me:3769: checking for native build C preprocessor-flags" >&5
3770 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3771
3772 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3773 if test "${with_build_cppflags+set}" = set; then
3774   withval="$with_build_cppflags"
3775   BUILD_CPPFLAGS="$withval"
3776 fi;
3777         echo "$as_me:3777: result: $BUILD_CPPFLAGS" >&5
3778 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3779
3780         echo "$as_me:3780: checking for native build linker-flags" >&5
3781 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3782
3783 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3784 if test "${with_build_ldflags+set}" = set; then
3785   withval="$with_build_ldflags"
3786   BUILD_LDFLAGS="$withval"
3787 fi;
3788         echo "$as_me:3788: result: $BUILD_LDFLAGS" >&5
3789 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3790
3791         echo "$as_me:3791: checking for native build linker-libraries" >&5
3792 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3793
3794 # Check whether --with-build-libs or --without-build-libs was given.
3795 if test "${with_build_libs+set}" = set; then
3796   withval="$with_build_libs"
3797   BUILD_LIBS="$withval"
3798 fi;
3799         echo "$as_me:3799: result: $BUILD_LIBS" >&5
3800 echo "${ECHO_T}$BUILD_LIBS" >&6
3801
3802         # this assumes we're on Unix.
3803         BUILD_EXEEXT=
3804         BUILD_OBJEXT=o
3805
3806         : ${BUILD_CC:='${CC}'}
3807
3808         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3809                 { { echo "$as_me:3809: error: Cross-build requires two compilers.
3810 Use --with-build-cc to specify the native compiler." >&5
3811 echo "$as_me: error: Cross-build requires two compilers.
3812 Use --with-build-cc to specify the native compiler." >&2;}
3813    { (exit 1); exit 1; }; }
3814         fi
3815
3816 else
3817         : ${BUILD_CC:='${CC}'}
3818         : ${BUILD_CPP:='${CPP}'}
3819         : ${BUILD_CFLAGS:='${CFLAGS}'}
3820         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3821         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3822         : ${BUILD_LIBS:='${LIBS}'}
3823         : ${BUILD_EXEEXT:='$x'}
3824         : ${BUILD_OBJEXT:='o'}
3825 fi
3826
3827 ###############################################################################
3828
3829 ### Options to allow the user to specify the set of libraries which are used.
3830 ### Use "--without-normal --with-shared" to allow the default model to be
3831 ### shared, for example.
3832 cf_list_models=""
3833
3834 echo "$as_me:3834: checking if you want to build shared C-objects" >&5
3835 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3836
3837 # Check whether --with-shared or --without-shared was given.
3838 if test "${with_shared+set}" = set; then
3839   withval="$with_shared"
3840   with_shared=$withval
3841 else
3842   with_shared=no
3843 fi;
3844 echo "$as_me:3844: result: $with_shared" >&5
3845 echo "${ECHO_T}$with_shared" >&6
3846 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3847
3848 echo "$as_me:3848: checking for specified models" >&5
3849 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3850 test -z "$cf_list_models" && cf_list_models=normal
3851 echo "$as_me:3851: result: $cf_list_models" >&5
3852 echo "${ECHO_T}$cf_list_models" >&6
3853
3854 ### Use the first model as the default, and save its suffix for use in building
3855 ### up test-applications.
3856 echo "$as_me:3856: checking for default model" >&5
3857 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3858 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3859 echo "$as_me:3859: result: $DFT_LWR_MODEL" >&5
3860 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3861
3862 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3863
3864 echo "$as_me:3864: checking for specific curses-directory" >&5
3865 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3866
3867 # Check whether --with-curses-dir or --without-curses-dir was given.
3868 if test "${with_curses_dir+set}" = set; then
3869   withval="$with_curses_dir"
3870   cf_cv_curses_dir=$withval
3871 else
3872   cf_cv_curses_dir=no
3873 fi;
3874 echo "$as_me:3874: result: $cf_cv_curses_dir" >&5
3875 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3876
3877 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3878 then
3879
3880 if test "x$prefix" != xNONE; then
3881         cf_path_syntax="$prefix"
3882 else
3883         cf_path_syntax="$ac_default_prefix"
3884 fi
3885
3886 case ".$withval" in
3887 (.\$\(*\)*|.\'*\'*)
3888         ;;
3889 (..|./*|.\\*)
3890         ;;
3891 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3892         ;;
3893 (.\${*prefix}*|.\${*dir}*)
3894         eval withval="$withval"
3895         case ".$withval" in
3896         (.NONE/*)
3897                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3898                 ;;
3899         esac
3900         ;;
3901 (.no|.NONE/*)
3902         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3903         ;;
3904 (*)
3905         { { echo "$as_me:3905: error: expected a pathname, not \"$withval\"" >&5
3906 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3907    { (exit 1); exit 1; }; }
3908         ;;
3909 esac
3910
3911         if test -d "$cf_cv_curses_dir"
3912         then
3913
3914 if test -n "$cf_cv_curses_dir/include" ; then
3915   for cf_add_incdir in $cf_cv_curses_dir/include
3916   do
3917         while test $cf_add_incdir != /usr/include
3918         do
3919           if test -d $cf_add_incdir
3920           then
3921                 cf_have_incdir=no
3922                 if test -n "$CFLAGS$CPPFLAGS" ; then
3923                   # a loop is needed to ensure we can add subdirs of existing dirs
3924                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3925                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3926                           cf_have_incdir=yes; break
3927                         fi
3928                   done
3929                 fi
3930
3931                 if test "$cf_have_incdir" = no ; then
3932                   if test "$cf_add_incdir" = /usr/local/include ; then
3933                         if test "$GCC" = yes
3934                         then
3935                           cf_save_CPPFLAGS=$CPPFLAGS
3936
3937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3938         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
3939
3940                           cat >conftest.$ac_ext <<_ACEOF
3941 #line 3941 "configure"
3942 #include "confdefs.h"
3943 #include <stdio.h>
3944 int
3945 main (void)
3946 {
3947 printf("Hello")
3948   ;
3949   return 0;
3950 }
3951 _ACEOF
3952 rm -f conftest.$ac_objext
3953 if { (eval echo "$as_me:3953: \"$ac_compile\"") >&5
3954   (eval $ac_compile) 2>&5
3955   ac_status=$?
3956   echo "$as_me:3956: \$? = $ac_status" >&5
3957   (exit $ac_status); } &&
3958          { ac_try='test -s conftest.$ac_objext'
3959   { (eval echo "$as_me:3959: \"$ac_try\"") >&5
3960   (eval $ac_try) 2>&5
3961   ac_status=$?
3962   echo "$as_me:3962: \$? = $ac_status" >&5
3963   (exit $ac_status); }; }; then
3964   :
3965 else
3966   echo "$as_me: failed program was:" >&5
3967 cat conftest.$ac_ext >&5
3968 cf_have_incdir=yes
3969 fi
3970 rm -f conftest.$ac_objext conftest.$ac_ext
3971                           CPPFLAGS=$cf_save_CPPFLAGS
3972                         fi
3973                   fi
3974                 fi
3975
3976                 if test "$cf_have_incdir" = no ; then
3977                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3978
3979 echo "${as_me:-configure}:3979: testing adding $cf_add_incdir to include-path ..." 1>&5
3980
3981                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3982
3983                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3984                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3985                   cf_add_incdir="$cf_top_incdir"
3986                 else
3987                   break
3988                 fi
3989           else
3990                 break
3991           fi
3992         done
3993   done
3994 fi
3995
3996 if test -n "$cf_cv_curses_dir/lib" ; then
3997         for cf_add_libdir in $cf_cv_curses_dir/lib
3998         do
3999                 if test $cf_add_libdir = /usr/lib ; then
4000                         :
4001                 elif test -d $cf_add_libdir
4002                 then
4003                         cf_have_libdir=no
4004                         if test -n "$LDFLAGS$LIBS" ; then
4005                                 # a loop is needed to ensure we can add subdirs of existing dirs
4006                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4007                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4008                                                 cf_have_libdir=yes; break
4009                                         fi
4010                                 done
4011                         fi
4012                         if test "$cf_have_libdir" = no ; then
4013                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4014
4015 echo "${as_me:-configure}:4015: testing adding $cf_add_libdir to library-path ..." 1>&5
4016
4017                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4018                         fi
4019                 fi
4020         done
4021 fi
4022
4023         fi
4024 fi
4025
4026 cf_ncuconfig_root=ncurses
4027 cf_have_ncuconfig=no
4028
4029 if test "x${PKG_CONFIG:=none}" != xnone; then
4030         echo "$as_me:4030: checking pkg-config for $cf_ncuconfig_root" >&5
4031 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
4032         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
4033                 echo "$as_me:4033: result: yes" >&5
4034 echo "${ECHO_T}yes" >&6
4035
4036                 echo "$as_me:4036: checking if the $cf_ncuconfig_root package files work" >&5
4037 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
4038                 cf_have_ncuconfig=unknown
4039
4040                 cf_save_CPPFLAGS="$CPPFLAGS"
4041                 cf_save_LIBS="$LIBS"
4042
4043 cf_fix_cppflags=no
4044 cf_new_cflags=
4045 cf_new_cppflags=
4046 cf_new_extra_cppflags=
4047
4048 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
4049 do
4050 case $cf_fix_cppflags in
4051 (no)
4052         case $cf_add_cflags in
4053         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4054                 case $cf_add_cflags in
4055                 (-D*)
4056                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4057
4058                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4059                                 && test -z "${cf_tst_cflags}" \
4060                                 && cf_fix_cppflags=yes
4061
4062                         if test $cf_fix_cppflags = yes ; then
4063
4064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4066
4067                                 continue
4068                         elif test "${cf_tst_cflags}" = "\"'" ; then
4069
4070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4072
4073                                 continue
4074                         fi
4075                         ;;
4076                 esac
4077                 case "$CPPFLAGS" in
4078                 (*$cf_add_cflags)
4079                         ;;
4080                 (*)
4081                         case $cf_add_cflags in
4082                         (-D*)
4083                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4084
4085 CPPFLAGS=`echo "$CPPFLAGS" | \
4086         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4087                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4088
4089                                 ;;
4090                         esac
4091
4092         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4093         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4094
4095                         ;;
4096                 esac
4097                 ;;
4098         (*)
4099
4100         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4101         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4102
4103                 ;;
4104         esac
4105         ;;
4106 (yes)
4107
4108         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4109         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4110
4111         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4112
4113         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4114                 && test -z "${cf_tst_cflags}" \
4115                 && cf_fix_cppflags=no
4116         ;;
4117 esac
4118 done
4119
4120 if test -n "$cf_new_cflags" ; then
4121
4122         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4123         CFLAGS="${CFLAGS}$cf_new_cflags"
4124
4125 fi
4126
4127 if test -n "$cf_new_cppflags" ; then
4128
4129         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4130         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4131
4132 fi
4133
4134 if test -n "$cf_new_extra_cppflags" ; then
4135
4136         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4137         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4138
4139 fi
4140
4141 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
4142 # Filter out duplicates - this happens with badly-designed ".pc" files...
4143 for cf_add_1lib in $LIBS
4144 do
4145         for cf_add_2lib in $cf_add_libs
4146         do
4147                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4148                 then
4149                         cf_add_1lib=
4150                         break
4151                 fi
4152         done
4153         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4154 done
4155 LIBS="$cf_add_libs"
4156
4157                 cat >conftest.$ac_ext <<_ACEOF
4158 #line 4158 "configure"
4159 #include "confdefs.h"
4160 #include <${cf_cv_ncurses_header:-curses.h}>
4161 int
4162 main (void)
4163 {
4164 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
4165   ;
4166   return 0;
4167 }
4168 _ACEOF
4169 rm -f conftest.$ac_objext conftest$ac_exeext
4170 if { (eval echo "$as_me:4170: \"$ac_link\"") >&5
4171   (eval $ac_link) 2>&5
4172   ac_status=$?
4173   echo "$as_me:4173: \$? = $ac_status" >&5
4174   (exit $ac_status); } &&
4175          { ac_try='test -s conftest$ac_exeext'
4176   { (eval echo "$as_me:4176: \"$ac_try\"") >&5
4177   (eval $ac_try) 2>&5
4178   ac_status=$?
4179   echo "$as_me:4179: \$? = $ac_status" >&5
4180   (exit $ac_status); }; }; then
4181   if test "$cross_compiling" = yes; then
4182   cf_have_ncuconfig=maybe
4183 else
4184   cat >conftest.$ac_ext <<_ACEOF
4185 #line 4185 "configure"
4186 #include "confdefs.h"
4187 #include <${cf_cv_ncurses_header:-curses.h}>
4188                                 int main(void)
4189                                 { char *xx = curses_version(); return (xx == 0); }
4190 _ACEOF
4191 rm -f conftest$ac_exeext
4192 if { (eval echo "$as_me:4192: \"$ac_link\"") >&5
4193   (eval $ac_link) 2>&5
4194   ac_status=$?
4195   echo "$as_me:4195: \$? = $ac_status" >&5
4196   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4197   { (eval echo "$as_me:4197: \"$ac_try\"") >&5
4198   (eval $ac_try) 2>&5
4199   ac_status=$?
4200   echo "$as_me:4200: \$? = $ac_status" >&5
4201   (exit $ac_status); }; }; then
4202   cf_have_ncuconfig=yes
4203 else
4204   echo "$as_me: program exited with status $ac_status" >&5
4205 echo "$as_me: failed program was:" >&5
4206 cat conftest.$ac_ext >&5
4207 cf_have_ncuconfig=no
4208 fi
4209 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4210 fi
4211 else
4212   echo "$as_me: failed program was:" >&5
4213 cat conftest.$ac_ext >&5
4214 cf_have_ncuconfig=no
4215 fi
4216 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4217                 echo "$as_me:4217: result: $cf_have_ncuconfig" >&5
4218 echo "${ECHO_T}$cf_have_ncuconfig" >&6
4219                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
4220                 if test "$cf_have_ncuconfig" != "yes"
4221                 then
4222                         CPPFLAGS="$cf_save_CPPFLAGS"
4223                         LIBS="$cf_save_LIBS"
4224                         NCURSES_CONFIG_PKG=none
4225                 else
4226
4227 cat >>confdefs.h <<\EOF
4228 #define NCURSES 1
4229 EOF
4230
4231                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
4232
4233 echo "$as_me:4233: checking for terminfo header" >&5
4234 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4235 if test "${cf_cv_term_header+set}" = set; then
4236   echo $ECHO_N "(cached) $ECHO_C" >&6
4237 else
4238
4239 case ${cf_cv_ncurses_header} in
4240 (*/ncurses.h|*/ncursesw.h)
4241         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4242         ;;
4243 (*)
4244         cf_term_header=term.h
4245         ;;
4246 esac
4247
4248 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4249 do
4250 cat >conftest.$ac_ext <<_ACEOF
4251 #line 4251 "configure"
4252 #include "confdefs.h"
4253 #include <stdio.h>
4254 #include <${cf_cv_ncurses_header:-curses.h}>
4255 #include <$cf_test>
4256
4257 int
4258 main (void)
4259 {
4260 int x = auto_left_margin
4261   ;
4262   return 0;
4263 }
4264 _ACEOF
4265 rm -f conftest.$ac_objext
4266 if { (eval echo "$as_me:4266: \"$ac_compile\"") >&5
4267   (eval $ac_compile) 2>&5
4268   ac_status=$?
4269   echo "$as_me:4269: \$? = $ac_status" >&5
4270   (exit $ac_status); } &&
4271          { ac_try='test -s conftest.$ac_objext'
4272   { (eval echo "$as_me:4272: \"$ac_try\"") >&5
4273   (eval $ac_try) 2>&5
4274   ac_status=$?
4275   echo "$as_me:4275: \$? = $ac_status" >&5
4276   (exit $ac_status); }; }; then
4277
4278         cf_cv_term_header="$cf_test"
4279 else
4280   echo "$as_me: failed program was:" >&5
4281 cat conftest.$ac_ext >&5
4282
4283         cf_cv_term_header=unknown
4284
4285 fi
4286 rm -f conftest.$ac_objext conftest.$ac_ext
4287         test "$cf_cv_term_header" != unknown && break
4288 done
4289
4290 fi
4291 echo "$as_me:4291: result: $cf_cv_term_header" >&5
4292 echo "${ECHO_T}$cf_cv_term_header" >&6
4293
4294 # Set definitions to allow ifdef'ing to accommodate subdirectories
4295
4296 case $cf_cv_term_header in
4297 (*term.h)
4298
4299 cat >>confdefs.h <<\EOF
4300 #define HAVE_TERM_H 1
4301 EOF
4302
4303         ;;
4304 esac
4305
4306 case $cf_cv_term_header in
4307 (ncurses/term.h)
4308
4309 cat >>confdefs.h <<\EOF
4310 #define HAVE_NCURSES_TERM_H 1
4311 EOF
4312
4313         ;;
4314 (ncursesw/term.h)
4315
4316 cat >>confdefs.h <<\EOF
4317 #define HAVE_NCURSESW_TERM_H 1
4318 EOF
4319
4320         ;;
4321 esac
4322
4323                 fi
4324
4325         else
4326                 echo "$as_me:4326: result: no" >&5
4327 echo "${ECHO_T}no" >&6
4328                 NCURSES_CONFIG_PKG=none
4329         fi
4330 else
4331         NCURSES_CONFIG_PKG=none
4332 fi
4333
4334 if test "x$cf_have_ncuconfig" = "xno"; then
4335         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4336
4337 if test -n "$ac_tool_prefix"; then
4338   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4339   do
4340     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4341 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4342 echo "$as_me:4342: checking for $ac_word" >&5
4343 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4344 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4345   echo $ECHO_N "(cached) $ECHO_C" >&6
4346 else
4347   if test -n "$NCURSES_CONFIG"; then
4348   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4349 else
4350   ac_save_IFS=$IFS; IFS=$ac_path_separator
4351 ac_dummy="$PATH"
4352 for ac_dir in $ac_dummy; do
4353   IFS=$ac_save_IFS
4354   test -z "$ac_dir" && ac_dir=.
4355   $as_executable_p "$ac_dir/$ac_word" || continue
4356 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4357 echo "$as_me:4357: found $ac_dir/$ac_word" >&5
4358 break
4359 done
4360
4361 fi
4362 fi
4363 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4364 if test -n "$NCURSES_CONFIG"; then
4365   echo "$as_me:4365: result: $NCURSES_CONFIG" >&5
4366 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4367 else
4368   echo "$as_me:4368: result: no" >&5
4369 echo "${ECHO_T}no" >&6
4370 fi
4371
4372     test -n "$NCURSES_CONFIG" && break
4373   done
4374 fi
4375 if test -z "$NCURSES_CONFIG"; then
4376   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4377   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4378 do
4379   # Extract the first word of "$ac_prog", so it can be a program name with args.
4380 set dummy $ac_prog; ac_word=$2
4381 echo "$as_me:4381: checking for $ac_word" >&5
4382 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4383 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4384   echo $ECHO_N "(cached) $ECHO_C" >&6
4385 else
4386   if test -n "$ac_ct_NCURSES_CONFIG"; then
4387   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4388 else
4389   ac_save_IFS=$IFS; IFS=$ac_path_separator
4390 ac_dummy="$PATH"
4391 for ac_dir in $ac_dummy; do
4392   IFS=$ac_save_IFS
4393   test -z "$ac_dir" && ac_dir=.
4394   $as_executable_p "$ac_dir/$ac_word" || continue
4395 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4396 echo "$as_me:4396: found $ac_dir/$ac_word" >&5
4397 break
4398 done
4399
4400 fi
4401 fi
4402 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4403 if test -n "$ac_ct_NCURSES_CONFIG"; then
4404   echo "$as_me:4404: result: $ac_ct_NCURSES_CONFIG" >&5
4405 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4406 else
4407   echo "$as_me:4407: result: no" >&5
4408 echo "${ECHO_T}no" >&6
4409 fi
4410
4411   test -n "$ac_ct_NCURSES_CONFIG" && break
4412 done
4413 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4414
4415   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4416 fi
4417
4418         if test "$NCURSES_CONFIG" != none ; then
4419
4420 cf_fix_cppflags=no
4421 cf_new_cflags=
4422 cf_new_cppflags=
4423 cf_new_extra_cppflags=
4424
4425 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
4426 do
4427 case $cf_fix_cppflags in
4428 (no)
4429         case $cf_add_cflags in
4430         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4431                 case $cf_add_cflags in
4432                 (-D*)
4433                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4434
4435                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4436                                 && test -z "${cf_tst_cflags}" \
4437                                 && cf_fix_cppflags=yes
4438
4439                         if test $cf_fix_cppflags = yes ; then
4440
4441         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4442         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4443
4444                                 continue
4445                         elif test "${cf_tst_cflags}" = "\"'" ; then
4446
4447         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4448         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4449
4450                                 continue
4451                         fi
4452                         ;;
4453                 esac
4454                 case "$CPPFLAGS" in
4455                 (*$cf_add_cflags)
4456                         ;;
4457                 (*)
4458                         case $cf_add_cflags in
4459                         (-D*)
4460                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4461
4462 CPPFLAGS=`echo "$CPPFLAGS" | \
4463         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4464                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4465
4466                                 ;;
4467                         esac
4468
4469         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4470         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4471
4472                         ;;
4473                 esac
4474                 ;;
4475         (*)
4476
4477         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4478         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4479
4480                 ;;
4481         esac
4482         ;;
4483 (yes)
4484
4485         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4486         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4487
4488         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4489
4490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4491                 && test -z "${cf_tst_cflags}" \
4492                 && cf_fix_cppflags=no
4493         ;;
4494 esac
4495 done
4496
4497 if test -n "$cf_new_cflags" ; then
4498
4499         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4500         CFLAGS="${CFLAGS}$cf_new_cflags"
4501
4502 fi
4503
4504 if test -n "$cf_new_cppflags" ; then
4505
4506         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4507         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4508
4509 fi
4510
4511 if test -n "$cf_new_extra_cppflags" ; then
4512
4513         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4514         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4515
4516 fi
4517
4518 cf_add_libs="`$NCURSES_CONFIG --libs`"
4519 # Filter out duplicates - this happens with badly-designed ".pc" files...
4520 for cf_add_1lib in $LIBS
4521 do
4522         for cf_add_2lib in $cf_add_libs
4523         do
4524                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4525                 then
4526                         cf_add_1lib=
4527                         break
4528                 fi
4529         done
4530         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4531 done
4532 LIBS="$cf_add_libs"
4533
4534                 # even with config script, some packages use no-override for curses.h
4535
4536 echo "$as_me:4536: checking if we have identified curses headers" >&5
4537 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4538 if test "${cf_cv_ncurses_header+set}" = set; then
4539   echo $ECHO_N "(cached) $ECHO_C" >&6
4540 else
4541
4542 cf_cv_ncurses_header=none
4543 for cf_header in \
4544         ncurses.h ncurses/ncurses.h \
4545         curses.h ncurses/curses.h
4546 do
4547 cat >conftest.$ac_ext <<_ACEOF
4548 #line 4548 "configure"
4549 #include "confdefs.h"
4550 #include <${cf_header}>
4551 int
4552 main (void)
4553 {
4554 initscr(); tgoto("?", 0,0)
4555   ;
4556   return 0;
4557 }
4558 _ACEOF
4559 rm -f conftest.$ac_objext
4560 if { (eval echo "$as_me:4560: \"$ac_compile\"") >&5
4561   (eval $ac_compile) 2>&5
4562   ac_status=$?
4563   echo "$as_me:4563: \$? = $ac_status" >&5
4564   (exit $ac_status); } &&
4565          { ac_try='test -s conftest.$ac_objext'
4566   { (eval echo "$as_me:4566: \"$ac_try\"") >&5
4567   (eval $ac_try) 2>&5
4568   ac_status=$?
4569   echo "$as_me:4569: \$? = $ac_status" >&5
4570   (exit $ac_status); }; }; then
4571   cf_cv_ncurses_header=$cf_header; break
4572 else
4573   echo "$as_me: failed program was:" >&5
4574 cat conftest.$ac_ext >&5
4575 fi
4576 rm -f conftest.$ac_objext conftest.$ac_ext
4577 done
4578
4579 fi
4580 echo "$as_me:4580: result: $cf_cv_ncurses_header" >&5
4581 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4582
4583 if test "$cf_cv_ncurses_header" = none ; then
4584         { { echo "$as_me:4584: error: No curses header-files found" >&5
4585 echo "$as_me: error: No curses header-files found" >&2;}
4586    { (exit 1); exit 1; }; }
4587 fi
4588
4589 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4590
4591 for ac_header in $cf_cv_ncurses_header
4592 do
4593 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4594 echo "$as_me:4594: checking for $ac_header" >&5
4595 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4596 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4597   echo $ECHO_N "(cached) $ECHO_C" >&6
4598 else
4599   cat >conftest.$ac_ext <<_ACEOF
4600 #line 4600 "configure"
4601 #include "confdefs.h"
4602 #include <$ac_header>
4603 _ACEOF
4604 if { (eval echo "$as_me:4604: \"$ac_cpp conftest.$ac_ext\"") >&5
4605   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4606   ac_status=$?
4607   egrep -v '^ *\+' conftest.er1 >conftest.err
4608   rm -f conftest.er1
4609   cat conftest.err >&5
4610   echo "$as_me:4610: \$? = $ac_status" >&5
4611   (exit $ac_status); } >/dev/null; then
4612   if test -s conftest.err; then
4613     ac_cpp_err=$ac_c_preproc_warn_flag
4614   else
4615     ac_cpp_err=
4616   fi
4617 else
4618   ac_cpp_err=yes
4619 fi
4620 if test -z "$ac_cpp_err"; then
4621   eval "$as_ac_Header=yes"
4622 else
4623   echo "$as_me: failed program was:" >&5
4624   cat conftest.$ac_ext >&5
4625   eval "$as_ac_Header=no"
4626 fi
4627 rm -f conftest.err conftest.$ac_ext
4628 fi
4629 echo "$as_me:4629: result: `eval echo '${'$as_ac_Header'}'`" >&5
4630 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4631 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4632   cat >>confdefs.h <<EOF
4633 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4634 EOF
4635
4636 fi
4637 done
4638
4639 cat >>confdefs.h <<\EOF
4640 #define NCURSES 1
4641 EOF
4642
4643 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4644
4645                 cat >>confdefs.h <<EOF
4646 #define $cf_nculib_ROOT 1
4647 EOF
4648
4649                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4650
4651         else
4652
4653 cf_ncuhdr_root=ncurses
4654
4655 test -n "$cf_cv_curses_dir" && \
4656 test "$cf_cv_curses_dir" != "no" && { \
4657
4658 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4659   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4660   do
4661         while test $cf_add_incdir != /usr/include
4662         do
4663           if test -d $cf_add_incdir
4664           then
4665                 cf_have_incdir=no
4666                 if test -n "$CFLAGS$CPPFLAGS" ; then
4667                   # a loop is needed to ensure we can add subdirs of existing dirs
4668                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4669                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4670                           cf_have_incdir=yes; break
4671                         fi
4672                   done
4673                 fi
4674
4675                 if test "$cf_have_incdir" = no ; then
4676                   if test "$cf_add_incdir" = /usr/local/include ; then
4677                         if test "$GCC" = yes
4678                         then
4679                           cf_save_CPPFLAGS=$CPPFLAGS
4680
4681         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4682         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4683
4684                           cat >conftest.$ac_ext <<_ACEOF
4685 #line 4685 "configure"
4686 #include "confdefs.h"
4687 #include <stdio.h>
4688 int
4689 main (void)
4690 {
4691 printf("Hello")
4692   ;
4693   return 0;
4694 }
4695 _ACEOF
4696 rm -f conftest.$ac_objext
4697 if { (eval echo "$as_me:4697: \"$ac_compile\"") >&5
4698   (eval $ac_compile) 2>&5
4699   ac_status=$?
4700   echo "$as_me:4700: \$? = $ac_status" >&5
4701   (exit $ac_status); } &&
4702          { ac_try='test -s conftest.$ac_objext'
4703   { (eval echo "$as_me:4703: \"$ac_try\"") >&5
4704   (eval $ac_try) 2>&5
4705   ac_status=$?
4706   echo "$as_me:4706: \$? = $ac_status" >&5
4707   (exit $ac_status); }; }; then
4708   :
4709 else
4710   echo "$as_me: failed program was:" >&5
4711 cat conftest.$ac_ext >&5
4712 cf_have_incdir=yes
4713 fi
4714 rm -f conftest.$ac_objext conftest.$ac_ext
4715                           CPPFLAGS=$cf_save_CPPFLAGS
4716                         fi
4717                   fi
4718                 fi
4719
4720                 if test "$cf_have_incdir" = no ; then
4721                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4722
4723 echo "${as_me:-configure}:4723: testing adding $cf_add_incdir to include-path ..." 1>&5
4724
4725                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4726
4727                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4728                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4729                   cf_add_incdir="$cf_top_incdir"
4730                 else
4731                   break
4732                 fi
4733           else
4734                 break
4735           fi
4736         done
4737   done
4738 fi
4739
4740 }
4741
4742 echo "$as_me:4742: checking for $cf_ncuhdr_root header in include-path" >&5
4743 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4744 if test "${cf_cv_ncurses_h+set}" = set; then
4745   echo $ECHO_N "(cached) $ECHO_C" >&6
4746 else
4747
4748         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4749         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4750         for cf_header in $cf_header_list
4751         do
4752
4753         cat >conftest.$ac_ext <<_ACEOF
4754 #line 4754 "configure"
4755 #include "confdefs.h"
4756
4757 #include <$cf_header>
4758 int
4759 main (void)
4760 {
4761
4762 #ifdef NCURSES_VERSION
4763
4764 printf("%s\n", NCURSES_VERSION);
4765 #else
4766 #ifdef __NCURSES_H
4767 printf("old\n");
4768 #else
4769         make an error
4770 #endif
4771 #endif
4772
4773   ;
4774   return 0;
4775 }
4776 _ACEOF
4777 rm -f conftest.$ac_objext
4778 if { (eval echo "$as_me:4778: \"$ac_compile\"") >&5
4779   (eval $ac_compile) 2>&5
4780   ac_status=$?
4781   echo "$as_me:4781: \$? = $ac_status" >&5
4782   (exit $ac_status); } &&
4783          { ac_try='test -s conftest.$ac_objext'
4784   { (eval echo "$as_me:4784: \"$ac_try\"") >&5
4785   (eval $ac_try) 2>&5
4786   ac_status=$?
4787   echo "$as_me:4787: \$? = $ac_status" >&5
4788   (exit $ac_status); }; }; then
4789   cf_cv_ncurses_h=$cf_header
4790
4791 else
4792   echo "$as_me: failed program was:" >&5
4793 cat conftest.$ac_ext >&5
4794 cf_cv_ncurses_h=no
4795 fi
4796 rm -f conftest.$ac_objext conftest.$ac_ext
4797
4798                 test "$cf_cv_ncurses_h" != no && break
4799         done
4800
4801 fi
4802 echo "$as_me:4802: result: $cf_cv_ncurses_h" >&5
4803 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4804
4805 if test "$cf_cv_ncurses_h" != no ; then
4806         cf_cv_ncurses_header=$cf_cv_ncurses_h
4807 else
4808
4809 echo "$as_me:4809: checking for $cf_ncuhdr_root include-path" >&5
4810 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4811 if test "${cf_cv_ncurses_h2+set}" = set; then
4812   echo $ECHO_N "(cached) $ECHO_C" >&6
4813 else
4814
4815         test -n "$verbose" && echo
4816
4817 cf_search=
4818
4819 # collect the current set of include-directories from compiler flags
4820 cf_header_path_list=""
4821 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4822         for cf_header_path in $CPPFLAGS $CFLAGS
4823         do
4824                 case $cf_header_path in
4825                 (-I*)
4826                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4827
4828 test "x$cf_header_path" != "xNONE" && \
4829 test -d "$cf_header_path" && \
4830  {
4831         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4832         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4833         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4834         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4835         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4836         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"
4837 }
4838
4839                         cf_header_path_list="$cf_header_path_list $cf_search"
4840                         ;;
4841                 esac
4842         done
4843 fi
4844
4845 # add the variations for the package we are looking for
4846
4847 cf_search=
4848
4849 test "x$prefix" != "xNONE" && \
4850 test -d "$prefix" && \
4851  {
4852         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4853         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4854         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4855         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4856         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4857         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4858 }
4859
4860 for cf_subdir_prefix in \
4861         /usr \
4862         /usr/local \
4863         /usr/pkg \
4864         /opt \
4865         /opt/local \
4866         $HOME
4867 do
4868
4869 test "x$cf_subdir_prefix" != "x$prefix" && \
4870 test -d "$cf_subdir_prefix" && \
4871 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4872         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4873         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4874         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4875         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4876         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4877         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"
4878 }
4879
4880 done
4881
4882 test "$includedir" != NONE && \
4883 test "$includedir" != "/usr/include" && \
4884 test -d "$includedir" && {
4885         test -d $includedir &&    cf_search="$cf_search $includedir"
4886         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4887 }
4888
4889 test "$oldincludedir" != NONE && \
4890 test "$oldincludedir" != "/usr/include" && \
4891 test -d "$oldincludedir" && {
4892         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4893         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4894 }
4895
4896 cf_search="$cf_search $cf_header_path_list"
4897
4898         test -n "$verbose" && echo search path $cf_search
4899         cf_save2_CPPFLAGS="$CPPFLAGS"
4900         for cf_incdir in $cf_search
4901         do
4902
4903 if test -n "$cf_incdir" ; then
4904   for cf_add_incdir in $cf_incdir
4905   do
4906         while test $cf_add_incdir != /usr/include
4907         do
4908           if test -d $cf_add_incdir
4909           then
4910                 cf_have_incdir=no
4911                 if test -n "$CFLAGS$CPPFLAGS" ; then
4912                   # a loop is needed to ensure we can add subdirs of existing dirs
4913                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4914                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4915                           cf_have_incdir=yes; break
4916                         fi
4917                   done
4918                 fi
4919
4920                 if test "$cf_have_incdir" = no ; then
4921                   if test "$cf_add_incdir" = /usr/local/include ; then
4922                         if test "$GCC" = yes
4923                         then
4924                           cf_save_CPPFLAGS=$CPPFLAGS
4925
4926         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4927         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
4928
4929                           cat >conftest.$ac_ext <<_ACEOF
4930 #line 4930 "configure"
4931 #include "confdefs.h"
4932 #include <stdio.h>
4933 int
4934 main (void)
4935 {
4936 printf("Hello")
4937   ;
4938   return 0;
4939 }
4940 _ACEOF
4941 rm -f conftest.$ac_objext
4942 if { (eval echo "$as_me:4942: \"$ac_compile\"") >&5
4943   (eval $ac_compile) 2>&5
4944   ac_status=$?
4945   echo "$as_me:4945: \$? = $ac_status" >&5
4946   (exit $ac_status); } &&
4947          { ac_try='test -s conftest.$ac_objext'
4948   { (eval echo "$as_me:4948: \"$ac_try\"") >&5
4949   (eval $ac_try) 2>&5
4950   ac_status=$?
4951   echo "$as_me:4951: \$? = $ac_status" >&5
4952   (exit $ac_status); }; }; then
4953   :
4954 else
4955   echo "$as_me: failed program was:" >&5
4956 cat conftest.$ac_ext >&5
4957 cf_have_incdir=yes
4958 fi
4959 rm -f conftest.$ac_objext conftest.$ac_ext
4960                           CPPFLAGS=$cf_save_CPPFLAGS
4961                         fi
4962                   fi
4963                 fi
4964
4965                 if test "$cf_have_incdir" = no ; then
4966                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4967
4968 echo "${as_me:-configure}:4968: testing adding $cf_add_incdir to include-path ..." 1>&5
4969
4970                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4971
4972                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4973                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4974                   cf_add_incdir="$cf_top_incdir"
4975                 else
4976                   break
4977                 fi
4978           else
4979                 break
4980           fi
4981         done
4982   done
4983 fi
4984
4985                 for cf_header in \
4986                         ncurses.h \
4987                         curses.h
4988                 do
4989
4990         cat >conftest.$ac_ext <<_ACEOF
4991 #line 4991 "configure"
4992 #include "confdefs.h"
4993
4994 #include <$cf_header>
4995 int
4996 main (void)
4997 {
4998
4999 #ifdef NCURSES_VERSION
5000
5001 printf("%s\n", NCURSES_VERSION);
5002 #else
5003 #ifdef __NCURSES_H
5004 printf("old\n");
5005 #else
5006         make an error
5007 #endif
5008 #endif
5009
5010   ;
5011   return 0;
5012 }
5013 _ACEOF
5014 rm -f conftest.$ac_objext
5015 if { (eval echo "$as_me:5015: \"$ac_compile\"") >&5
5016   (eval $ac_compile) 2>&5
5017   ac_status=$?
5018   echo "$as_me:5018: \$? = $ac_status" >&5
5019   (exit $ac_status); } &&
5020          { ac_try='test -s conftest.$ac_objext'
5021   { (eval echo "$as_me:5021: \"$ac_try\"") >&5
5022   (eval $ac_try) 2>&5
5023   ac_status=$?
5024   echo "$as_me:5024: \$? = $ac_status" >&5
5025   (exit $ac_status); }; }; then
5026   cf_cv_ncurses_h2=$cf_header
5027
5028 else
5029   echo "$as_me: failed program was:" >&5
5030 cat conftest.$ac_ext >&5
5031 cf_cv_ncurses_h2=no
5032 fi
5033 rm -f conftest.$ac_objext conftest.$ac_ext
5034
5035                         if test "$cf_cv_ncurses_h2" != no ; then
5036                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
5037                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
5038                                 break
5039                         fi
5040                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
5041                 done
5042                 CPPFLAGS="$cf_save2_CPPFLAGS"
5043                 test "$cf_cv_ncurses_h2" != no && break
5044         done
5045         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5045: error: not found" >&5
5046 echo "$as_me: error: not found" >&2;}
5047    { (exit 1); exit 1; }; }
5048
5049 fi
5050 echo "$as_me:5050: result: $cf_cv_ncurses_h2" >&5
5051 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
5052
5053         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
5054         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
5055         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
5056                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
5057         fi
5058
5059 if test -n "$cf_1st_incdir" ; then
5060   for cf_add_incdir in $cf_1st_incdir
5061   do
5062         while test $cf_add_incdir != /usr/include
5063         do
5064           if test -d $cf_add_incdir
5065           then
5066                 cf_have_incdir=no
5067                 if test -n "$CFLAGS$CPPFLAGS" ; then
5068                   # a loop is needed to ensure we can add subdirs of existing dirs
5069                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5070                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5071                           cf_have_incdir=yes; break
5072                         fi
5073                   done
5074                 fi
5075
5076                 if test "$cf_have_incdir" = no ; then
5077                   if test "$cf_add_incdir" = /usr/local/include ; then
5078                         if test "$GCC" = yes
5079                         then
5080                           cf_save_CPPFLAGS=$CPPFLAGS
5081
5082         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5083         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5084
5085                           cat >conftest.$ac_ext <<_ACEOF
5086 #line 5086 "configure"
5087 #include "confdefs.h"
5088 #include <stdio.h>
5089 int
5090 main (void)
5091 {
5092 printf("Hello")
5093   ;
5094   return 0;
5095 }
5096 _ACEOF
5097 rm -f conftest.$ac_objext
5098 if { (eval echo "$as_me:5098: \"$ac_compile\"") >&5
5099   (eval $ac_compile) 2>&5
5100   ac_status=$?
5101   echo "$as_me:5101: \$? = $ac_status" >&5
5102   (exit $ac_status); } &&
5103          { ac_try='test -s conftest.$ac_objext'
5104   { (eval echo "$as_me:5104: \"$ac_try\"") >&5
5105   (eval $ac_try) 2>&5
5106   ac_status=$?
5107   echo "$as_me:5107: \$? = $ac_status" >&5
5108   (exit $ac_status); }; }; then
5109   :
5110 else
5111   echo "$as_me: failed program was:" >&5
5112 cat conftest.$ac_ext >&5
5113 cf_have_incdir=yes
5114 fi
5115 rm -f conftest.$ac_objext conftest.$ac_ext
5116                           CPPFLAGS=$cf_save_CPPFLAGS
5117                         fi
5118                   fi
5119                 fi
5120
5121                 if test "$cf_have_incdir" = no ; then
5122                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5123
5124 echo "${as_me:-configure}:5124: testing adding $cf_add_incdir to include-path ..." 1>&5
5125
5126                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5127
5128                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5129                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5130                   cf_add_incdir="$cf_top_incdir"
5131                 else
5132                   break
5133                 fi
5134           else
5135                 break
5136           fi
5137         done
5138   done
5139 fi
5140
5141 fi
5142
5143 # Set definitions to allow ifdef'ing for ncurses.h
5144
5145 case $cf_cv_ncurses_header in
5146 (*ncurses.h)
5147
5148 cat >>confdefs.h <<\EOF
5149 #define HAVE_NCURSES_H 1
5150 EOF
5151
5152         ;;
5153 esac
5154
5155 case $cf_cv_ncurses_header in
5156 (ncurses/curses.h|ncurses/ncurses.h)
5157
5158 cat >>confdefs.h <<\EOF
5159 #define HAVE_NCURSES_NCURSES_H 1
5160 EOF
5161
5162         ;;
5163 (ncursesw/curses.h|ncursesw/ncurses.h)
5164
5165 cat >>confdefs.h <<\EOF
5166 #define HAVE_NCURSESW_NCURSES_H 1
5167 EOF
5168
5169         ;;
5170 esac
5171
5172 echo "$as_me:5172: checking for terminfo header" >&5
5173 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5174 if test "${cf_cv_term_header+set}" = set; then
5175   echo $ECHO_N "(cached) $ECHO_C" >&6
5176 else
5177
5178 case ${cf_cv_ncurses_header} in
5179 (*/ncurses.h|*/ncursesw.h)
5180         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5181         ;;
5182 (*)
5183         cf_term_header=term.h
5184         ;;
5185 esac
5186
5187 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5188 do
5189 cat >conftest.$ac_ext <<_ACEOF
5190 #line 5190 "configure"
5191 #include "confdefs.h"
5192 #include <stdio.h>
5193 #include <${cf_cv_ncurses_header:-curses.h}>
5194 #include <$cf_test>
5195
5196 int
5197 main (void)
5198 {
5199 int x = auto_left_margin
5200   ;
5201   return 0;
5202 }
5203 _ACEOF
5204 rm -f conftest.$ac_objext
5205 if { (eval echo "$as_me:5205: \"$ac_compile\"") >&5
5206   (eval $ac_compile) 2>&5
5207   ac_status=$?
5208   echo "$as_me:5208: \$? = $ac_status" >&5
5209   (exit $ac_status); } &&
5210          { ac_try='test -s conftest.$ac_objext'
5211   { (eval echo "$as_me:5211: \"$ac_try\"") >&5
5212   (eval $ac_try) 2>&5
5213   ac_status=$?
5214   echo "$as_me:5214: \$? = $ac_status" >&5
5215   (exit $ac_status); }; }; then
5216
5217         cf_cv_term_header="$cf_test"
5218 else
5219   echo "$as_me: failed program was:" >&5
5220 cat conftest.$ac_ext >&5
5221
5222         cf_cv_term_header=unknown
5223
5224 fi
5225 rm -f conftest.$ac_objext conftest.$ac_ext
5226         test "$cf_cv_term_header" != unknown && break
5227 done
5228
5229 fi
5230 echo "$as_me:5230: result: $cf_cv_term_header" >&5
5231 echo "${ECHO_T}$cf_cv_term_header" >&6
5232
5233 # Set definitions to allow ifdef'ing to accommodate subdirectories
5234
5235 case $cf_cv_term_header in
5236 (*term.h)
5237
5238 cat >>confdefs.h <<\EOF
5239 #define HAVE_TERM_H 1
5240 EOF
5241
5242         ;;
5243 esac
5244
5245 case $cf_cv_term_header in
5246 (ncurses/term.h)
5247
5248 cat >>confdefs.h <<\EOF
5249 #define HAVE_NCURSES_TERM_H 1
5250 EOF
5251
5252         ;;
5253 (ncursesw/term.h)
5254
5255 cat >>confdefs.h <<\EOF
5256 #define HAVE_NCURSESW_TERM_H 1
5257 EOF
5258
5259         ;;
5260 esac
5261
5262 # some applications need this, but should check for NCURSES_VERSION
5263
5264 cat >>confdefs.h <<\EOF
5265 #define NCURSES 1
5266 EOF
5267
5268 echo "$as_me:5268: checking for ncurses version" >&5
5269 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5270 if test "${cf_cv_ncurses_version+set}" = set; then
5271   echo $ECHO_N "(cached) $ECHO_C" >&6
5272 else
5273
5274         cf_cv_ncurses_version=no
5275         cf_tempfile=out$$
5276         rm -f $cf_tempfile
5277         if test "$cross_compiling" = yes; then
5278
5279         # This will not work if the preprocessor splits the line after the
5280         # Autoconf token.  The 'unproto' program does that.
5281         cat > conftest.$ac_ext <<EOF
5282 #include <${cf_cv_ncurses_header:-curses.h}>
5283 #undef Autoconf
5284 #ifdef NCURSES_VERSION
5285 Autoconf NCURSES_VERSION
5286 #else
5287 #ifdef __NCURSES_H
5288 Autoconf "old"
5289 #endif
5290 ;
5291 #endif
5292 EOF
5293         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5294         { (eval echo "$as_me:5294: \"$cf_try\"") >&5
5295   (eval $cf_try) 2>&5
5296   ac_status=$?
5297   echo "$as_me:5297: \$? = $ac_status" >&5
5298   (exit $ac_status); }
5299         if test -f conftest.out ; then
5300                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5301                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5302                 rm -f conftest.out
5303         fi
5304
5305 else
5306   cat >conftest.$ac_ext <<_ACEOF
5307 #line 5307 "configure"
5308 #include "confdefs.h"
5309
5310 #include <${cf_cv_ncurses_header:-curses.h}>
5311 #include <stdio.h>
5312 int main(void)
5313 {
5314         FILE *fp = fopen("$cf_tempfile", "w");
5315 #ifdef NCURSES_VERSION
5316 # ifdef NCURSES_VERSION_PATCH
5317         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5318 # else
5319         fprintf(fp, "%s\n", NCURSES_VERSION);
5320 # endif
5321 #else
5322 # ifdef __NCURSES_H
5323         fprintf(fp, "old\n");
5324 # else
5325         make an error
5326 # endif
5327 #endif
5328         ${cf_cv_main_return:-return}(0);
5329 }
5330 _ACEOF
5331 rm -f conftest$ac_exeext
5332 if { (eval echo "$as_me:5332: \"$ac_link\"") >&5
5333   (eval $ac_link) 2>&5
5334   ac_status=$?
5335   echo "$as_me:5335: \$? = $ac_status" >&5
5336   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5337   { (eval echo "$as_me:5337: \"$ac_try\"") >&5
5338   (eval $ac_try) 2>&5
5339   ac_status=$?
5340   echo "$as_me:5340: \$? = $ac_status" >&5
5341   (exit $ac_status); }; }; then
5342
5343         cf_cv_ncurses_version=`cat $cf_tempfile`
5344 else
5345   echo "$as_me: program exited with status $ac_status" >&5
5346 echo "$as_me: failed program was:" >&5
5347 cat conftest.$ac_ext >&5
5348 fi
5349 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5350 fi
5351         rm -f $cf_tempfile
5352
5353 fi
5354 echo "$as_me:5354: result: $cf_cv_ncurses_version" >&5
5355 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5356 test "$cf_cv_ncurses_version" = no ||
5357 cat >>confdefs.h <<\EOF
5358 #define NCURSES 1
5359 EOF
5360
5361 cf_nculib_root=ncurses
5362         # This works, except for the special case where we find gpm, but
5363         # ncurses is in a nonstandard location via $LIBS, and we really want
5364         # to link gpm.
5365 cf_ncurses_LIBS=""
5366 cf_ncurses_SAVE="$LIBS"
5367 echo "$as_me:5367: checking for Gpm_Open in -lgpm" >&5
5368 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5369 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5370   echo $ECHO_N "(cached) $ECHO_C" >&6
5371 else
5372   ac_check_lib_save_LIBS=$LIBS
5373 LIBS="-lgpm  $LIBS"
5374 cat >conftest.$ac_ext <<_ACEOF
5375 #line 5375 "configure"
5376 #include "confdefs.h"
5377
5378 /* Override any gcc2 internal prototype to avoid an error.  */
5379 #ifdef __cplusplus
5380 extern "C"
5381 #endif
5382 /* We use char because int might match the return type of a gcc2
5383    builtin and then its argument prototype would still apply.  */
5384 char Gpm_Open ();
5385 int
5386 main (void)
5387 {
5388 Gpm_Open ();
5389   ;
5390   return 0;
5391 }
5392 _ACEOF
5393 rm -f conftest.$ac_objext conftest$ac_exeext
5394 if { (eval echo "$as_me:5394: \"$ac_link\"") >&5
5395   (eval $ac_link) 2>&5
5396   ac_status=$?
5397   echo "$as_me:5397: \$? = $ac_status" >&5
5398   (exit $ac_status); } &&
5399          { ac_try='test -s conftest$ac_exeext'
5400   { (eval echo "$as_me:5400: \"$ac_try\"") >&5
5401   (eval $ac_try) 2>&5
5402   ac_status=$?
5403   echo "$as_me:5403: \$? = $ac_status" >&5
5404   (exit $ac_status); }; }; then
5405   ac_cv_lib_gpm_Gpm_Open=yes
5406 else
5407   echo "$as_me: failed program was:" >&5
5408 cat conftest.$ac_ext >&5
5409 ac_cv_lib_gpm_Gpm_Open=no
5410 fi
5411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5412 LIBS=$ac_check_lib_save_LIBS
5413 fi
5414 echo "$as_me:5414: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5415 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5416 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5417   echo "$as_me:5417: checking for initscr in -lgpm" >&5
5418 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5419 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5420   echo $ECHO_N "(cached) $ECHO_C" >&6
5421 else
5422   ac_check_lib_save_LIBS=$LIBS
5423 LIBS="-lgpm  $LIBS"
5424 cat >conftest.$ac_ext <<_ACEOF
5425 #line 5425 "configure"
5426 #include "confdefs.h"
5427
5428 /* Override any gcc2 internal prototype to avoid an error.  */
5429 #ifdef __cplusplus
5430 extern "C"
5431 #endif
5432 /* We use char because int might match the return type of a gcc2
5433    builtin and then its argument prototype would still apply.  */
5434 char initscr ();
5435 int
5436 main (void)
5437 {
5438 initscr ();
5439   ;
5440   return 0;
5441 }
5442 _ACEOF
5443 rm -f conftest.$ac_objext conftest$ac_exeext
5444 if { (eval echo "$as_me:5444: \"$ac_link\"") >&5
5445   (eval $ac_link) 2>&5
5446   ac_status=$?
5447   echo "$as_me:5447: \$? = $ac_status" >&5
5448   (exit $ac_status); } &&
5449          { ac_try='test -s conftest$ac_exeext'
5450   { (eval echo "$as_me:5450: \"$ac_try\"") >&5
5451   (eval $ac_try) 2>&5
5452   ac_status=$?
5453   echo "$as_me:5453: \$? = $ac_status" >&5
5454   (exit $ac_status); }; }; then
5455   ac_cv_lib_gpm_initscr=yes
5456 else
5457   echo "$as_me: failed program was:" >&5
5458 cat conftest.$ac_ext >&5
5459 ac_cv_lib_gpm_initscr=no
5460 fi
5461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5462 LIBS=$ac_check_lib_save_LIBS
5463 fi
5464 echo "$as_me:5464: result: $ac_cv_lib_gpm_initscr" >&5
5465 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5466 if test $ac_cv_lib_gpm_initscr = yes; then
5467   LIBS="$cf_ncurses_SAVE"
5468 else
5469   cf_ncurses_LIBS="-lgpm"
5470 fi
5471
5472 fi
5473
5474 case $host_os in
5475 (freebsd*)
5476         # This is only necessary if you are linking against an obsolete
5477         # version of ncurses (but it should do no harm, since it's static).
5478         if test "$cf_nculib_root" = ncurses ; then
5479                 echo "$as_me:5479: checking for tgoto in -lmytinfo" >&5
5480 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5481 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5482   echo $ECHO_N "(cached) $ECHO_C" >&6
5483 else
5484   ac_check_lib_save_LIBS=$LIBS
5485 LIBS="-lmytinfo  $LIBS"
5486 cat >conftest.$ac_ext <<_ACEOF
5487 #line 5487 "configure"
5488 #include "confdefs.h"
5489
5490 /* Override any gcc2 internal prototype to avoid an error.  */
5491 #ifdef __cplusplus
5492 extern "C"
5493 #endif
5494 /* We use char because int might match the return type of a gcc2
5495    builtin and then its argument prototype would still apply.  */
5496 char tgoto ();
5497 int
5498 main (void)
5499 {
5500 tgoto ();
5501   ;
5502   return 0;
5503 }
5504 _ACEOF
5505 rm -f conftest.$ac_objext conftest$ac_exeext
5506 if { (eval echo "$as_me:5506: \"$ac_link\"") >&5
5507   (eval $ac_link) 2>&5
5508   ac_status=$?
5509   echo "$as_me:5509: \$? = $ac_status" >&5
5510   (exit $ac_status); } &&
5511          { ac_try='test -s conftest$ac_exeext'
5512   { (eval echo "$as_me:5512: \"$ac_try\"") >&5
5513   (eval $ac_try) 2>&5
5514   ac_status=$?
5515   echo "$as_me:5515: \$? = $ac_status" >&5
5516   (exit $ac_status); }; }; then
5517   ac_cv_lib_mytinfo_tgoto=yes
5518 else
5519   echo "$as_me: failed program was:" >&5
5520 cat conftest.$ac_ext >&5
5521 ac_cv_lib_mytinfo_tgoto=no
5522 fi
5523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5524 LIBS=$ac_check_lib_save_LIBS
5525 fi
5526 echo "$as_me:5526: result: $ac_cv_lib_mytinfo_tgoto" >&5
5527 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5528 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5529   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5530 fi
5531
5532         fi
5533         ;;
5534 esac
5535
5536 cf_add_libs="$cf_ncurses_LIBS"
5537 # Filter out duplicates - this happens with badly-designed ".pc" files...
5538 for cf_add_1lib in $LIBS
5539 do
5540         for cf_add_2lib in $cf_add_libs
5541         do
5542                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5543                 then
5544                         cf_add_1lib=
5545                         break
5546                 fi
5547         done
5548         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5549 done
5550 LIBS="$cf_add_libs"
5551
5552 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5553 then
5554
5555 cf_add_libs="-l$cf_nculib_root"
5556 # Filter out duplicates - this happens with badly-designed ".pc" files...
5557 for cf_add_1lib in $LIBS
5558 do
5559         for cf_add_2lib in $cf_add_libs
5560         do
5561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5562                 then
5563                         cf_add_1lib=
5564                         break
5565                 fi
5566         done
5567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5568 done
5569 LIBS="$cf_add_libs"
5570
5571 else
5572
5573         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5574         cf_libdir=""
5575         echo "$as_me:5575: checking for initscr" >&5
5576 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5577 if test "${ac_cv_func_initscr+set}" = set; then
5578   echo $ECHO_N "(cached) $ECHO_C" >&6
5579 else
5580   cat >conftest.$ac_ext <<_ACEOF
5581 #line 5581 "configure"
5582 #include "confdefs.h"
5583 /* System header to define __stub macros and hopefully few prototypes,
5584     which can conflict with char initscr (); below.  */
5585 #include <assert.h>
5586 /* Override any gcc2 internal prototype to avoid an error.  */
5587 #ifdef __cplusplus
5588 extern "C"
5589 #endif
5590 /* We use char because int might match the return type of a gcc2
5591    builtin and then its argument prototype would still apply.  */
5592 char initscr ();
5593 char (*f) ();
5594
5595 int
5596 main (void)
5597 {
5598 /* The GNU C library defines this for functions which it implements
5599     to always fail with ENOSYS.  Some functions are actually named
5600     something starting with __ and the normal name is an alias.  */
5601 #if defined (__stub_initscr) || defined (__stub___initscr)
5602 choke me
5603 #else
5604 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5605 #endif
5606
5607   ;
5608   return 0;
5609 }
5610 _ACEOF
5611 rm -f conftest.$ac_objext conftest$ac_exeext
5612 if { (eval echo "$as_me:5612: \"$ac_link\"") >&5
5613   (eval $ac_link) 2>&5
5614   ac_status=$?
5615   echo "$as_me:5615: \$? = $ac_status" >&5
5616   (exit $ac_status); } &&
5617          { ac_try='test -s conftest$ac_exeext'
5618   { (eval echo "$as_me:5618: \"$ac_try\"") >&5
5619   (eval $ac_try) 2>&5
5620   ac_status=$?
5621   echo "$as_me:5621: \$? = $ac_status" >&5
5622   (exit $ac_status); }; }; then
5623   ac_cv_func_initscr=yes
5624 else
5625   echo "$as_me: failed program was:" >&5
5626 cat conftest.$ac_ext >&5
5627 ac_cv_func_initscr=no
5628 fi
5629 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5630 fi
5631 echo "$as_me:5631: result: $ac_cv_func_initscr" >&5
5632 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5633 if test $ac_cv_func_initscr = yes; then
5634   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5635 else
5636
5637                 cf_save_LIBS="$LIBS"
5638                 echo "$as_me:5638: checking for initscr in -l$cf_nculib_root" >&5
5639 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5640                 LIBS="-l$cf_nculib_root $LIBS"
5641                 cat >conftest.$ac_ext <<_ACEOF
5642 #line 5642 "configure"
5643 #include "confdefs.h"
5644 #include <${cf_cv_ncurses_header:-curses.h}>
5645 int
5646 main (void)
5647 {
5648 initscr()
5649   ;
5650   return 0;
5651 }
5652 _ACEOF
5653 rm -f conftest.$ac_objext conftest$ac_exeext
5654 if { (eval echo "$as_me:5654: \"$ac_link\"") >&5
5655   (eval $ac_link) 2>&5
5656   ac_status=$?
5657   echo "$as_me:5657: \$? = $ac_status" >&5
5658   (exit $ac_status); } &&
5659          { ac_try='test -s conftest$ac_exeext'
5660   { (eval echo "$as_me:5660: \"$ac_try\"") >&5
5661   (eval $ac_try) 2>&5
5662   ac_status=$?
5663   echo "$as_me:5663: \$? = $ac_status" >&5
5664   (exit $ac_status); }; }; then
5665   echo "$as_me:5665: result: yes" >&5
5666 echo "${ECHO_T}yes" >&6
5667                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5668
5669 else
5670   echo "$as_me: failed program was:" >&5
5671 cat conftest.$ac_ext >&5
5672 echo "$as_me:5672: result: no" >&5
5673 echo "${ECHO_T}no" >&6
5674
5675 cf_search=
5676 cf_library_path_list=""
5677 if test -n "${LDFLAGS}${LIBS}" ; then
5678         for cf_library_path in $LDFLAGS $LIBS
5679         do
5680                 case $cf_library_path in
5681                 (-L*)
5682                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5683
5684 test "x$cf_library_path" != "xNONE" && \
5685 test -d "$cf_library_path" && \
5686  {
5687         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5688         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5689         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5690         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5691         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5692         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"
5693 }
5694
5695                         cf_library_path_list="$cf_library_path_list $cf_search"
5696                         ;;
5697                 esac
5698         done
5699 fi
5700
5701 cf_search=
5702
5703 test "x$prefix" != "xNONE" && \
5704 test -d "$prefix" && \
5705  {
5706         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5707         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5708         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5709         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5710         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5711         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5712 }
5713
5714 for cf_subdir_prefix in \
5715         /usr \
5716         /usr/local \
5717         /usr/pkg \
5718         /opt \
5719         /opt/local \
5720         $HOME
5721 do
5722
5723 test "x$cf_subdir_prefix" != "x$prefix" && \
5724 test -d "$cf_subdir_prefix" && \
5725 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5726         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5727         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5728         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5729         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5730         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5731         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"
5732 }
5733
5734 done
5735
5736 cf_search="$cf_library_path_list $cf_search"
5737
5738                         for cf_libdir in $cf_search
5739                         do
5740                                 echo "$as_me:5740: checking for -l$cf_nculib_root in $cf_libdir" >&5
5741 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5742                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5743                                 cat >conftest.$ac_ext <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746 #include <${cf_cv_ncurses_header:-curses.h}>
5747 int
5748 main (void)
5749 {
5750 initscr()
5751   ;
5752   return 0;
5753 }
5754 _ACEOF
5755 rm -f conftest.$ac_objext conftest$ac_exeext
5756 if { (eval echo "$as_me:5756: \"$ac_link\"") >&5
5757   (eval $ac_link) 2>&5
5758   ac_status=$?
5759   echo "$as_me:5759: \$? = $ac_status" >&5
5760   (exit $ac_status); } &&
5761          { ac_try='test -s conftest$ac_exeext'
5762   { (eval echo "$as_me:5762: \"$ac_try\"") >&5
5763   (eval $ac_try) 2>&5
5764   ac_status=$?
5765   echo "$as_me:5765: \$? = $ac_status" >&5
5766   (exit $ac_status); }; }; then
5767   echo "$as_me:5767: result: yes" >&5
5768 echo "${ECHO_T}yes" >&6
5769                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5770                                          break
5771 else
5772   echo "$as_me: failed program was:" >&5
5773 cat conftest.$ac_ext >&5
5774 echo "$as_me:5774: result: no" >&5
5775 echo "${ECHO_T}no" >&6
5776                                          LIBS="$cf_save_LIBS"
5777 fi
5778 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5779                         done
5780
5781 fi
5782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5783
5784 fi
5785
5786 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5787
5788 if test $cf_found_library = no ; then
5789         { { echo "$as_me:5789: error: Cannot link $cf_nculib_root library" >&5
5790 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5791    { (exit 1); exit 1; }; }
5792 fi
5793
5794 fi
5795
5796 if test -n "$cf_ncurses_LIBS" ; then
5797         echo "$as_me:5797: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5798 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5799         cf_ncurses_SAVE="$LIBS"
5800         for p in $cf_ncurses_LIBS ; do
5801                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5802                 if test "$q" != "$LIBS" ; then
5803                         LIBS="$q"
5804                 fi
5805         done
5806         cat >conftest.$ac_ext <<_ACEOF
5807 #line 5807 "configure"
5808 #include "confdefs.h"
5809 #include <${cf_cv_ncurses_header:-curses.h}>
5810 int
5811 main (void)
5812 {
5813 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5814   ;
5815   return 0;
5816 }
5817 _ACEOF
5818 rm -f conftest.$ac_objext conftest$ac_exeext
5819 if { (eval echo "$as_me:5819: \"$ac_link\"") >&5
5820   (eval $ac_link) 2>&5
5821   ac_status=$?
5822   echo "$as_me:5822: \$? = $ac_status" >&5
5823   (exit $ac_status); } &&
5824          { ac_try='test -s conftest$ac_exeext'
5825   { (eval echo "$as_me:5825: \"$ac_try\"") >&5
5826   (eval $ac_try) 2>&5
5827   ac_status=$?
5828   echo "$as_me:5828: \$? = $ac_status" >&5
5829   (exit $ac_status); }; }; then
5830   echo "$as_me:5830: result: yes" >&5
5831 echo "${ECHO_T}yes" >&6
5832 else
5833   echo "$as_me: failed program was:" >&5
5834 cat conftest.$ac_ext >&5
5835 echo "$as_me:5835: result: no" >&5
5836 echo "${ECHO_T}no" >&6
5837                  LIBS="$cf_ncurses_SAVE"
5838 fi
5839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5840 fi
5841
5842 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5843
5844 cat >>confdefs.h <<EOF
5845 #define $cf_nculib_ROOT 1
5846 EOF
5847
5848         fi
5849 else
5850         NCURSES_CONFIG=none
5851 fi
5852
5853 echo "$as_me:5853: checking if you want wide-character code" >&5
5854 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5855
5856 # Check whether --enable-widec or --disable-widec was given.
5857 if test "${enable_widec+set}" = set; then
5858   enableval="$enable_widec"
5859   with_widec=$enableval
5860 else
5861   with_widec=no
5862 fi;
5863 echo "$as_me:5863: result: $with_widec" >&5
5864 echo "${ECHO_T}$with_widec" >&6
5865 if test "$with_widec" = yes ; then
5866
5867 echo "$as_me:5867: checking for multibyte character support" >&5
5868 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5869 if test "${cf_cv_utf8_lib+set}" = set; then
5870   echo $ECHO_N "(cached) $ECHO_C" >&6
5871 else
5872
5873         cf_save_LIBS="$LIBS"
5874         cat >conftest.$ac_ext <<_ACEOF
5875 #line 5875 "configure"
5876 #include "confdefs.h"
5877
5878 #include <stdlib.h>
5879 int
5880 main (void)
5881 {
5882 putwc(0,0);
5883   ;
5884   return 0;
5885 }
5886 _ACEOF
5887 rm -f conftest.$ac_objext conftest$ac_exeext
5888 if { (eval echo "$as_me:5888: \"$ac_link\"") >&5
5889   (eval $ac_link) 2>&5
5890   ac_status=$?
5891   echo "$as_me:5891: \$? = $ac_status" >&5
5892   (exit $ac_status); } &&
5893          { ac_try='test -s conftest$ac_exeext'
5894   { (eval echo "$as_me:5894: \"$ac_try\"") >&5
5895   (eval $ac_try) 2>&5
5896   ac_status=$?
5897   echo "$as_me:5897: \$? = $ac_status" >&5
5898   (exit $ac_status); }; }; then
5899   cf_cv_utf8_lib=yes
5900 else
5901   echo "$as_me: failed program was:" >&5
5902 cat conftest.$ac_ext >&5
5903
5904 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5905 # will be set on completion of the AC_TRY_LINK below.
5906 cf_cv_header_path_utf8=
5907 cf_cv_library_path_utf8=
5908
5909 echo "${as_me:-configure}:5909: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5910
5911 cf_save_LIBS="$LIBS"
5912
5913 cat >conftest.$ac_ext <<_ACEOF
5914 #line 5914 "configure"
5915 #include "confdefs.h"
5916
5917 #include <libutf8.h>
5918 int
5919 main (void)
5920 {
5921 putwc(0,0);
5922   ;
5923   return 0;
5924 }
5925 _ACEOF
5926 rm -f conftest.$ac_objext conftest$ac_exeext
5927 if { (eval echo "$as_me:5927: \"$ac_link\"") >&5
5928   (eval $ac_link) 2>&5
5929   ac_status=$?
5930   echo "$as_me:5930: \$? = $ac_status" >&5
5931   (exit $ac_status); } &&
5932          { ac_try='test -s conftest$ac_exeext'
5933   { (eval echo "$as_me:5933: \"$ac_try\"") >&5
5934   (eval $ac_try) 2>&5
5935   ac_status=$?
5936   echo "$as_me:5936: \$? = $ac_status" >&5
5937   (exit $ac_status); }; }; then
5938
5939         cf_cv_find_linkage_utf8=yes
5940         cf_cv_header_path_utf8=/usr/include
5941         cf_cv_library_path_utf8=/usr/lib
5942
5943 else
5944   echo "$as_me: failed program was:" >&5
5945 cat conftest.$ac_ext >&5
5946
5947 LIBS="-lutf8  $cf_save_LIBS"
5948
5949 cat >conftest.$ac_ext <<_ACEOF
5950 #line 5950 "configure"
5951 #include "confdefs.h"
5952
5953 #include <libutf8.h>
5954 int
5955 main (void)
5956 {
5957 putwc(0,0);
5958   ;
5959   return 0;
5960 }
5961 _ACEOF
5962 rm -f conftest.$ac_objext conftest$ac_exeext
5963 if { (eval echo "$as_me:5963: \"$ac_link\"") >&5
5964   (eval $ac_link) 2>&5
5965   ac_status=$?
5966   echo "$as_me:5966: \$? = $ac_status" >&5
5967   (exit $ac_status); } &&
5968          { ac_try='test -s conftest$ac_exeext'
5969   { (eval echo "$as_me:5969: \"$ac_try\"") >&5
5970   (eval $ac_try) 2>&5
5971   ac_status=$?
5972   echo "$as_me:5972: \$? = $ac_status" >&5
5973   (exit $ac_status); }; }; then
5974
5975         cf_cv_find_linkage_utf8=yes
5976         cf_cv_header_path_utf8=/usr/include
5977         cf_cv_library_path_utf8=/usr/lib
5978         cf_cv_library_file_utf8="-lutf8"
5979
5980 else
5981   echo "$as_me: failed program was:" >&5
5982 cat conftest.$ac_ext >&5
5983
5984         cf_cv_find_linkage_utf8=no
5985         LIBS="$cf_save_LIBS"
5986
5987         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5988
5989 echo "${as_me:-configure}:5989: testing find linkage for utf8 library ..." 1>&5
5990
5991 echo "${as_me:-configure}:5991: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5992
5993         cf_save_CPPFLAGS="$CPPFLAGS"
5994         cf_test_CPPFLAGS="$CPPFLAGS"
5995
5996 cf_search=
5997
5998 # collect the current set of include-directories from compiler flags
5999 cf_header_path_list=""
6000 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6001         for cf_header_path in $CPPFLAGS $CFLAGS
6002         do
6003                 case $cf_header_path in
6004                 (-I*)
6005                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6006
6007 test "x$cf_header_path" != "xNONE" && \
6008 test -d "$cf_header_path" && \
6009  {
6010         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6011         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6012         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6013         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6014         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6015         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6016 }
6017
6018                         cf_header_path_list="$cf_header_path_list $cf_search"
6019                         ;;
6020                 esac
6021         done
6022 fi
6023
6024 # add the variations for the package we are looking for
6025
6026 cf_search=
6027
6028 test "x$prefix" != "xNONE" && \
6029 test -d "$prefix" && \
6030  {
6031         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6032         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6033         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6034         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6035         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6036         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6037 }
6038
6039 for cf_subdir_prefix in \
6040         /usr \
6041         /usr/local \
6042         /usr/pkg \
6043         /opt \
6044         /opt/local \
6045         $HOME
6046 do
6047
6048 test "x$cf_subdir_prefix" != "x$prefix" && \
6049 test -d "$cf_subdir_prefix" && \
6050 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6051         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6052         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6053         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6054         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6055         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6056         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6057 }
6058
6059 done
6060
6061 test "$includedir" != NONE && \
6062 test "$includedir" != "/usr/include" && \
6063 test -d "$includedir" && {
6064         test -d $includedir &&    cf_search="$cf_search $includedir"
6065         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6066 }
6067
6068 test "$oldincludedir" != NONE && \
6069 test "$oldincludedir" != "/usr/include" && \
6070 test -d "$oldincludedir" && {
6071         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6072         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6073 }
6074
6075 cf_search="$cf_search $cf_header_path_list"
6076
6077         for cf_cv_header_path_utf8 in $cf_search
6078         do
6079                 if test -d $cf_cv_header_path_utf8 ; then
6080                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6081
6082 echo "${as_me:-configure}:6082: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6083
6084                         CPPFLAGS="$cf_save_CPPFLAGS"
6085
6086         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6087         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6088
6089                         cat >conftest.$ac_ext <<_ACEOF
6090 #line 6090 "configure"
6091 #include "confdefs.h"
6092
6093 #include <libutf8.h>
6094 int
6095 main (void)
6096 {
6097 putwc(0,0);
6098   ;
6099   return 0;
6100 }
6101 _ACEOF
6102 rm -f conftest.$ac_objext
6103 if { (eval echo "$as_me:6103: \"$ac_compile\"") >&5
6104   (eval $ac_compile) 2>&5
6105   ac_status=$?
6106   echo "$as_me:6106: \$? = $ac_status" >&5
6107   (exit $ac_status); } &&
6108          { ac_try='test -s conftest.$ac_objext'
6109   { (eval echo "$as_me:6109: \"$ac_try\"") >&5
6110   (eval $ac_try) 2>&5
6111   ac_status=$?
6112   echo "$as_me:6112: \$? = $ac_status" >&5
6113   (exit $ac_status); }; }; then
6114
6115                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6116
6117 echo "${as_me:-configure}:6117: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6118
6119                                 cf_cv_find_linkage_utf8=maybe
6120                                 cf_test_CPPFLAGS="$CPPFLAGS"
6121                                 break
6122 else
6123   echo "$as_me: failed program was:" >&5
6124 cat conftest.$ac_ext >&5
6125
6126                                 CPPFLAGS="$cf_save_CPPFLAGS"
6127
6128 fi
6129 rm -f conftest.$ac_objext conftest.$ac_ext
6130                 fi
6131         done
6132
6133         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6134
6135 echo "${as_me:-configure}:6135: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6136
6137                 cf_save_LIBS="$LIBS"
6138                 cf_save_LDFLAGS="$LDFLAGS"
6139
6140                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6141
6142 cf_search=
6143 cf_library_path_list=""
6144 if test -n "${LDFLAGS}${LIBS}" ; then
6145         for cf_library_path in $LDFLAGS $LIBS
6146         do
6147                 case $cf_library_path in
6148                 (-L*)
6149                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6150
6151 test "x$cf_library_path" != "xNONE" && \
6152 test -d "$cf_library_path" && \
6153  {
6154         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6155         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6156         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6157         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6158         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6159         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6160 }
6161
6162                         cf_library_path_list="$cf_library_path_list $cf_search"
6163                         ;;
6164                 esac
6165         done
6166 fi
6167
6168 cf_search=
6169
6170 test "x$prefix" != "xNONE" && \
6171 test -d "$prefix" && \
6172  {
6173         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6174         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6175         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6176         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6177         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6178         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6179 }
6180
6181 for cf_subdir_prefix in \
6182         /usr \
6183         /usr/local \
6184         /usr/pkg \
6185         /opt \
6186         /opt/local \
6187         $HOME
6188 do
6189
6190 test "x$cf_subdir_prefix" != "x$prefix" && \
6191 test -d "$cf_subdir_prefix" && \
6192 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6193         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6194         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6195         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6196         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6197         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6198         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6199 }
6200
6201 done
6202
6203 cf_search="$cf_library_path_list $cf_search"
6204
6205                         for cf_cv_library_path_utf8 in $cf_search
6206                         do
6207                                 if test -d $cf_cv_library_path_utf8 ; then
6208                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6209
6210 echo "${as_me:-configure}:6210: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6211
6212                                         CPPFLAGS="$cf_test_CPPFLAGS"
6213                                         LIBS="-lutf8  $cf_save_LIBS"
6214                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6215                                         cat >conftest.$ac_ext <<_ACEOF
6216 #line 6216 "configure"
6217 #include "confdefs.h"
6218
6219 #include <libutf8.h>
6220 int
6221 main (void)
6222 {
6223 putwc(0,0);
6224   ;
6225   return 0;
6226 }
6227 _ACEOF
6228 rm -f conftest.$ac_objext conftest$ac_exeext
6229 if { (eval echo "$as_me:6229: \"$ac_link\"") >&5
6230   (eval $ac_link) 2>&5
6231   ac_status=$?
6232   echo "$as_me:6232: \$? = $ac_status" >&5
6233   (exit $ac_status); } &&
6234          { ac_try='test -s conftest$ac_exeext'
6235   { (eval echo "$as_me:6235: \"$ac_try\"") >&5
6236   (eval $ac_try) 2>&5
6237   ac_status=$?
6238   echo "$as_me:6238: \$? = $ac_status" >&5
6239   (exit $ac_status); }; }; then
6240
6241                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6242
6243 echo "${as_me:-configure}:6243: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6244
6245                                         cf_cv_find_linkage_utf8=yes
6246                                         cf_cv_library_file_utf8="-lutf8"
6247                                         break
6248 else
6249   echo "$as_me: failed program was:" >&5
6250 cat conftest.$ac_ext >&5
6251
6252                                         CPPFLAGS="$cf_save_CPPFLAGS"
6253                                         LIBS="$cf_save_LIBS"
6254                                         LDFLAGS="$cf_save_LDFLAGS"
6255
6256 fi
6257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6258                                 fi
6259                         done
6260                         CPPFLAGS="$cf_save_CPPFLAGS"
6261                         LDFLAGS="$cf_save_LDFLAGS"
6262                 fi
6263
6264         else
6265                 cf_cv_find_linkage_utf8=no
6266         fi
6267
6268 fi
6269 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6270
6271 fi
6272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6273
6274 LIBS="$cf_save_LIBS"
6275
6276 if test "$cf_cv_find_linkage_utf8" = yes ; then
6277 cf_cv_utf8_lib=add-on
6278 else
6279 cf_cv_utf8_lib=no
6280 fi
6281
6282 fi
6283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6284 fi
6285 echo "$as_me:6285: result: $cf_cv_utf8_lib" >&5
6286 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6287
6288 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6289 # ncurses/ncursesw:
6290 if test "$cf_cv_utf8_lib" = "add-on" ; then
6291
6292 cat >>confdefs.h <<\EOF
6293 #define HAVE_LIBUTF8_H 1
6294 EOF
6295
6296 if test -n "$cf_cv_header_path_utf8" ; then
6297   for cf_add_incdir in $cf_cv_header_path_utf8
6298   do
6299         while test $cf_add_incdir != /usr/include
6300         do
6301           if test -d $cf_add_incdir
6302           then
6303                 cf_have_incdir=no
6304                 if test -n "$CFLAGS$CPPFLAGS" ; then
6305                   # a loop is needed to ensure we can add subdirs of existing dirs
6306                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6307                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6308                           cf_have_incdir=yes; break
6309                         fi
6310                   done
6311                 fi
6312
6313                 if test "$cf_have_incdir" = no ; then
6314                   if test "$cf_add_incdir" = /usr/local/include ; then
6315                         if test "$GCC" = yes
6316                         then
6317                           cf_save_CPPFLAGS=$CPPFLAGS
6318
6319         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6320         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
6321
6322                           cat >conftest.$ac_ext <<_ACEOF
6323 #line 6323 "configure"
6324 #include "confdefs.h"
6325 #include <stdio.h>
6326 int
6327 main (void)
6328 {
6329 printf("Hello")
6330   ;
6331   return 0;
6332 }
6333 _ACEOF
6334 rm -f conftest.$ac_objext
6335 if { (eval echo "$as_me:6335: \"$ac_compile\"") >&5
6336   (eval $ac_compile) 2>&5
6337   ac_status=$?
6338   echo "$as_me:6338: \$? = $ac_status" >&5
6339   (exit $ac_status); } &&
6340          { ac_try='test -s conftest.$ac_objext'
6341   { (eval echo "$as_me:6341: \"$ac_try\"") >&5
6342   (eval $ac_try) 2>&5
6343   ac_status=$?
6344   echo "$as_me:6344: \$? = $ac_status" >&5
6345   (exit $ac_status); }; }; then
6346   :
6347 else
6348   echo "$as_me: failed program was:" >&5
6349 cat conftest.$ac_ext >&5
6350 cf_have_incdir=yes
6351 fi
6352 rm -f conftest.$ac_objext conftest.$ac_ext
6353                           CPPFLAGS=$cf_save_CPPFLAGS
6354                         fi
6355                   fi
6356                 fi
6357
6358                 if test "$cf_have_incdir" = no ; then
6359                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6360
6361 echo "${as_me:-configure}:6361: testing adding $cf_add_incdir to include-path ..." 1>&5
6362
6363                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6364
6365                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6366                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6367                   cf_add_incdir="$cf_top_incdir"
6368                 else
6369                   break
6370                 fi
6371           else
6372                 break
6373           fi
6374         done
6375   done
6376 fi
6377
6378 if test -n "$cf_cv_library_path_utf8" ; then
6379         for cf_add_libdir in $cf_cv_library_path_utf8
6380         do
6381                 if test $cf_add_libdir = /usr/lib ; then
6382                         :
6383                 elif test -d $cf_add_libdir
6384                 then
6385                         cf_have_libdir=no
6386                         if test -n "$LDFLAGS$LIBS" ; then
6387                                 # a loop is needed to ensure we can add subdirs of existing dirs
6388                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6389                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6390                                                 cf_have_libdir=yes; break
6391                                         fi
6392                                 done
6393                         fi
6394                         if test "$cf_have_libdir" = no ; then
6395                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6396
6397 echo "${as_me:-configure}:6397: testing adding $cf_add_libdir to library-path ..." 1>&5
6398
6399                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6400                         fi
6401                 fi
6402         done
6403 fi
6404
6405 cf_add_libs="$cf_cv_library_file_utf8"
6406 # Filter out duplicates - this happens with badly-designed ".pc" files...
6407 for cf_add_1lib in $LIBS
6408 do
6409         for cf_add_2lib in $cf_add_libs
6410         do
6411                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6412                 then
6413                         cf_add_1lib=
6414                         break
6415                 fi
6416         done
6417         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6418 done
6419 LIBS="$cf_add_libs"
6420
6421 fi
6422
6423 cf_ncuconfig_root=ncursesw
6424 cf_have_ncuconfig=no
6425
6426 if test "x${PKG_CONFIG:=none}" != xnone; then
6427         echo "$as_me:6427: checking pkg-config for $cf_ncuconfig_root" >&5
6428 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6429         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6430                 echo "$as_me:6430: result: yes" >&5
6431 echo "${ECHO_T}yes" >&6
6432
6433                 echo "$as_me:6433: checking if the $cf_ncuconfig_root package files work" >&5
6434 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6435                 cf_have_ncuconfig=unknown
6436
6437                 cf_save_CPPFLAGS="$CPPFLAGS"
6438                 cf_save_LIBS="$LIBS"
6439
6440 cf_fix_cppflags=no
6441 cf_new_cflags=
6442 cf_new_cppflags=
6443 cf_new_extra_cppflags=
6444
6445 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
6446 do
6447 case $cf_fix_cppflags in
6448 (no)
6449         case $cf_add_cflags in
6450         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6451                 case $cf_add_cflags in
6452                 (-D*)
6453                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6454
6455                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6456                                 && test -z "${cf_tst_cflags}" \
6457                                 && cf_fix_cppflags=yes
6458
6459                         if test $cf_fix_cppflags = yes ; then
6460
6461         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6462         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6463
6464                                 continue
6465                         elif test "${cf_tst_cflags}" = "\"'" ; then
6466
6467         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6468         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6469
6470                                 continue
6471                         fi
6472                         ;;
6473                 esac
6474                 case "$CPPFLAGS" in
6475                 (*$cf_add_cflags)
6476                         ;;
6477                 (*)
6478                         case $cf_add_cflags in
6479                         (-D*)
6480                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6481
6482 CPPFLAGS=`echo "$CPPFLAGS" | \
6483         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6484                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6485
6486                                 ;;
6487                         esac
6488
6489         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6490         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6491
6492                         ;;
6493                 esac
6494                 ;;
6495         (*)
6496
6497         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6498         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6499
6500                 ;;
6501         esac
6502         ;;
6503 (yes)
6504
6505         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6506         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6507
6508         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6509
6510         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6511                 && test -z "${cf_tst_cflags}" \
6512                 && cf_fix_cppflags=no
6513         ;;
6514 esac
6515 done
6516
6517 if test -n "$cf_new_cflags" ; then
6518
6519         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6520         CFLAGS="${CFLAGS}$cf_new_cflags"
6521
6522 fi
6523
6524 if test -n "$cf_new_cppflags" ; then
6525
6526         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6527         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6528
6529 fi
6530
6531 if test -n "$cf_new_extra_cppflags" ; then
6532
6533         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6534         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6535
6536 fi
6537
6538 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6539 # Filter out duplicates - this happens with badly-designed ".pc" files...
6540 for cf_add_1lib in $LIBS
6541 do
6542         for cf_add_2lib in $cf_add_libs
6543         do
6544                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6545                 then
6546                         cf_add_1lib=
6547                         break
6548                 fi
6549         done
6550         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6551 done
6552 LIBS="$cf_add_libs"
6553
6554                 cat >conftest.$ac_ext <<_ACEOF
6555 #line 6555 "configure"
6556 #include "confdefs.h"
6557 #include <${cf_cv_ncurses_header:-curses.h}>
6558 int
6559 main (void)
6560 {
6561 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6562   ;
6563   return 0;
6564 }
6565 _ACEOF
6566 rm -f conftest.$ac_objext conftest$ac_exeext
6567 if { (eval echo "$as_me:6567: \"$ac_link\"") >&5
6568   (eval $ac_link) 2>&5
6569   ac_status=$?
6570   echo "$as_me:6570: \$? = $ac_status" >&5
6571   (exit $ac_status); } &&
6572          { ac_try='test -s conftest$ac_exeext'
6573   { (eval echo "$as_me:6573: \"$ac_try\"") >&5
6574   (eval $ac_try) 2>&5
6575   ac_status=$?
6576   echo "$as_me:6576: \$? = $ac_status" >&5
6577   (exit $ac_status); }; }; then
6578   if test "$cross_compiling" = yes; then
6579   cf_have_ncuconfig=maybe
6580 else
6581   cat >conftest.$ac_ext <<_ACEOF
6582 #line 6582 "configure"
6583 #include "confdefs.h"
6584 #include <${cf_cv_ncurses_header:-curses.h}>
6585                                 int main(void)
6586                                 { char *xx = curses_version(); return (xx == 0); }
6587 _ACEOF
6588 rm -f conftest$ac_exeext
6589 if { (eval echo "$as_me:6589: \"$ac_link\"") >&5
6590   (eval $ac_link) 2>&5
6591   ac_status=$?
6592   echo "$as_me:6592: \$? = $ac_status" >&5
6593   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6594   { (eval echo "$as_me:6594: \"$ac_try\"") >&5
6595   (eval $ac_try) 2>&5
6596   ac_status=$?
6597   echo "$as_me:6597: \$? = $ac_status" >&5
6598   (exit $ac_status); }; }; then
6599   cf_have_ncuconfig=yes
6600 else
6601   echo "$as_me: program exited with status $ac_status" >&5
6602 echo "$as_me: failed program was:" >&5
6603 cat conftest.$ac_ext >&5
6604 cf_have_ncuconfig=no
6605 fi
6606 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6607 fi
6608 else
6609   echo "$as_me: failed program was:" >&5
6610 cat conftest.$ac_ext >&5
6611 cf_have_ncuconfig=no
6612 fi
6613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6614                 echo "$as_me:6614: result: $cf_have_ncuconfig" >&5
6615 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6616                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6617                 if test "$cf_have_ncuconfig" != "yes"
6618                 then
6619                         CPPFLAGS="$cf_save_CPPFLAGS"
6620                         LIBS="$cf_save_LIBS"
6621                         NCURSES_CONFIG_PKG=none
6622                 else
6623
6624 cat >>confdefs.h <<\EOF
6625 #define NCURSES 1
6626 EOF
6627
6628                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6629
6630 echo "$as_me:6630: checking for terminfo header" >&5
6631 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6632 if test "${cf_cv_term_header+set}" = set; then
6633   echo $ECHO_N "(cached) $ECHO_C" >&6
6634 else
6635
6636 case ${cf_cv_ncurses_header} in
6637 (*/ncurses.h|*/ncursesw.h)
6638         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6639         ;;
6640 (*)
6641         cf_term_header=term.h
6642         ;;
6643 esac
6644
6645 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6646 do
6647 cat >conftest.$ac_ext <<_ACEOF
6648 #line 6648 "configure"
6649 #include "confdefs.h"
6650 #include <stdio.h>
6651 #include <${cf_cv_ncurses_header:-curses.h}>
6652 #include <$cf_test>
6653
6654 int
6655 main (void)
6656 {
6657 int x = auto_left_margin
6658   ;
6659   return 0;
6660 }
6661 _ACEOF
6662 rm -f conftest.$ac_objext
6663 if { (eval echo "$as_me:6663: \"$ac_compile\"") >&5
6664   (eval $ac_compile) 2>&5
6665   ac_status=$?
6666   echo "$as_me:6666: \$? = $ac_status" >&5
6667   (exit $ac_status); } &&
6668          { ac_try='test -s conftest.$ac_objext'
6669   { (eval echo "$as_me:6669: \"$ac_try\"") >&5
6670   (eval $ac_try) 2>&5
6671   ac_status=$?
6672   echo "$as_me:6672: \$? = $ac_status" >&5
6673   (exit $ac_status); }; }; then
6674
6675         cf_cv_term_header="$cf_test"
6676 else
6677   echo "$as_me: failed program was:" >&5
6678 cat conftest.$ac_ext >&5
6679
6680         cf_cv_term_header=unknown
6681
6682 fi
6683 rm -f conftest.$ac_objext conftest.$ac_ext
6684         test "$cf_cv_term_header" != unknown && break
6685 done
6686
6687 fi
6688 echo "$as_me:6688: result: $cf_cv_term_header" >&5
6689 echo "${ECHO_T}$cf_cv_term_header" >&6
6690
6691 # Set definitions to allow ifdef'ing to accommodate subdirectories
6692
6693 case $cf_cv_term_header in
6694 (*term.h)
6695
6696 cat >>confdefs.h <<\EOF
6697 #define HAVE_TERM_H 1
6698 EOF
6699
6700         ;;
6701 esac
6702
6703 case $cf_cv_term_header in
6704 (ncurses/term.h)
6705
6706 cat >>confdefs.h <<\EOF
6707 #define HAVE_NCURSES_TERM_H 1
6708 EOF
6709
6710         ;;
6711 (ncursesw/term.h)
6712
6713 cat >>confdefs.h <<\EOF
6714 #define HAVE_NCURSESW_TERM_H 1
6715 EOF
6716
6717         ;;
6718 esac
6719
6720                 fi
6721
6722         else
6723                 echo "$as_me:6723: result: no" >&5
6724 echo "${ECHO_T}no" >&6
6725                 NCURSES_CONFIG_PKG=none
6726         fi
6727 else
6728         NCURSES_CONFIG_PKG=none
6729 fi
6730
6731 if test "x$cf_have_ncuconfig" = "xno"; then
6732         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6733
6734 if test -n "$ac_tool_prefix"; then
6735   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6736   do
6737     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6738 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6739 echo "$as_me:6739: checking for $ac_word" >&5
6740 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6741 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6742   echo $ECHO_N "(cached) $ECHO_C" >&6
6743 else
6744   if test -n "$NCURSES_CONFIG"; then
6745   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6746 else
6747   ac_save_IFS=$IFS; IFS=$ac_path_separator
6748 ac_dummy="$PATH"
6749 for ac_dir in $ac_dummy; do
6750   IFS=$ac_save_IFS
6751   test -z "$ac_dir" && ac_dir=.
6752   $as_executable_p "$ac_dir/$ac_word" || continue
6753 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6754 echo "$as_me:6754: found $ac_dir/$ac_word" >&5
6755 break
6756 done
6757
6758 fi
6759 fi
6760 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6761 if test -n "$NCURSES_CONFIG"; then
6762   echo "$as_me:6762: result: $NCURSES_CONFIG" >&5
6763 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6764 else
6765   echo "$as_me:6765: result: no" >&5
6766 echo "${ECHO_T}no" >&6
6767 fi
6768
6769     test -n "$NCURSES_CONFIG" && break
6770   done
6771 fi
6772 if test -z "$NCURSES_CONFIG"; then
6773   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6774   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6775 do
6776   # Extract the first word of "$ac_prog", so it can be a program name with args.
6777 set dummy $ac_prog; ac_word=$2
6778 echo "$as_me:6778: checking for $ac_word" >&5
6779 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6780 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6781   echo $ECHO_N "(cached) $ECHO_C" >&6
6782 else
6783   if test -n "$ac_ct_NCURSES_CONFIG"; then
6784   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6785 else
6786   ac_save_IFS=$IFS; IFS=$ac_path_separator
6787 ac_dummy="$PATH"
6788 for ac_dir in $ac_dummy; do
6789   IFS=$ac_save_IFS
6790   test -z "$ac_dir" && ac_dir=.
6791   $as_executable_p "$ac_dir/$ac_word" || continue
6792 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6793 echo "$as_me:6793: found $ac_dir/$ac_word" >&5
6794 break
6795 done
6796
6797 fi
6798 fi
6799 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6800 if test -n "$ac_ct_NCURSES_CONFIG"; then
6801   echo "$as_me:6801: result: $ac_ct_NCURSES_CONFIG" >&5
6802 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6803 else
6804   echo "$as_me:6804: result: no" >&5
6805 echo "${ECHO_T}no" >&6
6806 fi
6807
6808   test -n "$ac_ct_NCURSES_CONFIG" && break
6809 done
6810 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6811
6812   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6813 fi
6814
6815         if test "$NCURSES_CONFIG" != none ; then
6816
6817 cf_fix_cppflags=no
6818 cf_new_cflags=
6819 cf_new_cppflags=
6820 cf_new_extra_cppflags=
6821
6822 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
6823 do
6824 case $cf_fix_cppflags in
6825 (no)
6826         case $cf_add_cflags in
6827         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
6828                 case $cf_add_cflags in
6829                 (-D*)
6830                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
6831
6832                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6833                                 && test -z "${cf_tst_cflags}" \
6834                                 && cf_fix_cppflags=yes
6835
6836                         if test $cf_fix_cppflags = yes ; then
6837
6838         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6839         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6840
6841                                 continue
6842                         elif test "${cf_tst_cflags}" = "\"'" ; then
6843
6844         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6845         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6846
6847                                 continue
6848                         fi
6849                         ;;
6850                 esac
6851                 case "$CPPFLAGS" in
6852                 (*$cf_add_cflags)
6853                         ;;
6854                 (*)
6855                         case $cf_add_cflags in
6856                         (-D*)
6857                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
6858
6859 CPPFLAGS=`echo "$CPPFLAGS" | \
6860         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
6861                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
6862
6863                                 ;;
6864                         esac
6865
6866         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
6867         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
6868
6869                         ;;
6870                 esac
6871                 ;;
6872         (*)
6873
6874         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
6875         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
6876
6877                 ;;
6878         esac
6879         ;;
6880 (yes)
6881
6882         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
6883         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
6884
6885         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
6886
6887         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
6888                 && test -z "${cf_tst_cflags}" \
6889                 && cf_fix_cppflags=no
6890         ;;
6891 esac
6892 done
6893
6894 if test -n "$cf_new_cflags" ; then
6895
6896         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
6897         CFLAGS="${CFLAGS}$cf_new_cflags"
6898
6899 fi
6900
6901 if test -n "$cf_new_cppflags" ; then
6902
6903         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6904         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
6905
6906 fi
6907
6908 if test -n "$cf_new_extra_cppflags" ; then
6909
6910         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
6911         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
6912
6913 fi
6914
6915 cf_add_libs="`$NCURSES_CONFIG --libs`"
6916 # Filter out duplicates - this happens with badly-designed ".pc" files...
6917 for cf_add_1lib in $LIBS
6918 do
6919         for cf_add_2lib in $cf_add_libs
6920         do
6921                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6922                 then
6923                         cf_add_1lib=
6924                         break
6925                 fi
6926         done
6927         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6928 done
6929 LIBS="$cf_add_libs"
6930
6931                 # even with config script, some packages use no-override for curses.h
6932
6933 echo "$as_me:6933: checking if we have identified curses headers" >&5
6934 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6935 if test "${cf_cv_ncurses_header+set}" = set; then
6936   echo $ECHO_N "(cached) $ECHO_C" >&6
6937 else
6938
6939 cf_cv_ncurses_header=none
6940 for cf_header in \
6941         ncurses.h ncursesw/ncurses.h \
6942         curses.h ncursesw/curses.h
6943 do
6944 cat >conftest.$ac_ext <<_ACEOF
6945 #line 6945 "configure"
6946 #include "confdefs.h"
6947 #include <${cf_header}>
6948 int
6949 main (void)
6950 {
6951 initscr(); tgoto("?", 0,0)
6952   ;
6953   return 0;
6954 }
6955 _ACEOF
6956 rm -f conftest.$ac_objext
6957 if { (eval echo "$as_me:6957: \"$ac_compile\"") >&5
6958   (eval $ac_compile) 2>&5
6959   ac_status=$?
6960   echo "$as_me:6960: \$? = $ac_status" >&5
6961   (exit $ac_status); } &&
6962          { ac_try='test -s conftest.$ac_objext'
6963   { (eval echo "$as_me:6963: \"$ac_try\"") >&5
6964   (eval $ac_try) 2>&5
6965   ac_status=$?
6966   echo "$as_me:6966: \$? = $ac_status" >&5
6967   (exit $ac_status); }; }; then
6968   cf_cv_ncurses_header=$cf_header; break
6969 else
6970   echo "$as_me: failed program was:" >&5
6971 cat conftest.$ac_ext >&5
6972 fi
6973 rm -f conftest.$ac_objext conftest.$ac_ext
6974 done
6975
6976 fi
6977 echo "$as_me:6977: result: $cf_cv_ncurses_header" >&5
6978 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6979
6980 if test "$cf_cv_ncurses_header" = none ; then
6981         { { echo "$as_me:6981: error: No curses header-files found" >&5
6982 echo "$as_me: error: No curses header-files found" >&2;}
6983    { (exit 1); exit 1; }; }
6984 fi
6985
6986 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6987
6988 for ac_header in $cf_cv_ncurses_header
6989 do
6990 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6991 echo "$as_me:6991: checking for $ac_header" >&5
6992 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6993 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6994   echo $ECHO_N "(cached) $ECHO_C" >&6
6995 else
6996   cat >conftest.$ac_ext <<_ACEOF
6997 #line 6997 "configure"
6998 #include "confdefs.h"
6999 #include <$ac_header>
7000 _ACEOF
7001 if { (eval echo "$as_me:7001: \"$ac_cpp conftest.$ac_ext\"") >&5
7002   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7003   ac_status=$?
7004   egrep -v '^ *\+' conftest.er1 >conftest.err
7005   rm -f conftest.er1
7006   cat conftest.err >&5
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit $ac_status); } >/dev/null; then
7009   if test -s conftest.err; then
7010     ac_cpp_err=$ac_c_preproc_warn_flag
7011   else
7012     ac_cpp_err=
7013   fi
7014 else
7015   ac_cpp_err=yes
7016 fi
7017 if test -z "$ac_cpp_err"; then
7018   eval "$as_ac_Header=yes"
7019 else
7020   echo "$as_me: failed program was:" >&5
7021   cat conftest.$ac_ext >&5
7022   eval "$as_ac_Header=no"
7023 fi
7024 rm -f conftest.err conftest.$ac_ext
7025 fi
7026 echo "$as_me:7026: result: `eval echo '${'$as_ac_Header'}'`" >&5
7027 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7028 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7029   cat >>confdefs.h <<EOF
7030 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7031 EOF
7032
7033 fi
7034 done
7035
7036 cat >>confdefs.h <<\EOF
7037 #define NCURSES 1
7038 EOF
7039
7040 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7041
7042                 cat >>confdefs.h <<EOF
7043 #define $cf_nculib_ROOT 1
7044 EOF
7045
7046                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7047
7048         else
7049
7050 cf_ncuhdr_root=ncursesw
7051
7052 test -n "$cf_cv_curses_dir" && \
7053 test "$cf_cv_curses_dir" != "no" && { \
7054
7055 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7056   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7057   do
7058         while test $cf_add_incdir != /usr/include
7059         do
7060           if test -d $cf_add_incdir
7061           then
7062                 cf_have_incdir=no
7063                 if test -n "$CFLAGS$CPPFLAGS" ; then
7064                   # a loop is needed to ensure we can add subdirs of existing dirs
7065                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7066                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7067                           cf_have_incdir=yes; break
7068                         fi
7069                   done
7070                 fi
7071
7072                 if test "$cf_have_incdir" = no ; then
7073                   if test "$cf_add_incdir" = /usr/local/include ; then
7074                         if test "$GCC" = yes
7075                         then
7076                           cf_save_CPPFLAGS=$CPPFLAGS
7077
7078         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7079         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7080
7081                           cat >conftest.$ac_ext <<_ACEOF
7082 #line 7082 "configure"
7083 #include "confdefs.h"
7084 #include <stdio.h>
7085 int
7086 main (void)
7087 {
7088 printf("Hello")
7089   ;
7090   return 0;
7091 }
7092 _ACEOF
7093 rm -f conftest.$ac_objext
7094 if { (eval echo "$as_me:7094: \"$ac_compile\"") >&5
7095   (eval $ac_compile) 2>&5
7096   ac_status=$?
7097   echo "$as_me:7097: \$? = $ac_status" >&5
7098   (exit $ac_status); } &&
7099          { ac_try='test -s conftest.$ac_objext'
7100   { (eval echo "$as_me:7100: \"$ac_try\"") >&5
7101   (eval $ac_try) 2>&5
7102   ac_status=$?
7103   echo "$as_me:7103: \$? = $ac_status" >&5
7104   (exit $ac_status); }; }; then
7105   :
7106 else
7107   echo "$as_me: failed program was:" >&5
7108 cat conftest.$ac_ext >&5
7109 cf_have_incdir=yes
7110 fi
7111 rm -f conftest.$ac_objext conftest.$ac_ext
7112                           CPPFLAGS=$cf_save_CPPFLAGS
7113                         fi
7114                   fi
7115                 fi
7116
7117                 if test "$cf_have_incdir" = no ; then
7118                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7119
7120 echo "${as_me:-configure}:7120: testing adding $cf_add_incdir to include-path ..." 1>&5
7121
7122                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7123
7124                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7125                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7126                   cf_add_incdir="$cf_top_incdir"
7127                 else
7128                   break
7129                 fi
7130           else
7131                 break
7132           fi
7133         done
7134   done
7135 fi
7136
7137 }
7138
7139 echo "$as_me:7139: checking for $cf_ncuhdr_root header in include-path" >&5
7140 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7141 if test "${cf_cv_ncurses_h+set}" = set; then
7142   echo $ECHO_N "(cached) $ECHO_C" >&6
7143 else
7144
7145         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7146         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7147         for cf_header in $cf_header_list
7148         do
7149
7150         cat >conftest.$ac_ext <<_ACEOF
7151 #line 7151 "configure"
7152 #include "confdefs.h"
7153
7154 #define _XOPEN_SOURCE_EXTENDED
7155 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
7156 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
7157
7158 #include <$cf_header>
7159 int
7160 main (void)
7161 {
7162
7163 #ifdef NCURSES_VERSION
7164
7165 #ifndef WACS_BSSB
7166         make an error
7167 #endif
7168
7169 printf("%s\n", NCURSES_VERSION);
7170 #else
7171 #ifdef __NCURSES_H
7172 printf("old\n");
7173 #else
7174         make an error
7175 #endif
7176 #endif
7177
7178   ;
7179   return 0;
7180 }
7181 _ACEOF
7182 rm -f conftest.$ac_objext
7183 if { (eval echo "$as_me:7183: \"$ac_compile\"") >&5
7184   (eval $ac_compile) 2>&5
7185   ac_status=$?
7186   echo "$as_me:7186: \$? = $ac_status" >&5
7187   (exit $ac_status); } &&
7188          { ac_try='test -s conftest.$ac_objext'
7189   { (eval echo "$as_me:7189: \"$ac_try\"") >&5
7190   (eval $ac_try) 2>&5
7191   ac_status=$?
7192   echo "$as_me:7192: \$? = $ac_status" >&5
7193   (exit $ac_status); }; }; then
7194   cf_cv_ncurses_h=$cf_header
7195
7196 else
7197   echo "$as_me: failed program was:" >&5
7198 cat conftest.$ac_ext >&5
7199 cf_cv_ncurses_h=no
7200 fi
7201 rm -f conftest.$ac_objext conftest.$ac_ext
7202
7203                 test "$cf_cv_ncurses_h" != no && break
7204         done
7205
7206 fi
7207 echo "$as_me:7207: result: $cf_cv_ncurses_h" >&5
7208 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7209
7210 if test "$cf_cv_ncurses_h" != no ; then
7211         cf_cv_ncurses_header=$cf_cv_ncurses_h
7212 else
7213
7214 echo "$as_me:7214: checking for $cf_ncuhdr_root include-path" >&5
7215 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7216 if test "${cf_cv_ncurses_h2+set}" = set; then
7217   echo $ECHO_N "(cached) $ECHO_C" >&6
7218 else
7219
7220         test -n "$verbose" && echo
7221
7222 cf_search=
7223
7224 # collect the current set of include-directories from compiler flags
7225 cf_header_path_list=""
7226 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7227         for cf_header_path in $CPPFLAGS $CFLAGS
7228         do
7229                 case $cf_header_path in
7230                 (-I*)
7231                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7232
7233 test "x$cf_header_path" != "xNONE" && \
7234 test -d "$cf_header_path" && \
7235  {
7236         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7237         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7238         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7239         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7240         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7241         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"
7242 }
7243
7244                         cf_header_path_list="$cf_header_path_list $cf_search"
7245                         ;;
7246                 esac
7247         done
7248 fi
7249
7250 # add the variations for the package we are looking for
7251
7252 cf_search=
7253
7254 test "x$prefix" != "xNONE" && \
7255 test -d "$prefix" && \
7256  {
7257         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7258         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7259         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7260         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7261         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7262         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7263 }
7264
7265 for cf_subdir_prefix in \
7266         /usr \
7267         /usr/local \
7268         /usr/pkg \
7269         /opt \
7270         /opt/local \
7271         $HOME
7272 do
7273
7274 test "x$cf_subdir_prefix" != "x$prefix" && \
7275 test -d "$cf_subdir_prefix" && \
7276 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7277         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7278         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7279         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7280         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7281         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7282         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"
7283 }
7284
7285 done
7286
7287 test "$includedir" != NONE && \
7288 test "$includedir" != "/usr/include" && \
7289 test -d "$includedir" && {
7290         test -d $includedir &&    cf_search="$cf_search $includedir"
7291         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7292 }
7293
7294 test "$oldincludedir" != NONE && \
7295 test "$oldincludedir" != "/usr/include" && \
7296 test -d "$oldincludedir" && {
7297         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7298         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7299 }
7300
7301 cf_search="$cf_search $cf_header_path_list"
7302
7303         test -n "$verbose" && echo search path $cf_search
7304         cf_save2_CPPFLAGS="$CPPFLAGS"
7305         for cf_incdir in $cf_search
7306         do
7307
7308 if test -n "$cf_incdir" ; then
7309   for cf_add_incdir in $cf_incdir
7310   do
7311         while test $cf_add_incdir != /usr/include
7312         do
7313           if test -d $cf_add_incdir
7314           then
7315                 cf_have_incdir=no
7316                 if test -n "$CFLAGS$CPPFLAGS" ; then
7317                   # a loop is needed to ensure we can add subdirs of existing dirs
7318                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7319                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7320                           cf_have_incdir=yes; break
7321                         fi
7322                   done
7323                 fi
7324
7325                 if test "$cf_have_incdir" = no ; then
7326                   if test "$cf_add_incdir" = /usr/local/include ; then
7327                         if test "$GCC" = yes
7328                         then
7329                           cf_save_CPPFLAGS=$CPPFLAGS
7330
7331         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7332         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7333
7334                           cat >conftest.$ac_ext <<_ACEOF
7335 #line 7335 "configure"
7336 #include "confdefs.h"
7337 #include <stdio.h>
7338 int
7339 main (void)
7340 {
7341 printf("Hello")
7342   ;
7343   return 0;
7344 }
7345 _ACEOF
7346 rm -f conftest.$ac_objext
7347 if { (eval echo "$as_me:7347: \"$ac_compile\"") >&5
7348   (eval $ac_compile) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); } &&
7352          { ac_try='test -s conftest.$ac_objext'
7353   { (eval echo "$as_me:7353: \"$ac_try\"") >&5
7354   (eval $ac_try) 2>&5
7355   ac_status=$?
7356   echo "$as_me:7356: \$? = $ac_status" >&5
7357   (exit $ac_status); }; }; then
7358   :
7359 else
7360   echo "$as_me: failed program was:" >&5
7361 cat conftest.$ac_ext >&5
7362 cf_have_incdir=yes
7363 fi
7364 rm -f conftest.$ac_objext conftest.$ac_ext
7365                           CPPFLAGS=$cf_save_CPPFLAGS
7366                         fi
7367                   fi
7368                 fi
7369
7370                 if test "$cf_have_incdir" = no ; then
7371                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7372
7373 echo "${as_me:-configure}:7373: testing adding $cf_add_incdir to include-path ..." 1>&5
7374
7375                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7376
7377                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7378                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7379                   cf_add_incdir="$cf_top_incdir"
7380                 else
7381                   break
7382                 fi
7383           else
7384                 break
7385           fi
7386         done
7387   done
7388 fi
7389
7390                 for cf_header in \
7391                         ncurses.h \
7392                         curses.h
7393                 do
7394
7395         cat >conftest.$ac_ext <<_ACEOF
7396 #line 7396 "configure"
7397 #include "confdefs.h"
7398
7399 #include <$cf_header>
7400 int
7401 main (void)
7402 {
7403
7404 #ifdef NCURSES_VERSION
7405
7406 printf("%s\n", NCURSES_VERSION);
7407 #else
7408 #ifdef __NCURSES_H
7409 printf("old\n");
7410 #else
7411         make an error
7412 #endif
7413 #endif
7414
7415   ;
7416   return 0;
7417 }
7418 _ACEOF
7419 rm -f conftest.$ac_objext
7420 if { (eval echo "$as_me:7420: \"$ac_compile\"") >&5
7421   (eval $ac_compile) 2>&5
7422   ac_status=$?
7423   echo "$as_me:7423: \$? = $ac_status" >&5
7424   (exit $ac_status); } &&
7425          { ac_try='test -s conftest.$ac_objext'
7426   { (eval echo "$as_me:7426: \"$ac_try\"") >&5
7427   (eval $ac_try) 2>&5
7428   ac_status=$?
7429   echo "$as_me:7429: \$? = $ac_status" >&5
7430   (exit $ac_status); }; }; then
7431   cf_cv_ncurses_h2=$cf_header
7432
7433 else
7434   echo "$as_me: failed program was:" >&5
7435 cat conftest.$ac_ext >&5
7436 cf_cv_ncurses_h2=no
7437 fi
7438 rm -f conftest.$ac_objext conftest.$ac_ext
7439
7440                         if test "$cf_cv_ncurses_h2" != no ; then
7441                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7442                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7443                                 break
7444                         fi
7445                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7446                 done
7447                 CPPFLAGS="$cf_save2_CPPFLAGS"
7448                 test "$cf_cv_ncurses_h2" != no && break
7449         done
7450         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7450: error: not found" >&5
7451 echo "$as_me: error: not found" >&2;}
7452    { (exit 1); exit 1; }; }
7453
7454 fi
7455 echo "$as_me:7455: result: $cf_cv_ncurses_h2" >&5
7456 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7457
7458         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7459         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7460         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7461                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7462         fi
7463
7464 if test -n "$cf_1st_incdir" ; then
7465   for cf_add_incdir in $cf_1st_incdir
7466   do
7467         while test $cf_add_incdir != /usr/include
7468         do
7469           if test -d $cf_add_incdir
7470           then
7471                 cf_have_incdir=no
7472                 if test -n "$CFLAGS$CPPFLAGS" ; then
7473                   # a loop is needed to ensure we can add subdirs of existing dirs
7474                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7475                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7476                           cf_have_incdir=yes; break
7477                         fi
7478                   done
7479                 fi
7480
7481                 if test "$cf_have_incdir" = no ; then
7482                   if test "$cf_add_incdir" = /usr/local/include ; then
7483                         if test "$GCC" = yes
7484                         then
7485                           cf_save_CPPFLAGS=$CPPFLAGS
7486
7487         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7488         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7489
7490                           cat >conftest.$ac_ext <<_ACEOF
7491 #line 7491 "configure"
7492 #include "confdefs.h"
7493 #include <stdio.h>
7494 int
7495 main (void)
7496 {
7497 printf("Hello")
7498   ;
7499   return 0;
7500 }
7501 _ACEOF
7502 rm -f conftest.$ac_objext
7503 if { (eval echo "$as_me:7503: \"$ac_compile\"") >&5
7504   (eval $ac_compile) 2>&5
7505   ac_status=$?
7506   echo "$as_me:7506: \$? = $ac_status" >&5
7507   (exit $ac_status); } &&
7508          { ac_try='test -s conftest.$ac_objext'
7509   { (eval echo "$as_me:7509: \"$ac_try\"") >&5
7510   (eval $ac_try) 2>&5
7511   ac_status=$?
7512   echo "$as_me:7512: \$? = $ac_status" >&5
7513   (exit $ac_status); }; }; then
7514   :
7515 else
7516   echo "$as_me: failed program was:" >&5
7517 cat conftest.$ac_ext >&5
7518 cf_have_incdir=yes
7519 fi
7520 rm -f conftest.$ac_objext conftest.$ac_ext
7521                           CPPFLAGS=$cf_save_CPPFLAGS
7522                         fi
7523                   fi
7524                 fi
7525
7526                 if test "$cf_have_incdir" = no ; then
7527                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7528
7529 echo "${as_me:-configure}:7529: testing adding $cf_add_incdir to include-path ..." 1>&5
7530
7531                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7532
7533                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7534                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7535                   cf_add_incdir="$cf_top_incdir"
7536                 else
7537                   break
7538                 fi
7539           else
7540                 break
7541           fi
7542         done
7543   done
7544 fi
7545
7546 fi
7547
7548 # Set definitions to allow ifdef'ing for ncurses.h
7549
7550 case $cf_cv_ncurses_header in
7551 (*ncurses.h)
7552
7553 cat >>confdefs.h <<\EOF
7554 #define HAVE_NCURSES_H 1
7555 EOF
7556
7557         ;;
7558 esac
7559
7560 case $cf_cv_ncurses_header in
7561 (ncurses/curses.h|ncurses/ncurses.h)
7562
7563 cat >>confdefs.h <<\EOF
7564 #define HAVE_NCURSES_NCURSES_H 1
7565 EOF
7566
7567         ;;
7568 (ncursesw/curses.h|ncursesw/ncurses.h)
7569
7570 cat >>confdefs.h <<\EOF
7571 #define HAVE_NCURSESW_NCURSES_H 1
7572 EOF
7573
7574         ;;
7575 esac
7576
7577 echo "$as_me:7577: checking for terminfo header" >&5
7578 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7579 if test "${cf_cv_term_header+set}" = set; then
7580   echo $ECHO_N "(cached) $ECHO_C" >&6
7581 else
7582
7583 case ${cf_cv_ncurses_header} in
7584 (*/ncurses.h|*/ncursesw.h)
7585         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7586         ;;
7587 (*)
7588         cf_term_header=term.h
7589         ;;
7590 esac
7591
7592 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7593 do
7594 cat >conftest.$ac_ext <<_ACEOF
7595 #line 7595 "configure"
7596 #include "confdefs.h"
7597 #include <stdio.h>
7598 #include <${cf_cv_ncurses_header:-curses.h}>
7599 #include <$cf_test>
7600
7601 int
7602 main (void)
7603 {
7604 int x = auto_left_margin
7605   ;
7606   return 0;
7607 }
7608 _ACEOF
7609 rm -f conftest.$ac_objext
7610 if { (eval echo "$as_me:7610: \"$ac_compile\"") >&5
7611   (eval $ac_compile) 2>&5
7612   ac_status=$?
7613   echo "$as_me:7613: \$? = $ac_status" >&5
7614   (exit $ac_status); } &&
7615          { ac_try='test -s conftest.$ac_objext'
7616   { (eval echo "$as_me:7616: \"$ac_try\"") >&5
7617   (eval $ac_try) 2>&5
7618   ac_status=$?
7619   echo "$as_me:7619: \$? = $ac_status" >&5
7620   (exit $ac_status); }; }; then
7621
7622         cf_cv_term_header="$cf_test"
7623 else
7624   echo "$as_me: failed program was:" >&5
7625 cat conftest.$ac_ext >&5
7626
7627         cf_cv_term_header=unknown
7628
7629 fi
7630 rm -f conftest.$ac_objext conftest.$ac_ext
7631         test "$cf_cv_term_header" != unknown && break
7632 done
7633
7634 fi
7635 echo "$as_me:7635: result: $cf_cv_term_header" >&5
7636 echo "${ECHO_T}$cf_cv_term_header" >&6
7637
7638 # Set definitions to allow ifdef'ing to accommodate subdirectories
7639
7640 case $cf_cv_term_header in
7641 (*term.h)
7642
7643 cat >>confdefs.h <<\EOF
7644 #define HAVE_TERM_H 1
7645 EOF
7646
7647         ;;
7648 esac
7649
7650 case $cf_cv_term_header in
7651 (ncurses/term.h)
7652
7653 cat >>confdefs.h <<\EOF
7654 #define HAVE_NCURSES_TERM_H 1
7655 EOF
7656
7657         ;;
7658 (ncursesw/term.h)
7659
7660 cat >>confdefs.h <<\EOF
7661 #define HAVE_NCURSESW_TERM_H 1
7662 EOF
7663
7664         ;;
7665 esac
7666
7667 # some applications need this, but should check for NCURSES_VERSION
7668
7669 cat >>confdefs.h <<\EOF
7670 #define NCURSES 1
7671 EOF
7672
7673 echo "$as_me:7673: checking for ncurses version" >&5
7674 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7675 if test "${cf_cv_ncurses_version+set}" = set; then
7676   echo $ECHO_N "(cached) $ECHO_C" >&6
7677 else
7678
7679         cf_cv_ncurses_version=no
7680         cf_tempfile=out$$
7681         rm -f $cf_tempfile
7682         if test "$cross_compiling" = yes; then
7683
7684         # This will not work if the preprocessor splits the line after the
7685         # Autoconf token.  The 'unproto' program does that.
7686         cat > conftest.$ac_ext <<EOF
7687 #include <${cf_cv_ncurses_header:-curses.h}>
7688 #undef Autoconf
7689 #ifdef NCURSES_VERSION
7690 Autoconf NCURSES_VERSION
7691 #else
7692 #ifdef __NCURSES_H
7693 Autoconf "old"
7694 #endif
7695 ;
7696 #endif
7697 EOF
7698         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7699         { (eval echo "$as_me:7699: \"$cf_try\"") >&5
7700   (eval $cf_try) 2>&5
7701   ac_status=$?
7702   echo "$as_me:7702: \$? = $ac_status" >&5
7703   (exit $ac_status); }
7704         if test -f conftest.out ; then
7705                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7706                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7707                 rm -f conftest.out
7708         fi
7709
7710 else
7711   cat >conftest.$ac_ext <<_ACEOF
7712 #line 7712 "configure"
7713 #include "confdefs.h"
7714
7715 #include <${cf_cv_ncurses_header:-curses.h}>
7716 #include <stdio.h>
7717 int main(void)
7718 {
7719         FILE *fp = fopen("$cf_tempfile", "w");
7720 #ifdef NCURSES_VERSION
7721 # ifdef NCURSES_VERSION_PATCH
7722         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7723 # else
7724         fprintf(fp, "%s\n", NCURSES_VERSION);
7725 # endif
7726 #else
7727 # ifdef __NCURSES_H
7728         fprintf(fp, "old\n");
7729 # else
7730         make an error
7731 # endif
7732 #endif
7733         ${cf_cv_main_return:-return}(0);
7734 }
7735 _ACEOF
7736 rm -f conftest$ac_exeext
7737 if { (eval echo "$as_me:7737: \"$ac_link\"") >&5
7738   (eval $ac_link) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7742   { (eval echo "$as_me:7742: \"$ac_try\"") >&5
7743   (eval $ac_try) 2>&5
7744   ac_status=$?
7745   echo "$as_me:7745: \$? = $ac_status" >&5
7746   (exit $ac_status); }; }; then
7747
7748         cf_cv_ncurses_version=`cat $cf_tempfile`
7749 else
7750   echo "$as_me: program exited with status $ac_status" >&5
7751 echo "$as_me: failed program was:" >&5
7752 cat conftest.$ac_ext >&5
7753 fi
7754 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7755 fi
7756         rm -f $cf_tempfile
7757
7758 fi
7759 echo "$as_me:7759: result: $cf_cv_ncurses_version" >&5
7760 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7761 test "$cf_cv_ncurses_version" = no ||
7762 cat >>confdefs.h <<\EOF
7763 #define NCURSES 1
7764 EOF
7765
7766 cf_nculib_root=ncursesw
7767         # This works, except for the special case where we find gpm, but
7768         # ncurses is in a nonstandard location via $LIBS, and we really want
7769         # to link gpm.
7770 cf_ncurses_LIBS=""
7771 cf_ncurses_SAVE="$LIBS"
7772 echo "$as_me:7772: checking for Gpm_Open in -lgpm" >&5
7773 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7774 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7775   echo $ECHO_N "(cached) $ECHO_C" >&6
7776 else
7777   ac_check_lib_save_LIBS=$LIBS
7778 LIBS="-lgpm  $LIBS"
7779 cat >conftest.$ac_ext <<_ACEOF
7780 #line 7780 "configure"
7781 #include "confdefs.h"
7782
7783 /* Override any gcc2 internal prototype to avoid an error.  */
7784 #ifdef __cplusplus
7785 extern "C"
7786 #endif
7787 /* We use char because int might match the return type of a gcc2
7788    builtin and then its argument prototype would still apply.  */
7789 char Gpm_Open ();
7790 int
7791 main (void)
7792 {
7793 Gpm_Open ();
7794   ;
7795   return 0;
7796 }
7797 _ACEOF
7798 rm -f conftest.$ac_objext conftest$ac_exeext
7799 if { (eval echo "$as_me:7799: \"$ac_link\"") >&5
7800   (eval $ac_link) 2>&5
7801   ac_status=$?
7802   echo "$as_me:7802: \$? = $ac_status" >&5
7803   (exit $ac_status); } &&
7804          { ac_try='test -s conftest$ac_exeext'
7805   { (eval echo "$as_me:7805: \"$ac_try\"") >&5
7806   (eval $ac_try) 2>&5
7807   ac_status=$?
7808   echo "$as_me:7808: \$? = $ac_status" >&5
7809   (exit $ac_status); }; }; then
7810   ac_cv_lib_gpm_Gpm_Open=yes
7811 else
7812   echo "$as_me: failed program was:" >&5
7813 cat conftest.$ac_ext >&5
7814 ac_cv_lib_gpm_Gpm_Open=no
7815 fi
7816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7817 LIBS=$ac_check_lib_save_LIBS
7818 fi
7819 echo "$as_me:7819: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7820 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7821 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7822   echo "$as_me:7822: checking for initscr in -lgpm" >&5
7823 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7824 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7825   echo $ECHO_N "(cached) $ECHO_C" >&6
7826 else
7827   ac_check_lib_save_LIBS=$LIBS
7828 LIBS="-lgpm  $LIBS"
7829 cat >conftest.$ac_ext <<_ACEOF
7830 #line 7830 "configure"
7831 #include "confdefs.h"
7832
7833 /* Override any gcc2 internal prototype to avoid an error.  */
7834 #ifdef __cplusplus
7835 extern "C"
7836 #endif
7837 /* We use char because int might match the return type of a gcc2
7838    builtin and then its argument prototype would still apply.  */
7839 char initscr ();
7840 int
7841 main (void)
7842 {
7843 initscr ();
7844   ;
7845   return 0;
7846 }
7847 _ACEOF
7848 rm -f conftest.$ac_objext conftest$ac_exeext
7849 if { (eval echo "$as_me:7849: \"$ac_link\"") >&5
7850   (eval $ac_link) 2>&5
7851   ac_status=$?
7852   echo "$as_me:7852: \$? = $ac_status" >&5
7853   (exit $ac_status); } &&
7854          { ac_try='test -s conftest$ac_exeext'
7855   { (eval echo "$as_me:7855: \"$ac_try\"") >&5
7856   (eval $ac_try) 2>&5
7857   ac_status=$?
7858   echo "$as_me:7858: \$? = $ac_status" >&5
7859   (exit $ac_status); }; }; then
7860   ac_cv_lib_gpm_initscr=yes
7861 else
7862   echo "$as_me: failed program was:" >&5
7863 cat conftest.$ac_ext >&5
7864 ac_cv_lib_gpm_initscr=no
7865 fi
7866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7867 LIBS=$ac_check_lib_save_LIBS
7868 fi
7869 echo "$as_me:7869: result: $ac_cv_lib_gpm_initscr" >&5
7870 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7871 if test $ac_cv_lib_gpm_initscr = yes; then
7872   LIBS="$cf_ncurses_SAVE"
7873 else
7874   cf_ncurses_LIBS="-lgpm"
7875 fi
7876
7877 fi
7878
7879 case $host_os in
7880 (freebsd*)
7881         # This is only necessary if you are linking against an obsolete
7882         # version of ncurses (but it should do no harm, since it's static).
7883         if test "$cf_nculib_root" = ncurses ; then
7884                 echo "$as_me:7884: checking for tgoto in -lmytinfo" >&5
7885 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7886 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7887   echo $ECHO_N "(cached) $ECHO_C" >&6
7888 else
7889   ac_check_lib_save_LIBS=$LIBS
7890 LIBS="-lmytinfo  $LIBS"
7891 cat >conftest.$ac_ext <<_ACEOF
7892 #line 7892 "configure"
7893 #include "confdefs.h"
7894
7895 /* Override any gcc2 internal prototype to avoid an error.  */
7896 #ifdef __cplusplus
7897 extern "C"
7898 #endif
7899 /* We use char because int might match the return type of a gcc2
7900    builtin and then its argument prototype would still apply.  */
7901 char tgoto ();
7902 int
7903 main (void)
7904 {
7905 tgoto ();
7906   ;
7907   return 0;
7908 }
7909 _ACEOF
7910 rm -f conftest.$ac_objext conftest$ac_exeext
7911 if { (eval echo "$as_me:7911: \"$ac_link\"") >&5
7912   (eval $ac_link) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit $ac_status); } &&
7916          { ac_try='test -s conftest$ac_exeext'
7917   { (eval echo "$as_me:7917: \"$ac_try\"") >&5
7918   (eval $ac_try) 2>&5
7919   ac_status=$?
7920   echo "$as_me:7920: \$? = $ac_status" >&5
7921   (exit $ac_status); }; }; then
7922   ac_cv_lib_mytinfo_tgoto=yes
7923 else
7924   echo "$as_me: failed program was:" >&5
7925 cat conftest.$ac_ext >&5
7926 ac_cv_lib_mytinfo_tgoto=no
7927 fi
7928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7929 LIBS=$ac_check_lib_save_LIBS
7930 fi
7931 echo "$as_me:7931: result: $ac_cv_lib_mytinfo_tgoto" >&5
7932 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7933 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7934   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7935 fi
7936
7937         fi
7938         ;;
7939 esac
7940
7941 cf_add_libs="$cf_ncurses_LIBS"
7942 # Filter out duplicates - this happens with badly-designed ".pc" files...
7943 for cf_add_1lib in $LIBS
7944 do
7945         for cf_add_2lib in $cf_add_libs
7946         do
7947                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7948                 then
7949                         cf_add_1lib=
7950                         break
7951                 fi
7952         done
7953         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7954 done
7955 LIBS="$cf_add_libs"
7956
7957 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7958 then
7959
7960 cf_add_libs="-l$cf_nculib_root"
7961 # Filter out duplicates - this happens with badly-designed ".pc" files...
7962 for cf_add_1lib in $LIBS
7963 do
7964         for cf_add_2lib in $cf_add_libs
7965         do
7966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7967                 then
7968                         cf_add_1lib=
7969                         break
7970                 fi
7971         done
7972         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7973 done
7974 LIBS="$cf_add_libs"
7975
7976 else
7977
7978         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7979         cf_libdir=""
7980         echo "$as_me:7980: checking for initscr" >&5
7981 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7982 if test "${ac_cv_func_initscr+set}" = set; then
7983   echo $ECHO_N "(cached) $ECHO_C" >&6
7984 else
7985   cat >conftest.$ac_ext <<_ACEOF
7986 #line 7986 "configure"
7987 #include "confdefs.h"
7988 /* System header to define __stub macros and hopefully few prototypes,
7989     which can conflict with char initscr (); below.  */
7990 #include <assert.h>
7991 /* Override any gcc2 internal prototype to avoid an error.  */
7992 #ifdef __cplusplus
7993 extern "C"
7994 #endif
7995 /* We use char because int might match the return type of a gcc2
7996    builtin and then its argument prototype would still apply.  */
7997 char initscr ();
7998 char (*f) ();
7999
8000 int
8001 main (void)
8002 {
8003 /* The GNU C library defines this for functions which it implements
8004     to always fail with ENOSYS.  Some functions are actually named
8005     something starting with __ and the normal name is an alias.  */
8006 #if defined (__stub_initscr) || defined (__stub___initscr)
8007 choke me
8008 #else
8009 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8010 #endif
8011
8012   ;
8013   return 0;
8014 }
8015 _ACEOF
8016 rm -f conftest.$ac_objext conftest$ac_exeext
8017 if { (eval echo "$as_me:8017: \"$ac_link\"") >&5
8018   (eval $ac_link) 2>&5
8019   ac_status=$?
8020   echo "$as_me:8020: \$? = $ac_status" >&5
8021   (exit $ac_status); } &&
8022          { ac_try='test -s conftest$ac_exeext'
8023   { (eval echo "$as_me:8023: \"$ac_try\"") >&5
8024   (eval $ac_try) 2>&5
8025   ac_status=$?
8026   echo "$as_me:8026: \$? = $ac_status" >&5
8027   (exit $ac_status); }; }; then
8028   ac_cv_func_initscr=yes
8029 else
8030   echo "$as_me: failed program was:" >&5
8031 cat conftest.$ac_ext >&5
8032 ac_cv_func_initscr=no
8033 fi
8034 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8035 fi
8036 echo "$as_me:8036: result: $ac_cv_func_initscr" >&5
8037 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8038 if test $ac_cv_func_initscr = yes; then
8039   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8040 else
8041
8042                 cf_save_LIBS="$LIBS"
8043                 echo "$as_me:8043: checking for initscr in -l$cf_nculib_root" >&5
8044 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8045                 LIBS="-l$cf_nculib_root $LIBS"
8046                 cat >conftest.$ac_ext <<_ACEOF
8047 #line 8047 "configure"
8048 #include "confdefs.h"
8049 #include <${cf_cv_ncurses_header:-curses.h}>
8050 int
8051 main (void)
8052 {
8053 initscr()
8054   ;
8055   return 0;
8056 }
8057 _ACEOF
8058 rm -f conftest.$ac_objext conftest$ac_exeext
8059 if { (eval echo "$as_me:8059: \"$ac_link\"") >&5
8060   (eval $ac_link) 2>&5
8061   ac_status=$?
8062   echo "$as_me:8062: \$? = $ac_status" >&5
8063   (exit $ac_status); } &&
8064          { ac_try='test -s conftest$ac_exeext'
8065   { (eval echo "$as_me:8065: \"$ac_try\"") >&5
8066   (eval $ac_try) 2>&5
8067   ac_status=$?
8068   echo "$as_me:8068: \$? = $ac_status" >&5
8069   (exit $ac_status); }; }; then
8070   echo "$as_me:8070: result: yes" >&5
8071 echo "${ECHO_T}yes" >&6
8072                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8073
8074 else
8075   echo "$as_me: failed program was:" >&5
8076 cat conftest.$ac_ext >&5
8077 echo "$as_me:8077: result: no" >&5
8078 echo "${ECHO_T}no" >&6
8079
8080 cf_search=
8081 cf_library_path_list=""
8082 if test -n "${LDFLAGS}${LIBS}" ; then
8083         for cf_library_path in $LDFLAGS $LIBS
8084         do
8085                 case $cf_library_path in
8086                 (-L*)
8087                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8088
8089 test "x$cf_library_path" != "xNONE" && \
8090 test -d "$cf_library_path" && \
8091  {
8092         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8093         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8094         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8095         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8096         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8097         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"
8098 }
8099
8100                         cf_library_path_list="$cf_library_path_list $cf_search"
8101                         ;;
8102                 esac
8103         done
8104 fi
8105
8106 cf_search=
8107
8108 test "x$prefix" != "xNONE" && \
8109 test -d "$prefix" && \
8110  {
8111         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8112         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8113         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8114         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8115         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8116         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8117 }
8118
8119 for cf_subdir_prefix in \
8120         /usr \
8121         /usr/local \
8122         /usr/pkg \
8123         /opt \
8124         /opt/local \
8125         $HOME
8126 do
8127
8128 test "x$cf_subdir_prefix" != "x$prefix" && \
8129 test -d "$cf_subdir_prefix" && \
8130 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8131         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8132         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8133         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8134         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8135         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8136         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"
8137 }
8138
8139 done
8140
8141 cf_search="$cf_library_path_list $cf_search"
8142
8143                         for cf_libdir in $cf_search
8144                         do
8145                                 echo "$as_me:8145: checking for -l$cf_nculib_root in $cf_libdir" >&5
8146 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8147                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8148                                 cat >conftest.$ac_ext <<_ACEOF
8149 #line 8149 "configure"
8150 #include "confdefs.h"
8151 #include <${cf_cv_ncurses_header:-curses.h}>
8152 int
8153 main (void)
8154 {
8155 initscr()
8156   ;
8157   return 0;
8158 }
8159 _ACEOF
8160 rm -f conftest.$ac_objext conftest$ac_exeext
8161 if { (eval echo "$as_me:8161: \"$ac_link\"") >&5
8162   (eval $ac_link) 2>&5
8163   ac_status=$?
8164   echo "$as_me:8164: \$? = $ac_status" >&5
8165   (exit $ac_status); } &&
8166          { ac_try='test -s conftest$ac_exeext'
8167   { (eval echo "$as_me:8167: \"$ac_try\"") >&5
8168   (eval $ac_try) 2>&5
8169   ac_status=$?
8170   echo "$as_me:8170: \$? = $ac_status" >&5
8171   (exit $ac_status); }; }; then
8172   echo "$as_me:8172: result: yes" >&5
8173 echo "${ECHO_T}yes" >&6
8174                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8175                                          break
8176 else
8177   echo "$as_me: failed program was:" >&5
8178 cat conftest.$ac_ext >&5
8179 echo "$as_me:8179: result: no" >&5
8180 echo "${ECHO_T}no" >&6
8181                                          LIBS="$cf_save_LIBS"
8182 fi
8183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8184                         done
8185
8186 fi
8187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8188
8189 fi
8190
8191 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8192
8193 if test $cf_found_library = no ; then
8194         { { echo "$as_me:8194: error: Cannot link $cf_nculib_root library" >&5
8195 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8196    { (exit 1); exit 1; }; }
8197 fi
8198
8199 fi
8200
8201 if test -n "$cf_ncurses_LIBS" ; then
8202         echo "$as_me:8202: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8203 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8204         cf_ncurses_SAVE="$LIBS"
8205         for p in $cf_ncurses_LIBS ; do
8206                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8207                 if test "$q" != "$LIBS" ; then
8208                         LIBS="$q"
8209                 fi
8210         done
8211         cat >conftest.$ac_ext <<_ACEOF
8212 #line 8212 "configure"
8213 #include "confdefs.h"
8214 #include <${cf_cv_ncurses_header:-curses.h}>
8215 int
8216 main (void)
8217 {
8218 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8219   ;
8220   return 0;
8221 }
8222 _ACEOF
8223 rm -f conftest.$ac_objext conftest$ac_exeext
8224 if { (eval echo "$as_me:8224: \"$ac_link\"") >&5
8225   (eval $ac_link) 2>&5
8226   ac_status=$?
8227   echo "$as_me:8227: \$? = $ac_status" >&5
8228   (exit $ac_status); } &&
8229          { ac_try='test -s conftest$ac_exeext'
8230   { (eval echo "$as_me:8230: \"$ac_try\"") >&5
8231   (eval $ac_try) 2>&5
8232   ac_status=$?
8233   echo "$as_me:8233: \$? = $ac_status" >&5
8234   (exit $ac_status); }; }; then
8235   echo "$as_me:8235: result: yes" >&5
8236 echo "${ECHO_T}yes" >&6
8237 else
8238   echo "$as_me: failed program was:" >&5
8239 cat conftest.$ac_ext >&5
8240 echo "$as_me:8240: result: no" >&5
8241 echo "${ECHO_T}no" >&6
8242                  LIBS="$cf_ncurses_SAVE"
8243 fi
8244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8245 fi
8246
8247 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8248
8249 cat >>confdefs.h <<EOF
8250 #define $cf_nculib_ROOT 1
8251 EOF
8252
8253         fi
8254 else
8255         NCURSES_CONFIG=none
8256 fi
8257
8258 else
8259
8260 cf_ncuconfig_root=ncurses
8261 cf_have_ncuconfig=no
8262
8263 if test "x${PKG_CONFIG:=none}" != xnone; then
8264         echo "$as_me:8264: checking pkg-config for $cf_ncuconfig_root" >&5
8265 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8266         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8267                 echo "$as_me:8267: result: yes" >&5
8268 echo "${ECHO_T}yes" >&6
8269
8270                 echo "$as_me:8270: checking if the $cf_ncuconfig_root package files work" >&5
8271 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8272                 cf_have_ncuconfig=unknown
8273
8274                 cf_save_CPPFLAGS="$CPPFLAGS"
8275                 cf_save_LIBS="$LIBS"
8276
8277 cf_fix_cppflags=no
8278 cf_new_cflags=
8279 cf_new_cppflags=
8280 cf_new_extra_cppflags=
8281
8282 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
8283 do
8284 case $cf_fix_cppflags in
8285 (no)
8286         case $cf_add_cflags in
8287         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8288                 case $cf_add_cflags in
8289                 (-D*)
8290                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8291
8292                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8293                                 && test -z "${cf_tst_cflags}" \
8294                                 && cf_fix_cppflags=yes
8295
8296                         if test $cf_fix_cppflags = yes ; then
8297
8298         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8299         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8300
8301                                 continue
8302                         elif test "${cf_tst_cflags}" = "\"'" ; then
8303
8304         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8305         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8306
8307                                 continue
8308                         fi
8309                         ;;
8310                 esac
8311                 case "$CPPFLAGS" in
8312                 (*$cf_add_cflags)
8313                         ;;
8314                 (*)
8315                         case $cf_add_cflags in
8316                         (-D*)
8317                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8318
8319 CPPFLAGS=`echo "$CPPFLAGS" | \
8320         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8321                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8322
8323                                 ;;
8324                         esac
8325
8326         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8327         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8328
8329                         ;;
8330                 esac
8331                 ;;
8332         (*)
8333
8334         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8335         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8336
8337                 ;;
8338         esac
8339         ;;
8340 (yes)
8341
8342         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8343         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8344
8345         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8346
8347         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8348                 && test -z "${cf_tst_cflags}" \
8349                 && cf_fix_cppflags=no
8350         ;;
8351 esac
8352 done
8353
8354 if test -n "$cf_new_cflags" ; then
8355
8356         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8357         CFLAGS="${CFLAGS}$cf_new_cflags"
8358
8359 fi
8360
8361 if test -n "$cf_new_cppflags" ; then
8362
8363         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8364         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8365
8366 fi
8367
8368 if test -n "$cf_new_extra_cppflags" ; then
8369
8370         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8371         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8372
8373 fi
8374
8375 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8376 # Filter out duplicates - this happens with badly-designed ".pc" files...
8377 for cf_add_1lib in $LIBS
8378 do
8379         for cf_add_2lib in $cf_add_libs
8380         do
8381                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8382                 then
8383                         cf_add_1lib=
8384                         break
8385                 fi
8386         done
8387         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8388 done
8389 LIBS="$cf_add_libs"
8390
8391                 cat >conftest.$ac_ext <<_ACEOF
8392 #line 8392 "configure"
8393 #include "confdefs.h"
8394 #include <${cf_cv_ncurses_header:-curses.h}>
8395 int
8396 main (void)
8397 {
8398 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8399   ;
8400   return 0;
8401 }
8402 _ACEOF
8403 rm -f conftest.$ac_objext conftest$ac_exeext
8404 if { (eval echo "$as_me:8404: \"$ac_link\"") >&5
8405   (eval $ac_link) 2>&5
8406   ac_status=$?
8407   echo "$as_me:8407: \$? = $ac_status" >&5
8408   (exit $ac_status); } &&
8409          { ac_try='test -s conftest$ac_exeext'
8410   { (eval echo "$as_me:8410: \"$ac_try\"") >&5
8411   (eval $ac_try) 2>&5
8412   ac_status=$?
8413   echo "$as_me:8413: \$? = $ac_status" >&5
8414   (exit $ac_status); }; }; then
8415   if test "$cross_compiling" = yes; then
8416   cf_have_ncuconfig=maybe
8417 else
8418   cat >conftest.$ac_ext <<_ACEOF
8419 #line 8419 "configure"
8420 #include "confdefs.h"
8421 #include <${cf_cv_ncurses_header:-curses.h}>
8422                                 int main(void)
8423                                 { char *xx = curses_version(); return (xx == 0); }
8424 _ACEOF
8425 rm -f conftest$ac_exeext
8426 if { (eval echo "$as_me:8426: \"$ac_link\"") >&5
8427   (eval $ac_link) 2>&5
8428   ac_status=$?
8429   echo "$as_me:8429: \$? = $ac_status" >&5
8430   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8431   { (eval echo "$as_me:8431: \"$ac_try\"") >&5
8432   (eval $ac_try) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); }; }; then
8436   cf_have_ncuconfig=yes
8437 else
8438   echo "$as_me: program exited with status $ac_status" >&5
8439 echo "$as_me: failed program was:" >&5
8440 cat conftest.$ac_ext >&5
8441 cf_have_ncuconfig=no
8442 fi
8443 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8444 fi
8445 else
8446   echo "$as_me: failed program was:" >&5
8447 cat conftest.$ac_ext >&5
8448 cf_have_ncuconfig=no
8449 fi
8450 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8451                 echo "$as_me:8451: result: $cf_have_ncuconfig" >&5
8452 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8453                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8454                 if test "$cf_have_ncuconfig" != "yes"
8455                 then
8456                         CPPFLAGS="$cf_save_CPPFLAGS"
8457                         LIBS="$cf_save_LIBS"
8458                         NCURSES_CONFIG_PKG=none
8459                 else
8460
8461 cat >>confdefs.h <<\EOF
8462 #define NCURSES 1
8463 EOF
8464
8465                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8466
8467 echo "$as_me:8467: checking for terminfo header" >&5
8468 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8469 if test "${cf_cv_term_header+set}" = set; then
8470   echo $ECHO_N "(cached) $ECHO_C" >&6
8471 else
8472
8473 case ${cf_cv_ncurses_header} in
8474 (*/ncurses.h|*/ncursesw.h)
8475         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8476         ;;
8477 (*)
8478         cf_term_header=term.h
8479         ;;
8480 esac
8481
8482 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8483 do
8484 cat >conftest.$ac_ext <<_ACEOF
8485 #line 8485 "configure"
8486 #include "confdefs.h"
8487 #include <stdio.h>
8488 #include <${cf_cv_ncurses_header:-curses.h}>
8489 #include <$cf_test>
8490
8491 int
8492 main (void)
8493 {
8494 int x = auto_left_margin
8495   ;
8496   return 0;
8497 }
8498 _ACEOF
8499 rm -f conftest.$ac_objext
8500 if { (eval echo "$as_me:8500: \"$ac_compile\"") >&5
8501   (eval $ac_compile) 2>&5
8502   ac_status=$?
8503   echo "$as_me:8503: \$? = $ac_status" >&5
8504   (exit $ac_status); } &&
8505          { ac_try='test -s conftest.$ac_objext'
8506   { (eval echo "$as_me:8506: \"$ac_try\"") >&5
8507   (eval $ac_try) 2>&5
8508   ac_status=$?
8509   echo "$as_me:8509: \$? = $ac_status" >&5
8510   (exit $ac_status); }; }; then
8511
8512         cf_cv_term_header="$cf_test"
8513 else
8514   echo "$as_me: failed program was:" >&5
8515 cat conftest.$ac_ext >&5
8516
8517         cf_cv_term_header=unknown
8518
8519 fi
8520 rm -f conftest.$ac_objext conftest.$ac_ext
8521         test "$cf_cv_term_header" != unknown && break
8522 done
8523
8524 fi
8525 echo "$as_me:8525: result: $cf_cv_term_header" >&5
8526 echo "${ECHO_T}$cf_cv_term_header" >&6
8527
8528 # Set definitions to allow ifdef'ing to accommodate subdirectories
8529
8530 case $cf_cv_term_header in
8531 (*term.h)
8532
8533 cat >>confdefs.h <<\EOF
8534 #define HAVE_TERM_H 1
8535 EOF
8536
8537         ;;
8538 esac
8539
8540 case $cf_cv_term_header in
8541 (ncurses/term.h)
8542
8543 cat >>confdefs.h <<\EOF
8544 #define HAVE_NCURSES_TERM_H 1
8545 EOF
8546
8547         ;;
8548 (ncursesw/term.h)
8549
8550 cat >>confdefs.h <<\EOF
8551 #define HAVE_NCURSESW_TERM_H 1
8552 EOF
8553
8554         ;;
8555 esac
8556
8557                 fi
8558
8559         else
8560                 echo "$as_me:8560: result: no" >&5
8561 echo "${ECHO_T}no" >&6
8562                 NCURSES_CONFIG_PKG=none
8563         fi
8564 else
8565         NCURSES_CONFIG_PKG=none
8566 fi
8567
8568 if test "x$cf_have_ncuconfig" = "xno"; then
8569         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8570
8571 if test -n "$ac_tool_prefix"; then
8572   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8573   do
8574     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8575 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8576 echo "$as_me:8576: checking for $ac_word" >&5
8577 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8578 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8579   echo $ECHO_N "(cached) $ECHO_C" >&6
8580 else
8581   if test -n "$NCURSES_CONFIG"; then
8582   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8583 else
8584   ac_save_IFS=$IFS; IFS=$ac_path_separator
8585 ac_dummy="$PATH"
8586 for ac_dir in $ac_dummy; do
8587   IFS=$ac_save_IFS
8588   test -z "$ac_dir" && ac_dir=.
8589   $as_executable_p "$ac_dir/$ac_word" || continue
8590 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8591 echo "$as_me:8591: found $ac_dir/$ac_word" >&5
8592 break
8593 done
8594
8595 fi
8596 fi
8597 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8598 if test -n "$NCURSES_CONFIG"; then
8599   echo "$as_me:8599: result: $NCURSES_CONFIG" >&5
8600 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8601 else
8602   echo "$as_me:8602: result: no" >&5
8603 echo "${ECHO_T}no" >&6
8604 fi
8605
8606     test -n "$NCURSES_CONFIG" && break
8607   done
8608 fi
8609 if test -z "$NCURSES_CONFIG"; then
8610   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8611   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8612 do
8613   # Extract the first word of "$ac_prog", so it can be a program name with args.
8614 set dummy $ac_prog; ac_word=$2
8615 echo "$as_me:8615: checking for $ac_word" >&5
8616 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8617 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8618   echo $ECHO_N "(cached) $ECHO_C" >&6
8619 else
8620   if test -n "$ac_ct_NCURSES_CONFIG"; then
8621   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8622 else
8623   ac_save_IFS=$IFS; IFS=$ac_path_separator
8624 ac_dummy="$PATH"
8625 for ac_dir in $ac_dummy; do
8626   IFS=$ac_save_IFS
8627   test -z "$ac_dir" && ac_dir=.
8628   $as_executable_p "$ac_dir/$ac_word" || continue
8629 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8630 echo "$as_me:8630: found $ac_dir/$ac_word" >&5
8631 break
8632 done
8633
8634 fi
8635 fi
8636 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8637 if test -n "$ac_ct_NCURSES_CONFIG"; then
8638   echo "$as_me:8638: result: $ac_ct_NCURSES_CONFIG" >&5
8639 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8640 else
8641   echo "$as_me:8641: result: no" >&5
8642 echo "${ECHO_T}no" >&6
8643 fi
8644
8645   test -n "$ac_ct_NCURSES_CONFIG" && break
8646 done
8647 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8648
8649   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8650 fi
8651
8652         if test "$NCURSES_CONFIG" != none ; then
8653
8654 cf_fix_cppflags=no
8655 cf_new_cflags=
8656 cf_new_cppflags=
8657 cf_new_extra_cppflags=
8658
8659 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8660 do
8661 case $cf_fix_cppflags in
8662 (no)
8663         case $cf_add_cflags in
8664         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8665                 case $cf_add_cflags in
8666                 (-D*)
8667                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8668
8669                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8670                                 && test -z "${cf_tst_cflags}" \
8671                                 && cf_fix_cppflags=yes
8672
8673                         if test $cf_fix_cppflags = yes ; then
8674
8675         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8676         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8677
8678                                 continue
8679                         elif test "${cf_tst_cflags}" = "\"'" ; then
8680
8681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8683
8684                                 continue
8685                         fi
8686                         ;;
8687                 esac
8688                 case "$CPPFLAGS" in
8689                 (*$cf_add_cflags)
8690                         ;;
8691                 (*)
8692                         case $cf_add_cflags in
8693                         (-D*)
8694                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8695
8696 CPPFLAGS=`echo "$CPPFLAGS" | \
8697         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8698                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8699
8700                                 ;;
8701                         esac
8702
8703         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8704         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8705
8706                         ;;
8707                 esac
8708                 ;;
8709         (*)
8710
8711         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8712         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8713
8714                 ;;
8715         esac
8716         ;;
8717 (yes)
8718
8719         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8720         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8721
8722         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8723
8724         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8725                 && test -z "${cf_tst_cflags}" \
8726                 && cf_fix_cppflags=no
8727         ;;
8728 esac
8729 done
8730
8731 if test -n "$cf_new_cflags" ; then
8732
8733         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8734         CFLAGS="${CFLAGS}$cf_new_cflags"
8735
8736 fi
8737
8738 if test -n "$cf_new_cppflags" ; then
8739
8740         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8741         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8742
8743 fi
8744
8745 if test -n "$cf_new_extra_cppflags" ; then
8746
8747         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8748         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8749
8750 fi
8751
8752 cf_add_libs="`$NCURSES_CONFIG --libs`"
8753 # Filter out duplicates - this happens with badly-designed ".pc" files...
8754 for cf_add_1lib in $LIBS
8755 do
8756         for cf_add_2lib in $cf_add_libs
8757         do
8758                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8759                 then
8760                         cf_add_1lib=
8761                         break
8762                 fi
8763         done
8764         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8765 done
8766 LIBS="$cf_add_libs"
8767
8768                 # even with config script, some packages use no-override for curses.h
8769
8770 echo "$as_me:8770: checking if we have identified curses headers" >&5
8771 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8772 if test "${cf_cv_ncurses_header+set}" = set; then
8773   echo $ECHO_N "(cached) $ECHO_C" >&6
8774 else
8775
8776 cf_cv_ncurses_header=none
8777 for cf_header in \
8778         ncurses.h ncurses/ncurses.h \
8779         curses.h ncurses/curses.h
8780 do
8781 cat >conftest.$ac_ext <<_ACEOF
8782 #line 8782 "configure"
8783 #include "confdefs.h"
8784 #include <${cf_header}>
8785 int
8786 main (void)
8787 {
8788 initscr(); tgoto("?", 0,0)
8789   ;
8790   return 0;
8791 }
8792 _ACEOF
8793 rm -f conftest.$ac_objext
8794 if { (eval echo "$as_me:8794: \"$ac_compile\"") >&5
8795   (eval $ac_compile) 2>&5
8796   ac_status=$?
8797   echo "$as_me:8797: \$? = $ac_status" >&5
8798   (exit $ac_status); } &&
8799          { ac_try='test -s conftest.$ac_objext'
8800   { (eval echo "$as_me:8800: \"$ac_try\"") >&5
8801   (eval $ac_try) 2>&5
8802   ac_status=$?
8803   echo "$as_me:8803: \$? = $ac_status" >&5
8804   (exit $ac_status); }; }; then
8805   cf_cv_ncurses_header=$cf_header; break
8806 else
8807   echo "$as_me: failed program was:" >&5
8808 cat conftest.$ac_ext >&5
8809 fi
8810 rm -f conftest.$ac_objext conftest.$ac_ext
8811 done
8812
8813 fi
8814 echo "$as_me:8814: result: $cf_cv_ncurses_header" >&5
8815 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8816
8817 if test "$cf_cv_ncurses_header" = none ; then
8818         { { echo "$as_me:8818: error: No curses header-files found" >&5
8819 echo "$as_me: error: No curses header-files found" >&2;}
8820    { (exit 1); exit 1; }; }
8821 fi
8822
8823 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8824
8825 for ac_header in $cf_cv_ncurses_header
8826 do
8827 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8828 echo "$as_me:8828: checking for $ac_header" >&5
8829 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8830 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8831   echo $ECHO_N "(cached) $ECHO_C" >&6
8832 else
8833   cat >conftest.$ac_ext <<_ACEOF
8834 #line 8834 "configure"
8835 #include "confdefs.h"
8836 #include <$ac_header>
8837 _ACEOF
8838 if { (eval echo "$as_me:8838: \"$ac_cpp conftest.$ac_ext\"") >&5
8839   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8840   ac_status=$?
8841   egrep -v '^ *\+' conftest.er1 >conftest.err
8842   rm -f conftest.er1
8843   cat conftest.err >&5
8844   echo "$as_me:8844: \$? = $ac_status" >&5
8845   (exit $ac_status); } >/dev/null; then
8846   if test -s conftest.err; then
8847     ac_cpp_err=$ac_c_preproc_warn_flag
8848   else
8849     ac_cpp_err=
8850   fi
8851 else
8852   ac_cpp_err=yes
8853 fi
8854 if test -z "$ac_cpp_err"; then
8855   eval "$as_ac_Header=yes"
8856 else
8857   echo "$as_me: failed program was:" >&5
8858   cat conftest.$ac_ext >&5
8859   eval "$as_ac_Header=no"
8860 fi
8861 rm -f conftest.err conftest.$ac_ext
8862 fi
8863 echo "$as_me:8863: result: `eval echo '${'$as_ac_Header'}'`" >&5
8864 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8865 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8866   cat >>confdefs.h <<EOF
8867 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8868 EOF
8869
8870 fi
8871 done
8872
8873 cat >>confdefs.h <<\EOF
8874 #define NCURSES 1
8875 EOF
8876
8877 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8878
8879                 cat >>confdefs.h <<EOF
8880 #define $cf_nculib_ROOT 1
8881 EOF
8882
8883                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8884
8885         else
8886
8887 cf_ncuhdr_root=ncurses
8888
8889 test -n "$cf_cv_curses_dir" && \
8890 test "$cf_cv_curses_dir" != "no" && { \
8891
8892 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8893   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8894   do
8895         while test $cf_add_incdir != /usr/include
8896         do
8897           if test -d $cf_add_incdir
8898           then
8899                 cf_have_incdir=no
8900                 if test -n "$CFLAGS$CPPFLAGS" ; then
8901                   # a loop is needed to ensure we can add subdirs of existing dirs
8902                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8903                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8904                           cf_have_incdir=yes; break
8905                         fi
8906                   done
8907                 fi
8908
8909                 if test "$cf_have_incdir" = no ; then
8910                   if test "$cf_add_incdir" = /usr/local/include ; then
8911                         if test "$GCC" = yes
8912                         then
8913                           cf_save_CPPFLAGS=$CPPFLAGS
8914
8915         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8916         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8917
8918                           cat >conftest.$ac_ext <<_ACEOF
8919 #line 8919 "configure"
8920 #include "confdefs.h"
8921 #include <stdio.h>
8922 int
8923 main (void)
8924 {
8925 printf("Hello")
8926   ;
8927   return 0;
8928 }
8929 _ACEOF
8930 rm -f conftest.$ac_objext
8931 if { (eval echo "$as_me:8931: \"$ac_compile\"") >&5
8932   (eval $ac_compile) 2>&5
8933   ac_status=$?
8934   echo "$as_me:8934: \$? = $ac_status" >&5
8935   (exit $ac_status); } &&
8936          { ac_try='test -s conftest.$ac_objext'
8937   { (eval echo "$as_me:8937: \"$ac_try\"") >&5
8938   (eval $ac_try) 2>&5
8939   ac_status=$?
8940   echo "$as_me:8940: \$? = $ac_status" >&5
8941   (exit $ac_status); }; }; then
8942   :
8943 else
8944   echo "$as_me: failed program was:" >&5
8945 cat conftest.$ac_ext >&5
8946 cf_have_incdir=yes
8947 fi
8948 rm -f conftest.$ac_objext conftest.$ac_ext
8949                           CPPFLAGS=$cf_save_CPPFLAGS
8950                         fi
8951                   fi
8952                 fi
8953
8954                 if test "$cf_have_incdir" = no ; then
8955                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8956
8957 echo "${as_me:-configure}:8957: testing adding $cf_add_incdir to include-path ..." 1>&5
8958
8959                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8960
8961                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8962                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8963                   cf_add_incdir="$cf_top_incdir"
8964                 else
8965                   break
8966                 fi
8967           else
8968                 break
8969           fi
8970         done
8971   done
8972 fi
8973
8974 }
8975
8976 echo "$as_me:8976: checking for $cf_ncuhdr_root header in include-path" >&5
8977 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8978 if test "${cf_cv_ncurses_h+set}" = set; then
8979   echo $ECHO_N "(cached) $ECHO_C" >&6
8980 else
8981
8982         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8983         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8984         for cf_header in $cf_header_list
8985         do
8986
8987         cat >conftest.$ac_ext <<_ACEOF
8988 #line 8988 "configure"
8989 #include "confdefs.h"
8990
8991 #include <$cf_header>
8992 int
8993 main (void)
8994 {
8995
8996 #ifdef NCURSES_VERSION
8997
8998 printf("%s\n", NCURSES_VERSION);
8999 #else
9000 #ifdef __NCURSES_H
9001 printf("old\n");
9002 #else
9003         make an error
9004 #endif
9005 #endif
9006
9007   ;
9008   return 0;
9009 }
9010 _ACEOF
9011 rm -f conftest.$ac_objext
9012 if { (eval echo "$as_me:9012: \"$ac_compile\"") >&5
9013   (eval $ac_compile) 2>&5
9014   ac_status=$?
9015   echo "$as_me:9015: \$? = $ac_status" >&5
9016   (exit $ac_status); } &&
9017          { ac_try='test -s conftest.$ac_objext'
9018   { (eval echo "$as_me:9018: \"$ac_try\"") >&5
9019   (eval $ac_try) 2>&5
9020   ac_status=$?
9021   echo "$as_me:9021: \$? = $ac_status" >&5
9022   (exit $ac_status); }; }; then
9023   cf_cv_ncurses_h=$cf_header
9024
9025 else
9026   echo "$as_me: failed program was:" >&5
9027 cat conftest.$ac_ext >&5
9028 cf_cv_ncurses_h=no
9029 fi
9030 rm -f conftest.$ac_objext conftest.$ac_ext
9031
9032                 test "$cf_cv_ncurses_h" != no && break
9033         done
9034
9035 fi
9036 echo "$as_me:9036: result: $cf_cv_ncurses_h" >&5
9037 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9038
9039 if test "$cf_cv_ncurses_h" != no ; then
9040         cf_cv_ncurses_header=$cf_cv_ncurses_h
9041 else
9042
9043 echo "$as_me:9043: checking for $cf_ncuhdr_root include-path" >&5
9044 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9045 if test "${cf_cv_ncurses_h2+set}" = set; then
9046   echo $ECHO_N "(cached) $ECHO_C" >&6
9047 else
9048
9049         test -n "$verbose" && echo
9050
9051 cf_search=
9052
9053 # collect the current set of include-directories from compiler flags
9054 cf_header_path_list=""
9055 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9056         for cf_header_path in $CPPFLAGS $CFLAGS
9057         do
9058                 case $cf_header_path in
9059                 (-I*)
9060                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9061
9062 test "x$cf_header_path" != "xNONE" && \
9063 test -d "$cf_header_path" && \
9064  {
9065         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9066         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9067         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9068         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9069         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9070         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"
9071 }
9072
9073                         cf_header_path_list="$cf_header_path_list $cf_search"
9074                         ;;
9075                 esac
9076         done
9077 fi
9078
9079 # add the variations for the package we are looking for
9080
9081 cf_search=
9082
9083 test "x$prefix" != "xNONE" && \
9084 test -d "$prefix" && \
9085  {
9086         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9087         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9088         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9089         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9090         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9091         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9092 }
9093
9094 for cf_subdir_prefix in \
9095         /usr \
9096         /usr/local \
9097         /usr/pkg \
9098         /opt \
9099         /opt/local \
9100         $HOME
9101 do
9102
9103 test "x$cf_subdir_prefix" != "x$prefix" && \
9104 test -d "$cf_subdir_prefix" && \
9105 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9106         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9107         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9108         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9109         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9110         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9111         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"
9112 }
9113
9114 done
9115
9116 test "$includedir" != NONE && \
9117 test "$includedir" != "/usr/include" && \
9118 test -d "$includedir" && {
9119         test -d $includedir &&    cf_search="$cf_search $includedir"
9120         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9121 }
9122
9123 test "$oldincludedir" != NONE && \
9124 test "$oldincludedir" != "/usr/include" && \
9125 test -d "$oldincludedir" && {
9126         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9127         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9128 }
9129
9130 cf_search="$cf_search $cf_header_path_list"
9131
9132         test -n "$verbose" && echo search path $cf_search
9133         cf_save2_CPPFLAGS="$CPPFLAGS"
9134         for cf_incdir in $cf_search
9135         do
9136
9137 if test -n "$cf_incdir" ; then
9138   for cf_add_incdir in $cf_incdir
9139   do
9140         while test $cf_add_incdir != /usr/include
9141         do
9142           if test -d $cf_add_incdir
9143           then
9144                 cf_have_incdir=no
9145                 if test -n "$CFLAGS$CPPFLAGS" ; then
9146                   # a loop is needed to ensure we can add subdirs of existing dirs
9147                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9148                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9149                           cf_have_incdir=yes; break
9150                         fi
9151                   done
9152                 fi
9153
9154                 if test "$cf_have_incdir" = no ; then
9155                   if test "$cf_add_incdir" = /usr/local/include ; then
9156                         if test "$GCC" = yes
9157                         then
9158                           cf_save_CPPFLAGS=$CPPFLAGS
9159
9160         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9161         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9162
9163                           cat >conftest.$ac_ext <<_ACEOF
9164 #line 9164 "configure"
9165 #include "confdefs.h"
9166 #include <stdio.h>
9167 int
9168 main (void)
9169 {
9170 printf("Hello")
9171   ;
9172   return 0;
9173 }
9174 _ACEOF
9175 rm -f conftest.$ac_objext
9176 if { (eval echo "$as_me:9176: \"$ac_compile\"") >&5
9177   (eval $ac_compile) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); } &&
9181          { ac_try='test -s conftest.$ac_objext'
9182   { (eval echo "$as_me:9182: \"$ac_try\"") >&5
9183   (eval $ac_try) 2>&5
9184   ac_status=$?
9185   echo "$as_me:9185: \$? = $ac_status" >&5
9186   (exit $ac_status); }; }; then
9187   :
9188 else
9189   echo "$as_me: failed program was:" >&5
9190 cat conftest.$ac_ext >&5
9191 cf_have_incdir=yes
9192 fi
9193 rm -f conftest.$ac_objext conftest.$ac_ext
9194                           CPPFLAGS=$cf_save_CPPFLAGS
9195                         fi
9196                   fi
9197                 fi
9198
9199                 if test "$cf_have_incdir" = no ; then
9200                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9201
9202 echo "${as_me:-configure}:9202: testing adding $cf_add_incdir to include-path ..." 1>&5
9203
9204                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9205
9206                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9207                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9208                   cf_add_incdir="$cf_top_incdir"
9209                 else
9210                   break
9211                 fi
9212           else
9213                 break
9214           fi
9215         done
9216   done
9217 fi
9218
9219                 for cf_header in \
9220                         ncurses.h \
9221                         curses.h
9222                 do
9223
9224         cat >conftest.$ac_ext <<_ACEOF
9225 #line 9225 "configure"
9226 #include "confdefs.h"
9227
9228 #include <$cf_header>
9229 int
9230 main (void)
9231 {
9232
9233 #ifdef NCURSES_VERSION
9234
9235 printf("%s\n", NCURSES_VERSION);
9236 #else
9237 #ifdef __NCURSES_H
9238 printf("old\n");
9239 #else
9240         make an error
9241 #endif
9242 #endif
9243
9244   ;
9245   return 0;
9246 }
9247 _ACEOF
9248 rm -f conftest.$ac_objext
9249 if { (eval echo "$as_me:9249: \"$ac_compile\"") >&5
9250   (eval $ac_compile) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit $ac_status); } &&
9254          { ac_try='test -s conftest.$ac_objext'
9255   { (eval echo "$as_me:9255: \"$ac_try\"") >&5
9256   (eval $ac_try) 2>&5
9257   ac_status=$?
9258   echo "$as_me:9258: \$? = $ac_status" >&5
9259   (exit $ac_status); }; }; then
9260   cf_cv_ncurses_h2=$cf_header
9261
9262 else
9263   echo "$as_me: failed program was:" >&5
9264 cat conftest.$ac_ext >&5
9265 cf_cv_ncurses_h2=no
9266 fi
9267 rm -f conftest.$ac_objext conftest.$ac_ext
9268
9269                         if test "$cf_cv_ncurses_h2" != no ; then
9270                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9271                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9272                                 break
9273                         fi
9274                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9275                 done
9276                 CPPFLAGS="$cf_save2_CPPFLAGS"
9277                 test "$cf_cv_ncurses_h2" != no && break
9278         done
9279         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9279: error: not found" >&5
9280 echo "$as_me: error: not found" >&2;}
9281    { (exit 1); exit 1; }; }
9282
9283 fi
9284 echo "$as_me:9284: result: $cf_cv_ncurses_h2" >&5
9285 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9286
9287         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9288         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9289         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9290                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9291         fi
9292
9293 if test -n "$cf_1st_incdir" ; then
9294   for cf_add_incdir in $cf_1st_incdir
9295   do
9296         while test $cf_add_incdir != /usr/include
9297         do
9298           if test -d $cf_add_incdir
9299           then
9300                 cf_have_incdir=no
9301                 if test -n "$CFLAGS$CPPFLAGS" ; then
9302                   # a loop is needed to ensure we can add subdirs of existing dirs
9303                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9304                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9305                           cf_have_incdir=yes; break
9306                         fi
9307                   done
9308                 fi
9309
9310                 if test "$cf_have_incdir" = no ; then
9311                   if test "$cf_add_incdir" = /usr/local/include ; then
9312                         if test "$GCC" = yes
9313                         then
9314                           cf_save_CPPFLAGS=$CPPFLAGS
9315
9316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9317         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9318
9319                           cat >conftest.$ac_ext <<_ACEOF
9320 #line 9320 "configure"
9321 #include "confdefs.h"
9322 #include <stdio.h>
9323 int
9324 main (void)
9325 {
9326 printf("Hello")
9327   ;
9328   return 0;
9329 }
9330 _ACEOF
9331 rm -f conftest.$ac_objext
9332 if { (eval echo "$as_me:9332: \"$ac_compile\"") >&5
9333   (eval $ac_compile) 2>&5
9334   ac_status=$?
9335   echo "$as_me:9335: \$? = $ac_status" >&5
9336   (exit $ac_status); } &&
9337          { ac_try='test -s conftest.$ac_objext'
9338   { (eval echo "$as_me:9338: \"$ac_try\"") >&5
9339   (eval $ac_try) 2>&5
9340   ac_status=$?
9341   echo "$as_me:9341: \$? = $ac_status" >&5
9342   (exit $ac_status); }; }; then
9343   :
9344 else
9345   echo "$as_me: failed program was:" >&5
9346 cat conftest.$ac_ext >&5
9347 cf_have_incdir=yes
9348 fi
9349 rm -f conftest.$ac_objext conftest.$ac_ext
9350                           CPPFLAGS=$cf_save_CPPFLAGS
9351                         fi
9352                   fi
9353                 fi
9354
9355                 if test "$cf_have_incdir" = no ; then
9356                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9357
9358 echo "${as_me:-configure}:9358: testing adding $cf_add_incdir to include-path ..." 1>&5
9359
9360                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9361
9362                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9363                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9364                   cf_add_incdir="$cf_top_incdir"
9365                 else
9366                   break
9367                 fi
9368           else
9369                 break
9370           fi
9371         done
9372   done
9373 fi
9374
9375 fi
9376
9377 # Set definitions to allow ifdef'ing for ncurses.h
9378
9379 case $cf_cv_ncurses_header in
9380 (*ncurses.h)
9381
9382 cat >>confdefs.h <<\EOF
9383 #define HAVE_NCURSES_H 1
9384 EOF
9385
9386         ;;
9387 esac
9388
9389 case $cf_cv_ncurses_header in
9390 (ncurses/curses.h|ncurses/ncurses.h)
9391
9392 cat >>confdefs.h <<\EOF
9393 #define HAVE_NCURSES_NCURSES_H 1
9394 EOF
9395
9396         ;;
9397 (ncursesw/curses.h|ncursesw/ncurses.h)
9398
9399 cat >>confdefs.h <<\EOF
9400 #define HAVE_NCURSESW_NCURSES_H 1
9401 EOF
9402
9403         ;;
9404 esac
9405
9406 echo "$as_me:9406: checking for terminfo header" >&5
9407 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9408 if test "${cf_cv_term_header+set}" = set; then
9409   echo $ECHO_N "(cached) $ECHO_C" >&6
9410 else
9411
9412 case ${cf_cv_ncurses_header} in
9413 (*/ncurses.h|*/ncursesw.h)
9414         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9415         ;;
9416 (*)
9417         cf_term_header=term.h
9418         ;;
9419 esac
9420
9421 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9422 do
9423 cat >conftest.$ac_ext <<_ACEOF
9424 #line 9424 "configure"
9425 #include "confdefs.h"
9426 #include <stdio.h>
9427 #include <${cf_cv_ncurses_header:-curses.h}>
9428 #include <$cf_test>
9429
9430 int
9431 main (void)
9432 {
9433 int x = auto_left_margin
9434   ;
9435   return 0;
9436 }
9437 _ACEOF
9438 rm -f conftest.$ac_objext
9439 if { (eval echo "$as_me:9439: \"$ac_compile\"") >&5
9440   (eval $ac_compile) 2>&5
9441   ac_status=$?
9442   echo "$as_me:9442: \$? = $ac_status" >&5
9443   (exit $ac_status); } &&
9444          { ac_try='test -s conftest.$ac_objext'
9445   { (eval echo "$as_me:9445: \"$ac_try\"") >&5
9446   (eval $ac_try) 2>&5
9447   ac_status=$?
9448   echo "$as_me:9448: \$? = $ac_status" >&5
9449   (exit $ac_status); }; }; then
9450
9451         cf_cv_term_header="$cf_test"
9452 else
9453   echo "$as_me: failed program was:" >&5
9454 cat conftest.$ac_ext >&5
9455
9456         cf_cv_term_header=unknown
9457
9458 fi
9459 rm -f conftest.$ac_objext conftest.$ac_ext
9460         test "$cf_cv_term_header" != unknown && break
9461 done
9462
9463 fi
9464 echo "$as_me:9464: result: $cf_cv_term_header" >&5
9465 echo "${ECHO_T}$cf_cv_term_header" >&6
9466
9467 # Set definitions to allow ifdef'ing to accommodate subdirectories
9468
9469 case $cf_cv_term_header in
9470 (*term.h)
9471
9472 cat >>confdefs.h <<\EOF
9473 #define HAVE_TERM_H 1
9474 EOF
9475
9476         ;;
9477 esac
9478
9479 case $cf_cv_term_header in
9480 (ncurses/term.h)
9481
9482 cat >>confdefs.h <<\EOF
9483 #define HAVE_NCURSES_TERM_H 1
9484 EOF
9485
9486         ;;
9487 (ncursesw/term.h)
9488
9489 cat >>confdefs.h <<\EOF
9490 #define HAVE_NCURSESW_TERM_H 1
9491 EOF
9492
9493         ;;
9494 esac
9495
9496 # some applications need this, but should check for NCURSES_VERSION
9497
9498 cat >>confdefs.h <<\EOF
9499 #define NCURSES 1
9500 EOF
9501
9502 echo "$as_me:9502: checking for ncurses version" >&5
9503 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9504 if test "${cf_cv_ncurses_version+set}" = set; then
9505   echo $ECHO_N "(cached) $ECHO_C" >&6
9506 else
9507
9508         cf_cv_ncurses_version=no
9509         cf_tempfile=out$$
9510         rm -f $cf_tempfile
9511         if test "$cross_compiling" = yes; then
9512
9513         # This will not work if the preprocessor splits the line after the
9514         # Autoconf token.  The 'unproto' program does that.
9515         cat > conftest.$ac_ext <<EOF
9516 #include <${cf_cv_ncurses_header:-curses.h}>
9517 #undef Autoconf
9518 #ifdef NCURSES_VERSION
9519 Autoconf NCURSES_VERSION
9520 #else
9521 #ifdef __NCURSES_H
9522 Autoconf "old"
9523 #endif
9524 ;
9525 #endif
9526 EOF
9527         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9528         { (eval echo "$as_me:9528: \"$cf_try\"") >&5
9529   (eval $cf_try) 2>&5
9530   ac_status=$?
9531   echo "$as_me:9531: \$? = $ac_status" >&5
9532   (exit $ac_status); }
9533         if test -f conftest.out ; then
9534                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9535                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9536                 rm -f conftest.out
9537         fi
9538
9539 else
9540   cat >conftest.$ac_ext <<_ACEOF
9541 #line 9541 "configure"
9542 #include "confdefs.h"
9543
9544 #include <${cf_cv_ncurses_header:-curses.h}>
9545 #include <stdio.h>
9546 int main(void)
9547 {
9548         FILE *fp = fopen("$cf_tempfile", "w");
9549 #ifdef NCURSES_VERSION
9550 # ifdef NCURSES_VERSION_PATCH
9551         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9552 # else
9553         fprintf(fp, "%s\n", NCURSES_VERSION);
9554 # endif
9555 #else
9556 # ifdef __NCURSES_H
9557         fprintf(fp, "old\n");
9558 # else
9559         make an error
9560 # endif
9561 #endif
9562         ${cf_cv_main_return:-return}(0);
9563 }
9564 _ACEOF
9565 rm -f conftest$ac_exeext
9566 if { (eval echo "$as_me:9566: \"$ac_link\"") >&5
9567   (eval $ac_link) 2>&5
9568   ac_status=$?
9569   echo "$as_me:9569: \$? = $ac_status" >&5
9570   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9571   { (eval echo "$as_me:9571: \"$ac_try\"") >&5
9572   (eval $ac_try) 2>&5
9573   ac_status=$?
9574   echo "$as_me:9574: \$? = $ac_status" >&5
9575   (exit $ac_status); }; }; then
9576
9577         cf_cv_ncurses_version=`cat $cf_tempfile`
9578 else
9579   echo "$as_me: program exited with status $ac_status" >&5
9580 echo "$as_me: failed program was:" >&5
9581 cat conftest.$ac_ext >&5
9582 fi
9583 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9584 fi
9585         rm -f $cf_tempfile
9586
9587 fi
9588 echo "$as_me:9588: result: $cf_cv_ncurses_version" >&5
9589 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9590 test "$cf_cv_ncurses_version" = no ||
9591 cat >>confdefs.h <<\EOF
9592 #define NCURSES 1
9593 EOF
9594
9595 cf_nculib_root=ncurses
9596         # This works, except for the special case where we find gpm, but
9597         # ncurses is in a nonstandard location via $LIBS, and we really want
9598         # to link gpm.
9599 cf_ncurses_LIBS=""
9600 cf_ncurses_SAVE="$LIBS"
9601 echo "$as_me:9601: checking for Gpm_Open in -lgpm" >&5
9602 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9603 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9604   echo $ECHO_N "(cached) $ECHO_C" >&6
9605 else
9606   ac_check_lib_save_LIBS=$LIBS
9607 LIBS="-lgpm  $LIBS"
9608 cat >conftest.$ac_ext <<_ACEOF
9609 #line 9609 "configure"
9610 #include "confdefs.h"
9611
9612 /* Override any gcc2 internal prototype to avoid an error.  */
9613 #ifdef __cplusplus
9614 extern "C"
9615 #endif
9616 /* We use char because int might match the return type of a gcc2
9617    builtin and then its argument prototype would still apply.  */
9618 char Gpm_Open ();
9619 int
9620 main (void)
9621 {
9622 Gpm_Open ();
9623   ;
9624   return 0;
9625 }
9626 _ACEOF
9627 rm -f conftest.$ac_objext conftest$ac_exeext
9628 if { (eval echo "$as_me:9628: \"$ac_link\"") >&5
9629   (eval $ac_link) 2>&5
9630   ac_status=$?
9631   echo "$as_me:9631: \$? = $ac_status" >&5
9632   (exit $ac_status); } &&
9633          { ac_try='test -s conftest$ac_exeext'
9634   { (eval echo "$as_me:9634: \"$ac_try\"") >&5
9635   (eval $ac_try) 2>&5
9636   ac_status=$?
9637   echo "$as_me:9637: \$? = $ac_status" >&5
9638   (exit $ac_status); }; }; then
9639   ac_cv_lib_gpm_Gpm_Open=yes
9640 else
9641   echo "$as_me: failed program was:" >&5
9642 cat conftest.$ac_ext >&5
9643 ac_cv_lib_gpm_Gpm_Open=no
9644 fi
9645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9646 LIBS=$ac_check_lib_save_LIBS
9647 fi
9648 echo "$as_me:9648: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9649 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9650 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9651   echo "$as_me:9651: checking for initscr in -lgpm" >&5
9652 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9653 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9654   echo $ECHO_N "(cached) $ECHO_C" >&6
9655 else
9656   ac_check_lib_save_LIBS=$LIBS
9657 LIBS="-lgpm  $LIBS"
9658 cat >conftest.$ac_ext <<_ACEOF
9659 #line 9659 "configure"
9660 #include "confdefs.h"
9661
9662 /* Override any gcc2 internal prototype to avoid an error.  */
9663 #ifdef __cplusplus
9664 extern "C"
9665 #endif
9666 /* We use char because int might match the return type of a gcc2
9667    builtin and then its argument prototype would still apply.  */
9668 char initscr ();
9669 int
9670 main (void)
9671 {
9672 initscr ();
9673   ;
9674   return 0;
9675 }
9676 _ACEOF
9677 rm -f conftest.$ac_objext conftest$ac_exeext
9678 if { (eval echo "$as_me:9678: \"$ac_link\"") >&5
9679   (eval $ac_link) 2>&5
9680   ac_status=$?
9681   echo "$as_me:9681: \$? = $ac_status" >&5
9682   (exit $ac_status); } &&
9683          { ac_try='test -s conftest$ac_exeext'
9684   { (eval echo "$as_me:9684: \"$ac_try\"") >&5
9685   (eval $ac_try) 2>&5
9686   ac_status=$?
9687   echo "$as_me:9687: \$? = $ac_status" >&5
9688   (exit $ac_status); }; }; then
9689   ac_cv_lib_gpm_initscr=yes
9690 else
9691   echo "$as_me: failed program was:" >&5
9692 cat conftest.$ac_ext >&5
9693 ac_cv_lib_gpm_initscr=no
9694 fi
9695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9696 LIBS=$ac_check_lib_save_LIBS
9697 fi
9698 echo "$as_me:9698: result: $ac_cv_lib_gpm_initscr" >&5
9699 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9700 if test $ac_cv_lib_gpm_initscr = yes; then
9701   LIBS="$cf_ncurses_SAVE"
9702 else
9703   cf_ncurses_LIBS="-lgpm"
9704 fi
9705
9706 fi
9707
9708 case $host_os in
9709 (freebsd*)
9710         # This is only necessary if you are linking against an obsolete
9711         # version of ncurses (but it should do no harm, since it's static).
9712         if test "$cf_nculib_root" = ncurses ; then
9713                 echo "$as_me:9713: checking for tgoto in -lmytinfo" >&5
9714 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9715 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9716   echo $ECHO_N "(cached) $ECHO_C" >&6
9717 else
9718   ac_check_lib_save_LIBS=$LIBS
9719 LIBS="-lmytinfo  $LIBS"
9720 cat >conftest.$ac_ext <<_ACEOF
9721 #line 9721 "configure"
9722 #include "confdefs.h"
9723
9724 /* Override any gcc2 internal prototype to avoid an error.  */
9725 #ifdef __cplusplus
9726 extern "C"
9727 #endif
9728 /* We use char because int might match the return type of a gcc2
9729    builtin and then its argument prototype would still apply.  */
9730 char tgoto ();
9731 int
9732 main (void)
9733 {
9734 tgoto ();
9735   ;
9736   return 0;
9737 }
9738 _ACEOF
9739 rm -f conftest.$ac_objext conftest$ac_exeext
9740 if { (eval echo "$as_me:9740: \"$ac_link\"") >&5
9741   (eval $ac_link) 2>&5
9742   ac_status=$?
9743   echo "$as_me:9743: \$? = $ac_status" >&5
9744   (exit $ac_status); } &&
9745          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_lib_mytinfo_tgoto=yes
9752 else
9753   echo "$as_me: failed program was:" >&5
9754 cat conftest.$ac_ext >&5
9755 ac_cv_lib_mytinfo_tgoto=no
9756 fi
9757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9758 LIBS=$ac_check_lib_save_LIBS
9759 fi
9760 echo "$as_me:9760: result: $ac_cv_lib_mytinfo_tgoto" >&5
9761 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9762 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9763   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9764 fi
9765
9766         fi
9767         ;;
9768 esac
9769
9770 cf_add_libs="$cf_ncurses_LIBS"
9771 # Filter out duplicates - this happens with badly-designed ".pc" files...
9772 for cf_add_1lib in $LIBS
9773 do
9774         for cf_add_2lib in $cf_add_libs
9775         do
9776                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9777                 then
9778                         cf_add_1lib=
9779                         break
9780                 fi
9781         done
9782         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9783 done
9784 LIBS="$cf_add_libs"
9785
9786 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9787 then
9788
9789 cf_add_libs="-l$cf_nculib_root"
9790 # Filter out duplicates - this happens with badly-designed ".pc" files...
9791 for cf_add_1lib in $LIBS
9792 do
9793         for cf_add_2lib in $cf_add_libs
9794         do
9795                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9796                 then
9797                         cf_add_1lib=
9798                         break
9799                 fi
9800         done
9801         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9802 done
9803 LIBS="$cf_add_libs"
9804
9805 else
9806
9807         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9808         cf_libdir=""
9809         echo "$as_me:9809: checking for initscr" >&5
9810 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9811 if test "${ac_cv_func_initscr+set}" = set; then
9812   echo $ECHO_N "(cached) $ECHO_C" >&6
9813 else
9814   cat >conftest.$ac_ext <<_ACEOF
9815 #line 9815 "configure"
9816 #include "confdefs.h"
9817 /* System header to define __stub macros and hopefully few prototypes,
9818     which can conflict with char initscr (); below.  */
9819 #include <assert.h>
9820 /* Override any gcc2 internal prototype to avoid an error.  */
9821 #ifdef __cplusplus
9822 extern "C"
9823 #endif
9824 /* We use char because int might match the return type of a gcc2
9825    builtin and then its argument prototype would still apply.  */
9826 char initscr ();
9827 char (*f) ();
9828
9829 int
9830 main (void)
9831 {
9832 /* The GNU C library defines this for functions which it implements
9833     to always fail with ENOSYS.  Some functions are actually named
9834     something starting with __ and the normal name is an alias.  */
9835 #if defined (__stub_initscr) || defined (__stub___initscr)
9836 choke me
9837 #else
9838 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9839 #endif
9840
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext conftest$ac_exeext
9846 if { (eval echo "$as_me:9846: \"$ac_link\"") >&5
9847   (eval $ac_link) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest$ac_exeext'
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   ac_cv_func_initscr=yes
9858 else
9859   echo "$as_me: failed program was:" >&5
9860 cat conftest.$ac_ext >&5
9861 ac_cv_func_initscr=no
9862 fi
9863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9864 fi
9865 echo "$as_me:9865: result: $ac_cv_func_initscr" >&5
9866 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9867 if test $ac_cv_func_initscr = yes; then
9868   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9869 else
9870
9871                 cf_save_LIBS="$LIBS"
9872                 echo "$as_me:9872: checking for initscr in -l$cf_nculib_root" >&5
9873 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9874                 LIBS="-l$cf_nculib_root $LIBS"
9875                 cat >conftest.$ac_ext <<_ACEOF
9876 #line 9876 "configure"
9877 #include "confdefs.h"
9878 #include <${cf_cv_ncurses_header:-curses.h}>
9879 int
9880 main (void)
9881 {
9882 initscr()
9883   ;
9884   return 0;
9885 }
9886 _ACEOF
9887 rm -f conftest.$ac_objext conftest$ac_exeext
9888 if { (eval echo "$as_me:9888: \"$ac_link\"") >&5
9889   (eval $ac_link) 2>&5
9890   ac_status=$?
9891   echo "$as_me:9891: \$? = $ac_status" >&5
9892   (exit $ac_status); } &&
9893          { ac_try='test -s conftest$ac_exeext'
9894   { (eval echo "$as_me:9894: \"$ac_try\"") >&5
9895   (eval $ac_try) 2>&5
9896   ac_status=$?
9897   echo "$as_me:9897: \$? = $ac_status" >&5
9898   (exit $ac_status); }; }; then
9899   echo "$as_me:9899: result: yes" >&5
9900 echo "${ECHO_T}yes" >&6
9901                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9902
9903 else
9904   echo "$as_me: failed program was:" >&5
9905 cat conftest.$ac_ext >&5
9906 echo "$as_me:9906: result: no" >&5
9907 echo "${ECHO_T}no" >&6
9908
9909 cf_search=
9910 cf_library_path_list=""
9911 if test -n "${LDFLAGS}${LIBS}" ; then
9912         for cf_library_path in $LDFLAGS $LIBS
9913         do
9914                 case $cf_library_path in
9915                 (-L*)
9916                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9917
9918 test "x$cf_library_path" != "xNONE" && \
9919 test -d "$cf_library_path" && \
9920  {
9921         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9922         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9923         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9924         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9925         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9926         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"
9927 }
9928
9929                         cf_library_path_list="$cf_library_path_list $cf_search"
9930                         ;;
9931                 esac
9932         done
9933 fi
9934
9935 cf_search=
9936
9937 test "x$prefix" != "xNONE" && \
9938 test -d "$prefix" && \
9939  {
9940         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9941         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9942         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9943         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9944         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9945         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9946 }
9947
9948 for cf_subdir_prefix in \
9949         /usr \
9950         /usr/local \
9951         /usr/pkg \
9952         /opt \
9953         /opt/local \
9954         $HOME
9955 do
9956
9957 test "x$cf_subdir_prefix" != "x$prefix" && \
9958 test -d "$cf_subdir_prefix" && \
9959 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9960         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9961         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9962         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9963         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9964         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9965         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"
9966 }
9967
9968 done
9969
9970 cf_search="$cf_library_path_list $cf_search"
9971
9972                         for cf_libdir in $cf_search
9973                         do
9974                                 echo "$as_me:9974: checking for -l$cf_nculib_root in $cf_libdir" >&5
9975 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9976                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9977                                 cat >conftest.$ac_ext <<_ACEOF
9978 #line 9978 "configure"
9979 #include "confdefs.h"
9980 #include <${cf_cv_ncurses_header:-curses.h}>
9981 int
9982 main (void)
9983 {
9984 initscr()
9985   ;
9986   return 0;
9987 }
9988 _ACEOF
9989 rm -f conftest.$ac_objext conftest$ac_exeext
9990 if { (eval echo "$as_me:9990: \"$ac_link\"") >&5
9991   (eval $ac_link) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); } &&
9995          { ac_try='test -s conftest$ac_exeext'
9996   { (eval echo "$as_me:9996: \"$ac_try\"") >&5
9997   (eval $ac_try) 2>&5
9998   ac_status=$?
9999   echo "$as_me:9999: \$? = $ac_status" >&5
10000   (exit $ac_status); }; }; then
10001   echo "$as_me:10001: result: yes" >&5
10002 echo "${ECHO_T}yes" >&6
10003                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10004                                          break
10005 else
10006   echo "$as_me: failed program was:" >&5
10007 cat conftest.$ac_ext >&5
10008 echo "$as_me:10008: result: no" >&5
10009 echo "${ECHO_T}no" >&6
10010                                          LIBS="$cf_save_LIBS"
10011 fi
10012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10013                         done
10014
10015 fi
10016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10017
10018 fi
10019
10020 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10021
10022 if test $cf_found_library = no ; then
10023         { { echo "$as_me:10023: error: Cannot link $cf_nculib_root library" >&5
10024 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10025    { (exit 1); exit 1; }; }
10026 fi
10027
10028 fi
10029
10030 if test -n "$cf_ncurses_LIBS" ; then
10031         echo "$as_me:10031: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10032 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10033         cf_ncurses_SAVE="$LIBS"
10034         for p in $cf_ncurses_LIBS ; do
10035                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10036                 if test "$q" != "$LIBS" ; then
10037                         LIBS="$q"
10038                 fi
10039         done
10040         cat >conftest.$ac_ext <<_ACEOF
10041 #line 10041 "configure"
10042 #include "confdefs.h"
10043 #include <${cf_cv_ncurses_header:-curses.h}>
10044 int
10045 main (void)
10046 {
10047 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10048   ;
10049   return 0;
10050 }
10051 _ACEOF
10052 rm -f conftest.$ac_objext conftest$ac_exeext
10053 if { (eval echo "$as_me:10053: \"$ac_link\"") >&5
10054   (eval $ac_link) 2>&5
10055   ac_status=$?
10056   echo "$as_me:10056: \$? = $ac_status" >&5
10057   (exit $ac_status); } &&
10058          { ac_try='test -s conftest$ac_exeext'
10059   { (eval echo "$as_me:10059: \"$ac_try\"") >&5
10060   (eval $ac_try) 2>&5
10061   ac_status=$?
10062   echo "$as_me:10062: \$? = $ac_status" >&5
10063   (exit $ac_status); }; }; then
10064   echo "$as_me:10064: result: yes" >&5
10065 echo "${ECHO_T}yes" >&6
10066 else
10067   echo "$as_me: failed program was:" >&5
10068 cat conftest.$ac_ext >&5
10069 echo "$as_me:10069: result: no" >&5
10070 echo "${ECHO_T}no" >&6
10071                  LIBS="$cf_ncurses_SAVE"
10072 fi
10073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10074 fi
10075
10076 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10077
10078 cat >>confdefs.h <<EOF
10079 #define $cf_nculib_ROOT 1
10080 EOF
10081
10082         fi
10083 else
10084         NCURSES_CONFIG=none
10085 fi
10086
10087 fi
10088
10089 if test "$NCURSES_CONFIG_PKG" != none ; then
10090         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
10091
10092         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10093         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10094         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10095
10096         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
10097         if test -z "$cf_cv_abi_version"
10098         then
10099                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
10100         fi
10101
10102 elif test "$NCURSES_CONFIG" != none ; then
10103
10104         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
10105
10106         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
10107         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
10108         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
10109
10110         # ABI version is not available from headers
10111         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
10112
10113 else
10114
10115         for cf_name in MAJOR MINOR PATCH
10116         do
10117         cat >conftest.$ac_ext <<CF_EOF
10118         #include <${cf_cv_ncurses_header:-curses.h}>
10119         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
10120 CF_EOF
10121                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
10122                 { (eval echo "$as_me:10122: \"$cf_try\"") >&5
10123   (eval $cf_try) 2>&5
10124   ac_status=$?
10125   echo "$as_me:10125: \$? = $ac_status" >&5
10126   (exit $ac_status); }
10127                 if test -f conftest.out ; then
10128                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
10129                         eval NCURSES_$cf_name=\"$cf_result\"
10130                         # cat conftest.$ac_ext
10131                         # cat conftest.out
10132                 fi
10133         done
10134
10135         cf_cv_abi_version=${NCURSES_MAJOR}
10136
10137 fi
10138
10139 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
10140
10141 cf_cv_timestamp=`date`
10142
10143 echo "$as_me:10143: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
10144 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
10145
10146 echo "$as_me:10146: checking if you want to have a library-prefix" >&5
10147 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
10148
10149 # Check whether --with-lib-prefix or --without-lib-prefix was given.
10150 if test "${with_lib_prefix+set}" = set; then
10151   withval="$with_lib_prefix"
10152   with_lib_prefix=$withval
10153 else
10154   with_lib_prefix=auto
10155 fi;
10156 echo "$as_me:10156: result: $with_lib_prefix" >&5
10157 echo "${ECHO_T}$with_lib_prefix" >&6
10158
10159 if test $with_lib_prefix = auto
10160 then
10161
10162         case $cf_cv_system_name in
10163         (OS/2*|os2*)
10164                 if test "$DFT_LWR_MODEL" = libtool; then
10165                         LIB_PREFIX='lib'
10166                 else
10167                         LIB_PREFIX=''
10168                 fi
10169                 ;;
10170         (*)     LIB_PREFIX='lib'
10171                 ;;
10172         esac
10173 cf_prefix=$LIB_PREFIX
10174
10175 elif test $with_lib_prefix = no
10176 then
10177         LIB_PREFIX=
10178 else
10179         LIB_PREFIX=$with_lib_prefix
10180 fi
10181
10182 LIB_SUFFIX=
10183
10184 ###############################################################################
10185
10186 if test X"$CC_G_OPT" = X"" ; then
10187         CC_G_OPT='-g'
10188         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
10189 fi
10190
10191 echo "$as_me:10191: checking for default loader flags" >&5
10192 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
10193 case $DFT_LWR_MODEL in
10194 (normal)  LD_MODEL=''   ;;
10195 (debug)   LD_MODEL=$CC_G_OPT ;;
10196 (profile) LD_MODEL='-pg';;
10197 (shared)  LD_MODEL=''   ;;
10198 esac
10199 echo "$as_me:10199: result: $LD_MODEL" >&5
10200 echo "${ECHO_T}$LD_MODEL" >&6
10201
10202 LD_RPATH_OPT=
10203 if test "x$cf_cv_enable_rpath" != xno
10204 then
10205         echo "$as_me:10205: checking for an rpath option" >&5
10206 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
10207         case $cf_cv_system_name in
10208         (irix*)
10209                 if test "$GCC" = yes; then
10210                         LD_RPATH_OPT="-Wl,-rpath,"
10211                 else
10212                         LD_RPATH_OPT="-rpath "
10213                 fi
10214                 ;;
10215         (linux*|gnu*|k*bsd*-gnu|freebsd*)
10216                 LD_RPATH_OPT="-Wl,-rpath,"
10217                 ;;
10218         (openbsd[2-9].*|mirbsd*)
10219                 LD_RPATH_OPT="-Wl,-rpath,"
10220                 ;;
10221         (dragonfly*)
10222                 LD_RPATH_OPT="-rpath "
10223                 ;;
10224         (netbsd*)
10225                 LD_RPATH_OPT="-Wl,-rpath,"
10226                 ;;
10227         (osf*|mls+*)
10228                 LD_RPATH_OPT="-rpath "
10229                 ;;
10230         (solaris2*)
10231                 LD_RPATH_OPT="-R"
10232                 ;;
10233         (*)
10234                 ;;
10235         esac
10236         echo "$as_me:10236: result: $LD_RPATH_OPT" >&5
10237 echo "${ECHO_T}$LD_RPATH_OPT" >&6
10238
10239         case "x$LD_RPATH_OPT" in
10240         (x-R*)
10241                 echo "$as_me:10241: checking if we need a space after rpath option" >&5
10242 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
10243                 cf_save_LIBS="$LIBS"
10244
10245 cf_add_libs="${LD_RPATH_OPT}$libdir"
10246 # Filter out duplicates - this happens with badly-designed ".pc" files...
10247 for cf_add_1lib in $LIBS
10248 do
10249         for cf_add_2lib in $cf_add_libs
10250         do
10251                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10252                 then
10253                         cf_add_1lib=
10254                         break
10255                 fi
10256         done
10257         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10258 done
10259 LIBS="$cf_add_libs"
10260
10261                 cat >conftest.$ac_ext <<_ACEOF
10262 #line 10262 "configure"
10263 #include "confdefs.h"
10264
10265 int
10266 main (void)
10267 {
10268
10269   ;
10270   return 0;
10271 }
10272 _ACEOF
10273 rm -f conftest.$ac_objext conftest$ac_exeext
10274 if { (eval echo "$as_me:10274: \"$ac_link\"") >&5
10275   (eval $ac_link) 2>&5
10276   ac_status=$?
10277   echo "$as_me:10277: \$? = $ac_status" >&5
10278   (exit $ac_status); } &&
10279          { ac_try='test -s conftest$ac_exeext'
10280   { (eval echo "$as_me:10280: \"$ac_try\"") >&5
10281   (eval $ac_try) 2>&5
10282   ac_status=$?
10283   echo "$as_me:10283: \$? = $ac_status" >&5
10284   (exit $ac_status); }; }; then
10285   cf_rpath_space=no
10286 else
10287   echo "$as_me: failed program was:" >&5
10288 cat conftest.$ac_ext >&5
10289 cf_rpath_space=yes
10290 fi
10291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10292                 LIBS="$cf_save_LIBS"
10293                 echo "$as_me:10293: result: $cf_rpath_space" >&5
10294 echo "${ECHO_T}$cf_rpath_space" >&6
10295                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
10296                 ;;
10297         esac
10298 fi
10299
10300         RM_SHARED_OPTS=
10301         LOCAL_LDFLAGS=
10302         LOCAL_LDFLAGS2=
10303         LD_SHARED_OPTS=
10304         INSTALL_LIB="-m 644"
10305         : ${rel_builddir:=.}
10306
10307         shlibdir=$libdir
10308
10309         MAKE_DLLS="#"
10310
10311         cf_cv_do_symlinks=no
10312         cf_ld_rpath_opt=
10313         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
10314
10315         echo "$as_me:10315: checking if release/abi version should be used for shared libs" >&5
10316 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
10317
10318 # Check whether --with-shlib-version or --without-shlib-version was given.
10319 if test "${with_shlib_version+set}" = set; then
10320   withval="$with_shlib_version"
10321   test -z "$withval" && withval=auto
10322         case $withval in
10323         (yes)
10324                 cf_cv_shlib_version=auto
10325                 ;;
10326         (rel|abi|auto)
10327                 cf_cv_shlib_version=$withval
10328                 ;;
10329         (*)
10330                 echo "$as_me:10330: result: $withval" >&5
10331 echo "${ECHO_T}$withval" >&6
10332                 { { echo "$as_me:10332: error: option value must be one of: rel, abi, or auto" >&5
10333 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
10334    { (exit 1); exit 1; }; }
10335                 ;;
10336         esac
10337
10338 else
10339   cf_cv_shlib_version=auto
10340 fi;
10341         echo "$as_me:10341: result: $cf_cv_shlib_version" >&5
10342 echo "${ECHO_T}$cf_cv_shlib_version" >&6
10343
10344         cf_cv_rm_so_locs=no
10345         cf_try_cflags=
10346
10347         # Some less-capable ports of gcc support only -fpic
10348         CC_SHARED_OPTS=
10349
10350         cf_try_fPIC=no
10351         if test "$GCC" = yes
10352         then
10353                 cf_try_fPIC=yes
10354         else
10355                 case $cf_cv_system_name in
10356                 (*linux*)       # e.g., PGI compiler
10357                         cf_try_fPIC=yes
10358                         ;;
10359                 esac
10360         fi
10361
10362         if test "$cf_try_fPIC" = yes
10363         then
10364                 echo "$as_me:10364: checking which $CC option to use" >&5
10365 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
10366                 cf_save_CFLAGS="$CFLAGS"
10367                 for CC_SHARED_OPTS in -fPIC -fpic ''
10368                 do
10369                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
10370                         cat >conftest.$ac_ext <<_ACEOF
10371 #line 10371 "configure"
10372 #include "confdefs.h"
10373 #include <stdio.h>
10374 int
10375 main (void)
10376 {
10377 int x = 1
10378   ;
10379   return 0;
10380 }
10381 _ACEOF
10382 rm -f conftest.$ac_objext
10383 if { (eval echo "$as_me:10383: \"$ac_compile\"") >&5
10384   (eval $ac_compile) 2>&5
10385   ac_status=$?
10386   echo "$as_me:10386: \$? = $ac_status" >&5
10387   (exit $ac_status); } &&
10388          { ac_try='test -s conftest.$ac_objext'
10389   { (eval echo "$as_me:10389: \"$ac_try\"") >&5
10390   (eval $ac_try) 2>&5
10391   ac_status=$?
10392   echo "$as_me:10392: \$? = $ac_status" >&5
10393   (exit $ac_status); }; }; then
10394   break
10395 else
10396   echo "$as_me: failed program was:" >&5
10397 cat conftest.$ac_ext >&5
10398 fi
10399 rm -f conftest.$ac_objext conftest.$ac_ext
10400                 done
10401                 echo "$as_me:10401: result: $CC_SHARED_OPTS" >&5
10402 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
10403                 CFLAGS="$cf_save_CFLAGS"
10404         fi
10405
10406         cf_cv_shlib_version_infix=no
10407
10408         case $cf_cv_system_name in
10409         (aix4.3-9*|aix[5-7]*)
10410                 if test "$GCC" = yes; then
10411                         CC_SHARED_OPTS='-Wl,-brtl'
10412                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10413                 else
10414                         CC_SHARED_OPTS='-brtl'
10415                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
10416                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
10417                 fi
10418                 ;;
10419         (beos*)
10420                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
10421                 ;;
10422         (cygwin*)
10423                 CC_SHARED_OPTS=
10424                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10425                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10426                 cf_cv_shlib_version=cygdll
10427                 cf_cv_shlib_version_infix=cygdll
10428                 shlibdir=$bindir
10429                 MAKE_DLLS=
10430                 cat >mk_shared_lib.sh <<-CF_EOF
10431                 #!$SHELL
10432                 SHARED_LIB=\$1
10433                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10434                 shift
10435                 cat <<-EOF
10436                 Linking shared library
10437                 ** SHARED_LIB \$SHARED_LIB
10438                 ** IMPORT_LIB \$IMPORT_LIB
10439 EOF
10440                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10441 CF_EOF
10442                 chmod +x mk_shared_lib.sh
10443                 ;;
10444         (msys*)
10445                 CC_SHARED_OPTS=
10446                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10447                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10448                 cf_cv_shlib_version=msysdll
10449                 cf_cv_shlib_version_infix=msysdll
10450                 shlibdir=$bindir
10451                 MAKE_DLLS=
10452                 cat >mk_shared_lib.sh <<-CF_EOF
10453                 #!$SHELL
10454                 SHARED_LIB=\$1
10455                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
10456                 shift
10457                 cat <<-EOF
10458                 Linking shared library
10459                 ** SHARED_LIB \$SHARED_LIB
10460                 ** IMPORT_LIB \$IMPORT_LIB
10461 EOF
10462                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10463 CF_EOF
10464                 chmod +x mk_shared_lib.sh
10465                 ;;
10466         (darwin*)
10467                 cf_try_cflags="no-cpp-precomp"
10468                 CC_SHARED_OPTS="-dynamic"
10469                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
10470                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
10471                 cf_cv_shlib_version_infix=yes
10472                 echo "$as_me:10472: checking if ld -search_paths_first works" >&5
10473 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
10474 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
10475   echo $ECHO_N "(cached) $ECHO_C" >&6
10476 else
10477
10478                         cf_save_LDFLAGS=$LDFLAGS
10479                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10480                         cat >conftest.$ac_ext <<_ACEOF
10481 #line 10481 "configure"
10482 #include "confdefs.h"
10483
10484 int
10485 main (void)
10486 {
10487 int i;
10488   ;
10489   return 0;
10490 }
10491 _ACEOF
10492 rm -f conftest.$ac_objext conftest$ac_exeext
10493 if { (eval echo "$as_me:10493: \"$ac_link\"") >&5
10494   (eval $ac_link) 2>&5
10495   ac_status=$?
10496   echo "$as_me:10496: \$? = $ac_status" >&5
10497   (exit $ac_status); } &&
10498          { ac_try='test -s conftest$ac_exeext'
10499   { (eval echo "$as_me:10499: \"$ac_try\"") >&5
10500   (eval $ac_try) 2>&5
10501   ac_status=$?
10502   echo "$as_me:10502: \$? = $ac_status" >&5
10503   (exit $ac_status); }; }; then
10504   cf_cv_ldflags_search_paths_first=yes
10505 else
10506   echo "$as_me: failed program was:" >&5
10507 cat conftest.$ac_ext >&5
10508 cf_cv_ldflags_search_paths_first=no
10509 fi
10510 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10511                                 LDFLAGS=$cf_save_LDFLAGS
10512 fi
10513 echo "$as_me:10513: result: $cf_cv_ldflags_search_paths_first" >&5
10514 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
10515                 if test $cf_cv_ldflags_search_paths_first = yes; then
10516                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
10517                 fi
10518                 ;;
10519         (hpux[7-8]*)
10520                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
10521                 if test "$GCC" != yes; then
10522                         CC_SHARED_OPTS='+Z'
10523                 fi
10524                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
10525                 INSTALL_LIB="-m 555"
10526                 ;;
10527         (hpux*)
10528                 # (tested with gcc 2.7.2 -- I don't have c89)
10529                 if test "$GCC" = yes; then
10530                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
10531                 else
10532                         CC_SHARED_OPTS='+Z'
10533                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
10534                 fi
10535                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
10536                 # HP-UX shared libraries must be executable, and should be
10537                 # readonly to exploit a quirk in the memory manager.
10538                 INSTALL_LIB="-m 555"
10539                 ;;
10540         (interix*)
10541                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10542                 if test "$cf_cv_shlib_version" = rel; then
10543                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10544                 else
10545                         cf_shared_soname='`basename $@`'
10546                 fi
10547                 CC_SHARED_OPTS=
10548                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
10549                 ;;
10550         (irix*)
10551                 if test "$cf_cv_enable_rpath" = yes ; then
10552                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10553                 fi
10554                 # tested with IRIX 5.2 and 'cc'.
10555                 if test "$GCC" != yes; then
10556                         CC_SHARED_OPTS='-KPIC'
10557                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
10558                 else
10559                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
10560                 fi
10561                 cf_cv_rm_so_locs=yes
10562                 ;;
10563         (linux*|gnu*|k*bsd*-gnu)
10564                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10565                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10566                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10567                 fi
10568                 if test "$cf_cv_enable_rpath" = yes ; then
10569                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10570                 fi
10571
10572         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10573         if test "$cf_cv_shlib_version" = rel; then
10574                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10575         else
10576                 cf_cv_shared_soname='`basename $@`'
10577         fi
10578
10579                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10580                 ;;
10581         (mingw*)
10582                 cf_cv_shlib_version=mingw
10583                 cf_cv_shlib_version_infix=mingw
10584                 shlibdir=$bindir
10585                 MAKE_DLLS=
10586                 if test "$DFT_LWR_MODEL" = "shared" ; then
10587                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
10588                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10589                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
10590                 fi
10591                 CC_SHARED_OPTS=
10592                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
10593                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
10594                 cat >mk_shared_lib.sh <<-CF_EOF
10595                 #!$SHELL
10596                 SHARED_LIB=\$1
10597                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
10598                 shift
10599                 cat <<-EOF
10600                 Linking shared library
10601                 ** SHARED_LIB \$SHARED_LIB
10602                 ** IMPORT_LIB \$IMPORT_LIB
10603 EOF
10604                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
10605 CF_EOF
10606                 chmod +x mk_shared_lib.sh
10607                 ;;
10608         (openbsd[2-9].*|mirbsd*)
10609                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10610                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10611                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10612                 fi
10613                 if test "$cf_cv_enable_rpath" = yes ; then
10614                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10615                 fi
10616                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10617
10618         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10619         if test "$cf_cv_shlib_version" = rel; then
10620                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10621         else
10622                 cf_cv_shared_soname='`basename $@`'
10623         fi
10624
10625                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10626                 ;;
10627         (nto-qnx*|openbsd*|freebsd[12].*)
10628                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10629                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
10630                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10631                 ;;
10632         (dragonfly*|freebsd*)
10633                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10634                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10635                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10636                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
10637                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10638                 fi
10639
10640         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10641         if test "$cf_cv_shlib_version" = rel; then
10642                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10643         else
10644                 cf_cv_shared_soname='`basename $@`'
10645         fi
10646
10647                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
10648                 ;;
10649         (netbsd*)
10650                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
10651                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
10652                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
10653                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10654                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
10655                         if test "$cf_cv_shlib_version" = auto; then
10656                         if test -f /usr/libexec/ld.elf_so; then
10657                                 cf_cv_shlib_version=abi
10658                         else
10659                                 cf_cv_shlib_version=rel
10660                         fi
10661                         fi
10662
10663         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10664         if test "$cf_cv_shlib_version" = rel; then
10665                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10666         else
10667                 cf_cv_shared_soname='`basename $@`'
10668         fi
10669
10670                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
10671                 else
10672                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
10673                 fi
10674                 ;;
10675         (osf*|mls+*)
10676                 # tested with OSF/1 V3.2 and 'cc'
10677                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
10678                 # link with shared libs).
10679                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
10680                 case $host_os in
10681                 (osf4*)
10682                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
10683                         ;;
10684                 esac
10685                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
10686                 if test "$DFT_LWR_MODEL" = "shared" && test -n "$LD_RPATH_OPT" ; then
10687                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
10688                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10689                 fi
10690                 cf_cv_rm_so_locs=yes
10691                 ;;
10692         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
10693                 # tested with osr5.0.5
10694                 if test "$GCC" != yes; then
10695                         CC_SHARED_OPTS='-belf -KPIC'
10696                 fi
10697                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
10698                 if test "$cf_cv_enable_rpath" = yes ; then
10699                         # only way is to set LD_RUN_PATH but no switch for it
10700                         RUN_PATH=$libdir
10701                 fi
10702                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10703                 LINK_PROGS='LD_RUN_PATH=${libdir}'
10704                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
10705                 ;;
10706         (sunos4*)
10707                 # tested with SunOS 4.1.1 and gcc 2.7.0
10708                 if test "$GCC" != yes; then
10709                         CC_SHARED_OPTS='-KPIC'
10710                 fi
10711                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
10712                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10713                 ;;
10714         (solaris2*)
10715                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
10716                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
10717                 if test "$DFT_LWR_MODEL" = "shared" ; then
10718                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
10719                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
10720                 fi
10721                 if test "$cf_cv_enable_rpath" = yes ; then
10722                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
10723                 fi
10724
10725         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
10726         if test "$cf_cv_shlib_version" = rel; then
10727                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
10728         else
10729                 cf_cv_shared_soname='`basename $@`'
10730         fi
10731
10732                 if test "$GCC" != yes; then
10733                         cf_save_CFLAGS="$CFLAGS"
10734                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
10735                         do
10736                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
10737                                 cat >conftest.$ac_ext <<_ACEOF
10738 #line 10738 "configure"
10739 #include "confdefs.h"
10740 #include <stdio.h>
10741 int
10742 main (void)
10743 {
10744 printf("Hello\n");
10745   ;
10746   return 0;
10747 }
10748 _ACEOF
10749 rm -f conftest.$ac_objext
10750 if { (eval echo "$as_me:10750: \"$ac_compile\"") >&5
10751   (eval $ac_compile) 2>&5
10752   ac_status=$?
10753   echo "$as_me:10753: \$? = $ac_status" >&5
10754   (exit $ac_status); } &&
10755          { ac_try='test -s conftest.$ac_objext'
10756   { (eval echo "$as_me:10756: \"$ac_try\"") >&5
10757   (eval $ac_try) 2>&5
10758   ac_status=$?
10759   echo "$as_me:10759: \$? = $ac_status" >&5
10760   (exit $ac_status); }; }; then
10761   break
10762 else
10763   echo "$as_me: failed program was:" >&5
10764 cat conftest.$ac_ext >&5
10765 fi
10766 rm -f conftest.$ac_objext conftest.$ac_ext
10767                         done
10768                         CFLAGS="$cf_save_CFLAGS"
10769                         CC_SHARED_OPTS=$cf_shared_opts
10770                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10771                 else
10772                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10773                 fi
10774                 ;;
10775         (sysv5uw7*|unix_sv*)
10776                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10777                 if test "$GCC" != yes; then
10778                         CC_SHARED_OPTS='-KPIC'
10779                 fi
10780                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10781                 ;;
10782         (*)
10783                 CC_SHARED_OPTS='unknown'
10784                 MK_SHARED_LIB='echo unknown'
10785                 ;;
10786         esac
10787
10788         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10789         case "$cf_cv_shlib_version" in
10790         (rel|abi)
10791                 case "$MK_SHARED_LIB" in
10792                 (*'-o $@')
10793                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10794                         ;;
10795                 (*)
10796                         { echo "$as_me:10796: WARNING: ignored --with-shlib-version" >&5
10797 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10798                         ;;
10799                 esac
10800                 ;;
10801         esac
10802
10803         if test -n "$cf_try_cflags"
10804         then
10805 cat > conftest.$ac_ext <<EOF
10806 #line 10806 "${as_me:-configure}"
10807 #include <stdio.h>
10808 int main(int argc, char *argv[])
10809 {
10810         printf("hello\n");
10811         return (argv[argc-1] == 0) ;
10812 }
10813 EOF
10814                 cf_save_CFLAGS="$CFLAGS"
10815                 for cf_opt in $cf_try_cflags
10816                 do
10817                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10818                         echo "$as_me:10818: checking if CFLAGS option -$cf_opt works" >&5
10819 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10820                         if { (eval echo "$as_me:10820: \"$ac_compile\"") >&5
10821   (eval $ac_compile) 2>&5
10822   ac_status=$?
10823   echo "$as_me:10823: \$? = $ac_status" >&5
10824   (exit $ac_status); }; then
10825                                 echo "$as_me:10825: result: yes" >&5
10826 echo "${ECHO_T}yes" >&6
10827                                 cf_save_CFLAGS="$CFLAGS"
10828                         else
10829                                 echo "$as_me:10829: result: no" >&5
10830 echo "${ECHO_T}no" >&6
10831                         fi
10832                 done
10833                 CFLAGS="$cf_save_CFLAGS"
10834         fi
10835
10836         # RPATH_LIST is a colon-separated list of directories
10837         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10838         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10839
10840         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10841
10842         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10843
10844 echo "${as_me:-configure}:10844: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10845
10846         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10847
10848 echo "${as_me:-configure}:10848: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10849
10850 # The test/sample programs in the original tree link using rpath option.
10851 # Make it optional for packagers.
10852 if test -n "$LOCAL_LDFLAGS"
10853 then
10854         echo "$as_me:10854: checking if you want to link sample programs with rpath option" >&5
10855 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10856
10857 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10858 if test "${enable_rpath_link+set}" = set; then
10859   enableval="$enable_rpath_link"
10860   with_rpath_link=$enableval
10861 else
10862   with_rpath_link=yes
10863 fi;
10864         echo "$as_me:10864: result: $with_rpath_link" >&5
10865 echo "${ECHO_T}$with_rpath_link" >&6
10866         if test "$with_rpath_link" = no
10867         then
10868                 LOCAL_LDFLAGS=
10869                 LOCAL_LDFLAGS2=
10870         fi
10871 fi
10872
10873 ###############################################################################
10874
10875 ###   use option --enable-broken-linker to force on use of broken-linker support
10876 echo "$as_me:10876: checking if you want broken-linker support code" >&5
10877 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10878
10879 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10880 if test "${enable_broken_linker+set}" = set; then
10881   enableval="$enable_broken_linker"
10882   with_broken_linker=$enableval
10883 else
10884   with_broken_linker=${BROKEN_LINKER:-no}
10885 fi;
10886 echo "$as_me:10886: result: $with_broken_linker" >&5
10887 echo "${ECHO_T}$with_broken_linker" >&6
10888
10889 BROKEN_LINKER=0
10890 if test "$with_broken_linker" = yes ; then
10891         cat >>confdefs.h <<\EOF
10892 #define BROKEN_LINKER 1
10893 EOF
10894
10895         BROKEN_LINKER=1
10896 elif test "$DFT_LWR_MODEL" = shared ; then
10897         case $cf_cv_system_name in
10898         (cygwin*)
10899                 cat >>confdefs.h <<\EOF
10900 #define BROKEN_LINKER 1
10901 EOF
10902
10903                 BROKEN_LINKER=1
10904                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
10905
10906 echo "${as_me:-configure}:10906: testing cygwin linker is broken anyway ..." 1>&5
10907
10908                 ;;
10909         esac
10910 fi
10911
10912 # Check to define _XOPEN_SOURCE "automatically"
10913
10914 cf_XOPEN_SOURCE=600
10915 cf_POSIX_C_SOURCE=199506L
10916 cf_xopen_source=
10917
10918 case $host_os in
10919 (aix[4-7]*)
10920         cf_xopen_source="-D_ALL_SOURCE"
10921         ;;
10922 (msys)
10923         cf_XOPEN_SOURCE=600
10924         ;;
10925 (darwin[0-8].*)
10926         cf_xopen_source="-D_APPLE_C_SOURCE"
10927         ;;
10928 (darwin*)
10929         cf_xopen_source="-D_DARWIN_C_SOURCE"
10930         cf_XOPEN_SOURCE=
10931         ;;
10932 (freebsd*|dragonfly*)
10933         # 5.x headers associate
10934         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10935         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10936         cf_POSIX_C_SOURCE=200112L
10937         cf_XOPEN_SOURCE=600
10938         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10939         ;;
10940 (hpux11*)
10941         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10942         ;;
10943 (hpux*)
10944         cf_xopen_source="-D_HPUX_SOURCE"
10945         ;;
10946 (irix[56].*)
10947         cf_xopen_source="-D_SGI_SOURCE"
10948         cf_XOPEN_SOURCE=
10949         ;;
10950 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10951
10952 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
10953
10954 echo "$as_me:10954: checking if this is the GNU C library" >&5
10955 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
10956 if test "${cf_cv_gnu_library+set}" = set; then
10957   echo $ECHO_N "(cached) $ECHO_C" >&6
10958 else
10959
10960 cat >conftest.$ac_ext <<_ACEOF
10961 #line 10961 "configure"
10962 #include "confdefs.h"
10963 #include <sys/types.h>
10964 int
10965 main (void)
10966 {
10967
10968         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
10969                 return 0;
10970         #else
10971         #       error not GNU C library
10972         #endif
10973   ;
10974   return 0;
10975 }
10976 _ACEOF
10977 rm -f conftest.$ac_objext
10978 if { (eval echo "$as_me:10978: \"$ac_compile\"") >&5
10979   (eval $ac_compile) 2>&5
10980   ac_status=$?
10981   echo "$as_me:10981: \$? = $ac_status" >&5
10982   (exit $ac_status); } &&
10983          { ac_try='test -s conftest.$ac_objext'
10984   { (eval echo "$as_me:10984: \"$ac_try\"") >&5
10985   (eval $ac_try) 2>&5
10986   ac_status=$?
10987   echo "$as_me:10987: \$? = $ac_status" >&5
10988   (exit $ac_status); }; }; then
10989   cf_cv_gnu_library=yes
10990 else
10991   echo "$as_me: failed program was:" >&5
10992 cat conftest.$ac_ext >&5
10993 cf_cv_gnu_library=no
10994 fi
10995 rm -f conftest.$ac_objext conftest.$ac_ext
10996
10997 fi
10998 echo "$as_me:10998: result: $cf_cv_gnu_library" >&5
10999 echo "${ECHO_T}$cf_cv_gnu_library" >&6
11000
11001 if test x$cf_cv_gnu_library = xyes; then
11002
11003         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
11004         # was changed to help a little...
11005         echo "$as_me:11005: checking if _DEFAULT_SOURCE can be used as a basis" >&5
11006 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
11007 if test "${cf_cv_gnu_library_219+set}" = set; then
11008   echo $ECHO_N "(cached) $ECHO_C" >&6
11009 else
11010
11011                 cf_save="$CPPFLAGS"
11012
11013         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11014         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11015
11016                 cat >conftest.$ac_ext <<_ACEOF
11017 #line 11017 "configure"
11018 #include "confdefs.h"
11019 #include <sys/types.h>
11020 int
11021 main (void)
11022 {
11023
11024                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
11025                                 return 0;
11026                         #else
11027                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
11028                         #endif
11029   ;
11030   return 0;
11031 }
11032 _ACEOF
11033 rm -f conftest.$ac_objext
11034 if { (eval echo "$as_me:11034: \"$ac_compile\"") >&5
11035   (eval $ac_compile) 2>&5
11036   ac_status=$?
11037   echo "$as_me:11037: \$? = $ac_status" >&5
11038   (exit $ac_status); } &&
11039          { ac_try='test -s conftest.$ac_objext'
11040   { (eval echo "$as_me:11040: \"$ac_try\"") >&5
11041   (eval $ac_try) 2>&5
11042   ac_status=$?
11043   echo "$as_me:11043: \$? = $ac_status" >&5
11044   (exit $ac_status); }; }; then
11045   cf_cv_gnu_library_219=yes
11046 else
11047   echo "$as_me: failed program was:" >&5
11048 cat conftest.$ac_ext >&5
11049 cf_cv_gnu_library_219=no
11050 fi
11051 rm -f conftest.$ac_objext conftest.$ac_ext
11052                 CPPFLAGS="$cf_save"
11053
11054 fi
11055 echo "$as_me:11055: result: $cf_cv_gnu_library_219" >&5
11056 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
11057
11058         if test "x$cf_cv_gnu_library_219" = xyes; then
11059                 cf_save="$CPPFLAGS"
11060                 echo "$as_me:11060: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
11061 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
11062 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
11063   echo $ECHO_N "(cached) $ECHO_C" >&6
11064 else
11065
11066 cf_fix_cppflags=no
11067 cf_new_cflags=
11068 cf_new_cppflags=
11069 cf_new_extra_cppflags=
11070
11071 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
11072 do
11073 case $cf_fix_cppflags in
11074 (no)
11075         case $cf_add_cflags in
11076         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11077                 case $cf_add_cflags in
11078                 (-D*)
11079                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11080
11081                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11082                                 && test -z "${cf_tst_cflags}" \
11083                                 && cf_fix_cppflags=yes
11084
11085                         if test $cf_fix_cppflags = yes ; then
11086
11087         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11088         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11089
11090                                 continue
11091                         elif test "${cf_tst_cflags}" = "\"'" ; then
11092
11093         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11094         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11095
11096                                 continue
11097                         fi
11098                         ;;
11099                 esac
11100                 case "$CPPFLAGS" in
11101                 (*$cf_add_cflags)
11102                         ;;
11103                 (*)
11104                         case $cf_add_cflags in
11105                         (-D*)
11106                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11107
11108 CPPFLAGS=`echo "$CPPFLAGS" | \
11109         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11110                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11111
11112                                 ;;
11113                         esac
11114
11115         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11116         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11117
11118                         ;;
11119                 esac
11120                 ;;
11121         (*)
11122
11123         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11124         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11125
11126                 ;;
11127         esac
11128         ;;
11129 (yes)
11130
11131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11133
11134         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11135
11136         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11137                 && test -z "${cf_tst_cflags}" \
11138                 && cf_fix_cppflags=no
11139         ;;
11140 esac
11141 done
11142
11143 if test -n "$cf_new_cflags" ; then
11144
11145         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11146         CFLAGS="${CFLAGS}$cf_new_cflags"
11147
11148 fi
11149
11150 if test -n "$cf_new_cppflags" ; then
11151
11152         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11153         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11154
11155 fi
11156
11157 if test -n "$cf_new_extra_cppflags" ; then
11158
11159         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11160         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11161
11162 fi
11163
11164                         cat >conftest.$ac_ext <<_ACEOF
11165 #line 11165 "configure"
11166 #include "confdefs.h"
11167
11168                                 #include <limits.h>
11169                                 #include <sys/types.h>
11170
11171 int
11172 main (void)
11173 {
11174
11175                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
11176                                         return 0;
11177                                 #else
11178                                 #       error GNU C library is too old
11179                                 #endif
11180   ;
11181   return 0;
11182 }
11183 _ACEOF
11184 rm -f conftest.$ac_objext
11185 if { (eval echo "$as_me:11185: \"$ac_compile\"") >&5
11186   (eval $ac_compile) 2>&5
11187   ac_status=$?
11188   echo "$as_me:11188: \$? = $ac_status" >&5
11189   (exit $ac_status); } &&
11190          { ac_try='test -s conftest.$ac_objext'
11191   { (eval echo "$as_me:11191: \"$ac_try\"") >&5
11192   (eval $ac_try) 2>&5
11193   ac_status=$?
11194   echo "$as_me:11194: \$? = $ac_status" >&5
11195   (exit $ac_status); }; }; then
11196   cf_cv_gnu_dftsrc_219=yes
11197 else
11198   echo "$as_me: failed program was:" >&5
11199 cat conftest.$ac_ext >&5
11200 cf_cv_gnu_dftsrc_219=no
11201 fi
11202 rm -f conftest.$ac_objext conftest.$ac_ext
11203
11204 fi
11205 echo "$as_me:11205: result: $cf_cv_gnu_dftsrc_219" >&5
11206 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
11207                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
11208         else
11209                 cf_cv_gnu_dftsrc_219=maybe
11210         fi
11211
11212         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
11213
11214                 echo "$as_me:11214: checking if we must define _GNU_SOURCE" >&5
11215 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
11216 if test "${cf_cv_gnu_source+set}" = set; then
11217   echo $ECHO_N "(cached) $ECHO_C" >&6
11218 else
11219
11220                 cat >conftest.$ac_ext <<_ACEOF
11221 #line 11221 "configure"
11222 #include "confdefs.h"
11223 #include <sys/types.h>
11224 int
11225 main (void)
11226 {
11227
11228                         #ifndef _XOPEN_SOURCE
11229                         #error  expected _XOPEN_SOURCE to be defined
11230                         #endif
11231   ;
11232   return 0;
11233 }
11234 _ACEOF
11235 rm -f conftest.$ac_objext
11236 if { (eval echo "$as_me:11236: \"$ac_compile\"") >&5
11237   (eval $ac_compile) 2>&5
11238   ac_status=$?
11239   echo "$as_me:11239: \$? = $ac_status" >&5
11240   (exit $ac_status); } &&
11241          { ac_try='test -s conftest.$ac_objext'
11242   { (eval echo "$as_me:11242: \"$ac_try\"") >&5
11243   (eval $ac_try) 2>&5
11244   ac_status=$?
11245   echo "$as_me:11245: \$? = $ac_status" >&5
11246   (exit $ac_status); }; }; then
11247   cf_cv_gnu_source=no
11248 else
11249   echo "$as_me: failed program was:" >&5
11250 cat conftest.$ac_ext >&5
11251 cf_save="$CPPFLAGS"
11252
11253 cf_fix_cppflags=no
11254 cf_new_cflags=
11255 cf_new_cppflags=
11256 cf_new_extra_cppflags=
11257
11258 for cf_add_cflags in -D_GNU_SOURCE
11259 do
11260 case $cf_fix_cppflags in
11261 (no)
11262         case $cf_add_cflags in
11263         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11264                 case $cf_add_cflags in
11265                 (-D*)
11266                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11267
11268                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11269                                 && test -z "${cf_tst_cflags}" \
11270                                 && cf_fix_cppflags=yes
11271
11272                         if test $cf_fix_cppflags = yes ; then
11273
11274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11276
11277                                 continue
11278                         elif test "${cf_tst_cflags}" = "\"'" ; then
11279
11280         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11281         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11282
11283                                 continue
11284                         fi
11285                         ;;
11286                 esac
11287                 case "$CPPFLAGS" in
11288                 (*$cf_add_cflags)
11289                         ;;
11290                 (*)
11291                         case $cf_add_cflags in
11292                         (-D*)
11293                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11294
11295 CPPFLAGS=`echo "$CPPFLAGS" | \
11296         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11297                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11298
11299                                 ;;
11300                         esac
11301
11302         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11303         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11304
11305                         ;;
11306                 esac
11307                 ;;
11308         (*)
11309
11310         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11311         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11312
11313                 ;;
11314         esac
11315         ;;
11316 (yes)
11317
11318         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11319         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11320
11321         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11322
11323         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11324                 && test -z "${cf_tst_cflags}" \
11325                 && cf_fix_cppflags=no
11326         ;;
11327 esac
11328 done
11329
11330 if test -n "$cf_new_cflags" ; then
11331
11332         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11333         CFLAGS="${CFLAGS}$cf_new_cflags"
11334
11335 fi
11336
11337 if test -n "$cf_new_cppflags" ; then
11338
11339         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11340         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11341
11342 fi
11343
11344 if test -n "$cf_new_extra_cppflags" ; then
11345
11346         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11347         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11348
11349 fi
11350
11351                          cat >conftest.$ac_ext <<_ACEOF
11352 #line 11352 "configure"
11353 #include "confdefs.h"
11354 #include <sys/types.h>
11355 int
11356 main (void)
11357 {
11358
11359                                 #ifdef _XOPEN_SOURCE
11360                                 #error  expected _XOPEN_SOURCE to be undefined
11361                                 #endif
11362   ;
11363   return 0;
11364 }
11365 _ACEOF
11366 rm -f conftest.$ac_objext
11367 if { (eval echo "$as_me:11367: \"$ac_compile\"") >&5
11368   (eval $ac_compile) 2>&5
11369   ac_status=$?
11370   echo "$as_me:11370: \$? = $ac_status" >&5
11371   (exit $ac_status); } &&
11372          { ac_try='test -s conftest.$ac_objext'
11373   { (eval echo "$as_me:11373: \"$ac_try\"") >&5
11374   (eval $ac_try) 2>&5
11375   ac_status=$?
11376   echo "$as_me:11376: \$? = $ac_status" >&5
11377   (exit $ac_status); }; }; then
11378   cf_cv_gnu_source=no
11379 else
11380   echo "$as_me: failed program was:" >&5
11381 cat conftest.$ac_ext >&5
11382 cf_cv_gnu_source=yes
11383 fi
11384 rm -f conftest.$ac_objext conftest.$ac_ext
11385                         CPPFLAGS="$cf_save"
11386
11387 fi
11388 rm -f conftest.$ac_objext conftest.$ac_ext
11389
11390 fi
11391 echo "$as_me:11391: result: $cf_cv_gnu_source" >&5
11392 echo "${ECHO_T}$cf_cv_gnu_source" >&6
11393
11394                 if test "$cf_cv_gnu_source" = yes
11395                 then
11396                 echo "$as_me:11396: checking if we should also define _DEFAULT_SOURCE" >&5
11397 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
11398 if test "${cf_cv_default_source+set}" = set; then
11399   echo $ECHO_N "(cached) $ECHO_C" >&6
11400 else
11401
11402         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11403         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
11404
11405                         cat >conftest.$ac_ext <<_ACEOF
11406 #line 11406 "configure"
11407 #include "confdefs.h"
11408 #include <sys/types.h>
11409 int
11410 main (void)
11411 {
11412
11413                                 #ifdef _DEFAULT_SOURCE
11414                                 #error  expected _DEFAULT_SOURCE to be undefined
11415                                 #endif
11416   ;
11417   return 0;
11418 }
11419 _ACEOF
11420 rm -f conftest.$ac_objext
11421 if { (eval echo "$as_me:11421: \"$ac_compile\"") >&5
11422   (eval $ac_compile) 2>&5
11423   ac_status=$?
11424   echo "$as_me:11424: \$? = $ac_status" >&5
11425   (exit $ac_status); } &&
11426          { ac_try='test -s conftest.$ac_objext'
11427   { (eval echo "$as_me:11427: \"$ac_try\"") >&5
11428   (eval $ac_try) 2>&5
11429   ac_status=$?
11430   echo "$as_me:11430: \$? = $ac_status" >&5
11431   (exit $ac_status); }; }; then
11432   cf_cv_default_source=no
11433 else
11434   echo "$as_me: failed program was:" >&5
11435 cat conftest.$ac_ext >&5
11436 cf_cv_default_source=yes
11437 fi
11438 rm -f conftest.$ac_objext conftest.$ac_ext
11439
11440 fi
11441 echo "$as_me:11441: result: $cf_cv_default_source" >&5
11442 echo "${ECHO_T}$cf_cv_default_source" >&6
11443                         if test "$cf_cv_default_source" = yes
11444                         then
11445
11446         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11447         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
11448
11449                         fi
11450                 fi
11451         fi
11452
11453 fi
11454
11455         ;;
11456 (minix*)
11457         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
11458         ;;
11459 (mirbsd*)
11460         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
11461         cf_XOPEN_SOURCE=
11462
11463 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11464
11465 cf_save_CFLAGS="$CFLAGS"
11466 cf_save_CPPFLAGS="$CPPFLAGS"
11467
11468 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11469         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11470                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11471
11472 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11473         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11474                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11475
11476 echo "$as_me:11476: checking if we should define _POSIX_C_SOURCE" >&5
11477 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11478 if test "${cf_cv_posix_c_source+set}" = set; then
11479   echo $ECHO_N "(cached) $ECHO_C" >&6
11480 else
11481
11482 echo "${as_me:-configure}:11482: testing if the symbol is already defined go no further ..." 1>&5
11483
11484         cat >conftest.$ac_ext <<_ACEOF
11485 #line 11485 "configure"
11486 #include "confdefs.h"
11487 #include <sys/types.h>
11488 int
11489 main (void)
11490 {
11491
11492 #ifndef _POSIX_C_SOURCE
11493 make an error
11494 #endif
11495   ;
11496   return 0;
11497 }
11498 _ACEOF
11499 rm -f conftest.$ac_objext
11500 if { (eval echo "$as_me:11500: \"$ac_compile\"") >&5
11501   (eval $ac_compile) 2>&5
11502   ac_status=$?
11503   echo "$as_me:11503: \$? = $ac_status" >&5
11504   (exit $ac_status); } &&
11505          { ac_try='test -s conftest.$ac_objext'
11506   { (eval echo "$as_me:11506: \"$ac_try\"") >&5
11507   (eval $ac_try) 2>&5
11508   ac_status=$?
11509   echo "$as_me:11509: \$? = $ac_status" >&5
11510   (exit $ac_status); }; }; then
11511   cf_cv_posix_c_source=no
11512 else
11513   echo "$as_me: failed program was:" >&5
11514 cat conftest.$ac_ext >&5
11515 cf_want_posix_source=no
11516          case .$cf_POSIX_C_SOURCE in
11517          (.[12]??*)
11518                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11519                 ;;
11520          (.2)
11521                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11522                 cf_want_posix_source=yes
11523                 ;;
11524          (.*)
11525                 cf_want_posix_source=yes
11526                 ;;
11527          esac
11528          if test "$cf_want_posix_source" = yes ; then
11529                 cat >conftest.$ac_ext <<_ACEOF
11530 #line 11530 "configure"
11531 #include "confdefs.h"
11532 #include <sys/types.h>
11533 int
11534 main (void)
11535 {
11536
11537 #ifdef _POSIX_SOURCE
11538 make an error
11539 #endif
11540   ;
11541   return 0;
11542 }
11543 _ACEOF
11544 rm -f conftest.$ac_objext
11545 if { (eval echo "$as_me:11545: \"$ac_compile\"") >&5
11546   (eval $ac_compile) 2>&5
11547   ac_status=$?
11548   echo "$as_me:11548: \$? = $ac_status" >&5
11549   (exit $ac_status); } &&
11550          { ac_try='test -s conftest.$ac_objext'
11551   { (eval echo "$as_me:11551: \"$ac_try\"") >&5
11552   (eval $ac_try) 2>&5
11553   ac_status=$?
11554   echo "$as_me:11554: \$? = $ac_status" >&5
11555   (exit $ac_status); }; }; then
11556   :
11557 else
11558   echo "$as_me: failed program was:" >&5
11559 cat conftest.$ac_ext >&5
11560 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11561 fi
11562 rm -f conftest.$ac_objext conftest.$ac_ext
11563          fi
11564
11565 echo "${as_me:-configure}:11565: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11566
11567          CFLAGS="$cf_trim_CFLAGS"
11568          CPPFLAGS="$cf_trim_CPPFLAGS"
11569
11570         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11571         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
11572
11573 echo "${as_me:-configure}:11573: testing if the second compile does not leave our definition intact error ..." 1>&5
11574
11575          cat >conftest.$ac_ext <<_ACEOF
11576 #line 11576 "configure"
11577 #include "confdefs.h"
11578 #include <sys/types.h>
11579 int
11580 main (void)
11581 {
11582
11583 #ifndef _POSIX_C_SOURCE
11584 make an error
11585 #endif
11586   ;
11587   return 0;
11588 }
11589 _ACEOF
11590 rm -f conftest.$ac_objext
11591 if { (eval echo "$as_me:11591: \"$ac_compile\"") >&5
11592   (eval $ac_compile) 2>&5
11593   ac_status=$?
11594   echo "$as_me:11594: \$? = $ac_status" >&5
11595   (exit $ac_status); } &&
11596          { ac_try='test -s conftest.$ac_objext'
11597   { (eval echo "$as_me:11597: \"$ac_try\"") >&5
11598   (eval $ac_try) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit $ac_status); }; }; then
11602   :
11603 else
11604   echo "$as_me: failed program was:" >&5
11605 cat conftest.$ac_ext >&5
11606 cf_cv_posix_c_source=no
11607 fi
11608 rm -f conftest.$ac_objext conftest.$ac_ext
11609          CFLAGS="$cf_save_CFLAGS"
11610          CPPFLAGS="$cf_save_CPPFLAGS"
11611
11612 fi
11613 rm -f conftest.$ac_objext conftest.$ac_ext
11614
11615 fi
11616 echo "$as_me:11616: result: $cf_cv_posix_c_source" >&5
11617 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11618
11619 if test "$cf_cv_posix_c_source" != no ; then
11620         CFLAGS="$cf_trim_CFLAGS"
11621         CPPFLAGS="$cf_trim_CPPFLAGS"
11622
11623 cf_fix_cppflags=no
11624 cf_new_cflags=
11625 cf_new_cppflags=
11626 cf_new_extra_cppflags=
11627
11628 for cf_add_cflags in $cf_cv_posix_c_source
11629 do
11630 case $cf_fix_cppflags in
11631 (no)
11632         case $cf_add_cflags in
11633         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11634                 case $cf_add_cflags in
11635                 (-D*)
11636                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11637
11638                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11639                                 && test -z "${cf_tst_cflags}" \
11640                                 && cf_fix_cppflags=yes
11641
11642                         if test $cf_fix_cppflags = yes ; then
11643
11644         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11645         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11646
11647                                 continue
11648                         elif test "${cf_tst_cflags}" = "\"'" ; then
11649
11650         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11651         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11652
11653                                 continue
11654                         fi
11655                         ;;
11656                 esac
11657                 case "$CPPFLAGS" in
11658                 (*$cf_add_cflags)
11659                         ;;
11660                 (*)
11661                         case $cf_add_cflags in
11662                         (-D*)
11663                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11664
11665 CPPFLAGS=`echo "$CPPFLAGS" | \
11666         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11667                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11668
11669                                 ;;
11670                         esac
11671
11672         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11673         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11674
11675                         ;;
11676                 esac
11677                 ;;
11678         (*)
11679
11680         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11681         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11682
11683                 ;;
11684         esac
11685         ;;
11686 (yes)
11687
11688         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11689         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11690
11691         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11692
11693         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11694                 && test -z "${cf_tst_cflags}" \
11695                 && cf_fix_cppflags=no
11696         ;;
11697 esac
11698 done
11699
11700 if test -n "$cf_new_cflags" ; then
11701
11702         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11703         CFLAGS="${CFLAGS}$cf_new_cflags"
11704
11705 fi
11706
11707 if test -n "$cf_new_cppflags" ; then
11708
11709         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11710         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11711
11712 fi
11713
11714 if test -n "$cf_new_extra_cppflags" ; then
11715
11716         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11717         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11718
11719 fi
11720
11721 fi
11722
11723         ;;
11724 (netbsd*)
11725         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
11726         ;;
11727 (openbsd[4-9]*)
11728         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
11729         cf_xopen_source="-D_BSD_SOURCE"
11730         cf_XOPEN_SOURCE=600
11731         ;;
11732 (openbsd*)
11733         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
11734         ;;
11735 (osf[45]*)
11736         cf_xopen_source="-D_OSF_SOURCE"
11737         ;;
11738 (nto-qnx*)
11739         cf_xopen_source="-D_QNX_SOURCE"
11740         ;;
11741 (sco*)
11742         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
11743         ;;
11744 (solaris2.*)
11745         cf_xopen_source="-D__EXTENSIONS__"
11746         cf_cv_xopen_source=broken
11747         ;;
11748 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
11749         cf_XOPEN_SOURCE=
11750         cf_POSIX_C_SOURCE=
11751         ;;
11752 (*)
11753
11754 echo "$as_me:11754: checking if we should define _XOPEN_SOURCE" >&5
11755 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11756 if test "${cf_cv_xopen_source+set}" = set; then
11757   echo $ECHO_N "(cached) $ECHO_C" >&6
11758 else
11759
11760         cat >conftest.$ac_ext <<_ACEOF
11761 #line 11761 "configure"
11762 #include "confdefs.h"
11763
11764 #include <stdlib.h>
11765 #include <string.h>
11766 #include <sys/types.h>
11767
11768 int
11769 main (void)
11770 {
11771
11772 #ifndef _XOPEN_SOURCE
11773 make an error
11774 #endif
11775   ;
11776   return 0;
11777 }
11778 _ACEOF
11779 rm -f conftest.$ac_objext
11780 if { (eval echo "$as_me:11780: \"$ac_compile\"") >&5
11781   (eval $ac_compile) 2>&5
11782   ac_status=$?
11783   echo "$as_me:11783: \$? = $ac_status" >&5
11784   (exit $ac_status); } &&
11785          { ac_try='test -s conftest.$ac_objext'
11786   { (eval echo "$as_me:11786: \"$ac_try\"") >&5
11787   (eval $ac_try) 2>&5
11788   ac_status=$?
11789   echo "$as_me:11789: \$? = $ac_status" >&5
11790   (exit $ac_status); }; }; then
11791   cf_cv_xopen_source=no
11792 else
11793   echo "$as_me: failed program was:" >&5
11794 cat conftest.$ac_ext >&5
11795 cf_save="$CPPFLAGS"
11796
11797         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11798         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11799
11800          cat >conftest.$ac_ext <<_ACEOF
11801 #line 11801 "configure"
11802 #include "confdefs.h"
11803
11804 #include <stdlib.h>
11805 #include <string.h>
11806 #include <sys/types.h>
11807
11808 int
11809 main (void)
11810 {
11811
11812 #ifdef _XOPEN_SOURCE
11813 make an error
11814 #endif
11815   ;
11816   return 0;
11817 }
11818 _ACEOF
11819 rm -f conftest.$ac_objext
11820 if { (eval echo "$as_me:11820: \"$ac_compile\"") >&5
11821   (eval $ac_compile) 2>&5
11822   ac_status=$?
11823   echo "$as_me:11823: \$? = $ac_status" >&5
11824   (exit $ac_status); } &&
11825          { ac_try='test -s conftest.$ac_objext'
11826   { (eval echo "$as_me:11826: \"$ac_try\"") >&5
11827   (eval $ac_try) 2>&5
11828   ac_status=$?
11829   echo "$as_me:11829: \$? = $ac_status" >&5
11830   (exit $ac_status); }; }; then
11831   cf_cv_xopen_source=no
11832 else
11833   echo "$as_me: failed program was:" >&5
11834 cat conftest.$ac_ext >&5
11835 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11836 fi
11837 rm -f conftest.$ac_objext conftest.$ac_ext
11838         CPPFLAGS="$cf_save"
11839
11840 fi
11841 rm -f conftest.$ac_objext conftest.$ac_ext
11842
11843 fi
11844 echo "$as_me:11844: result: $cf_cv_xopen_source" >&5
11845 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11846
11847 if test "$cf_cv_xopen_source" != no ; then
11848
11849 CFLAGS=`echo "$CFLAGS" | \
11850         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11851                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11852
11853 CPPFLAGS=`echo "$CPPFLAGS" | \
11854         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11855                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11856
11857         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11858
11859 cf_fix_cppflags=no
11860 cf_new_cflags=
11861 cf_new_cppflags=
11862 cf_new_extra_cppflags=
11863
11864 for cf_add_cflags in $cf_temp_xopen_source
11865 do
11866 case $cf_fix_cppflags in
11867 (no)
11868         case $cf_add_cflags in
11869         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11870                 case $cf_add_cflags in
11871                 (-D*)
11872                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11873
11874                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11875                                 && test -z "${cf_tst_cflags}" \
11876                                 && cf_fix_cppflags=yes
11877
11878                         if test $cf_fix_cppflags = yes ; then
11879
11880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11882
11883                                 continue
11884                         elif test "${cf_tst_cflags}" = "\"'" ; then
11885
11886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11888
11889                                 continue
11890                         fi
11891                         ;;
11892                 esac
11893                 case "$CPPFLAGS" in
11894                 (*$cf_add_cflags)
11895                         ;;
11896                 (*)
11897                         case $cf_add_cflags in
11898                         (-D*)
11899                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11900
11901 CPPFLAGS=`echo "$CPPFLAGS" | \
11902         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11903                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11904
11905                                 ;;
11906                         esac
11907
11908         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11909         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11910
11911                         ;;
11912                 esac
11913                 ;;
11914         (*)
11915
11916         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11917         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11918
11919                 ;;
11920         esac
11921         ;;
11922 (yes)
11923
11924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11926
11927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11928
11929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11930                 && test -z "${cf_tst_cflags}" \
11931                 && cf_fix_cppflags=no
11932         ;;
11933 esac
11934 done
11935
11936 if test -n "$cf_new_cflags" ; then
11937
11938         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11939         CFLAGS="${CFLAGS}$cf_new_cflags"
11940
11941 fi
11942
11943 if test -n "$cf_new_cppflags" ; then
11944
11945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11946         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11947
11948 fi
11949
11950 if test -n "$cf_new_extra_cppflags" ; then
11951
11952         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11953         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11954
11955 fi
11956
11957 fi
11958
11959 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
11960
11961 cf_save_CFLAGS="$CFLAGS"
11962 cf_save_CPPFLAGS="$CPPFLAGS"
11963
11964 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
11965         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11966                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11967
11968 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
11969         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
11970                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
11971
11972 echo "$as_me:11972: checking if we should define _POSIX_C_SOURCE" >&5
11973 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
11974 if test "${cf_cv_posix_c_source+set}" = set; then
11975   echo $ECHO_N "(cached) $ECHO_C" >&6
11976 else
11977
11978 echo "${as_me:-configure}:11978: testing if the symbol is already defined go no further ..." 1>&5
11979
11980         cat >conftest.$ac_ext <<_ACEOF
11981 #line 11981 "configure"
11982 #include "confdefs.h"
11983 #include <sys/types.h>
11984 int
11985 main (void)
11986 {
11987
11988 #ifndef _POSIX_C_SOURCE
11989 make an error
11990 #endif
11991   ;
11992   return 0;
11993 }
11994 _ACEOF
11995 rm -f conftest.$ac_objext
11996 if { (eval echo "$as_me:11996: \"$ac_compile\"") >&5
11997   (eval $ac_compile) 2>&5
11998   ac_status=$?
11999   echo "$as_me:11999: \$? = $ac_status" >&5
12000   (exit $ac_status); } &&
12001          { ac_try='test -s conftest.$ac_objext'
12002   { (eval echo "$as_me:12002: \"$ac_try\"") >&5
12003   (eval $ac_try) 2>&5
12004   ac_status=$?
12005   echo "$as_me:12005: \$? = $ac_status" >&5
12006   (exit $ac_status); }; }; then
12007   cf_cv_posix_c_source=no
12008 else
12009   echo "$as_me: failed program was:" >&5
12010 cat conftest.$ac_ext >&5
12011 cf_want_posix_source=no
12012          case .$cf_POSIX_C_SOURCE in
12013          (.[12]??*)
12014                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12015                 ;;
12016          (.2)
12017                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
12018                 cf_want_posix_source=yes
12019                 ;;
12020          (.*)
12021                 cf_want_posix_source=yes
12022                 ;;
12023          esac
12024          if test "$cf_want_posix_source" = yes ; then
12025                 cat >conftest.$ac_ext <<_ACEOF
12026 #line 12026 "configure"
12027 #include "confdefs.h"
12028 #include <sys/types.h>
12029 int
12030 main (void)
12031 {
12032
12033 #ifdef _POSIX_SOURCE
12034 make an error
12035 #endif
12036   ;
12037   return 0;
12038 }
12039 _ACEOF
12040 rm -f conftest.$ac_objext
12041 if { (eval echo "$as_me:12041: \"$ac_compile\"") >&5
12042   (eval $ac_compile) 2>&5
12043   ac_status=$?
12044   echo "$as_me:12044: \$? = $ac_status" >&5
12045   (exit $ac_status); } &&
12046          { ac_try='test -s conftest.$ac_objext'
12047   { (eval echo "$as_me:12047: \"$ac_try\"") >&5
12048   (eval $ac_try) 2>&5
12049   ac_status=$?
12050   echo "$as_me:12050: \$? = $ac_status" >&5
12051   (exit $ac_status); }; }; then
12052   :
12053 else
12054   echo "$as_me: failed program was:" >&5
12055 cat conftest.$ac_ext >&5
12056 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
12057 fi
12058 rm -f conftest.$ac_objext conftest.$ac_ext
12059          fi
12060
12061 echo "${as_me:-configure}:12061: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
12062
12063          CFLAGS="$cf_trim_CFLAGS"
12064          CPPFLAGS="$cf_trim_CPPFLAGS"
12065
12066         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12067         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
12068
12069 echo "${as_me:-configure}:12069: testing if the second compile does not leave our definition intact error ..." 1>&5
12070
12071          cat >conftest.$ac_ext <<_ACEOF
12072 #line 12072 "configure"
12073 #include "confdefs.h"
12074 #include <sys/types.h>
12075 int
12076 main (void)
12077 {
12078
12079 #ifndef _POSIX_C_SOURCE
12080 make an error
12081 #endif
12082   ;
12083   return 0;
12084 }
12085 _ACEOF
12086 rm -f conftest.$ac_objext
12087 if { (eval echo "$as_me:12087: \"$ac_compile\"") >&5
12088   (eval $ac_compile) 2>&5
12089   ac_status=$?
12090   echo "$as_me:12090: \$? = $ac_status" >&5
12091   (exit $ac_status); } &&
12092          { ac_try='test -s conftest.$ac_objext'
12093   { (eval echo "$as_me:12093: \"$ac_try\"") >&5
12094   (eval $ac_try) 2>&5
12095   ac_status=$?
12096   echo "$as_me:12096: \$? = $ac_status" >&5
12097   (exit $ac_status); }; }; then
12098   :
12099 else
12100   echo "$as_me: failed program was:" >&5
12101 cat conftest.$ac_ext >&5
12102 cf_cv_posix_c_source=no
12103 fi
12104 rm -f conftest.$ac_objext conftest.$ac_ext
12105          CFLAGS="$cf_save_CFLAGS"
12106          CPPFLAGS="$cf_save_CPPFLAGS"
12107
12108 fi
12109 rm -f conftest.$ac_objext conftest.$ac_ext
12110
12111 fi
12112 echo "$as_me:12112: result: $cf_cv_posix_c_source" >&5
12113 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
12114
12115 if test "$cf_cv_posix_c_source" != no ; then
12116         CFLAGS="$cf_trim_CFLAGS"
12117         CPPFLAGS="$cf_trim_CPPFLAGS"
12118
12119 cf_fix_cppflags=no
12120 cf_new_cflags=
12121 cf_new_cppflags=
12122 cf_new_extra_cppflags=
12123
12124 for cf_add_cflags in $cf_cv_posix_c_source
12125 do
12126 case $cf_fix_cppflags in
12127 (no)
12128         case $cf_add_cflags in
12129         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12130                 case $cf_add_cflags in
12131                 (-D*)
12132                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12133
12134                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12135                                 && test -z "${cf_tst_cflags}" \
12136                                 && cf_fix_cppflags=yes
12137
12138                         if test $cf_fix_cppflags = yes ; then
12139
12140         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12141         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12142
12143                                 continue
12144                         elif test "${cf_tst_cflags}" = "\"'" ; then
12145
12146         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12147         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12148
12149                                 continue
12150                         fi
12151                         ;;
12152                 esac
12153                 case "$CPPFLAGS" in
12154                 (*$cf_add_cflags)
12155                         ;;
12156                 (*)
12157                         case $cf_add_cflags in
12158                         (-D*)
12159                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12160
12161 CPPFLAGS=`echo "$CPPFLAGS" | \
12162         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12163                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12164
12165                                 ;;
12166                         esac
12167
12168         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12169         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12170
12171                         ;;
12172                 esac
12173                 ;;
12174         (*)
12175
12176         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12177         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12178
12179                 ;;
12180         esac
12181         ;;
12182 (yes)
12183
12184         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12185         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12186
12187         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12188
12189         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12190                 && test -z "${cf_tst_cflags}" \
12191                 && cf_fix_cppflags=no
12192         ;;
12193 esac
12194 done
12195
12196 if test -n "$cf_new_cflags" ; then
12197
12198         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12199         CFLAGS="${CFLAGS}$cf_new_cflags"
12200
12201 fi
12202
12203 if test -n "$cf_new_cppflags" ; then
12204
12205         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12206         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12207
12208 fi
12209
12210 if test -n "$cf_new_extra_cppflags" ; then
12211
12212         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12213         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12214
12215 fi
12216
12217 fi
12218
12219         ;;
12220 esac
12221
12222 if test -n "$cf_xopen_source" ; then
12223
12224 cf_fix_cppflags=no
12225 cf_new_cflags=
12226 cf_new_cppflags=
12227 cf_new_extra_cppflags=
12228
12229 for cf_add_cflags in $cf_xopen_source
12230 do
12231 case $cf_fix_cppflags in
12232 (no)
12233         case $cf_add_cflags in
12234         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12235                 case $cf_add_cflags in
12236                 (-D*)
12237                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12238
12239                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12240                                 && test -z "${cf_tst_cflags}" \
12241                                 && cf_fix_cppflags=yes
12242
12243                         if test $cf_fix_cppflags = yes ; then
12244
12245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12247
12248                                 continue
12249                         elif test "${cf_tst_cflags}" = "\"'" ; then
12250
12251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12253
12254                                 continue
12255                         fi
12256                         ;;
12257                 esac
12258                 case "$CPPFLAGS" in
12259                 (*$cf_add_cflags)
12260                         ;;
12261                 (*)
12262                         case $cf_add_cflags in
12263                         (-D*)
12264                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12265
12266 CPPFLAGS=`echo "$CPPFLAGS" | \
12267         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12268                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12269
12270                                 ;;
12271                         esac
12272
12273         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12274         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12275
12276                         ;;
12277                 esac
12278                 ;;
12279         (*)
12280
12281         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12282         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12283
12284                 ;;
12285         esac
12286         ;;
12287 (yes)
12288
12289         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12290         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12291
12292         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12293
12294         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12295                 && test -z "${cf_tst_cflags}" \
12296                 && cf_fix_cppflags=no
12297         ;;
12298 esac
12299 done
12300
12301 if test -n "$cf_new_cflags" ; then
12302         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12303
12304 echo "${as_me:-configure}:12304: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12305
12306         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12307         CFLAGS="${CFLAGS}$cf_new_cflags"
12308
12309 fi
12310
12311 if test -n "$cf_new_cppflags" ; then
12312         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12313
12314 echo "${as_me:-configure}:12314: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12315
12316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12317         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12318
12319 fi
12320
12321 if test -n "$cf_new_extra_cppflags" ; then
12322         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12323
12324 echo "${as_me:-configure}:12324: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12325
12326         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12327         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12328
12329 fi
12330
12331 fi
12332
12333 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
12334         echo "$as_me:12334: checking if _XOPEN_SOURCE really is set" >&5
12335 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
12336         cat >conftest.$ac_ext <<_ACEOF
12337 #line 12337 "configure"
12338 #include "confdefs.h"
12339 #include <stdlib.h>
12340 int
12341 main (void)
12342 {
12343
12344 #ifndef _XOPEN_SOURCE
12345 make an error
12346 #endif
12347   ;
12348   return 0;
12349 }
12350 _ACEOF
12351 rm -f conftest.$ac_objext
12352 if { (eval echo "$as_me:12352: \"$ac_compile\"") >&5
12353   (eval $ac_compile) 2>&5
12354   ac_status=$?
12355   echo "$as_me:12355: \$? = $ac_status" >&5
12356   (exit $ac_status); } &&
12357          { ac_try='test -s conftest.$ac_objext'
12358   { (eval echo "$as_me:12358: \"$ac_try\"") >&5
12359   (eval $ac_try) 2>&5
12360   ac_status=$?
12361   echo "$as_me:12361: \$? = $ac_status" >&5
12362   (exit $ac_status); }; }; then
12363   cf_XOPEN_SOURCE_set=yes
12364 else
12365   echo "$as_me: failed program was:" >&5
12366 cat conftest.$ac_ext >&5
12367 cf_XOPEN_SOURCE_set=no
12368 fi
12369 rm -f conftest.$ac_objext conftest.$ac_ext
12370         echo "$as_me:12370: result: $cf_XOPEN_SOURCE_set" >&5
12371 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
12372         if test $cf_XOPEN_SOURCE_set = yes
12373         then
12374                 cat >conftest.$ac_ext <<_ACEOF
12375 #line 12375 "configure"
12376 #include "confdefs.h"
12377 #include <stdlib.h>
12378 int
12379 main (void)
12380 {
12381
12382 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
12383 make an error
12384 #endif
12385   ;
12386   return 0;
12387 }
12388 _ACEOF
12389 rm -f conftest.$ac_objext
12390 if { (eval echo "$as_me:12390: \"$ac_compile\"") >&5
12391   (eval $ac_compile) 2>&5
12392   ac_status=$?
12393   echo "$as_me:12393: \$? = $ac_status" >&5
12394   (exit $ac_status); } &&
12395          { ac_try='test -s conftest.$ac_objext'
12396   { (eval echo "$as_me:12396: \"$ac_try\"") >&5
12397   (eval $ac_try) 2>&5
12398   ac_status=$?
12399   echo "$as_me:12399: \$? = $ac_status" >&5
12400   (exit $ac_status); }; }; then
12401   cf_XOPEN_SOURCE_set_ok=yes
12402 else
12403   echo "$as_me: failed program was:" >&5
12404 cat conftest.$ac_ext >&5
12405 cf_XOPEN_SOURCE_set_ok=no
12406 fi
12407 rm -f conftest.$ac_objext conftest.$ac_ext
12408                 if test $cf_XOPEN_SOURCE_set_ok = no
12409                 then
12410                         { echo "$as_me:12410: WARNING: _XOPEN_SOURCE is lower than requested" >&5
12411 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
12412                 fi
12413         else
12414
12415 echo "$as_me:12415: checking if we should define _XOPEN_SOURCE" >&5
12416 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
12417 if test "${cf_cv_xopen_source+set}" = set; then
12418   echo $ECHO_N "(cached) $ECHO_C" >&6
12419 else
12420
12421         cat >conftest.$ac_ext <<_ACEOF
12422 #line 12422 "configure"
12423 #include "confdefs.h"
12424
12425 #include <stdlib.h>
12426 #include <string.h>
12427 #include <sys/types.h>
12428
12429 int
12430 main (void)
12431 {
12432
12433 #ifndef _XOPEN_SOURCE
12434 make an error
12435 #endif
12436   ;
12437   return 0;
12438 }
12439 _ACEOF
12440 rm -f conftest.$ac_objext
12441 if { (eval echo "$as_me:12441: \"$ac_compile\"") >&5
12442   (eval $ac_compile) 2>&5
12443   ac_status=$?
12444   echo "$as_me:12444: \$? = $ac_status" >&5
12445   (exit $ac_status); } &&
12446          { ac_try='test -s conftest.$ac_objext'
12447   { (eval echo "$as_me:12447: \"$ac_try\"") >&5
12448   (eval $ac_try) 2>&5
12449   ac_status=$?
12450   echo "$as_me:12450: \$? = $ac_status" >&5
12451   (exit $ac_status); }; }; then
12452   cf_cv_xopen_source=no
12453 else
12454   echo "$as_me: failed program was:" >&5
12455 cat conftest.$ac_ext >&5
12456 cf_save="$CPPFLAGS"
12457
12458         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12459         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
12460
12461          cat >conftest.$ac_ext <<_ACEOF
12462 #line 12462 "configure"
12463 #include "confdefs.h"
12464
12465 #include <stdlib.h>
12466 #include <string.h>
12467 #include <sys/types.h>
12468
12469 int
12470 main (void)
12471 {
12472
12473 #ifdef _XOPEN_SOURCE
12474 make an error
12475 #endif
12476   ;
12477   return 0;
12478 }
12479 _ACEOF
12480 rm -f conftest.$ac_objext
12481 if { (eval echo "$as_me:12481: \"$ac_compile\"") >&5
12482   (eval $ac_compile) 2>&5
12483   ac_status=$?
12484   echo "$as_me:12484: \$? = $ac_status" >&5
12485   (exit $ac_status); } &&
12486          { ac_try='test -s conftest.$ac_objext'
12487   { (eval echo "$as_me:12487: \"$ac_try\"") >&5
12488   (eval $ac_try) 2>&5
12489   ac_status=$?
12490   echo "$as_me:12490: \$? = $ac_status" >&5
12491   (exit $ac_status); }; }; then
12492   cf_cv_xopen_source=no
12493 else
12494   echo "$as_me: failed program was:" >&5
12495 cat conftest.$ac_ext >&5
12496 cf_cv_xopen_source=$cf_XOPEN_SOURCE
12497 fi
12498 rm -f conftest.$ac_objext conftest.$ac_ext
12499         CPPFLAGS="$cf_save"
12500
12501 fi
12502 rm -f conftest.$ac_objext conftest.$ac_ext
12503
12504 fi
12505 echo "$as_me:12505: result: $cf_cv_xopen_source" >&5
12506 echo "${ECHO_T}$cf_cv_xopen_source" >&6
12507
12508 if test "$cf_cv_xopen_source" != no ; then
12509
12510 CFLAGS=`echo "$CFLAGS" | \
12511         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12512                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12513
12514 CPPFLAGS=`echo "$CPPFLAGS" | \
12515         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
12516                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
12517
12518         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
12519
12520 cf_fix_cppflags=no
12521 cf_new_cflags=
12522 cf_new_cppflags=
12523 cf_new_extra_cppflags=
12524
12525 for cf_add_cflags in $cf_temp_xopen_source
12526 do
12527 case $cf_fix_cppflags in
12528 (no)
12529         case $cf_add_cflags in
12530         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12531                 case $cf_add_cflags in
12532                 (-D*)
12533                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12534
12535                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12536                                 && test -z "${cf_tst_cflags}" \
12537                                 && cf_fix_cppflags=yes
12538
12539                         if test $cf_fix_cppflags = yes ; then
12540
12541         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12542         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12543
12544                                 continue
12545                         elif test "${cf_tst_cflags}" = "\"'" ; then
12546
12547         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12548         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12549
12550                                 continue
12551                         fi
12552                         ;;
12553                 esac
12554                 case "$CPPFLAGS" in
12555                 (*$cf_add_cflags)
12556                         ;;
12557                 (*)
12558                         case $cf_add_cflags in
12559                         (-D*)
12560                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12561
12562 CPPFLAGS=`echo "$CPPFLAGS" | \
12563         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12564                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12565
12566                                 ;;
12567                         esac
12568
12569         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12570         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12571
12572                         ;;
12573                 esac
12574                 ;;
12575         (*)
12576
12577         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12578         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12579
12580                 ;;
12581         esac
12582         ;;
12583 (yes)
12584
12585         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12586         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12587
12588         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12589
12590         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12591                 && test -z "${cf_tst_cflags}" \
12592                 && cf_fix_cppflags=no
12593         ;;
12594 esac
12595 done
12596
12597 if test -n "$cf_new_cflags" ; then
12598
12599         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12600         CFLAGS="${CFLAGS}$cf_new_cflags"
12601
12602 fi
12603
12604 if test -n "$cf_new_cppflags" ; then
12605
12606         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12607         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12608
12609 fi
12610
12611 if test -n "$cf_new_extra_cppflags" ; then
12612
12613         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12614         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12615
12616 fi
12617
12618 fi
12619
12620         fi
12621 fi
12622
12623 # Check whether --enable-largefile or --disable-largefile was given.
12624 if test "${enable_largefile+set}" = set; then
12625   enableval="$enable_largefile"
12626
12627 fi;
12628 if test "$enable_largefile" != no; then
12629
12630   echo "$as_me:12630: checking for special C compiler options needed for large files" >&5
12631 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
12632 if test "${ac_cv_sys_largefile_CC+set}" = set; then
12633   echo $ECHO_N "(cached) $ECHO_C" >&6
12634 else
12635   ac_cv_sys_largefile_CC=no
12636      if test "$GCC" != yes; then
12637        ac_save_CC=$CC
12638        while :; do
12639          # IRIX 6.2 and later do not support large files by default,
12640          # so use the C compiler's -n32 option if that helps.
12641          cat >conftest.$ac_ext <<_ACEOF
12642 #line 12642 "configure"
12643 #include "confdefs.h"
12644 #include <sys/types.h>
12645  /* Check that off_t can represent 2**63 - 1 correctly.
12646     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12647     since some C++ compilers masquerading as C compilers
12648     incorrectly reject 9223372036854775807.  */
12649 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12650   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12651                        && LARGE_OFF_T % 2147483647 == 1)
12652                       ? 1 : -1];
12653 int
12654 main (void)
12655 {
12656
12657   ;
12658   return 0;
12659 }
12660 _ACEOF
12661          rm -f conftest.$ac_objext
12662 if { (eval echo "$as_me:12662: \"$ac_compile\"") >&5
12663   (eval $ac_compile) 2>&5
12664   ac_status=$?
12665   echo "$as_me:12665: \$? = $ac_status" >&5
12666   (exit $ac_status); } &&
12667          { ac_try='test -s conftest.$ac_objext'
12668   { (eval echo "$as_me:12668: \"$ac_try\"") >&5
12669   (eval $ac_try) 2>&5
12670   ac_status=$?
12671   echo "$as_me:12671: \$? = $ac_status" >&5
12672   (exit $ac_status); }; }; then
12673   break
12674 else
12675   echo "$as_me: failed program was:" >&5
12676 cat conftest.$ac_ext >&5
12677 fi
12678 rm -f conftest.$ac_objext
12679          CC="$CC -n32"
12680          rm -f conftest.$ac_objext
12681 if { (eval echo "$as_me:12681: \"$ac_compile\"") >&5
12682   (eval $ac_compile) 2>&5
12683   ac_status=$?
12684   echo "$as_me:12684: \$? = $ac_status" >&5
12685   (exit $ac_status); } &&
12686          { ac_try='test -s conftest.$ac_objext'
12687   { (eval echo "$as_me:12687: \"$ac_try\"") >&5
12688   (eval $ac_try) 2>&5
12689   ac_status=$?
12690   echo "$as_me:12690: \$? = $ac_status" >&5
12691   (exit $ac_status); }; }; then
12692   ac_cv_sys_largefile_CC=' -n32'; break
12693 else
12694   echo "$as_me: failed program was:" >&5
12695 cat conftest.$ac_ext >&5
12696 fi
12697 rm -f conftest.$ac_objext
12698          break
12699        done
12700        CC=$ac_save_CC
12701        rm -f conftest.$ac_ext
12702     fi
12703 fi
12704 echo "$as_me:12704: result: $ac_cv_sys_largefile_CC" >&5
12705 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
12706   if test "$ac_cv_sys_largefile_CC" != no; then
12707     CC=$CC$ac_cv_sys_largefile_CC
12708   fi
12709
12710   echo "$as_me:12710: checking for _FILE_OFFSET_BITS value needed for large files" >&5
12711 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
12712 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
12713   echo $ECHO_N "(cached) $ECHO_C" >&6
12714 else
12715   while :; do
12716   ac_cv_sys_file_offset_bits=no
12717   cat >conftest.$ac_ext <<_ACEOF
12718 #line 12718 "configure"
12719 #include "confdefs.h"
12720 #include <sys/types.h>
12721  /* Check that off_t can represent 2**63 - 1 correctly.
12722     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12723     since some C++ compilers masquerading as C compilers
12724     incorrectly reject 9223372036854775807.  */
12725 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12726   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12727                        && LARGE_OFF_T % 2147483647 == 1)
12728                       ? 1 : -1];
12729 int
12730 main (void)
12731 {
12732
12733   ;
12734   return 0;
12735 }
12736 _ACEOF
12737 rm -f conftest.$ac_objext
12738 if { (eval echo "$as_me:12738: \"$ac_compile\"") >&5
12739   (eval $ac_compile) 2>&5
12740   ac_status=$?
12741   echo "$as_me:12741: \$? = $ac_status" >&5
12742   (exit $ac_status); } &&
12743          { ac_try='test -s conftest.$ac_objext'
12744   { (eval echo "$as_me:12744: \"$ac_try\"") >&5
12745   (eval $ac_try) 2>&5
12746   ac_status=$?
12747   echo "$as_me:12747: \$? = $ac_status" >&5
12748   (exit $ac_status); }; }; then
12749   break
12750 else
12751   echo "$as_me: failed program was:" >&5
12752 cat conftest.$ac_ext >&5
12753 fi
12754 rm -f conftest.$ac_objext conftest.$ac_ext
12755   cat >conftest.$ac_ext <<_ACEOF
12756 #line 12756 "configure"
12757 #include "confdefs.h"
12758 #define _FILE_OFFSET_BITS 64
12759 #include <sys/types.h>
12760  /* Check that off_t can represent 2**63 - 1 correctly.
12761     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12762     since some C++ compilers masquerading as C compilers
12763     incorrectly reject 9223372036854775807.  */
12764 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12765   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12766                        && LARGE_OFF_T % 2147483647 == 1)
12767                       ? 1 : -1];
12768 int
12769 main (void)
12770 {
12771
12772   ;
12773   return 0;
12774 }
12775 _ACEOF
12776 rm -f conftest.$ac_objext
12777 if { (eval echo "$as_me:12777: \"$ac_compile\"") >&5
12778   (eval $ac_compile) 2>&5
12779   ac_status=$?
12780   echo "$as_me:12780: \$? = $ac_status" >&5
12781   (exit $ac_status); } &&
12782          { ac_try='test -s conftest.$ac_objext'
12783   { (eval echo "$as_me:12783: \"$ac_try\"") >&5
12784   (eval $ac_try) 2>&5
12785   ac_status=$?
12786   echo "$as_me:12786: \$? = $ac_status" >&5
12787   (exit $ac_status); }; }; then
12788   ac_cv_sys_file_offset_bits=64; break
12789 else
12790   echo "$as_me: failed program was:" >&5
12791 cat conftest.$ac_ext >&5
12792 fi
12793 rm -f conftest.$ac_objext conftest.$ac_ext
12794   break
12795 done
12796 fi
12797 echo "$as_me:12797: result: $ac_cv_sys_file_offset_bits" >&5
12798 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
12799 if test "$ac_cv_sys_file_offset_bits" != no; then
12800
12801 cat >>confdefs.h <<EOF
12802 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
12803 EOF
12804
12805 fi
12806 rm -rf conftest*
12807   echo "$as_me:12807: checking for _LARGE_FILES value needed for large files" >&5
12808 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
12809 if test "${ac_cv_sys_large_files+set}" = set; then
12810   echo $ECHO_N "(cached) $ECHO_C" >&6
12811 else
12812   while :; do
12813   ac_cv_sys_large_files=no
12814   cat >conftest.$ac_ext <<_ACEOF
12815 #line 12815 "configure"
12816 #include "confdefs.h"
12817 #include <sys/types.h>
12818  /* Check that off_t can represent 2**63 - 1 correctly.
12819     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12820     since some C++ compilers masquerading as C compilers
12821     incorrectly reject 9223372036854775807.  */
12822 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12823   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12824                        && LARGE_OFF_T % 2147483647 == 1)
12825                       ? 1 : -1];
12826 int
12827 main (void)
12828 {
12829
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   break
12847 else
12848   echo "$as_me: failed program was:" >&5
12849 cat conftest.$ac_ext >&5
12850 fi
12851 rm -f conftest.$ac_objext conftest.$ac_ext
12852   cat >conftest.$ac_ext <<_ACEOF
12853 #line 12853 "configure"
12854 #include "confdefs.h"
12855 #define _LARGE_FILES 1
12856 #include <sys/types.h>
12857  /* Check that off_t can represent 2**63 - 1 correctly.
12858     We can't simply define LARGE_OFF_T to be 9223372036854775807,
12859     since some C++ compilers masquerading as C compilers
12860     incorrectly reject 9223372036854775807.  */
12861 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
12862   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
12863                        && LARGE_OFF_T % 2147483647 == 1)
12864                       ? 1 : -1];
12865 int
12866 main (void)
12867 {
12868
12869   ;
12870   return 0;
12871 }
12872 _ACEOF
12873 rm -f conftest.$ac_objext
12874 if { (eval echo "$as_me:12874: \"$ac_compile\"") >&5
12875   (eval $ac_compile) 2>&5
12876   ac_status=$?
12877   echo "$as_me:12877: \$? = $ac_status" >&5
12878   (exit $ac_status); } &&
12879          { ac_try='test -s conftest.$ac_objext'
12880   { (eval echo "$as_me:12880: \"$ac_try\"") >&5
12881   (eval $ac_try) 2>&5
12882   ac_status=$?
12883   echo "$as_me:12883: \$? = $ac_status" >&5
12884   (exit $ac_status); }; }; then
12885   ac_cv_sys_large_files=1; break
12886 else
12887   echo "$as_me: failed program was:" >&5
12888 cat conftest.$ac_ext >&5
12889 fi
12890 rm -f conftest.$ac_objext conftest.$ac_ext
12891   break
12892 done
12893 fi
12894 echo "$as_me:12894: result: $ac_cv_sys_large_files" >&5
12895 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
12896 if test "$ac_cv_sys_large_files" != no; then
12897
12898 cat >>confdefs.h <<EOF
12899 #define _LARGE_FILES $ac_cv_sys_large_files
12900 EOF
12901
12902 fi
12903 rm -rf conftest*
12904 fi
12905
12906         if test "$enable_largefile" != no ; then
12907         echo "$as_me:12907: checking for _LARGEFILE_SOURCE value needed for large files" >&5
12908 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
12909 if test "${ac_cv_sys_largefile_source+set}" = set; then
12910   echo $ECHO_N "(cached) $ECHO_C" >&6
12911 else
12912   while :; do
12913   ac_cv_sys_largefile_source=no
12914   cat >conftest.$ac_ext <<_ACEOF
12915 #line 12915 "configure"
12916 #include "confdefs.h"
12917 #include <stdio.h>
12918 int
12919 main (void)
12920 {
12921 return !fseeko;
12922   ;
12923   return 0;
12924 }
12925 _ACEOF
12926 rm -f conftest.$ac_objext
12927 if { (eval echo "$as_me:12927: \"$ac_compile\"") >&5
12928   (eval $ac_compile) 2>&5
12929   ac_status=$?
12930   echo "$as_me:12930: \$? = $ac_status" >&5
12931   (exit $ac_status); } &&
12932          { ac_try='test -s conftest.$ac_objext'
12933   { (eval echo "$as_me:12933: \"$ac_try\"") >&5
12934   (eval $ac_try) 2>&5
12935   ac_status=$?
12936   echo "$as_me:12936: \$? = $ac_status" >&5
12937   (exit $ac_status); }; }; then
12938   break
12939 else
12940   echo "$as_me: failed program was:" >&5
12941 cat conftest.$ac_ext >&5
12942 fi
12943 rm -f conftest.$ac_objext conftest.$ac_ext
12944   cat >conftest.$ac_ext <<_ACEOF
12945 #line 12945 "configure"
12946 #include "confdefs.h"
12947 #define _LARGEFILE_SOURCE 1
12948 #include <stdio.h>
12949 int
12950 main (void)
12951 {
12952 return !fseeko;
12953   ;
12954   return 0;
12955 }
12956 _ACEOF
12957 rm -f conftest.$ac_objext
12958 if { (eval echo "$as_me:12958: \"$ac_compile\"") >&5
12959   (eval $ac_compile) 2>&5
12960   ac_status=$?
12961   echo "$as_me:12961: \$? = $ac_status" >&5
12962   (exit $ac_status); } &&
12963          { ac_try='test -s conftest.$ac_objext'
12964   { (eval echo "$as_me:12964: \"$ac_try\"") >&5
12965   (eval $ac_try) 2>&5
12966   ac_status=$?
12967   echo "$as_me:12967: \$? = $ac_status" >&5
12968   (exit $ac_status); }; }; then
12969   ac_cv_sys_largefile_source=1; break
12970 else
12971   echo "$as_me: failed program was:" >&5
12972 cat conftest.$ac_ext >&5
12973 fi
12974 rm -f conftest.$ac_objext conftest.$ac_ext
12975   break
12976 done
12977 fi
12978 echo "$as_me:12978: result: $ac_cv_sys_largefile_source" >&5
12979 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
12980 if test "$ac_cv_sys_largefile_source" != no; then
12981
12982 cat >>confdefs.h <<EOF
12983 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
12984 EOF
12985
12986 fi
12987 rm -rf conftest*
12988
12989 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12990 # in glibc 2.1.3, but that breaks too many other things.
12991 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12992 echo "$as_me:12992: checking for fseeko" >&5
12993 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
12994 if test "${ac_cv_func_fseeko+set}" = set; then
12995   echo $ECHO_N "(cached) $ECHO_C" >&6
12996 else
12997   cat >conftest.$ac_ext <<_ACEOF
12998 #line 12998 "configure"
12999 #include "confdefs.h"
13000 #include <stdio.h>
13001 int
13002 main (void)
13003 {
13004 return fseeko && fseeko (stdin, 0, 0);
13005   ;
13006   return 0;
13007 }
13008 _ACEOF
13009 rm -f conftest.$ac_objext conftest$ac_exeext
13010 if { (eval echo "$as_me:13010: \"$ac_link\"") >&5
13011   (eval $ac_link) 2>&5
13012   ac_status=$?
13013   echo "$as_me:13013: \$? = $ac_status" >&5
13014   (exit $ac_status); } &&
13015          { ac_try='test -s conftest$ac_exeext'
13016   { (eval echo "$as_me:13016: \"$ac_try\"") >&5
13017   (eval $ac_try) 2>&5
13018   ac_status=$?
13019   echo "$as_me:13019: \$? = $ac_status" >&5
13020   (exit $ac_status); }; }; then
13021   ac_cv_func_fseeko=yes
13022 else
13023   echo "$as_me: failed program was:" >&5
13024 cat conftest.$ac_ext >&5
13025 ac_cv_func_fseeko=no
13026 fi
13027 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13028 fi
13029 echo "$as_me:13029: result: $ac_cv_func_fseeko" >&5
13030 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
13031 if test $ac_cv_func_fseeko = yes; then
13032
13033 cat >>confdefs.h <<\EOF
13034 #define HAVE_FSEEKO 1
13035 EOF
13036
13037 fi
13038
13039         # Normally we would collect these definitions in the config.h,
13040         # but (like _XOPEN_SOURCE), some environments rely on having these
13041         # defined before any of the system headers are included.  Another
13042         # case comes up with C++, e.g., on AIX the compiler compiles the
13043         # header files by themselves before looking at the body files it is
13044         # told to compile.  For ncurses, those header files do not include
13045         # the config.h
13046         if test "$ac_cv_sys_large_files" != no
13047         then
13048
13049         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13050         CPPFLAGS="${CPPFLAGS}-D_LARGE_FILES"
13051
13052         fi
13053         if test "$ac_cv_sys_largefile_source" != no
13054         then
13055
13056         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13057         CPPFLAGS="${CPPFLAGS}-D_LARGEFILE_SOURCE"
13058
13059         fi
13060         if test "$ac_cv_sys_file_offset_bits" != no
13061         then
13062
13063         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13064         CPPFLAGS="${CPPFLAGS}-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
13065
13066         fi
13067
13068         echo "$as_me:13068: checking whether to use struct dirent64" >&5
13069 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
13070 if test "${cf_cv_struct_dirent64+set}" = set; then
13071   echo $ECHO_N "(cached) $ECHO_C" >&6
13072 else
13073
13074                 cat >conftest.$ac_ext <<_ACEOF
13075 #line 13075 "configure"
13076 #include "confdefs.h"
13077
13078 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
13079 #include <sys/types.h>
13080 #include <dirent.h>
13081
13082 int
13083 main (void)
13084 {
13085
13086                 /* if transitional largefile support is setup, this is true */
13087                 extern struct dirent64 * readdir(DIR *);
13088                 struct dirent64 *x = readdir((DIR *)0);
13089                 struct dirent *y = readdir((DIR *)0);
13090                 int z = x - y;
13091
13092   ;
13093   return 0;
13094 }
13095 _ACEOF
13096 rm -f conftest.$ac_objext
13097 if { (eval echo "$as_me:13097: \"$ac_compile\"") >&5
13098   (eval $ac_compile) 2>&5
13099   ac_status=$?
13100   echo "$as_me:13100: \$? = $ac_status" >&5
13101   (exit $ac_status); } &&
13102          { ac_try='test -s conftest.$ac_objext'
13103   { (eval echo "$as_me:13103: \"$ac_try\"") >&5
13104   (eval $ac_try) 2>&5
13105   ac_status=$?
13106   echo "$as_me:13106: \$? = $ac_status" >&5
13107   (exit $ac_status); }; }; then
13108   cf_cv_struct_dirent64=yes
13109 else
13110   echo "$as_me: failed program was:" >&5
13111 cat conftest.$ac_ext >&5
13112 cf_cv_struct_dirent64=no
13113 fi
13114 rm -f conftest.$ac_objext conftest.$ac_ext
13115
13116 fi
13117 echo "$as_me:13117: result: $cf_cv_struct_dirent64" >&5
13118 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
13119         test "$cf_cv_struct_dirent64" = yes &&
13120 cat >>confdefs.h <<\EOF
13121 #define HAVE_STRUCT_DIRENT64 1
13122 EOF
13123
13124         fi
13125
13126 ### Enable compiling-in rcs id's
13127 echo "$as_me:13127: checking if RCS identifiers should be compiled-in" >&5
13128 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
13129
13130 # Check whether --with-rcs-ids or --without-rcs-ids was given.
13131 if test "${with_rcs_ids+set}" = set; then
13132   withval="$with_rcs_ids"
13133   with_rcs_ids=$withval
13134 else
13135   with_rcs_ids=no
13136 fi;
13137 echo "$as_me:13137: result: $with_rcs_ids" >&5
13138 echo "${ECHO_T}$with_rcs_ids" >&6
13139 test "$with_rcs_ids" = yes &&
13140 cat >>confdefs.h <<\EOF
13141 #define USE_RCS_IDS 1
13142 EOF
13143
13144 ###############################################################################
13145
13146 ### Note that some functions (such as const) are normally disabled anyway.
13147 echo "$as_me:13147: checking if you want to build with function extensions" >&5
13148 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
13149
13150 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
13151 if test "${enable_ext_funcs+set}" = set; then
13152   enableval="$enable_ext_funcs"
13153   with_ext_funcs=$enableval
13154 else
13155   with_ext_funcs=yes
13156 fi;
13157 echo "$as_me:13157: result: $with_ext_funcs" >&5
13158 echo "${ECHO_T}$with_ext_funcs" >&6
13159 if test "$with_ext_funcs" = yes ; then
13160         NCURSES_EXT_FUNCS=1
13161
13162 cat >>confdefs.h <<\EOF
13163 #define HAVE_USE_DEFAULT_COLORS 1
13164 EOF
13165
13166 cat >>confdefs.h <<\EOF
13167 #define NCURSES_EXT_FUNCS 1
13168 EOF
13169
13170 else
13171         NCURSES_EXT_FUNCS=0
13172 fi
13173
13174 ###   use option --enable-const to turn on use of const beyond that in XSI.
13175 echo "$as_me:13175: checking for extended use of const keyword" >&5
13176 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
13177
13178 # Check whether --enable-const or --disable-const was given.
13179 if test "${enable_const+set}" = set; then
13180   enableval="$enable_const"
13181   with_ext_const=$enableval
13182 else
13183   with_ext_const=no
13184 fi;
13185 echo "$as_me:13185: result: $with_ext_const" >&5
13186 echo "${ECHO_T}$with_ext_const" >&6
13187 NCURSES_CONST='/*nothing*/'
13188 if test "$with_ext_const" = yes ; then
13189         NCURSES_CONST=const
13190 fi
13191
13192 ###############################################################################
13193 # These options are relatively safe to experiment with.
13194
13195 echo "$as_me:13195: checking if you want all development code" >&5
13196 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
13197
13198 # Check whether --with-develop or --without-develop was given.
13199 if test "${with_develop+set}" = set; then
13200   withval="$with_develop"
13201   with_develop=$withval
13202 else
13203   with_develop=no
13204 fi;
13205 echo "$as_me:13205: result: $with_develop" >&5
13206 echo "${ECHO_T}$with_develop" >&6
13207
13208 ###############################################################################
13209 # These are just experimental, probably should not be in a package:
13210
13211 # This is still experimental (20080329), but should ultimately be moved to
13212 # the script-block --with-normal, etc.
13213
13214 echo "$as_me:13214: checking if you want to link with the pthread library" >&5
13215 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
13216
13217 # Check whether --with-pthread or --without-pthread was given.
13218 if test "${with_pthread+set}" = set; then
13219   withval="$with_pthread"
13220   with_pthread=$withval
13221 else
13222   with_pthread=no
13223 fi;
13224 echo "$as_me:13224: result: $with_pthread" >&5
13225 echo "${ECHO_T}$with_pthread" >&6
13226
13227 if test "$with_pthread" != no ; then
13228         echo "$as_me:13228: checking for pthread.h" >&5
13229 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
13230 if test "${ac_cv_header_pthread_h+set}" = set; then
13231   echo $ECHO_N "(cached) $ECHO_C" >&6
13232 else
13233   cat >conftest.$ac_ext <<_ACEOF
13234 #line 13234 "configure"
13235 #include "confdefs.h"
13236 #include <pthread.h>
13237 _ACEOF
13238 if { (eval echo "$as_me:13238: \"$ac_cpp conftest.$ac_ext\"") >&5
13239   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13240   ac_status=$?
13241   egrep -v '^ *\+' conftest.er1 >conftest.err
13242   rm -f conftest.er1
13243   cat conftest.err >&5
13244   echo "$as_me:13244: \$? = $ac_status" >&5
13245   (exit $ac_status); } >/dev/null; then
13246   if test -s conftest.err; then
13247     ac_cpp_err=$ac_c_preproc_warn_flag
13248   else
13249     ac_cpp_err=
13250   fi
13251 else
13252   ac_cpp_err=yes
13253 fi
13254 if test -z "$ac_cpp_err"; then
13255   ac_cv_header_pthread_h=yes
13256 else
13257   echo "$as_me: failed program was:" >&5
13258   cat conftest.$ac_ext >&5
13259   ac_cv_header_pthread_h=no
13260 fi
13261 rm -f conftest.err conftest.$ac_ext
13262 fi
13263 echo "$as_me:13263: result: $ac_cv_header_pthread_h" >&5
13264 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
13265 if test $ac_cv_header_pthread_h = yes; then
13266
13267 cat >>confdefs.h <<\EOF
13268 #define HAVE_PTHREADS_H 1
13269 EOF
13270
13271         for cf_lib_pthread in pthread c_r
13272         do
13273             echo "$as_me:13273: checking if we can link with the $cf_lib_pthread library" >&5
13274 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
13275             cf_save_LIBS="$LIBS"
13276
13277 cf_add_libs="-l$cf_lib_pthread"
13278 # Filter out duplicates - this happens with badly-designed ".pc" files...
13279 for cf_add_1lib in $LIBS
13280 do
13281         for cf_add_2lib in $cf_add_libs
13282         do
13283                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13284                 then
13285                         cf_add_1lib=
13286                         break
13287                 fi
13288         done
13289         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13290 done
13291 LIBS="$cf_add_libs"
13292
13293             cat >conftest.$ac_ext <<_ACEOF
13294 #line 13294 "configure"
13295 #include "confdefs.h"
13296
13297 #include <pthread.h>
13298
13299 int
13300 main (void)
13301 {
13302
13303                 int rc = pthread_create(0,0,0,0);
13304                 int r2 = pthread_mutexattr_settype(0, 0);
13305
13306   ;
13307   return 0;
13308 }
13309 _ACEOF
13310 rm -f conftest.$ac_objext conftest$ac_exeext
13311 if { (eval echo "$as_me:13311: \"$ac_link\"") >&5
13312   (eval $ac_link) 2>&5
13313   ac_status=$?
13314   echo "$as_me:13314: \$? = $ac_status" >&5
13315   (exit $ac_status); } &&
13316          { ac_try='test -s conftest$ac_exeext'
13317   { (eval echo "$as_me:13317: \"$ac_try\"") >&5
13318   (eval $ac_try) 2>&5
13319   ac_status=$?
13320   echo "$as_me:13320: \$? = $ac_status" >&5
13321   (exit $ac_status); }; }; then
13322   with_pthread=yes
13323 else
13324   echo "$as_me: failed program was:" >&5
13325 cat conftest.$ac_ext >&5
13326 with_pthread=no
13327 fi
13328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13329             LIBS="$cf_save_LIBS"
13330             echo "$as_me:13330: result: $with_pthread" >&5
13331 echo "${ECHO_T}$with_pthread" >&6
13332             test "$with_pthread" = yes && break
13333         done
13334
13335         if test "$with_pthread" = yes ; then
13336
13337 cf_add_libs="-l$cf_lib_pthread"
13338 # Filter out duplicates - this happens with badly-designed ".pc" files...
13339 for cf_add_1lib in $LIBS
13340 do
13341         for cf_add_2lib in $cf_add_libs
13342         do
13343                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13344                 then
13345                         cf_add_1lib=
13346                         break
13347                 fi
13348         done
13349         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13350 done
13351 LIBS="$cf_add_libs"
13352
13353 cat >>confdefs.h <<\EOF
13354 #define HAVE_LIBPTHREADS 1
13355 EOF
13356
13357         else
13358             { { echo "$as_me:13358: error: Cannot link with pthread library" >&5
13359 echo "$as_me: error: Cannot link with pthread library" >&2;}
13360    { (exit 1); exit 1; }; }
13361         fi
13362
13363 fi
13364
13365 fi
13366
13367 echo "$as_me:13367: checking if you want to use weak-symbols for pthreads" >&5
13368 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
13369
13370 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
13371 if test "${enable_weak_symbols+set}" = set; then
13372   enableval="$enable_weak_symbols"
13373   use_weak_symbols=$withval
13374 else
13375   use_weak_symbols=no
13376 fi;
13377 echo "$as_me:13377: result: $use_weak_symbols" >&5
13378 echo "${ECHO_T}$use_weak_symbols" >&6
13379 if test "$use_weak_symbols" = yes ; then
13380
13381 echo "$as_me:13381: checking if $CC supports weak symbols" >&5
13382 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
13383 if test "${cf_cv_weak_symbols+set}" = set; then
13384   echo $ECHO_N "(cached) $ECHO_C" >&6
13385 else
13386
13387 cat >conftest.$ac_ext <<_ACEOF
13388 #line 13388 "configure"
13389 #include "confdefs.h"
13390
13391 #include <stdio.h>
13392 int
13393 main (void)
13394 {
13395
13396 #if defined(__GNUC__)
13397 #  if defined __USE_ISOC99
13398 #    define _cat_pragma(exp)    _Pragma(#exp)
13399 #    define _weak_pragma(exp)   _cat_pragma(weak name)
13400 #  else
13401 #    define _weak_pragma(exp)
13402 #  endif
13403 #  define _declare(name)        __extension__ extern __typeof__(name) name
13404 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
13405 #endif
13406
13407 weak_symbol(fopen);
13408
13409   ;
13410   return 0;
13411 }
13412 _ACEOF
13413 rm -f conftest.$ac_objext
13414 if { (eval echo "$as_me:13414: \"$ac_compile\"") >&5
13415   (eval $ac_compile) 2>&5
13416   ac_status=$?
13417   echo "$as_me:13417: \$? = $ac_status" >&5
13418   (exit $ac_status); } &&
13419          { ac_try='test -s conftest.$ac_objext'
13420   { (eval echo "$as_me:13420: \"$ac_try\"") >&5
13421   (eval $ac_try) 2>&5
13422   ac_status=$?
13423   echo "$as_me:13423: \$? = $ac_status" >&5
13424   (exit $ac_status); }; }; then
13425   cf_cv_weak_symbols=yes
13426 else
13427   echo "$as_me: failed program was:" >&5
13428 cat conftest.$ac_ext >&5
13429 cf_cv_weak_symbols=no
13430 fi
13431 rm -f conftest.$ac_objext conftest.$ac_ext
13432
13433 fi
13434 echo "$as_me:13434: result: $cf_cv_weak_symbols" >&5
13435 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
13436
13437 else
13438         cf_cv_weak_symbols=no
13439 fi
13440
13441 if test $cf_cv_weak_symbols = yes ; then
13442
13443 cat >>confdefs.h <<\EOF
13444 #define USE_WEAK_SYMBOLS 1
13445 EOF
13446
13447 fi
13448
13449 PTHREAD=
13450 if test "$with_pthread" = "yes" ; then
13451
13452 cat >>confdefs.h <<\EOF
13453 #define USE_PTHREADS 1
13454 EOF
13455
13456         enable_reentrant=yes
13457         if test $cf_cv_weak_symbols = yes ; then
13458                 PTHREAD=-lpthread
13459         fi
13460 fi
13461
13462 # OpenSUSE is installing ncurses6, using reentrant option.
13463 echo "$as_me:13463: checking for _nc_TABSIZE" >&5
13464 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
13465 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
13466   echo $ECHO_N "(cached) $ECHO_C" >&6
13467 else
13468   cat >conftest.$ac_ext <<_ACEOF
13469 #line 13469 "configure"
13470 #include "confdefs.h"
13471 /* System header to define __stub macros and hopefully few prototypes,
13472     which can conflict with char _nc_TABSIZE (); below.  */
13473 #include <assert.h>
13474 /* Override any gcc2 internal prototype to avoid an error.  */
13475 #ifdef __cplusplus
13476 extern "C"
13477 #endif
13478 /* We use char because int might match the return type of a gcc2
13479    builtin and then its argument prototype would still apply.  */
13480 char _nc_TABSIZE ();
13481 char (*f) ();
13482
13483 int
13484 main (void)
13485 {
13486 /* The GNU C library defines this for functions which it implements
13487     to always fail with ENOSYS.  Some functions are actually named
13488     something starting with __ and the normal name is an alias.  */
13489 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
13490 choke me
13491 #else
13492 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13493 #endif
13494
13495   ;
13496   return 0;
13497 }
13498 _ACEOF
13499 rm -f conftest.$ac_objext conftest$ac_exeext
13500 if { (eval echo "$as_me:13500: \"$ac_link\"") >&5
13501   (eval $ac_link) 2>&5
13502   ac_status=$?
13503   echo "$as_me:13503: \$? = $ac_status" >&5
13504   (exit $ac_status); } &&
13505          { ac_try='test -s conftest$ac_exeext'
13506   { (eval echo "$as_me:13506: \"$ac_try\"") >&5
13507   (eval $ac_try) 2>&5
13508   ac_status=$?
13509   echo "$as_me:13509: \$? = $ac_status" >&5
13510   (exit $ac_status); }; }; then
13511   ac_cv_func__nc_TABSIZE=yes
13512 else
13513   echo "$as_me: failed program was:" >&5
13514 cat conftest.$ac_ext >&5
13515 ac_cv_func__nc_TABSIZE=no
13516 fi
13517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13518 fi
13519 echo "$as_me:13519: result: $ac_cv_func__nc_TABSIZE" >&5
13520 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
13521 if test $ac_cv_func__nc_TABSIZE = yes; then
13522   assume_reentrant=yes
13523 else
13524   assume_reentrant=no
13525 fi
13526
13527 # Reentrant code has to be opaque; there's little advantage to making ncurses
13528 # opaque outside of that, so there is no --enable-opaque option.  We can use
13529 # this option without --with-pthreads, but this will be always set for
13530 # pthreads.
13531 echo "$as_me:13531: checking if you want experimental reentrant code" >&5
13532 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
13533
13534 # Check whether --enable-reentrant or --disable-reentrant was given.
13535 if test "${enable_reentrant+set}" = set; then
13536   enableval="$enable_reentrant"
13537   with_reentrant=$enableval
13538 else
13539   with_reentrant=$assume_reentrant
13540 fi;
13541 echo "$as_me:13541: result: $with_reentrant" >&5
13542 echo "${ECHO_T}$with_reentrant" >&6
13543 if test "$with_reentrant" = yes ; then
13544         cf_cv_enable_reentrant=1
13545         if test $cf_cv_weak_symbols = yes ; then
13546
13547 # remove pthread library from $LIBS
13548 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
13549
13550         elif test "$assume_reentrant" = no ; then
13551                 LIB_SUFFIX="t${LIB_SUFFIX}"
13552         fi
13553
13554 cat >>confdefs.h <<\EOF
13555 #define USE_REENTRANT 1
13556 EOF
13557
13558 else
13559         cf_cv_enable_reentrant=0
13560 fi
13561
13562 ### Allow using a different wrap-prefix
13563 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
13564         echo "$as_me:13564: checking for prefix used to wrap public variables" >&5
13565 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
13566
13567 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
13568 if test "${with_wrap_prefix+set}" = set; then
13569   withval="$with_wrap_prefix"
13570   NCURSES_WRAP_PREFIX=$withval
13571 else
13572   NCURSES_WRAP_PREFIX=_nc_
13573 fi;
13574         echo "$as_me:13574: result: $NCURSES_WRAP_PREFIX" >&5
13575 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
13576 else
13577         NCURSES_WRAP_PREFIX=_nc_
13578 fi
13579
13580 cat >>confdefs.h <<EOF
13581 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
13582 EOF
13583
13584 ###############################################################################
13585
13586 ###     use option --disable-echo to suppress full display compiling commands
13587
13588 echo "$as_me:13588: checking if you want to see long compiling messages" >&5
13589 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
13590
13591 # Check whether --enable-echo or --disable-echo was given.
13592 if test "${enable_echo+set}" = set; then
13593   enableval="$enable_echo"
13594   test "$enableval" != no && enableval=yes
13595         if test "$enableval" != "yes" ; then
13596
13597         ECHO_LT='--silent'
13598         ECHO_LD='@echo linking $@;'
13599         RULE_CC='@echo compiling $<'
13600         SHOW_CC='@echo compiling $@'
13601         ECHO_CC='@'
13602
13603         else
13604
13605         ECHO_LT=''
13606         ECHO_LD=''
13607         RULE_CC=''
13608         SHOW_CC=''
13609         ECHO_CC=''
13610
13611         fi
13612 else
13613   enableval=yes
13614
13615         ECHO_LT=''
13616         ECHO_LD=''
13617         RULE_CC=''
13618         SHOW_CC=''
13619         ECHO_CC=''
13620
13621 fi;
13622 echo "$as_me:13622: result: $enableval" >&5
13623 echo "${ECHO_T}$enableval" >&6
13624
13625 ###     use option --enable-warnings to turn on all gcc warnings
13626 echo "$as_me:13626: checking if you want to see compiler warnings" >&5
13627 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
13628
13629 # Check whether --enable-warnings or --disable-warnings was given.
13630 if test "${enable_warnings+set}" = set; then
13631   enableval="$enable_warnings"
13632   with_warnings=$enableval
13633 fi;
13634 echo "$as_me:13634: result: $with_warnings" >&5
13635 echo "${ECHO_T}$with_warnings" >&6
13636
13637 if test "x$with_warnings" = "xyes"; then
13638
13639         ADAFLAGS="$ADAFLAGS -gnatg"
13640
13641 INTEL_COMPILER=no
13642
13643 if test "$GCC" = yes ; then
13644         case $host_os in
13645         (linux*|gnu*)
13646                 echo "$as_me:13646: checking if this is really Intel C compiler" >&5
13647 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
13648                 cf_save_CFLAGS="$CFLAGS"
13649                 CFLAGS="$CFLAGS -no-gcc"
13650                 cat >conftest.$ac_ext <<_ACEOF
13651 #line 13651 "configure"
13652 #include "confdefs.h"
13653
13654 int
13655 main (void)
13656 {
13657
13658 #ifdef __INTEL_COMPILER
13659 #else
13660 make an error
13661 #endif
13662
13663   ;
13664   return 0;
13665 }
13666 _ACEOF
13667 rm -f conftest.$ac_objext
13668 if { (eval echo "$as_me:13668: \"$ac_compile\"") >&5
13669   (eval $ac_compile) 2>&5
13670   ac_status=$?
13671   echo "$as_me:13671: \$? = $ac_status" >&5
13672   (exit $ac_status); } &&
13673          { ac_try='test -s conftest.$ac_objext'
13674   { (eval echo "$as_me:13674: \"$ac_try\"") >&5
13675   (eval $ac_try) 2>&5
13676   ac_status=$?
13677   echo "$as_me:13677: \$? = $ac_status" >&5
13678   (exit $ac_status); }; }; then
13679   INTEL_COMPILER=yes
13680 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
13681
13682 else
13683   echo "$as_me: failed program was:" >&5
13684 cat conftest.$ac_ext >&5
13685 fi
13686 rm -f conftest.$ac_objext conftest.$ac_ext
13687                 CFLAGS="$cf_save_CFLAGS"
13688                 echo "$as_me:13688: result: $INTEL_COMPILER" >&5
13689 echo "${ECHO_T}$INTEL_COMPILER" >&6
13690                 ;;
13691         esac
13692 fi
13693
13694 CLANG_COMPILER=no
13695
13696 if test "$GCC" = yes ; then
13697         echo "$as_me:13697: checking if this is really Clang C compiler" >&5
13698 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
13699         cf_save_CFLAGS="$CFLAGS"
13700         CFLAGS="$CFLAGS -Qunused-arguments"
13701         cat >conftest.$ac_ext <<_ACEOF
13702 #line 13702 "configure"
13703 #include "confdefs.h"
13704
13705 int
13706 main (void)
13707 {
13708
13709 #ifdef __clang__
13710 #else
13711 make an error
13712 #endif
13713
13714   ;
13715   return 0;
13716 }
13717 _ACEOF
13718 rm -f conftest.$ac_objext
13719 if { (eval echo "$as_me:13719: \"$ac_compile\"") >&5
13720   (eval $ac_compile) 2>&5
13721   ac_status=$?
13722   echo "$as_me:13722: \$? = $ac_status" >&5
13723   (exit $ac_status); } &&
13724          { ac_try='test -s conftest.$ac_objext'
13725   { (eval echo "$as_me:13725: \"$ac_try\"") >&5
13726   (eval $ac_try) 2>&5
13727   ac_status=$?
13728   echo "$as_me:13728: \$? = $ac_status" >&5
13729   (exit $ac_status); }; }; then
13730   CLANG_COMPILER=yes
13731 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
13732
13733 else
13734   echo "$as_me: failed program was:" >&5
13735 cat conftest.$ac_ext >&5
13736 fi
13737 rm -f conftest.$ac_objext conftest.$ac_ext
13738         CFLAGS="$cf_save_CFLAGS"
13739         echo "$as_me:13739: result: $CLANG_COMPILER" >&5
13740 echo "${ECHO_T}$CLANG_COMPILER" >&6
13741 fi
13742
13743 cat > conftest.$ac_ext <<EOF
13744 #line 13744 "${as_me:-configure}"
13745 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
13746 EOF
13747
13748 if test "$INTEL_COMPILER" = yes
13749 then
13750 # The "-wdXXX" options suppress warnings:
13751 # remark #1419: external declaration in primary source file
13752 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
13753 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
13754 # remark #193: zero used for undefined preprocessing identifier
13755 # remark #593: variable "curs_sb_left_arrow" was set but never used
13756 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
13757 # remark #869: parameter "tw" was never referenced
13758 # remark #981: operands are evaluated in unspecified order
13759 # warning #279: controlling expression is constant
13760
13761         { echo "$as_me:13761: checking for $CC warning options..." >&5
13762 echo "$as_me: checking for $CC warning options..." >&6;}
13763         cf_save_CFLAGS="$CFLAGS"
13764         EXTRA_CFLAGS="-Wall"
13765         for cf_opt in \
13766                 wd1419 \
13767                 wd1683 \
13768                 wd1684 \
13769                 wd193 \
13770                 wd593 \
13771                 wd279 \
13772                 wd810 \
13773                 wd869 \
13774                 wd981
13775         do
13776                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13777                 if { (eval echo "$as_me:13777: \"$ac_compile\"") >&5
13778   (eval $ac_compile) 2>&5
13779   ac_status=$?
13780   echo "$as_me:13780: \$? = $ac_status" >&5
13781   (exit $ac_status); }; then
13782                         test -n "$verbose" && echo "$as_me:13782: result: ... -$cf_opt" >&5
13783 echo "${ECHO_T}... -$cf_opt" >&6
13784                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13785                 fi
13786         done
13787         CFLAGS="$cf_save_CFLAGS"
13788
13789 elif test "$GCC" = yes
13790 then
13791         { echo "$as_me:13791: checking for $CC warning options..." >&5
13792 echo "$as_me: checking for $CC warning options..." >&6;}
13793         cf_save_CFLAGS="$CFLAGS"
13794         EXTRA_CFLAGS=
13795         cf_warn_CONST=""
13796         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
13797         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
13798         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
13799         for cf_opt in W Wall \
13800                 Wbad-function-cast \
13801                 Wcast-align \
13802                 Wcast-qual \
13803                 Wdeclaration-after-statement \
13804                 Wextra \
13805                 Winline \
13806                 Wmissing-declarations \
13807                 Wmissing-prototypes \
13808                 Wnested-externs \
13809                 Wpointer-arith \
13810                 Wshadow \
13811                 Wstrict-prototypes \
13812                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
13813         do
13814                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
13815                 if { (eval echo "$as_me:13815: \"$ac_compile\"") >&5
13816   (eval $ac_compile) 2>&5
13817   ac_status=$?
13818   echo "$as_me:13818: \$? = $ac_status" >&5
13819   (exit $ac_status); }; then
13820                         test -n "$verbose" && echo "$as_me:13820: result: ... -$cf_opt" >&5
13821 echo "${ECHO_T}... -$cf_opt" >&6
13822                         case $cf_opt in
13823                         (Wcast-qual)
13824
13825         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13826         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
13827
13828                                 ;;
13829                         (Winline)
13830                                 case $GCC_VERSION in
13831                                 ([34].*)
13832                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13833
13834 echo "${as_me:-configure}:13834: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13835
13836                                         continue;;
13837                                 esac
13838                                 ;;
13839                         (Wpointer-arith)
13840                                 case $GCC_VERSION in
13841                                 ([12].*)
13842                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
13843
13844 echo "${as_me:-configure}:13844: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
13845
13846                                         continue;;
13847                                 esac
13848                                 ;;
13849                         esac
13850                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
13851                 fi
13852         done
13853         CFLAGS="$cf_save_CFLAGS"
13854 fi
13855 rm -rf conftest*
13856
13857 fi
13858
13859 if test "$GCC" = yes
13860 then
13861 cat > conftest.i <<EOF
13862 #ifndef GCC_PRINTF
13863 #define GCC_PRINTF 0
13864 #endif
13865 #ifndef GCC_SCANF
13866 #define GCC_SCANF 0
13867 #endif
13868 #ifndef GCC_NORETURN
13869 #define GCC_NORETURN /* nothing */
13870 #endif
13871 #ifndef GCC_UNUSED
13872 #define GCC_UNUSED /* nothing */
13873 #endif
13874 EOF
13875 if test "$GCC" = yes
13876 then
13877         { echo "$as_me:13877: checking for $CC __attribute__ directives..." >&5
13878 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
13879 cat > conftest.$ac_ext <<EOF
13880 #line 13880 "${as_me:-configure}"
13881 #include "confdefs.h"
13882 #include "conftest.h"
13883 #include "conftest.i"
13884 #if     GCC_PRINTF
13885 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
13886 #else
13887 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
13888 #endif
13889 #if     GCC_SCANF
13890 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
13891 #else
13892 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
13893 #endif
13894 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
13895 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
13896 extern void foo(void) GCC_NORETURN;
13897 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
13898 EOF
13899         cf_printf_attribute=no
13900         cf_scanf_attribute=no
13901         for cf_attribute in scanf printf unused noreturn
13902         do
13903
13904 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13905
13906                 cf_directive="__attribute__(($cf_attribute))"
13907                 echo "checking for $CC $cf_directive" 1>&5
13908
13909                 case $cf_attribute in
13910                 (printf)
13911                         cf_printf_attribute=yes
13912                         cat >conftest.h <<EOF
13913 #define GCC_$cf_ATTRIBUTE 1
13914 EOF
13915                         ;;
13916                 (scanf)
13917                         cf_scanf_attribute=yes
13918                         cat >conftest.h <<EOF
13919 #define GCC_$cf_ATTRIBUTE 1
13920 EOF
13921                         ;;
13922                 (*)
13923                         cat >conftest.h <<EOF
13924 #define GCC_$cf_ATTRIBUTE $cf_directive
13925 EOF
13926                         ;;
13927                 esac
13928
13929                 if { (eval echo "$as_me:13929: \"$ac_compile\"") >&5
13930   (eval $ac_compile) 2>&5
13931   ac_status=$?
13932   echo "$as_me:13932: \$? = $ac_status" >&5
13933   (exit $ac_status); }; then
13934                         test -n "$verbose" && echo "$as_me:13934: result: ... $cf_attribute" >&5
13935 echo "${ECHO_T}... $cf_attribute" >&6
13936                         cat conftest.h >>confdefs.h
13937                         case $cf_attribute in
13938                         (noreturn)
13939
13940 cat >>confdefs.h <<EOF
13941 #define GCC_NORETURN $cf_directive
13942 EOF
13943
13944                                 ;;
13945                         (printf)
13946                                 cf_value='/* nothing */'
13947                                 if test "$cf_printf_attribute" != no ; then
13948                                         cf_value='__attribute__((format(printf,fmt,var)))'
13949
13950 cat >>confdefs.h <<\EOF
13951 #define GCC_PRINTF 1
13952 EOF
13953
13954                                 fi
13955
13956 cat >>confdefs.h <<EOF
13957 #define GCC_PRINTFLIKE(fmt,var) $cf_value
13958 EOF
13959
13960                                 ;;
13961                         (scanf)
13962                                 cf_value='/* nothing */'
13963                                 if test "$cf_scanf_attribute" != no ; then
13964                                         cf_value='__attribute__((format(scanf,fmt,var)))'
13965
13966 cat >>confdefs.h <<\EOF
13967 #define GCC_SCANF 1
13968 EOF
13969
13970                                 fi
13971
13972 cat >>confdefs.h <<EOF
13973 #define GCC_SCANFLIKE(fmt,var) $cf_value
13974 EOF
13975
13976                                 ;;
13977                         (unused)
13978
13979 cat >>confdefs.h <<EOF
13980 #define GCC_UNUSED $cf_directive
13981 EOF
13982
13983                                 ;;
13984                         esac
13985                 fi
13986         done
13987 else
13988         fgrep define conftest.i >>confdefs.h
13989 fi
13990 rm -rf conftest*
13991 fi
13992
13993 ###     use option --enable-assertions to turn on generation of assertion code
13994 echo "$as_me:13994: checking if you want to enable runtime assertions" >&5
13995 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
13996
13997 # Check whether --enable-assertions or --disable-assertions was given.
13998 if test "${enable_assertions+set}" = set; then
13999   enableval="$enable_assertions"
14000   with_assertions=$enableval
14001 else
14002   with_assertions=no
14003 fi;
14004 echo "$as_me:14004: result: $with_assertions" >&5
14005 echo "${ECHO_T}$with_assertions" >&6
14006 if test -n "$GCC"
14007 then
14008         if test "$with_assertions" = no
14009         then
14010                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
14011         else
14012
14013         ADAFLAGS="$ADAFLAGS -gnata"
14014
14015         fi
14016 fi
14017
14018 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
14019
14020 cat >>confdefs.h <<\EOF
14021 #define HAVE_NC_ALLOC_H 1
14022 EOF
14023
14024 ###     use option --enable-expanded to generate certain macros as functions
14025
14026 # Check whether --enable-expanded or --disable-expanded was given.
14027 if test "${enable_expanded+set}" = set; then
14028   enableval="$enable_expanded"
14029   test "$enableval" = yes &&
14030 cat >>confdefs.h <<\EOF
14031 #define NCURSES_EXPANDED 1
14032 EOF
14033
14034 fi;
14035
14036 ###     use option --disable-macros to suppress macros in favor of functions
14037
14038 # Check whether --enable-macros or --disable-macros was given.
14039 if test "${enable_macros+set}" = set; then
14040   enableval="$enable_macros"
14041   test "$enableval" = no &&
14042 cat >>confdefs.h <<\EOF
14043 #define NCURSES_NOMACROS 1
14044 EOF
14045
14046 fi;
14047
14048 # Normally we only add trace() to the debug-library.  Allow this to be
14049 # extended to all models of the ncurses library:
14050 cf_all_traces=no
14051 case "$CFLAGS $CPPFLAGS" in
14052 (*-DTRACE*)
14053         cf_all_traces=yes
14054         ;;
14055 esac
14056
14057 echo "$as_me:14057: checking whether to add trace feature to all models" >&5
14058 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
14059
14060 # Check whether --with-trace or --without-trace was given.
14061 if test "${with_trace+set}" = set; then
14062   withval="$with_trace"
14063   cf_with_trace=$withval
14064 else
14065   cf_with_trace=$cf_all_traces
14066 fi;
14067 echo "$as_me:14067: result: $cf_with_trace" >&5
14068 echo "${ECHO_T}$cf_with_trace" >&6
14069
14070 if test "$cf_with_trace" = yes ; then
14071         ADA_TRACE=TRUE
14072
14073 cf_fix_cppflags=no
14074 cf_new_cflags=
14075 cf_new_cppflags=
14076 cf_new_extra_cppflags=
14077
14078 for cf_add_cflags in -DTRACE
14079 do
14080 case $cf_fix_cppflags in
14081 (no)
14082         case $cf_add_cflags in
14083         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14084                 case $cf_add_cflags in
14085                 (-D*)
14086                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14087
14088                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14089                                 && test -z "${cf_tst_cflags}" \
14090                                 && cf_fix_cppflags=yes
14091
14092                         if test $cf_fix_cppflags = yes ; then
14093
14094         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14095         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14096
14097                                 continue
14098                         elif test "${cf_tst_cflags}" = "\"'" ; then
14099
14100         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14101         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14102
14103                                 continue
14104                         fi
14105                         ;;
14106                 esac
14107                 case "$CPPFLAGS" in
14108                 (*$cf_add_cflags)
14109                         ;;
14110                 (*)
14111                         case $cf_add_cflags in
14112                         (-D*)
14113                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14114
14115 CPPFLAGS=`echo "$CPPFLAGS" | \
14116         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14117                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14118
14119                                 ;;
14120                         esac
14121
14122         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14123         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14124
14125                         ;;
14126                 esac
14127                 ;;
14128         (*)
14129
14130         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14131         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14132
14133                 ;;
14134         esac
14135         ;;
14136 (yes)
14137
14138         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14139         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14140
14141         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14142
14143         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14144                 && test -z "${cf_tst_cflags}" \
14145                 && cf_fix_cppflags=no
14146         ;;
14147 esac
14148 done
14149
14150 if test -n "$cf_new_cflags" ; then
14151
14152         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14153         CFLAGS="${CFLAGS}$cf_new_cflags"
14154
14155 fi
14156
14157 if test -n "$cf_new_cppflags" ; then
14158
14159         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14160         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14161
14162 fi
14163
14164 if test -n "$cf_new_extra_cppflags" ; then
14165
14166         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14167         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14168
14169 fi
14170
14171 else
14172         ADA_TRACE=FALSE
14173 fi
14174
14175 echo "$as_me:14175: checking if we want to use GNAT projects" >&5
14176 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
14177
14178 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
14179 if test "${enable_gnat_projects+set}" = set; then
14180   enableval="$enable_gnat_projects"
14181   test "$enableval" != no && enableval=yes
14182         if test "$enableval" != "yes" ; then
14183     enable_gnat_projects=no
14184         else
14185                 enable_gnat_projects=yes
14186         fi
14187 else
14188   enableval=yes
14189         enable_gnat_projects=yes
14190
14191 fi;
14192 echo "$as_me:14192: result: $enable_gnat_projects" >&5
14193 echo "${ECHO_T}$enable_gnat_projects" >&6
14194
14195 ###     Checks for libraries.
14196 case $cf_cv_system_name in
14197 (*mingw32*)
14198         ;;
14199 (*)
14200 echo "$as_me:14200: checking for gettimeofday" >&5
14201 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
14202 if test "${ac_cv_func_gettimeofday+set}" = set; then
14203   echo $ECHO_N "(cached) $ECHO_C" >&6
14204 else
14205   cat >conftest.$ac_ext <<_ACEOF
14206 #line 14206 "configure"
14207 #include "confdefs.h"
14208 /* System header to define __stub macros and hopefully few prototypes,
14209     which can conflict with char gettimeofday (); below.  */
14210 #include <assert.h>
14211 /* Override any gcc2 internal prototype to avoid an error.  */
14212 #ifdef __cplusplus
14213 extern "C"
14214 #endif
14215 /* We use char because int might match the return type of a gcc2
14216    builtin and then its argument prototype would still apply.  */
14217 char gettimeofday ();
14218 char (*f) ();
14219
14220 int
14221 main (void)
14222 {
14223 /* The GNU C library defines this for functions which it implements
14224     to always fail with ENOSYS.  Some functions are actually named
14225     something starting with __ and the normal name is an alias.  */
14226 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
14227 choke me
14228 #else
14229 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14230 #endif
14231
14232   ;
14233   return 0;
14234 }
14235 _ACEOF
14236 rm -f conftest.$ac_objext conftest$ac_exeext
14237 if { (eval echo "$as_me:14237: \"$ac_link\"") >&5
14238   (eval $ac_link) 2>&5
14239   ac_status=$?
14240   echo "$as_me:14240: \$? = $ac_status" >&5
14241   (exit $ac_status); } &&
14242          { ac_try='test -s conftest$ac_exeext'
14243   { (eval echo "$as_me:14243: \"$ac_try\"") >&5
14244   (eval $ac_try) 2>&5
14245   ac_status=$?
14246   echo "$as_me:14246: \$? = $ac_status" >&5
14247   (exit $ac_status); }; }; then
14248   ac_cv_func_gettimeofday=yes
14249 else
14250   echo "$as_me: failed program was:" >&5
14251 cat conftest.$ac_ext >&5
14252 ac_cv_func_gettimeofday=no
14253 fi
14254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14255 fi
14256 echo "$as_me:14256: result: $ac_cv_func_gettimeofday" >&5
14257 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
14258 if test $ac_cv_func_gettimeofday = yes; then
14259   cat >>confdefs.h <<\EOF
14260 #define HAVE_GETTIMEOFDAY 1
14261 EOF
14262
14263 else
14264
14265 echo "$as_me:14265: checking for gettimeofday in -lbsd" >&5
14266 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
14267 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
14268   echo $ECHO_N "(cached) $ECHO_C" >&6
14269 else
14270   ac_check_lib_save_LIBS=$LIBS
14271 LIBS="-lbsd  $LIBS"
14272 cat >conftest.$ac_ext <<_ACEOF
14273 #line 14273 "configure"
14274 #include "confdefs.h"
14275
14276 /* Override any gcc2 internal prototype to avoid an error.  */
14277 #ifdef __cplusplus
14278 extern "C"
14279 #endif
14280 /* We use char because int might match the return type of a gcc2
14281    builtin and then its argument prototype would still apply.  */
14282 char gettimeofday ();
14283 int
14284 main (void)
14285 {
14286 gettimeofday ();
14287   ;
14288   return 0;
14289 }
14290 _ACEOF
14291 rm -f conftest.$ac_objext conftest$ac_exeext
14292 if { (eval echo "$as_me:14292: \"$ac_link\"") >&5
14293   (eval $ac_link) 2>&5
14294   ac_status=$?
14295   echo "$as_me:14295: \$? = $ac_status" >&5
14296   (exit $ac_status); } &&
14297          { ac_try='test -s conftest$ac_exeext'
14298   { (eval echo "$as_me:14298: \"$ac_try\"") >&5
14299   (eval $ac_try) 2>&5
14300   ac_status=$?
14301   echo "$as_me:14301: \$? = $ac_status" >&5
14302   (exit $ac_status); }; }; then
14303   ac_cv_lib_bsd_gettimeofday=yes
14304 else
14305   echo "$as_me: failed program was:" >&5
14306 cat conftest.$ac_ext >&5
14307 ac_cv_lib_bsd_gettimeofday=no
14308 fi
14309 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14310 LIBS=$ac_check_lib_save_LIBS
14311 fi
14312 echo "$as_me:14312: result: $ac_cv_lib_bsd_gettimeofday" >&5
14313 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
14314 if test $ac_cv_lib_bsd_gettimeofday = yes; then
14315
14316 cat >>confdefs.h <<\EOF
14317 #define HAVE_GETTIMEOFDAY 1
14318 EOF
14319
14320         LIBS="$LIBS -lbsd"
14321 fi
14322
14323 fi
14324         ;;
14325 esac
14326
14327 ###     Checks for header files.
14328 echo "$as_me:14328: checking for ANSI C header files" >&5
14329 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14330 if test "${ac_cv_header_stdc+set}" = set; then
14331   echo $ECHO_N "(cached) $ECHO_C" >&6
14332 else
14333   cat >conftest.$ac_ext <<_ACEOF
14334 #line 14334 "configure"
14335 #include "confdefs.h"
14336 #include <stdlib.h>
14337 #include <stdarg.h>
14338 #include <string.h>
14339 #include <float.h>
14340
14341 _ACEOF
14342 if { (eval echo "$as_me:14342: \"$ac_cpp conftest.$ac_ext\"") >&5
14343   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14344   ac_status=$?
14345   egrep -v '^ *\+' conftest.er1 >conftest.err
14346   rm -f conftest.er1
14347   cat conftest.err >&5
14348   echo "$as_me:14348: \$? = $ac_status" >&5
14349   (exit $ac_status); } >/dev/null; then
14350   if test -s conftest.err; then
14351     ac_cpp_err=$ac_c_preproc_warn_flag
14352   else
14353     ac_cpp_err=
14354   fi
14355 else
14356   ac_cpp_err=yes
14357 fi
14358 if test -z "$ac_cpp_err"; then
14359   ac_cv_header_stdc=yes
14360 else
14361   echo "$as_me: failed program was:" >&5
14362   cat conftest.$ac_ext >&5
14363   ac_cv_header_stdc=no
14364 fi
14365 rm -f conftest.err conftest.$ac_ext
14366
14367 if test $ac_cv_header_stdc = yes; then
14368   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14369   cat >conftest.$ac_ext <<_ACEOF
14370 #line 14370 "configure"
14371 #include "confdefs.h"
14372 #include <string.h>
14373
14374 _ACEOF
14375 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14376   egrep "memchr" >/dev/null 2>&1; then
14377   :
14378 else
14379   ac_cv_header_stdc=no
14380 fi
14381 rm -rf conftest*
14382
14383 fi
14384
14385 if test $ac_cv_header_stdc = yes; then
14386   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14387   cat >conftest.$ac_ext <<_ACEOF
14388 #line 14388 "configure"
14389 #include "confdefs.h"
14390 #include <stdlib.h>
14391
14392 _ACEOF
14393 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14394   egrep "free" >/dev/null 2>&1; then
14395   :
14396 else
14397   ac_cv_header_stdc=no
14398 fi
14399 rm -rf conftest*
14400
14401 fi
14402
14403 if test $ac_cv_header_stdc = yes; then
14404   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14405   if test "$cross_compiling" = yes; then
14406   :
14407 else
14408   cat >conftest.$ac_ext <<_ACEOF
14409 #line 14409 "configure"
14410 #include "confdefs.h"
14411 #include <ctype.h>
14412 #if ((' ' & 0x0FF) == 0x020)
14413 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14414 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14415 #else
14416 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14417                      || ('j' <= (c) && (c) <= 'r') \
14418                      || ('s' <= (c) && (c) <= 'z'))
14419 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14420 #endif
14421
14422 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14423 int
14424 main (void)
14425 {
14426   int i;
14427   for (i = 0; i < 256; i++)
14428     if (XOR (islower (i), ISLOWER (i))
14429         || toupper (i) != TOUPPER (i))
14430       $ac_main_return(2);
14431   $ac_main_return (0);
14432 }
14433 _ACEOF
14434 rm -f conftest$ac_exeext
14435 if { (eval echo "$as_me:14435: \"$ac_link\"") >&5
14436   (eval $ac_link) 2>&5
14437   ac_status=$?
14438   echo "$as_me:14438: \$? = $ac_status" >&5
14439   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14440   { (eval echo "$as_me:14440: \"$ac_try\"") >&5
14441   (eval $ac_try) 2>&5
14442   ac_status=$?
14443   echo "$as_me:14443: \$? = $ac_status" >&5
14444   (exit $ac_status); }; }; then
14445   :
14446 else
14447   echo "$as_me: program exited with status $ac_status" >&5
14448 echo "$as_me: failed program was:" >&5
14449 cat conftest.$ac_ext >&5
14450 ac_cv_header_stdc=no
14451 fi
14452 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14453 fi
14454 fi
14455 fi
14456 echo "$as_me:14456: result: $ac_cv_header_stdc" >&5
14457 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14458 if test $ac_cv_header_stdc = yes; then
14459
14460 cat >>confdefs.h <<\EOF
14461 #define STDC_HEADERS 1
14462 EOF
14463
14464 fi
14465
14466 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
14467
14468 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
14469                   inttypes.h stdint.h unistd.h
14470 do
14471 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14472 echo "$as_me:14472: checking for $ac_header" >&5
14473 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14474 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14475   echo $ECHO_N "(cached) $ECHO_C" >&6
14476 else
14477   cat >conftest.$ac_ext <<_ACEOF
14478 #line 14478 "configure"
14479 #include "confdefs.h"
14480 $ac_includes_default
14481 #include <$ac_header>
14482 _ACEOF
14483 rm -f conftest.$ac_objext
14484 if { (eval echo "$as_me:14484: \"$ac_compile\"") >&5
14485   (eval $ac_compile) 2>&5
14486   ac_status=$?
14487   echo "$as_me:14487: \$? = $ac_status" >&5
14488   (exit $ac_status); } &&
14489          { ac_try='test -s conftest.$ac_objext'
14490   { (eval echo "$as_me:14490: \"$ac_try\"") >&5
14491   (eval $ac_try) 2>&5
14492   ac_status=$?
14493   echo "$as_me:14493: \$? = $ac_status" >&5
14494   (exit $ac_status); }; }; then
14495   eval "$as_ac_Header=yes"
14496 else
14497   echo "$as_me: failed program was:" >&5
14498 cat conftest.$ac_ext >&5
14499 eval "$as_ac_Header=no"
14500 fi
14501 rm -f conftest.$ac_objext conftest.$ac_ext
14502 fi
14503 echo "$as_me:14503: result: `eval echo '${'$as_ac_Header'}'`" >&5
14504 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14505 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14506   cat >>confdefs.h <<EOF
14507 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14508 EOF
14509
14510 fi
14511 done
14512
14513 echo "$as_me:14513: checking for signed char" >&5
14514 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
14515 if test "${ac_cv_type_signed_char+set}" = set; then
14516   echo $ECHO_N "(cached) $ECHO_C" >&6
14517 else
14518   cat >conftest.$ac_ext <<_ACEOF
14519 #line 14519 "configure"
14520 #include "confdefs.h"
14521 $ac_includes_default
14522 int
14523 main (void)
14524 {
14525 if ((signed char *) 0)
14526   return 0;
14527 if (sizeof (signed char))
14528   return 0;
14529   ;
14530   return 0;
14531 }
14532 _ACEOF
14533 rm -f conftest.$ac_objext
14534 if { (eval echo "$as_me:14534: \"$ac_compile\"") >&5
14535   (eval $ac_compile) 2>&5
14536   ac_status=$?
14537   echo "$as_me:14537: \$? = $ac_status" >&5
14538   (exit $ac_status); } &&
14539          { ac_try='test -s conftest.$ac_objext'
14540   { (eval echo "$as_me:14540: \"$ac_try\"") >&5
14541   (eval $ac_try) 2>&5
14542   ac_status=$?
14543   echo "$as_me:14543: \$? = $ac_status" >&5
14544   (exit $ac_status); }; }; then
14545   ac_cv_type_signed_char=yes
14546 else
14547   echo "$as_me: failed program was:" >&5
14548 cat conftest.$ac_ext >&5
14549 ac_cv_type_signed_char=no
14550 fi
14551 rm -f conftest.$ac_objext conftest.$ac_ext
14552 fi
14553 echo "$as_me:14553: result: $ac_cv_type_signed_char" >&5
14554 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
14555
14556 echo "$as_me:14556: checking size of signed char" >&5
14557 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
14558 if test "${ac_cv_sizeof_signed_char+set}" = set; then
14559   echo $ECHO_N "(cached) $ECHO_C" >&6
14560 else
14561   if test "$ac_cv_type_signed_char" = yes; then
14562   if test "$cross_compiling" = yes; then
14563   # Depending upon the size, compute the lo and hi bounds.
14564 cat >conftest.$ac_ext <<_ACEOF
14565 #line 14565 "configure"
14566 #include "confdefs.h"
14567 $ac_includes_default
14568 int
14569 main (void)
14570 {
14571 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
14572   ;
14573   return 0;
14574 }
14575 _ACEOF
14576 rm -f conftest.$ac_objext
14577 if { (eval echo "$as_me:14577: \"$ac_compile\"") >&5
14578   (eval $ac_compile) 2>&5
14579   ac_status=$?
14580   echo "$as_me:14580: \$? = $ac_status" >&5
14581   (exit $ac_status); } &&
14582          { ac_try='test -s conftest.$ac_objext'
14583   { (eval echo "$as_me:14583: \"$ac_try\"") >&5
14584   (eval $ac_try) 2>&5
14585   ac_status=$?
14586   echo "$as_me:14586: \$? = $ac_status" >&5
14587   (exit $ac_status); }; }; then
14588   ac_lo=0 ac_mid=0
14589   while :; do
14590     cat >conftest.$ac_ext <<_ACEOF
14591 #line 14591 "configure"
14592 #include "confdefs.h"
14593 $ac_includes_default
14594 int
14595 main (void)
14596 {
14597 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14598   ;
14599   return 0;
14600 }
14601 _ACEOF
14602 rm -f conftest.$ac_objext
14603 if { (eval echo "$as_me:14603: \"$ac_compile\"") >&5
14604   (eval $ac_compile) 2>&5
14605   ac_status=$?
14606   echo "$as_me:14606: \$? = $ac_status" >&5
14607   (exit $ac_status); } &&
14608          { ac_try='test -s conftest.$ac_objext'
14609   { (eval echo "$as_me:14609: \"$ac_try\"") >&5
14610   (eval $ac_try) 2>&5
14611   ac_status=$?
14612   echo "$as_me:14612: \$? = $ac_status" >&5
14613   (exit $ac_status); }; }; then
14614   ac_hi=$ac_mid; break
14615 else
14616   echo "$as_me: failed program was:" >&5
14617 cat conftest.$ac_ext >&5
14618 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
14619 fi
14620 rm -f conftest.$ac_objext conftest.$ac_ext
14621   done
14622 else
14623   echo "$as_me: failed program was:" >&5
14624 cat conftest.$ac_ext >&5
14625 ac_hi=-1 ac_mid=-1
14626   while :; do
14627     cat >conftest.$ac_ext <<_ACEOF
14628 #line 14628 "configure"
14629 #include "confdefs.h"
14630 $ac_includes_default
14631 int
14632 main (void)
14633 {
14634 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
14635   ;
14636   return 0;
14637 }
14638 _ACEOF
14639 rm -f conftest.$ac_objext
14640 if { (eval echo "$as_me:14640: \"$ac_compile\"") >&5
14641   (eval $ac_compile) 2>&5
14642   ac_status=$?
14643   echo "$as_me:14643: \$? = $ac_status" >&5
14644   (exit $ac_status); } &&
14645          { ac_try='test -s conftest.$ac_objext'
14646   { (eval echo "$as_me:14646: \"$ac_try\"") >&5
14647   (eval $ac_try) 2>&5
14648   ac_status=$?
14649   echo "$as_me:14649: \$? = $ac_status" >&5
14650   (exit $ac_status); }; }; then
14651   ac_lo=$ac_mid; break
14652 else
14653   echo "$as_me: failed program was:" >&5
14654 cat conftest.$ac_ext >&5
14655 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
14656 fi
14657 rm -f conftest.$ac_objext conftest.$ac_ext
14658   done
14659 fi
14660 rm -f conftest.$ac_objext conftest.$ac_ext
14661 # Binary search between lo and hi bounds.
14662 while test "x$ac_lo" != "x$ac_hi"; do
14663   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
14664   cat >conftest.$ac_ext <<_ACEOF
14665 #line 14665 "configure"
14666 #include "confdefs.h"
14667 $ac_includes_default
14668 int
14669 main (void)
14670 {
14671 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
14672   ;
14673   return 0;
14674 }
14675 _ACEOF
14676 rm -f conftest.$ac_objext
14677 if { (eval echo "$as_me:14677: \"$ac_compile\"") >&5
14678   (eval $ac_compile) 2>&5
14679   ac_status=$?
14680   echo "$as_me:14680: \$? = $ac_status" >&5
14681   (exit $ac_status); } &&
14682          { ac_try='test -s conftest.$ac_objext'
14683   { (eval echo "$as_me:14683: \"$ac_try\"") >&5
14684   (eval $ac_try) 2>&5
14685   ac_status=$?
14686   echo "$as_me:14686: \$? = $ac_status" >&5
14687   (exit $ac_status); }; }; then
14688   ac_hi=$ac_mid
14689 else
14690   echo "$as_me: failed program was:" >&5
14691 cat conftest.$ac_ext >&5
14692 ac_lo=`expr $ac_mid + 1`
14693 fi
14694 rm -f conftest.$ac_objext conftest.$ac_ext
14695 done
14696 ac_cv_sizeof_signed_char=$ac_lo
14697 else
14698   if test "$cross_compiling" = yes; then
14699   { { echo "$as_me:14699: error: cannot run test program while cross compiling" >&5
14700 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14701    { (exit 1); exit 1; }; }
14702 else
14703   cat >conftest.$ac_ext <<_ACEOF
14704 #line 14704 "configure"
14705 #include "confdefs.h"
14706 $ac_includes_default
14707 int
14708 main (void)
14709 {
14710 FILE *f = fopen ("conftest.val", "w");
14711 if (!f)
14712   $ac_main_return (1);
14713 fprintf (f, "%d", (sizeof (signed char)));
14714 fclose (f);
14715   ;
14716   return 0;
14717 }
14718 _ACEOF
14719 rm -f conftest$ac_exeext
14720 if { (eval echo "$as_me:14720: \"$ac_link\"") >&5
14721   (eval $ac_link) 2>&5
14722   ac_status=$?
14723   echo "$as_me:14723: \$? = $ac_status" >&5
14724   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14725   { (eval echo "$as_me:14725: \"$ac_try\"") >&5
14726   (eval $ac_try) 2>&5
14727   ac_status=$?
14728   echo "$as_me:14728: \$? = $ac_status" >&5
14729   (exit $ac_status); }; }; then
14730   ac_cv_sizeof_signed_char=`cat conftest.val`
14731 else
14732   echo "$as_me: program exited with status $ac_status" >&5
14733 echo "$as_me: failed program was:" >&5
14734 cat conftest.$ac_ext >&5
14735 fi
14736 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14737 fi
14738 fi
14739 rm -f conftest.val
14740 else
14741   ac_cv_sizeof_signed_char=0
14742 fi
14743 fi
14744 echo "$as_me:14744: result: $ac_cv_sizeof_signed_char" >&5
14745 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
14746 cat >>confdefs.h <<EOF
14747 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
14748 EOF
14749
14750 echo "$as_me:14750: checking for ANSI C header files" >&5
14751 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14752 if test "${ac_cv_header_stdc+set}" = set; then
14753   echo $ECHO_N "(cached) $ECHO_C" >&6
14754 else
14755   cat >conftest.$ac_ext <<_ACEOF
14756 #line 14756 "configure"
14757 #include "confdefs.h"
14758 #include <stdlib.h>
14759 #include <stdarg.h>
14760 #include <string.h>
14761 #include <float.h>
14762
14763 _ACEOF
14764 if { (eval echo "$as_me:14764: \"$ac_cpp conftest.$ac_ext\"") >&5
14765   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14766   ac_status=$?
14767   egrep -v '^ *\+' conftest.er1 >conftest.err
14768   rm -f conftest.er1
14769   cat conftest.err >&5
14770   echo "$as_me:14770: \$? = $ac_status" >&5
14771   (exit $ac_status); } >/dev/null; then
14772   if test -s conftest.err; then
14773     ac_cpp_err=$ac_c_preproc_warn_flag
14774   else
14775     ac_cpp_err=
14776   fi
14777 else
14778   ac_cpp_err=yes
14779 fi
14780 if test -z "$ac_cpp_err"; then
14781   ac_cv_header_stdc=yes
14782 else
14783   echo "$as_me: failed program was:" >&5
14784   cat conftest.$ac_ext >&5
14785   ac_cv_header_stdc=no
14786 fi
14787 rm -f conftest.err conftest.$ac_ext
14788
14789 if test $ac_cv_header_stdc = yes; then
14790   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14791   cat >conftest.$ac_ext <<_ACEOF
14792 #line 14792 "configure"
14793 #include "confdefs.h"
14794 #include <string.h>
14795
14796 _ACEOF
14797 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14798   egrep "memchr" >/dev/null 2>&1; then
14799   :
14800 else
14801   ac_cv_header_stdc=no
14802 fi
14803 rm -rf conftest*
14804
14805 fi
14806
14807 if test $ac_cv_header_stdc = yes; then
14808   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14809   cat >conftest.$ac_ext <<_ACEOF
14810 #line 14810 "configure"
14811 #include "confdefs.h"
14812 #include <stdlib.h>
14813
14814 _ACEOF
14815 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14816   egrep "free" >/dev/null 2>&1; then
14817   :
14818 else
14819   ac_cv_header_stdc=no
14820 fi
14821 rm -rf conftest*
14822
14823 fi
14824
14825 if test $ac_cv_header_stdc = yes; then
14826   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14827   if test "$cross_compiling" = yes; then
14828   :
14829 else
14830   cat >conftest.$ac_ext <<_ACEOF
14831 #line 14831 "configure"
14832 #include "confdefs.h"
14833 #include <ctype.h>
14834 #if ((' ' & 0x0FF) == 0x020)
14835 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14836 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14837 #else
14838 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14839                      || ('j' <= (c) && (c) <= 'r') \
14840                      || ('s' <= (c) && (c) <= 'z'))
14841 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14842 #endif
14843
14844 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14845 int
14846 main (void)
14847 {
14848   int i;
14849   for (i = 0; i < 256; i++)
14850     if (XOR (islower (i), ISLOWER (i))
14851         || toupper (i) != TOUPPER (i))
14852       $ac_main_return(2);
14853   $ac_main_return (0);
14854 }
14855 _ACEOF
14856 rm -f conftest$ac_exeext
14857 if { (eval echo "$as_me:14857: \"$ac_link\"") >&5
14858   (eval $ac_link) 2>&5
14859   ac_status=$?
14860   echo "$as_me:14860: \$? = $ac_status" >&5
14861   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14862   { (eval echo "$as_me:14862: \"$ac_try\"") >&5
14863   (eval $ac_try) 2>&5
14864   ac_status=$?
14865   echo "$as_me:14865: \$? = $ac_status" >&5
14866   (exit $ac_status); }; }; then
14867   :
14868 else
14869   echo "$as_me: program exited with status $ac_status" >&5
14870 echo "$as_me: failed program was:" >&5
14871 cat conftest.$ac_ext >&5
14872 ac_cv_header_stdc=no
14873 fi
14874 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14875 fi
14876 fi
14877 fi
14878 echo "$as_me:14878: result: $ac_cv_header_stdc" >&5
14879 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14880 if test $ac_cv_header_stdc = yes; then
14881
14882 cat >>confdefs.h <<\EOF
14883 #define STDC_HEADERS 1
14884 EOF
14885
14886 fi
14887
14888 ac_header_dirent=no
14889 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
14890   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
14891 echo "$as_me:14891: checking for $ac_hdr that defines DIR" >&5
14892 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
14893 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14894   echo $ECHO_N "(cached) $ECHO_C" >&6
14895 else
14896   cat >conftest.$ac_ext <<_ACEOF
14897 #line 14897 "configure"
14898 #include "confdefs.h"
14899 #include <sys/types.h>
14900 #include <$ac_hdr>
14901
14902 int
14903 main (void)
14904 {
14905 if ((DIR *) 0)
14906 return 0;
14907   ;
14908   return 0;
14909 }
14910 _ACEOF
14911 rm -f conftest.$ac_objext
14912 if { (eval echo "$as_me:14912: \"$ac_compile\"") >&5
14913   (eval $ac_compile) 2>&5
14914   ac_status=$?
14915   echo "$as_me:14915: \$? = $ac_status" >&5
14916   (exit $ac_status); } &&
14917          { ac_try='test -s conftest.$ac_objext'
14918   { (eval echo "$as_me:14918: \"$ac_try\"") >&5
14919   (eval $ac_try) 2>&5
14920   ac_status=$?
14921   echo "$as_me:14921: \$? = $ac_status" >&5
14922   (exit $ac_status); }; }; then
14923   eval "$as_ac_Header=yes"
14924 else
14925   echo "$as_me: failed program was:" >&5
14926 cat conftest.$ac_ext >&5
14927 eval "$as_ac_Header=no"
14928 fi
14929 rm -f conftest.$ac_objext conftest.$ac_ext
14930 fi
14931 echo "$as_me:14931: result: `eval echo '${'$as_ac_Header'}'`" >&5
14932 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14933 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14934   cat >>confdefs.h <<EOF
14935 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
14936 EOF
14937
14938 ac_header_dirent=$ac_hdr; break
14939 fi
14940
14941 done
14942 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
14943 if test $ac_header_dirent = dirent.h; then
14944   echo "$as_me:14944: checking for opendir in -ldir" >&5
14945 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
14946 if test "${ac_cv_lib_dir_opendir+set}" = set; then
14947   echo $ECHO_N "(cached) $ECHO_C" >&6
14948 else
14949   ac_check_lib_save_LIBS=$LIBS
14950 LIBS="-ldir  $LIBS"
14951 cat >conftest.$ac_ext <<_ACEOF
14952 #line 14952 "configure"
14953 #include "confdefs.h"
14954
14955 /* Override any gcc2 internal prototype to avoid an error.  */
14956 #ifdef __cplusplus
14957 extern "C"
14958 #endif
14959 /* We use char because int might match the return type of a gcc2
14960    builtin and then its argument prototype would still apply.  */
14961 char opendir ();
14962 int
14963 main (void)
14964 {
14965 opendir ();
14966   ;
14967   return 0;
14968 }
14969 _ACEOF
14970 rm -f conftest.$ac_objext conftest$ac_exeext
14971 if { (eval echo "$as_me:14971: \"$ac_link\"") >&5
14972   (eval $ac_link) 2>&5
14973   ac_status=$?
14974   echo "$as_me:14974: \$? = $ac_status" >&5
14975   (exit $ac_status); } &&
14976          { ac_try='test -s conftest$ac_exeext'
14977   { (eval echo "$as_me:14977: \"$ac_try\"") >&5
14978   (eval $ac_try) 2>&5
14979   ac_status=$?
14980   echo "$as_me:14980: \$? = $ac_status" >&5
14981   (exit $ac_status); }; }; then
14982   ac_cv_lib_dir_opendir=yes
14983 else
14984   echo "$as_me: failed program was:" >&5
14985 cat conftest.$ac_ext >&5
14986 ac_cv_lib_dir_opendir=no
14987 fi
14988 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14989 LIBS=$ac_check_lib_save_LIBS
14990 fi
14991 echo "$as_me:14991: result: $ac_cv_lib_dir_opendir" >&5
14992 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
14993 if test $ac_cv_lib_dir_opendir = yes; then
14994   LIBS="$LIBS -ldir"
14995 fi
14996
14997 else
14998   echo "$as_me:14998: checking for opendir in -lx" >&5
14999 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
15000 if test "${ac_cv_lib_x_opendir+set}" = set; then
15001   echo $ECHO_N "(cached) $ECHO_C" >&6
15002 else
15003   ac_check_lib_save_LIBS=$LIBS
15004 LIBS="-lx  $LIBS"
15005 cat >conftest.$ac_ext <<_ACEOF
15006 #line 15006 "configure"
15007 #include "confdefs.h"
15008
15009 /* Override any gcc2 internal prototype to avoid an error.  */
15010 #ifdef __cplusplus
15011 extern "C"
15012 #endif
15013 /* We use char because int might match the return type of a gcc2
15014    builtin and then its argument prototype would still apply.  */
15015 char opendir ();
15016 int
15017 main (void)
15018 {
15019 opendir ();
15020   ;
15021   return 0;
15022 }
15023 _ACEOF
15024 rm -f conftest.$ac_objext conftest$ac_exeext
15025 if { (eval echo "$as_me:15025: \"$ac_link\"") >&5
15026   (eval $ac_link) 2>&5
15027   ac_status=$?
15028   echo "$as_me:15028: \$? = $ac_status" >&5
15029   (exit $ac_status); } &&
15030          { ac_try='test -s conftest$ac_exeext'
15031   { (eval echo "$as_me:15031: \"$ac_try\"") >&5
15032   (eval $ac_try) 2>&5
15033   ac_status=$?
15034   echo "$as_me:15034: \$? = $ac_status" >&5
15035   (exit $ac_status); }; }; then
15036   ac_cv_lib_x_opendir=yes
15037 else
15038   echo "$as_me: failed program was:" >&5
15039 cat conftest.$ac_ext >&5
15040 ac_cv_lib_x_opendir=no
15041 fi
15042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15043 LIBS=$ac_check_lib_save_LIBS
15044 fi
15045 echo "$as_me:15045: result: $ac_cv_lib_x_opendir" >&5
15046 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
15047 if test $ac_cv_lib_x_opendir = yes; then
15048   LIBS="$LIBS -lx"
15049 fi
15050
15051 fi
15052
15053 echo "$as_me:15053: checking whether time.h and sys/time.h may both be included" >&5
15054 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15055 if test "${ac_cv_header_time+set}" = set; then
15056   echo $ECHO_N "(cached) $ECHO_C" >&6
15057 else
15058   cat >conftest.$ac_ext <<_ACEOF
15059 #line 15059 "configure"
15060 #include "confdefs.h"
15061 #include <sys/types.h>
15062 #include <sys/time.h>
15063 #include <time.h>
15064
15065 int
15066 main (void)
15067 {
15068 if ((struct tm *) 0)
15069 return 0;
15070   ;
15071   return 0;
15072 }
15073 _ACEOF
15074 rm -f conftest.$ac_objext
15075 if { (eval echo "$as_me:15075: \"$ac_compile\"") >&5
15076   (eval $ac_compile) 2>&5
15077   ac_status=$?
15078   echo "$as_me:15078: \$? = $ac_status" >&5
15079   (exit $ac_status); } &&
15080          { ac_try='test -s conftest.$ac_objext'
15081   { (eval echo "$as_me:15081: \"$ac_try\"") >&5
15082   (eval $ac_try) 2>&5
15083   ac_status=$?
15084   echo "$as_me:15084: \$? = $ac_status" >&5
15085   (exit $ac_status); }; }; then
15086   ac_cv_header_time=yes
15087 else
15088   echo "$as_me: failed program was:" >&5
15089 cat conftest.$ac_ext >&5
15090 ac_cv_header_time=no
15091 fi
15092 rm -f conftest.$ac_objext conftest.$ac_ext
15093 fi
15094 echo "$as_me:15094: result: $ac_cv_header_time" >&5
15095 echo "${ECHO_T}$ac_cv_header_time" >&6
15096 if test $ac_cv_header_time = yes; then
15097
15098 cat >>confdefs.h <<\EOF
15099 #define TIME_WITH_SYS_TIME 1
15100 EOF
15101
15102 fi
15103
15104 ###     checks for compiler characteristics
15105 ac_ext=c
15106 ac_cpp='$CPP $CPPFLAGS'
15107 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15108 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15109 ac_compiler_gnu=$ac_cv_c_compiler_gnu
15110 ac_main_return=return
15111
15112 echo "$as_me:15112: checking for an ANSI C-conforming const" >&5
15113 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
15114 if test "${ac_cv_c_const+set}" = set; then
15115   echo $ECHO_N "(cached) $ECHO_C" >&6
15116 else
15117   cat >conftest.$ac_ext <<_ACEOF
15118 #line 15118 "configure"
15119 #include "confdefs.h"
15120
15121 int
15122 main (void)
15123 {
15124 /* FIXME: Include the comments suggested by Paul. */
15125 #ifndef __cplusplus
15126   /* Ultrix mips cc rejects this.  */
15127   typedef int charset[2];
15128   const charset x;
15129   /* SunOS 4.1.1 cc rejects this.  */
15130   char const *const *ccp;
15131   char **p;
15132   /* NEC SVR4.0.2 mips cc rejects this.  */
15133   struct point {int x, y;};
15134   static struct point const zero = {0,0};
15135   /* AIX XL C 1.02.0.0 rejects this.
15136      It does not let you subtract one const X* pointer from another in
15137      an arm of an if-expression whose if-part is not a constant
15138      expression */
15139   const char *g = "string";
15140   ccp = &g + (g ? g-g : 0);
15141   /* HPUX 7.0 cc rejects these. */
15142   ++ccp;
15143   p = (char**) ccp;
15144   ccp = (char const *const *) p;
15145   { /* SCO 3.2v4 cc rejects this.  */
15146     char *t;
15147     char const *s = 0 ? (char *) 0 : (char const *) 0;
15148
15149     *t++ = 0;
15150   }
15151   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15152     int x[] = {25, 17};
15153     const int *foo = &x[0];
15154     ++foo;
15155   }
15156   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15157     typedef const int *iptr;
15158     iptr p = 0;
15159     ++p;
15160   }
15161   { /* AIX XL C 1.02.0.0 rejects this saying
15162        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15163     struct s { int j; const int *ap[3]; };
15164     struct s *b; b->j = 5;
15165   }
15166   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15167     const int foo = 10;
15168   }
15169 #endif
15170
15171   ;
15172   return 0;
15173 }
15174 _ACEOF
15175 rm -f conftest.$ac_objext
15176 if { (eval echo "$as_me:15176: \"$ac_compile\"") >&5
15177   (eval $ac_compile) 2>&5
15178   ac_status=$?
15179   echo "$as_me:15179: \$? = $ac_status" >&5
15180   (exit $ac_status); } &&
15181          { ac_try='test -s conftest.$ac_objext'
15182   { (eval echo "$as_me:15182: \"$ac_try\"") >&5
15183   (eval $ac_try) 2>&5
15184   ac_status=$?
15185   echo "$as_me:15185: \$? = $ac_status" >&5
15186   (exit $ac_status); }; }; then
15187   ac_cv_c_const=yes
15188 else
15189   echo "$as_me: failed program was:" >&5
15190 cat conftest.$ac_ext >&5
15191 ac_cv_c_const=no
15192 fi
15193 rm -f conftest.$ac_objext conftest.$ac_ext
15194 fi
15195 echo "$as_me:15195: result: $ac_cv_c_const" >&5
15196 echo "${ECHO_T}$ac_cv_c_const" >&6
15197 if test $ac_cv_c_const = no; then
15198
15199 cat >>confdefs.h <<\EOF
15200 #define const
15201 EOF
15202
15203 fi
15204
15205 ###     Checks for external-data
15206
15207 echo "$as_me:15207: checking if data-only library module links" >&5
15208 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
15209 if test "${cf_cv_link_dataonly+set}" = set; then
15210   echo $ECHO_N "(cached) $ECHO_C" >&6
15211 else
15212
15213         rm -f conftest.a
15214         cat >conftest.$ac_ext <<EOF
15215 #line 15215 "configure"
15216 int     testdata[3] = { 123, 456, 789 };
15217 EOF
15218         if { (eval echo "$as_me:15218: \"$ac_compile\"") >&5
15219   (eval $ac_compile) 2>&5
15220   ac_status=$?
15221   echo "$as_me:15221: \$? = $ac_status" >&5
15222   (exit $ac_status); } ; then
15223                 mv conftest.o data.o && \
15224                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
15225         fi
15226         rm -f conftest.$ac_ext data.o
15227         cat >conftest.$ac_ext <<EOF
15228 #line 15228 "configure"
15229 int     testfunc(void)
15230 {
15231 #if defined(NeXT)
15232         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
15233 #else
15234         extern int testdata[3];
15235         return testdata[0] == 123
15236            &&  testdata[1] == 456
15237            &&  testdata[2] == 789;
15238 #endif
15239 }
15240 EOF
15241         if { (eval echo "$as_me:15241: \"$ac_compile\"") >&5
15242   (eval $ac_compile) 2>&5
15243   ac_status=$?
15244   echo "$as_me:15244: \$? = $ac_status" >&5
15245   (exit $ac_status); }; then
15246                 mv conftest.o func.o && \
15247                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
15248         fi
15249         rm -f conftest.$ac_ext func.o
15250         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
15251         cf_saveLIBS="$LIBS"
15252         LIBS="conftest.a $LIBS"
15253         if test "$cross_compiling" = yes; then
15254   cf_cv_link_dataonly=unknown
15255 else
15256   cat >conftest.$ac_ext <<_ACEOF
15257 #line 15257 "configure"
15258 #include "confdefs.h"
15259
15260         int main(void)
15261         {
15262                 extern int testfunc();
15263                 ${cf_cv_main_return:-return} (!testfunc());
15264         }
15265
15266 _ACEOF
15267 rm -f conftest$ac_exeext
15268 if { (eval echo "$as_me:15268: \"$ac_link\"") >&5
15269   (eval $ac_link) 2>&5
15270   ac_status=$?
15271   echo "$as_me:15271: \$? = $ac_status" >&5
15272   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15273   { (eval echo "$as_me:15273: \"$ac_try\"") >&5
15274   (eval $ac_try) 2>&5
15275   ac_status=$?
15276   echo "$as_me:15276: \$? = $ac_status" >&5
15277   (exit $ac_status); }; }; then
15278   cf_cv_link_dataonly=yes
15279 else
15280   echo "$as_me: program exited with status $ac_status" >&5
15281 echo "$as_me: failed program was:" >&5
15282 cat conftest.$ac_ext >&5
15283 cf_cv_link_dataonly=no
15284 fi
15285 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15286 fi
15287         LIBS="$cf_saveLIBS"
15288
15289 fi
15290
15291 echo "$as_me:15291: result: $cf_cv_link_dataonly" >&5
15292 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
15293
15294 if test "$cf_cv_link_dataonly" = no ; then
15295
15296 cat >>confdefs.h <<\EOF
15297 #define BROKEN_LINKER 1
15298 EOF
15299
15300         BROKEN_LINKER=1
15301 fi
15302
15303 ###     Checks for library functions.
15304
15305 for ac_header in \
15306 unistd.h \
15307
15308 do
15309 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15310 echo "$as_me:15310: checking for $ac_header" >&5
15311 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15312 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15313   echo $ECHO_N "(cached) $ECHO_C" >&6
15314 else
15315   cat >conftest.$ac_ext <<_ACEOF
15316 #line 15316 "configure"
15317 #include "confdefs.h"
15318 #include <$ac_header>
15319 _ACEOF
15320 if { (eval echo "$as_me:15320: \"$ac_cpp conftest.$ac_ext\"") >&5
15321   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15322   ac_status=$?
15323   egrep -v '^ *\+' conftest.er1 >conftest.err
15324   rm -f conftest.er1
15325   cat conftest.err >&5
15326   echo "$as_me:15326: \$? = $ac_status" >&5
15327   (exit $ac_status); } >/dev/null; then
15328   if test -s conftest.err; then
15329     ac_cpp_err=$ac_c_preproc_warn_flag
15330   else
15331     ac_cpp_err=
15332   fi
15333 else
15334   ac_cpp_err=yes
15335 fi
15336 if test -z "$ac_cpp_err"; then
15337   eval "$as_ac_Header=yes"
15338 else
15339   echo "$as_me: failed program was:" >&5
15340   cat conftest.$ac_ext >&5
15341   eval "$as_ac_Header=no"
15342 fi
15343 rm -f conftest.err conftest.$ac_ext
15344 fi
15345 echo "$as_me:15345: result: `eval echo '${'$as_ac_Header'}'`" >&5
15346 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15347 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15348   cat >>confdefs.h <<EOF
15349 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15350 EOF
15351
15352 fi
15353 done
15354
15355 echo "$as_me:15355: checking for working mkstemp" >&5
15356 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
15357 if test "${cf_cv_func_mkstemp+set}" = set; then
15358   echo $ECHO_N "(cached) $ECHO_C" >&6
15359 else
15360
15361 rm -rf conftest*
15362 if test "$cross_compiling" = yes; then
15363   cf_cv_func_mkstemp=maybe
15364 else
15365   cat >conftest.$ac_ext <<_ACEOF
15366 #line 15366 "configure"
15367 #include "confdefs.h"
15368
15369 #include <sys/types.h>
15370 #ifdef HAVE_UNISTD_H
15371 #include <unistd.h>
15372 #endif
15373 #include <stdlib.h>
15374 #include <stdio.h>
15375 #include <string.h>
15376 #include <sys/stat.h>
15377 int main(void)
15378 {
15379         char *tmpl = "conftestXXXXXX";
15380         char name[2][80];
15381         int n;
15382         int result = 0;
15383         int fd;
15384         struct stat sb;
15385
15386         umask(077);
15387         for (n = 0; n < 2; ++n) {
15388                 strcpy(name[n], tmpl);
15389                 if ((fd = mkstemp(name[n])) >= 0) {
15390                         if (!strcmp(name[n], tmpl)
15391                          || stat(name[n], &sb) != 0
15392                          || (sb.st_mode & S_IFMT) != S_IFREG
15393                          || (sb.st_mode & 077) != 0) {
15394                                 result = 1;
15395                         }
15396                         close(fd);
15397                 }
15398         }
15399         if (result == 0
15400          && !strcmp(name[0], name[1]))
15401                 result = 1;
15402         ${cf_cv_main_return:-return}(result);
15403 }
15404
15405 _ACEOF
15406 rm -f conftest$ac_exeext
15407 if { (eval echo "$as_me:15407: \"$ac_link\"") >&5
15408   (eval $ac_link) 2>&5
15409   ac_status=$?
15410   echo "$as_me:15410: \$? = $ac_status" >&5
15411   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15412   { (eval echo "$as_me:15412: \"$ac_try\"") >&5
15413   (eval $ac_try) 2>&5
15414   ac_status=$?
15415   echo "$as_me:15415: \$? = $ac_status" >&5
15416   (exit $ac_status); }; }; then
15417   cf_cv_func_mkstemp=yes
15418
15419 else
15420   echo "$as_me: program exited with status $ac_status" >&5
15421 echo "$as_me: failed program was:" >&5
15422 cat conftest.$ac_ext >&5
15423 cf_cv_func_mkstemp=no
15424
15425 fi
15426 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15427 fi
15428
15429 fi
15430 echo "$as_me:15430: result: $cf_cv_func_mkstemp" >&5
15431 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
15432 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
15433         echo "$as_me:15433: checking for mkstemp" >&5
15434 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
15435 if test "${ac_cv_func_mkstemp+set}" = set; then
15436   echo $ECHO_N "(cached) $ECHO_C" >&6
15437 else
15438   cat >conftest.$ac_ext <<_ACEOF
15439 #line 15439 "configure"
15440 #include "confdefs.h"
15441 /* System header to define __stub macros and hopefully few prototypes,
15442     which can conflict with char mkstemp (); below.  */
15443 #include <assert.h>
15444 /* Override any gcc2 internal prototype to avoid an error.  */
15445 #ifdef __cplusplus
15446 extern "C"
15447 #endif
15448 /* We use char because int might match the return type of a gcc2
15449    builtin and then its argument prototype would still apply.  */
15450 char mkstemp ();
15451 char (*f) ();
15452
15453 int
15454 main (void)
15455 {
15456 /* The GNU C library defines this for functions which it implements
15457     to always fail with ENOSYS.  Some functions are actually named
15458     something starting with __ and the normal name is an alias.  */
15459 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
15460 choke me
15461 #else
15462 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15463 #endif
15464
15465   ;
15466   return 0;
15467 }
15468 _ACEOF
15469 rm -f conftest.$ac_objext conftest$ac_exeext
15470 if { (eval echo "$as_me:15470: \"$ac_link\"") >&5
15471   (eval $ac_link) 2>&5
15472   ac_status=$?
15473   echo "$as_me:15473: \$? = $ac_status" >&5
15474   (exit $ac_status); } &&
15475          { ac_try='test -s conftest$ac_exeext'
15476   { (eval echo "$as_me:15476: \"$ac_try\"") >&5
15477   (eval $ac_try) 2>&5
15478   ac_status=$?
15479   echo "$as_me:15479: \$? = $ac_status" >&5
15480   (exit $ac_status); }; }; then
15481   ac_cv_func_mkstemp=yes
15482 else
15483   echo "$as_me: failed program was:" >&5
15484 cat conftest.$ac_ext >&5
15485 ac_cv_func_mkstemp=no
15486 fi
15487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15488 fi
15489 echo "$as_me:15489: result: $ac_cv_func_mkstemp" >&5
15490 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
15491
15492 fi
15493 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
15494
15495 cat >>confdefs.h <<\EOF
15496 #define HAVE_MKSTEMP 1
15497 EOF
15498
15499 fi
15500
15501 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
15502         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15503         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
15504 fi
15505
15506 cf_with_ada=yes
15507 if test "$cf_with_ada" != "no" ; then
15508
15509 cf_ada_make=gnatmake
15510 cf_ada_config="#"
15511 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
15512 set dummy $cf_ada_make; ac_word=$2
15513 echo "$as_me:15513: checking for $ac_word" >&5
15514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15515 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
15516   echo $ECHO_N "(cached) $ECHO_C" >&6
15517 else
15518   if test -n "$gnatmake_exists"; then
15519   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
15520 else
15521   ac_save_IFS=$IFS; IFS=$ac_path_separator
15522 ac_dummy="$PATH"
15523 for ac_dir in $ac_dummy; do
15524   IFS=$ac_save_IFS
15525   test -z "$ac_dir" && ac_dir=.
15526   $as_executable_p "$ac_dir/$ac_word" || continue
15527 ac_cv_prog_gnatmake_exists="yes"
15528 echo "$as_me:15528: found $ac_dir/$ac_word" >&5
15529 break
15530 done
15531
15532   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
15533 fi
15534 fi
15535 gnatmake_exists=$ac_cv_prog_gnatmake_exists
15536 if test -n "$gnatmake_exists"; then
15537   echo "$as_me:15537: result: $gnatmake_exists" >&5
15538 echo "${ECHO_T}$gnatmake_exists" >&6
15539 else
15540   echo "$as_me:15540: result: no" >&5
15541 echo "${ECHO_T}no" >&6
15542 fi
15543
15544 if test "$ac_cv_prog_gnatmake_exists" = no; then
15545         cf_ada_make=
15546         cf_cv_prog_gnat_correct=no
15547 else
15548         # Extract the first word of "gprconfig", so it can be a program name with args.
15549 set dummy gprconfig; ac_word=$2
15550 echo "$as_me:15550: checking for $ac_word" >&5
15551 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15552 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
15553   echo $ECHO_N "(cached) $ECHO_C" >&6
15554 else
15555   if test -n "$gprconfig_exists"; then
15556   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
15557 else
15558   ac_save_IFS=$IFS; IFS=$ac_path_separator
15559 ac_dummy="$PATH"
15560 for ac_dir in $ac_dummy; do
15561   IFS=$ac_save_IFS
15562   test -z "$ac_dir" && ac_dir=.
15563   $as_executable_p "$ac_dir/$ac_word" || continue
15564 ac_cv_prog_gprconfig_exists="yes"
15565 echo "$as_me:15565: found $ac_dir/$ac_word" >&5
15566 break
15567 done
15568
15569   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
15570 fi
15571 fi
15572 gprconfig_exists=$ac_cv_prog_gprconfig_exists
15573 if test -n "$gprconfig_exists"; then
15574   echo "$as_me:15574: result: $gprconfig_exists" >&5
15575 echo "${ECHO_T}$gprconfig_exists" >&6
15576 else
15577   echo "$as_me:15577: result: no" >&5
15578 echo "${ECHO_T}no" >&6
15579 fi
15580
15581         if test "$ac_cv_prog_gprconfig_exists" = yes
15582         then
15583                 rm -rf conftest* *~conftest*
15584                 if mkdir conftest.src
15585                 then
15586                         cf_ada_config=""
15587                         cd conftest.src
15588                         for cf_gprconfig in Ada C
15589                         do
15590                                 echo "$as_me:15590: checking for gprconfig name for $cf_gprconfig" >&5
15591 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
15592                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
15593                                 if test -n "$cf_gprconfig_value"
15594                                 then
15595                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
15596                                         echo "$as_me:15596: result: $cf_gprconfig_value" >&5
15597 echo "${ECHO_T}$cf_gprconfig_value" >&6
15598                                 else
15599                                         echo "$as_me:15599: result: missing" >&5
15600 echo "${ECHO_T}missing" >&6
15601                                         cf_ada_config="#"
15602                                         break
15603                                 fi
15604                         done
15605                         cd ..
15606                         rm -rf conftest* *~conftest*
15607                 fi
15608         else
15609                 # gprconfig is newer than gnatmake; we can continue...
15610                 cf_ada_config="##"
15611         fi
15612         if test "x$cf_ada_config" != "x#"
15613         then
15614
15615 echo "$as_me:15615: checking for gnat version" >&5
15616 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
15617 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
15618         grep '[0-9].[0-9][0-9]*' |\
15619         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
15620 echo "$as_me:15620: result: $cf_gnat_version" >&5
15621 echo "${ECHO_T}$cf_gnat_version" >&6
15622
15623 case $cf_gnat_version in
15624 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
15625         cf_cv_prog_gnat_correct=yes
15626         ;;
15627 (*)
15628         { echo "$as_me:15628: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
15629 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
15630         cf_cv_prog_gnat_correct=no
15631         ;;
15632 esac
15633
15634                 # Extract the first word of "m4", so it can be a program name with args.
15635 set dummy m4; ac_word=$2
15636 echo "$as_me:15636: checking for $ac_word" >&5
15637 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15638 if test "${ac_cv_prog_M4_exists+set}" = set; then
15639   echo $ECHO_N "(cached) $ECHO_C" >&6
15640 else
15641   if test -n "$M4_exists"; then
15642   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
15643 else
15644   ac_save_IFS=$IFS; IFS=$ac_path_separator
15645 ac_dummy="$PATH"
15646 for ac_dir in $ac_dummy; do
15647   IFS=$ac_save_IFS
15648   test -z "$ac_dir" && ac_dir=.
15649   $as_executable_p "$ac_dir/$ac_word" || continue
15650 ac_cv_prog_M4_exists="yes"
15651 echo "$as_me:15651: found $ac_dir/$ac_word" >&5
15652 break
15653 done
15654
15655   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
15656 fi
15657 fi
15658 M4_exists=$ac_cv_prog_M4_exists
15659 if test -n "$M4_exists"; then
15660   echo "$as_me:15660: result: $M4_exists" >&5
15661 echo "${ECHO_T}$M4_exists" >&6
15662 else
15663   echo "$as_me:15663: result: no" >&5
15664 echo "${ECHO_T}no" >&6
15665 fi
15666
15667                 if test "$ac_cv_prog_M4_exists" = no; then
15668                         cf_cv_prog_gnat_correct=no
15669                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
15670                 fi
15671                 if test "$cf_cv_prog_gnat_correct" = yes; then
15672                         echo "$as_me:15672: checking if GNAT works" >&5
15673 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
15674
15675 rm -rf conftest* *~conftest*
15676 cat >>conftest.ads <<CF_EOF
15677 procedure conftest;
15678 CF_EOF
15679 cat >>conftest.adb <<CF_EOF
15680 with Text_IO;
15681 with GNAT.OS_Lib;
15682 procedure conftest is
15683 begin
15684    Text_IO.Put ("Hello World");
15685    Text_IO.New_Line;
15686    GNAT.OS_Lib.OS_Exit (0);
15687 end conftest;
15688 CF_EOF
15689 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15690    if ( ./conftest 1>&5 2>&1 ) ; then
15691       cf_cv_prog_gnat_correct=yes
15692    else
15693       cf_cv_prog_gnat_correct=no
15694    fi
15695 else
15696    cf_cv_prog_gnat_correct=no
15697 fi
15698 rm -rf conftest* *~conftest*
15699
15700                         echo "$as_me:15700: result: $cf_cv_prog_gnat_correct" >&5
15701 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
15702                 fi
15703         else
15704                 cf_cv_prog_gnat_correct=no
15705         fi
15706 fi
15707
15708         if test "$cf_cv_prog_gnat_correct" = yes; then
15709
15710         echo "$as_me:15710: checking optimization options for ADAFLAGS" >&5
15711 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
15712         case "$CFLAGS" in
15713         (*-g*)
15714
15715         ADAFLAGS="$ADAFLAGS -g"
15716
15717                 ;;
15718         esac
15719         case "$CFLAGS" in
15720         (*-O*)
15721                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
15722
15723         ADAFLAGS="$ADAFLAGS $cf_O_flag"
15724
15725                 ;;
15726         esac
15727         echo "$as_me:15727: result: $ADAFLAGS" >&5
15728 echo "${ECHO_T}$ADAFLAGS" >&6
15729
15730 echo "$as_me:15730: checking if GNATPREP supports -T option" >&5
15731 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
15732 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
15733   echo $ECHO_N "(cached) $ECHO_C" >&6
15734 else
15735
15736 cf_cv_gnatprep_opt_t=no
15737 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
15738
15739 fi
15740 echo "$as_me:15740: result: $cf_cv_gnatprep_opt_t" >&5
15741 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
15742 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
15743
15744 echo "$as_me:15744: checking if GNAT supports generics" >&5
15745 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
15746 case $cf_gnat_version in
15747 (3.[1-9]*|[4-9].*)
15748         cf_gnat_generics=yes
15749         ;;
15750 (*)
15751         cf_gnat_generics=no
15752         ;;
15753 esac
15754 echo "$as_me:15754: result: $cf_gnat_generics" >&5
15755 echo "${ECHO_T}$cf_gnat_generics" >&6
15756
15757 if test "$cf_gnat_generics" = yes
15758 then
15759         cf_compile_generics=generics
15760         cf_generic_objects="\${GENOBJS}"
15761 else
15762         cf_compile_generics=
15763         cf_generic_objects=
15764 fi
15765
15766 echo "$as_me:15766: checking if GNAT supports SIGINT" >&5
15767 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
15768 if test "${cf_cv_gnat_sigint+set}" = set; then
15769   echo $ECHO_N "(cached) $ECHO_C" >&6
15770 else
15771
15772 rm -rf conftest* *~conftest*
15773 cat >>conftest.ads <<CF_EOF
15774 with Ada.Interrupts.Names;
15775
15776 package ConfTest is
15777
15778    pragma Warnings (Off);  --  the next pragma exists since 3.11p
15779    pragma Unreserve_All_Interrupts;
15780    pragma Warnings (On);
15781
15782    protected Process is
15783       procedure Stop;
15784       function Continue return Boolean;
15785       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
15786    private
15787       Done : Boolean := False;
15788    end Process;
15789
15790 end ConfTest;
15791 CF_EOF
15792 cat >>conftest.adb <<CF_EOF
15793 package body ConfTest is
15794    protected body Process is
15795       procedure Stop is
15796       begin
15797          Done := True;
15798       end Stop;
15799       function Continue return Boolean is
15800       begin
15801          return not Done;
15802       end Continue;
15803    end Process;
15804 end ConfTest;
15805 CF_EOF
15806 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
15807       cf_cv_gnat_sigint=yes
15808 else
15809    cf_cv_gnat_sigint=no
15810 fi
15811 rm -rf conftest* *~conftest*
15812
15813 fi
15814 echo "$as_me:15814: result: $cf_cv_gnat_sigint" >&5
15815 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
15816
15817 if test $cf_cv_gnat_sigint = yes ; then
15818         USE_GNAT_SIGINT=""
15819 else
15820         USE_GNAT_SIGINT="#"
15821 fi
15822
15823 cf_gnat_libraries=no
15824 cf_gnat_projects=no
15825
15826 if test "$enable_gnat_projects" != no ; then
15827 echo "$as_me:15827: checking if GNAT supports project files" >&5
15828 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
15829 case $cf_gnat_version in
15830 (3.[0-9]*)
15831         ;;
15832 (*)
15833         case $cf_cv_system_name in
15834         (cygwin*|msys*)
15835                 ;;
15836         (*)
15837                 rm -rf conftest* *~conftest*
15838                 if mkdir conftest.src conftest.bin conftest.lib
15839                 then
15840                         cd conftest.src
15841                         rm -rf conftest* *~conftest*
15842                         cat >>library.gpr <<CF_EOF
15843 project Library is
15844   Kind := External ("LIB_KIND");
15845   for Library_Name use "ConfTest";
15846   for Object_Dir use ".";
15847   for Library_ALI_Dir use External("LIBRARY_DIR");
15848   for Library_Version use External ("SONAME");
15849   for Library_Kind use Kind;
15850   for Library_Dir use External("BUILD_DIR");
15851   Source_Dir := External ("SOURCE_DIR");
15852   for Source_Dirs use (Source_Dir);
15853 end Library;
15854 CF_EOF
15855                         cat >>confpackage.ads <<CF_EOF
15856 package ConfPackage is
15857    procedure conftest;
15858 end ConfPackage;
15859 CF_EOF
15860                         cat >>confpackage.adb <<CF_EOF
15861 with Text_IO;
15862 package body ConfPackage is
15863    procedure conftest is
15864    begin
15865       Text_IO.Put ("Hello World");
15866       Text_IO.New_Line;
15867    end conftest;
15868 end ConfPackage;
15869 CF_EOF
15870                         if ( $cf_ada_make $ADAFLAGS \
15871                                         -Plibrary.gpr \
15872                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
15873                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
15874                                         -XSOURCE_DIR=`pwd` \
15875                                         -XSONAME=libConfTest.so.1 \
15876                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
15877                                 cf_gnat_projects=yes
15878                         fi
15879                         cd ..
15880                 fi
15881                 if test -f conftest.lib/confpackage.ali
15882                 then
15883                         cf_gnat_libraries=yes
15884                 fi
15885                 rm -rf conftest* *~conftest*
15886                 ;;
15887         esac
15888         ;;
15889 esac
15890 echo "$as_me:15890: result: $cf_gnat_projects" >&5
15891 echo "${ECHO_T}$cf_gnat_projects" >&6
15892 fi # enable_gnat_projects
15893
15894 if test $cf_gnat_projects = yes
15895 then
15896         echo "$as_me:15896: checking if GNAT supports libraries" >&5
15897 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
15898         echo "$as_me:15898: result: $cf_gnat_libraries" >&5
15899 echo "${ECHO_T}$cf_gnat_libraries" >&6
15900 fi
15901
15902 if test "$cf_gnat_projects" = yes
15903 then
15904         USE_OLD_MAKERULES="#"
15905         USE_GNAT_PROJECTS=""
15906 else
15907         USE_OLD_MAKERULES=""
15908         USE_GNAT_PROJECTS="#"
15909 fi
15910
15911 if test "$cf_gnat_libraries" = yes
15912 then
15913         USE_GNAT_LIBRARIES=""
15914 else
15915         USE_GNAT_LIBRARIES="#"
15916 fi
15917
15918 echo "$as_me:15918: checking for ada-compiler" >&5
15919 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
15920
15921 # Check whether --with-ada-compiler or --without-ada-compiler was given.
15922 if test "${with_ada_compiler+set}" = set; then
15923   withval="$with_ada_compiler"
15924   cf_ada_compiler=$withval
15925 else
15926   cf_ada_compiler=gnatmake
15927 fi;
15928
15929 echo "$as_me:15929: result: $cf_ada_compiler" >&5
15930 echo "${ECHO_T}$cf_ada_compiler" >&6
15931
15932                 cf_ada_package=terminal_interface
15933
15934 echo "$as_me:15934: checking for ada-include" >&5
15935 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
15936
15937 # Check whether --with-ada-include or --without-ada-include was given.
15938 if test "${with_ada_include+set}" = set; then
15939   withval="$with_ada_include"
15940
15941 else
15942   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
15943 fi; if test -n "$prefix/share/ada/adainclude" ; then
15944
15945 if test "x$prefix" != xNONE; then
15946         cf_path_syntax="$prefix"
15947 else
15948         cf_path_syntax="$ac_default_prefix"
15949 fi
15950
15951 case ".$withval" in
15952 (.\$\(*\)*|.\'*\'*)
15953         ;;
15954 (..|./*|.\\*)
15955         ;;
15956 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15957         ;;
15958 (.\${*prefix}*|.\${*dir}*)
15959         eval withval="$withval"
15960         case ".$withval" in
15961         (.NONE/*)
15962                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15963                 ;;
15964         esac
15965         ;;
15966 (.no|.NONE/*)
15967         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15968         ;;
15969 (*)
15970         { { echo "$as_me:15970: error: expected a pathname, not \"$withval\"" >&5
15971 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
15972    { (exit 1); exit 1; }; }
15973         ;;
15974 esac
15975
15976 fi
15977 eval ADA_INCLUDE="$withval"
15978
15979 echo "$as_me:15979: result: $ADA_INCLUDE" >&5
15980 echo "${ECHO_T}$ADA_INCLUDE" >&6
15981
15982 echo "$as_me:15982: checking for ada-objects" >&5
15983 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
15984
15985 # Check whether --with-ada-objects or --without-ada-objects was given.
15986 if test "${with_ada_objects+set}" = set; then
15987   withval="$with_ada_objects"
15988
15989 else
15990   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
15991 fi; if test -n "$prefix/lib/ada/adalib" ; then
15992
15993 if test "x$prefix" != xNONE; then
15994         cf_path_syntax="$prefix"
15995 else
15996         cf_path_syntax="$ac_default_prefix"
15997 fi
15998
15999 case ".$withval" in
16000 (.\$\(*\)*|.\'*\'*)
16001         ;;
16002 (..|./*|.\\*)
16003         ;;
16004 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16005         ;;
16006 (.\${*prefix}*|.\${*dir}*)
16007         eval withval="$withval"
16008         case ".$withval" in
16009         (.NONE/*)
16010                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16011                 ;;
16012         esac
16013         ;;
16014 (.no|.NONE/*)
16015         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
16016         ;;
16017 (*)
16018         { { echo "$as_me:16018: error: expected a pathname, not \"$withval\"" >&5
16019 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
16020    { (exit 1); exit 1; }; }
16021         ;;
16022 esac
16023
16024 fi
16025 eval ADA_OBJECTS="$withval"
16026
16027 echo "$as_me:16027: result: $ADA_OBJECTS" >&5
16028 echo "${ECHO_T}$ADA_OBJECTS" >&6
16029
16030 echo "$as_me:16030: checking if an Ada95 shared-library should be built" >&5
16031 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
16032
16033 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
16034 if test "${with_ada_sharedlib+set}" = set; then
16035   withval="$with_ada_sharedlib"
16036   with_ada_sharedlib=$withval
16037 else
16038   with_ada_sharedlib=no
16039 fi;
16040 echo "$as_me:16040: result: $with_ada_sharedlib" >&5
16041 echo "${ECHO_T}$with_ada_sharedlib" >&6
16042
16043 if test "x$with_ada_sharedlib" != xno
16044 then
16045         if test "x$cf_gnat_projects" != xyes
16046         then
16047                 { echo "$as_me:16047: WARNING: disabling shared-library since GNAT projects are not supported" >&5
16048 echo "$as_me: WARNING: disabling shared-library since GNAT projects are not supported" >&2;}
16049                 with_ada_sharedlib=no
16050         fi
16051 fi
16052
16053 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
16054 MAKE_ADA_SHAREDLIB="#"
16055
16056 if test "x$with_ada_sharedlib" != xno
16057 then
16058         MAKE_ADA_SHAREDLIB=
16059         if test "x$with_ada_sharedlib" != xyes
16060         then
16061                 ADA_SHAREDLIB="$with_ada_sharedlib"
16062         fi
16063 fi
16064
16065         else
16066                 { { echo "$as_me:16066: error: No usable Ada compiler found" >&5
16067 echo "$as_me: error: No usable Ada compiler found" >&2;}
16068    { (exit 1); exit 1; }; }
16069         fi
16070 else
16071         { { echo "$as_me:16071: error: The Ada compiler is needed for this package" >&5
16072 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
16073    { (exit 1); exit 1; }; }
16074 fi
16075
16076 ################################################################################
16077
16078 # not needed
16079 TINFO_LDFLAGS2=
16080
16081 TINFO_LIBS=
16082
16083 ### Construct the list of include-directories to be generated
16084
16085 if test "$srcdir" != "."; then
16086         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
16087 fi
16088 CPPFLAGS="-I../include $CPPFLAGS"
16089 if test "$srcdir" != "."; then
16090         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
16091 fi
16092 CPPFLAGS="-I. $CPPFLAGS"
16093
16094 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
16095 if test "$srcdir" != "."; then
16096         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
16097 fi
16098 if test "$GCC" != yes; then
16099         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16100 elif test "$includedir" != "/usr/include"; then
16101         if test "$includedir" = '${prefix}/include' ; then
16102                 if test x$prefix != x/usr ; then
16103                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16104                 fi
16105         else
16106                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
16107         fi
16108 fi
16109
16110 ### Build up pieces for makefile rules
16111 echo "$as_me:16111: checking default library suffix" >&5
16112 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
16113
16114         case $DFT_LWR_MODEL in
16115         (libtool) DFT_ARG_SUFFIX=''   ;;
16116         (normal)  DFT_ARG_SUFFIX=''   ;;
16117         (debug)   DFT_ARG_SUFFIX='_g' ;;
16118         (profile) DFT_ARG_SUFFIX='_p' ;;
16119         (shared)  DFT_ARG_SUFFIX=''   ;;
16120         esac
16121         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
16122 echo "$as_me:16122: result: $DFT_ARG_SUFFIX" >&5
16123 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
16124
16125 echo "$as_me:16125: checking default library-dependency suffix" >&5
16126 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
16127
16128         case X$DFT_LWR_MODEL in
16129         (Xlibtool)
16130                 DFT_LIB_SUFFIX='.la'
16131                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16132                 ;;
16133         (Xdebug)
16134                 DFT_LIB_SUFFIX='_g.a'
16135                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16136                 ;;
16137         (Xprofile)
16138                 DFT_LIB_SUFFIX='_p.a'
16139                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16140                 ;;
16141         (Xshared)
16142                 case $cf_cv_system_name in
16143                 (aix[5-7]*)
16144                         DFT_LIB_SUFFIX='.so'
16145                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16146                         ;;
16147                 (cygwin*|msys*|mingw*)
16148                         DFT_LIB_SUFFIX='.dll'
16149                         DFT_DEP_SUFFIX='.dll.a'
16150                         ;;
16151                 (darwin*)
16152                         DFT_LIB_SUFFIX='.dylib'
16153                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16154                         ;;
16155                 (hpux*)
16156                         case $target in
16157                         (ia64*)
16158                                 DFT_LIB_SUFFIX='.so'
16159                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16160                                 ;;
16161                         (*)
16162                                 DFT_LIB_SUFFIX='.sl'
16163                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16164                                 ;;
16165                         esac
16166                         ;;
16167                 (*)
16168                         DFT_LIB_SUFFIX='.so'
16169                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16170                         ;;
16171                 esac
16172                 ;;
16173         (*)
16174                 DFT_LIB_SUFFIX='.a'
16175                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
16176                 ;;
16177         esac
16178         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
16179         then
16180                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
16181                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
16182         fi
16183 echo "$as_me:16183: result: $DFT_DEP_SUFFIX" >&5
16184 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
16185
16186 echo "$as_me:16186: checking default object directory" >&5
16187 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
16188
16189         case $DFT_LWR_MODEL in
16190         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
16191         (normal)  DFT_OBJ_SUBDIR='objects' ;;
16192         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
16193         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
16194         (shared)
16195                 case $cf_cv_system_name in
16196                 (cygwin|msys)
16197                         DFT_OBJ_SUBDIR='objects' ;;
16198                 (*)
16199                         DFT_OBJ_SUBDIR='obj_s' ;;
16200                 esac
16201         esac
16202 echo "$as_me:16202: result: $DFT_OBJ_SUBDIR" >&5
16203 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
16204
16205 ### Set up low-level terminfo dependencies for makefiles.
16206
16207 if test "$DFT_LWR_MODEL" = shared ; then
16208         case $cf_cv_system_name in
16209         (cygwin*)
16210                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
16211                 ;;
16212         (msys*)
16213                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
16214                 ;;
16215         esac
16216 fi
16217
16218 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
16219
16220 ### Construct the list of subdirectories for which we'll customize makefiles
16221 ### with the appropriate compile-rules.
16222
16223 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
16224
16225 cat >>confdefs.h <<EOF
16226 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
16227 EOF
16228
16229 ### Now that we're done running tests, add the compiler-warnings, if any
16230
16231 cf_fix_cppflags=no
16232 cf_new_cflags=
16233 cf_new_cppflags=
16234 cf_new_extra_cppflags=
16235
16236 for cf_add_cflags in $EXTRA_CFLAGS
16237 do
16238 case $cf_fix_cppflags in
16239 (no)
16240         case $cf_add_cflags in
16241         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16242                 case $cf_add_cflags in
16243                 (-D*)
16244                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16245
16246                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16247                                 && test -z "${cf_tst_cflags}" \
16248                                 && cf_fix_cppflags=yes
16249
16250                         if test $cf_fix_cppflags = yes ; then
16251
16252         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16253         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16254
16255                                 continue
16256                         elif test "${cf_tst_cflags}" = "\"'" ; then
16257
16258         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16259         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16260
16261                                 continue
16262                         fi
16263                         ;;
16264                 esac
16265                 case "$CPPFLAGS" in
16266                 (*$cf_add_cflags)
16267                         ;;
16268                 (*)
16269                         case $cf_add_cflags in
16270                         (-D*)
16271                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16272
16273 CPPFLAGS=`echo "$CPPFLAGS" | \
16274         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16275                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16276
16277                                 ;;
16278                         esac
16279
16280         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16281         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16282
16283                         ;;
16284                 esac
16285                 ;;
16286         (*)
16287
16288         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16289         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16290
16291                 ;;
16292         esac
16293         ;;
16294 (yes)
16295
16296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16298
16299         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16300
16301         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16302                 && test -z "${cf_tst_cflags}" \
16303                 && cf_fix_cppflags=no
16304         ;;
16305 esac
16306 done
16307
16308 if test -n "$cf_new_cflags" ; then
16309
16310         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16311         CFLAGS="${CFLAGS}$cf_new_cflags"
16312
16313 fi
16314
16315 if test -n "$cf_new_cppflags" ; then
16316
16317         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16318         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16319
16320 fi
16321
16322 if test -n "$cf_new_extra_cppflags" ; then
16323
16324         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16325         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16326
16327 fi
16328
16329 ################################################################################
16330
16331 TEST_ARG2=
16332
16333 TEST_LIBS2=
16334
16335 NCURSES_SHLIB2="sh -c"
16336
16337 ADA_SUBDIRS="include gen src doc"
16338 if test "x$cf_with_tests" != "xno" ; then
16339         ADA_SUBDIRS="$ADA_SUBDIRS samples"
16340 fi
16341 for cf_dir in $ADA_SUBDIRS
16342 do
16343         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
16344 done
16345
16346 NCURSES_TREE="#"
16347
16348 EXTERNAL_TREE=
16349
16350 # match layout used by make-tar.sh
16351 ADAHTML_DIR=../doc/ada
16352
16353 if test "x$cross_compiling" = xyes ; then
16354         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
16355 else
16356         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
16357 fi
16358
16359 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
16360 ac_config_commands="$ac_config_commands default"
16361 cat >confcache <<\_ACEOF
16362 # This file is a shell script that caches the results of configure
16363 # tests run on this system so they can be shared between configure
16364 # scripts and configure runs, see configure's option --config-cache.
16365 # It is not useful on other systems.  If it contains results you don't
16366 # want to keep, you may remove or edit it.
16367 #
16368 # config.status only pays attention to the cache file if you give it
16369 # the --recheck option to rerun configure.
16370 #
16371 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16372 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16373 # following values.
16374
16375 _ACEOF
16376
16377 # The following way of writing the cache mishandles newlines in values,
16378 # but we know of no workaround that is simple, portable, and efficient.
16379 # So, don't put newlines in cache variables' values.
16380 # Ultrix sh set writes to stderr and can't be redirected directly,
16381 # and sets the high bit in the cache file unless we assign to the vars.
16382 {
16383   (set) 2>&1 |
16384     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16385     *ac_space=\ *)
16386       # `set' does not quote correctly, so add quotes (double-quote
16387       # substitution turns \\\\ into \\, and sed turns \\ into \).
16388       sed -n \
16389         "s/'/'\\\\''/g;
16390           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16391       ;;
16392     *)
16393       # `set' quotes correctly as required by POSIX, so do not add quotes.
16394       sed -n \
16395         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16396       ;;
16397     esac;
16398 } |
16399   sed '
16400      t clear
16401      : clear
16402      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16403      t end
16404      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16405      : end' >>confcache
16406 if cmp -s $cache_file confcache; then :; else
16407   if test -w $cache_file; then
16408     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16409     cat confcache >$cache_file
16410   else
16411     echo "not updating unwritable cache $cache_file"
16412   fi
16413 fi
16414 rm -f confcache
16415
16416 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16417 # Let make expand exec_prefix.
16418 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16419
16420 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16421 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16422 # trailing colons and then remove the whole line if VPATH becomes empty
16423 # (actually we leave an empty line to preserve line numbers).
16424 if test "x$srcdir" = x.; then
16425   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16426 s/:*\$(srcdir):*/:/;
16427 s/:*\${srcdir}:*/:/;
16428 s/:*@srcdir@:*/:/;
16429 s/^\([^=]*=[    ]*\):*/\1/;
16430 s/:*$//;
16431 s/^[^=]*=[      ]*$//;
16432 }'
16433 fi
16434
16435 DEFS=-DHAVE_CONFIG_H
16436
16437 : ${CONFIG_STATUS=./config.status}
16438 ac_clean_files_save=$ac_clean_files
16439 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16440 { echo "$as_me:16440: creating $CONFIG_STATUS" >&5
16441 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16442 cat >$CONFIG_STATUS <<_ACEOF
16443 #! $SHELL
16444 # Generated automatically by configure.
16445 # Run this file to recreate the current configuration.
16446 # Compiler output produced by configure, useful for debugging
16447 # configure, is in config.log if it exists.
16448
16449 debug=false
16450 SHELL=\${CONFIG_SHELL-$SHELL}
16451 ac_cs_invocation="\$0 \$@"
16452
16453 _ACEOF
16454
16455 cat >>$CONFIG_STATUS <<\_ACEOF
16456 # Be Bourne compatible
16457 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16458   emulate sh
16459   NULLCMD=:
16460 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16461   set -o posix
16462 fi
16463
16464 # Name of the executable.
16465 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16466
16467 if expr a : '\(a\)' >/dev/null 2>&1; then
16468   as_expr=expr
16469 else
16470   as_expr=false
16471 fi
16472
16473 rm -f conf$$ conf$$.exe conf$$.file
16474 echo >conf$$.file
16475 if ln -s conf$$.file conf$$ 2>/dev/null; then
16476   # We could just check for DJGPP; but this test a) works b) is more generic
16477   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16478   if test -f conf$$.exe; then
16479     # Don't use ln at all; we don't have any links
16480     as_ln_s='cp -p'
16481   else
16482     as_ln_s='ln -s'
16483   fi
16484 elif ln conf$$.file conf$$ 2>/dev/null; then
16485   as_ln_s=ln
16486 else
16487   as_ln_s='cp -p'
16488 fi
16489 rm -f conf$$ conf$$.exe conf$$.file
16490
16491 as_executable_p="test -f"
16492
16493 # Support unset when possible.
16494 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16495   as_unset=unset
16496 else
16497   as_unset=false
16498 fi
16499
16500 # NLS nuisances.
16501 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16502 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16503 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16504 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16505 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16506 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16507 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16508 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16509
16510 # IFS
16511 # We need space, tab and new line, in precisely that order.
16512 as_nl='
16513 '
16514 IFS="   $as_nl"
16515
16516 # CDPATH.
16517 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16518
16519 exec 6>&1
16520
16521 _ACEOF
16522
16523 # Files that config.status was made for.
16524 if test -n "$ac_config_files"; then
16525   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16526 fi
16527
16528 if test -n "$ac_config_headers"; then
16529   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16530 fi
16531
16532 if test -n "$ac_config_links"; then
16533   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16534 fi
16535
16536 if test -n "$ac_config_commands"; then
16537   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16538 fi
16539
16540 cat >>$CONFIG_STATUS <<\EOF
16541
16542 ac_cs_usage="\
16543 \`$as_me' instantiates files from templates according to the
16544 current configuration.
16545
16546 Usage: $0 [OPTIONS] [FILE]...
16547
16548   -h, --help       print this help, then exit
16549   -V, --version    print version number, then exit
16550   -d, --debug      don't remove temporary files
16551       --recheck    update $as_me by reconfiguring in the same conditions
16552   --file=FILE[:TEMPLATE]
16553                    instantiate the configuration file FILE
16554   --header=FILE[:TEMPLATE]
16555                    instantiate the configuration header FILE
16556
16557 Configuration files:
16558 $config_files
16559
16560 Configuration headers:
16561 $config_headers
16562
16563 Configuration commands:
16564 $config_commands
16565
16566 Report bugs to <dickey@invisible-island.net>."
16567 EOF
16568
16569 cat >>$CONFIG_STATUS <<EOF
16570 ac_cs_version="\\
16571 config.status
16572 configured by $0, generated by GNU Autoconf 2.52.20170501,
16573   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16574
16575 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16576 Free Software Foundation, Inc.
16577 This config.status script is free software; the Free Software Foundation
16578 gives unlimited permission to copy, distribute and modify it."
16579 srcdir=$srcdir
16580 INSTALL="$INSTALL"
16581 EOF
16582
16583 cat >>$CONFIG_STATUS <<\EOF
16584 # If no file are specified by the user, then we need to provide default
16585 # value.  By we need to know if files were specified by the user.
16586 ac_need_defaults=:
16587 while test $# != 0
16588 do
16589   case $1 in
16590   --*=*)
16591     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16592     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16593     shift
16594     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16595     shift
16596     ;;
16597   -*);;
16598   *) # This is not an option, so the user has probably given explicit
16599      # arguments.
16600      ac_need_defaults=false;;
16601   esac
16602
16603   case $1 in
16604   # Handling of the options.
16605 EOF
16606 cat >>$CONFIG_STATUS <<EOF
16607   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16608     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16609     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16610 EOF
16611 cat >>$CONFIG_STATUS <<\EOF
16612   --version | --vers* | -V )
16613     echo "$ac_cs_version"; exit 0 ;;
16614   --he | --h)
16615     # Conflict between --help and --header
16616     { { echo "$as_me:16616: error: ambiguous option: $1
16617 Try \`$0 --help' for more information." >&5
16618 echo "$as_me: error: ambiguous option: $1
16619 Try \`$0 --help' for more information." >&2;}
16620    { (exit 1); exit 1; }; };;
16621   --help | --hel | -h )
16622     echo "$ac_cs_usage"; exit 0 ;;
16623   --debug | --d* | -d )
16624     debug=: ;;
16625   --file | --fil | --fi | --f )
16626     shift
16627     CONFIG_FILES="$CONFIG_FILES $1"
16628     ac_need_defaults=false;;
16629   --header | --heade | --head | --hea )
16630     shift
16631     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16632     ac_need_defaults=false;;
16633
16634   # This is an error.
16635   -*) { { echo "$as_me:16635: error: unrecognized option: $1
16636 Try \`$0 --help' for more information." >&5
16637 echo "$as_me: error: unrecognized option: $1
16638 Try \`$0 --help' for more information." >&2;}
16639    { (exit 1); exit 1; }; } ;;
16640
16641   *) ac_config_targets="$ac_config_targets $1" ;;
16642
16643   esac
16644   shift
16645 done
16646
16647 exec 5>>config.log
16648 cat >&5 << _ACEOF
16649
16650 ## ----------------------- ##
16651 ## Running config.status.  ##
16652 ## ----------------------- ##
16653
16654 This file was extended by $as_me 2.52.20170501, executed with
16655   CONFIG_FILES    = $CONFIG_FILES
16656   CONFIG_HEADERS  = $CONFIG_HEADERS
16657   CONFIG_LINKS    = $CONFIG_LINKS
16658   CONFIG_COMMANDS = $CONFIG_COMMANDS
16659   > $ac_cs_invocation
16660 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16661
16662 _ACEOF
16663 EOF
16664
16665 cat >>$CONFIG_STATUS <<EOF
16666 #
16667 # INIT-COMMANDS section.
16668 #
16669
16670 ### Special initialization commands, used to pass information from the
16671 ### configuration-run into config.status
16672
16673 AWK="$AWK"
16674 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
16675 DFT_LWR_MODEL="$DFT_LWR_MODEL"
16676 LIB_NAME="$LIB_NAME"
16677 LIB_PREFIX="$LIB_PREFIX"
16678 LIB_SUFFIX="$LIB_SUFFIX"
16679 LN_S="$LN_S"
16680 NCURSES_MAJOR="$NCURSES_MAJOR"
16681 NCURSES_MINOR="$NCURSES_MINOR"
16682 NCURSES_PATCH="$NCURSES_PATCH"
16683 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
16684 cf_cv_abi_version="$cf_cv_abi_version"
16685 cf_cv_rel_version="$cf_cv_rel_version"
16686 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
16687 cf_cv_shared_soname='$cf_cv_shared_soname'
16688 cf_cv_shlib_version="$cf_cv_shlib_version"
16689 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
16690 cf_cv_system_name="$cf_cv_system_name"
16691 host="$host"
16692 target="$target"
16693
16694 EOF
16695
16696 cat >>$CONFIG_STATUS <<\EOF
16697 for ac_config_target in $ac_config_targets
16698 do
16699   case "$ac_config_target" in
16700   # Handling of arguments.
16701   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
16702   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
16703   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16704   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16705   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
16706   *) { { echo "$as_me:16706: error: invalid argument: $ac_config_target" >&5
16707 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16708    { (exit 1); exit 1; }; };;
16709   esac
16710 done
16711
16712 # If the user did not use the arguments to specify the items to instantiate,
16713 # then the envvar interface is used.  Set only those that are not.
16714 # We use the long form for the default assignment because of an extremely
16715 # bizarre bug on SunOS 4.1.3.
16716 if $ac_need_defaults; then
16717   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16718   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16719   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16720 fi
16721
16722 # Create a temporary directory, and hook for its removal unless debugging.
16723 $debug ||
16724 {
16725   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16726   trap '{ (exit 1); exit 1; }' 1 2 13 15
16727 }
16728
16729 # Create a (secure) tmp directory for tmp files.
16730 : ${TMPDIR=/tmp}
16731 {
16732   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16733   test -n "$tmp" && test -d "$tmp"
16734 }  ||
16735 {
16736   tmp=$TMPDIR/cs$$-$RANDOM
16737   (umask 077 && mkdir $tmp)
16738 } ||
16739 {
16740    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16741    { (exit 1); exit 1; }
16742 }
16743
16744 EOF
16745
16746 cat >>$CONFIG_STATUS <<EOF
16747
16748 #
16749 # CONFIG_FILES section.
16750 #
16751
16752 # No need to generate the scripts if there are no CONFIG_FILES.
16753 # This happens for instance when ./config.status config.h
16754 if test -n "\$CONFIG_FILES"; then
16755   # Protect against being on the right side of a sed subst in config.status.
16756   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16757    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16758 s,@SHELL@,$SHELL,;t t
16759 s,@exec_prefix@,$exec_prefix,;t t
16760 s,@prefix@,$prefix,;t t
16761 s,@program_transform_name@,$program_transform_name,;t t
16762 s,@bindir@,$bindir,;t t
16763 s,@sbindir@,$sbindir,;t t
16764 s,@libexecdir@,$libexecdir,;t t
16765 s,@datarootdir@,$datarootdir,;t t
16766 s,@datadir@,$datadir,;t t
16767 s,@sysconfdir@,$sysconfdir,;t t
16768 s,@sharedstatedir@,$sharedstatedir,;t t
16769 s,@localstatedir@,$localstatedir,;t t
16770 s,@libdir@,$libdir,;t t
16771 s,@includedir@,$includedir,;t t
16772 s,@oldincludedir@,$oldincludedir,;t t
16773 s,@infodir@,$infodir,;t t
16774 s,@mandir@,$mandir,;t t
16775 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16776 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16777 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16778 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16779 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16780 s,@build_alias@,$build_alias,;t t
16781 s,@host_alias@,$host_alias,;t t
16782 s,@target_alias@,$target_alias,;t t
16783 s,@ECHO_C@,$ECHO_C,;t t
16784 s,@ECHO_N@,$ECHO_N,;t t
16785 s,@ECHO_T@,$ECHO_T,;t t
16786 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16787 s,@DEFS@,$DEFS,;t t
16788 s,@LIBS@,$LIBS,;t t
16789 s,@top_builddir@,$top_builddir,;t t
16790 s,@build@,$build,;t t
16791 s,@build_cpu@,$build_cpu,;t t
16792 s,@build_vendor@,$build_vendor,;t t
16793 s,@build_os@,$build_os,;t t
16794 s,@host@,$host,;t t
16795 s,@host_cpu@,$host_cpu,;t t
16796 s,@host_vendor@,$host_vendor,;t t
16797 s,@host_os@,$host_os,;t t
16798 s,@target@,$target,;t t
16799 s,@target_cpu@,$target_cpu,;t t
16800 s,@target_vendor@,$target_vendor,;t t
16801 s,@target_os@,$target_os,;t t
16802 s,@CC@,$CC,;t t
16803 s,@CFLAGS@,$CFLAGS,;t t
16804 s,@LDFLAGS@,$LDFLAGS,;t t
16805 s,@CPPFLAGS@,$CPPFLAGS,;t t
16806 s,@ac_ct_CC@,$ac_ct_CC,;t t
16807 s,@EXEEXT@,$EXEEXT,;t t
16808 s,@OBJEXT@,$OBJEXT,;t t
16809 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16810 s,@CPP@,$CPP,;t t
16811 s,@AWK@,$AWK,;t t
16812 s,@EGREP@,$EGREP,;t t
16813 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16814 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16815 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16816 s,@LN_S@,$LN_S,;t t
16817 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
16818 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
16819 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16820 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16821 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
16822 s,@SET_MAKE@,$SET_MAKE,;t t
16823 s,@CTAGS@,$CTAGS,;t t
16824 s,@ETAGS@,$ETAGS,;t t
16825 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16826 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16827 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
16828 s,@RANLIB@,$RANLIB,;t t
16829 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
16830 s,@LD@,$LD,;t t
16831 s,@ac_ct_LD@,$ac_ct_LD,;t t
16832 s,@AR@,$AR,;t t
16833 s,@ac_ct_AR@,$ac_ct_AR,;t t
16834 s,@ARFLAGS@,$ARFLAGS,;t t
16835 s,@DESTDIR@,$DESTDIR,;t t
16836 s,@BUILD_CC@,$BUILD_CC,;t t
16837 s,@BUILD_CPP@,$BUILD_CPP,;t t
16838 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
16839 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
16840 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
16841 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
16842 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
16843 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
16844 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
16845 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16846 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16847 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16848 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
16849 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
16850 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
16851 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16852 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16853 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
16854 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
16855 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
16856 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
16857 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
16858 s,@CC_G_OPT@,$CC_G_OPT,;t t
16859 s,@LD_MODEL@,$LD_MODEL,;t t
16860 s,@shlibdir@,$shlibdir,;t t
16861 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
16862 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16863 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
16864 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16865 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
16866 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
16867 s,@LINK_PROGS@,$LINK_PROGS,;t t
16868 s,@LINK_TESTS@,$LINK_TESTS,;t t
16869 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16870 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16871 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
16872 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
16873 s,@RPATH_LIST@,$RPATH_LIST,;t t
16874 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
16875 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
16876 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
16877 s,@PTHREAD@,$PTHREAD,;t t
16878 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
16879 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16880 s,@ECHO_LT@,$ECHO_LT,;t t
16881 s,@ECHO_LD@,$ECHO_LD,;t t
16882 s,@RULE_CC@,$RULE_CC,;t t
16883 s,@SHOW_CC@,$SHOW_CC,;t t
16884 s,@ECHO_CC@,$ECHO_CC,;t t
16885 s,@ADAFLAGS@,$ADAFLAGS,;t t
16886 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16887 s,@ADA_TRACE@,$ADA_TRACE,;t t
16888 s,@gnatmake_exists@,$gnatmake_exists,;t t
16889 s,@gprconfig_exists@,$gprconfig_exists,;t t
16890 s,@M4_exists@,$M4_exists,;t t
16891 s,@cf_ada_make@,$cf_ada_make,;t t
16892 s,@cf_ada_config@,$cf_ada_config,;t t
16893 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
16894 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
16895 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
16896 s,@cf_compile_generics@,$cf_compile_generics,;t t
16897 s,@cf_generic_objects@,$cf_generic_objects,;t t
16898 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
16899 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
16900 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
16901 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
16902 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
16903 s,@cf_ada_package@,$cf_ada_package,;t t
16904 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
16905 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
16906 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
16907 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
16908 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
16909 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16910 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
16911 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
16912 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16913 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16914 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
16915 s,@TEST_ARG2@,$TEST_ARG2,;t t
16916 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
16917 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
16918 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
16919 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
16920 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
16921 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
16922 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
16923 CEOF
16924
16925 EOF
16926
16927   cat >>$CONFIG_STATUS <<\EOF
16928   # Split the substitutions into bite-sized pieces for seds with
16929   # small command number limits, like on Digital OSF/1 and HP-UX.
16930   ac_max_sed_lines=48
16931   ac_sed_frag=1 # Number of current file.
16932   ac_beg=1 # First line for current file.
16933   ac_end=$ac_max_sed_lines # Line after last line for current file.
16934   ac_more_lines=:
16935   ac_sed_cmds=
16936   while $ac_more_lines; do
16937     if test $ac_beg -gt 1; then
16938       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16939     else
16940       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16941     fi
16942     if test ! -s $tmp/subs.frag; then
16943       ac_more_lines=false
16944     else
16945       # The purpose of the label and of the branching condition is to
16946       # speed up the sed processing (if there are no `@' at all, there
16947       # is no need to browse any of the substitutions).
16948       # These are the two extra sed commands mentioned above.
16949       (echo ':t
16950   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16951       # It is possible to make a multiline substitution using escaped newlines.
16952       # Ensure that we do not split the substitution between script fragments.
16953       ac_BEG=$ac_end
16954       ac_END=`expr $ac_end + $ac_max_sed_lines`
16955       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
16956       if test -s $tmp/subs.next; then
16957         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
16958         if test ! -s $tmp/subs.edit; then
16959           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
16960           if test ! -s $tmp/subs.edit; then
16961             if test $ac_beg -gt 1; then
16962               ac_end=`expr $ac_end - 1`
16963               continue
16964             fi
16965           fi
16966         fi
16967       fi
16968
16969       if test -z "$ac_sed_cmds"; then
16970         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16971       else
16972         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16973       fi
16974       ac_sed_frag=`expr $ac_sed_frag + 1`
16975       ac_beg=$ac_end
16976       ac_end=`expr $ac_end + $ac_max_sed_lines`
16977     fi
16978   done
16979   if test -z "$ac_sed_cmds"; then
16980     ac_sed_cmds=cat
16981   fi
16982 fi # test -n "$CONFIG_FILES"
16983
16984 EOF
16985 cat >>$CONFIG_STATUS <<\EOF
16986 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16987   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16988   case $ac_file in
16989   - | *:- | *:-:* ) # input from stdin
16990         cat >$tmp/stdin
16991         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16992         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16993   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16994         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16995   * )   ac_file_in=$ac_file.in ;;
16996   esac
16997
16998   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16999   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17000          X"$ac_file" : 'X\(//\)[^/]' \| \
17001          X"$ac_file" : 'X\(//\)$' \| \
17002          X"$ac_file" : 'X\(/\)' \| \
17003          .     : '\(.\)' 2>/dev/null ||
17004 echo X"$ac_file" |
17005     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17006           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17007           /^X\(\/\/\)$/{ s//\1/; q; }
17008           /^X\(\/\).*/{ s//\1/; q; }
17009           s/.*/./; q'`
17010   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17011     { case "$ac_dir" in
17012   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17013   *)                      as_incr_dir=.;;
17014 esac
17015 as_dummy="$ac_dir"
17016 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17017   case $as_mkdir_dir in
17018     # Skip DOS drivespec
17019     ?:) as_incr_dir=$as_mkdir_dir ;;
17020     *)
17021       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17022       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17023     ;;
17024   esac
17025 done; }
17026
17027     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17028     # A "../" for each directory in $ac_dir_suffix.
17029     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17030   else
17031     ac_dir_suffix= ac_dots=
17032   fi
17033
17034   case $srcdir in
17035   .)  ac_srcdir=.
17036       if test -z "$ac_dots"; then
17037          ac_top_srcdir=.
17038       else
17039          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17040       fi ;;
17041   [\\/]* | ?:[\\/]* )
17042       ac_srcdir=$srcdir$ac_dir_suffix;
17043       ac_top_srcdir=$srcdir ;;
17044   *) # Relative path.
17045     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17046     ac_top_srcdir=$ac_dots$srcdir ;;
17047   esac
17048
17049   case $INSTALL in
17050   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17051   *) ac_INSTALL=$ac_dots$INSTALL ;;
17052   esac
17053
17054   if test x"$ac_file" != x-; then
17055     { echo "$as_me:17055: creating $ac_file" >&5
17056 echo "$as_me: creating $ac_file" >&6;}
17057     rm -f "$ac_file"
17058   fi
17059   # Let's still pretend it is `configure' which instantiates (i.e., don't
17060   # use $as_me), people would be surprised to read:
17061   #    /* config.h.  Generated automatically by config.status.  */
17062   configure_input="Generated automatically from `echo $ac_file_in |
17063                                                  sed 's,.*/,,'` by configure."
17064
17065   # First look for the input files in the build tree, otherwise in the
17066   # src tree.
17067   ac_file_inputs=`IFS=:
17068     for f in $ac_file_in; do
17069       case $f in
17070       -) echo $tmp/stdin ;;
17071       [\\/$]*)
17072          # Absolute (can't be DOS-style, as IFS=:)
17073          test -f "$f" || { { echo "$as_me:17073: error: cannot find input file: $f" >&5
17074 echo "$as_me: error: cannot find input file: $f" >&2;}
17075    { (exit 1); exit 1; }; }
17076          echo $f;;
17077       *) # Relative
17078          if test -f "$f"; then
17079            # Build tree
17080            echo $f
17081          elif test -f "$srcdir/$f"; then
17082            # Source tree
17083            echo $srcdir/$f
17084          else
17085            # /dev/null tree
17086            { { echo "$as_me:17086: error: cannot find input file: $f" >&5
17087 echo "$as_me: error: cannot find input file: $f" >&2;}
17088    { (exit 1); exit 1; }; }
17089          fi;;
17090       esac
17091     done` || { (exit 1); exit 1; }
17092 EOF
17093 cat >>$CONFIG_STATUS <<\EOF
17094   ac_warn_datarootdir=no
17095   if test x"$ac_file" != x-; then
17096     for ac_item in $ac_file_inputs
17097     do
17098       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17099       if test -n "$ac_seen"; then
17100         ac_used=`grep '@datarootdir@' $ac_item`
17101         if test -z "$ac_used"; then
17102           { echo "$as_me:17102: WARNING: datarootdir was used implicitly but not set:
17103 $ac_seen" >&5
17104 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17105 $ac_seen" >&2;}
17106           ac_warn_datarootdir=yes
17107         fi
17108       fi
17109       ac_seen=`grep '${datarootdir}' $ac_item`
17110       if test -n "$ac_seen"; then
17111         { echo "$as_me:17111: WARNING: datarootdir was used explicitly but not set:
17112 $ac_seen" >&5
17113 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17114 $ac_seen" >&2;}
17115         ac_warn_datarootdir=yes
17116       fi
17117     done
17118   fi
17119
17120 if test "x$ac_warn_datarootdir" = xyes; then
17121   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17122 fi
17123
17124 EOF
17125 cat >>$CONFIG_STATUS <<EOF
17126   sed "$ac_vpsub
17127 $extrasub
17128 EOF
17129 cat >>$CONFIG_STATUS <<\EOF
17130 :t
17131 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17132 s,@configure_input@,$configure_input,;t t
17133 s,@srcdir@,$ac_srcdir,;t t
17134 s,@top_srcdir@,$ac_top_srcdir,;t t
17135 s,@INSTALL@,$ac_INSTALL,;t t
17136 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17137   rm -f $tmp/stdin
17138   if test x"$ac_file" != x-; then
17139     cp $tmp/out $ac_file
17140
17141     for ac_name in prefix exec_prefix datarootdir
17142     do
17143         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17144         if test -n "$ac_seen"; then
17145             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17146             if test -z "$ac_init"; then
17147               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17148               { echo "$as_me:17148: WARNING: Variable $ac_name is used but was not set:
17149 $ac_seen" >&5
17150 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17151 $ac_seen" >&2;}
17152             fi
17153         fi
17154     done
17155     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17156     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17157     if test -s $tmp/out; then
17158       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17159       { echo "$as_me:17159: WARNING: Some variables may not be substituted:
17160 $ac_seen" >&5
17161 echo "$as_me: WARNING: Some variables may not be substituted:
17162 $ac_seen" >&2;}
17163     fi
17164   else
17165     cat $tmp/out
17166   fi
17167   rm -f $tmp/out
17168
17169 done
17170 EOF
17171 cat >>$CONFIG_STATUS <<\EOF
17172
17173 #
17174 # CONFIG_HEADER section.
17175 #
17176
17177 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17178 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17179 #
17180 # ac_d sets the value in "#define NAME VALUE" lines.
17181 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17182 ac_dB='[        ].*$,\1#\2'
17183 ac_dC=' '
17184 ac_dD=',;t'
17185 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17186 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17187 ac_iB='\([      ]\),\1#\2define\3'
17188 ac_iC=' '
17189 ac_iD='\4,;t'
17190 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17191 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17192 ac_uB='$,\1#\2define\3'
17193 ac_uC=' '
17194 ac_uD=',;t'
17195
17196 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17197   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17198   case $ac_file in
17199   - | *:- | *:-:* ) # input from stdin
17200         cat >$tmp/stdin
17201         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17202         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17203   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17204         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17205   * )   ac_file_in=$ac_file.in ;;
17206   esac
17207
17208   test x"$ac_file" != x- && { echo "$as_me:17208: creating $ac_file" >&5
17209 echo "$as_me: creating $ac_file" >&6;}
17210
17211   # First look for the input files in the build tree, otherwise in the
17212   # src tree.
17213   ac_file_inputs=`IFS=:
17214     for f in $ac_file_in; do
17215       case $f in
17216       -) echo $tmp/stdin ;;
17217       [\\/$]*)
17218          # Absolute (can't be DOS-style, as IFS=:)
17219          test -f "$f" || { { echo "$as_me:17219: error: cannot find input file: $f" >&5
17220 echo "$as_me: error: cannot find input file: $f" >&2;}
17221    { (exit 1); exit 1; }; }
17222          echo $f;;
17223       *) # Relative
17224          if test -f "$f"; then
17225            # Build tree
17226            echo $f
17227          elif test -f "$srcdir/$f"; then
17228            # Source tree
17229            echo $srcdir/$f
17230          else
17231            # /dev/null tree
17232            { { echo "$as_me:17232: error: cannot find input file: $f" >&5
17233 echo "$as_me: error: cannot find input file: $f" >&2;}
17234    { (exit 1); exit 1; }; }
17235          fi;;
17236       esac
17237     done` || { (exit 1); exit 1; }
17238   # Remove the trailing spaces.
17239   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17240
17241 EOF
17242
17243 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17244 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17245 # be either 'cat' or 'sort'.
17246 cat confdefs.h | uniq >conftest.vals
17247
17248 # Break up conftest.vals because some shells have a limit on
17249 # the size of here documents, and old seds have small limits too.
17250
17251 rm -f conftest.tail
17252 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17253 while grep . conftest.vals >/dev/null
17254 do
17255   # Write chunks of a limited-size here document to conftest.frag.
17256   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17257   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17258   echo 'CEOF' >> $CONFIG_STATUS
17259   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17260   rm -f conftest.vals
17261   mv conftest.tail conftest.vals
17262 done
17263 rm -f conftest.vals
17264
17265 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17266 # marker @DEFS@.
17267 echo '  cat >> conftest.edit <<CEOF
17268 /@DEFS@/r conftest.frag
17269 /@DEFS@/d
17270 CEOF
17271 sed -f conftest.edit $tmp/in > $tmp/out
17272 rm -f $tmp/in
17273 mv $tmp/out $tmp/in
17274 rm -f conftest.edit conftest.frag
17275 ' >> $CONFIG_STATUS
17276
17277 cat >>$CONFIG_STATUS <<\EOF
17278   # Let's still pretend it is `configure' which instantiates (i.e., don't
17279   # use $as_me), people would be surprised to read:
17280   #    /* config.h.  Generated automatically by config.status.  */
17281   if test x"$ac_file" = x-; then
17282     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17283   else
17284     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17285   fi
17286   cat $tmp/in >>$tmp/config.h
17287   rm -f $tmp/in
17288   if test x"$ac_file" != x-; then
17289     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17290       { echo "$as_me:17290: $ac_file is unchanged" >&5
17291 echo "$as_me: $ac_file is unchanged" >&6;}
17292     else
17293       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17294          X"$ac_file" : 'X\(//\)[^/]' \| \
17295          X"$ac_file" : 'X\(//\)$' \| \
17296          X"$ac_file" : 'X\(/\)' \| \
17297          .     : '\(.\)' 2>/dev/null ||
17298 echo X"$ac_file" |
17299     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17300           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17301           /^X\(\/\/\)$/{ s//\1/; q; }
17302           /^X\(\/\).*/{ s//\1/; q; }
17303           s/.*/./; q'`
17304       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17305         { case "$ac_dir" in
17306   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17307   *)                      as_incr_dir=.;;
17308 esac
17309 as_dummy="$ac_dir"
17310 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17311   case $as_mkdir_dir in
17312     # Skip DOS drivespec
17313     ?:) as_incr_dir=$as_mkdir_dir ;;
17314     *)
17315       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17316       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17317     ;;
17318   esac
17319 done; }
17320
17321       fi
17322       rm -f $ac_file
17323       mv $tmp/config.h $ac_file
17324     fi
17325   else
17326     cat $tmp/config.h
17327     rm -f $tmp/config.h
17328   fi
17329 done
17330 EOF
17331 cat >>$CONFIG_STATUS <<\EOF
17332 #
17333 # CONFIG_COMMANDS section.
17334 #
17335 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17336   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17337   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17338
17339   case $ac_dest in
17340     default )
17341 if test -z "$USE_OLD_MAKERULES" ; then
17342         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
17343 fi
17344  ;;
17345   esac
17346 done
17347 EOF
17348
17349 cat >>$CONFIG_STATUS <<\EOF
17350
17351 { (exit 0); exit 0; }
17352 EOF
17353 chmod +x $CONFIG_STATUS
17354 ac_clean_files=$ac_clean_files_save
17355
17356 # configure is writing to config.log, and then calls config.status.
17357 # config.status does its own redirection, appending to config.log.
17358 # Unfortunately, on DOS this fails, as config.log is still kept open
17359 # by configure, so config.status won't be able to write to it; its
17360 # output is simply discarded.  So we exec the FD to /dev/null,
17361 # effectively closing config.log, so it can be properly (re)opened and
17362 # appended to by config.status.  When coming back to configure, we
17363 # need to make the FD available again.
17364 if test "$no_create" != yes; then
17365   ac_cs_success=:
17366   exec 5>/dev/null
17367   $SHELL $CONFIG_STATUS || ac_cs_success=false
17368   exec 5>>config.log
17369   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17370   # would make configure fail if this is the last instruction.
17371   $ac_cs_success || { (exit 1); exit 1; }
17372 fi
17373 ${MAKE:-make} preinstall