]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.1 - patch 20180616
[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 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 \$CC variable" >&5
1834 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1835 case "$CC" in
1836 (*[\ \  ]-*)
1837         echo "$as_me:1837: result: broken" >&5
1838 echo "${ECHO_T}broken" >&6
1839         { echo "$as_me:1839: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1840 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1841         # humor him...
1842         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1843         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1844         CC="$cf_prog"
1845         for cf_arg in $cf_flags
1846         do
1847                 case "x$cf_arg" in
1848                 (x-[IUDfgOW]*)
1849
1850 cf_fix_cppflags=no
1851 cf_new_cflags=
1852 cf_new_cppflags=
1853 cf_new_extra_cppflags=
1854
1855 for cf_add_cflags in $cf_arg
1856 do
1857 case $cf_fix_cppflags in
1858 (no)
1859         case $cf_add_cflags in
1860         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1861                 case $cf_add_cflags in
1862                 (-D*)
1863                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1864
1865                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1866                                 && test -z "${cf_tst_cflags}" \
1867                                 && cf_fix_cppflags=yes
1868
1869                         if test $cf_fix_cppflags = yes ; then
1870
1871         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1872         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1873
1874                                 continue
1875                         elif test "${cf_tst_cflags}" = "\"'" ; then
1876
1877         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1878         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1879
1880                                 continue
1881                         fi
1882                         ;;
1883                 esac
1884                 case "$CPPFLAGS" in
1885                 (*$cf_add_cflags)
1886                         ;;
1887                 (*)
1888                         case $cf_add_cflags in
1889                         (-D*)
1890                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1891
1892 CPPFLAGS=`echo "$CPPFLAGS" | \
1893         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1894                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1895
1896                                 ;;
1897                         esac
1898
1899         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
1900         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
1901
1902                         ;;
1903                 esac
1904                 ;;
1905         (*)
1906
1907         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
1908         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
1909
1910                 ;;
1911         esac
1912         ;;
1913 (yes)
1914
1915         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1916         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1917
1918         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1919
1920         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1921                 && test -z "${cf_tst_cflags}" \
1922                 && cf_fix_cppflags=no
1923         ;;
1924 esac
1925 done
1926
1927 if test -n "$cf_new_cflags" ; then
1928
1929         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1930         CFLAGS="${CFLAGS}$cf_new_cflags"
1931
1932 fi
1933
1934 if test -n "$cf_new_cppflags" ; then
1935
1936         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
1937         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
1938
1939 fi
1940
1941 if test -n "$cf_new_extra_cppflags" ; then
1942
1943         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
1944         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
1945
1946 fi
1947
1948                         ;;
1949                 (*)
1950                         CC="$CC $cf_arg"
1951                         ;;
1952                 esac
1953         done
1954         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
1955
1956 echo "${as_me:-configure}:1956: testing resulting CC: '$CC' ..." 1>&5
1957
1958         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
1959
1960 echo "${as_me:-configure}:1960: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
1961
1962         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
1963
1964 echo "${as_me:-configure}:1964: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
1965
1966         ;;
1967 (*)
1968         echo "$as_me:1968: result: ok" >&5
1969 echo "${ECHO_T}ok" >&6
1970         ;;
1971 esac
1972
1973 ac_ext=c
1974 ac_cpp='$CPP $CPPFLAGS'
1975 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1976 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1977 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1978 ac_main_return=return
1979 echo "$as_me:1979: checking how to run the C preprocessor" >&5
1980 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1981 # On Suns, sometimes $CPP names a directory.
1982 if test -n "$CPP" && test -d "$CPP"; then
1983   CPP=
1984 fi
1985 if test -z "$CPP"; then
1986   if test "${ac_cv_prog_CPP+set}" = set; then
1987   echo $ECHO_N "(cached) $ECHO_C" >&6
1988 else
1989       # Double quotes because CPP needs to be expanded
1990     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1991     do
1992       ac_preproc_ok=false
1993 for ac_c_preproc_warn_flag in '' yes
1994 do
1995   # Use a header file that comes with gcc, so configuring glibc
1996   # with a fresh cross-compiler works.
1997   # On the NeXT, cc -E runs the code through the compiler's parser,
1998   # not just through cpp. "Syntax error" is here to catch this case.
1999   cat >conftest.$ac_ext <<_ACEOF
2000 #line 2000 "configure"
2001 #include "confdefs.h"
2002 #include <assert.h>
2003                      Syntax error
2004 _ACEOF
2005 if { (eval echo "$as_me:2005: \"$ac_cpp conftest.$ac_ext\"") >&5
2006   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2007   ac_status=$?
2008   egrep -v '^ *\+' conftest.er1 >conftest.err
2009   rm -f conftest.er1
2010   cat conftest.err >&5
2011   echo "$as_me:2011: \$? = $ac_status" >&5
2012   (exit $ac_status); } >/dev/null; then
2013   if test -s conftest.err; then
2014     ac_cpp_err=$ac_c_preproc_warn_flag
2015   else
2016     ac_cpp_err=
2017   fi
2018 else
2019   ac_cpp_err=yes
2020 fi
2021 if test -z "$ac_cpp_err"; then
2022   :
2023 else
2024   echo "$as_me: failed program was:" >&5
2025   cat conftest.$ac_ext >&5
2026   # Broken: fails on valid input.
2027 continue
2028 fi
2029 rm -f conftest.err conftest.$ac_ext
2030
2031   # OK, works on sane cases.  Now check whether non-existent headers
2032   # can be detected and how.
2033   cat >conftest.$ac_ext <<_ACEOF
2034 #line 2034 "configure"
2035 #include "confdefs.h"
2036 #include <ac_nonexistent.h>
2037 _ACEOF
2038 if { (eval echo "$as_me:2038: \"$ac_cpp conftest.$ac_ext\"") >&5
2039   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2040   ac_status=$?
2041   egrep -v '^ *\+' conftest.er1 >conftest.err
2042   rm -f conftest.er1
2043   cat conftest.err >&5
2044   echo "$as_me:2044: \$? = $ac_status" >&5
2045   (exit $ac_status); } >/dev/null; then
2046   if test -s conftest.err; then
2047     ac_cpp_err=$ac_c_preproc_warn_flag
2048   else
2049     ac_cpp_err=
2050   fi
2051 else
2052   ac_cpp_err=yes
2053 fi
2054 if test -z "$ac_cpp_err"; then
2055   # Broken: success on invalid input.
2056 continue
2057 else
2058   echo "$as_me: failed program was:" >&5
2059   cat conftest.$ac_ext >&5
2060   # Passes both tests.
2061 ac_preproc_ok=:
2062 break
2063 fi
2064 rm -f conftest.err conftest.$ac_ext
2065
2066 done
2067 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2068 rm -f conftest.err conftest.$ac_ext
2069 if $ac_preproc_ok; then
2070   break
2071 fi
2072
2073     done
2074     ac_cv_prog_CPP=$CPP
2075
2076 fi
2077   CPP=$ac_cv_prog_CPP
2078 else
2079   ac_cv_prog_CPP=$CPP
2080 fi
2081 echo "$as_me:2081: result: $CPP" >&5
2082 echo "${ECHO_T}$CPP" >&6
2083 ac_preproc_ok=false
2084 for ac_c_preproc_warn_flag in '' yes
2085 do
2086   # Use a header file that comes with gcc, so configuring glibc
2087   # with a fresh cross-compiler works.
2088   # On the NeXT, cc -E runs the code through the compiler's parser,
2089   # not just through cpp. "Syntax error" is here to catch this case.
2090   cat >conftest.$ac_ext <<_ACEOF
2091 #line 2091 "configure"
2092 #include "confdefs.h"
2093 #include <assert.h>
2094                      Syntax error
2095 _ACEOF
2096 if { (eval echo "$as_me:2096: \"$ac_cpp conftest.$ac_ext\"") >&5
2097   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2098   ac_status=$?
2099   egrep -v '^ *\+' conftest.er1 >conftest.err
2100   rm -f conftest.er1
2101   cat conftest.err >&5
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } >/dev/null; then
2104   if test -s conftest.err; then
2105     ac_cpp_err=$ac_c_preproc_warn_flag
2106   else
2107     ac_cpp_err=
2108   fi
2109 else
2110   ac_cpp_err=yes
2111 fi
2112 if test -z "$ac_cpp_err"; then
2113   :
2114 else
2115   echo "$as_me: failed program was:" >&5
2116   cat conftest.$ac_ext >&5
2117   # Broken: fails on valid input.
2118 continue
2119 fi
2120 rm -f conftest.err conftest.$ac_ext
2121
2122   # OK, works on sane cases.  Now check whether non-existent headers
2123   # can be detected and how.
2124   cat >conftest.$ac_ext <<_ACEOF
2125 #line 2125 "configure"
2126 #include "confdefs.h"
2127 #include <ac_nonexistent.h>
2128 _ACEOF
2129 if { (eval echo "$as_me:2129: \"$ac_cpp conftest.$ac_ext\"") >&5
2130   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2131   ac_status=$?
2132   egrep -v '^ *\+' conftest.er1 >conftest.err
2133   rm -f conftest.er1
2134   cat conftest.err >&5
2135   echo "$as_me:2135: \$? = $ac_status" >&5
2136   (exit $ac_status); } >/dev/null; then
2137   if test -s conftest.err; then
2138     ac_cpp_err=$ac_c_preproc_warn_flag
2139   else
2140     ac_cpp_err=
2141   fi
2142 else
2143   ac_cpp_err=yes
2144 fi
2145 if test -z "$ac_cpp_err"; then
2146   # Broken: success on invalid input.
2147 continue
2148 else
2149   echo "$as_me: failed program was:" >&5
2150   cat conftest.$ac_ext >&5
2151   # Passes both tests.
2152 ac_preproc_ok=:
2153 break
2154 fi
2155 rm -f conftest.err conftest.$ac_ext
2156
2157 done
2158 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2159 rm -f conftest.err conftest.$ac_ext
2160 if $ac_preproc_ok; then
2161   :
2162 else
2163   { { echo "$as_me:2163: error: C preprocessor \"$CPP\" fails sanity check" >&5
2164 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2165    { (exit 1); exit 1; }; }
2166 fi
2167
2168 ac_ext=c
2169 ac_cpp='$CPP $CPPFLAGS'
2170 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2171 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2172 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2173 ac_main_return=return
2174
2175 if test $ac_cv_c_compiler_gnu = yes; then
2176     echo "$as_me:2176: checking whether $CC needs -traditional" >&5
2177 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2178 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2179   echo $ECHO_N "(cached) $ECHO_C" >&6
2180 else
2181     ac_pattern="Autoconf.*'x'"
2182   cat >conftest.$ac_ext <<_ACEOF
2183 #line 2183 "configure"
2184 #include "confdefs.h"
2185 #include <sgtty.h>
2186 int Autoconf = TIOCGETP;
2187 _ACEOF
2188 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2189   egrep "$ac_pattern" >/dev/null 2>&1; then
2190   ac_cv_prog_gcc_traditional=yes
2191 else
2192   ac_cv_prog_gcc_traditional=no
2193 fi
2194 rm -rf conftest*
2195
2196   if test $ac_cv_prog_gcc_traditional = no; then
2197     cat >conftest.$ac_ext <<_ACEOF
2198 #line 2198 "configure"
2199 #include "confdefs.h"
2200 #include <termio.h>
2201 int Autoconf = TCGETA;
2202 _ACEOF
2203 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2204   egrep "$ac_pattern" >/dev/null 2>&1; then
2205   ac_cv_prog_gcc_traditional=yes
2206 fi
2207 rm -rf conftest*
2208
2209   fi
2210 fi
2211 echo "$as_me:2211: result: $ac_cv_prog_gcc_traditional" >&5
2212 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2213   if test $ac_cv_prog_gcc_traditional = yes; then
2214     CC="$CC -traditional"
2215   fi
2216 fi
2217
2218 echo "$as_me:2218: checking whether $CC understands -c and -o together" >&5
2219 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2220 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2221   echo $ECHO_N "(cached) $ECHO_C" >&6
2222 else
2223
2224 cat > conftest.$ac_ext <<CF_EOF
2225 int main(void)
2226 {
2227         ${cf_cv_main_return:-return}(0);
2228 }
2229 CF_EOF
2230 # We do the test twice because some compilers refuse to overwrite an
2231 # existing .o file with -o, though they will create one.
2232 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2233 if { (eval echo "$as_me:2233: \"$ac_try\"") >&5
2234   (eval $ac_try) 2>&5
2235   ac_status=$?
2236   echo "$as_me:2236: \$? = $ac_status" >&5
2237   (exit $ac_status); } &&
2238   test -f conftest2.$ac_objext && { (eval echo "$as_me:2238: \"$ac_try\"") >&5
2239   (eval $ac_try) 2>&5
2240   ac_status=$?
2241   echo "$as_me:2241: \$? = $ac_status" >&5
2242   (exit $ac_status); };
2243 then
2244   eval cf_cv_prog_CC_c_o=yes
2245 else
2246   eval cf_cv_prog_CC_c_o=no
2247 fi
2248 rm -rf conftest*
2249
2250 fi
2251 if test $cf_cv_prog_CC_c_o = yes; then
2252   echo "$as_me:2252: result: yes" >&5
2253 echo "${ECHO_T}yes" >&6
2254 else
2255   echo "$as_me:2255: result: no" >&5
2256 echo "${ECHO_T}no" >&6
2257 fi
2258
2259 test "$program_prefix" != NONE &&
2260   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2261 # Use a double $ so make ignores it.
2262 test "$program_suffix" != NONE &&
2263   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2264 # Double any \ or $.  echo might interpret backslashes.
2265 # By default was `s,x,x', remove it if useless.
2266 cat <<\_ACEOF >conftest.sed
2267 s/[\\$]/&&/g;s/;s,x,x,$//
2268 _ACEOF
2269 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2270 rm conftest.sed
2271
2272 for ac_prog in mawk gawk nawk awk
2273 do
2274   # Extract the first word of "$ac_prog", so it can be a program name with args.
2275 set dummy $ac_prog; ac_word=$2
2276 echo "$as_me:2276: checking for $ac_word" >&5
2277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2278 if test "${ac_cv_prog_AWK+set}" = set; then
2279   echo $ECHO_N "(cached) $ECHO_C" >&6
2280 else
2281   if test -n "$AWK"; then
2282   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2283 else
2284   ac_save_IFS=$IFS; IFS=$ac_path_separator
2285 ac_dummy="$PATH"
2286 for ac_dir in $ac_dummy; do
2287   IFS=$ac_save_IFS
2288   test -z "$ac_dir" && ac_dir=.
2289   $as_executable_p "$ac_dir/$ac_word" || continue
2290 ac_cv_prog_AWK="$ac_prog"
2291 echo "$as_me:2291: found $ac_dir/$ac_word" >&5
2292 break
2293 done
2294
2295 fi
2296 fi
2297 AWK=$ac_cv_prog_AWK
2298 if test -n "$AWK"; then
2299   echo "$as_me:2299: result: $AWK" >&5
2300 echo "${ECHO_T}$AWK" >&6
2301 else
2302   echo "$as_me:2302: result: no" >&5
2303 echo "${ECHO_T}no" >&6
2304 fi
2305
2306   test -n "$AWK" && break
2307 done
2308
2309 test -z "$AWK" && { { echo "$as_me:2309: error: No awk program found" >&5
2310 echo "$as_me: error: No awk program found" >&2;}
2311    { (exit 1); exit 1; }; }
2312
2313 echo "$as_me:2313: checking for egrep" >&5
2314 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2315 if test "${ac_cv_prog_egrep+set}" = set; then
2316   echo $ECHO_N "(cached) $ECHO_C" >&6
2317 else
2318   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2319                 then ac_cv_prog_egrep='grep -E'
2320                 else ac_cv_prog_egrep='egrep'
2321         fi
2322 fi
2323 echo "$as_me:2323: result: $ac_cv_prog_egrep" >&5
2324 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2325         EGREP=$ac_cv_prog_egrep
2326
2327         test -z "$EGREP" && { { echo "$as_me:2327: error: No egrep program found" >&5
2328 echo "$as_me: error: No egrep program found" >&2;}
2329    { (exit 1); exit 1; }; }
2330
2331 # Find a good install program.  We prefer a C program (faster),
2332 # so one script is as good as another.  But avoid the broken or
2333 # incompatible versions:
2334 # SysV /etc/install, /usr/sbin/install
2335 # SunOS /usr/etc/install
2336 # IRIX /sbin/install
2337 # AIX /bin/install
2338 # AmigaOS /C/install, which installs bootblocks on floppy discs
2339 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2340 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2341 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2342 # ./install, which can be erroneously created by make from ./install.sh.
2343 echo "$as_me:2343: checking for a BSD compatible install" >&5
2344 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2345 if test -z "$INSTALL"; then
2346 if test "${ac_cv_path_install+set}" = set; then
2347   echo $ECHO_N "(cached) $ECHO_C" >&6
2348 else
2349     ac_save_IFS=$IFS; IFS=$ac_path_separator
2350   for ac_dir in $PATH; do
2351     IFS=$ac_save_IFS
2352     # Account for people who put trailing slashes in PATH elements.
2353     case $ac_dir/ in
2354     / | ./ | .// | /cC/* \
2355     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2356     | /usr/ucb/* ) ;;
2357     *)
2358       # OSF1 and SCO ODT 3.0 have their own names for install.
2359       # Don't use installbsd from OSF since it installs stuff as root
2360       # by default.
2361       for ac_prog in ginstall scoinst install; do
2362         if $as_executable_p "$ac_dir/$ac_prog"; then
2363           if test $ac_prog = install &&
2364             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2365             # AIX install.  It has an incompatible calling convention.
2366             :
2367           elif test $ac_prog = install &&
2368             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2369             # program-specific install script used by HP pwplus--don't use.
2370             :
2371           else
2372             ac_cv_path_install="$ac_dir/$ac_prog -c"
2373             break 2
2374           fi
2375         fi
2376       done
2377       ;;
2378     esac
2379   done
2380
2381 fi
2382   if test "${ac_cv_path_install+set}" = set; then
2383     INSTALL=$ac_cv_path_install
2384   else
2385     # As a last resort, use the slow shell script.  We don't cache a
2386     # path for INSTALL within a source directory, because that will
2387     # break other packages using the cache if that directory is
2388     # removed, or if the path is relative.
2389     INSTALL=$ac_install_sh
2390   fi
2391 fi
2392 echo "$as_me:2392: result: $INSTALL" >&5
2393 echo "${ECHO_T}$INSTALL" >&6
2394
2395 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2396 # It thinks the first close brace ends the variable substitution.
2397 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2398
2399 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2400
2401 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2402
2403 echo "$as_me:2403: checking whether ln -s works" >&5
2404 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2405 LN_S=$as_ln_s
2406 if test "$LN_S" = "ln -s"; then
2407   echo "$as_me:2407: result: yes" >&5
2408 echo "${ECHO_T}yes" >&6
2409 else
2410   echo "$as_me:2410: result: no, using $LN_S" >&5
2411 echo "${ECHO_T}no, using $LN_S" >&6
2412 fi
2413
2414 echo "$as_me:2414: checking if $LN_S -f options work" >&5
2415 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2416
2417 rm -f conf$$.src conf$$dst
2418 echo >conf$$.dst
2419 echo first >conf$$.src
2420 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2421         cf_prog_ln_sf=yes
2422 else
2423         cf_prog_ln_sf=no
2424 fi
2425 rm -f conf$$.dst conf$$src
2426 echo "$as_me:2426: result: $cf_prog_ln_sf" >&5
2427 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2428
2429 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2430
2431 # Find a good install program.  We prefer a C program (faster),
2432 # so one script is as good as another.  But avoid the broken or
2433 # incompatible versions:
2434 # SysV /etc/install, /usr/sbin/install
2435 # SunOS /usr/etc/install
2436 # IRIX /sbin/install
2437 # AIX /bin/install
2438 # AmigaOS /C/install, which installs bootblocks on floppy discs
2439 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2440 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2441 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2442 # ./install, which can be erroneously created by make from ./install.sh.
2443 echo "$as_me:2443: checking for a BSD compatible install" >&5
2444 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2445 if test -z "$INSTALL"; then
2446 if test "${ac_cv_path_install+set}" = set; then
2447   echo $ECHO_N "(cached) $ECHO_C" >&6
2448 else
2449     ac_save_IFS=$IFS; IFS=$ac_path_separator
2450   for ac_dir in $PATH; do
2451     IFS=$ac_save_IFS
2452     # Account for people who put trailing slashes in PATH elements.
2453     case $ac_dir/ in
2454     / | ./ | .// | /cC/* \
2455     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2456     | /usr/ucb/* ) ;;
2457     *)
2458       # OSF1 and SCO ODT 3.0 have their own names for install.
2459       # Don't use installbsd from OSF since it installs stuff as root
2460       # by default.
2461       for ac_prog in ginstall scoinst install; do
2462         if $as_executable_p "$ac_dir/$ac_prog"; then
2463           if test $ac_prog = install &&
2464             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2465             # AIX install.  It has an incompatible calling convention.
2466             :
2467           elif test $ac_prog = install &&
2468             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2469             # program-specific install script used by HP pwplus--don't use.
2470             :
2471           else
2472             ac_cv_path_install="$ac_dir/$ac_prog -c"
2473             break 2
2474           fi
2475         fi
2476       done
2477       ;;
2478     esac
2479   done
2480
2481 fi
2482   if test "${ac_cv_path_install+set}" = set; then
2483     INSTALL=$ac_cv_path_install
2484   else
2485     # As a last resort, use the slow shell script.  We don't cache a
2486     # path for INSTALL within a source directory, because that will
2487     # break other packages using the cache if that directory is
2488     # removed, or if the path is relative.
2489     INSTALL=$ac_install_sh
2490   fi
2491 fi
2492 echo "$as_me:2492: result: $INSTALL" >&5
2493 echo "${ECHO_T}$INSTALL" >&6
2494
2495 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2496 # It thinks the first close brace ends the variable substitution.
2497 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2498
2499 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2500
2501 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2502
2503 case $INSTALL in
2504 (/*)
2505         ;;
2506 (*)
2507         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2508         test -z "$cf_dir" && cf_dir=.
2509         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2510         ;;
2511 esac
2512
2513 echo "$as_me:2513: checking if you want to install stripped executables" >&5
2514 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2515
2516 # Check whether --enable-stripping or --disable-stripping was given.
2517 if test "${enable_stripping+set}" = set; then
2518   enableval="$enable_stripping"
2519   test "$enableval" != no && enableval=yes
2520         if test "$enableval" != "yes" ; then
2521     with_stripping=no
2522         else
2523                 with_stripping=yes
2524         fi
2525 else
2526   enableval=yes
2527         with_stripping=yes
2528
2529 fi;
2530 echo "$as_me:2530: result: $with_stripping" >&5
2531 echo "${ECHO_T}$with_stripping" >&6
2532
2533 if test "$with_stripping" = yes
2534 then
2535         INSTALL_OPT_S="-s"
2536 else
2537         INSTALL_OPT_S=
2538 fi
2539
2540 echo "$as_me:2540: checking if install needs to be told about ownership" >&5
2541 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2542 case `$ac_config_guess` in
2543 (*minix)
2544         with_install_o=yes
2545         ;;
2546 (*)
2547         with_install_o=no
2548         ;;
2549 esac
2550
2551 echo "$as_me:2551: result: $with_install_o" >&5
2552 echo "${ECHO_T}$with_install_o" >&6
2553 if test "x$with_install_o" = xyes
2554 then
2555         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'`
2556 else
2557         INSTALL_OPT_O=
2558 fi
2559
2560 echo "$as_me:2560: checking for long file names" >&5
2561 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2562 if test "${ac_cv_sys_long_file_names+set}" = set; then
2563   echo $ECHO_N "(cached) $ECHO_C" >&6
2564 else
2565   ac_cv_sys_long_file_names=yes
2566 # Test for long file names in all the places we know might matter:
2567 #      .                the current directory, where building will happen
2568 #      $prefix/lib      where we will be installing things
2569 #      $exec_prefix/lib likewise
2570 # eval it to expand exec_prefix.
2571 #      $TMPDIR          if set, where it might want to write temporary files
2572 # if $TMPDIR is not set:
2573 #      /tmp             where it might want to write temporary files
2574 #      /var/tmp         likewise
2575 #      /usr/tmp         likewise
2576 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2577   ac_tmpdirs=$TMPDIR
2578 else
2579   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2580 fi
2581 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2582   test -d $ac_dir || continue
2583   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2584   ac_xdir=$ac_dir/cf$$
2585   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2586   ac_tf1=$ac_xdir/conftest9012345
2587   ac_tf2=$ac_xdir/conftest9012346
2588   (echo 1 >$ac_tf1) 2>/dev/null
2589   (echo 2 >$ac_tf2) 2>/dev/null
2590   ac_val=`cat $ac_tf1 2>/dev/null`
2591   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2592     ac_cv_sys_long_file_names=no
2593     rm -rf $ac_xdir 2>/dev/null
2594     break
2595   fi
2596   rm -rf $ac_xdir 2>/dev/null
2597 done
2598 fi
2599 echo "$as_me:2599: result: $ac_cv_sys_long_file_names" >&5
2600 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2601 if test $ac_cv_sys_long_file_names = yes; then
2602
2603 cat >>confdefs.h <<\EOF
2604 #define HAVE_LONG_FILE_NAMES 1
2605 EOF
2606
2607 fi
2608
2609 # if we find pkg-config, check if we should install the ".pc" files.
2610
2611 echo "$as_me:2611: checking if you want to use pkg-config" >&5
2612 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2613
2614 # Check whether --with-pkg-config or --without-pkg-config was given.
2615 if test "${with_pkg_config+set}" = set; then
2616   withval="$with_pkg_config"
2617   cf_pkg_config=$withval
2618 else
2619   cf_pkg_config=yes
2620 fi;
2621 echo "$as_me:2621: result: $cf_pkg_config" >&5
2622 echo "${ECHO_T}$cf_pkg_config" >&6
2623
2624 case $cf_pkg_config in
2625 (no)
2626         PKG_CONFIG=none
2627         ;;
2628 (yes)
2629
2630 if test -n "$ac_tool_prefix"; then
2631   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2632 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2633 echo "$as_me:2633: checking for $ac_word" >&5
2634 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2635 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2636   echo $ECHO_N "(cached) $ECHO_C" >&6
2637 else
2638   case $PKG_CONFIG in
2639   [\\/]* | ?:[\\/]*)
2640   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2641   ;;
2642   *)
2643   ac_save_IFS=$IFS; IFS=$ac_path_separator
2644 ac_dummy="$PATH"
2645 for ac_dir in $ac_dummy; do
2646   IFS=$ac_save_IFS
2647   test -z "$ac_dir" && ac_dir=.
2648   if $as_executable_p "$ac_dir/$ac_word"; then
2649    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2650    echo "$as_me:2650: found $ac_dir/$ac_word" >&5
2651    break
2652 fi
2653 done
2654
2655   ;;
2656 esac
2657 fi
2658 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2659
2660 if test -n "$PKG_CONFIG"; then
2661   echo "$as_me:2661: result: $PKG_CONFIG" >&5
2662 echo "${ECHO_T}$PKG_CONFIG" >&6
2663 else
2664   echo "$as_me:2664: result: no" >&5
2665 echo "${ECHO_T}no" >&6
2666 fi
2667
2668 fi
2669 if test -z "$ac_cv_path_PKG_CONFIG"; then
2670   ac_pt_PKG_CONFIG=$PKG_CONFIG
2671   # Extract the first word of "pkg-config", so it can be a program name with args.
2672 set dummy pkg-config; ac_word=$2
2673 echo "$as_me:2673: checking for $ac_word" >&5
2674 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2675 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2676   echo $ECHO_N "(cached) $ECHO_C" >&6
2677 else
2678   case $ac_pt_PKG_CONFIG in
2679   [\\/]* | ?:[\\/]*)
2680   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2681   ;;
2682   *)
2683   ac_save_IFS=$IFS; IFS=$ac_path_separator
2684 ac_dummy="$PATH"
2685 for ac_dir in $ac_dummy; do
2686   IFS=$ac_save_IFS
2687   test -z "$ac_dir" && ac_dir=.
2688   if $as_executable_p "$ac_dir/$ac_word"; then
2689    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2690    echo "$as_me:2690: found $ac_dir/$ac_word" >&5
2691    break
2692 fi
2693 done
2694
2695   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2696   ;;
2697 esac
2698 fi
2699 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2700
2701 if test -n "$ac_pt_PKG_CONFIG"; then
2702   echo "$as_me:2702: result: $ac_pt_PKG_CONFIG" >&5
2703 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2704 else
2705   echo "$as_me:2705: result: no" >&5
2706 echo "${ECHO_T}no" >&6
2707 fi
2708
2709   PKG_CONFIG=$ac_pt_PKG_CONFIG
2710 else
2711   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2712 fi
2713
2714         ;;
2715 (*)
2716         PKG_CONFIG=$withval
2717         ;;
2718 esac
2719
2720 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2721 if test "$PKG_CONFIG" != none ; then
2722
2723 if test "x$prefix" != xNONE; then
2724         cf_path_syntax="$prefix"
2725 else
2726         cf_path_syntax="$ac_default_prefix"
2727 fi
2728
2729 case ".$PKG_CONFIG" in
2730 (.\$\(*\)*|.\'*\'*)
2731         ;;
2732 (..|./*|.\\*)
2733         ;;
2734 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2735         ;;
2736 (.\${*prefix}*|.\${*dir}*)
2737         eval PKG_CONFIG="$PKG_CONFIG"
2738         case ".$PKG_CONFIG" in
2739         (.NONE/*)
2740                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2741                 ;;
2742         esac
2743         ;;
2744 (.no|.NONE/*)
2745         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2746         ;;
2747 (*)
2748         { { echo "$as_me:2748: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2749 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2750    { (exit 1); exit 1; }; }
2751         ;;
2752 esac
2753
2754 elif test "x$cf_pkg_config" != xno ; then
2755         { echo "$as_me:2755: WARNING: pkg-config is not installed" >&5
2756 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2757 fi
2758
2759 case $PKG_CONFIG in
2760 (no|none|yes)
2761         echo "$as_me:2761: checking for pkg-config library directory" >&5
2762 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2763         ;;
2764 (*)
2765         echo "$as_me:2765: checking for $PKG_CONFIG library directory" >&5
2766 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2767         ;;
2768 esac
2769
2770 PKG_CONFIG_LIBDIR=no
2771
2772 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2773 if test "${with_pkg_config_libdir+set}" = set; then
2774   withval="$with_pkg_config_libdir"
2775   PKG_CONFIG_LIBDIR=$withval
2776 else
2777   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2778 fi;
2779
2780 case x$PKG_CONFIG_LIBDIR in
2781 (x/*)
2782         ;;
2783 (xyes)
2784         # Look for the library directory using the same prefix as the executable
2785         if test "x$PKG_CONFIG" = xnone
2786         then
2787                 cf_path=$prefix
2788         else
2789                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2790         fi
2791
2792         # If you don't like using the default architecture, you have to specify the
2793         # intended library directory and corresponding compiler/linker options.
2794         #
2795         # This case allows for Debian's 2014-flavor of multiarch, along with the
2796         # most common variations before that point.  Some other variants spell the
2797         # directory differently, e.g., "pkg-config", and put it in unusual places.
2798         # pkg-config has always been poorly standardized, which is ironic...
2799         case x`(arch) 2>/dev/null` in
2800         (*64)
2801                 cf_search_path="\
2802                         $cf_path/lib/*64-linux-gnu \
2803                         $cf_path/share \
2804                         $cf_path/lib64 \
2805                         $cf_path/lib32 \
2806                         $cf_path/lib"
2807                 ;;
2808         (*)
2809                 cf_search_path="\
2810                         $cf_path/lib/*-linux-gnu \
2811                         $cf_path/share \
2812                         $cf_path/lib32 \
2813                         $cf_path/lib \
2814                         $cf_path/libdata"
2815                 ;;
2816         esac
2817
2818         test -n "$verbose" && echo "    list..." 1>&6
2819
2820 echo "${as_me:-configure}:2820: testing list... ..." 1>&5
2821
2822         for cf_config in $cf_search_path
2823         do
2824                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2825
2826 echo "${as_me:-configure}:2826: testing checking $cf_config/pkgconfig ..." 1>&5
2827
2828                 if test -d $cf_config/pkgconfig
2829                 then
2830                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2831                         echo "$as_me:2831: checking done" >&5
2832 echo $ECHO_N "checking done... $ECHO_C" >&6
2833                         break
2834                 fi
2835         done
2836         ;;
2837 (*)
2838         ;;
2839 esac
2840
2841 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2842         echo "$as_me:2842: result: $PKG_CONFIG_LIBDIR" >&5
2843 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2844 fi
2845
2846 echo "$as_me:2846: checking if you want to build test-programs" >&5
2847 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2848
2849 # Check whether --with-tests or --without-tests was given.
2850 if test "${with_tests+set}" = set; then
2851   withval="$with_tests"
2852   cf_with_tests=$withval
2853 else
2854   cf_with_tests=yes
2855 fi;
2856 echo "$as_me:2856: result: $cf_with_tests" >&5
2857 echo "${ECHO_T}$cf_with_tests" >&6
2858
2859 echo "$as_me:2859: checking if we should assume mixed-case filenames" >&5
2860 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2861
2862 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2863 if test "${enable_mixed_case+set}" = set; then
2864   enableval="$enable_mixed_case"
2865   enable_mixedcase=$enableval
2866 else
2867   enable_mixedcase=auto
2868 fi;
2869 echo "$as_me:2869: result: $enable_mixedcase" >&5
2870 echo "${ECHO_T}$enable_mixedcase" >&6
2871 if test "$enable_mixedcase" = "auto" ; then
2872
2873 echo "$as_me:2873: checking if filesystem supports mixed-case filenames" >&5
2874 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2875 if test "${cf_cv_mixedcase+set}" = set; then
2876   echo $ECHO_N "(cached) $ECHO_C" >&6
2877 else
2878
2879 if test "$cross_compiling" = yes ; then
2880         case $target_alias in
2881         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2882                 cf_cv_mixedcase=no
2883                 ;;
2884         (*)
2885                 cf_cv_mixedcase=yes
2886                 ;;
2887         esac
2888 else
2889         rm -f conftest CONFTEST
2890         echo test >conftest
2891         if test -f CONFTEST ; then
2892                 cf_cv_mixedcase=no
2893         else
2894                 cf_cv_mixedcase=yes
2895         fi
2896         rm -f conftest CONFTEST
2897 fi
2898
2899 fi
2900 echo "$as_me:2900: result: $cf_cv_mixedcase" >&5
2901 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2902 test "$cf_cv_mixedcase" = yes &&
2903 cat >>confdefs.h <<\EOF
2904 #define MIXEDCASE_FILENAMES 1
2905 EOF
2906
2907 else
2908         cf_cv_mixedcase=$enable_mixedcase
2909         if test "$enable_mixedcase" = "yes" ; then
2910                 cat >>confdefs.h <<\EOF
2911 #define MIXEDCASE_FILENAMES 1
2912 EOF
2913
2914         fi
2915 fi
2916
2917 # do this after mixed-case option (tags/TAGS is not as important as tic).
2918 echo "$as_me:2918: checking whether ${MAKE-make} sets \${MAKE}" >&5
2919 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2920 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2921 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2922   echo $ECHO_N "(cached) $ECHO_C" >&6
2923 else
2924   cat >conftest.make <<\EOF
2925 all:
2926         @echo 'ac_maketemp="${MAKE}"'
2927 EOF
2928 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2929 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2930 if test -n "$ac_maketemp"; then
2931   eval ac_cv_prog_make_${ac_make}_set=yes
2932 else
2933   eval ac_cv_prog_make_${ac_make}_set=no
2934 fi
2935 rm -f conftest.make
2936 fi
2937 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2938   echo "$as_me:2938: result: yes" >&5
2939 echo "${ECHO_T}yes" >&6
2940   SET_MAKE=
2941 else
2942   echo "$as_me:2942: result: no" >&5
2943 echo "${ECHO_T}no" >&6
2944   SET_MAKE="MAKE=${MAKE-make}"
2945 fi
2946
2947 for ac_prog in exctags ctags
2948 do
2949   # Extract the first word of "$ac_prog", so it can be a program name with args.
2950 set dummy $ac_prog; ac_word=$2
2951 echo "$as_me:2951: checking for $ac_word" >&5
2952 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2953 if test "${ac_cv_prog_CTAGS+set}" = set; then
2954   echo $ECHO_N "(cached) $ECHO_C" >&6
2955 else
2956   if test -n "$CTAGS"; then
2957   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2958 else
2959   ac_save_IFS=$IFS; IFS=$ac_path_separator
2960 ac_dummy="$PATH"
2961 for ac_dir in $ac_dummy; do
2962   IFS=$ac_save_IFS
2963   test -z "$ac_dir" && ac_dir=.
2964   $as_executable_p "$ac_dir/$ac_word" || continue
2965 ac_cv_prog_CTAGS="$ac_prog"
2966 echo "$as_me:2966: found $ac_dir/$ac_word" >&5
2967 break
2968 done
2969
2970 fi
2971 fi
2972 CTAGS=$ac_cv_prog_CTAGS
2973 if test -n "$CTAGS"; then
2974   echo "$as_me:2974: result: $CTAGS" >&5
2975 echo "${ECHO_T}$CTAGS" >&6
2976 else
2977   echo "$as_me:2977: result: no" >&5
2978 echo "${ECHO_T}no" >&6
2979 fi
2980
2981   test -n "$CTAGS" && break
2982 done
2983
2984 for ac_prog in exetags etags
2985 do
2986   # Extract the first word of "$ac_prog", so it can be a program name with args.
2987 set dummy $ac_prog; ac_word=$2
2988 echo "$as_me:2988: checking for $ac_word" >&5
2989 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2990 if test "${ac_cv_prog_ETAGS+set}" = set; then
2991   echo $ECHO_N "(cached) $ECHO_C" >&6
2992 else
2993   if test -n "$ETAGS"; then
2994   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2995 else
2996   ac_save_IFS=$IFS; IFS=$ac_path_separator
2997 ac_dummy="$PATH"
2998 for ac_dir in $ac_dummy; do
2999   IFS=$ac_save_IFS
3000   test -z "$ac_dir" && ac_dir=.
3001   $as_executable_p "$ac_dir/$ac_word" || continue
3002 ac_cv_prog_ETAGS="$ac_prog"
3003 echo "$as_me:3003: found $ac_dir/$ac_word" >&5
3004 break
3005 done
3006
3007 fi
3008 fi
3009 ETAGS=$ac_cv_prog_ETAGS
3010 if test -n "$ETAGS"; then
3011   echo "$as_me:3011: result: $ETAGS" >&5
3012 echo "${ECHO_T}$ETAGS" >&6
3013 else
3014   echo "$as_me:3014: result: no" >&5
3015 echo "${ECHO_T}no" >&6
3016 fi
3017
3018   test -n "$ETAGS" && break
3019 done
3020
3021 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
3022 set dummy ${CTAGS:-ctags}; ac_word=$2
3023 echo "$as_me:3023: checking for $ac_word" >&5
3024 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3025 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
3026   echo $ECHO_N "(cached) $ECHO_C" >&6
3027 else
3028   if test -n "$MAKE_LOWER_TAGS"; then
3029   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
3030 else
3031   ac_save_IFS=$IFS; IFS=$ac_path_separator
3032 ac_dummy="$PATH"
3033 for ac_dir in $ac_dummy; do
3034   IFS=$ac_save_IFS
3035   test -z "$ac_dir" && ac_dir=.
3036   $as_executable_p "$ac_dir/$ac_word" || continue
3037 ac_cv_prog_MAKE_LOWER_TAGS="yes"
3038 echo "$as_me:3038: found $ac_dir/$ac_word" >&5
3039 break
3040 done
3041
3042   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3043 fi
3044 fi
3045 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3046 if test -n "$MAKE_LOWER_TAGS"; then
3047   echo "$as_me:3047: result: $MAKE_LOWER_TAGS" >&5
3048 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3049 else
3050   echo "$as_me:3050: result: no" >&5
3051 echo "${ECHO_T}no" >&6
3052 fi
3053
3054 if test "$cf_cv_mixedcase" = yes ; then
3055         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3056 set dummy ${ETAGS:-etags}; ac_word=$2
3057 echo "$as_me:3057: checking for $ac_word" >&5
3058 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3059 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3060   echo $ECHO_N "(cached) $ECHO_C" >&6
3061 else
3062   if test -n "$MAKE_UPPER_TAGS"; then
3063   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3064 else
3065   ac_save_IFS=$IFS; IFS=$ac_path_separator
3066 ac_dummy="$PATH"
3067 for ac_dir in $ac_dummy; do
3068   IFS=$ac_save_IFS
3069   test -z "$ac_dir" && ac_dir=.
3070   $as_executable_p "$ac_dir/$ac_word" || continue
3071 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3072 echo "$as_me:3072: found $ac_dir/$ac_word" >&5
3073 break
3074 done
3075
3076   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3077 fi
3078 fi
3079 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3080 if test -n "$MAKE_UPPER_TAGS"; then
3081   echo "$as_me:3081: result: $MAKE_UPPER_TAGS" >&5
3082 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3083 else
3084   echo "$as_me:3084: result: no" >&5
3085 echo "${ECHO_T}no" >&6
3086 fi
3087
3088 else
3089         MAKE_UPPER_TAGS=no
3090 fi
3091
3092 if test "$MAKE_UPPER_TAGS" = yes ; then
3093         MAKE_UPPER_TAGS=
3094 else
3095         MAKE_UPPER_TAGS="#"
3096 fi
3097
3098 if test "$MAKE_LOWER_TAGS" = yes ; then
3099         MAKE_LOWER_TAGS=
3100 else
3101         MAKE_LOWER_TAGS="#"
3102 fi
3103
3104 echo "$as_me:3104: checking for makeflags variable" >&5
3105 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
3106 if test "${cf_cv_makeflags+set}" = set; then
3107   echo $ECHO_N "(cached) $ECHO_C" >&6
3108 else
3109
3110         cf_cv_makeflags=''
3111         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
3112         do
3113                 cat >cf_makeflags.tmp <<CF_EOF
3114 SHELL = $SHELL
3115 all :
3116         @ echo '.$cf_option'
3117 CF_EOF
3118                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
3119                 case "$cf_result" in
3120                 (.*k|.*kw)
3121                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
3122                         case "$cf_result" in
3123                         (.*CC=*)        cf_cv_makeflags=
3124                                 ;;
3125                         (*)     cf_cv_makeflags=$cf_option
3126                                 ;;
3127                         esac
3128                         break
3129                         ;;
3130                 (.-)
3131                         ;;
3132                 (*)
3133
3134 echo "${as_me:-configure}:3134: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5
3135
3136                         ;;
3137                 esac
3138         done
3139         rm -f cf_makeflags.tmp
3140
3141 fi
3142 echo "$as_me:3142: result: $cf_cv_makeflags" >&5
3143 echo "${ECHO_T}$cf_cv_makeflags" >&6
3144
3145 if test -n "$ac_tool_prefix"; then
3146   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3147 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3148 echo "$as_me:3148: checking for $ac_word" >&5
3149 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3150 if test "${ac_cv_prog_RANLIB+set}" = set; then
3151   echo $ECHO_N "(cached) $ECHO_C" >&6
3152 else
3153   if test -n "$RANLIB"; then
3154   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3155 else
3156   ac_save_IFS=$IFS; IFS=$ac_path_separator
3157 ac_dummy="$PATH"
3158 for ac_dir in $ac_dummy; do
3159   IFS=$ac_save_IFS
3160   test -z "$ac_dir" && ac_dir=.
3161   $as_executable_p "$ac_dir/$ac_word" || continue
3162 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3163 echo "$as_me:3163: found $ac_dir/$ac_word" >&5
3164 break
3165 done
3166
3167 fi
3168 fi
3169 RANLIB=$ac_cv_prog_RANLIB
3170 if test -n "$RANLIB"; then
3171   echo "$as_me:3171: result: $RANLIB" >&5
3172 echo "${ECHO_T}$RANLIB" >&6
3173 else
3174   echo "$as_me:3174: result: no" >&5
3175 echo "${ECHO_T}no" >&6
3176 fi
3177
3178 fi
3179 if test -z "$ac_cv_prog_RANLIB"; then
3180   ac_ct_RANLIB=$RANLIB
3181   # Extract the first word of "ranlib", so it can be a program name with args.
3182 set dummy ranlib; ac_word=$2
3183 echo "$as_me:3183: checking for $ac_word" >&5
3184 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3185 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3186   echo $ECHO_N "(cached) $ECHO_C" >&6
3187 else
3188   if test -n "$ac_ct_RANLIB"; then
3189   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3190 else
3191   ac_save_IFS=$IFS; IFS=$ac_path_separator
3192 ac_dummy="$PATH"
3193 for ac_dir in $ac_dummy; do
3194   IFS=$ac_save_IFS
3195   test -z "$ac_dir" && ac_dir=.
3196   $as_executable_p "$ac_dir/$ac_word" || continue
3197 ac_cv_prog_ac_ct_RANLIB="ranlib"
3198 echo "$as_me:3198: found $ac_dir/$ac_word" >&5
3199 break
3200 done
3201
3202   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3203 fi
3204 fi
3205 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3206 if test -n "$ac_ct_RANLIB"; then
3207   echo "$as_me:3207: result: $ac_ct_RANLIB" >&5
3208 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3209 else
3210   echo "$as_me:3210: result: no" >&5
3211 echo "${ECHO_T}no" >&6
3212 fi
3213
3214   RANLIB=$ac_ct_RANLIB
3215 else
3216   RANLIB="$ac_cv_prog_RANLIB"
3217 fi
3218
3219 if test -n "$ac_tool_prefix"; then
3220   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3221 set dummy ${ac_tool_prefix}ld; ac_word=$2
3222 echo "$as_me:3222: checking for $ac_word" >&5
3223 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3224 if test "${ac_cv_prog_LD+set}" = set; then
3225   echo $ECHO_N "(cached) $ECHO_C" >&6
3226 else
3227   if test -n "$LD"; then
3228   ac_cv_prog_LD="$LD" # Let the user override the test.
3229 else
3230   ac_save_IFS=$IFS; IFS=$ac_path_separator
3231 ac_dummy="$PATH"
3232 for ac_dir in $ac_dummy; do
3233   IFS=$ac_save_IFS
3234   test -z "$ac_dir" && ac_dir=.
3235   $as_executable_p "$ac_dir/$ac_word" || continue
3236 ac_cv_prog_LD="${ac_tool_prefix}ld"
3237 echo "$as_me:3237: found $ac_dir/$ac_word" >&5
3238 break
3239 done
3240
3241 fi
3242 fi
3243 LD=$ac_cv_prog_LD
3244 if test -n "$LD"; then
3245   echo "$as_me:3245: result: $LD" >&5
3246 echo "${ECHO_T}$LD" >&6
3247 else
3248   echo "$as_me:3248: result: no" >&5
3249 echo "${ECHO_T}no" >&6
3250 fi
3251
3252 fi
3253 if test -z "$ac_cv_prog_LD"; then
3254   ac_ct_LD=$LD
3255   # Extract the first word of "ld", so it can be a program name with args.
3256 set dummy ld; ac_word=$2
3257 echo "$as_me:3257: checking for $ac_word" >&5
3258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3259 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3260   echo $ECHO_N "(cached) $ECHO_C" >&6
3261 else
3262   if test -n "$ac_ct_LD"; then
3263   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3264 else
3265   ac_save_IFS=$IFS; IFS=$ac_path_separator
3266 ac_dummy="$PATH"
3267 for ac_dir in $ac_dummy; do
3268   IFS=$ac_save_IFS
3269   test -z "$ac_dir" && ac_dir=.
3270   $as_executable_p "$ac_dir/$ac_word" || continue
3271 ac_cv_prog_ac_ct_LD="ld"
3272 echo "$as_me:3272: found $ac_dir/$ac_word" >&5
3273 break
3274 done
3275
3276   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3277 fi
3278 fi
3279 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3280 if test -n "$ac_ct_LD"; then
3281   echo "$as_me:3281: result: $ac_ct_LD" >&5
3282 echo "${ECHO_T}$ac_ct_LD" >&6
3283 else
3284   echo "$as_me:3284: result: no" >&5
3285 echo "${ECHO_T}no" >&6
3286 fi
3287
3288   LD=$ac_ct_LD
3289 else
3290   LD="$ac_cv_prog_LD"
3291 fi
3292
3293 if test -n "$ac_tool_prefix"; then
3294   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3295 set dummy ${ac_tool_prefix}ar; ac_word=$2
3296 echo "$as_me:3296: checking for $ac_word" >&5
3297 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3298 if test "${ac_cv_prog_AR+set}" = set; then
3299   echo $ECHO_N "(cached) $ECHO_C" >&6
3300 else
3301   if test -n "$AR"; then
3302   ac_cv_prog_AR="$AR" # Let the user override the test.
3303 else
3304   ac_save_IFS=$IFS; IFS=$ac_path_separator
3305 ac_dummy="$PATH"
3306 for ac_dir in $ac_dummy; do
3307   IFS=$ac_save_IFS
3308   test -z "$ac_dir" && ac_dir=.
3309   $as_executable_p "$ac_dir/$ac_word" || continue
3310 ac_cv_prog_AR="${ac_tool_prefix}ar"
3311 echo "$as_me:3311: found $ac_dir/$ac_word" >&5
3312 break
3313 done
3314
3315 fi
3316 fi
3317 AR=$ac_cv_prog_AR
3318 if test -n "$AR"; then
3319   echo "$as_me:3319: result: $AR" >&5
3320 echo "${ECHO_T}$AR" >&6
3321 else
3322   echo "$as_me:3322: result: no" >&5
3323 echo "${ECHO_T}no" >&6
3324 fi
3325
3326 fi
3327 if test -z "$ac_cv_prog_AR"; then
3328   ac_ct_AR=$AR
3329   # Extract the first word of "ar", so it can be a program name with args.
3330 set dummy ar; ac_word=$2
3331 echo "$as_me:3331: checking for $ac_word" >&5
3332 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3333 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3334   echo $ECHO_N "(cached) $ECHO_C" >&6
3335 else
3336   if test -n "$ac_ct_AR"; then
3337   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3338 else
3339   ac_save_IFS=$IFS; IFS=$ac_path_separator
3340 ac_dummy="$PATH"
3341 for ac_dir in $ac_dummy; do
3342   IFS=$ac_save_IFS
3343   test -z "$ac_dir" && ac_dir=.
3344   $as_executable_p "$ac_dir/$ac_word" || continue
3345 ac_cv_prog_ac_ct_AR="ar"
3346 echo "$as_me:3346: found $ac_dir/$ac_word" >&5
3347 break
3348 done
3349
3350   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3351 fi
3352 fi
3353 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3354 if test -n "$ac_ct_AR"; then
3355   echo "$as_me:3355: result: $ac_ct_AR" >&5
3356 echo "${ECHO_T}$ac_ct_AR" >&6
3357 else
3358   echo "$as_me:3358: result: no" >&5
3359 echo "${ECHO_T}no" >&6
3360 fi
3361
3362   AR=$ac_ct_AR
3363 else
3364   AR="$ac_cv_prog_AR"
3365 fi
3366
3367 if test -n "$ac_tool_prefix"; then
3368   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3369 set dummy ${ac_tool_prefix}ar; ac_word=$2
3370 echo "$as_me:3370: checking for $ac_word" >&5
3371 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3372 if test "${ac_cv_prog_AR+set}" = set; then
3373   echo $ECHO_N "(cached) $ECHO_C" >&6
3374 else
3375   if test -n "$AR"; then
3376   ac_cv_prog_AR="$AR" # Let the user override the test.
3377 else
3378   ac_save_IFS=$IFS; IFS=$ac_path_separator
3379 ac_dummy="$PATH"
3380 for ac_dir in $ac_dummy; do
3381   IFS=$ac_save_IFS
3382   test -z "$ac_dir" && ac_dir=.
3383   $as_executable_p "$ac_dir/$ac_word" || continue
3384 ac_cv_prog_AR="${ac_tool_prefix}ar"
3385 echo "$as_me:3385: found $ac_dir/$ac_word" >&5
3386 break
3387 done
3388
3389 fi
3390 fi
3391 AR=$ac_cv_prog_AR
3392 if test -n "$AR"; then
3393   echo "$as_me:3393: result: $AR" >&5
3394 echo "${ECHO_T}$AR" >&6
3395 else
3396   echo "$as_me:3396: result: no" >&5
3397 echo "${ECHO_T}no" >&6
3398 fi
3399
3400 fi
3401 if test -z "$ac_cv_prog_AR"; then
3402   ac_ct_AR=$AR
3403   # Extract the first word of "ar", so it can be a program name with args.
3404 set dummy ar; ac_word=$2
3405 echo "$as_me:3405: checking for $ac_word" >&5
3406 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3407 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3408   echo $ECHO_N "(cached) $ECHO_C" >&6
3409 else
3410   if test -n "$ac_ct_AR"; then
3411   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3412 else
3413   ac_save_IFS=$IFS; IFS=$ac_path_separator
3414 ac_dummy="$PATH"
3415 for ac_dir in $ac_dummy; do
3416   IFS=$ac_save_IFS
3417   test -z "$ac_dir" && ac_dir=.
3418   $as_executable_p "$ac_dir/$ac_word" || continue
3419 ac_cv_prog_ac_ct_AR="ar"
3420 echo "$as_me:3420: found $ac_dir/$ac_word" >&5
3421 break
3422 done
3423
3424   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3425 fi
3426 fi
3427 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3428 if test -n "$ac_ct_AR"; then
3429   echo "$as_me:3429: result: $ac_ct_AR" >&5
3430 echo "${ECHO_T}$ac_ct_AR" >&6
3431 else
3432   echo "$as_me:3432: result: no" >&5
3433 echo "${ECHO_T}no" >&6
3434 fi
3435
3436   AR=$ac_ct_AR
3437 else
3438   AR="$ac_cv_prog_AR"
3439 fi
3440
3441 echo "$as_me:3441: checking for options to update archives" >&5
3442 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3443 if test "${cf_cv_ar_flags+set}" = set; then
3444   echo $ECHO_N "(cached) $ECHO_C" >&6
3445 else
3446
3447         cf_cv_ar_flags=unknown
3448         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3449         do
3450
3451                 # check if $ARFLAGS already contains this choice
3452                 if test "x$ARFLAGS" != "x" ; then
3453                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3454                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3455                                 cf_cv_ar_flags=
3456                                 break
3457                         fi
3458                 fi
3459
3460                 rm -f conftest.$ac_cv_objext
3461                 rm -f conftest.a
3462
3463                 cat >conftest.$ac_ext <<EOF
3464 #line 3464 "configure"
3465 int     testdata[3] = { 123, 456, 789 };
3466 EOF
3467                 if { (eval echo "$as_me:3467: \"$ac_compile\"") >&5
3468   (eval $ac_compile) 2>&5
3469   ac_status=$?
3470   echo "$as_me:3470: \$? = $ac_status" >&5
3471   (exit $ac_status); } ; then
3472                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3473                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3474                         if test -f conftest.a ; then
3475                                 cf_cv_ar_flags=$cf_ar_flags
3476                                 break
3477                         fi
3478                 else
3479                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3480
3481 echo "${as_me:-configure}:3481: testing cannot compile test-program ..." 1>&5
3482
3483                         break
3484                 fi
3485         done
3486         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3487
3488 fi
3489 echo "$as_me:3489: result: $cf_cv_ar_flags" >&5
3490 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3491
3492 if test -n "$ARFLAGS" ; then
3493         if test -n "$cf_cv_ar_flags" ; then
3494                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3495         fi
3496 else
3497         ARFLAGS=$cf_cv_ar_flags
3498 fi
3499
3500         echo "$as_me:3500: checking for PATH separator" >&5
3501 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3502         case $cf_cv_system_name in
3503         (os2*)  PATH_SEPARATOR=';'  ;;
3504         (*)     ${PATH_SEPARATOR:=':'}  ;;
3505         esac
3506
3507         echo "$as_me:3507: result: $PATH_SEPARATOR" >&5
3508 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3509
3510 echo "$as_me:3510: checking if you have specified an install-prefix" >&5
3511 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3512
3513 # Check whether --with-install-prefix or --without-install-prefix was given.
3514 if test "${with_install_prefix+set}" = set; then
3515   withval="$with_install_prefix"
3516   case "$withval" in
3517         (yes|no)
3518                 ;;
3519         (*)     DESTDIR="$withval"
3520                 ;;
3521         esac
3522 fi;
3523 echo "$as_me:3523: result: $DESTDIR" >&5
3524 echo "${ECHO_T}$DESTDIR" >&6
3525
3526 ###############################################################################
3527
3528 # If we're cross-compiling, allow the user to override the tools and their
3529 # options.  The configure script is oriented toward identifying the host
3530 # compiler, etc., but we need a build compiler to generate parts of the source.
3531
3532 if test "$cross_compiling" = yes ; then
3533
3534         # defaults that we might want to override
3535         : ${BUILD_CFLAGS:=''}
3536         : ${BUILD_CPPFLAGS:=''}
3537         : ${BUILD_LDFLAGS:=''}
3538         : ${BUILD_LIBS:=''}
3539         : ${BUILD_EXEEXT:='$x'}
3540         : ${BUILD_OBJEXT:='o'}
3541
3542 # Check whether --with-build-cc or --without-build-cc was given.
3543 if test "${with_build_cc+set}" = set; then
3544   withval="$with_build_cc"
3545   BUILD_CC="$withval"
3546 else
3547   for ac_prog in gcc clang c99 c89 cc cl
3548 do
3549   # Extract the first word of "$ac_prog", so it can be a program name with args.
3550 set dummy $ac_prog; ac_word=$2
3551 echo "$as_me:3551: checking for $ac_word" >&5
3552 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3553 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3554   echo $ECHO_N "(cached) $ECHO_C" >&6
3555 else
3556   if test -n "$BUILD_CC"; then
3557   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3558 else
3559   ac_save_IFS=$IFS; IFS=$ac_path_separator
3560 ac_dummy="$PATH"
3561 for ac_dir in $ac_dummy; do
3562   IFS=$ac_save_IFS
3563   test -z "$ac_dir" && ac_dir=.
3564   $as_executable_p "$ac_dir/$ac_word" || continue
3565 ac_cv_prog_BUILD_CC="$ac_prog"
3566 echo "$as_me:3566: found $ac_dir/$ac_word" >&5
3567 break
3568 done
3569
3570 fi
3571 fi
3572 BUILD_CC=$ac_cv_prog_BUILD_CC
3573 if test -n "$BUILD_CC"; then
3574   echo "$as_me:3574: result: $BUILD_CC" >&5
3575 echo "${ECHO_T}$BUILD_CC" >&6
3576 else
3577   echo "$as_me:3577: result: no" >&5
3578 echo "${ECHO_T}no" >&6
3579 fi
3580
3581   test -n "$BUILD_CC" && break
3582 done
3583 test -n "$BUILD_CC" || BUILD_CC="none"
3584
3585 fi;
3586         echo "$as_me:3586: checking for native build C compiler" >&5
3587 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3588         echo "$as_me:3588: result: $BUILD_CC" >&5
3589 echo "${ECHO_T}$BUILD_CC" >&6
3590
3591         echo "$as_me:3591: checking for native build C preprocessor" >&5
3592 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3593
3594 # Check whether --with-build-cpp or --without-build-cpp was given.
3595 if test "${with_build_cpp+set}" = set; then
3596   withval="$with_build_cpp"
3597   BUILD_CPP="$withval"
3598 else
3599   BUILD_CPP='${BUILD_CC} -E'
3600 fi;
3601         echo "$as_me:3601: result: $BUILD_CPP" >&5
3602 echo "${ECHO_T}$BUILD_CPP" >&6
3603
3604         echo "$as_me:3604: checking for native build C flags" >&5
3605 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3606
3607 # Check whether --with-build-cflags or --without-build-cflags was given.
3608 if test "${with_build_cflags+set}" = set; then
3609   withval="$with_build_cflags"
3610   BUILD_CFLAGS="$withval"
3611 fi;
3612         echo "$as_me:3612: result: $BUILD_CFLAGS" >&5
3613 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3614
3615         echo "$as_me:3615: checking for native build C preprocessor-flags" >&5
3616 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3617
3618 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3619 if test "${with_build_cppflags+set}" = set; then
3620   withval="$with_build_cppflags"
3621   BUILD_CPPFLAGS="$withval"
3622 fi;
3623         echo "$as_me:3623: result: $BUILD_CPPFLAGS" >&5
3624 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3625
3626         echo "$as_me:3626: checking for native build linker-flags" >&5
3627 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3628
3629 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3630 if test "${with_build_ldflags+set}" = set; then
3631   withval="$with_build_ldflags"
3632   BUILD_LDFLAGS="$withval"
3633 fi;
3634         echo "$as_me:3634: result: $BUILD_LDFLAGS" >&5
3635 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3636
3637         echo "$as_me:3637: checking for native build linker-libraries" >&5
3638 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3639
3640 # Check whether --with-build-libs or --without-build-libs was given.
3641 if test "${with_build_libs+set}" = set; then
3642   withval="$with_build_libs"
3643   BUILD_LIBS="$withval"
3644 fi;
3645         echo "$as_me:3645: result: $BUILD_LIBS" >&5
3646 echo "${ECHO_T}$BUILD_LIBS" >&6
3647
3648         # this assumes we're on Unix.
3649         BUILD_EXEEXT=
3650         BUILD_OBJEXT=o
3651
3652         : ${BUILD_CC:='${CC}'}
3653
3654         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3655                 { { echo "$as_me:3655: error: Cross-build requires two compilers.
3656 Use --with-build-cc to specify the native compiler." >&5
3657 echo "$as_me: error: Cross-build requires two compilers.
3658 Use --with-build-cc to specify the native compiler." >&2;}
3659    { (exit 1); exit 1; }; }
3660         fi
3661
3662 else
3663         : ${BUILD_CC:='${CC}'}
3664         : ${BUILD_CPP:='${CPP}'}
3665         : ${BUILD_CFLAGS:='${CFLAGS}'}
3666         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3667         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3668         : ${BUILD_LIBS:='${LIBS}'}
3669         : ${BUILD_EXEEXT:='$x'}
3670         : ${BUILD_OBJEXT:='o'}
3671 fi
3672
3673 ###############################################################################
3674
3675 ### Options to allow the user to specify the set of libraries which are used.
3676 ### Use "--without-normal --with-shared" to allow the default model to be
3677 ### shared, for example.
3678 cf_list_models=""
3679
3680 echo "$as_me:3680: checking if you want to build shared C-objects" >&5
3681 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3682
3683 # Check whether --with-shared or --without-shared was given.
3684 if test "${with_shared+set}" = set; then
3685   withval="$with_shared"
3686   with_shared=$withval
3687 else
3688   with_shared=no
3689 fi;
3690 echo "$as_me:3690: result: $with_shared" >&5
3691 echo "${ECHO_T}$with_shared" >&6
3692 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3693
3694 echo "$as_me:3694: checking for specified models" >&5
3695 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3696 test -z "$cf_list_models" && cf_list_models=normal
3697 echo "$as_me:3697: result: $cf_list_models" >&5
3698 echo "${ECHO_T}$cf_list_models" >&6
3699
3700 ### Use the first model as the default, and save its suffix for use in building
3701 ### up test-applications.
3702 echo "$as_me:3702: checking for default model" >&5
3703 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3704 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3705 echo "$as_me:3705: result: $DFT_LWR_MODEL" >&5
3706 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3707
3708 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3709
3710 echo "$as_me:3710: checking for specific curses-directory" >&5
3711 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3712
3713 # Check whether --with-curses-dir or --without-curses-dir was given.
3714 if test "${with_curses_dir+set}" = set; then
3715   withval="$with_curses_dir"
3716   cf_cv_curses_dir=$withval
3717 else
3718   cf_cv_curses_dir=no
3719 fi;
3720 echo "$as_me:3720: result: $cf_cv_curses_dir" >&5
3721 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3722
3723 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3724 then
3725
3726 if test "x$prefix" != xNONE; then
3727         cf_path_syntax="$prefix"
3728 else
3729         cf_path_syntax="$ac_default_prefix"
3730 fi
3731
3732 case ".$withval" in
3733 (.\$\(*\)*|.\'*\'*)
3734         ;;
3735 (..|./*|.\\*)
3736         ;;
3737 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3738         ;;
3739 (.\${*prefix}*|.\${*dir}*)
3740         eval withval="$withval"
3741         case ".$withval" in
3742         (.NONE/*)
3743                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3744                 ;;
3745         esac
3746         ;;
3747 (.no|.NONE/*)
3748         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3749         ;;
3750 (*)
3751         { { echo "$as_me:3751: error: expected a pathname, not \"$withval\"" >&5
3752 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3753    { (exit 1); exit 1; }; }
3754         ;;
3755 esac
3756
3757         if test -d "$cf_cv_curses_dir"
3758         then
3759
3760 if test -n "$cf_cv_curses_dir/include" ; then
3761   for cf_add_incdir in $cf_cv_curses_dir/include
3762   do
3763         while test $cf_add_incdir != /usr/include
3764         do
3765           if test -d $cf_add_incdir
3766           then
3767                 cf_have_incdir=no
3768                 if test -n "$CFLAGS$CPPFLAGS" ; then
3769                   # a loop is needed to ensure we can add subdirs of existing dirs
3770                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3771                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3772                           cf_have_incdir=yes; break
3773                         fi
3774                   done
3775                 fi
3776
3777                 if test "$cf_have_incdir" = no ; then
3778                   if test "$cf_add_incdir" = /usr/local/include ; then
3779                         if test "$GCC" = yes
3780                         then
3781                           cf_save_CPPFLAGS=$CPPFLAGS
3782                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3783                           cat >conftest.$ac_ext <<_ACEOF
3784 #line 3784 "configure"
3785 #include "confdefs.h"
3786 #include <stdio.h>
3787 int
3788 main (void)
3789 {
3790 printf("Hello")
3791   ;
3792   return 0;
3793 }
3794 _ACEOF
3795 rm -f conftest.$ac_objext
3796 if { (eval echo "$as_me:3796: \"$ac_compile\"") >&5
3797   (eval $ac_compile) 2>&5
3798   ac_status=$?
3799   echo "$as_me:3799: \$? = $ac_status" >&5
3800   (exit $ac_status); } &&
3801          { ac_try='test -s conftest.$ac_objext'
3802   { (eval echo "$as_me:3802: \"$ac_try\"") >&5
3803   (eval $ac_try) 2>&5
3804   ac_status=$?
3805   echo "$as_me:3805: \$? = $ac_status" >&5
3806   (exit $ac_status); }; }; then
3807   :
3808 else
3809   echo "$as_me: failed program was:" >&5
3810 cat conftest.$ac_ext >&5
3811 cf_have_incdir=yes
3812 fi
3813 rm -f conftest.$ac_objext conftest.$ac_ext
3814                           CPPFLAGS=$cf_save_CPPFLAGS
3815                         fi
3816                   fi
3817                 fi
3818
3819                 if test "$cf_have_incdir" = no ; then
3820                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3821
3822 echo "${as_me:-configure}:3822: testing adding $cf_add_incdir to include-path ..." 1>&5
3823
3824                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3825
3826                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3827                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3828                   cf_add_incdir="$cf_top_incdir"
3829                 else
3830                   break
3831                 fi
3832           else
3833                 break
3834           fi
3835         done
3836   done
3837 fi
3838
3839 if test -n "$cf_cv_curses_dir/lib" ; then
3840         for cf_add_libdir in $cf_cv_curses_dir/lib
3841         do
3842                 if test $cf_add_libdir = /usr/lib ; then
3843                         :
3844                 elif test -d $cf_add_libdir
3845                 then
3846                         cf_have_libdir=no
3847                         if test -n "$LDFLAGS$LIBS" ; then
3848                                 # a loop is needed to ensure we can add subdirs of existing dirs
3849                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3850                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3851                                                 cf_have_libdir=yes; break
3852                                         fi
3853                                 done
3854                         fi
3855                         if test "$cf_have_libdir" = no ; then
3856                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3857
3858 echo "${as_me:-configure}:3858: testing adding $cf_add_libdir to library-path ..." 1>&5
3859
3860                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3861                         fi
3862                 fi
3863         done
3864 fi
3865
3866         fi
3867 fi
3868
3869 cf_ncuconfig_root=ncurses
3870 cf_have_ncuconfig=no
3871
3872 if test "x${PKG_CONFIG:=none}" != xnone; then
3873         echo "$as_me:3873: checking pkg-config for $cf_ncuconfig_root" >&5
3874 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3875         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3876                 echo "$as_me:3876: result: yes" >&5
3877 echo "${ECHO_T}yes" >&6
3878
3879                 echo "$as_me:3879: checking if the $cf_ncuconfig_root package files work" >&5
3880 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3881                 cf_have_ncuconfig=unknown
3882
3883                 cf_save_CPPFLAGS="$CPPFLAGS"
3884                 cf_save_LIBS="$LIBS"
3885
3886                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3887
3888 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3889 # Filter out duplicates - this happens with badly-designed ".pc" files...
3890 for cf_add_1lib in $LIBS
3891 do
3892         for cf_add_2lib in $cf_add_libs
3893         do
3894                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3895                 then
3896                         cf_add_1lib=
3897                         break
3898                 fi
3899         done
3900         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3901 done
3902 LIBS="$cf_add_libs"
3903
3904                 cat >conftest.$ac_ext <<_ACEOF
3905 #line 3905 "configure"
3906 #include "confdefs.h"
3907 #include <${cf_cv_ncurses_header:-curses.h}>
3908 int
3909 main (void)
3910 {
3911 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3912   ;
3913   return 0;
3914 }
3915 _ACEOF
3916 rm -f conftest.$ac_objext conftest$ac_exeext
3917 if { (eval echo "$as_me:3917: \"$ac_link\"") >&5
3918   (eval $ac_link) 2>&5
3919   ac_status=$?
3920   echo "$as_me:3920: \$? = $ac_status" >&5
3921   (exit $ac_status); } &&
3922          { ac_try='test -s conftest$ac_exeext'
3923   { (eval echo "$as_me:3923: \"$ac_try\"") >&5
3924   (eval $ac_try) 2>&5
3925   ac_status=$?
3926   echo "$as_me:3926: \$? = $ac_status" >&5
3927   (exit $ac_status); }; }; then
3928   if test "$cross_compiling" = yes; then
3929   cf_have_ncuconfig=maybe
3930 else
3931   cat >conftest.$ac_ext <<_ACEOF
3932 #line 3932 "configure"
3933 #include "confdefs.h"
3934 #include <${cf_cv_ncurses_header:-curses.h}>
3935                                 int main(void)
3936                                 { char *xx = curses_version(); return (xx == 0); }
3937 _ACEOF
3938 rm -f conftest$ac_exeext
3939 if { (eval echo "$as_me:3939: \"$ac_link\"") >&5
3940   (eval $ac_link) 2>&5
3941   ac_status=$?
3942   echo "$as_me:3942: \$? = $ac_status" >&5
3943   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3944   { (eval echo "$as_me:3944: \"$ac_try\"") >&5
3945   (eval $ac_try) 2>&5
3946   ac_status=$?
3947   echo "$as_me:3947: \$? = $ac_status" >&5
3948   (exit $ac_status); }; }; then
3949   cf_have_ncuconfig=yes
3950 else
3951   echo "$as_me: program exited with status $ac_status" >&5
3952 echo "$as_me: failed program was:" >&5
3953 cat conftest.$ac_ext >&5
3954 cf_have_ncuconfig=no
3955 fi
3956 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3957 fi
3958 else
3959   echo "$as_me: failed program was:" >&5
3960 cat conftest.$ac_ext >&5
3961 cf_have_ncuconfig=no
3962 fi
3963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3964                 echo "$as_me:3964: result: $cf_have_ncuconfig" >&5
3965 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3966                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3967                 if test "$cf_have_ncuconfig" != "yes"
3968                 then
3969                         CPPFLAGS="$cf_save_CPPFLAGS"
3970                         LIBS="$cf_save_LIBS"
3971                         NCURSES_CONFIG_PKG=none
3972                 else
3973
3974 cat >>confdefs.h <<\EOF
3975 #define NCURSES 1
3976 EOF
3977
3978                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3979
3980 echo "$as_me:3980: checking for terminfo header" >&5
3981 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
3982 if test "${cf_cv_term_header+set}" = set; then
3983   echo $ECHO_N "(cached) $ECHO_C" >&6
3984 else
3985
3986 case ${cf_cv_ncurses_header} in
3987 (*/ncurses.h|*/ncursesw.h)
3988         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3989         ;;
3990 (*)
3991         cf_term_header=term.h
3992         ;;
3993 esac
3994
3995 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3996 do
3997 cat >conftest.$ac_ext <<_ACEOF
3998 #line 3998 "configure"
3999 #include "confdefs.h"
4000 #include <stdio.h>
4001 #include <${cf_cv_ncurses_header:-curses.h}>
4002 #include <$cf_test>
4003
4004 int
4005 main (void)
4006 {
4007 int x = auto_left_margin
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024
4025         cf_cv_term_header="$cf_test"
4026 else
4027   echo "$as_me: failed program was:" >&5
4028 cat conftest.$ac_ext >&5
4029
4030         cf_cv_term_header=unknown
4031
4032 fi
4033 rm -f conftest.$ac_objext conftest.$ac_ext
4034         test "$cf_cv_term_header" != unknown && break
4035 done
4036
4037 fi
4038 echo "$as_me:4038: result: $cf_cv_term_header" >&5
4039 echo "${ECHO_T}$cf_cv_term_header" >&6
4040
4041 # Set definitions to allow ifdef'ing to accommodate subdirectories
4042
4043 case $cf_cv_term_header in
4044 (*term.h)
4045
4046 cat >>confdefs.h <<\EOF
4047 #define HAVE_TERM_H 1
4048 EOF
4049
4050         ;;
4051 esac
4052
4053 case $cf_cv_term_header in
4054 (ncurses/term.h)
4055
4056 cat >>confdefs.h <<\EOF
4057 #define HAVE_NCURSES_TERM_H 1
4058 EOF
4059
4060         ;;
4061 (ncursesw/term.h)
4062
4063 cat >>confdefs.h <<\EOF
4064 #define HAVE_NCURSESW_TERM_H 1
4065 EOF
4066
4067         ;;
4068 esac
4069
4070                 fi
4071
4072         else
4073                 echo "$as_me:4073: result: no" >&5
4074 echo "${ECHO_T}no" >&6
4075                 NCURSES_CONFIG_PKG=none
4076         fi
4077 else
4078         NCURSES_CONFIG_PKG=none
4079 fi
4080
4081 if test "x$cf_have_ncuconfig" = "xno"; then
4082         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4083
4084 if test -n "$ac_tool_prefix"; then
4085   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4086   do
4087     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4088 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4089 echo "$as_me:4089: checking for $ac_word" >&5
4090 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4091 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4092   echo $ECHO_N "(cached) $ECHO_C" >&6
4093 else
4094   if test -n "$NCURSES_CONFIG"; then
4095   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4096 else
4097   ac_save_IFS=$IFS; IFS=$ac_path_separator
4098 ac_dummy="$PATH"
4099 for ac_dir in $ac_dummy; do
4100   IFS=$ac_save_IFS
4101   test -z "$ac_dir" && ac_dir=.
4102   $as_executable_p "$ac_dir/$ac_word" || continue
4103 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4104 echo "$as_me:4104: found $ac_dir/$ac_word" >&5
4105 break
4106 done
4107
4108 fi
4109 fi
4110 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4111 if test -n "$NCURSES_CONFIG"; then
4112   echo "$as_me:4112: result: $NCURSES_CONFIG" >&5
4113 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4114 else
4115   echo "$as_me:4115: result: no" >&5
4116 echo "${ECHO_T}no" >&6
4117 fi
4118
4119     test -n "$NCURSES_CONFIG" && break
4120   done
4121 fi
4122 if test -z "$NCURSES_CONFIG"; then
4123   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4124   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4125 do
4126   # Extract the first word of "$ac_prog", so it can be a program name with args.
4127 set dummy $ac_prog; ac_word=$2
4128 echo "$as_me:4128: checking for $ac_word" >&5
4129 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4130 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4131   echo $ECHO_N "(cached) $ECHO_C" >&6
4132 else
4133   if test -n "$ac_ct_NCURSES_CONFIG"; then
4134   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4135 else
4136   ac_save_IFS=$IFS; IFS=$ac_path_separator
4137 ac_dummy="$PATH"
4138 for ac_dir in $ac_dummy; do
4139   IFS=$ac_save_IFS
4140   test -z "$ac_dir" && ac_dir=.
4141   $as_executable_p "$ac_dir/$ac_word" || continue
4142 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4143 echo "$as_me:4143: found $ac_dir/$ac_word" >&5
4144 break
4145 done
4146
4147 fi
4148 fi
4149 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4150 if test -n "$ac_ct_NCURSES_CONFIG"; then
4151   echo "$as_me:4151: result: $ac_ct_NCURSES_CONFIG" >&5
4152 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4153 else
4154   echo "$as_me:4154: result: no" >&5
4155 echo "${ECHO_T}no" >&6
4156 fi
4157
4158   test -n "$ac_ct_NCURSES_CONFIG" && break
4159 done
4160 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4161
4162   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4163 fi
4164
4165         if test "$NCURSES_CONFIG" != none ; then
4166
4167                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4168
4169 cf_add_libs="`$NCURSES_CONFIG --libs`"
4170 # Filter out duplicates - this happens with badly-designed ".pc" files...
4171 for cf_add_1lib in $LIBS
4172 do
4173         for cf_add_2lib in $cf_add_libs
4174         do
4175                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4176                 then
4177                         cf_add_1lib=
4178                         break
4179                 fi
4180         done
4181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4182 done
4183 LIBS="$cf_add_libs"
4184
4185                 # even with config script, some packages use no-override for curses.h
4186
4187 echo "$as_me:4187: checking if we have identified curses headers" >&5
4188 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4189 if test "${cf_cv_ncurses_header+set}" = set; then
4190   echo $ECHO_N "(cached) $ECHO_C" >&6
4191 else
4192
4193 cf_cv_ncurses_header=none
4194 for cf_header in \
4195         ncurses.h ncurses/ncurses.h \
4196         curses.h ncurses/curses.h
4197 do
4198 cat >conftest.$ac_ext <<_ACEOF
4199 #line 4199 "configure"
4200 #include "confdefs.h"
4201 #include <${cf_header}>
4202 int
4203 main (void)
4204 {
4205 initscr(); tgoto("?", 0,0)
4206   ;
4207   return 0;
4208 }
4209 _ACEOF
4210 rm -f conftest.$ac_objext
4211 if { (eval echo "$as_me:4211: \"$ac_compile\"") >&5
4212   (eval $ac_compile) 2>&5
4213   ac_status=$?
4214   echo "$as_me:4214: \$? = $ac_status" >&5
4215   (exit $ac_status); } &&
4216          { ac_try='test -s conftest.$ac_objext'
4217   { (eval echo "$as_me:4217: \"$ac_try\"") >&5
4218   (eval $ac_try) 2>&5
4219   ac_status=$?
4220   echo "$as_me:4220: \$? = $ac_status" >&5
4221   (exit $ac_status); }; }; then
4222   cf_cv_ncurses_header=$cf_header; break
4223 else
4224   echo "$as_me: failed program was:" >&5
4225 cat conftest.$ac_ext >&5
4226 fi
4227 rm -f conftest.$ac_objext conftest.$ac_ext
4228 done
4229
4230 fi
4231 echo "$as_me:4231: result: $cf_cv_ncurses_header" >&5
4232 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4233
4234 if test "$cf_cv_ncurses_header" = none ; then
4235         { { echo "$as_me:4235: error: No curses header-files found" >&5
4236 echo "$as_me: error: No curses header-files found" >&2;}
4237    { (exit 1); exit 1; }; }
4238 fi
4239
4240 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4241
4242 for ac_header in $cf_cv_ncurses_header
4243 do
4244 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4245 echo "$as_me:4245: checking for $ac_header" >&5
4246 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4247 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4248   echo $ECHO_N "(cached) $ECHO_C" >&6
4249 else
4250   cat >conftest.$ac_ext <<_ACEOF
4251 #line 4251 "configure"
4252 #include "confdefs.h"
4253 #include <$ac_header>
4254 _ACEOF
4255 if { (eval echo "$as_me:4255: \"$ac_cpp conftest.$ac_ext\"") >&5
4256   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4257   ac_status=$?
4258   egrep -v '^ *\+' conftest.er1 >conftest.err
4259   rm -f conftest.er1
4260   cat conftest.err >&5
4261   echo "$as_me:4261: \$? = $ac_status" >&5
4262   (exit $ac_status); } >/dev/null; then
4263   if test -s conftest.err; then
4264     ac_cpp_err=$ac_c_preproc_warn_flag
4265   else
4266     ac_cpp_err=
4267   fi
4268 else
4269   ac_cpp_err=yes
4270 fi
4271 if test -z "$ac_cpp_err"; then
4272   eval "$as_ac_Header=yes"
4273 else
4274   echo "$as_me: failed program was:" >&5
4275   cat conftest.$ac_ext >&5
4276   eval "$as_ac_Header=no"
4277 fi
4278 rm -f conftest.err conftest.$ac_ext
4279 fi
4280 echo "$as_me:4280: result: `eval echo '${'$as_ac_Header'}'`" >&5
4281 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4282 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4283   cat >>confdefs.h <<EOF
4284 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4285 EOF
4286
4287 fi
4288 done
4289
4290 cat >>confdefs.h <<\EOF
4291 #define NCURSES 1
4292 EOF
4293
4294 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4295
4296                 cat >>confdefs.h <<EOF
4297 #define $cf_nculib_ROOT 1
4298 EOF
4299
4300                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4301
4302         else
4303
4304 cf_ncuhdr_root=ncurses
4305
4306 test -n "$cf_cv_curses_dir" && \
4307 test "$cf_cv_curses_dir" != "no" && { \
4308
4309 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4310   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4311   do
4312         while test $cf_add_incdir != /usr/include
4313         do
4314           if test -d $cf_add_incdir
4315           then
4316                 cf_have_incdir=no
4317                 if test -n "$CFLAGS$CPPFLAGS" ; then
4318                   # a loop is needed to ensure we can add subdirs of existing dirs
4319                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4320                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4321                           cf_have_incdir=yes; break
4322                         fi
4323                   done
4324                 fi
4325
4326                 if test "$cf_have_incdir" = no ; then
4327                   if test "$cf_add_incdir" = /usr/local/include ; then
4328                         if test "$GCC" = yes
4329                         then
4330                           cf_save_CPPFLAGS=$CPPFLAGS
4331                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4332                           cat >conftest.$ac_ext <<_ACEOF
4333 #line 4333 "configure"
4334 #include "confdefs.h"
4335 #include <stdio.h>
4336 int
4337 main (void)
4338 {
4339 printf("Hello")
4340   ;
4341   return 0;
4342 }
4343 _ACEOF
4344 rm -f conftest.$ac_objext
4345 if { (eval echo "$as_me:4345: \"$ac_compile\"") >&5
4346   (eval $ac_compile) 2>&5
4347   ac_status=$?
4348   echo "$as_me:4348: \$? = $ac_status" >&5
4349   (exit $ac_status); } &&
4350          { ac_try='test -s conftest.$ac_objext'
4351   { (eval echo "$as_me:4351: \"$ac_try\"") >&5
4352   (eval $ac_try) 2>&5
4353   ac_status=$?
4354   echo "$as_me:4354: \$? = $ac_status" >&5
4355   (exit $ac_status); }; }; then
4356   :
4357 else
4358   echo "$as_me: failed program was:" >&5
4359 cat conftest.$ac_ext >&5
4360 cf_have_incdir=yes
4361 fi
4362 rm -f conftest.$ac_objext conftest.$ac_ext
4363                           CPPFLAGS=$cf_save_CPPFLAGS
4364                         fi
4365                   fi
4366                 fi
4367
4368                 if test "$cf_have_incdir" = no ; then
4369                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4370
4371 echo "${as_me:-configure}:4371: testing adding $cf_add_incdir to include-path ..." 1>&5
4372
4373                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4374
4375                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4376                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4377                   cf_add_incdir="$cf_top_incdir"
4378                 else
4379                   break
4380                 fi
4381           else
4382                 break
4383           fi
4384         done
4385   done
4386 fi
4387
4388 }
4389
4390 echo "$as_me:4390: checking for $cf_ncuhdr_root header in include-path" >&5
4391 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4392 if test "${cf_cv_ncurses_h+set}" = set; then
4393   echo $ECHO_N "(cached) $ECHO_C" >&6
4394 else
4395
4396         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4397         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4398         for cf_header in $cf_header_list
4399         do
4400
4401         cat >conftest.$ac_ext <<_ACEOF
4402 #line 4402 "configure"
4403 #include "confdefs.h"
4404
4405 #include <$cf_header>
4406 int
4407 main (void)
4408 {
4409
4410 #ifdef NCURSES_VERSION
4411
4412 printf("%s\n", NCURSES_VERSION);
4413 #else
4414 #ifdef __NCURSES_H
4415 printf("old\n");
4416 #else
4417         make an error
4418 #endif
4419 #endif
4420
4421   ;
4422   return 0;
4423 }
4424 _ACEOF
4425 rm -f conftest.$ac_objext
4426 if { (eval echo "$as_me:4426: \"$ac_compile\"") >&5
4427   (eval $ac_compile) 2>&5
4428   ac_status=$?
4429   echo "$as_me:4429: \$? = $ac_status" >&5
4430   (exit $ac_status); } &&
4431          { ac_try='test -s conftest.$ac_objext'
4432   { (eval echo "$as_me:4432: \"$ac_try\"") >&5
4433   (eval $ac_try) 2>&5
4434   ac_status=$?
4435   echo "$as_me:4435: \$? = $ac_status" >&5
4436   (exit $ac_status); }; }; then
4437   cf_cv_ncurses_h=$cf_header
4438
4439 else
4440   echo "$as_me: failed program was:" >&5
4441 cat conftest.$ac_ext >&5
4442 cf_cv_ncurses_h=no
4443 fi
4444 rm -f conftest.$ac_objext conftest.$ac_ext
4445
4446                 test "$cf_cv_ncurses_h" != no && break
4447         done
4448
4449 fi
4450 echo "$as_me:4450: result: $cf_cv_ncurses_h" >&5
4451 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4452
4453 if test "$cf_cv_ncurses_h" != no ; then
4454         cf_cv_ncurses_header=$cf_cv_ncurses_h
4455 else
4456
4457 echo "$as_me:4457: checking for $cf_ncuhdr_root include-path" >&5
4458 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4459 if test "${cf_cv_ncurses_h2+set}" = set; then
4460   echo $ECHO_N "(cached) $ECHO_C" >&6
4461 else
4462
4463         test -n "$verbose" && echo
4464
4465 cf_search=
4466
4467 # collect the current set of include-directories from compiler flags
4468 cf_header_path_list=""
4469 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4470         for cf_header_path in $CPPFLAGS $CFLAGS
4471         do
4472                 case $cf_header_path in
4473                 (-I*)
4474                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4475
4476 test "x$cf_header_path" != "xNONE" && \
4477 test -d "$cf_header_path" && \
4478  {
4479         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4480         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4481         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4482         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4483         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4484         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"
4485 }
4486
4487                         cf_header_path_list="$cf_header_path_list $cf_search"
4488                         ;;
4489                 esac
4490         done
4491 fi
4492
4493 # add the variations for the package we are looking for
4494
4495 cf_search=
4496
4497 test "x$prefix" != "xNONE" && \
4498 test -d "$prefix" && \
4499  {
4500         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4501         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4502         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4503         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4504         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4505         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4506 }
4507
4508 for cf_subdir_prefix in \
4509         /usr \
4510         /usr/local \
4511         /usr/pkg \
4512         /opt \
4513         /opt/local \
4514         $HOME
4515 do
4516
4517 test "x$cf_subdir_prefix" != "x$prefix" && \
4518 test -d "$cf_subdir_prefix" && \
4519 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4520         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4521         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4522         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4523         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4524         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4525         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"
4526 }
4527
4528 done
4529
4530 test "$includedir" != NONE && \
4531 test "$includedir" != "/usr/include" && \
4532 test -d "$includedir" && {
4533         test -d $includedir &&    cf_search="$cf_search $includedir"
4534         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4535 }
4536
4537 test "$oldincludedir" != NONE && \
4538 test "$oldincludedir" != "/usr/include" && \
4539 test -d "$oldincludedir" && {
4540         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4541         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4542 }
4543
4544 cf_search="$cf_search $cf_header_path_list"
4545
4546         test -n "$verbose" && echo search path $cf_search
4547         cf_save2_CPPFLAGS="$CPPFLAGS"
4548         for cf_incdir in $cf_search
4549         do
4550
4551 if test -n "$cf_incdir" ; then
4552   for cf_add_incdir in $cf_incdir
4553   do
4554         while test $cf_add_incdir != /usr/include
4555         do
4556           if test -d $cf_add_incdir
4557           then
4558                 cf_have_incdir=no
4559                 if test -n "$CFLAGS$CPPFLAGS" ; then
4560                   # a loop is needed to ensure we can add subdirs of existing dirs
4561                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4562                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4563                           cf_have_incdir=yes; break
4564                         fi
4565                   done
4566                 fi
4567
4568                 if test "$cf_have_incdir" = no ; then
4569                   if test "$cf_add_incdir" = /usr/local/include ; then
4570                         if test "$GCC" = yes
4571                         then
4572                           cf_save_CPPFLAGS=$CPPFLAGS
4573                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4574                           cat >conftest.$ac_ext <<_ACEOF
4575 #line 4575 "configure"
4576 #include "confdefs.h"
4577 #include <stdio.h>
4578 int
4579 main (void)
4580 {
4581 printf("Hello")
4582   ;
4583   return 0;
4584 }
4585 _ACEOF
4586 rm -f conftest.$ac_objext
4587 if { (eval echo "$as_me:4587: \"$ac_compile\"") >&5
4588   (eval $ac_compile) 2>&5
4589   ac_status=$?
4590   echo "$as_me:4590: \$? = $ac_status" >&5
4591   (exit $ac_status); } &&
4592          { ac_try='test -s conftest.$ac_objext'
4593   { (eval echo "$as_me:4593: \"$ac_try\"") >&5
4594   (eval $ac_try) 2>&5
4595   ac_status=$?
4596   echo "$as_me:4596: \$? = $ac_status" >&5
4597   (exit $ac_status); }; }; then
4598   :
4599 else
4600   echo "$as_me: failed program was:" >&5
4601 cat conftest.$ac_ext >&5
4602 cf_have_incdir=yes
4603 fi
4604 rm -f conftest.$ac_objext conftest.$ac_ext
4605                           CPPFLAGS=$cf_save_CPPFLAGS
4606                         fi
4607                   fi
4608                 fi
4609
4610                 if test "$cf_have_incdir" = no ; then
4611                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4612
4613 echo "${as_me:-configure}:4613: testing adding $cf_add_incdir to include-path ..." 1>&5
4614
4615                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4616
4617                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4618                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4619                   cf_add_incdir="$cf_top_incdir"
4620                 else
4621                   break
4622                 fi
4623           else
4624                 break
4625           fi
4626         done
4627   done
4628 fi
4629
4630                 for cf_header in \
4631                         ncurses.h \
4632                         curses.h
4633                 do
4634
4635         cat >conftest.$ac_ext <<_ACEOF
4636 #line 4636 "configure"
4637 #include "confdefs.h"
4638
4639 #include <$cf_header>
4640 int
4641 main (void)
4642 {
4643
4644 #ifdef NCURSES_VERSION
4645
4646 printf("%s\n", NCURSES_VERSION);
4647 #else
4648 #ifdef __NCURSES_H
4649 printf("old\n");
4650 #else
4651         make an error
4652 #endif
4653 #endif
4654
4655   ;
4656   return 0;
4657 }
4658 _ACEOF
4659 rm -f conftest.$ac_objext
4660 if { (eval echo "$as_me:4660: \"$ac_compile\"") >&5
4661   (eval $ac_compile) 2>&5
4662   ac_status=$?
4663   echo "$as_me:4663: \$? = $ac_status" >&5
4664   (exit $ac_status); } &&
4665          { ac_try='test -s conftest.$ac_objext'
4666   { (eval echo "$as_me:4666: \"$ac_try\"") >&5
4667   (eval $ac_try) 2>&5
4668   ac_status=$?
4669   echo "$as_me:4669: \$? = $ac_status" >&5
4670   (exit $ac_status); }; }; then
4671   cf_cv_ncurses_h2=$cf_header
4672
4673 else
4674   echo "$as_me: failed program was:" >&5
4675 cat conftest.$ac_ext >&5
4676 cf_cv_ncurses_h2=no
4677 fi
4678 rm -f conftest.$ac_objext conftest.$ac_ext
4679
4680                         if test "$cf_cv_ncurses_h2" != no ; then
4681                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4682                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4683                                 break
4684                         fi
4685                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4686                 done
4687                 CPPFLAGS="$cf_save2_CPPFLAGS"
4688                 test "$cf_cv_ncurses_h2" != no && break
4689         done
4690         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4690: error: not found" >&5
4691 echo "$as_me: error: not found" >&2;}
4692    { (exit 1); exit 1; }; }
4693
4694 fi
4695 echo "$as_me:4695: result: $cf_cv_ncurses_h2" >&5
4696 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4697
4698         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4699         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4700         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4701                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4702         fi
4703
4704 if test -n "$cf_1st_incdir" ; then
4705   for cf_add_incdir in $cf_1st_incdir
4706   do
4707         while test $cf_add_incdir != /usr/include
4708         do
4709           if test -d $cf_add_incdir
4710           then
4711                 cf_have_incdir=no
4712                 if test -n "$CFLAGS$CPPFLAGS" ; then
4713                   # a loop is needed to ensure we can add subdirs of existing dirs
4714                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4715                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4716                           cf_have_incdir=yes; break
4717                         fi
4718                   done
4719                 fi
4720
4721                 if test "$cf_have_incdir" = no ; then
4722                   if test "$cf_add_incdir" = /usr/local/include ; then
4723                         if test "$GCC" = yes
4724                         then
4725                           cf_save_CPPFLAGS=$CPPFLAGS
4726                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4727                           cat >conftest.$ac_ext <<_ACEOF
4728 #line 4728 "configure"
4729 #include "confdefs.h"
4730 #include <stdio.h>
4731 int
4732 main (void)
4733 {
4734 printf("Hello")
4735   ;
4736   return 0;
4737 }
4738 _ACEOF
4739 rm -f conftest.$ac_objext
4740 if { (eval echo "$as_me:4740: \"$ac_compile\"") >&5
4741   (eval $ac_compile) 2>&5
4742   ac_status=$?
4743   echo "$as_me:4743: \$? = $ac_status" >&5
4744   (exit $ac_status); } &&
4745          { ac_try='test -s conftest.$ac_objext'
4746   { (eval echo "$as_me:4746: \"$ac_try\"") >&5
4747   (eval $ac_try) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); }; }; then
4751   :
4752 else
4753   echo "$as_me: failed program was:" >&5
4754 cat conftest.$ac_ext >&5
4755 cf_have_incdir=yes
4756 fi
4757 rm -f conftest.$ac_objext conftest.$ac_ext
4758                           CPPFLAGS=$cf_save_CPPFLAGS
4759                         fi
4760                   fi
4761                 fi
4762
4763                 if test "$cf_have_incdir" = no ; then
4764                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4765
4766 echo "${as_me:-configure}:4766: testing adding $cf_add_incdir to include-path ..." 1>&5
4767
4768                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4769
4770                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4771                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4772                   cf_add_incdir="$cf_top_incdir"
4773                 else
4774                   break
4775                 fi
4776           else
4777                 break
4778           fi
4779         done
4780   done
4781 fi
4782
4783 fi
4784
4785 # Set definitions to allow ifdef'ing for ncurses.h
4786
4787 case $cf_cv_ncurses_header in
4788 (*ncurses.h)
4789
4790 cat >>confdefs.h <<\EOF
4791 #define HAVE_NCURSES_H 1
4792 EOF
4793
4794         ;;
4795 esac
4796
4797 case $cf_cv_ncurses_header in
4798 (ncurses/curses.h|ncurses/ncurses.h)
4799
4800 cat >>confdefs.h <<\EOF
4801 #define HAVE_NCURSES_NCURSES_H 1
4802 EOF
4803
4804         ;;
4805 (ncursesw/curses.h|ncursesw/ncurses.h)
4806
4807 cat >>confdefs.h <<\EOF
4808 #define HAVE_NCURSESW_NCURSES_H 1
4809 EOF
4810
4811         ;;
4812 esac
4813
4814 echo "$as_me:4814: checking for terminfo header" >&5
4815 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4816 if test "${cf_cv_term_header+set}" = set; then
4817   echo $ECHO_N "(cached) $ECHO_C" >&6
4818 else
4819
4820 case ${cf_cv_ncurses_header} in
4821 (*/ncurses.h|*/ncursesw.h)
4822         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4823         ;;
4824 (*)
4825         cf_term_header=term.h
4826         ;;
4827 esac
4828
4829 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4830 do
4831 cat >conftest.$ac_ext <<_ACEOF
4832 #line 4832 "configure"
4833 #include "confdefs.h"
4834 #include <stdio.h>
4835 #include <${cf_cv_ncurses_header:-curses.h}>
4836 #include <$cf_test>
4837
4838 int
4839 main (void)
4840 {
4841 int x = auto_left_margin
4842   ;
4843   return 0;
4844 }
4845 _ACEOF
4846 rm -f conftest.$ac_objext
4847 if { (eval echo "$as_me:4847: \"$ac_compile\"") >&5
4848   (eval $ac_compile) 2>&5
4849   ac_status=$?
4850   echo "$as_me:4850: \$? = $ac_status" >&5
4851   (exit $ac_status); } &&
4852          { ac_try='test -s conftest.$ac_objext'
4853   { (eval echo "$as_me:4853: \"$ac_try\"") >&5
4854   (eval $ac_try) 2>&5
4855   ac_status=$?
4856   echo "$as_me:4856: \$? = $ac_status" >&5
4857   (exit $ac_status); }; }; then
4858
4859         cf_cv_term_header="$cf_test"
4860 else
4861   echo "$as_me: failed program was:" >&5
4862 cat conftest.$ac_ext >&5
4863
4864         cf_cv_term_header=unknown
4865
4866 fi
4867 rm -f conftest.$ac_objext conftest.$ac_ext
4868         test "$cf_cv_term_header" != unknown && break
4869 done
4870
4871 fi
4872 echo "$as_me:4872: result: $cf_cv_term_header" >&5
4873 echo "${ECHO_T}$cf_cv_term_header" >&6
4874
4875 # Set definitions to allow ifdef'ing to accommodate subdirectories
4876
4877 case $cf_cv_term_header in
4878 (*term.h)
4879
4880 cat >>confdefs.h <<\EOF
4881 #define HAVE_TERM_H 1
4882 EOF
4883
4884         ;;
4885 esac
4886
4887 case $cf_cv_term_header in
4888 (ncurses/term.h)
4889
4890 cat >>confdefs.h <<\EOF
4891 #define HAVE_NCURSES_TERM_H 1
4892 EOF
4893
4894         ;;
4895 (ncursesw/term.h)
4896
4897 cat >>confdefs.h <<\EOF
4898 #define HAVE_NCURSESW_TERM_H 1
4899 EOF
4900
4901         ;;
4902 esac
4903
4904 # some applications need this, but should check for NCURSES_VERSION
4905
4906 cat >>confdefs.h <<\EOF
4907 #define NCURSES 1
4908 EOF
4909
4910 echo "$as_me:4910: checking for ncurses version" >&5
4911 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4912 if test "${cf_cv_ncurses_version+set}" = set; then
4913   echo $ECHO_N "(cached) $ECHO_C" >&6
4914 else
4915
4916         cf_cv_ncurses_version=no
4917         cf_tempfile=out$$
4918         rm -f $cf_tempfile
4919         if test "$cross_compiling" = yes; then
4920
4921         # This will not work if the preprocessor splits the line after the
4922         # Autoconf token.  The 'unproto' program does that.
4923         cat > conftest.$ac_ext <<EOF
4924 #include <${cf_cv_ncurses_header:-curses.h}>
4925 #undef Autoconf
4926 #ifdef NCURSES_VERSION
4927 Autoconf NCURSES_VERSION
4928 #else
4929 #ifdef __NCURSES_H
4930 Autoconf "old"
4931 #endif
4932 ;
4933 #endif
4934 EOF
4935         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4936         { (eval echo "$as_me:4936: \"$cf_try\"") >&5
4937   (eval $cf_try) 2>&5
4938   ac_status=$?
4939   echo "$as_me:4939: \$? = $ac_status" >&5
4940   (exit $ac_status); }
4941         if test -f conftest.out ; then
4942                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4943                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4944                 rm -f conftest.out
4945         fi
4946
4947 else
4948   cat >conftest.$ac_ext <<_ACEOF
4949 #line 4949 "configure"
4950 #include "confdefs.h"
4951
4952 #include <${cf_cv_ncurses_header:-curses.h}>
4953 #include <stdio.h>
4954 int main(void)
4955 {
4956         FILE *fp = fopen("$cf_tempfile", "w");
4957 #ifdef NCURSES_VERSION
4958 # ifdef NCURSES_VERSION_PATCH
4959         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4960 # else
4961         fprintf(fp, "%s\n", NCURSES_VERSION);
4962 # endif
4963 #else
4964 # ifdef __NCURSES_H
4965         fprintf(fp, "old\n");
4966 # else
4967         make an error
4968 # endif
4969 #endif
4970         ${cf_cv_main_return:-return}(0);
4971 }
4972 _ACEOF
4973 rm -f conftest$ac_exeext
4974 if { (eval echo "$as_me:4974: \"$ac_link\"") >&5
4975   (eval $ac_link) 2>&5
4976   ac_status=$?
4977   echo "$as_me:4977: \$? = $ac_status" >&5
4978   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4979   { (eval echo "$as_me:4979: \"$ac_try\"") >&5
4980   (eval $ac_try) 2>&5
4981   ac_status=$?
4982   echo "$as_me:4982: \$? = $ac_status" >&5
4983   (exit $ac_status); }; }; then
4984
4985         cf_cv_ncurses_version=`cat $cf_tempfile`
4986 else
4987   echo "$as_me: program exited with status $ac_status" >&5
4988 echo "$as_me: failed program was:" >&5
4989 cat conftest.$ac_ext >&5
4990 fi
4991 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4992 fi
4993         rm -f $cf_tempfile
4994
4995 fi
4996 echo "$as_me:4996: result: $cf_cv_ncurses_version" >&5
4997 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4998 test "$cf_cv_ncurses_version" = no ||
4999 cat >>confdefs.h <<\EOF
5000 #define NCURSES 1
5001 EOF
5002
5003 cf_nculib_root=ncurses
5004         # This works, except for the special case where we find gpm, but
5005         # ncurses is in a nonstandard location via $LIBS, and we really want
5006         # to link gpm.
5007 cf_ncurses_LIBS=""
5008 cf_ncurses_SAVE="$LIBS"
5009 echo "$as_me:5009: checking for Gpm_Open in -lgpm" >&5
5010 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5011 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5012   echo $ECHO_N "(cached) $ECHO_C" >&6
5013 else
5014   ac_check_lib_save_LIBS=$LIBS
5015 LIBS="-lgpm  $LIBS"
5016 cat >conftest.$ac_ext <<_ACEOF
5017 #line 5017 "configure"
5018 #include "confdefs.h"
5019
5020 /* Override any gcc2 internal prototype to avoid an error.  */
5021 #ifdef __cplusplus
5022 extern "C"
5023 #endif
5024 /* We use char because int might match the return type of a gcc2
5025    builtin and then its argument prototype would still apply.  */
5026 char Gpm_Open ();
5027 int
5028 main (void)
5029 {
5030 Gpm_Open ();
5031   ;
5032   return 0;
5033 }
5034 _ACEOF
5035 rm -f conftest.$ac_objext conftest$ac_exeext
5036 if { (eval echo "$as_me:5036: \"$ac_link\"") >&5
5037   (eval $ac_link) 2>&5
5038   ac_status=$?
5039   echo "$as_me:5039: \$? = $ac_status" >&5
5040   (exit $ac_status); } &&
5041          { ac_try='test -s conftest$ac_exeext'
5042   { (eval echo "$as_me:5042: \"$ac_try\"") >&5
5043   (eval $ac_try) 2>&5
5044   ac_status=$?
5045   echo "$as_me:5045: \$? = $ac_status" >&5
5046   (exit $ac_status); }; }; then
5047   ac_cv_lib_gpm_Gpm_Open=yes
5048 else
5049   echo "$as_me: failed program was:" >&5
5050 cat conftest.$ac_ext >&5
5051 ac_cv_lib_gpm_Gpm_Open=no
5052 fi
5053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5054 LIBS=$ac_check_lib_save_LIBS
5055 fi
5056 echo "$as_me:5056: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5057 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5058 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5059   echo "$as_me:5059: checking for initscr in -lgpm" >&5
5060 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5061 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5062   echo $ECHO_N "(cached) $ECHO_C" >&6
5063 else
5064   ac_check_lib_save_LIBS=$LIBS
5065 LIBS="-lgpm  $LIBS"
5066 cat >conftest.$ac_ext <<_ACEOF
5067 #line 5067 "configure"
5068 #include "confdefs.h"
5069
5070 /* Override any gcc2 internal prototype to avoid an error.  */
5071 #ifdef __cplusplus
5072 extern "C"
5073 #endif
5074 /* We use char because int might match the return type of a gcc2
5075    builtin and then its argument prototype would still apply.  */
5076 char initscr ();
5077 int
5078 main (void)
5079 {
5080 initscr ();
5081   ;
5082   return 0;
5083 }
5084 _ACEOF
5085 rm -f conftest.$ac_objext conftest$ac_exeext
5086 if { (eval echo "$as_me:5086: \"$ac_link\"") >&5
5087   (eval $ac_link) 2>&5
5088   ac_status=$?
5089   echo "$as_me:5089: \$? = $ac_status" >&5
5090   (exit $ac_status); } &&
5091          { ac_try='test -s conftest$ac_exeext'
5092   { (eval echo "$as_me:5092: \"$ac_try\"") >&5
5093   (eval $ac_try) 2>&5
5094   ac_status=$?
5095   echo "$as_me:5095: \$? = $ac_status" >&5
5096   (exit $ac_status); }; }; then
5097   ac_cv_lib_gpm_initscr=yes
5098 else
5099   echo "$as_me: failed program was:" >&5
5100 cat conftest.$ac_ext >&5
5101 ac_cv_lib_gpm_initscr=no
5102 fi
5103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5104 LIBS=$ac_check_lib_save_LIBS
5105 fi
5106 echo "$as_me:5106: result: $ac_cv_lib_gpm_initscr" >&5
5107 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5108 if test $ac_cv_lib_gpm_initscr = yes; then
5109   LIBS="$cf_ncurses_SAVE"
5110 else
5111   cf_ncurses_LIBS="-lgpm"
5112 fi
5113
5114 fi
5115
5116 case $host_os in
5117 (freebsd*)
5118         # This is only necessary if you are linking against an obsolete
5119         # version of ncurses (but it should do no harm, since it's static).
5120         if test "$cf_nculib_root" = ncurses ; then
5121                 echo "$as_me:5121: checking for tgoto in -lmytinfo" >&5
5122 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5123 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5124   echo $ECHO_N "(cached) $ECHO_C" >&6
5125 else
5126   ac_check_lib_save_LIBS=$LIBS
5127 LIBS="-lmytinfo  $LIBS"
5128 cat >conftest.$ac_ext <<_ACEOF
5129 #line 5129 "configure"
5130 #include "confdefs.h"
5131
5132 /* Override any gcc2 internal prototype to avoid an error.  */
5133 #ifdef __cplusplus
5134 extern "C"
5135 #endif
5136 /* We use char because int might match the return type of a gcc2
5137    builtin and then its argument prototype would still apply.  */
5138 char tgoto ();
5139 int
5140 main (void)
5141 {
5142 tgoto ();
5143   ;
5144   return 0;
5145 }
5146 _ACEOF
5147 rm -f conftest.$ac_objext conftest$ac_exeext
5148 if { (eval echo "$as_me:5148: \"$ac_link\"") >&5
5149   (eval $ac_link) 2>&5
5150   ac_status=$?
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); } &&
5153          { ac_try='test -s conftest$ac_exeext'
5154   { (eval echo "$as_me:5154: \"$ac_try\"") >&5
5155   (eval $ac_try) 2>&5
5156   ac_status=$?
5157   echo "$as_me:5157: \$? = $ac_status" >&5
5158   (exit $ac_status); }; }; then
5159   ac_cv_lib_mytinfo_tgoto=yes
5160 else
5161   echo "$as_me: failed program was:" >&5
5162 cat conftest.$ac_ext >&5
5163 ac_cv_lib_mytinfo_tgoto=no
5164 fi
5165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5166 LIBS=$ac_check_lib_save_LIBS
5167 fi
5168 echo "$as_me:5168: result: $ac_cv_lib_mytinfo_tgoto" >&5
5169 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5170 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5171   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5172 fi
5173
5174         fi
5175         ;;
5176 esac
5177
5178 cf_add_libs="$cf_ncurses_LIBS"
5179 # Filter out duplicates - this happens with badly-designed ".pc" files...
5180 for cf_add_1lib in $LIBS
5181 do
5182         for cf_add_2lib in $cf_add_libs
5183         do
5184                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5185                 then
5186                         cf_add_1lib=
5187                         break
5188                 fi
5189         done
5190         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5191 done
5192 LIBS="$cf_add_libs"
5193
5194 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5195 then
5196
5197 cf_add_libs="-l$cf_nculib_root"
5198 # Filter out duplicates - this happens with badly-designed ".pc" files...
5199 for cf_add_1lib in $LIBS
5200 do
5201         for cf_add_2lib in $cf_add_libs
5202         do
5203                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5204                 then
5205                         cf_add_1lib=
5206                         break
5207                 fi
5208         done
5209         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5210 done
5211 LIBS="$cf_add_libs"
5212
5213 else
5214
5215         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5216         cf_libdir=""
5217         echo "$as_me:5217: checking for initscr" >&5
5218 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5219 if test "${ac_cv_func_initscr+set}" = set; then
5220   echo $ECHO_N "(cached) $ECHO_C" >&6
5221 else
5222   cat >conftest.$ac_ext <<_ACEOF
5223 #line 5223 "configure"
5224 #include "confdefs.h"
5225 /* System header to define __stub macros and hopefully few prototypes,
5226     which can conflict with char initscr (); below.  */
5227 #include <assert.h>
5228 /* Override any gcc2 internal prototype to avoid an error.  */
5229 #ifdef __cplusplus
5230 extern "C"
5231 #endif
5232 /* We use char because int might match the return type of a gcc2
5233    builtin and then its argument prototype would still apply.  */
5234 char initscr ();
5235 char (*f) ();
5236
5237 int
5238 main (void)
5239 {
5240 /* The GNU C library defines this for functions which it implements
5241     to always fail with ENOSYS.  Some functions are actually named
5242     something starting with __ and the normal name is an alias.  */
5243 #if defined (__stub_initscr) || defined (__stub___initscr)
5244 choke me
5245 #else
5246 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5247 #endif
5248
5249   ;
5250   return 0;
5251 }
5252 _ACEOF
5253 rm -f conftest.$ac_objext conftest$ac_exeext
5254 if { (eval echo "$as_me:5254: \"$ac_link\"") >&5
5255   (eval $ac_link) 2>&5
5256   ac_status=$?
5257   echo "$as_me:5257: \$? = $ac_status" >&5
5258   (exit $ac_status); } &&
5259          { ac_try='test -s conftest$ac_exeext'
5260   { (eval echo "$as_me:5260: \"$ac_try\"") >&5
5261   (eval $ac_try) 2>&5
5262   ac_status=$?
5263   echo "$as_me:5263: \$? = $ac_status" >&5
5264   (exit $ac_status); }; }; then
5265   ac_cv_func_initscr=yes
5266 else
5267   echo "$as_me: failed program was:" >&5
5268 cat conftest.$ac_ext >&5
5269 ac_cv_func_initscr=no
5270 fi
5271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5272 fi
5273 echo "$as_me:5273: result: $ac_cv_func_initscr" >&5
5274 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5275 if test $ac_cv_func_initscr = yes; then
5276   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5277 else
5278
5279                 cf_save_LIBS="$LIBS"
5280                 echo "$as_me:5280: checking for initscr in -l$cf_nculib_root" >&5
5281 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5282                 LIBS="-l$cf_nculib_root $LIBS"
5283                 cat >conftest.$ac_ext <<_ACEOF
5284 #line 5284 "configure"
5285 #include "confdefs.h"
5286 #include <${cf_cv_ncurses_header:-curses.h}>
5287 int
5288 main (void)
5289 {
5290 initscr()
5291   ;
5292   return 0;
5293 }
5294 _ACEOF
5295 rm -f conftest.$ac_objext conftest$ac_exeext
5296 if { (eval echo "$as_me:5296: \"$ac_link\"") >&5
5297   (eval $ac_link) 2>&5
5298   ac_status=$?
5299   echo "$as_me:5299: \$? = $ac_status" >&5
5300   (exit $ac_status); } &&
5301          { ac_try='test -s conftest$ac_exeext'
5302   { (eval echo "$as_me:5302: \"$ac_try\"") >&5
5303   (eval $ac_try) 2>&5
5304   ac_status=$?
5305   echo "$as_me:5305: \$? = $ac_status" >&5
5306   (exit $ac_status); }; }; then
5307   echo "$as_me:5307: result: yes" >&5
5308 echo "${ECHO_T}yes" >&6
5309                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5310
5311 else
5312   echo "$as_me: failed program was:" >&5
5313 cat conftest.$ac_ext >&5
5314 echo "$as_me:5314: result: no" >&5
5315 echo "${ECHO_T}no" >&6
5316
5317 cf_search=
5318 cf_library_path_list=""
5319 if test -n "${LDFLAGS}${LIBS}" ; then
5320         for cf_library_path in $LDFLAGS $LIBS
5321         do
5322                 case $cf_library_path in
5323                 (-L*)
5324                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5325
5326 test "x$cf_library_path" != "xNONE" && \
5327 test -d "$cf_library_path" && \
5328  {
5329         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5330         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5331         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5332         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5333         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5334         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"
5335 }
5336
5337                         cf_library_path_list="$cf_library_path_list $cf_search"
5338                         ;;
5339                 esac
5340         done
5341 fi
5342
5343 cf_search=
5344
5345 test "x$prefix" != "xNONE" && \
5346 test -d "$prefix" && \
5347  {
5348         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5349         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5350         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5351         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5352         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5353         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5354 }
5355
5356 for cf_subdir_prefix in \
5357         /usr \
5358         /usr/local \
5359         /usr/pkg \
5360         /opt \
5361         /opt/local \
5362         $HOME
5363 do
5364
5365 test "x$cf_subdir_prefix" != "x$prefix" && \
5366 test -d "$cf_subdir_prefix" && \
5367 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5368         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5369         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5370         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5371         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5372         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5373         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"
5374 }
5375
5376 done
5377
5378 cf_search="$cf_library_path_list $cf_search"
5379
5380                         for cf_libdir in $cf_search
5381                         do
5382                                 echo "$as_me:5382: checking for -l$cf_nculib_root in $cf_libdir" >&5
5383 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5384                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5385                                 cat >conftest.$ac_ext <<_ACEOF
5386 #line 5386 "configure"
5387 #include "confdefs.h"
5388 #include <${cf_cv_ncurses_header:-curses.h}>
5389 int
5390 main (void)
5391 {
5392 initscr()
5393   ;
5394   return 0;
5395 }
5396 _ACEOF
5397 rm -f conftest.$ac_objext conftest$ac_exeext
5398 if { (eval echo "$as_me:5398: \"$ac_link\"") >&5
5399   (eval $ac_link) 2>&5
5400   ac_status=$?
5401   echo "$as_me:5401: \$? = $ac_status" >&5
5402   (exit $ac_status); } &&
5403          { ac_try='test -s conftest$ac_exeext'
5404   { (eval echo "$as_me:5404: \"$ac_try\"") >&5
5405   (eval $ac_try) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit $ac_status); }; }; then
5409   echo "$as_me:5409: result: yes" >&5
5410 echo "${ECHO_T}yes" >&6
5411                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5412                                          break
5413 else
5414   echo "$as_me: failed program was:" >&5
5415 cat conftest.$ac_ext >&5
5416 echo "$as_me:5416: result: no" >&5
5417 echo "${ECHO_T}no" >&6
5418                                          LIBS="$cf_save_LIBS"
5419 fi
5420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5421                         done
5422
5423 fi
5424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5425
5426 fi
5427
5428 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5429
5430 if test $cf_found_library = no ; then
5431         { { echo "$as_me:5431: error: Cannot link $cf_nculib_root library" >&5
5432 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5433    { (exit 1); exit 1; }; }
5434 fi
5435
5436 fi
5437
5438 if test -n "$cf_ncurses_LIBS" ; then
5439         echo "$as_me:5439: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5440 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5441         cf_ncurses_SAVE="$LIBS"
5442         for p in $cf_ncurses_LIBS ; do
5443                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5444                 if test "$q" != "$LIBS" ; then
5445                         LIBS="$q"
5446                 fi
5447         done
5448         cat >conftest.$ac_ext <<_ACEOF
5449 #line 5449 "configure"
5450 #include "confdefs.h"
5451 #include <${cf_cv_ncurses_header:-curses.h}>
5452 int
5453 main (void)
5454 {
5455 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5456   ;
5457   return 0;
5458 }
5459 _ACEOF
5460 rm -f conftest.$ac_objext conftest$ac_exeext
5461 if { (eval echo "$as_me:5461: \"$ac_link\"") >&5
5462   (eval $ac_link) 2>&5
5463   ac_status=$?
5464   echo "$as_me:5464: \$? = $ac_status" >&5
5465   (exit $ac_status); } &&
5466          { ac_try='test -s conftest$ac_exeext'
5467   { (eval echo "$as_me:5467: \"$ac_try\"") >&5
5468   (eval $ac_try) 2>&5
5469   ac_status=$?
5470   echo "$as_me:5470: \$? = $ac_status" >&5
5471   (exit $ac_status); }; }; then
5472   echo "$as_me:5472: result: yes" >&5
5473 echo "${ECHO_T}yes" >&6
5474 else
5475   echo "$as_me: failed program was:" >&5
5476 cat conftest.$ac_ext >&5
5477 echo "$as_me:5477: result: no" >&5
5478 echo "${ECHO_T}no" >&6
5479                  LIBS="$cf_ncurses_SAVE"
5480 fi
5481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5482 fi
5483
5484 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5485
5486 cat >>confdefs.h <<EOF
5487 #define $cf_nculib_ROOT 1
5488 EOF
5489
5490         fi
5491 else
5492         NCURSES_CONFIG=none
5493 fi
5494
5495 echo "$as_me:5495: checking if you want wide-character code" >&5
5496 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5497
5498 # Check whether --enable-widec or --disable-widec was given.
5499 if test "${enable_widec+set}" = set; then
5500   enableval="$enable_widec"
5501   with_widec=$enableval
5502 else
5503   with_widec=no
5504 fi;
5505 echo "$as_me:5505: result: $with_widec" >&5
5506 echo "${ECHO_T}$with_widec" >&6
5507 if test "$with_widec" = yes ; then
5508
5509 echo "$as_me:5509: checking for multibyte character support" >&5
5510 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5511 if test "${cf_cv_utf8_lib+set}" = set; then
5512   echo $ECHO_N "(cached) $ECHO_C" >&6
5513 else
5514
5515         cf_save_LIBS="$LIBS"
5516         cat >conftest.$ac_ext <<_ACEOF
5517 #line 5517 "configure"
5518 #include "confdefs.h"
5519
5520 #include <stdlib.h>
5521 int
5522 main (void)
5523 {
5524 putwc(0,0);
5525   ;
5526   return 0;
5527 }
5528 _ACEOF
5529 rm -f conftest.$ac_objext conftest$ac_exeext
5530 if { (eval echo "$as_me:5530: \"$ac_link\"") >&5
5531   (eval $ac_link) 2>&5
5532   ac_status=$?
5533   echo "$as_me:5533: \$? = $ac_status" >&5
5534   (exit $ac_status); } &&
5535          { ac_try='test -s conftest$ac_exeext'
5536   { (eval echo "$as_me:5536: \"$ac_try\"") >&5
5537   (eval $ac_try) 2>&5
5538   ac_status=$?
5539   echo "$as_me:5539: \$? = $ac_status" >&5
5540   (exit $ac_status); }; }; then
5541   cf_cv_utf8_lib=yes
5542 else
5543   echo "$as_me: failed program was:" >&5
5544 cat conftest.$ac_ext >&5
5545
5546 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5547 # will be set on completion of the AC_TRY_LINK below.
5548 cf_cv_header_path_utf8=
5549 cf_cv_library_path_utf8=
5550
5551 echo "${as_me:-configure}:5551: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5552
5553 cf_save_LIBS="$LIBS"
5554
5555 cat >conftest.$ac_ext <<_ACEOF
5556 #line 5556 "configure"
5557 #include "confdefs.h"
5558
5559 #include <libutf8.h>
5560 int
5561 main (void)
5562 {
5563 putwc(0,0);
5564   ;
5565   return 0;
5566 }
5567 _ACEOF
5568 rm -f conftest.$ac_objext conftest$ac_exeext
5569 if { (eval echo "$as_me:5569: \"$ac_link\"") >&5
5570   (eval $ac_link) 2>&5
5571   ac_status=$?
5572   echo "$as_me:5572: \$? = $ac_status" >&5
5573   (exit $ac_status); } &&
5574          { ac_try='test -s conftest$ac_exeext'
5575   { (eval echo "$as_me:5575: \"$ac_try\"") >&5
5576   (eval $ac_try) 2>&5
5577   ac_status=$?
5578   echo "$as_me:5578: \$? = $ac_status" >&5
5579   (exit $ac_status); }; }; then
5580
5581         cf_cv_find_linkage_utf8=yes
5582         cf_cv_header_path_utf8=/usr/include
5583         cf_cv_library_path_utf8=/usr/lib
5584
5585 else
5586   echo "$as_me: failed program was:" >&5
5587 cat conftest.$ac_ext >&5
5588
5589 LIBS="-lutf8  $cf_save_LIBS"
5590
5591 cat >conftest.$ac_ext <<_ACEOF
5592 #line 5592 "configure"
5593 #include "confdefs.h"
5594
5595 #include <libutf8.h>
5596 int
5597 main (void)
5598 {
5599 putwc(0,0);
5600   ;
5601   return 0;
5602 }
5603 _ACEOF
5604 rm -f conftest.$ac_objext conftest$ac_exeext
5605 if { (eval echo "$as_me:5605: \"$ac_link\"") >&5
5606   (eval $ac_link) 2>&5
5607   ac_status=$?
5608   echo "$as_me:5608: \$? = $ac_status" >&5
5609   (exit $ac_status); } &&
5610          { ac_try='test -s conftest$ac_exeext'
5611   { (eval echo "$as_me:5611: \"$ac_try\"") >&5
5612   (eval $ac_try) 2>&5
5613   ac_status=$?
5614   echo "$as_me:5614: \$? = $ac_status" >&5
5615   (exit $ac_status); }; }; then
5616
5617         cf_cv_find_linkage_utf8=yes
5618         cf_cv_header_path_utf8=/usr/include
5619         cf_cv_library_path_utf8=/usr/lib
5620         cf_cv_library_file_utf8="-lutf8"
5621
5622 else
5623   echo "$as_me: failed program was:" >&5
5624 cat conftest.$ac_ext >&5
5625
5626         cf_cv_find_linkage_utf8=no
5627         LIBS="$cf_save_LIBS"
5628
5629         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5630
5631 echo "${as_me:-configure}:5631: testing find linkage for utf8 library ..." 1>&5
5632
5633 echo "${as_me:-configure}:5633: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5634
5635         cf_save_CPPFLAGS="$CPPFLAGS"
5636         cf_test_CPPFLAGS="$CPPFLAGS"
5637
5638 cf_search=
5639
5640 # collect the current set of include-directories from compiler flags
5641 cf_header_path_list=""
5642 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5643         for cf_header_path in $CPPFLAGS $CFLAGS
5644         do
5645                 case $cf_header_path in
5646                 (-I*)
5647                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5648
5649 test "x$cf_header_path" != "xNONE" && \
5650 test -d "$cf_header_path" && \
5651  {
5652         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5653         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5654         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5655         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5656         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5657         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5658 }
5659
5660                         cf_header_path_list="$cf_header_path_list $cf_search"
5661                         ;;
5662                 esac
5663         done
5664 fi
5665
5666 # add the variations for the package we are looking for
5667
5668 cf_search=
5669
5670 test "x$prefix" != "xNONE" && \
5671 test -d "$prefix" && \
5672  {
5673         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5674         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5675         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5676         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5677         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5678         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5679 }
5680
5681 for cf_subdir_prefix in \
5682         /usr \
5683         /usr/local \
5684         /usr/pkg \
5685         /opt \
5686         /opt/local \
5687         $HOME
5688 do
5689
5690 test "x$cf_subdir_prefix" != "x$prefix" && \
5691 test -d "$cf_subdir_prefix" && \
5692 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5693         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5694         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5695         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5696         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5697         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5698         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5699 }
5700
5701 done
5702
5703 test "$includedir" != NONE && \
5704 test "$includedir" != "/usr/include" && \
5705 test -d "$includedir" && {
5706         test -d $includedir &&    cf_search="$cf_search $includedir"
5707         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5708 }
5709
5710 test "$oldincludedir" != NONE && \
5711 test "$oldincludedir" != "/usr/include" && \
5712 test -d "$oldincludedir" && {
5713         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5714         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5715 }
5716
5717 cf_search="$cf_search $cf_header_path_list"
5718
5719         for cf_cv_header_path_utf8 in $cf_search
5720         do
5721                 if test -d $cf_cv_header_path_utf8 ; then
5722                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5723
5724 echo "${as_me:-configure}:5724: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5725
5726                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5727                         cat >conftest.$ac_ext <<_ACEOF
5728 #line 5728 "configure"
5729 #include "confdefs.h"
5730
5731 #include <libutf8.h>
5732 int
5733 main (void)
5734 {
5735 putwc(0,0);
5736   ;
5737   return 0;
5738 }
5739 _ACEOF
5740 rm -f conftest.$ac_objext
5741 if { (eval echo "$as_me:5741: \"$ac_compile\"") >&5
5742   (eval $ac_compile) 2>&5
5743   ac_status=$?
5744   echo "$as_me:5744: \$? = $ac_status" >&5
5745   (exit $ac_status); } &&
5746          { ac_try='test -s conftest.$ac_objext'
5747   { (eval echo "$as_me:5747: \"$ac_try\"") >&5
5748   (eval $ac_try) 2>&5
5749   ac_status=$?
5750   echo "$as_me:5750: \$? = $ac_status" >&5
5751   (exit $ac_status); }; }; then
5752
5753                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5754
5755 echo "${as_me:-configure}:5755: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5756
5757                                 cf_cv_find_linkage_utf8=maybe
5758                                 cf_test_CPPFLAGS="$CPPFLAGS"
5759                                 break
5760 else
5761   echo "$as_me: failed program was:" >&5
5762 cat conftest.$ac_ext >&5
5763
5764                                 CPPFLAGS="$cf_save_CPPFLAGS"
5765
5766 fi
5767 rm -f conftest.$ac_objext conftest.$ac_ext
5768                 fi
5769         done
5770
5771         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5772
5773 echo "${as_me:-configure}:5773: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5774
5775                 cf_save_LIBS="$LIBS"
5776                 cf_save_LDFLAGS="$LDFLAGS"
5777
5778                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5779
5780 cf_search=
5781 cf_library_path_list=""
5782 if test -n "${LDFLAGS}${LIBS}" ; then
5783         for cf_library_path in $LDFLAGS $LIBS
5784         do
5785                 case $cf_library_path in
5786                 (-L*)
5787                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5788
5789 test "x$cf_library_path" != "xNONE" && \
5790 test -d "$cf_library_path" && \
5791  {
5792         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5793         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5794         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5795         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5796         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5797         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5798 }
5799
5800                         cf_library_path_list="$cf_library_path_list $cf_search"
5801                         ;;
5802                 esac
5803         done
5804 fi
5805
5806 cf_search=
5807
5808 test "x$prefix" != "xNONE" && \
5809 test -d "$prefix" && \
5810  {
5811         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5812         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5813         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5814         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5815         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5816         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5817 }
5818
5819 for cf_subdir_prefix in \
5820         /usr \
5821         /usr/local \
5822         /usr/pkg \
5823         /opt \
5824         /opt/local \
5825         $HOME
5826 do
5827
5828 test "x$cf_subdir_prefix" != "x$prefix" && \
5829 test -d "$cf_subdir_prefix" && \
5830 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5831         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5832         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5833         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5834         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5835         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5836         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5837 }
5838
5839 done
5840
5841 cf_search="$cf_library_path_list $cf_search"
5842
5843                         for cf_cv_library_path_utf8 in $cf_search
5844                         do
5845                                 if test -d $cf_cv_library_path_utf8 ; then
5846                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5847
5848 echo "${as_me:-configure}:5848: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5849
5850                                         CPPFLAGS="$cf_test_CPPFLAGS"
5851                                         LIBS="-lutf8  $cf_save_LIBS"
5852                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5853                                         cat >conftest.$ac_ext <<_ACEOF
5854 #line 5854 "configure"
5855 #include "confdefs.h"
5856
5857 #include <libutf8.h>
5858 int
5859 main (void)
5860 {
5861 putwc(0,0);
5862   ;
5863   return 0;
5864 }
5865 _ACEOF
5866 rm -f conftest.$ac_objext conftest$ac_exeext
5867 if { (eval echo "$as_me:5867: \"$ac_link\"") >&5
5868   (eval $ac_link) 2>&5
5869   ac_status=$?
5870   echo "$as_me:5870: \$? = $ac_status" >&5
5871   (exit $ac_status); } &&
5872          { ac_try='test -s conftest$ac_exeext'
5873   { (eval echo "$as_me:5873: \"$ac_try\"") >&5
5874   (eval $ac_try) 2>&5
5875   ac_status=$?
5876   echo "$as_me:5876: \$? = $ac_status" >&5
5877   (exit $ac_status); }; }; then
5878
5879                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5880
5881 echo "${as_me:-configure}:5881: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5882
5883                                         cf_cv_find_linkage_utf8=yes
5884                                         cf_cv_library_file_utf8="-lutf8"
5885                                         break
5886 else
5887   echo "$as_me: failed program was:" >&5
5888 cat conftest.$ac_ext >&5
5889
5890                                         CPPFLAGS="$cf_save_CPPFLAGS"
5891                                         LIBS="$cf_save_LIBS"
5892                                         LDFLAGS="$cf_save_LDFLAGS"
5893
5894 fi
5895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5896                                 fi
5897                         done
5898                         CPPFLAGS="$cf_save_CPPFLAGS"
5899                         LDFLAGS="$cf_save_LDFLAGS"
5900                 fi
5901
5902         else
5903                 cf_cv_find_linkage_utf8=no
5904         fi
5905
5906 fi
5907 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5908
5909 fi
5910 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5911
5912 LIBS="$cf_save_LIBS"
5913
5914 if test "$cf_cv_find_linkage_utf8" = yes ; then
5915 cf_cv_utf8_lib=add-on
5916 else
5917 cf_cv_utf8_lib=no
5918 fi
5919
5920 fi
5921 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5922 fi
5923 echo "$as_me:5923: result: $cf_cv_utf8_lib" >&5
5924 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5925
5926 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5927 # ncurses/ncursesw:
5928 if test "$cf_cv_utf8_lib" = "add-on" ; then
5929
5930 cat >>confdefs.h <<\EOF
5931 #define HAVE_LIBUTF8_H 1
5932 EOF
5933
5934 if test -n "$cf_cv_header_path_utf8" ; then
5935   for cf_add_incdir in $cf_cv_header_path_utf8
5936   do
5937         while test $cf_add_incdir != /usr/include
5938         do
5939           if test -d $cf_add_incdir
5940           then
5941                 cf_have_incdir=no
5942                 if test -n "$CFLAGS$CPPFLAGS" ; then
5943                   # a loop is needed to ensure we can add subdirs of existing dirs
5944                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5945                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5946                           cf_have_incdir=yes; break
5947                         fi
5948                   done
5949                 fi
5950
5951                 if test "$cf_have_incdir" = no ; then
5952                   if test "$cf_add_incdir" = /usr/local/include ; then
5953                         if test "$GCC" = yes
5954                         then
5955                           cf_save_CPPFLAGS=$CPPFLAGS
5956                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5957                           cat >conftest.$ac_ext <<_ACEOF
5958 #line 5958 "configure"
5959 #include "confdefs.h"
5960 #include <stdio.h>
5961 int
5962 main (void)
5963 {
5964 printf("Hello")
5965   ;
5966   return 0;
5967 }
5968 _ACEOF
5969 rm -f conftest.$ac_objext
5970 if { (eval echo "$as_me:5970: \"$ac_compile\"") >&5
5971   (eval $ac_compile) 2>&5
5972   ac_status=$?
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } &&
5975          { ac_try='test -s conftest.$ac_objext'
5976   { (eval echo "$as_me:5976: \"$ac_try\"") >&5
5977   (eval $ac_try) 2>&5
5978   ac_status=$?
5979   echo "$as_me:5979: \$? = $ac_status" >&5
5980   (exit $ac_status); }; }; then
5981   :
5982 else
5983   echo "$as_me: failed program was:" >&5
5984 cat conftest.$ac_ext >&5
5985 cf_have_incdir=yes
5986 fi
5987 rm -f conftest.$ac_objext conftest.$ac_ext
5988                           CPPFLAGS=$cf_save_CPPFLAGS
5989                         fi
5990                   fi
5991                 fi
5992
5993                 if test "$cf_have_incdir" = no ; then
5994                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5995
5996 echo "${as_me:-configure}:5996: testing adding $cf_add_incdir to include-path ..." 1>&5
5997
5998                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5999
6000                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6001                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6002                   cf_add_incdir="$cf_top_incdir"
6003                 else
6004                   break
6005                 fi
6006           else
6007                 break
6008           fi
6009         done
6010   done
6011 fi
6012
6013 if test -n "$cf_cv_library_path_utf8" ; then
6014         for cf_add_libdir in $cf_cv_library_path_utf8
6015         do
6016                 if test $cf_add_libdir = /usr/lib ; then
6017                         :
6018                 elif test -d $cf_add_libdir
6019                 then
6020                         cf_have_libdir=no
6021                         if test -n "$LDFLAGS$LIBS" ; then
6022                                 # a loop is needed to ensure we can add subdirs of existing dirs
6023                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6024                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6025                                                 cf_have_libdir=yes; break
6026                                         fi
6027                                 done
6028                         fi
6029                         if test "$cf_have_libdir" = no ; then
6030                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6031
6032 echo "${as_me:-configure}:6032: testing adding $cf_add_libdir to library-path ..." 1>&5
6033
6034                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6035                         fi
6036                 fi
6037         done
6038 fi
6039
6040 cf_add_libs="$cf_cv_library_file_utf8"
6041 # Filter out duplicates - this happens with badly-designed ".pc" files...
6042 for cf_add_1lib in $LIBS
6043 do
6044         for cf_add_2lib in $cf_add_libs
6045         do
6046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6047                 then
6048                         cf_add_1lib=
6049                         break
6050                 fi
6051         done
6052         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6053 done
6054 LIBS="$cf_add_libs"
6055
6056 fi
6057
6058 cf_ncuconfig_root=ncursesw
6059 cf_have_ncuconfig=no
6060
6061 if test "x${PKG_CONFIG:=none}" != xnone; then
6062         echo "$as_me:6062: checking pkg-config for $cf_ncuconfig_root" >&5
6063 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6064         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6065                 echo "$as_me:6065: result: yes" >&5
6066 echo "${ECHO_T}yes" >&6
6067
6068                 echo "$as_me:6068: checking if the $cf_ncuconfig_root package files work" >&5
6069 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6070                 cf_have_ncuconfig=unknown
6071
6072                 cf_save_CPPFLAGS="$CPPFLAGS"
6073                 cf_save_LIBS="$LIBS"
6074
6075                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6076
6077 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6078 # Filter out duplicates - this happens with badly-designed ".pc" files...
6079 for cf_add_1lib in $LIBS
6080 do
6081         for cf_add_2lib in $cf_add_libs
6082         do
6083                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6084                 then
6085                         cf_add_1lib=
6086                         break
6087                 fi
6088         done
6089         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6090 done
6091 LIBS="$cf_add_libs"
6092
6093                 cat >conftest.$ac_ext <<_ACEOF
6094 #line 6094 "configure"
6095 #include "confdefs.h"
6096 #include <${cf_cv_ncurses_header:-curses.h}>
6097 int
6098 main (void)
6099 {
6100 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6101   ;
6102   return 0;
6103 }
6104 _ACEOF
6105 rm -f conftest.$ac_objext conftest$ac_exeext
6106 if { (eval echo "$as_me:6106: \"$ac_link\"") >&5
6107   (eval $ac_link) 2>&5
6108   ac_status=$?
6109   echo "$as_me:6109: \$? = $ac_status" >&5
6110   (exit $ac_status); } &&
6111          { ac_try='test -s conftest$ac_exeext'
6112   { (eval echo "$as_me:6112: \"$ac_try\"") >&5
6113   (eval $ac_try) 2>&5
6114   ac_status=$?
6115   echo "$as_me:6115: \$? = $ac_status" >&5
6116   (exit $ac_status); }; }; then
6117   if test "$cross_compiling" = yes; then
6118   cf_have_ncuconfig=maybe
6119 else
6120   cat >conftest.$ac_ext <<_ACEOF
6121 #line 6121 "configure"
6122 #include "confdefs.h"
6123 #include <${cf_cv_ncurses_header:-curses.h}>
6124                                 int main(void)
6125                                 { char *xx = curses_version(); return (xx == 0); }
6126 _ACEOF
6127 rm -f conftest$ac_exeext
6128 if { (eval echo "$as_me:6128: \"$ac_link\"") >&5
6129   (eval $ac_link) 2>&5
6130   ac_status=$?
6131   echo "$as_me:6131: \$? = $ac_status" >&5
6132   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6133   { (eval echo "$as_me:6133: \"$ac_try\"") >&5
6134   (eval $ac_try) 2>&5
6135   ac_status=$?
6136   echo "$as_me:6136: \$? = $ac_status" >&5
6137   (exit $ac_status); }; }; then
6138   cf_have_ncuconfig=yes
6139 else
6140   echo "$as_me: program exited with status $ac_status" >&5
6141 echo "$as_me: failed program was:" >&5
6142 cat conftest.$ac_ext >&5
6143 cf_have_ncuconfig=no
6144 fi
6145 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6146 fi
6147 else
6148   echo "$as_me: failed program was:" >&5
6149 cat conftest.$ac_ext >&5
6150 cf_have_ncuconfig=no
6151 fi
6152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6153                 echo "$as_me:6153: result: $cf_have_ncuconfig" >&5
6154 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6155                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6156                 if test "$cf_have_ncuconfig" != "yes"
6157                 then
6158                         CPPFLAGS="$cf_save_CPPFLAGS"
6159                         LIBS="$cf_save_LIBS"
6160                         NCURSES_CONFIG_PKG=none
6161                 else
6162
6163 cat >>confdefs.h <<\EOF
6164 #define NCURSES 1
6165 EOF
6166
6167                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6168
6169 echo "$as_me:6169: checking for terminfo header" >&5
6170 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6171 if test "${cf_cv_term_header+set}" = set; then
6172   echo $ECHO_N "(cached) $ECHO_C" >&6
6173 else
6174
6175 case ${cf_cv_ncurses_header} in
6176 (*/ncurses.h|*/ncursesw.h)
6177         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6178         ;;
6179 (*)
6180         cf_term_header=term.h
6181         ;;
6182 esac
6183
6184 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6185 do
6186 cat >conftest.$ac_ext <<_ACEOF
6187 #line 6187 "configure"
6188 #include "confdefs.h"
6189 #include <stdio.h>
6190 #include <${cf_cv_ncurses_header:-curses.h}>
6191 #include <$cf_test>
6192
6193 int
6194 main (void)
6195 {
6196 int x = auto_left_margin
6197   ;
6198   return 0;
6199 }
6200 _ACEOF
6201 rm -f conftest.$ac_objext
6202 if { (eval echo "$as_me:6202: \"$ac_compile\"") >&5
6203   (eval $ac_compile) 2>&5
6204   ac_status=$?
6205   echo "$as_me:6205: \$? = $ac_status" >&5
6206   (exit $ac_status); } &&
6207          { ac_try='test -s conftest.$ac_objext'
6208   { (eval echo "$as_me:6208: \"$ac_try\"") >&5
6209   (eval $ac_try) 2>&5
6210   ac_status=$?
6211   echo "$as_me:6211: \$? = $ac_status" >&5
6212   (exit $ac_status); }; }; then
6213
6214         cf_cv_term_header="$cf_test"
6215 else
6216   echo "$as_me: failed program was:" >&5
6217 cat conftest.$ac_ext >&5
6218
6219         cf_cv_term_header=unknown
6220
6221 fi
6222 rm -f conftest.$ac_objext conftest.$ac_ext
6223         test "$cf_cv_term_header" != unknown && break
6224 done
6225
6226 fi
6227 echo "$as_me:6227: result: $cf_cv_term_header" >&5
6228 echo "${ECHO_T}$cf_cv_term_header" >&6
6229
6230 # Set definitions to allow ifdef'ing to accommodate subdirectories
6231
6232 case $cf_cv_term_header in
6233 (*term.h)
6234
6235 cat >>confdefs.h <<\EOF
6236 #define HAVE_TERM_H 1
6237 EOF
6238
6239         ;;
6240 esac
6241
6242 case $cf_cv_term_header in
6243 (ncurses/term.h)
6244
6245 cat >>confdefs.h <<\EOF
6246 #define HAVE_NCURSES_TERM_H 1
6247 EOF
6248
6249         ;;
6250 (ncursesw/term.h)
6251
6252 cat >>confdefs.h <<\EOF
6253 #define HAVE_NCURSESW_TERM_H 1
6254 EOF
6255
6256         ;;
6257 esac
6258
6259                 fi
6260
6261         else
6262                 echo "$as_me:6262: result: no" >&5
6263 echo "${ECHO_T}no" >&6
6264                 NCURSES_CONFIG_PKG=none
6265         fi
6266 else
6267         NCURSES_CONFIG_PKG=none
6268 fi
6269
6270 if test "x$cf_have_ncuconfig" = "xno"; then
6271         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6272
6273 if test -n "$ac_tool_prefix"; then
6274   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6275   do
6276     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6277 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6278 echo "$as_me:6278: checking for $ac_word" >&5
6279 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6280 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6281   echo $ECHO_N "(cached) $ECHO_C" >&6
6282 else
6283   if test -n "$NCURSES_CONFIG"; then
6284   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6285 else
6286   ac_save_IFS=$IFS; IFS=$ac_path_separator
6287 ac_dummy="$PATH"
6288 for ac_dir in $ac_dummy; do
6289   IFS=$ac_save_IFS
6290   test -z "$ac_dir" && ac_dir=.
6291   $as_executable_p "$ac_dir/$ac_word" || continue
6292 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6293 echo "$as_me:6293: found $ac_dir/$ac_word" >&5
6294 break
6295 done
6296
6297 fi
6298 fi
6299 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6300 if test -n "$NCURSES_CONFIG"; then
6301   echo "$as_me:6301: result: $NCURSES_CONFIG" >&5
6302 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6303 else
6304   echo "$as_me:6304: result: no" >&5
6305 echo "${ECHO_T}no" >&6
6306 fi
6307
6308     test -n "$NCURSES_CONFIG" && break
6309   done
6310 fi
6311 if test -z "$NCURSES_CONFIG"; then
6312   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6313   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6314 do
6315   # Extract the first word of "$ac_prog", so it can be a program name with args.
6316 set dummy $ac_prog; ac_word=$2
6317 echo "$as_me:6317: checking for $ac_word" >&5
6318 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6319 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6320   echo $ECHO_N "(cached) $ECHO_C" >&6
6321 else
6322   if test -n "$ac_ct_NCURSES_CONFIG"; then
6323   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6324 else
6325   ac_save_IFS=$IFS; IFS=$ac_path_separator
6326 ac_dummy="$PATH"
6327 for ac_dir in $ac_dummy; do
6328   IFS=$ac_save_IFS
6329   test -z "$ac_dir" && ac_dir=.
6330   $as_executable_p "$ac_dir/$ac_word" || continue
6331 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6332 echo "$as_me:6332: found $ac_dir/$ac_word" >&5
6333 break
6334 done
6335
6336 fi
6337 fi
6338 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6339 if test -n "$ac_ct_NCURSES_CONFIG"; then
6340   echo "$as_me:6340: result: $ac_ct_NCURSES_CONFIG" >&5
6341 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6342 else
6343   echo "$as_me:6343: result: no" >&5
6344 echo "${ECHO_T}no" >&6
6345 fi
6346
6347   test -n "$ac_ct_NCURSES_CONFIG" && break
6348 done
6349 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6350
6351   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6352 fi
6353
6354         if test "$NCURSES_CONFIG" != none ; then
6355
6356                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6357
6358 cf_add_libs="`$NCURSES_CONFIG --libs`"
6359 # Filter out duplicates - this happens with badly-designed ".pc" files...
6360 for cf_add_1lib in $LIBS
6361 do
6362         for cf_add_2lib in $cf_add_libs
6363         do
6364                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6365                 then
6366                         cf_add_1lib=
6367                         break
6368                 fi
6369         done
6370         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6371 done
6372 LIBS="$cf_add_libs"
6373
6374                 # even with config script, some packages use no-override for curses.h
6375
6376 echo "$as_me:6376: checking if we have identified curses headers" >&5
6377 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6378 if test "${cf_cv_ncurses_header+set}" = set; then
6379   echo $ECHO_N "(cached) $ECHO_C" >&6
6380 else
6381
6382 cf_cv_ncurses_header=none
6383 for cf_header in \
6384         ncurses.h ncursesw/ncurses.h \
6385         curses.h ncursesw/curses.h
6386 do
6387 cat >conftest.$ac_ext <<_ACEOF
6388 #line 6388 "configure"
6389 #include "confdefs.h"
6390 #include <${cf_header}>
6391 int
6392 main (void)
6393 {
6394 initscr(); tgoto("?", 0,0)
6395   ;
6396   return 0;
6397 }
6398 _ACEOF
6399 rm -f conftest.$ac_objext
6400 if { (eval echo "$as_me:6400: \"$ac_compile\"") >&5
6401   (eval $ac_compile) 2>&5
6402   ac_status=$?
6403   echo "$as_me:6403: \$? = $ac_status" >&5
6404   (exit $ac_status); } &&
6405          { ac_try='test -s conftest.$ac_objext'
6406   { (eval echo "$as_me:6406: \"$ac_try\"") >&5
6407   (eval $ac_try) 2>&5
6408   ac_status=$?
6409   echo "$as_me:6409: \$? = $ac_status" >&5
6410   (exit $ac_status); }; }; then
6411   cf_cv_ncurses_header=$cf_header; break
6412 else
6413   echo "$as_me: failed program was:" >&5
6414 cat conftest.$ac_ext >&5
6415 fi
6416 rm -f conftest.$ac_objext conftest.$ac_ext
6417 done
6418
6419 fi
6420 echo "$as_me:6420: result: $cf_cv_ncurses_header" >&5
6421 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6422
6423 if test "$cf_cv_ncurses_header" = none ; then
6424         { { echo "$as_me:6424: error: No curses header-files found" >&5
6425 echo "$as_me: error: No curses header-files found" >&2;}
6426    { (exit 1); exit 1; }; }
6427 fi
6428
6429 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6430
6431 for ac_header in $cf_cv_ncurses_header
6432 do
6433 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6434 echo "$as_me:6434: checking for $ac_header" >&5
6435 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6436 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6437   echo $ECHO_N "(cached) $ECHO_C" >&6
6438 else
6439   cat >conftest.$ac_ext <<_ACEOF
6440 #line 6440 "configure"
6441 #include "confdefs.h"
6442 #include <$ac_header>
6443 _ACEOF
6444 if { (eval echo "$as_me:6444: \"$ac_cpp conftest.$ac_ext\"") >&5
6445   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6446   ac_status=$?
6447   egrep -v '^ *\+' conftest.er1 >conftest.err
6448   rm -f conftest.er1
6449   cat conftest.err >&5
6450   echo "$as_me:6450: \$? = $ac_status" >&5
6451   (exit $ac_status); } >/dev/null; then
6452   if test -s conftest.err; then
6453     ac_cpp_err=$ac_c_preproc_warn_flag
6454   else
6455     ac_cpp_err=
6456   fi
6457 else
6458   ac_cpp_err=yes
6459 fi
6460 if test -z "$ac_cpp_err"; then
6461   eval "$as_ac_Header=yes"
6462 else
6463   echo "$as_me: failed program was:" >&5
6464   cat conftest.$ac_ext >&5
6465   eval "$as_ac_Header=no"
6466 fi
6467 rm -f conftest.err conftest.$ac_ext
6468 fi
6469 echo "$as_me:6469: result: `eval echo '${'$as_ac_Header'}'`" >&5
6470 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6471 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6472   cat >>confdefs.h <<EOF
6473 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6474 EOF
6475
6476 fi
6477 done
6478
6479 cat >>confdefs.h <<\EOF
6480 #define NCURSES 1
6481 EOF
6482
6483 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6484
6485                 cat >>confdefs.h <<EOF
6486 #define $cf_nculib_ROOT 1
6487 EOF
6488
6489                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6490
6491         else
6492
6493 cf_ncuhdr_root=ncursesw
6494
6495 test -n "$cf_cv_curses_dir" && \
6496 test "$cf_cv_curses_dir" != "no" && { \
6497
6498 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6499   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6500   do
6501         while test $cf_add_incdir != /usr/include
6502         do
6503           if test -d $cf_add_incdir
6504           then
6505                 cf_have_incdir=no
6506                 if test -n "$CFLAGS$CPPFLAGS" ; then
6507                   # a loop is needed to ensure we can add subdirs of existing dirs
6508                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6509                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6510                           cf_have_incdir=yes; break
6511                         fi
6512                   done
6513                 fi
6514
6515                 if test "$cf_have_incdir" = no ; then
6516                   if test "$cf_add_incdir" = /usr/local/include ; then
6517                         if test "$GCC" = yes
6518                         then
6519                           cf_save_CPPFLAGS=$CPPFLAGS
6520                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6521                           cat >conftest.$ac_ext <<_ACEOF
6522 #line 6522 "configure"
6523 #include "confdefs.h"
6524 #include <stdio.h>
6525 int
6526 main (void)
6527 {
6528 printf("Hello")
6529   ;
6530   return 0;
6531 }
6532 _ACEOF
6533 rm -f conftest.$ac_objext
6534 if { (eval echo "$as_me:6534: \"$ac_compile\"") >&5
6535   (eval $ac_compile) 2>&5
6536   ac_status=$?
6537   echo "$as_me:6537: \$? = $ac_status" >&5
6538   (exit $ac_status); } &&
6539          { ac_try='test -s conftest.$ac_objext'
6540   { (eval echo "$as_me:6540: \"$ac_try\"") >&5
6541   (eval $ac_try) 2>&5
6542   ac_status=$?
6543   echo "$as_me:6543: \$? = $ac_status" >&5
6544   (exit $ac_status); }; }; then
6545   :
6546 else
6547   echo "$as_me: failed program was:" >&5
6548 cat conftest.$ac_ext >&5
6549 cf_have_incdir=yes
6550 fi
6551 rm -f conftest.$ac_objext conftest.$ac_ext
6552                           CPPFLAGS=$cf_save_CPPFLAGS
6553                         fi
6554                   fi
6555                 fi
6556
6557                 if test "$cf_have_incdir" = no ; then
6558                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6559
6560 echo "${as_me:-configure}:6560: testing adding $cf_add_incdir to include-path ..." 1>&5
6561
6562                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6563
6564                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6565                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6566                   cf_add_incdir="$cf_top_incdir"
6567                 else
6568                   break
6569                 fi
6570           else
6571                 break
6572           fi
6573         done
6574   done
6575 fi
6576
6577 }
6578
6579 echo "$as_me:6579: checking for $cf_ncuhdr_root header in include-path" >&5
6580 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6581 if test "${cf_cv_ncurses_h+set}" = set; then
6582   echo $ECHO_N "(cached) $ECHO_C" >&6
6583 else
6584
6585         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6586         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6587         for cf_header in $cf_header_list
6588         do
6589
6590         cat >conftest.$ac_ext <<_ACEOF
6591 #line 6591 "configure"
6592 #include "confdefs.h"
6593
6594 #define _XOPEN_SOURCE_EXTENDED
6595 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6596 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6597
6598 #include <$cf_header>
6599 int
6600 main (void)
6601 {
6602
6603 #ifdef NCURSES_VERSION
6604
6605 #ifndef WACS_BSSB
6606         make an error
6607 #endif
6608
6609 printf("%s\n", NCURSES_VERSION);
6610 #else
6611 #ifdef __NCURSES_H
6612 printf("old\n");
6613 #else
6614         make an error
6615 #endif
6616 #endif
6617
6618   ;
6619   return 0;
6620 }
6621 _ACEOF
6622 rm -f conftest.$ac_objext
6623 if { (eval echo "$as_me:6623: \"$ac_compile\"") >&5
6624   (eval $ac_compile) 2>&5
6625   ac_status=$?
6626   echo "$as_me:6626: \$? = $ac_status" >&5
6627   (exit $ac_status); } &&
6628          { ac_try='test -s conftest.$ac_objext'
6629   { (eval echo "$as_me:6629: \"$ac_try\"") >&5
6630   (eval $ac_try) 2>&5
6631   ac_status=$?
6632   echo "$as_me:6632: \$? = $ac_status" >&5
6633   (exit $ac_status); }; }; then
6634   cf_cv_ncurses_h=$cf_header
6635
6636 else
6637   echo "$as_me: failed program was:" >&5
6638 cat conftest.$ac_ext >&5
6639 cf_cv_ncurses_h=no
6640 fi
6641 rm -f conftest.$ac_objext conftest.$ac_ext
6642
6643                 test "$cf_cv_ncurses_h" != no && break
6644         done
6645
6646 fi
6647 echo "$as_me:6647: result: $cf_cv_ncurses_h" >&5
6648 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6649
6650 if test "$cf_cv_ncurses_h" != no ; then
6651         cf_cv_ncurses_header=$cf_cv_ncurses_h
6652 else
6653
6654 echo "$as_me:6654: checking for $cf_ncuhdr_root include-path" >&5
6655 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6656 if test "${cf_cv_ncurses_h2+set}" = set; then
6657   echo $ECHO_N "(cached) $ECHO_C" >&6
6658 else
6659
6660         test -n "$verbose" && echo
6661
6662 cf_search=
6663
6664 # collect the current set of include-directories from compiler flags
6665 cf_header_path_list=""
6666 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6667         for cf_header_path in $CPPFLAGS $CFLAGS
6668         do
6669                 case $cf_header_path in
6670                 (-I*)
6671                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6672
6673 test "x$cf_header_path" != "xNONE" && \
6674 test -d "$cf_header_path" && \
6675  {
6676         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6677         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6678         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6679         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6680         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6681         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"
6682 }
6683
6684                         cf_header_path_list="$cf_header_path_list $cf_search"
6685                         ;;
6686                 esac
6687         done
6688 fi
6689
6690 # add the variations for the package we are looking for
6691
6692 cf_search=
6693
6694 test "x$prefix" != "xNONE" && \
6695 test -d "$prefix" && \
6696  {
6697         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6698         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6699         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6700         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6701         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6702         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6703 }
6704
6705 for cf_subdir_prefix in \
6706         /usr \
6707         /usr/local \
6708         /usr/pkg \
6709         /opt \
6710         /opt/local \
6711         $HOME
6712 do
6713
6714 test "x$cf_subdir_prefix" != "x$prefix" && \
6715 test -d "$cf_subdir_prefix" && \
6716 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6717         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6718         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6719         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6720         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6721         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6722         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"
6723 }
6724
6725 done
6726
6727 test "$includedir" != NONE && \
6728 test "$includedir" != "/usr/include" && \
6729 test -d "$includedir" && {
6730         test -d $includedir &&    cf_search="$cf_search $includedir"
6731         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6732 }
6733
6734 test "$oldincludedir" != NONE && \
6735 test "$oldincludedir" != "/usr/include" && \
6736 test -d "$oldincludedir" && {
6737         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6738         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6739 }
6740
6741 cf_search="$cf_search $cf_header_path_list"
6742
6743         test -n "$verbose" && echo search path $cf_search
6744         cf_save2_CPPFLAGS="$CPPFLAGS"
6745         for cf_incdir in $cf_search
6746         do
6747
6748 if test -n "$cf_incdir" ; then
6749   for cf_add_incdir in $cf_incdir
6750   do
6751         while test $cf_add_incdir != /usr/include
6752         do
6753           if test -d $cf_add_incdir
6754           then
6755                 cf_have_incdir=no
6756                 if test -n "$CFLAGS$CPPFLAGS" ; then
6757                   # a loop is needed to ensure we can add subdirs of existing dirs
6758                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6759                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6760                           cf_have_incdir=yes; break
6761                         fi
6762                   done
6763                 fi
6764
6765                 if test "$cf_have_incdir" = no ; then
6766                   if test "$cf_add_incdir" = /usr/local/include ; then
6767                         if test "$GCC" = yes
6768                         then
6769                           cf_save_CPPFLAGS=$CPPFLAGS
6770                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6771                           cat >conftest.$ac_ext <<_ACEOF
6772 #line 6772 "configure"
6773 #include "confdefs.h"
6774 #include <stdio.h>
6775 int
6776 main (void)
6777 {
6778 printf("Hello")
6779   ;
6780   return 0;
6781 }
6782 _ACEOF
6783 rm -f conftest.$ac_objext
6784 if { (eval echo "$as_me:6784: \"$ac_compile\"") >&5
6785   (eval $ac_compile) 2>&5
6786   ac_status=$?
6787   echo "$as_me:6787: \$? = $ac_status" >&5
6788   (exit $ac_status); } &&
6789          { ac_try='test -s conftest.$ac_objext'
6790   { (eval echo "$as_me:6790: \"$ac_try\"") >&5
6791   (eval $ac_try) 2>&5
6792   ac_status=$?
6793   echo "$as_me:6793: \$? = $ac_status" >&5
6794   (exit $ac_status); }; }; then
6795   :
6796 else
6797   echo "$as_me: failed program was:" >&5
6798 cat conftest.$ac_ext >&5
6799 cf_have_incdir=yes
6800 fi
6801 rm -f conftest.$ac_objext conftest.$ac_ext
6802                           CPPFLAGS=$cf_save_CPPFLAGS
6803                         fi
6804                   fi
6805                 fi
6806
6807                 if test "$cf_have_incdir" = no ; then
6808                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6809
6810 echo "${as_me:-configure}:6810: testing adding $cf_add_incdir to include-path ..." 1>&5
6811
6812                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6813
6814                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6815                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6816                   cf_add_incdir="$cf_top_incdir"
6817                 else
6818                   break
6819                 fi
6820           else
6821                 break
6822           fi
6823         done
6824   done
6825 fi
6826
6827                 for cf_header in \
6828                         ncurses.h \
6829                         curses.h
6830                 do
6831
6832         cat >conftest.$ac_ext <<_ACEOF
6833 #line 6833 "configure"
6834 #include "confdefs.h"
6835
6836 #include <$cf_header>
6837 int
6838 main (void)
6839 {
6840
6841 #ifdef NCURSES_VERSION
6842
6843 printf("%s\n", NCURSES_VERSION);
6844 #else
6845 #ifdef __NCURSES_H
6846 printf("old\n");
6847 #else
6848         make an error
6849 #endif
6850 #endif
6851
6852   ;
6853   return 0;
6854 }
6855 _ACEOF
6856 rm -f conftest.$ac_objext
6857 if { (eval echo "$as_me:6857: \"$ac_compile\"") >&5
6858   (eval $ac_compile) 2>&5
6859   ac_status=$?
6860   echo "$as_me:6860: \$? = $ac_status" >&5
6861   (exit $ac_status); } &&
6862          { ac_try='test -s conftest.$ac_objext'
6863   { (eval echo "$as_me:6863: \"$ac_try\"") >&5
6864   (eval $ac_try) 2>&5
6865   ac_status=$?
6866   echo "$as_me:6866: \$? = $ac_status" >&5
6867   (exit $ac_status); }; }; then
6868   cf_cv_ncurses_h2=$cf_header
6869
6870 else
6871   echo "$as_me: failed program was:" >&5
6872 cat conftest.$ac_ext >&5
6873 cf_cv_ncurses_h2=no
6874 fi
6875 rm -f conftest.$ac_objext conftest.$ac_ext
6876
6877                         if test "$cf_cv_ncurses_h2" != no ; then
6878                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6879                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6880                                 break
6881                         fi
6882                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6883                 done
6884                 CPPFLAGS="$cf_save2_CPPFLAGS"
6885                 test "$cf_cv_ncurses_h2" != no && break
6886         done
6887         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6887: error: not found" >&5
6888 echo "$as_me: error: not found" >&2;}
6889    { (exit 1); exit 1; }; }
6890
6891 fi
6892 echo "$as_me:6892: result: $cf_cv_ncurses_h2" >&5
6893 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6894
6895         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6896         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6897         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6898                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6899         fi
6900
6901 if test -n "$cf_1st_incdir" ; then
6902   for cf_add_incdir in $cf_1st_incdir
6903   do
6904         while test $cf_add_incdir != /usr/include
6905         do
6906           if test -d $cf_add_incdir
6907           then
6908                 cf_have_incdir=no
6909                 if test -n "$CFLAGS$CPPFLAGS" ; then
6910                   # a loop is needed to ensure we can add subdirs of existing dirs
6911                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6912                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6913                           cf_have_incdir=yes; break
6914                         fi
6915                   done
6916                 fi
6917
6918                 if test "$cf_have_incdir" = no ; then
6919                   if test "$cf_add_incdir" = /usr/local/include ; then
6920                         if test "$GCC" = yes
6921                         then
6922                           cf_save_CPPFLAGS=$CPPFLAGS
6923                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6924                           cat >conftest.$ac_ext <<_ACEOF
6925 #line 6925 "configure"
6926 #include "confdefs.h"
6927 #include <stdio.h>
6928 int
6929 main (void)
6930 {
6931 printf("Hello")
6932   ;
6933   return 0;
6934 }
6935 _ACEOF
6936 rm -f conftest.$ac_objext
6937 if { (eval echo "$as_me:6937: \"$ac_compile\"") >&5
6938   (eval $ac_compile) 2>&5
6939   ac_status=$?
6940   echo "$as_me:6940: \$? = $ac_status" >&5
6941   (exit $ac_status); } &&
6942          { ac_try='test -s conftest.$ac_objext'
6943   { (eval echo "$as_me:6943: \"$ac_try\"") >&5
6944   (eval $ac_try) 2>&5
6945   ac_status=$?
6946   echo "$as_me:6946: \$? = $ac_status" >&5
6947   (exit $ac_status); }; }; then
6948   :
6949 else
6950   echo "$as_me: failed program was:" >&5
6951 cat conftest.$ac_ext >&5
6952 cf_have_incdir=yes
6953 fi
6954 rm -f conftest.$ac_objext conftest.$ac_ext
6955                           CPPFLAGS=$cf_save_CPPFLAGS
6956                         fi
6957                   fi
6958                 fi
6959
6960                 if test "$cf_have_incdir" = no ; then
6961                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6962
6963 echo "${as_me:-configure}:6963: testing adding $cf_add_incdir to include-path ..." 1>&5
6964
6965                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6966
6967                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6968                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6969                   cf_add_incdir="$cf_top_incdir"
6970                 else
6971                   break
6972                 fi
6973           else
6974                 break
6975           fi
6976         done
6977   done
6978 fi
6979
6980 fi
6981
6982 # Set definitions to allow ifdef'ing for ncurses.h
6983
6984 case $cf_cv_ncurses_header in
6985 (*ncurses.h)
6986
6987 cat >>confdefs.h <<\EOF
6988 #define HAVE_NCURSES_H 1
6989 EOF
6990
6991         ;;
6992 esac
6993
6994 case $cf_cv_ncurses_header in
6995 (ncurses/curses.h|ncurses/ncurses.h)
6996
6997 cat >>confdefs.h <<\EOF
6998 #define HAVE_NCURSES_NCURSES_H 1
6999 EOF
7000
7001         ;;
7002 (ncursesw/curses.h|ncursesw/ncurses.h)
7003
7004 cat >>confdefs.h <<\EOF
7005 #define HAVE_NCURSESW_NCURSES_H 1
7006 EOF
7007
7008         ;;
7009 esac
7010
7011 echo "$as_me:7011: checking for terminfo header" >&5
7012 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7013 if test "${cf_cv_term_header+set}" = set; then
7014   echo $ECHO_N "(cached) $ECHO_C" >&6
7015 else
7016
7017 case ${cf_cv_ncurses_header} in
7018 (*/ncurses.h|*/ncursesw.h)
7019         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7020         ;;
7021 (*)
7022         cf_term_header=term.h
7023         ;;
7024 esac
7025
7026 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7027 do
7028 cat >conftest.$ac_ext <<_ACEOF
7029 #line 7029 "configure"
7030 #include "confdefs.h"
7031 #include <stdio.h>
7032 #include <${cf_cv_ncurses_header:-curses.h}>
7033 #include <$cf_test>
7034
7035 int
7036 main (void)
7037 {
7038 int x = auto_left_margin
7039   ;
7040   return 0;
7041 }
7042 _ACEOF
7043 rm -f conftest.$ac_objext
7044 if { (eval echo "$as_me:7044: \"$ac_compile\"") >&5
7045   (eval $ac_compile) 2>&5
7046   ac_status=$?
7047   echo "$as_me:7047: \$? = $ac_status" >&5
7048   (exit $ac_status); } &&
7049          { ac_try='test -s conftest.$ac_objext'
7050   { (eval echo "$as_me:7050: \"$ac_try\"") >&5
7051   (eval $ac_try) 2>&5
7052   ac_status=$?
7053   echo "$as_me:7053: \$? = $ac_status" >&5
7054   (exit $ac_status); }; }; then
7055
7056         cf_cv_term_header="$cf_test"
7057 else
7058   echo "$as_me: failed program was:" >&5
7059 cat conftest.$ac_ext >&5
7060
7061         cf_cv_term_header=unknown
7062
7063 fi
7064 rm -f conftest.$ac_objext conftest.$ac_ext
7065         test "$cf_cv_term_header" != unknown && break
7066 done
7067
7068 fi
7069 echo "$as_me:7069: result: $cf_cv_term_header" >&5
7070 echo "${ECHO_T}$cf_cv_term_header" >&6
7071
7072 # Set definitions to allow ifdef'ing to accommodate subdirectories
7073
7074 case $cf_cv_term_header in
7075 (*term.h)
7076
7077 cat >>confdefs.h <<\EOF
7078 #define HAVE_TERM_H 1
7079 EOF
7080
7081         ;;
7082 esac
7083
7084 case $cf_cv_term_header in
7085 (ncurses/term.h)
7086
7087 cat >>confdefs.h <<\EOF
7088 #define HAVE_NCURSES_TERM_H 1
7089 EOF
7090
7091         ;;
7092 (ncursesw/term.h)
7093
7094 cat >>confdefs.h <<\EOF
7095 #define HAVE_NCURSESW_TERM_H 1
7096 EOF
7097
7098         ;;
7099 esac
7100
7101 # some applications need this, but should check for NCURSES_VERSION
7102
7103 cat >>confdefs.h <<\EOF
7104 #define NCURSES 1
7105 EOF
7106
7107 echo "$as_me:7107: checking for ncurses version" >&5
7108 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7109 if test "${cf_cv_ncurses_version+set}" = set; then
7110   echo $ECHO_N "(cached) $ECHO_C" >&6
7111 else
7112
7113         cf_cv_ncurses_version=no
7114         cf_tempfile=out$$
7115         rm -f $cf_tempfile
7116         if test "$cross_compiling" = yes; then
7117
7118         # This will not work if the preprocessor splits the line after the
7119         # Autoconf token.  The 'unproto' program does that.
7120         cat > conftest.$ac_ext <<EOF
7121 #include <${cf_cv_ncurses_header:-curses.h}>
7122 #undef Autoconf
7123 #ifdef NCURSES_VERSION
7124 Autoconf NCURSES_VERSION
7125 #else
7126 #ifdef __NCURSES_H
7127 Autoconf "old"
7128 #endif
7129 ;
7130 #endif
7131 EOF
7132         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7133         { (eval echo "$as_me:7133: \"$cf_try\"") >&5
7134   (eval $cf_try) 2>&5
7135   ac_status=$?
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); }
7138         if test -f conftest.out ; then
7139                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7140                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7141                 rm -f conftest.out
7142         fi
7143
7144 else
7145   cat >conftest.$ac_ext <<_ACEOF
7146 #line 7146 "configure"
7147 #include "confdefs.h"
7148
7149 #include <${cf_cv_ncurses_header:-curses.h}>
7150 #include <stdio.h>
7151 int main(void)
7152 {
7153         FILE *fp = fopen("$cf_tempfile", "w");
7154 #ifdef NCURSES_VERSION
7155 # ifdef NCURSES_VERSION_PATCH
7156         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7157 # else
7158         fprintf(fp, "%s\n", NCURSES_VERSION);
7159 # endif
7160 #else
7161 # ifdef __NCURSES_H
7162         fprintf(fp, "old\n");
7163 # else
7164         make an error
7165 # endif
7166 #endif
7167         ${cf_cv_main_return:-return}(0);
7168 }
7169 _ACEOF
7170 rm -f conftest$ac_exeext
7171 if { (eval echo "$as_me:7171: \"$ac_link\"") >&5
7172   (eval $ac_link) 2>&5
7173   ac_status=$?
7174   echo "$as_me:7174: \$? = $ac_status" >&5
7175   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7176   { (eval echo "$as_me:7176: \"$ac_try\"") >&5
7177   (eval $ac_try) 2>&5
7178   ac_status=$?
7179   echo "$as_me:7179: \$? = $ac_status" >&5
7180   (exit $ac_status); }; }; then
7181
7182         cf_cv_ncurses_version=`cat $cf_tempfile`
7183 else
7184   echo "$as_me: program exited with status $ac_status" >&5
7185 echo "$as_me: failed program was:" >&5
7186 cat conftest.$ac_ext >&5
7187 fi
7188 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7189 fi
7190         rm -f $cf_tempfile
7191
7192 fi
7193 echo "$as_me:7193: result: $cf_cv_ncurses_version" >&5
7194 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7195 test "$cf_cv_ncurses_version" = no ||
7196 cat >>confdefs.h <<\EOF
7197 #define NCURSES 1
7198 EOF
7199
7200 cf_nculib_root=ncursesw
7201         # This works, except for the special case where we find gpm, but
7202         # ncurses is in a nonstandard location via $LIBS, and we really want
7203         # to link gpm.
7204 cf_ncurses_LIBS=""
7205 cf_ncurses_SAVE="$LIBS"
7206 echo "$as_me:7206: checking for Gpm_Open in -lgpm" >&5
7207 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7208 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7209   echo $ECHO_N "(cached) $ECHO_C" >&6
7210 else
7211   ac_check_lib_save_LIBS=$LIBS
7212 LIBS="-lgpm  $LIBS"
7213 cat >conftest.$ac_ext <<_ACEOF
7214 #line 7214 "configure"
7215 #include "confdefs.h"
7216
7217 /* Override any gcc2 internal prototype to avoid an error.  */
7218 #ifdef __cplusplus
7219 extern "C"
7220 #endif
7221 /* We use char because int might match the return type of a gcc2
7222    builtin and then its argument prototype would still apply.  */
7223 char Gpm_Open ();
7224 int
7225 main (void)
7226 {
7227 Gpm_Open ();
7228   ;
7229   return 0;
7230 }
7231 _ACEOF
7232 rm -f conftest.$ac_objext conftest$ac_exeext
7233 if { (eval echo "$as_me:7233: \"$ac_link\"") >&5
7234   (eval $ac_link) 2>&5
7235   ac_status=$?
7236   echo "$as_me:7236: \$? = $ac_status" >&5
7237   (exit $ac_status); } &&
7238          { ac_try='test -s conftest$ac_exeext'
7239   { (eval echo "$as_me:7239: \"$ac_try\"") >&5
7240   (eval $ac_try) 2>&5
7241   ac_status=$?
7242   echo "$as_me:7242: \$? = $ac_status" >&5
7243   (exit $ac_status); }; }; then
7244   ac_cv_lib_gpm_Gpm_Open=yes
7245 else
7246   echo "$as_me: failed program was:" >&5
7247 cat conftest.$ac_ext >&5
7248 ac_cv_lib_gpm_Gpm_Open=no
7249 fi
7250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7251 LIBS=$ac_check_lib_save_LIBS
7252 fi
7253 echo "$as_me:7253: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7254 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7255 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7256   echo "$as_me:7256: checking for initscr in -lgpm" >&5
7257 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7258 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7259   echo $ECHO_N "(cached) $ECHO_C" >&6
7260 else
7261   ac_check_lib_save_LIBS=$LIBS
7262 LIBS="-lgpm  $LIBS"
7263 cat >conftest.$ac_ext <<_ACEOF
7264 #line 7264 "configure"
7265 #include "confdefs.h"
7266
7267 /* Override any gcc2 internal prototype to avoid an error.  */
7268 #ifdef __cplusplus
7269 extern "C"
7270 #endif
7271 /* We use char because int might match the return type of a gcc2
7272    builtin and then its argument prototype would still apply.  */
7273 char initscr ();
7274 int
7275 main (void)
7276 {
7277 initscr ();
7278   ;
7279   return 0;
7280 }
7281 _ACEOF
7282 rm -f conftest.$ac_objext conftest$ac_exeext
7283 if { (eval echo "$as_me:7283: \"$ac_link\"") >&5
7284   (eval $ac_link) 2>&5
7285   ac_status=$?
7286   echo "$as_me:7286: \$? = $ac_status" >&5
7287   (exit $ac_status); } &&
7288          { ac_try='test -s conftest$ac_exeext'
7289   { (eval echo "$as_me:7289: \"$ac_try\"") >&5
7290   (eval $ac_try) 2>&5
7291   ac_status=$?
7292   echo "$as_me:7292: \$? = $ac_status" >&5
7293   (exit $ac_status); }; }; then
7294   ac_cv_lib_gpm_initscr=yes
7295 else
7296   echo "$as_me: failed program was:" >&5
7297 cat conftest.$ac_ext >&5
7298 ac_cv_lib_gpm_initscr=no
7299 fi
7300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7301 LIBS=$ac_check_lib_save_LIBS
7302 fi
7303 echo "$as_me:7303: result: $ac_cv_lib_gpm_initscr" >&5
7304 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7305 if test $ac_cv_lib_gpm_initscr = yes; then
7306   LIBS="$cf_ncurses_SAVE"
7307 else
7308   cf_ncurses_LIBS="-lgpm"
7309 fi
7310
7311 fi
7312
7313 case $host_os in
7314 (freebsd*)
7315         # This is only necessary if you are linking against an obsolete
7316         # version of ncurses (but it should do no harm, since it's static).
7317         if test "$cf_nculib_root" = ncurses ; then
7318                 echo "$as_me:7318: checking for tgoto in -lmytinfo" >&5
7319 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7320 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7321   echo $ECHO_N "(cached) $ECHO_C" >&6
7322 else
7323   ac_check_lib_save_LIBS=$LIBS
7324 LIBS="-lmytinfo  $LIBS"
7325 cat >conftest.$ac_ext <<_ACEOF
7326 #line 7326 "configure"
7327 #include "confdefs.h"
7328
7329 /* Override any gcc2 internal prototype to avoid an error.  */
7330 #ifdef __cplusplus
7331 extern "C"
7332 #endif
7333 /* We use char because int might match the return type of a gcc2
7334    builtin and then its argument prototype would still apply.  */
7335 char tgoto ();
7336 int
7337 main (void)
7338 {
7339 tgoto ();
7340   ;
7341   return 0;
7342 }
7343 _ACEOF
7344 rm -f conftest.$ac_objext conftest$ac_exeext
7345 if { (eval echo "$as_me:7345: \"$ac_link\"") >&5
7346   (eval $ac_link) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit $ac_status); } &&
7350          { ac_try='test -s conftest$ac_exeext'
7351   { (eval echo "$as_me:7351: \"$ac_try\"") >&5
7352   (eval $ac_try) 2>&5
7353   ac_status=$?
7354   echo "$as_me:7354: \$? = $ac_status" >&5
7355   (exit $ac_status); }; }; then
7356   ac_cv_lib_mytinfo_tgoto=yes
7357 else
7358   echo "$as_me: failed program was:" >&5
7359 cat conftest.$ac_ext >&5
7360 ac_cv_lib_mytinfo_tgoto=no
7361 fi
7362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7363 LIBS=$ac_check_lib_save_LIBS
7364 fi
7365 echo "$as_me:7365: result: $ac_cv_lib_mytinfo_tgoto" >&5
7366 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7367 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7368   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7369 fi
7370
7371         fi
7372         ;;
7373 esac
7374
7375 cf_add_libs="$cf_ncurses_LIBS"
7376 # Filter out duplicates - this happens with badly-designed ".pc" files...
7377 for cf_add_1lib in $LIBS
7378 do
7379         for cf_add_2lib in $cf_add_libs
7380         do
7381                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7382                 then
7383                         cf_add_1lib=
7384                         break
7385                 fi
7386         done
7387         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7388 done
7389 LIBS="$cf_add_libs"
7390
7391 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7392 then
7393
7394 cf_add_libs="-l$cf_nculib_root"
7395 # Filter out duplicates - this happens with badly-designed ".pc" files...
7396 for cf_add_1lib in $LIBS
7397 do
7398         for cf_add_2lib in $cf_add_libs
7399         do
7400                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7401                 then
7402                         cf_add_1lib=
7403                         break
7404                 fi
7405         done
7406         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7407 done
7408 LIBS="$cf_add_libs"
7409
7410 else
7411
7412         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7413         cf_libdir=""
7414         echo "$as_me:7414: checking for initscr" >&5
7415 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7416 if test "${ac_cv_func_initscr+set}" = set; then
7417   echo $ECHO_N "(cached) $ECHO_C" >&6
7418 else
7419   cat >conftest.$ac_ext <<_ACEOF
7420 #line 7420 "configure"
7421 #include "confdefs.h"
7422 /* System header to define __stub macros and hopefully few prototypes,
7423     which can conflict with char initscr (); below.  */
7424 #include <assert.h>
7425 /* Override any gcc2 internal prototype to avoid an error.  */
7426 #ifdef __cplusplus
7427 extern "C"
7428 #endif
7429 /* We use char because int might match the return type of a gcc2
7430    builtin and then its argument prototype would still apply.  */
7431 char initscr ();
7432 char (*f) ();
7433
7434 int
7435 main (void)
7436 {
7437 /* The GNU C library defines this for functions which it implements
7438     to always fail with ENOSYS.  Some functions are actually named
7439     something starting with __ and the normal name is an alias.  */
7440 #if defined (__stub_initscr) || defined (__stub___initscr)
7441 choke me
7442 #else
7443 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7444 #endif
7445
7446   ;
7447   return 0;
7448 }
7449 _ACEOF
7450 rm -f conftest.$ac_objext conftest$ac_exeext
7451 if { (eval echo "$as_me:7451: \"$ac_link\"") >&5
7452   (eval $ac_link) 2>&5
7453   ac_status=$?
7454   echo "$as_me:7454: \$? = $ac_status" >&5
7455   (exit $ac_status); } &&
7456          { ac_try='test -s conftest$ac_exeext'
7457   { (eval echo "$as_me:7457: \"$ac_try\"") >&5
7458   (eval $ac_try) 2>&5
7459   ac_status=$?
7460   echo "$as_me:7460: \$? = $ac_status" >&5
7461   (exit $ac_status); }; }; then
7462   ac_cv_func_initscr=yes
7463 else
7464   echo "$as_me: failed program was:" >&5
7465 cat conftest.$ac_ext >&5
7466 ac_cv_func_initscr=no
7467 fi
7468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7469 fi
7470 echo "$as_me:7470: result: $ac_cv_func_initscr" >&5
7471 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7472 if test $ac_cv_func_initscr = yes; then
7473   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7474 else
7475
7476                 cf_save_LIBS="$LIBS"
7477                 echo "$as_me:7477: checking for initscr in -l$cf_nculib_root" >&5
7478 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7479                 LIBS="-l$cf_nculib_root $LIBS"
7480                 cat >conftest.$ac_ext <<_ACEOF
7481 #line 7481 "configure"
7482 #include "confdefs.h"
7483 #include <${cf_cv_ncurses_header:-curses.h}>
7484 int
7485 main (void)
7486 {
7487 initscr()
7488   ;
7489   return 0;
7490 }
7491 _ACEOF
7492 rm -f conftest.$ac_objext conftest$ac_exeext
7493 if { (eval echo "$as_me:7493: \"$ac_link\"") >&5
7494   (eval $ac_link) 2>&5
7495   ac_status=$?
7496   echo "$as_me:7496: \$? = $ac_status" >&5
7497   (exit $ac_status); } &&
7498          { ac_try='test -s conftest$ac_exeext'
7499   { (eval echo "$as_me:7499: \"$ac_try\"") >&5
7500   (eval $ac_try) 2>&5
7501   ac_status=$?
7502   echo "$as_me:7502: \$? = $ac_status" >&5
7503   (exit $ac_status); }; }; then
7504   echo "$as_me:7504: result: yes" >&5
7505 echo "${ECHO_T}yes" >&6
7506                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7507
7508 else
7509   echo "$as_me: failed program was:" >&5
7510 cat conftest.$ac_ext >&5
7511 echo "$as_me:7511: result: no" >&5
7512 echo "${ECHO_T}no" >&6
7513
7514 cf_search=
7515 cf_library_path_list=""
7516 if test -n "${LDFLAGS}${LIBS}" ; then
7517         for cf_library_path in $LDFLAGS $LIBS
7518         do
7519                 case $cf_library_path in
7520                 (-L*)
7521                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7522
7523 test "x$cf_library_path" != "xNONE" && \
7524 test -d "$cf_library_path" && \
7525  {
7526         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7527         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7528         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7529         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7530         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7531         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"
7532 }
7533
7534                         cf_library_path_list="$cf_library_path_list $cf_search"
7535                         ;;
7536                 esac
7537         done
7538 fi
7539
7540 cf_search=
7541
7542 test "x$prefix" != "xNONE" && \
7543 test -d "$prefix" && \
7544  {
7545         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7546         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7547         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7548         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7549         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7550         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7551 }
7552
7553 for cf_subdir_prefix in \
7554         /usr \
7555         /usr/local \
7556         /usr/pkg \
7557         /opt \
7558         /opt/local \
7559         $HOME
7560 do
7561
7562 test "x$cf_subdir_prefix" != "x$prefix" && \
7563 test -d "$cf_subdir_prefix" && \
7564 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7565         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7566         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7567         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7568         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7569         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7570         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"
7571 }
7572
7573 done
7574
7575 cf_search="$cf_library_path_list $cf_search"
7576
7577                         for cf_libdir in $cf_search
7578                         do
7579                                 echo "$as_me:7579: checking for -l$cf_nculib_root in $cf_libdir" >&5
7580 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7581                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7582                                 cat >conftest.$ac_ext <<_ACEOF
7583 #line 7583 "configure"
7584 #include "confdefs.h"
7585 #include <${cf_cv_ncurses_header:-curses.h}>
7586 int
7587 main (void)
7588 {
7589 initscr()
7590   ;
7591   return 0;
7592 }
7593 _ACEOF
7594 rm -f conftest.$ac_objext conftest$ac_exeext
7595 if { (eval echo "$as_me:7595: \"$ac_link\"") >&5
7596   (eval $ac_link) 2>&5
7597   ac_status=$?
7598   echo "$as_me:7598: \$? = $ac_status" >&5
7599   (exit $ac_status); } &&
7600          { ac_try='test -s conftest$ac_exeext'
7601   { (eval echo "$as_me:7601: \"$ac_try\"") >&5
7602   (eval $ac_try) 2>&5
7603   ac_status=$?
7604   echo "$as_me:7604: \$? = $ac_status" >&5
7605   (exit $ac_status); }; }; then
7606   echo "$as_me:7606: result: yes" >&5
7607 echo "${ECHO_T}yes" >&6
7608                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7609                                          break
7610 else
7611   echo "$as_me: failed program was:" >&5
7612 cat conftest.$ac_ext >&5
7613 echo "$as_me:7613: result: no" >&5
7614 echo "${ECHO_T}no" >&6
7615                                          LIBS="$cf_save_LIBS"
7616 fi
7617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7618                         done
7619
7620 fi
7621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7622
7623 fi
7624
7625 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7626
7627 if test $cf_found_library = no ; then
7628         { { echo "$as_me:7628: error: Cannot link $cf_nculib_root library" >&5
7629 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7630    { (exit 1); exit 1; }; }
7631 fi
7632
7633 fi
7634
7635 if test -n "$cf_ncurses_LIBS" ; then
7636         echo "$as_me:7636: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7637 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7638         cf_ncurses_SAVE="$LIBS"
7639         for p in $cf_ncurses_LIBS ; do
7640                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7641                 if test "$q" != "$LIBS" ; then
7642                         LIBS="$q"
7643                 fi
7644         done
7645         cat >conftest.$ac_ext <<_ACEOF
7646 #line 7646 "configure"
7647 #include "confdefs.h"
7648 #include <${cf_cv_ncurses_header:-curses.h}>
7649 int
7650 main (void)
7651 {
7652 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7653   ;
7654   return 0;
7655 }
7656 _ACEOF
7657 rm -f conftest.$ac_objext conftest$ac_exeext
7658 if { (eval echo "$as_me:7658: \"$ac_link\"") >&5
7659   (eval $ac_link) 2>&5
7660   ac_status=$?
7661   echo "$as_me:7661: \$? = $ac_status" >&5
7662   (exit $ac_status); } &&
7663          { ac_try='test -s conftest$ac_exeext'
7664   { (eval echo "$as_me:7664: \"$ac_try\"") >&5
7665   (eval $ac_try) 2>&5
7666   ac_status=$?
7667   echo "$as_me:7667: \$? = $ac_status" >&5
7668   (exit $ac_status); }; }; then
7669   echo "$as_me:7669: result: yes" >&5
7670 echo "${ECHO_T}yes" >&6
7671 else
7672   echo "$as_me: failed program was:" >&5
7673 cat conftest.$ac_ext >&5
7674 echo "$as_me:7674: result: no" >&5
7675 echo "${ECHO_T}no" >&6
7676                  LIBS="$cf_ncurses_SAVE"
7677 fi
7678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7679 fi
7680
7681 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7682
7683 cat >>confdefs.h <<EOF
7684 #define $cf_nculib_ROOT 1
7685 EOF
7686
7687         fi
7688 else
7689         NCURSES_CONFIG=none
7690 fi
7691
7692 else
7693
7694 cf_ncuconfig_root=ncurses
7695 cf_have_ncuconfig=no
7696
7697 if test "x${PKG_CONFIG:=none}" != xnone; then
7698         echo "$as_me:7698: checking pkg-config for $cf_ncuconfig_root" >&5
7699 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7700         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7701                 echo "$as_me:7701: result: yes" >&5
7702 echo "${ECHO_T}yes" >&6
7703
7704                 echo "$as_me:7704: checking if the $cf_ncuconfig_root package files work" >&5
7705 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7706                 cf_have_ncuconfig=unknown
7707
7708                 cf_save_CPPFLAGS="$CPPFLAGS"
7709                 cf_save_LIBS="$LIBS"
7710
7711                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7712
7713 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7714 # Filter out duplicates - this happens with badly-designed ".pc" files...
7715 for cf_add_1lib in $LIBS
7716 do
7717         for cf_add_2lib in $cf_add_libs
7718         do
7719                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7720                 then
7721                         cf_add_1lib=
7722                         break
7723                 fi
7724         done
7725         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7726 done
7727 LIBS="$cf_add_libs"
7728
7729                 cat >conftest.$ac_ext <<_ACEOF
7730 #line 7730 "configure"
7731 #include "confdefs.h"
7732 #include <${cf_cv_ncurses_header:-curses.h}>
7733 int
7734 main (void)
7735 {
7736 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7737   ;
7738   return 0;
7739 }
7740 _ACEOF
7741 rm -f conftest.$ac_objext conftest$ac_exeext
7742 if { (eval echo "$as_me:7742: \"$ac_link\"") >&5
7743   (eval $ac_link) 2>&5
7744   ac_status=$?
7745   echo "$as_me:7745: \$? = $ac_status" >&5
7746   (exit $ac_status); } &&
7747          { ac_try='test -s conftest$ac_exeext'
7748   { (eval echo "$as_me:7748: \"$ac_try\"") >&5
7749   (eval $ac_try) 2>&5
7750   ac_status=$?
7751   echo "$as_me:7751: \$? = $ac_status" >&5
7752   (exit $ac_status); }; }; then
7753   if test "$cross_compiling" = yes; then
7754   cf_have_ncuconfig=maybe
7755 else
7756   cat >conftest.$ac_ext <<_ACEOF
7757 #line 7757 "configure"
7758 #include "confdefs.h"
7759 #include <${cf_cv_ncurses_header:-curses.h}>
7760                                 int main(void)
7761                                 { char *xx = curses_version(); return (xx == 0); }
7762 _ACEOF
7763 rm -f conftest$ac_exeext
7764 if { (eval echo "$as_me:7764: \"$ac_link\"") >&5
7765   (eval $ac_link) 2>&5
7766   ac_status=$?
7767   echo "$as_me:7767: \$? = $ac_status" >&5
7768   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7769   { (eval echo "$as_me:7769: \"$ac_try\"") >&5
7770   (eval $ac_try) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit $ac_status); }; }; then
7774   cf_have_ncuconfig=yes
7775 else
7776   echo "$as_me: program exited with status $ac_status" >&5
7777 echo "$as_me: failed program was:" >&5
7778 cat conftest.$ac_ext >&5
7779 cf_have_ncuconfig=no
7780 fi
7781 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7782 fi
7783 else
7784   echo "$as_me: failed program was:" >&5
7785 cat conftest.$ac_ext >&5
7786 cf_have_ncuconfig=no
7787 fi
7788 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7789                 echo "$as_me:7789: result: $cf_have_ncuconfig" >&5
7790 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7791                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7792                 if test "$cf_have_ncuconfig" != "yes"
7793                 then
7794                         CPPFLAGS="$cf_save_CPPFLAGS"
7795                         LIBS="$cf_save_LIBS"
7796                         NCURSES_CONFIG_PKG=none
7797                 else
7798
7799 cat >>confdefs.h <<\EOF
7800 #define NCURSES 1
7801 EOF
7802
7803                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7804
7805 echo "$as_me:7805: checking for terminfo header" >&5
7806 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7807 if test "${cf_cv_term_header+set}" = set; then
7808   echo $ECHO_N "(cached) $ECHO_C" >&6
7809 else
7810
7811 case ${cf_cv_ncurses_header} in
7812 (*/ncurses.h|*/ncursesw.h)
7813         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7814         ;;
7815 (*)
7816         cf_term_header=term.h
7817         ;;
7818 esac
7819
7820 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7821 do
7822 cat >conftest.$ac_ext <<_ACEOF
7823 #line 7823 "configure"
7824 #include "confdefs.h"
7825 #include <stdio.h>
7826 #include <${cf_cv_ncurses_header:-curses.h}>
7827 #include <$cf_test>
7828
7829 int
7830 main (void)
7831 {
7832 int x = auto_left_margin
7833   ;
7834   return 0;
7835 }
7836 _ACEOF
7837 rm -f conftest.$ac_objext
7838 if { (eval echo "$as_me:7838: \"$ac_compile\"") >&5
7839   (eval $ac_compile) 2>&5
7840   ac_status=$?
7841   echo "$as_me:7841: \$? = $ac_status" >&5
7842   (exit $ac_status); } &&
7843          { ac_try='test -s conftest.$ac_objext'
7844   { (eval echo "$as_me:7844: \"$ac_try\"") >&5
7845   (eval $ac_try) 2>&5
7846   ac_status=$?
7847   echo "$as_me:7847: \$? = $ac_status" >&5
7848   (exit $ac_status); }; }; then
7849
7850         cf_cv_term_header="$cf_test"
7851 else
7852   echo "$as_me: failed program was:" >&5
7853 cat conftest.$ac_ext >&5
7854
7855         cf_cv_term_header=unknown
7856
7857 fi
7858 rm -f conftest.$ac_objext conftest.$ac_ext
7859         test "$cf_cv_term_header" != unknown && break
7860 done
7861
7862 fi
7863 echo "$as_me:7863: result: $cf_cv_term_header" >&5
7864 echo "${ECHO_T}$cf_cv_term_header" >&6
7865
7866 # Set definitions to allow ifdef'ing to accommodate subdirectories
7867
7868 case $cf_cv_term_header in
7869 (*term.h)
7870
7871 cat >>confdefs.h <<\EOF
7872 #define HAVE_TERM_H 1
7873 EOF
7874
7875         ;;
7876 esac
7877
7878 case $cf_cv_term_header in
7879 (ncurses/term.h)
7880
7881 cat >>confdefs.h <<\EOF
7882 #define HAVE_NCURSES_TERM_H 1
7883 EOF
7884
7885         ;;
7886 (ncursesw/term.h)
7887
7888 cat >>confdefs.h <<\EOF
7889 #define HAVE_NCURSESW_TERM_H 1
7890 EOF
7891
7892         ;;
7893 esac
7894
7895                 fi
7896
7897         else
7898                 echo "$as_me:7898: result: no" >&5
7899 echo "${ECHO_T}no" >&6
7900                 NCURSES_CONFIG_PKG=none
7901         fi
7902 else
7903         NCURSES_CONFIG_PKG=none
7904 fi
7905
7906 if test "x$cf_have_ncuconfig" = "xno"; then
7907         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7908
7909 if test -n "$ac_tool_prefix"; then
7910   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7911   do
7912     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7913 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7914 echo "$as_me:7914: checking for $ac_word" >&5
7915 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7916 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7917   echo $ECHO_N "(cached) $ECHO_C" >&6
7918 else
7919   if test -n "$NCURSES_CONFIG"; then
7920   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7921 else
7922   ac_save_IFS=$IFS; IFS=$ac_path_separator
7923 ac_dummy="$PATH"
7924 for ac_dir in $ac_dummy; do
7925   IFS=$ac_save_IFS
7926   test -z "$ac_dir" && ac_dir=.
7927   $as_executable_p "$ac_dir/$ac_word" || continue
7928 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7929 echo "$as_me:7929: found $ac_dir/$ac_word" >&5
7930 break
7931 done
7932
7933 fi
7934 fi
7935 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7936 if test -n "$NCURSES_CONFIG"; then
7937   echo "$as_me:7937: result: $NCURSES_CONFIG" >&5
7938 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7939 else
7940   echo "$as_me:7940: result: no" >&5
7941 echo "${ECHO_T}no" >&6
7942 fi
7943
7944     test -n "$NCURSES_CONFIG" && break
7945   done
7946 fi
7947 if test -z "$NCURSES_CONFIG"; then
7948   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7949   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7950 do
7951   # Extract the first word of "$ac_prog", so it can be a program name with args.
7952 set dummy $ac_prog; ac_word=$2
7953 echo "$as_me:7953: checking for $ac_word" >&5
7954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7955 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7956   echo $ECHO_N "(cached) $ECHO_C" >&6
7957 else
7958   if test -n "$ac_ct_NCURSES_CONFIG"; then
7959   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7960 else
7961   ac_save_IFS=$IFS; IFS=$ac_path_separator
7962 ac_dummy="$PATH"
7963 for ac_dir in $ac_dummy; do
7964   IFS=$ac_save_IFS
7965   test -z "$ac_dir" && ac_dir=.
7966   $as_executable_p "$ac_dir/$ac_word" || continue
7967 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7968 echo "$as_me:7968: found $ac_dir/$ac_word" >&5
7969 break
7970 done
7971
7972 fi
7973 fi
7974 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7975 if test -n "$ac_ct_NCURSES_CONFIG"; then
7976   echo "$as_me:7976: result: $ac_ct_NCURSES_CONFIG" >&5
7977 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7978 else
7979   echo "$as_me:7979: result: no" >&5
7980 echo "${ECHO_T}no" >&6
7981 fi
7982
7983   test -n "$ac_ct_NCURSES_CONFIG" && break
7984 done
7985 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7986
7987   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7988 fi
7989
7990         if test "$NCURSES_CONFIG" != none ; then
7991
7992                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7993
7994 cf_add_libs="`$NCURSES_CONFIG --libs`"
7995 # Filter out duplicates - this happens with badly-designed ".pc" files...
7996 for cf_add_1lib in $LIBS
7997 do
7998         for cf_add_2lib in $cf_add_libs
7999         do
8000                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8001                 then
8002                         cf_add_1lib=
8003                         break
8004                 fi
8005         done
8006         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8007 done
8008 LIBS="$cf_add_libs"
8009
8010                 # even with config script, some packages use no-override for curses.h
8011
8012 echo "$as_me:8012: checking if we have identified curses headers" >&5
8013 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8014 if test "${cf_cv_ncurses_header+set}" = set; then
8015   echo $ECHO_N "(cached) $ECHO_C" >&6
8016 else
8017
8018 cf_cv_ncurses_header=none
8019 for cf_header in \
8020         ncurses.h ncurses/ncurses.h \
8021         curses.h ncurses/curses.h
8022 do
8023 cat >conftest.$ac_ext <<_ACEOF
8024 #line 8024 "configure"
8025 #include "confdefs.h"
8026 #include <${cf_header}>
8027 int
8028 main (void)
8029 {
8030 initscr(); tgoto("?", 0,0)
8031   ;
8032   return 0;
8033 }
8034 _ACEOF
8035 rm -f conftest.$ac_objext
8036 if { (eval echo "$as_me:8036: \"$ac_compile\"") >&5
8037   (eval $ac_compile) 2>&5
8038   ac_status=$?
8039   echo "$as_me:8039: \$? = $ac_status" >&5
8040   (exit $ac_status); } &&
8041          { ac_try='test -s conftest.$ac_objext'
8042   { (eval echo "$as_me:8042: \"$ac_try\"") >&5
8043   (eval $ac_try) 2>&5
8044   ac_status=$?
8045   echo "$as_me:8045: \$? = $ac_status" >&5
8046   (exit $ac_status); }; }; then
8047   cf_cv_ncurses_header=$cf_header; break
8048 else
8049   echo "$as_me: failed program was:" >&5
8050 cat conftest.$ac_ext >&5
8051 fi
8052 rm -f conftest.$ac_objext conftest.$ac_ext
8053 done
8054
8055 fi
8056 echo "$as_me:8056: result: $cf_cv_ncurses_header" >&5
8057 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8058
8059 if test "$cf_cv_ncurses_header" = none ; then
8060         { { echo "$as_me:8060: error: No curses header-files found" >&5
8061 echo "$as_me: error: No curses header-files found" >&2;}
8062    { (exit 1); exit 1; }; }
8063 fi
8064
8065 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8066
8067 for ac_header in $cf_cv_ncurses_header
8068 do
8069 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8070 echo "$as_me:8070: checking for $ac_header" >&5
8071 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8072 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8073   echo $ECHO_N "(cached) $ECHO_C" >&6
8074 else
8075   cat >conftest.$ac_ext <<_ACEOF
8076 #line 8076 "configure"
8077 #include "confdefs.h"
8078 #include <$ac_header>
8079 _ACEOF
8080 if { (eval echo "$as_me:8080: \"$ac_cpp conftest.$ac_ext\"") >&5
8081   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8082   ac_status=$?
8083   egrep -v '^ *\+' conftest.er1 >conftest.err
8084   rm -f conftest.er1
8085   cat conftest.err >&5
8086   echo "$as_me:8086: \$? = $ac_status" >&5
8087   (exit $ac_status); } >/dev/null; then
8088   if test -s conftest.err; then
8089     ac_cpp_err=$ac_c_preproc_warn_flag
8090   else
8091     ac_cpp_err=
8092   fi
8093 else
8094   ac_cpp_err=yes
8095 fi
8096 if test -z "$ac_cpp_err"; then
8097   eval "$as_ac_Header=yes"
8098 else
8099   echo "$as_me: failed program was:" >&5
8100   cat conftest.$ac_ext >&5
8101   eval "$as_ac_Header=no"
8102 fi
8103 rm -f conftest.err conftest.$ac_ext
8104 fi
8105 echo "$as_me:8105: result: `eval echo '${'$as_ac_Header'}'`" >&5
8106 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8107 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8108   cat >>confdefs.h <<EOF
8109 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8110 EOF
8111
8112 fi
8113 done
8114
8115 cat >>confdefs.h <<\EOF
8116 #define NCURSES 1
8117 EOF
8118
8119 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8120
8121                 cat >>confdefs.h <<EOF
8122 #define $cf_nculib_ROOT 1
8123 EOF
8124
8125                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8126
8127         else
8128
8129 cf_ncuhdr_root=ncurses
8130
8131 test -n "$cf_cv_curses_dir" && \
8132 test "$cf_cv_curses_dir" != "no" && { \
8133
8134 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8135   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8136   do
8137         while test $cf_add_incdir != /usr/include
8138         do
8139           if test -d $cf_add_incdir
8140           then
8141                 cf_have_incdir=no
8142                 if test -n "$CFLAGS$CPPFLAGS" ; then
8143                   # a loop is needed to ensure we can add subdirs of existing dirs
8144                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8145                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8146                           cf_have_incdir=yes; break
8147                         fi
8148                   done
8149                 fi
8150
8151                 if test "$cf_have_incdir" = no ; then
8152                   if test "$cf_add_incdir" = /usr/local/include ; then
8153                         if test "$GCC" = yes
8154                         then
8155                           cf_save_CPPFLAGS=$CPPFLAGS
8156                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8157                           cat >conftest.$ac_ext <<_ACEOF
8158 #line 8158 "configure"
8159 #include "confdefs.h"
8160 #include <stdio.h>
8161 int
8162 main (void)
8163 {
8164 printf("Hello")
8165   ;
8166   return 0;
8167 }
8168 _ACEOF
8169 rm -f conftest.$ac_objext
8170 if { (eval echo "$as_me:8170: \"$ac_compile\"") >&5
8171   (eval $ac_compile) 2>&5
8172   ac_status=$?
8173   echo "$as_me:8173: \$? = $ac_status" >&5
8174   (exit $ac_status); } &&
8175          { ac_try='test -s conftest.$ac_objext'
8176   { (eval echo "$as_me:8176: \"$ac_try\"") >&5
8177   (eval $ac_try) 2>&5
8178   ac_status=$?
8179   echo "$as_me:8179: \$? = $ac_status" >&5
8180   (exit $ac_status); }; }; then
8181   :
8182 else
8183   echo "$as_me: failed program was:" >&5
8184 cat conftest.$ac_ext >&5
8185 cf_have_incdir=yes
8186 fi
8187 rm -f conftest.$ac_objext conftest.$ac_ext
8188                           CPPFLAGS=$cf_save_CPPFLAGS
8189                         fi
8190                   fi
8191                 fi
8192
8193                 if test "$cf_have_incdir" = no ; then
8194                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8195
8196 echo "${as_me:-configure}:8196: testing adding $cf_add_incdir to include-path ..." 1>&5
8197
8198                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8199
8200                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8201                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8202                   cf_add_incdir="$cf_top_incdir"
8203                 else
8204                   break
8205                 fi
8206           else
8207                 break
8208           fi
8209         done
8210   done
8211 fi
8212
8213 }
8214
8215 echo "$as_me:8215: checking for $cf_ncuhdr_root header in include-path" >&5
8216 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8217 if test "${cf_cv_ncurses_h+set}" = set; then
8218   echo $ECHO_N "(cached) $ECHO_C" >&6
8219 else
8220
8221         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8222         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8223         for cf_header in $cf_header_list
8224         do
8225
8226         cat >conftest.$ac_ext <<_ACEOF
8227 #line 8227 "configure"
8228 #include "confdefs.h"
8229
8230 #include <$cf_header>
8231 int
8232 main (void)
8233 {
8234
8235 #ifdef NCURSES_VERSION
8236
8237 printf("%s\n", NCURSES_VERSION);
8238 #else
8239 #ifdef __NCURSES_H
8240 printf("old\n");
8241 #else
8242         make an error
8243 #endif
8244 #endif
8245
8246   ;
8247   return 0;
8248 }
8249 _ACEOF
8250 rm -f conftest.$ac_objext
8251 if { (eval echo "$as_me:8251: \"$ac_compile\"") >&5
8252   (eval $ac_compile) 2>&5
8253   ac_status=$?
8254   echo "$as_me:8254: \$? = $ac_status" >&5
8255   (exit $ac_status); } &&
8256          { ac_try='test -s conftest.$ac_objext'
8257   { (eval echo "$as_me:8257: \"$ac_try\"") >&5
8258   (eval $ac_try) 2>&5
8259   ac_status=$?
8260   echo "$as_me:8260: \$? = $ac_status" >&5
8261   (exit $ac_status); }; }; then
8262   cf_cv_ncurses_h=$cf_header
8263
8264 else
8265   echo "$as_me: failed program was:" >&5
8266 cat conftest.$ac_ext >&5
8267 cf_cv_ncurses_h=no
8268 fi
8269 rm -f conftest.$ac_objext conftest.$ac_ext
8270
8271                 test "$cf_cv_ncurses_h" != no && break
8272         done
8273
8274 fi
8275 echo "$as_me:8275: result: $cf_cv_ncurses_h" >&5
8276 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8277
8278 if test "$cf_cv_ncurses_h" != no ; then
8279         cf_cv_ncurses_header=$cf_cv_ncurses_h
8280 else
8281
8282 echo "$as_me:8282: checking for $cf_ncuhdr_root include-path" >&5
8283 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8284 if test "${cf_cv_ncurses_h2+set}" = set; then
8285   echo $ECHO_N "(cached) $ECHO_C" >&6
8286 else
8287
8288         test -n "$verbose" && echo
8289
8290 cf_search=
8291
8292 # collect the current set of include-directories from compiler flags
8293 cf_header_path_list=""
8294 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8295         for cf_header_path in $CPPFLAGS $CFLAGS
8296         do
8297                 case $cf_header_path in
8298                 (-I*)
8299                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8300
8301 test "x$cf_header_path" != "xNONE" && \
8302 test -d "$cf_header_path" && \
8303  {
8304         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8305         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8306         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8307         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8308         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8309         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"
8310 }
8311
8312                         cf_header_path_list="$cf_header_path_list $cf_search"
8313                         ;;
8314                 esac
8315         done
8316 fi
8317
8318 # add the variations for the package we are looking for
8319
8320 cf_search=
8321
8322 test "x$prefix" != "xNONE" && \
8323 test -d "$prefix" && \
8324  {
8325         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8326         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8327         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8328         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8329         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8330         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8331 }
8332
8333 for cf_subdir_prefix in \
8334         /usr \
8335         /usr/local \
8336         /usr/pkg \
8337         /opt \
8338         /opt/local \
8339         $HOME
8340 do
8341
8342 test "x$cf_subdir_prefix" != "x$prefix" && \
8343 test -d "$cf_subdir_prefix" && \
8344 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8345         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8346         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8347         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8348         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8349         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8350         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"
8351 }
8352
8353 done
8354
8355 test "$includedir" != NONE && \
8356 test "$includedir" != "/usr/include" && \
8357 test -d "$includedir" && {
8358         test -d $includedir &&    cf_search="$cf_search $includedir"
8359         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8360 }
8361
8362 test "$oldincludedir" != NONE && \
8363 test "$oldincludedir" != "/usr/include" && \
8364 test -d "$oldincludedir" && {
8365         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8366         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8367 }
8368
8369 cf_search="$cf_search $cf_header_path_list"
8370
8371         test -n "$verbose" && echo search path $cf_search
8372         cf_save2_CPPFLAGS="$CPPFLAGS"
8373         for cf_incdir in $cf_search
8374         do
8375
8376 if test -n "$cf_incdir" ; then
8377   for cf_add_incdir in $cf_incdir
8378   do
8379         while test $cf_add_incdir != /usr/include
8380         do
8381           if test -d $cf_add_incdir
8382           then
8383                 cf_have_incdir=no
8384                 if test -n "$CFLAGS$CPPFLAGS" ; then
8385                   # a loop is needed to ensure we can add subdirs of existing dirs
8386                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8387                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8388                           cf_have_incdir=yes; break
8389                         fi
8390                   done
8391                 fi
8392
8393                 if test "$cf_have_incdir" = no ; then
8394                   if test "$cf_add_incdir" = /usr/local/include ; then
8395                         if test "$GCC" = yes
8396                         then
8397                           cf_save_CPPFLAGS=$CPPFLAGS
8398                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8399                           cat >conftest.$ac_ext <<_ACEOF
8400 #line 8400 "configure"
8401 #include "confdefs.h"
8402 #include <stdio.h>
8403 int
8404 main (void)
8405 {
8406 printf("Hello")
8407   ;
8408   return 0;
8409 }
8410 _ACEOF
8411 rm -f conftest.$ac_objext
8412 if { (eval echo "$as_me:8412: \"$ac_compile\"") >&5
8413   (eval $ac_compile) 2>&5
8414   ac_status=$?
8415   echo "$as_me:8415: \$? = $ac_status" >&5
8416   (exit $ac_status); } &&
8417          { ac_try='test -s conftest.$ac_objext'
8418   { (eval echo "$as_me:8418: \"$ac_try\"") >&5
8419   (eval $ac_try) 2>&5
8420   ac_status=$?
8421   echo "$as_me:8421: \$? = $ac_status" >&5
8422   (exit $ac_status); }; }; then
8423   :
8424 else
8425   echo "$as_me: failed program was:" >&5
8426 cat conftest.$ac_ext >&5
8427 cf_have_incdir=yes
8428 fi
8429 rm -f conftest.$ac_objext conftest.$ac_ext
8430                           CPPFLAGS=$cf_save_CPPFLAGS
8431                         fi
8432                   fi
8433                 fi
8434
8435                 if test "$cf_have_incdir" = no ; then
8436                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8437
8438 echo "${as_me:-configure}:8438: testing adding $cf_add_incdir to include-path ..." 1>&5
8439
8440                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8441
8442                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8443                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8444                   cf_add_incdir="$cf_top_incdir"
8445                 else
8446                   break
8447                 fi
8448           else
8449                 break
8450           fi
8451         done
8452   done
8453 fi
8454
8455                 for cf_header in \
8456                         ncurses.h \
8457                         curses.h
8458                 do
8459
8460         cat >conftest.$ac_ext <<_ACEOF
8461 #line 8461 "configure"
8462 #include "confdefs.h"
8463
8464 #include <$cf_header>
8465 int
8466 main (void)
8467 {
8468
8469 #ifdef NCURSES_VERSION
8470
8471 printf("%s\n", NCURSES_VERSION);
8472 #else
8473 #ifdef __NCURSES_H
8474 printf("old\n");
8475 #else
8476         make an error
8477 #endif
8478 #endif
8479
8480   ;
8481   return 0;
8482 }
8483 _ACEOF
8484 rm -f conftest.$ac_objext
8485 if { (eval echo "$as_me:8485: \"$ac_compile\"") >&5
8486   (eval $ac_compile) 2>&5
8487   ac_status=$?
8488   echo "$as_me:8488: \$? = $ac_status" >&5
8489   (exit $ac_status); } &&
8490          { ac_try='test -s conftest.$ac_objext'
8491   { (eval echo "$as_me:8491: \"$ac_try\"") >&5
8492   (eval $ac_try) 2>&5
8493   ac_status=$?
8494   echo "$as_me:8494: \$? = $ac_status" >&5
8495   (exit $ac_status); }; }; then
8496   cf_cv_ncurses_h2=$cf_header
8497
8498 else
8499   echo "$as_me: failed program was:" >&5
8500 cat conftest.$ac_ext >&5
8501 cf_cv_ncurses_h2=no
8502 fi
8503 rm -f conftest.$ac_objext conftest.$ac_ext
8504
8505                         if test "$cf_cv_ncurses_h2" != no ; then
8506                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8507                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8508                                 break
8509                         fi
8510                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8511                 done
8512                 CPPFLAGS="$cf_save2_CPPFLAGS"
8513                 test "$cf_cv_ncurses_h2" != no && break
8514         done
8515         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8515: error: not found" >&5
8516 echo "$as_me: error: not found" >&2;}
8517    { (exit 1); exit 1; }; }
8518
8519 fi
8520 echo "$as_me:8520: result: $cf_cv_ncurses_h2" >&5
8521 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8522
8523         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8524         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8525         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8526                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8527         fi
8528
8529 if test -n "$cf_1st_incdir" ; then
8530   for cf_add_incdir in $cf_1st_incdir
8531   do
8532         while test $cf_add_incdir != /usr/include
8533         do
8534           if test -d $cf_add_incdir
8535           then
8536                 cf_have_incdir=no
8537                 if test -n "$CFLAGS$CPPFLAGS" ; then
8538                   # a loop is needed to ensure we can add subdirs of existing dirs
8539                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8540                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8541                           cf_have_incdir=yes; break
8542                         fi
8543                   done
8544                 fi
8545
8546                 if test "$cf_have_incdir" = no ; then
8547                   if test "$cf_add_incdir" = /usr/local/include ; then
8548                         if test "$GCC" = yes
8549                         then
8550                           cf_save_CPPFLAGS=$CPPFLAGS
8551                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8552                           cat >conftest.$ac_ext <<_ACEOF
8553 #line 8553 "configure"
8554 #include "confdefs.h"
8555 #include <stdio.h>
8556 int
8557 main (void)
8558 {
8559 printf("Hello")
8560   ;
8561   return 0;
8562 }
8563 _ACEOF
8564 rm -f conftest.$ac_objext
8565 if { (eval echo "$as_me:8565: \"$ac_compile\"") >&5
8566   (eval $ac_compile) 2>&5
8567   ac_status=$?
8568   echo "$as_me:8568: \$? = $ac_status" >&5
8569   (exit $ac_status); } &&
8570          { ac_try='test -s conftest.$ac_objext'
8571   { (eval echo "$as_me:8571: \"$ac_try\"") >&5
8572   (eval $ac_try) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit $ac_status); }; }; then
8576   :
8577 else
8578   echo "$as_me: failed program was:" >&5
8579 cat conftest.$ac_ext >&5
8580 cf_have_incdir=yes
8581 fi
8582 rm -f conftest.$ac_objext conftest.$ac_ext
8583                           CPPFLAGS=$cf_save_CPPFLAGS
8584                         fi
8585                   fi
8586                 fi
8587
8588                 if test "$cf_have_incdir" = no ; then
8589                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8590
8591 echo "${as_me:-configure}:8591: testing adding $cf_add_incdir to include-path ..." 1>&5
8592
8593                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8594
8595                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8596                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8597                   cf_add_incdir="$cf_top_incdir"
8598                 else
8599                   break
8600                 fi
8601           else
8602                 break
8603           fi
8604         done
8605   done
8606 fi
8607
8608 fi
8609
8610 # Set definitions to allow ifdef'ing for ncurses.h
8611
8612 case $cf_cv_ncurses_header in
8613 (*ncurses.h)
8614
8615 cat >>confdefs.h <<\EOF
8616 #define HAVE_NCURSES_H 1
8617 EOF
8618
8619         ;;
8620 esac
8621
8622 case $cf_cv_ncurses_header in
8623 (ncurses/curses.h|ncurses/ncurses.h)
8624
8625 cat >>confdefs.h <<\EOF
8626 #define HAVE_NCURSES_NCURSES_H 1
8627 EOF
8628
8629         ;;
8630 (ncursesw/curses.h|ncursesw/ncurses.h)
8631
8632 cat >>confdefs.h <<\EOF
8633 #define HAVE_NCURSESW_NCURSES_H 1
8634 EOF
8635
8636         ;;
8637 esac
8638
8639 echo "$as_me:8639: checking for terminfo header" >&5
8640 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8641 if test "${cf_cv_term_header+set}" = set; then
8642   echo $ECHO_N "(cached) $ECHO_C" >&6
8643 else
8644
8645 case ${cf_cv_ncurses_header} in
8646 (*/ncurses.h|*/ncursesw.h)
8647         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8648         ;;
8649 (*)
8650         cf_term_header=term.h
8651         ;;
8652 esac
8653
8654 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8655 do
8656 cat >conftest.$ac_ext <<_ACEOF
8657 #line 8657 "configure"
8658 #include "confdefs.h"
8659 #include <stdio.h>
8660 #include <${cf_cv_ncurses_header:-curses.h}>
8661 #include <$cf_test>
8662
8663 int
8664 main (void)
8665 {
8666 int x = auto_left_margin
8667   ;
8668   return 0;
8669 }
8670 _ACEOF
8671 rm -f conftest.$ac_objext
8672 if { (eval echo "$as_me:8672: \"$ac_compile\"") >&5
8673   (eval $ac_compile) 2>&5
8674   ac_status=$?
8675   echo "$as_me:8675: \$? = $ac_status" >&5
8676   (exit $ac_status); } &&
8677          { ac_try='test -s conftest.$ac_objext'
8678   { (eval echo "$as_me:8678: \"$ac_try\"") >&5
8679   (eval $ac_try) 2>&5
8680   ac_status=$?
8681   echo "$as_me:8681: \$? = $ac_status" >&5
8682   (exit $ac_status); }; }; then
8683
8684         cf_cv_term_header="$cf_test"
8685 else
8686   echo "$as_me: failed program was:" >&5
8687 cat conftest.$ac_ext >&5
8688
8689         cf_cv_term_header=unknown
8690
8691 fi
8692 rm -f conftest.$ac_objext conftest.$ac_ext
8693         test "$cf_cv_term_header" != unknown && break
8694 done
8695
8696 fi
8697 echo "$as_me:8697: result: $cf_cv_term_header" >&5
8698 echo "${ECHO_T}$cf_cv_term_header" >&6
8699
8700 # Set definitions to allow ifdef'ing to accommodate subdirectories
8701
8702 case $cf_cv_term_header in
8703 (*term.h)
8704
8705 cat >>confdefs.h <<\EOF
8706 #define HAVE_TERM_H 1
8707 EOF
8708
8709         ;;
8710 esac
8711
8712 case $cf_cv_term_header in
8713 (ncurses/term.h)
8714
8715 cat >>confdefs.h <<\EOF
8716 #define HAVE_NCURSES_TERM_H 1
8717 EOF
8718
8719         ;;
8720 (ncursesw/term.h)
8721
8722 cat >>confdefs.h <<\EOF
8723 #define HAVE_NCURSESW_TERM_H 1
8724 EOF
8725
8726         ;;
8727 esac
8728
8729 # some applications need this, but should check for NCURSES_VERSION
8730
8731 cat >>confdefs.h <<\EOF
8732 #define NCURSES 1
8733 EOF
8734
8735 echo "$as_me:8735: checking for ncurses version" >&5
8736 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8737 if test "${cf_cv_ncurses_version+set}" = set; then
8738   echo $ECHO_N "(cached) $ECHO_C" >&6
8739 else
8740
8741         cf_cv_ncurses_version=no
8742         cf_tempfile=out$$
8743         rm -f $cf_tempfile
8744         if test "$cross_compiling" = yes; then
8745
8746         # This will not work if the preprocessor splits the line after the
8747         # Autoconf token.  The 'unproto' program does that.
8748         cat > conftest.$ac_ext <<EOF
8749 #include <${cf_cv_ncurses_header:-curses.h}>
8750 #undef Autoconf
8751 #ifdef NCURSES_VERSION
8752 Autoconf NCURSES_VERSION
8753 #else
8754 #ifdef __NCURSES_H
8755 Autoconf "old"
8756 #endif
8757 ;
8758 #endif
8759 EOF
8760         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8761         { (eval echo "$as_me:8761: \"$cf_try\"") >&5
8762   (eval $cf_try) 2>&5
8763   ac_status=$?
8764   echo "$as_me:8764: \$? = $ac_status" >&5
8765   (exit $ac_status); }
8766         if test -f conftest.out ; then
8767                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8768                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8769                 rm -f conftest.out
8770         fi
8771
8772 else
8773   cat >conftest.$ac_ext <<_ACEOF
8774 #line 8774 "configure"
8775 #include "confdefs.h"
8776
8777 #include <${cf_cv_ncurses_header:-curses.h}>
8778 #include <stdio.h>
8779 int main(void)
8780 {
8781         FILE *fp = fopen("$cf_tempfile", "w");
8782 #ifdef NCURSES_VERSION
8783 # ifdef NCURSES_VERSION_PATCH
8784         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8785 # else
8786         fprintf(fp, "%s\n", NCURSES_VERSION);
8787 # endif
8788 #else
8789 # ifdef __NCURSES_H
8790         fprintf(fp, "old\n");
8791 # else
8792         make an error
8793 # endif
8794 #endif
8795         ${cf_cv_main_return:-return}(0);
8796 }
8797 _ACEOF
8798 rm -f conftest$ac_exeext
8799 if { (eval echo "$as_me:8799: \"$ac_link\"") >&5
8800   (eval $ac_link) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8804   { (eval echo "$as_me:8804: \"$ac_try\"") >&5
8805   (eval $ac_try) 2>&5
8806   ac_status=$?
8807   echo "$as_me:8807: \$? = $ac_status" >&5
8808   (exit $ac_status); }; }; then
8809
8810         cf_cv_ncurses_version=`cat $cf_tempfile`
8811 else
8812   echo "$as_me: program exited with status $ac_status" >&5
8813 echo "$as_me: failed program was:" >&5
8814 cat conftest.$ac_ext >&5
8815 fi
8816 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8817 fi
8818         rm -f $cf_tempfile
8819
8820 fi
8821 echo "$as_me:8821: result: $cf_cv_ncurses_version" >&5
8822 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8823 test "$cf_cv_ncurses_version" = no ||
8824 cat >>confdefs.h <<\EOF
8825 #define NCURSES 1
8826 EOF
8827
8828 cf_nculib_root=ncurses
8829         # This works, except for the special case where we find gpm, but
8830         # ncurses is in a nonstandard location via $LIBS, and we really want
8831         # to link gpm.
8832 cf_ncurses_LIBS=""
8833 cf_ncurses_SAVE="$LIBS"
8834 echo "$as_me:8834: checking for Gpm_Open in -lgpm" >&5
8835 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8836 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8837   echo $ECHO_N "(cached) $ECHO_C" >&6
8838 else
8839   ac_check_lib_save_LIBS=$LIBS
8840 LIBS="-lgpm  $LIBS"
8841 cat >conftest.$ac_ext <<_ACEOF
8842 #line 8842 "configure"
8843 #include "confdefs.h"
8844
8845 /* Override any gcc2 internal prototype to avoid an error.  */
8846 #ifdef __cplusplus
8847 extern "C"
8848 #endif
8849 /* We use char because int might match the return type of a gcc2
8850    builtin and then its argument prototype would still apply.  */
8851 char Gpm_Open ();
8852 int
8853 main (void)
8854 {
8855 Gpm_Open ();
8856   ;
8857   return 0;
8858 }
8859 _ACEOF
8860 rm -f conftest.$ac_objext conftest$ac_exeext
8861 if { (eval echo "$as_me:8861: \"$ac_link\"") >&5
8862   (eval $ac_link) 2>&5
8863   ac_status=$?
8864   echo "$as_me:8864: \$? = $ac_status" >&5
8865   (exit $ac_status); } &&
8866          { ac_try='test -s conftest$ac_exeext'
8867   { (eval echo "$as_me:8867: \"$ac_try\"") >&5
8868   (eval $ac_try) 2>&5
8869   ac_status=$?
8870   echo "$as_me:8870: \$? = $ac_status" >&5
8871   (exit $ac_status); }; }; then
8872   ac_cv_lib_gpm_Gpm_Open=yes
8873 else
8874   echo "$as_me: failed program was:" >&5
8875 cat conftest.$ac_ext >&5
8876 ac_cv_lib_gpm_Gpm_Open=no
8877 fi
8878 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8879 LIBS=$ac_check_lib_save_LIBS
8880 fi
8881 echo "$as_me:8881: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8882 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8883 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8884   echo "$as_me:8884: checking for initscr in -lgpm" >&5
8885 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8886 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8887   echo $ECHO_N "(cached) $ECHO_C" >&6
8888 else
8889   ac_check_lib_save_LIBS=$LIBS
8890 LIBS="-lgpm  $LIBS"
8891 cat >conftest.$ac_ext <<_ACEOF
8892 #line 8892 "configure"
8893 #include "confdefs.h"
8894
8895 /* Override any gcc2 internal prototype to avoid an error.  */
8896 #ifdef __cplusplus
8897 extern "C"
8898 #endif
8899 /* We use char because int might match the return type of a gcc2
8900    builtin and then its argument prototype would still apply.  */
8901 char initscr ();
8902 int
8903 main (void)
8904 {
8905 initscr ();
8906   ;
8907   return 0;
8908 }
8909 _ACEOF
8910 rm -f conftest.$ac_objext conftest$ac_exeext
8911 if { (eval echo "$as_me:8911: \"$ac_link\"") >&5
8912   (eval $ac_link) 2>&5
8913   ac_status=$?
8914   echo "$as_me:8914: \$? = $ac_status" >&5
8915   (exit $ac_status); } &&
8916          { ac_try='test -s conftest$ac_exeext'
8917   { (eval echo "$as_me:8917: \"$ac_try\"") >&5
8918   (eval $ac_try) 2>&5
8919   ac_status=$?
8920   echo "$as_me:8920: \$? = $ac_status" >&5
8921   (exit $ac_status); }; }; then
8922   ac_cv_lib_gpm_initscr=yes
8923 else
8924   echo "$as_me: failed program was:" >&5
8925 cat conftest.$ac_ext >&5
8926 ac_cv_lib_gpm_initscr=no
8927 fi
8928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8929 LIBS=$ac_check_lib_save_LIBS
8930 fi
8931 echo "$as_me:8931: result: $ac_cv_lib_gpm_initscr" >&5
8932 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8933 if test $ac_cv_lib_gpm_initscr = yes; then
8934   LIBS="$cf_ncurses_SAVE"
8935 else
8936   cf_ncurses_LIBS="-lgpm"
8937 fi
8938
8939 fi
8940
8941 case $host_os in
8942 (freebsd*)
8943         # This is only necessary if you are linking against an obsolete
8944         # version of ncurses (but it should do no harm, since it's static).
8945         if test "$cf_nculib_root" = ncurses ; then
8946                 echo "$as_me:8946: checking for tgoto in -lmytinfo" >&5
8947 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8948 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8949   echo $ECHO_N "(cached) $ECHO_C" >&6
8950 else
8951   ac_check_lib_save_LIBS=$LIBS
8952 LIBS="-lmytinfo  $LIBS"
8953 cat >conftest.$ac_ext <<_ACEOF
8954 #line 8954 "configure"
8955 #include "confdefs.h"
8956
8957 /* Override any gcc2 internal prototype to avoid an error.  */
8958 #ifdef __cplusplus
8959 extern "C"
8960 #endif
8961 /* We use char because int might match the return type of a gcc2
8962    builtin and then its argument prototype would still apply.  */
8963 char tgoto ();
8964 int
8965 main (void)
8966 {
8967 tgoto ();
8968   ;
8969   return 0;
8970 }
8971 _ACEOF
8972 rm -f conftest.$ac_objext conftest$ac_exeext
8973 if { (eval echo "$as_me:8973: \"$ac_link\"") >&5
8974   (eval $ac_link) 2>&5
8975   ac_status=$?
8976   echo "$as_me:8976: \$? = $ac_status" >&5
8977   (exit $ac_status); } &&
8978          { ac_try='test -s conftest$ac_exeext'
8979   { (eval echo "$as_me:8979: \"$ac_try\"") >&5
8980   (eval $ac_try) 2>&5
8981   ac_status=$?
8982   echo "$as_me:8982: \$? = $ac_status" >&5
8983   (exit $ac_status); }; }; then
8984   ac_cv_lib_mytinfo_tgoto=yes
8985 else
8986   echo "$as_me: failed program was:" >&5
8987 cat conftest.$ac_ext >&5
8988 ac_cv_lib_mytinfo_tgoto=no
8989 fi
8990 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8991 LIBS=$ac_check_lib_save_LIBS
8992 fi
8993 echo "$as_me:8993: result: $ac_cv_lib_mytinfo_tgoto" >&5
8994 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8995 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8996   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8997 fi
8998
8999         fi
9000         ;;
9001 esac
9002
9003 cf_add_libs="$cf_ncurses_LIBS"
9004 # Filter out duplicates - this happens with badly-designed ".pc" files...
9005 for cf_add_1lib in $LIBS
9006 do
9007         for cf_add_2lib in $cf_add_libs
9008         do
9009                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9010                 then
9011                         cf_add_1lib=
9012                         break
9013                 fi
9014         done
9015         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9016 done
9017 LIBS="$cf_add_libs"
9018
9019 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9020 then
9021
9022 cf_add_libs="-l$cf_nculib_root"
9023 # Filter out duplicates - this happens with badly-designed ".pc" files...
9024 for cf_add_1lib in $LIBS
9025 do
9026         for cf_add_2lib in $cf_add_libs
9027         do
9028                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9029                 then
9030                         cf_add_1lib=
9031                         break
9032                 fi
9033         done
9034         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9035 done
9036 LIBS="$cf_add_libs"
9037
9038 else
9039
9040         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9041         cf_libdir=""
9042         echo "$as_me:9042: checking for initscr" >&5
9043 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9044 if test "${ac_cv_func_initscr+set}" = set; then
9045   echo $ECHO_N "(cached) $ECHO_C" >&6
9046 else
9047   cat >conftest.$ac_ext <<_ACEOF
9048 #line 9048 "configure"
9049 #include "confdefs.h"
9050 /* System header to define __stub macros and hopefully few prototypes,
9051     which can conflict with char initscr (); below.  */
9052 #include <assert.h>
9053 /* Override any gcc2 internal prototype to avoid an error.  */
9054 #ifdef __cplusplus
9055 extern "C"
9056 #endif
9057 /* We use char because int might match the return type of a gcc2
9058    builtin and then its argument prototype would still apply.  */
9059 char initscr ();
9060 char (*f) ();
9061
9062 int
9063 main (void)
9064 {
9065 /* The GNU C library defines this for functions which it implements
9066     to always fail with ENOSYS.  Some functions are actually named
9067     something starting with __ and the normal name is an alias.  */
9068 #if defined (__stub_initscr) || defined (__stub___initscr)
9069 choke me
9070 #else
9071 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9072 #endif
9073
9074   ;
9075   return 0;
9076 }
9077 _ACEOF
9078 rm -f conftest.$ac_objext conftest$ac_exeext
9079 if { (eval echo "$as_me:9079: \"$ac_link\"") >&5
9080   (eval $ac_link) 2>&5
9081   ac_status=$?
9082   echo "$as_me:9082: \$? = $ac_status" >&5
9083   (exit $ac_status); } &&
9084          { ac_try='test -s conftest$ac_exeext'
9085   { (eval echo "$as_me:9085: \"$ac_try\"") >&5
9086   (eval $ac_try) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit $ac_status); }; }; then
9090   ac_cv_func_initscr=yes
9091 else
9092   echo "$as_me: failed program was:" >&5
9093 cat conftest.$ac_ext >&5
9094 ac_cv_func_initscr=no
9095 fi
9096 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9097 fi
9098 echo "$as_me:9098: result: $ac_cv_func_initscr" >&5
9099 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9100 if test $ac_cv_func_initscr = yes; then
9101   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9102 else
9103
9104                 cf_save_LIBS="$LIBS"
9105                 echo "$as_me:9105: checking for initscr in -l$cf_nculib_root" >&5
9106 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9107                 LIBS="-l$cf_nculib_root $LIBS"
9108                 cat >conftest.$ac_ext <<_ACEOF
9109 #line 9109 "configure"
9110 #include "confdefs.h"
9111 #include <${cf_cv_ncurses_header:-curses.h}>
9112 int
9113 main (void)
9114 {
9115 initscr()
9116   ;
9117   return 0;
9118 }
9119 _ACEOF
9120 rm -f conftest.$ac_objext conftest$ac_exeext
9121 if { (eval echo "$as_me:9121: \"$ac_link\"") >&5
9122   (eval $ac_link) 2>&5
9123   ac_status=$?
9124   echo "$as_me:9124: \$? = $ac_status" >&5
9125   (exit $ac_status); } &&
9126          { ac_try='test -s conftest$ac_exeext'
9127   { (eval echo "$as_me:9127: \"$ac_try\"") >&5
9128   (eval $ac_try) 2>&5
9129   ac_status=$?
9130   echo "$as_me:9130: \$? = $ac_status" >&5
9131   (exit $ac_status); }; }; then
9132   echo "$as_me:9132: result: yes" >&5
9133 echo "${ECHO_T}yes" >&6
9134                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9135
9136 else
9137   echo "$as_me: failed program was:" >&5
9138 cat conftest.$ac_ext >&5
9139 echo "$as_me:9139: result: no" >&5
9140 echo "${ECHO_T}no" >&6
9141
9142 cf_search=
9143 cf_library_path_list=""
9144 if test -n "${LDFLAGS}${LIBS}" ; then
9145         for cf_library_path in $LDFLAGS $LIBS
9146         do
9147                 case $cf_library_path in
9148                 (-L*)
9149                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9150
9151 test "x$cf_library_path" != "xNONE" && \
9152 test -d "$cf_library_path" && \
9153  {
9154         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9155         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9156         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9157         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9158         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9159         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"
9160 }
9161
9162                         cf_library_path_list="$cf_library_path_list $cf_search"
9163                         ;;
9164                 esac
9165         done
9166 fi
9167
9168 cf_search=
9169
9170 test "x$prefix" != "xNONE" && \
9171 test -d "$prefix" && \
9172  {
9173         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9174         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9175         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9176         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9177         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9178         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9179 }
9180
9181 for cf_subdir_prefix in \
9182         /usr \
9183         /usr/local \
9184         /usr/pkg \
9185         /opt \
9186         /opt/local \
9187         $HOME
9188 do
9189
9190 test "x$cf_subdir_prefix" != "x$prefix" && \
9191 test -d "$cf_subdir_prefix" && \
9192 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9193         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9194         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9195         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9196         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9197         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9198         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"
9199 }
9200
9201 done
9202
9203 cf_search="$cf_library_path_list $cf_search"
9204
9205                         for cf_libdir in $cf_search
9206                         do
9207                                 echo "$as_me:9207: checking for -l$cf_nculib_root in $cf_libdir" >&5
9208 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9209                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9210                                 cat >conftest.$ac_ext <<_ACEOF
9211 #line 9211 "configure"
9212 #include "confdefs.h"
9213 #include <${cf_cv_ncurses_header:-curses.h}>
9214 int
9215 main (void)
9216 {
9217 initscr()
9218   ;
9219   return 0;
9220 }
9221 _ACEOF
9222 rm -f conftest.$ac_objext conftest$ac_exeext
9223 if { (eval echo "$as_me:9223: \"$ac_link\"") >&5
9224   (eval $ac_link) 2>&5
9225   ac_status=$?
9226   echo "$as_me:9226: \$? = $ac_status" >&5
9227   (exit $ac_status); } &&
9228          { ac_try='test -s conftest$ac_exeext'
9229   { (eval echo "$as_me:9229: \"$ac_try\"") >&5
9230   (eval $ac_try) 2>&5
9231   ac_status=$?
9232   echo "$as_me:9232: \$? = $ac_status" >&5
9233   (exit $ac_status); }; }; then
9234   echo "$as_me:9234: result: yes" >&5
9235 echo "${ECHO_T}yes" >&6
9236                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9237                                          break
9238 else
9239   echo "$as_me: failed program was:" >&5
9240 cat conftest.$ac_ext >&5
9241 echo "$as_me:9241: result: no" >&5
9242 echo "${ECHO_T}no" >&6
9243                                          LIBS="$cf_save_LIBS"
9244 fi
9245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9246                         done
9247
9248 fi
9249 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9250
9251 fi
9252
9253 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9254
9255 if test $cf_found_library = no ; then
9256         { { echo "$as_me:9256: error: Cannot link $cf_nculib_root library" >&5
9257 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9258    { (exit 1); exit 1; }; }
9259 fi
9260
9261 fi
9262
9263 if test -n "$cf_ncurses_LIBS" ; then
9264         echo "$as_me:9264: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9265 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9266         cf_ncurses_SAVE="$LIBS"
9267         for p in $cf_ncurses_LIBS ; do
9268                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9269                 if test "$q" != "$LIBS" ; then
9270                         LIBS="$q"
9271                 fi
9272         done
9273         cat >conftest.$ac_ext <<_ACEOF
9274 #line 9274 "configure"
9275 #include "confdefs.h"
9276 #include <${cf_cv_ncurses_header:-curses.h}>
9277 int
9278 main (void)
9279 {
9280 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9281   ;
9282   return 0;
9283 }
9284 _ACEOF
9285 rm -f conftest.$ac_objext conftest$ac_exeext
9286 if { (eval echo "$as_me:9286: \"$ac_link\"") >&5
9287   (eval $ac_link) 2>&5
9288   ac_status=$?
9289   echo "$as_me:9289: \$? = $ac_status" >&5
9290   (exit $ac_status); } &&
9291          { ac_try='test -s conftest$ac_exeext'
9292   { (eval echo "$as_me:9292: \"$ac_try\"") >&5
9293   (eval $ac_try) 2>&5
9294   ac_status=$?
9295   echo "$as_me:9295: \$? = $ac_status" >&5
9296   (exit $ac_status); }; }; then
9297   echo "$as_me:9297: result: yes" >&5
9298 echo "${ECHO_T}yes" >&6
9299 else
9300   echo "$as_me: failed program was:" >&5
9301 cat conftest.$ac_ext >&5
9302 echo "$as_me:9302: result: no" >&5
9303 echo "${ECHO_T}no" >&6
9304                  LIBS="$cf_ncurses_SAVE"
9305 fi
9306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9307 fi
9308
9309 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9310
9311 cat >>confdefs.h <<EOF
9312 #define $cf_nculib_ROOT 1
9313 EOF
9314
9315         fi
9316 else
9317         NCURSES_CONFIG=none
9318 fi
9319
9320 fi
9321
9322 if test "$NCURSES_CONFIG_PKG" != none ; then
9323         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
9324
9325         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9326         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9327         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9328
9329         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
9330         if test -z "$cf_cv_abi_version"
9331         then
9332                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
9333         fi
9334
9335 elif test "$NCURSES_CONFIG" != none ; then
9336
9337         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
9338
9339         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9340         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9341         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9342
9343         # ABI version is not available from headers
9344         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
9345
9346 else
9347
9348         for cf_name in MAJOR MINOR PATCH
9349         do
9350         cat >conftest.$ac_ext <<CF_EOF
9351         #include <${cf_cv_ncurses_header:-curses.h}>
9352         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
9353 CF_EOF
9354                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
9355                 { (eval echo "$as_me:9355: \"$cf_try\"") >&5
9356   (eval $cf_try) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); }
9360                 if test -f conftest.out ; then
9361                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
9362                         eval NCURSES_$cf_name=\"$cf_result\"
9363                         # cat conftest.$ac_ext
9364                         # cat conftest.out
9365                 fi
9366         done
9367
9368         cf_cv_abi_version=${NCURSES_MAJOR}
9369
9370 fi
9371
9372 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
9373
9374 cf_cv_timestamp=`date`
9375
9376 echo "$as_me:9376: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
9377 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
9378
9379 echo "$as_me:9379: checking if you want to have a library-prefix" >&5
9380 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
9381
9382 # Check whether --with-lib-prefix or --without-lib-prefix was given.
9383 if test "${with_lib_prefix+set}" = set; then
9384   withval="$with_lib_prefix"
9385   with_lib_prefix=$withval
9386 else
9387   with_lib_prefix=auto
9388 fi;
9389 echo "$as_me:9389: result: $with_lib_prefix" >&5
9390 echo "${ECHO_T}$with_lib_prefix" >&6
9391
9392 if test $with_lib_prefix = auto
9393 then
9394
9395         case $cf_cv_system_name in
9396         (OS/2*|os2*)
9397                 if test "$DFT_LWR_MODEL" = libtool; then
9398                         LIB_PREFIX='lib'
9399                 else
9400                         LIB_PREFIX=''
9401                 fi
9402                 ;;
9403         (*)     LIB_PREFIX='lib'
9404                 ;;
9405         esac
9406 cf_prefix=$LIB_PREFIX
9407
9408 elif test $with_lib_prefix = no
9409 then
9410         LIB_PREFIX=
9411 else
9412         LIB_PREFIX=$with_lib_prefix
9413 fi
9414
9415 LIB_SUFFIX=
9416
9417 ###############################################################################
9418
9419 if test X"$CC_G_OPT" = X"" ; then
9420         CC_G_OPT='-g'
9421         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
9422 fi
9423
9424 echo "$as_me:9424: checking for default loader flags" >&5
9425 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
9426 case $DFT_LWR_MODEL in
9427 (normal)  LD_MODEL=''   ;;
9428 (debug)   LD_MODEL=$CC_G_OPT ;;
9429 (profile) LD_MODEL='-pg';;
9430 (shared)  LD_MODEL=''   ;;
9431 esac
9432 echo "$as_me:9432: result: $LD_MODEL" >&5
9433 echo "${ECHO_T}$LD_MODEL" >&6
9434
9435 LD_RPATH_OPT=
9436 echo "$as_me:9436: checking for an rpath option" >&5
9437 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9438 case $cf_cv_system_name in
9439 (irix*)
9440         if test "$GCC" = yes; then
9441                 LD_RPATH_OPT="-Wl,-rpath,"
9442         else
9443                 LD_RPATH_OPT="-rpath "
9444         fi
9445         ;;
9446 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9447         LD_RPATH_OPT="-Wl,-rpath,"
9448         ;;
9449 (openbsd[2-9].*|mirbsd*)
9450         LD_RPATH_OPT="-Wl,-rpath,"
9451         ;;
9452 (dragonfly*)
9453         LD_RPATH_OPT="-rpath "
9454         ;;
9455 (netbsd*)
9456         LD_RPATH_OPT="-Wl,-rpath,"
9457         ;;
9458 (osf*|mls+*)
9459         LD_RPATH_OPT="-rpath "
9460         ;;
9461 (solaris2*)
9462         LD_RPATH_OPT="-R"
9463         ;;
9464 (*)
9465         ;;
9466 esac
9467 echo "$as_me:9467: result: $LD_RPATH_OPT" >&5
9468 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9469
9470 case "x$LD_RPATH_OPT" in
9471 (x-R*)
9472         echo "$as_me:9472: checking if we need a space after rpath option" >&5
9473 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9474         cf_save_LIBS="$LIBS"
9475
9476 cf_add_libs="${LD_RPATH_OPT}$libdir"
9477 # Filter out duplicates - this happens with badly-designed ".pc" files...
9478 for cf_add_1lib in $LIBS
9479 do
9480         for cf_add_2lib in $cf_add_libs
9481         do
9482                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9483                 then
9484                         cf_add_1lib=
9485                         break
9486                 fi
9487         done
9488         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9489 done
9490 LIBS="$cf_add_libs"
9491
9492         cat >conftest.$ac_ext <<_ACEOF
9493 #line 9493 "configure"
9494 #include "confdefs.h"
9495
9496 int
9497 main (void)
9498 {
9499
9500   ;
9501   return 0;
9502 }
9503 _ACEOF
9504 rm -f conftest.$ac_objext conftest$ac_exeext
9505 if { (eval echo "$as_me:9505: \"$ac_link\"") >&5
9506   (eval $ac_link) 2>&5
9507   ac_status=$?
9508   echo "$as_me:9508: \$? = $ac_status" >&5
9509   (exit $ac_status); } &&
9510          { ac_try='test -s conftest$ac_exeext'
9511   { (eval echo "$as_me:9511: \"$ac_try\"") >&5
9512   (eval $ac_try) 2>&5
9513   ac_status=$?
9514   echo "$as_me:9514: \$? = $ac_status" >&5
9515   (exit $ac_status); }; }; then
9516   cf_rpath_space=no
9517 else
9518   echo "$as_me: failed program was:" >&5
9519 cat conftest.$ac_ext >&5
9520 cf_rpath_space=yes
9521 fi
9522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9523         LIBS="$cf_save_LIBS"
9524         echo "$as_me:9524: result: $cf_rpath_space" >&5
9525 echo "${ECHO_T}$cf_rpath_space" >&6
9526         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9527         ;;
9528 esac
9529
9530         RM_SHARED_OPTS=
9531         LOCAL_LDFLAGS=
9532         LOCAL_LDFLAGS2=
9533         LD_SHARED_OPTS=
9534         INSTALL_LIB="-m 644"
9535         : ${rel_builddir:=.}
9536
9537         shlibdir=$libdir
9538
9539         MAKE_DLLS="#"
9540
9541         cf_cv_do_symlinks=no
9542         cf_ld_rpath_opt=
9543         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9544
9545         echo "$as_me:9545: checking if release/abi version should be used for shared libs" >&5
9546 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9547
9548 # Check whether --with-shlib-version or --without-shlib-version was given.
9549 if test "${with_shlib_version+set}" = set; then
9550   withval="$with_shlib_version"
9551   test -z "$withval" && withval=auto
9552         case $withval in
9553         (yes)
9554                 cf_cv_shlib_version=auto
9555                 ;;
9556         (rel|abi|auto)
9557                 cf_cv_shlib_version=$withval
9558                 ;;
9559         (*)
9560                 echo "$as_me:9560: result: $withval" >&5
9561 echo "${ECHO_T}$withval" >&6
9562                 { { echo "$as_me:9562: error: option value must be one of: rel, abi, or auto" >&5
9563 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9564    { (exit 1); exit 1; }; }
9565                 ;;
9566         esac
9567
9568 else
9569   cf_cv_shlib_version=auto
9570 fi;
9571         echo "$as_me:9571: result: $cf_cv_shlib_version" >&5
9572 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9573
9574         cf_cv_rm_so_locs=no
9575         cf_try_cflags=
9576
9577         # Some less-capable ports of gcc support only -fpic
9578         CC_SHARED_OPTS=
9579
9580         cf_try_fPIC=no
9581         if test "$GCC" = yes
9582         then
9583                 cf_try_fPIC=yes
9584         else
9585                 case $cf_cv_system_name in
9586                 (*linux*)       # e.g., PGI compiler
9587                         cf_try_fPIC=yes
9588                         ;;
9589                 esac
9590         fi
9591
9592         if test "$cf_try_fPIC" = yes
9593         then
9594                 echo "$as_me:9594: checking which $CC option to use" >&5
9595 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9596                 cf_save_CFLAGS="$CFLAGS"
9597                 for CC_SHARED_OPTS in -fPIC -fpic ''
9598                 do
9599                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9600                         cat >conftest.$ac_ext <<_ACEOF
9601 #line 9601 "configure"
9602 #include "confdefs.h"
9603 #include <stdio.h>
9604 int
9605 main (void)
9606 {
9607 int x = 1
9608   ;
9609   return 0;
9610 }
9611 _ACEOF
9612 rm -f conftest.$ac_objext
9613 if { (eval echo "$as_me:9613: \"$ac_compile\"") >&5
9614   (eval $ac_compile) 2>&5
9615   ac_status=$?
9616   echo "$as_me:9616: \$? = $ac_status" >&5
9617   (exit $ac_status); } &&
9618          { ac_try='test -s conftest.$ac_objext'
9619   { (eval echo "$as_me:9619: \"$ac_try\"") >&5
9620   (eval $ac_try) 2>&5
9621   ac_status=$?
9622   echo "$as_me:9622: \$? = $ac_status" >&5
9623   (exit $ac_status); }; }; then
9624   break
9625 else
9626   echo "$as_me: failed program was:" >&5
9627 cat conftest.$ac_ext >&5
9628 fi
9629 rm -f conftest.$ac_objext conftest.$ac_ext
9630                 done
9631                 echo "$as_me:9631: result: $CC_SHARED_OPTS" >&5
9632 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9633                 CFLAGS="$cf_save_CFLAGS"
9634         fi
9635
9636         cf_cv_shlib_version_infix=no
9637
9638         case $cf_cv_system_name in
9639         (aix4.3-9*|aix[5-7]*)
9640                 if test "$GCC" = yes; then
9641                         CC_SHARED_OPTS='-Wl,-brtl'
9642                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9643                 else
9644                         CC_SHARED_OPTS='-brtl'
9645                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9646                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9647                 fi
9648                 ;;
9649         (beos*)
9650                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9651                 ;;
9652         (cygwin*)
9653                 CC_SHARED_OPTS=
9654                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9655                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9656                 cf_cv_shlib_version=cygdll
9657                 cf_cv_shlib_version_infix=cygdll
9658                 shlibdir=$bindir
9659                 MAKE_DLLS=
9660                 cat >mk_shared_lib.sh <<-CF_EOF
9661                 #!$SHELL
9662                 SHARED_LIB=\$1
9663                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9664                 shift
9665                 cat <<-EOF
9666                 Linking shared library
9667                 ** SHARED_LIB \$SHARED_LIB
9668                 ** IMPORT_LIB \$IMPORT_LIB
9669 EOF
9670                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9671 CF_EOF
9672                 chmod +x mk_shared_lib.sh
9673                 ;;
9674         (msys*)
9675                 CC_SHARED_OPTS=
9676                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9677                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9678                 cf_cv_shlib_version=msysdll
9679                 cf_cv_shlib_version_infix=msysdll
9680                 shlibdir=$bindir
9681                 MAKE_DLLS=
9682                 cat >mk_shared_lib.sh <<-CF_EOF
9683                 #!$SHELL
9684                 SHARED_LIB=\$1
9685                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9686                 shift
9687                 cat <<-EOF
9688                 Linking shared library
9689                 ** SHARED_LIB \$SHARED_LIB
9690                 ** IMPORT_LIB \$IMPORT_LIB
9691 EOF
9692                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9693 CF_EOF
9694                 chmod +x mk_shared_lib.sh
9695                 ;;
9696         (darwin*)
9697                 cf_try_cflags="no-cpp-precomp"
9698                 CC_SHARED_OPTS="-dynamic"
9699                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9700                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9701                 cf_cv_shlib_version_infix=yes
9702                 echo "$as_me:9702: checking if ld -search_paths_first works" >&5
9703 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9704 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9705   echo $ECHO_N "(cached) $ECHO_C" >&6
9706 else
9707
9708                         cf_save_LDFLAGS=$LDFLAGS
9709                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9710                         cat >conftest.$ac_ext <<_ACEOF
9711 #line 9711 "configure"
9712 #include "confdefs.h"
9713
9714 int
9715 main (void)
9716 {
9717 int i;
9718   ;
9719   return 0;
9720 }
9721 _ACEOF
9722 rm -f conftest.$ac_objext conftest$ac_exeext
9723 if { (eval echo "$as_me:9723: \"$ac_link\"") >&5
9724   (eval $ac_link) 2>&5
9725   ac_status=$?
9726   echo "$as_me:9726: \$? = $ac_status" >&5
9727   (exit $ac_status); } &&
9728          { ac_try='test -s conftest$ac_exeext'
9729   { (eval echo "$as_me:9729: \"$ac_try\"") >&5
9730   (eval $ac_try) 2>&5
9731   ac_status=$?
9732   echo "$as_me:9732: \$? = $ac_status" >&5
9733   (exit $ac_status); }; }; then
9734   cf_cv_ldflags_search_paths_first=yes
9735 else
9736   echo "$as_me: failed program was:" >&5
9737 cat conftest.$ac_ext >&5
9738 cf_cv_ldflags_search_paths_first=no
9739 fi
9740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9741                                 LDFLAGS=$cf_save_LDFLAGS
9742 fi
9743 echo "$as_me:9743: result: $cf_cv_ldflags_search_paths_first" >&5
9744 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9745                 if test $cf_cv_ldflags_search_paths_first = yes; then
9746                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9747                 fi
9748                 ;;
9749         (hpux[7-8]*)
9750                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9751                 if test "$GCC" != yes; then
9752                         CC_SHARED_OPTS='+Z'
9753                 fi
9754                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
9755                 INSTALL_LIB="-m 555"
9756                 ;;
9757         (hpux*)
9758                 # (tested with gcc 2.7.2 -- I don't have c89)
9759                 if test "$GCC" = yes; then
9760                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9761                 else
9762                         CC_SHARED_OPTS='+Z'
9763                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9764                 fi
9765                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
9766                 # HP-UX shared libraries must be executable, and should be
9767                 # readonly to exploit a quirk in the memory manager.
9768                 INSTALL_LIB="-m 555"
9769                 ;;
9770         (interix*)
9771                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9772                 if test "$cf_cv_shlib_version" = rel; then
9773                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9774                 else
9775                         cf_shared_soname='`basename $@`'
9776                 fi
9777                 CC_SHARED_OPTS=
9778                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
9779                 ;;
9780         (irix*)
9781                 if test "$cf_cv_enable_rpath" = yes ; then
9782                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9783                 fi
9784                 # tested with IRIX 5.2 and 'cc'.
9785                 if test "$GCC" != yes; then
9786                         CC_SHARED_OPTS='-KPIC'
9787                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
9788                 else
9789                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
9790                 fi
9791                 cf_cv_rm_so_locs=yes
9792                 ;;
9793         (linux*|gnu*|k*bsd*-gnu)
9794                 if test "$DFT_LWR_MODEL" = "shared" ; then
9795                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9796                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9797                 fi
9798                 if test "$cf_cv_enable_rpath" = yes ; then
9799                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9800                 fi
9801
9802         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9803         if test "$cf_cv_shlib_version" = rel; then
9804                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9805         else
9806                 cf_cv_shared_soname='`basename $@`'
9807         fi
9808
9809                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9810                 ;;
9811         (mingw*)
9812                 cf_cv_shlib_version=mingw
9813                 cf_cv_shlib_version_infix=mingw
9814                 shlibdir=$bindir
9815                 MAKE_DLLS=
9816                 if test "$DFT_LWR_MODEL" = "shared" ; then
9817                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9818                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9819                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9820                 fi
9821                 CC_SHARED_OPTS=
9822                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9823                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9824                 cat >mk_shared_lib.sh <<-CF_EOF
9825                 #!$SHELL
9826                 SHARED_LIB=\$1
9827                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9828                 shift
9829                 cat <<-EOF
9830                 Linking shared library
9831                 ** SHARED_LIB \$SHARED_LIB
9832                 ** IMPORT_LIB \$IMPORT_LIB
9833 EOF
9834                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9835 CF_EOF
9836                 chmod +x mk_shared_lib.sh
9837                 ;;
9838         (openbsd[2-9].*|mirbsd*)
9839                 if test "$DFT_LWR_MODEL" = "shared" ; then
9840                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9841                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9842                 fi
9843                 if test "$cf_cv_enable_rpath" = yes ; then
9844                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9845                 fi
9846                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9847
9848         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9849         if test "$cf_cv_shlib_version" = rel; then
9850                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9851         else
9852                 cf_cv_shared_soname='`basename $@`'
9853         fi
9854
9855                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9856                 ;;
9857         (nto-qnx*|openbsd*|freebsd[12].*)
9858                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9859                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
9860                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9861                 ;;
9862         (dragonfly*|freebsd*)
9863                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9864                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9865                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9866                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9867                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9868                 fi
9869
9870         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9871         if test "$cf_cv_shlib_version" = rel; then
9872                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9873         else
9874                 cf_cv_shared_soname='`basename $@`'
9875         fi
9876
9877                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9878                 ;;
9879         (netbsd*)
9880                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9881                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9882                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9883                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9884                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9885                         if test "$cf_cv_shlib_version" = auto; then
9886                         if test -f /usr/libexec/ld.elf_so; then
9887                                 cf_cv_shlib_version=abi
9888                         else
9889                                 cf_cv_shlib_version=rel
9890                         fi
9891                         fi
9892
9893         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9894         if test "$cf_cv_shlib_version" = rel; then
9895                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9896         else
9897                 cf_cv_shared_soname='`basename $@`'
9898         fi
9899
9900                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9901                 else
9902                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
9903                 fi
9904                 ;;
9905         (osf*|mls+*)
9906                 # tested with OSF/1 V3.2 and 'cc'
9907                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9908                 # link with shared libs).
9909                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9910                 case $host_os in
9911                 (osf4*)
9912                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9913                         ;;
9914                 esac
9915                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9916                 if test "$DFT_LWR_MODEL" = "shared" ; then
9917                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9918                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9919                 fi
9920                 cf_cv_rm_so_locs=yes
9921                 ;;
9922         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9923                 # tested with osr5.0.5
9924                 if test "$GCC" != yes; then
9925                         CC_SHARED_OPTS='-belf -KPIC'
9926                 fi
9927                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9928                 if test "$cf_cv_enable_rpath" = yes ; then
9929                         # only way is to set LD_RUN_PATH but no switch for it
9930                         RUN_PATH=$libdir
9931                 fi
9932                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9933                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9934                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9935                 ;;
9936         (sunos4*)
9937                 # tested with SunOS 4.1.1 and gcc 2.7.0
9938                 if test "$GCC" != yes; then
9939                         CC_SHARED_OPTS='-KPIC'
9940                 fi
9941                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
9942                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9943                 ;;
9944         (solaris2*)
9945                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9946                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9947                 if test "$DFT_LWR_MODEL" = "shared" ; then
9948                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9949                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9950                 fi
9951                 if test "$cf_cv_enable_rpath" = yes ; then
9952                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9953                 fi
9954
9955         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9956         if test "$cf_cv_shlib_version" = rel; then
9957                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9958         else
9959                 cf_cv_shared_soname='`basename $@`'
9960         fi
9961
9962                 if test "$GCC" != yes; then
9963                         cf_save_CFLAGS="$CFLAGS"
9964                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9965                         do
9966                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9967                                 cat >conftest.$ac_ext <<_ACEOF
9968 #line 9968 "configure"
9969 #include "confdefs.h"
9970 #include <stdio.h>
9971 int
9972 main (void)
9973 {
9974 printf("Hello\n");
9975   ;
9976   return 0;
9977 }
9978 _ACEOF
9979 rm -f conftest.$ac_objext
9980 if { (eval echo "$as_me:9980: \"$ac_compile\"") >&5
9981   (eval $ac_compile) 2>&5
9982   ac_status=$?
9983   echo "$as_me:9983: \$? = $ac_status" >&5
9984   (exit $ac_status); } &&
9985          { ac_try='test -s conftest.$ac_objext'
9986   { (eval echo "$as_me:9986: \"$ac_try\"") >&5
9987   (eval $ac_try) 2>&5
9988   ac_status=$?
9989   echo "$as_me:9989: \$? = $ac_status" >&5
9990   (exit $ac_status); }; }; then
9991   break
9992 else
9993   echo "$as_me: failed program was:" >&5
9994 cat conftest.$ac_ext >&5
9995 fi
9996 rm -f conftest.$ac_objext conftest.$ac_ext
9997                         done
9998                         CFLAGS="$cf_save_CFLAGS"
9999                         CC_SHARED_OPTS=$cf_shared_opts
10000                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
10001                 else
10002                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
10003                 fi
10004                 ;;
10005         (sysv5uw7*|unix_sv*)
10006                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10007                 if test "$GCC" != yes; then
10008                         CC_SHARED_OPTS='-KPIC'
10009                 fi
10010                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10011                 ;;
10012         (*)
10013                 CC_SHARED_OPTS='unknown'
10014                 MK_SHARED_LIB='echo unknown'
10015                 ;;
10016         esac
10017
10018         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10019         case "$cf_cv_shlib_version" in
10020         (rel|abi)
10021                 case "$MK_SHARED_LIB" in
10022                 (*'-o $@')
10023                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10024                         ;;
10025                 (*)
10026                         { echo "$as_me:10026: WARNING: ignored --with-shlib-version" >&5
10027 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10028                         ;;
10029                 esac
10030                 ;;
10031         esac
10032
10033         if test -n "$cf_try_cflags"
10034         then
10035 cat > conftest.$ac_ext <<EOF
10036 #line 10036 "${as_me:-configure}"
10037 #include <stdio.h>
10038 int main(int argc, char *argv[])
10039 {
10040         printf("hello\n");
10041         return (argv[argc-1] == 0) ;
10042 }
10043 EOF
10044                 cf_save_CFLAGS="$CFLAGS"
10045                 for cf_opt in $cf_try_cflags
10046                 do
10047                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10048                         echo "$as_me:10048: checking if CFLAGS option -$cf_opt works" >&5
10049 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10050                         if { (eval echo "$as_me:10050: \"$ac_compile\"") >&5
10051   (eval $ac_compile) 2>&5
10052   ac_status=$?
10053   echo "$as_me:10053: \$? = $ac_status" >&5
10054   (exit $ac_status); }; then
10055                                 echo "$as_me:10055: result: yes" >&5
10056 echo "${ECHO_T}yes" >&6
10057                                 cf_save_CFLAGS="$CFLAGS"
10058                         else
10059                                 echo "$as_me:10059: result: no" >&5
10060 echo "${ECHO_T}no" >&6
10061                         fi
10062                 done
10063                 CFLAGS="$cf_save_CFLAGS"
10064         fi
10065
10066         # RPATH_LIST is a colon-separated list of directories
10067         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10068         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10069
10070         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10071
10072         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10073
10074 echo "${as_me:-configure}:10074: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10075
10076         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10077
10078 echo "${as_me:-configure}:10078: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10079
10080 # The test/sample programs in the original tree link using rpath option.
10081 # Make it optional for packagers.
10082 if test -n "$LOCAL_LDFLAGS"
10083 then
10084         echo "$as_me:10084: checking if you want to link sample programs with rpath option" >&5
10085 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10086
10087 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10088 if test "${enable_rpath_link+set}" = set; then
10089   enableval="$enable_rpath_link"
10090   with_rpath_link=$enableval
10091 else
10092   with_rpath_link=yes
10093 fi;
10094         echo "$as_me:10094: result: $with_rpath_link" >&5
10095 echo "${ECHO_T}$with_rpath_link" >&6
10096         if test "$with_rpath_link" = no
10097         then
10098                 LOCAL_LDFLAGS=
10099                 LOCAL_LDFLAGS2=
10100         fi
10101 fi
10102
10103 ###############################################################################
10104
10105 ###   use option --enable-broken-linker to force on use of broken-linker support
10106 echo "$as_me:10106: checking if you want broken-linker support code" >&5
10107 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10108
10109 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10110 if test "${enable_broken_linker+set}" = set; then
10111   enableval="$enable_broken_linker"
10112   with_broken_linker=$enableval
10113 else
10114   with_broken_linker=${BROKEN_LINKER:-no}
10115 fi;
10116 echo "$as_me:10116: result: $with_broken_linker" >&5
10117 echo "${ECHO_T}$with_broken_linker" >&6
10118
10119 BROKEN_LINKER=0
10120 if test "$with_broken_linker" = yes ; then
10121         cat >>confdefs.h <<\EOF
10122 #define BROKEN_LINKER 1
10123 EOF
10124
10125         BROKEN_LINKER=1
10126 elif test "$DFT_LWR_MODEL" = shared ; then
10127         case $cf_cv_system_name in
10128         (cygwin*)
10129                 cat >>confdefs.h <<\EOF
10130 #define BROKEN_LINKER 1
10131 EOF
10132
10133                 BROKEN_LINKER=1
10134                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
10135
10136 echo "${as_me:-configure}:10136: testing cygwin linker is broken anyway ..." 1>&5
10137
10138                 ;;
10139         esac
10140 fi
10141
10142 # Check to define _XOPEN_SOURCE "automatically"
10143
10144 cf_XOPEN_SOURCE=600
10145 cf_POSIX_C_SOURCE=199506L
10146 cf_xopen_source=
10147
10148 case $host_os in
10149 (aix[4-7]*)
10150         cf_xopen_source="-D_ALL_SOURCE"
10151         ;;
10152 (msys)
10153         cf_XOPEN_SOURCE=600
10154         ;;
10155 (darwin[0-8].*)
10156         cf_xopen_source="-D_APPLE_C_SOURCE"
10157         ;;
10158 (darwin*)
10159         cf_xopen_source="-D_DARWIN_C_SOURCE"
10160         cf_XOPEN_SOURCE=
10161         ;;
10162 (freebsd*|dragonfly*)
10163         # 5.x headers associate
10164         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10165         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10166         cf_POSIX_C_SOURCE=200112L
10167         cf_XOPEN_SOURCE=600
10168         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10169         ;;
10170 (hpux11*)
10171         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10172         ;;
10173 (hpux*)
10174         cf_xopen_source="-D_HPUX_SOURCE"
10175         ;;
10176 (irix[56].*)
10177         cf_xopen_source="-D_SGI_SOURCE"
10178         cf_XOPEN_SOURCE=
10179         ;;
10180 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10181
10182 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
10183
10184 echo "$as_me:10184: checking if this is the GNU C library" >&5
10185 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
10186 if test "${cf_cv_gnu_library+set}" = set; then
10187   echo $ECHO_N "(cached) $ECHO_C" >&6
10188 else
10189
10190 cat >conftest.$ac_ext <<_ACEOF
10191 #line 10191 "configure"
10192 #include "confdefs.h"
10193 #include <sys/types.h>
10194 int
10195 main (void)
10196 {
10197
10198         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
10199                 return 0;
10200         #else
10201         #       error not GNU C library
10202         #endif
10203   ;
10204   return 0;
10205 }
10206 _ACEOF
10207 rm -f conftest.$ac_objext
10208 if { (eval echo "$as_me:10208: \"$ac_compile\"") >&5
10209   (eval $ac_compile) 2>&5
10210   ac_status=$?
10211   echo "$as_me:10211: \$? = $ac_status" >&5
10212   (exit $ac_status); } &&
10213          { ac_try='test -s conftest.$ac_objext'
10214   { (eval echo "$as_me:10214: \"$ac_try\"") >&5
10215   (eval $ac_try) 2>&5
10216   ac_status=$?
10217   echo "$as_me:10217: \$? = $ac_status" >&5
10218   (exit $ac_status); }; }; then
10219   cf_cv_gnu_library=yes
10220 else
10221   echo "$as_me: failed program was:" >&5
10222 cat conftest.$ac_ext >&5
10223 cf_cv_gnu_library=no
10224 fi
10225 rm -f conftest.$ac_objext conftest.$ac_ext
10226
10227 fi
10228 echo "$as_me:10228: result: $cf_cv_gnu_library" >&5
10229 echo "${ECHO_T}$cf_cv_gnu_library" >&6
10230
10231 if test x$cf_cv_gnu_library = xyes; then
10232
10233         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
10234         # was changed to help a little...
10235         echo "$as_me:10235: checking if _DEFAULT_SOURCE can be used as a basis" >&5
10236 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
10237 if test "${cf_cv_gnu_library_219+set}" = set; then
10238   echo $ECHO_N "(cached) $ECHO_C" >&6
10239 else
10240
10241                 cf_save="$CPPFLAGS"
10242                 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
10243                 cat >conftest.$ac_ext <<_ACEOF
10244 #line 10244 "configure"
10245 #include "confdefs.h"
10246 #include <sys/types.h>
10247 int
10248 main (void)
10249 {
10250
10251                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
10252                                 return 0;
10253                         #else
10254                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
10255                         #endif
10256   ;
10257   return 0;
10258 }
10259 _ACEOF
10260 rm -f conftest.$ac_objext
10261 if { (eval echo "$as_me:10261: \"$ac_compile\"") >&5
10262   (eval $ac_compile) 2>&5
10263   ac_status=$?
10264   echo "$as_me:10264: \$? = $ac_status" >&5
10265   (exit $ac_status); } &&
10266          { ac_try='test -s conftest.$ac_objext'
10267   { (eval echo "$as_me:10267: \"$ac_try\"") >&5
10268   (eval $ac_try) 2>&5
10269   ac_status=$?
10270   echo "$as_me:10270: \$? = $ac_status" >&5
10271   (exit $ac_status); }; }; then
10272   cf_cv_gnu_library_219=yes
10273 else
10274   echo "$as_me: failed program was:" >&5
10275 cat conftest.$ac_ext >&5
10276 cf_cv_gnu_library_219=no
10277 fi
10278 rm -f conftest.$ac_objext conftest.$ac_ext
10279                 CPPFLAGS="$cf_save"
10280
10281 fi
10282 echo "$as_me:10282: result: $cf_cv_gnu_library_219" >&5
10283 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
10284
10285         if test "x$cf_cv_gnu_library_219" = xyes; then
10286                 echo "$as_me:10286: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
10287 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
10288 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
10289   echo $ECHO_N "(cached) $ECHO_C" >&6
10290 else
10291
10292                         cf_save="$CPPFLAGS"
10293                         CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source"
10294                         cat >conftest.$ac_ext <<_ACEOF
10295 #line 10295 "configure"
10296 #include "confdefs.h"
10297
10298                                 #include <limits.h>
10299                                 #include <sys/types.h>
10300
10301 int
10302 main (void)
10303 {
10304
10305                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
10306                                         return 0;
10307                                 #else
10308                                 #       error GNU C library is too old
10309                                 #endif
10310   ;
10311   return 0;
10312 }
10313 _ACEOF
10314 rm -f conftest.$ac_objext
10315 if { (eval echo "$as_me:10315: \"$ac_compile\"") >&5
10316   (eval $ac_compile) 2>&5
10317   ac_status=$?
10318   echo "$as_me:10318: \$? = $ac_status" >&5
10319   (exit $ac_status); } &&
10320          { ac_try='test -s conftest.$ac_objext'
10321   { (eval echo "$as_me:10321: \"$ac_try\"") >&5
10322   (eval $ac_try) 2>&5
10323   ac_status=$?
10324   echo "$as_me:10324: \$? = $ac_status" >&5
10325   (exit $ac_status); }; }; then
10326   cf_cv_gnu_dftsrc_219=yes
10327 else
10328   echo "$as_me: failed program was:" >&5
10329 cat conftest.$ac_ext >&5
10330 cf_cv_gnu_dftsrc_219=no
10331 fi
10332 rm -f conftest.$ac_objext conftest.$ac_ext
10333
10334 fi
10335 echo "$as_me:10335: result: $cf_cv_gnu_dftsrc_219" >&5
10336 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
10337                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
10338         else
10339                 cf_cv_gnu_dftsrc_219=maybe
10340         fi
10341
10342         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
10343
10344                 echo "$as_me:10344: checking if we must define _GNU_SOURCE" >&5
10345 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
10346 if test "${cf_cv_gnu_source+set}" = set; then
10347   echo $ECHO_N "(cached) $ECHO_C" >&6
10348 else
10349
10350                 cat >conftest.$ac_ext <<_ACEOF
10351 #line 10351 "configure"
10352 #include "confdefs.h"
10353 #include <sys/types.h>
10354 int
10355 main (void)
10356 {
10357
10358                         #ifndef _XOPEN_SOURCE
10359                         #error  expected _XOPEN_SOURCE to be defined
10360                         #endif
10361   ;
10362   return 0;
10363 }
10364 _ACEOF
10365 rm -f conftest.$ac_objext
10366 if { (eval echo "$as_me:10366: \"$ac_compile\"") >&5
10367   (eval $ac_compile) 2>&5
10368   ac_status=$?
10369   echo "$as_me:10369: \$? = $ac_status" >&5
10370   (exit $ac_status); } &&
10371          { ac_try='test -s conftest.$ac_objext'
10372   { (eval echo "$as_me:10372: \"$ac_try\"") >&5
10373   (eval $ac_try) 2>&5
10374   ac_status=$?
10375   echo "$as_me:10375: \$? = $ac_status" >&5
10376   (exit $ac_status); }; }; then
10377   cf_cv_gnu_source=no
10378 else
10379   echo "$as_me: failed program was:" >&5
10380 cat conftest.$ac_ext >&5
10381 cf_save="$CPPFLAGS"
10382                          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10383                          cat >conftest.$ac_ext <<_ACEOF
10384 #line 10384 "configure"
10385 #include "confdefs.h"
10386 #include <sys/types.h>
10387 int
10388 main (void)
10389 {
10390
10391                                 #ifdef _XOPEN_SOURCE
10392                                 #error  expected _XOPEN_SOURCE to be undefined
10393                                 #endif
10394   ;
10395   return 0;
10396 }
10397 _ACEOF
10398 rm -f conftest.$ac_objext
10399 if { (eval echo "$as_me:10399: \"$ac_compile\"") >&5
10400   (eval $ac_compile) 2>&5
10401   ac_status=$?
10402   echo "$as_me:10402: \$? = $ac_status" >&5
10403   (exit $ac_status); } &&
10404          { ac_try='test -s conftest.$ac_objext'
10405   { (eval echo "$as_me:10405: \"$ac_try\"") >&5
10406   (eval $ac_try) 2>&5
10407   ac_status=$?
10408   echo "$as_me:10408: \$? = $ac_status" >&5
10409   (exit $ac_status); }; }; then
10410   cf_cv_gnu_source=no
10411 else
10412   echo "$as_me: failed program was:" >&5
10413 cat conftest.$ac_ext >&5
10414 cf_cv_gnu_source=yes
10415 fi
10416 rm -f conftest.$ac_objext conftest.$ac_ext
10417                         CPPFLAGS="$cf_save"
10418
10419 fi
10420 rm -f conftest.$ac_objext conftest.$ac_ext
10421
10422 fi
10423 echo "$as_me:10423: result: $cf_cv_gnu_source" >&5
10424 echo "${ECHO_T}$cf_cv_gnu_source" >&6
10425
10426                 if test "$cf_cv_gnu_source" = yes
10427                 then
10428                 echo "$as_me:10428: checking if we should also define _DEFAULT_SOURCE" >&5
10429 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
10430 if test "${cf_cv_default_source+set}" = set; then
10431   echo $ECHO_N "(cached) $ECHO_C" >&6
10432 else
10433
10434                         CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10435                         cat >conftest.$ac_ext <<_ACEOF
10436 #line 10436 "configure"
10437 #include "confdefs.h"
10438 #include <sys/types.h>
10439 int
10440 main (void)
10441 {
10442
10443                                 #ifdef _DEFAULT_SOURCE
10444                                 #error  expected _DEFAULT_SOURCE to be undefined
10445                                 #endif
10446   ;
10447   return 0;
10448 }
10449 _ACEOF
10450 rm -f conftest.$ac_objext
10451 if { (eval echo "$as_me:10451: \"$ac_compile\"") >&5
10452   (eval $ac_compile) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); } &&
10456          { ac_try='test -s conftest.$ac_objext'
10457   { (eval echo "$as_me:10457: \"$ac_try\"") >&5
10458   (eval $ac_try) 2>&5
10459   ac_status=$?
10460   echo "$as_me:10460: \$? = $ac_status" >&5
10461   (exit $ac_status); }; }; then
10462   cf_cv_default_source=no
10463 else
10464   echo "$as_me: failed program was:" >&5
10465 cat conftest.$ac_ext >&5
10466 cf_cv_default_source=yes
10467 fi
10468 rm -f conftest.$ac_objext conftest.$ac_ext
10469
10470 fi
10471 echo "$as_me:10471: result: $cf_cv_default_source" >&5
10472 echo "${ECHO_T}$cf_cv_default_source" >&6
10473                         test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
10474                 fi
10475         fi
10476
10477 fi
10478
10479         ;;
10480 (minix*)
10481         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
10482         ;;
10483 (mirbsd*)
10484         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
10485         cf_XOPEN_SOURCE=
10486
10487 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10488
10489 cf_save_CFLAGS="$CFLAGS"
10490 cf_save_CPPFLAGS="$CPPFLAGS"
10491
10492 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10493         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10494                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10495
10496 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10497         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10498                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10499
10500 echo "$as_me:10500: checking if we should define _POSIX_C_SOURCE" >&5
10501 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10502 if test "${cf_cv_posix_c_source+set}" = set; then
10503   echo $ECHO_N "(cached) $ECHO_C" >&6
10504 else
10505
10506 echo "${as_me:-configure}:10506: testing if the symbol is already defined go no further ..." 1>&5
10507
10508         cat >conftest.$ac_ext <<_ACEOF
10509 #line 10509 "configure"
10510 #include "confdefs.h"
10511 #include <sys/types.h>
10512 int
10513 main (void)
10514 {
10515
10516 #ifndef _POSIX_C_SOURCE
10517 make an error
10518 #endif
10519   ;
10520   return 0;
10521 }
10522 _ACEOF
10523 rm -f conftest.$ac_objext
10524 if { (eval echo "$as_me:10524: \"$ac_compile\"") >&5
10525   (eval $ac_compile) 2>&5
10526   ac_status=$?
10527   echo "$as_me:10527: \$? = $ac_status" >&5
10528   (exit $ac_status); } &&
10529          { ac_try='test -s conftest.$ac_objext'
10530   { (eval echo "$as_me:10530: \"$ac_try\"") >&5
10531   (eval $ac_try) 2>&5
10532   ac_status=$?
10533   echo "$as_me:10533: \$? = $ac_status" >&5
10534   (exit $ac_status); }; }; then
10535   cf_cv_posix_c_source=no
10536 else
10537   echo "$as_me: failed program was:" >&5
10538 cat conftest.$ac_ext >&5
10539 cf_want_posix_source=no
10540          case .$cf_POSIX_C_SOURCE in
10541          (.[12]??*)
10542                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10543                 ;;
10544          (.2)
10545                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10546                 cf_want_posix_source=yes
10547                 ;;
10548          (.*)
10549                 cf_want_posix_source=yes
10550                 ;;
10551          esac
10552          if test "$cf_want_posix_source" = yes ; then
10553                 cat >conftest.$ac_ext <<_ACEOF
10554 #line 10554 "configure"
10555 #include "confdefs.h"
10556 #include <sys/types.h>
10557 int
10558 main (void)
10559 {
10560
10561 #ifdef _POSIX_SOURCE
10562 make an error
10563 #endif
10564   ;
10565   return 0;
10566 }
10567 _ACEOF
10568 rm -f conftest.$ac_objext
10569 if { (eval echo "$as_me:10569: \"$ac_compile\"") >&5
10570   (eval $ac_compile) 2>&5
10571   ac_status=$?
10572   echo "$as_me:10572: \$? = $ac_status" >&5
10573   (exit $ac_status); } &&
10574          { ac_try='test -s conftest.$ac_objext'
10575   { (eval echo "$as_me:10575: \"$ac_try\"") >&5
10576   (eval $ac_try) 2>&5
10577   ac_status=$?
10578   echo "$as_me:10578: \$? = $ac_status" >&5
10579   (exit $ac_status); }; }; then
10580   :
10581 else
10582   echo "$as_me: failed program was:" >&5
10583 cat conftest.$ac_ext >&5
10584 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10585 fi
10586 rm -f conftest.$ac_objext conftest.$ac_ext
10587          fi
10588
10589 echo "${as_me:-configure}:10589: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10590
10591          CFLAGS="$cf_trim_CFLAGS"
10592          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10593
10594 echo "${as_me:-configure}:10594: testing if the second compile does not leave our definition intact error ..." 1>&5
10595
10596          cat >conftest.$ac_ext <<_ACEOF
10597 #line 10597 "configure"
10598 #include "confdefs.h"
10599 #include <sys/types.h>
10600 int
10601 main (void)
10602 {
10603
10604 #ifndef _POSIX_C_SOURCE
10605 make an error
10606 #endif
10607   ;
10608   return 0;
10609 }
10610 _ACEOF
10611 rm -f conftest.$ac_objext
10612 if { (eval echo "$as_me:10612: \"$ac_compile\"") >&5
10613   (eval $ac_compile) 2>&5
10614   ac_status=$?
10615   echo "$as_me:10615: \$? = $ac_status" >&5
10616   (exit $ac_status); } &&
10617          { ac_try='test -s conftest.$ac_objext'
10618   { (eval echo "$as_me:10618: \"$ac_try\"") >&5
10619   (eval $ac_try) 2>&5
10620   ac_status=$?
10621   echo "$as_me:10621: \$? = $ac_status" >&5
10622   (exit $ac_status); }; }; then
10623   :
10624 else
10625   echo "$as_me: failed program was:" >&5
10626 cat conftest.$ac_ext >&5
10627 cf_cv_posix_c_source=no
10628 fi
10629 rm -f conftest.$ac_objext conftest.$ac_ext
10630          CFLAGS="$cf_save_CFLAGS"
10631          CPPFLAGS="$cf_save_CPPFLAGS"
10632
10633 fi
10634 rm -f conftest.$ac_objext conftest.$ac_ext
10635
10636 fi
10637 echo "$as_me:10637: result: $cf_cv_posix_c_source" >&5
10638 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10639
10640 if test "$cf_cv_posix_c_source" != no ; then
10641         CFLAGS="$cf_trim_CFLAGS"
10642         CPPFLAGS="$cf_trim_CPPFLAGS"
10643
10644 cf_fix_cppflags=no
10645 cf_new_cflags=
10646 cf_new_cppflags=
10647 cf_new_extra_cppflags=
10648
10649 for cf_add_cflags in $cf_cv_posix_c_source
10650 do
10651 case $cf_fix_cppflags in
10652 (no)
10653         case $cf_add_cflags in
10654         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10655                 case $cf_add_cflags in
10656                 (-D*)
10657                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10658
10659                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10660                                 && test -z "${cf_tst_cflags}" \
10661                                 && cf_fix_cppflags=yes
10662
10663                         if test $cf_fix_cppflags = yes ; then
10664
10665         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10666         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10667
10668                                 continue
10669                         elif test "${cf_tst_cflags}" = "\"'" ; then
10670
10671         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10672         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10673
10674                                 continue
10675                         fi
10676                         ;;
10677                 esac
10678                 case "$CPPFLAGS" in
10679                 (*$cf_add_cflags)
10680                         ;;
10681                 (*)
10682                         case $cf_add_cflags in
10683                         (-D*)
10684                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10685
10686 CPPFLAGS=`echo "$CPPFLAGS" | \
10687         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10688                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10689
10690                                 ;;
10691                         esac
10692
10693         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10694         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10695
10696                         ;;
10697                 esac
10698                 ;;
10699         (*)
10700
10701         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10702         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10703
10704                 ;;
10705         esac
10706         ;;
10707 (yes)
10708
10709         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10710         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10711
10712         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10713
10714         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10715                 && test -z "${cf_tst_cflags}" \
10716                 && cf_fix_cppflags=no
10717         ;;
10718 esac
10719 done
10720
10721 if test -n "$cf_new_cflags" ; then
10722
10723         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10724         CFLAGS="${CFLAGS}$cf_new_cflags"
10725
10726 fi
10727
10728 if test -n "$cf_new_cppflags" ; then
10729
10730         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10731         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10732
10733 fi
10734
10735 if test -n "$cf_new_extra_cppflags" ; then
10736
10737         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10738         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10739
10740 fi
10741
10742 fi
10743
10744         ;;
10745 (netbsd*)
10746         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10747         ;;
10748 (openbsd[4-9]*)
10749         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10750         cf_xopen_source="-D_BSD_SOURCE"
10751         cf_XOPEN_SOURCE=600
10752         ;;
10753 (openbsd*)
10754         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10755         ;;
10756 (osf[45]*)
10757         cf_xopen_source="-D_OSF_SOURCE"
10758         ;;
10759 (nto-qnx*)
10760         cf_xopen_source="-D_QNX_SOURCE"
10761         ;;
10762 (sco*)
10763         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10764         ;;
10765 (solaris2.*)
10766         cf_xopen_source="-D__EXTENSIONS__"
10767         cf_cv_xopen_source=broken
10768         ;;
10769 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10770         cf_XOPEN_SOURCE=
10771         cf_POSIX_C_SOURCE=
10772         ;;
10773 (*)
10774
10775 echo "$as_me:10775: checking if we should define _XOPEN_SOURCE" >&5
10776 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10777 if test "${cf_cv_xopen_source+set}" = set; then
10778   echo $ECHO_N "(cached) $ECHO_C" >&6
10779 else
10780
10781         cat >conftest.$ac_ext <<_ACEOF
10782 #line 10782 "configure"
10783 #include "confdefs.h"
10784
10785 #include <stdlib.h>
10786 #include <string.h>
10787 #include <sys/types.h>
10788
10789 int
10790 main (void)
10791 {
10792
10793 #ifndef _XOPEN_SOURCE
10794 make an error
10795 #endif
10796   ;
10797   return 0;
10798 }
10799 _ACEOF
10800 rm -f conftest.$ac_objext
10801 if { (eval echo "$as_me:10801: \"$ac_compile\"") >&5
10802   (eval $ac_compile) 2>&5
10803   ac_status=$?
10804   echo "$as_me:10804: \$? = $ac_status" >&5
10805   (exit $ac_status); } &&
10806          { ac_try='test -s conftest.$ac_objext'
10807   { (eval echo "$as_me:10807: \"$ac_try\"") >&5
10808   (eval $ac_try) 2>&5
10809   ac_status=$?
10810   echo "$as_me:10810: \$? = $ac_status" >&5
10811   (exit $ac_status); }; }; then
10812   cf_cv_xopen_source=no
10813 else
10814   echo "$as_me: failed program was:" >&5
10815 cat conftest.$ac_ext >&5
10816 cf_save="$CPPFLAGS"
10817          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10818          cat >conftest.$ac_ext <<_ACEOF
10819 #line 10819 "configure"
10820 #include "confdefs.h"
10821
10822 #include <stdlib.h>
10823 #include <string.h>
10824 #include <sys/types.h>
10825
10826 int
10827 main (void)
10828 {
10829
10830 #ifdef _XOPEN_SOURCE
10831 make an error
10832 #endif
10833   ;
10834   return 0;
10835 }
10836 _ACEOF
10837 rm -f conftest.$ac_objext
10838 if { (eval echo "$as_me:10838: \"$ac_compile\"") >&5
10839   (eval $ac_compile) 2>&5
10840   ac_status=$?
10841   echo "$as_me:10841: \$? = $ac_status" >&5
10842   (exit $ac_status); } &&
10843          { ac_try='test -s conftest.$ac_objext'
10844   { (eval echo "$as_me:10844: \"$ac_try\"") >&5
10845   (eval $ac_try) 2>&5
10846   ac_status=$?
10847   echo "$as_me:10847: \$? = $ac_status" >&5
10848   (exit $ac_status); }; }; then
10849   cf_cv_xopen_source=no
10850 else
10851   echo "$as_me: failed program was:" >&5
10852 cat conftest.$ac_ext >&5
10853 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10854 fi
10855 rm -f conftest.$ac_objext conftest.$ac_ext
10856         CPPFLAGS="$cf_save"
10857
10858 fi
10859 rm -f conftest.$ac_objext conftest.$ac_ext
10860
10861 fi
10862 echo "$as_me:10862: result: $cf_cv_xopen_source" >&5
10863 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10864
10865 if test "$cf_cv_xopen_source" != no ; then
10866
10867 CFLAGS=`echo "$CFLAGS" | \
10868         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10869                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10870
10871 CPPFLAGS=`echo "$CPPFLAGS" | \
10872         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10873                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10874
10875         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10876
10877 cf_fix_cppflags=no
10878 cf_new_cflags=
10879 cf_new_cppflags=
10880 cf_new_extra_cppflags=
10881
10882 for cf_add_cflags in $cf_temp_xopen_source
10883 do
10884 case $cf_fix_cppflags in
10885 (no)
10886         case $cf_add_cflags in
10887         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10888                 case $cf_add_cflags in
10889                 (-D*)
10890                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10891
10892                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10893                                 && test -z "${cf_tst_cflags}" \
10894                                 && cf_fix_cppflags=yes
10895
10896                         if test $cf_fix_cppflags = yes ; then
10897
10898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10900
10901                                 continue
10902                         elif test "${cf_tst_cflags}" = "\"'" ; then
10903
10904         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10905         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10906
10907                                 continue
10908                         fi
10909                         ;;
10910                 esac
10911                 case "$CPPFLAGS" in
10912                 (*$cf_add_cflags)
10913                         ;;
10914                 (*)
10915                         case $cf_add_cflags in
10916                         (-D*)
10917                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10918
10919 CPPFLAGS=`echo "$CPPFLAGS" | \
10920         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10921                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10922
10923                                 ;;
10924                         esac
10925
10926         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10927         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10928
10929                         ;;
10930                 esac
10931                 ;;
10932         (*)
10933
10934         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10935         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10936
10937                 ;;
10938         esac
10939         ;;
10940 (yes)
10941
10942         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10943         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10944
10945         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10946
10947         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10948                 && test -z "${cf_tst_cflags}" \
10949                 && cf_fix_cppflags=no
10950         ;;
10951 esac
10952 done
10953
10954 if test -n "$cf_new_cflags" ; then
10955
10956         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10957         CFLAGS="${CFLAGS}$cf_new_cflags"
10958
10959 fi
10960
10961 if test -n "$cf_new_cppflags" ; then
10962
10963         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10964         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10965
10966 fi
10967
10968 if test -n "$cf_new_extra_cppflags" ; then
10969
10970         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10971         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10972
10973 fi
10974
10975 fi
10976
10977 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10978
10979 cf_save_CFLAGS="$CFLAGS"
10980 cf_save_CPPFLAGS="$CPPFLAGS"
10981
10982 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10983         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10984                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10985
10986 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10987         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10988                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10989
10990 echo "$as_me:10990: checking if we should define _POSIX_C_SOURCE" >&5
10991 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10992 if test "${cf_cv_posix_c_source+set}" = set; then
10993   echo $ECHO_N "(cached) $ECHO_C" >&6
10994 else
10995
10996 echo "${as_me:-configure}:10996: testing if the symbol is already defined go no further ..." 1>&5
10997
10998         cat >conftest.$ac_ext <<_ACEOF
10999 #line 10999 "configure"
11000 #include "confdefs.h"
11001 #include <sys/types.h>
11002 int
11003 main (void)
11004 {
11005
11006 #ifndef _POSIX_C_SOURCE
11007 make an error
11008 #endif
11009   ;
11010   return 0;
11011 }
11012 _ACEOF
11013 rm -f conftest.$ac_objext
11014 if { (eval echo "$as_me:11014: \"$ac_compile\"") >&5
11015   (eval $ac_compile) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit $ac_status); } &&
11019          { ac_try='test -s conftest.$ac_objext'
11020   { (eval echo "$as_me:11020: \"$ac_try\"") >&5
11021   (eval $ac_try) 2>&5
11022   ac_status=$?
11023   echo "$as_me:11023: \$? = $ac_status" >&5
11024   (exit $ac_status); }; }; then
11025   cf_cv_posix_c_source=no
11026 else
11027   echo "$as_me: failed program was:" >&5
11028 cat conftest.$ac_ext >&5
11029 cf_want_posix_source=no
11030          case .$cf_POSIX_C_SOURCE in
11031          (.[12]??*)
11032                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11033                 ;;
11034          (.2)
11035                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
11036                 cf_want_posix_source=yes
11037                 ;;
11038          (.*)
11039                 cf_want_posix_source=yes
11040                 ;;
11041          esac
11042          if test "$cf_want_posix_source" = yes ; then
11043                 cat >conftest.$ac_ext <<_ACEOF
11044 #line 11044 "configure"
11045 #include "confdefs.h"
11046 #include <sys/types.h>
11047 int
11048 main (void)
11049 {
11050
11051 #ifdef _POSIX_SOURCE
11052 make an error
11053 #endif
11054   ;
11055   return 0;
11056 }
11057 _ACEOF
11058 rm -f conftest.$ac_objext
11059 if { (eval echo "$as_me:11059: \"$ac_compile\"") >&5
11060   (eval $ac_compile) 2>&5
11061   ac_status=$?
11062   echo "$as_me:11062: \$? = $ac_status" >&5
11063   (exit $ac_status); } &&
11064          { ac_try='test -s conftest.$ac_objext'
11065   { (eval echo "$as_me:11065: \"$ac_try\"") >&5
11066   (eval $ac_try) 2>&5
11067   ac_status=$?
11068   echo "$as_me:11068: \$? = $ac_status" >&5
11069   (exit $ac_status); }; }; then
11070   :
11071 else
11072   echo "$as_me: failed program was:" >&5
11073 cat conftest.$ac_ext >&5
11074 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
11075 fi
11076 rm -f conftest.$ac_objext conftest.$ac_ext
11077          fi
11078
11079 echo "${as_me:-configure}:11079: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
11080
11081          CFLAGS="$cf_trim_CFLAGS"
11082          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
11083
11084 echo "${as_me:-configure}:11084: testing if the second compile does not leave our definition intact error ..." 1>&5
11085
11086          cat >conftest.$ac_ext <<_ACEOF
11087 #line 11087 "configure"
11088 #include "confdefs.h"
11089 #include <sys/types.h>
11090 int
11091 main (void)
11092 {
11093
11094 #ifndef _POSIX_C_SOURCE
11095 make an error
11096 #endif
11097   ;
11098   return 0;
11099 }
11100 _ACEOF
11101 rm -f conftest.$ac_objext
11102 if { (eval echo "$as_me:11102: \"$ac_compile\"") >&5
11103   (eval $ac_compile) 2>&5
11104   ac_status=$?
11105   echo "$as_me:11105: \$? = $ac_status" >&5
11106   (exit $ac_status); } &&
11107          { ac_try='test -s conftest.$ac_objext'
11108   { (eval echo "$as_me:11108: \"$ac_try\"") >&5
11109   (eval $ac_try) 2>&5
11110   ac_status=$?
11111   echo "$as_me:11111: \$? = $ac_status" >&5
11112   (exit $ac_status); }; }; then
11113   :
11114 else
11115   echo "$as_me: failed program was:" >&5
11116 cat conftest.$ac_ext >&5
11117 cf_cv_posix_c_source=no
11118 fi
11119 rm -f conftest.$ac_objext conftest.$ac_ext
11120          CFLAGS="$cf_save_CFLAGS"
11121          CPPFLAGS="$cf_save_CPPFLAGS"
11122
11123 fi
11124 rm -f conftest.$ac_objext conftest.$ac_ext
11125
11126 fi
11127 echo "$as_me:11127: result: $cf_cv_posix_c_source" >&5
11128 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
11129
11130 if test "$cf_cv_posix_c_source" != no ; then
11131         CFLAGS="$cf_trim_CFLAGS"
11132         CPPFLAGS="$cf_trim_CPPFLAGS"
11133
11134 cf_fix_cppflags=no
11135 cf_new_cflags=
11136 cf_new_cppflags=
11137 cf_new_extra_cppflags=
11138
11139 for cf_add_cflags in $cf_cv_posix_c_source
11140 do
11141 case $cf_fix_cppflags in
11142 (no)
11143         case $cf_add_cflags in
11144         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11145                 case $cf_add_cflags in
11146                 (-D*)
11147                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11148
11149                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11150                                 && test -z "${cf_tst_cflags}" \
11151                                 && cf_fix_cppflags=yes
11152
11153                         if test $cf_fix_cppflags = yes ; then
11154
11155         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11156         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11157
11158                                 continue
11159                         elif test "${cf_tst_cflags}" = "\"'" ; then
11160
11161         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11162         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11163
11164                                 continue
11165                         fi
11166                         ;;
11167                 esac
11168                 case "$CPPFLAGS" in
11169                 (*$cf_add_cflags)
11170                         ;;
11171                 (*)
11172                         case $cf_add_cflags in
11173                         (-D*)
11174                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11175
11176 CPPFLAGS=`echo "$CPPFLAGS" | \
11177         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11178                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11179
11180                                 ;;
11181                         esac
11182
11183         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11184         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11185
11186                         ;;
11187                 esac
11188                 ;;
11189         (*)
11190
11191         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11192         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11193
11194                 ;;
11195         esac
11196         ;;
11197 (yes)
11198
11199         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11200         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11201
11202         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11203
11204         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11205                 && test -z "${cf_tst_cflags}" \
11206                 && cf_fix_cppflags=no
11207         ;;
11208 esac
11209 done
11210
11211 if test -n "$cf_new_cflags" ; then
11212
11213         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11214         CFLAGS="${CFLAGS}$cf_new_cflags"
11215
11216 fi
11217
11218 if test -n "$cf_new_cppflags" ; then
11219
11220         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11221         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11222
11223 fi
11224
11225 if test -n "$cf_new_extra_cppflags" ; then
11226
11227         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11228         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11229
11230 fi
11231
11232 fi
11233
11234         ;;
11235 esac
11236
11237 if test -n "$cf_xopen_source" ; then
11238
11239 cf_fix_cppflags=no
11240 cf_new_cflags=
11241 cf_new_cppflags=
11242 cf_new_extra_cppflags=
11243
11244 for cf_add_cflags in $cf_xopen_source
11245 do
11246 case $cf_fix_cppflags in
11247 (no)
11248         case $cf_add_cflags in
11249         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11250                 case $cf_add_cflags in
11251                 (-D*)
11252                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11253
11254                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11255                                 && test -z "${cf_tst_cflags}" \
11256                                 && cf_fix_cppflags=yes
11257
11258                         if test $cf_fix_cppflags = yes ; then
11259
11260         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11261         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11262
11263                                 continue
11264                         elif test "${cf_tst_cflags}" = "\"'" ; then
11265
11266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11268
11269                                 continue
11270                         fi
11271                         ;;
11272                 esac
11273                 case "$CPPFLAGS" in
11274                 (*$cf_add_cflags)
11275                         ;;
11276                 (*)
11277                         case $cf_add_cflags in
11278                         (-D*)
11279                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11280
11281 CPPFLAGS=`echo "$CPPFLAGS" | \
11282         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11283                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11284
11285                                 ;;
11286                         esac
11287
11288         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11289         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11290
11291                         ;;
11292                 esac
11293                 ;;
11294         (*)
11295
11296         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11297         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11298
11299                 ;;
11300         esac
11301         ;;
11302 (yes)
11303
11304         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11305         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11306
11307         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11308
11309         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11310                 && test -z "${cf_tst_cflags}" \
11311                 && cf_fix_cppflags=no
11312         ;;
11313 esac
11314 done
11315
11316 if test -n "$cf_new_cflags" ; then
11317         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11318
11319 echo "${as_me:-configure}:11319: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11320
11321         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11322         CFLAGS="${CFLAGS}$cf_new_cflags"
11323
11324 fi
11325
11326 if test -n "$cf_new_cppflags" ; then
11327         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11328
11329 echo "${as_me:-configure}:11329: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11330
11331         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11332         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11333
11334 fi
11335
11336 if test -n "$cf_new_extra_cppflags" ; then
11337         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11338
11339 echo "${as_me:-configure}:11339: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11340
11341         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11342         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11343
11344 fi
11345
11346 fi
11347
11348 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
11349         echo "$as_me:11349: checking if _XOPEN_SOURCE really is set" >&5
11350 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
11351         cat >conftest.$ac_ext <<_ACEOF
11352 #line 11352 "configure"
11353 #include "confdefs.h"
11354 #include <stdlib.h>
11355 int
11356 main (void)
11357 {
11358
11359 #ifndef _XOPEN_SOURCE
11360 make an error
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_XOPEN_SOURCE_set=yes
11379 else
11380   echo "$as_me: failed program was:" >&5
11381 cat conftest.$ac_ext >&5
11382 cf_XOPEN_SOURCE_set=no
11383 fi
11384 rm -f conftest.$ac_objext conftest.$ac_ext
11385         echo "$as_me:11385: result: $cf_XOPEN_SOURCE_set" >&5
11386 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
11387         if test $cf_XOPEN_SOURCE_set = yes
11388         then
11389                 cat >conftest.$ac_ext <<_ACEOF
11390 #line 11390 "configure"
11391 #include "confdefs.h"
11392 #include <stdlib.h>
11393 int
11394 main (void)
11395 {
11396
11397 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
11398 make an error
11399 #endif
11400   ;
11401   return 0;
11402 }
11403 _ACEOF
11404 rm -f conftest.$ac_objext
11405 if { (eval echo "$as_me:11405: \"$ac_compile\"") >&5
11406   (eval $ac_compile) 2>&5
11407   ac_status=$?
11408   echo "$as_me:11408: \$? = $ac_status" >&5
11409   (exit $ac_status); } &&
11410          { ac_try='test -s conftest.$ac_objext'
11411   { (eval echo "$as_me:11411: \"$ac_try\"") >&5
11412   (eval $ac_try) 2>&5
11413   ac_status=$?
11414   echo "$as_me:11414: \$? = $ac_status" >&5
11415   (exit $ac_status); }; }; then
11416   cf_XOPEN_SOURCE_set_ok=yes
11417 else
11418   echo "$as_me: failed program was:" >&5
11419 cat conftest.$ac_ext >&5
11420 cf_XOPEN_SOURCE_set_ok=no
11421 fi
11422 rm -f conftest.$ac_objext conftest.$ac_ext
11423                 if test $cf_XOPEN_SOURCE_set_ok = no
11424                 then
11425                         { echo "$as_me:11425: WARNING: _XOPEN_SOURCE is lower than requested" >&5
11426 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
11427                 fi
11428         else
11429
11430 echo "$as_me:11430: checking if we should define _XOPEN_SOURCE" >&5
11431 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11432 if test "${cf_cv_xopen_source+set}" = set; then
11433   echo $ECHO_N "(cached) $ECHO_C" >&6
11434 else
11435
11436         cat >conftest.$ac_ext <<_ACEOF
11437 #line 11437 "configure"
11438 #include "confdefs.h"
11439
11440 #include <stdlib.h>
11441 #include <string.h>
11442 #include <sys/types.h>
11443
11444 int
11445 main (void)
11446 {
11447
11448 #ifndef _XOPEN_SOURCE
11449 make an error
11450 #endif
11451   ;
11452   return 0;
11453 }
11454 _ACEOF
11455 rm -f conftest.$ac_objext
11456 if { (eval echo "$as_me:11456: \"$ac_compile\"") >&5
11457   (eval $ac_compile) 2>&5
11458   ac_status=$?
11459   echo "$as_me:11459: \$? = $ac_status" >&5
11460   (exit $ac_status); } &&
11461          { ac_try='test -s conftest.$ac_objext'
11462   { (eval echo "$as_me:11462: \"$ac_try\"") >&5
11463   (eval $ac_try) 2>&5
11464   ac_status=$?
11465   echo "$as_me:11465: \$? = $ac_status" >&5
11466   (exit $ac_status); }; }; then
11467   cf_cv_xopen_source=no
11468 else
11469   echo "$as_me: failed program was:" >&5
11470 cat conftest.$ac_ext >&5
11471 cf_save="$CPPFLAGS"
11472          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11473          cat >conftest.$ac_ext <<_ACEOF
11474 #line 11474 "configure"
11475 #include "confdefs.h"
11476
11477 #include <stdlib.h>
11478 #include <string.h>
11479 #include <sys/types.h>
11480
11481 int
11482 main (void)
11483 {
11484
11485 #ifdef _XOPEN_SOURCE
11486 make an error
11487 #endif
11488   ;
11489   return 0;
11490 }
11491 _ACEOF
11492 rm -f conftest.$ac_objext
11493 if { (eval echo "$as_me:11493: \"$ac_compile\"") >&5
11494   (eval $ac_compile) 2>&5
11495   ac_status=$?
11496   echo "$as_me:11496: \$? = $ac_status" >&5
11497   (exit $ac_status); } &&
11498          { ac_try='test -s conftest.$ac_objext'
11499   { (eval echo "$as_me:11499: \"$ac_try\"") >&5
11500   (eval $ac_try) 2>&5
11501   ac_status=$?
11502   echo "$as_me:11502: \$? = $ac_status" >&5
11503   (exit $ac_status); }; }; then
11504   cf_cv_xopen_source=no
11505 else
11506   echo "$as_me: failed program was:" >&5
11507 cat conftest.$ac_ext >&5
11508 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11509 fi
11510 rm -f conftest.$ac_objext conftest.$ac_ext
11511         CPPFLAGS="$cf_save"
11512
11513 fi
11514 rm -f conftest.$ac_objext conftest.$ac_ext
11515
11516 fi
11517 echo "$as_me:11517: result: $cf_cv_xopen_source" >&5
11518 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11519
11520 if test "$cf_cv_xopen_source" != no ; then
11521
11522 CFLAGS=`echo "$CFLAGS" | \
11523         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11524                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11525
11526 CPPFLAGS=`echo "$CPPFLAGS" | \
11527         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11528                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11529
11530         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11531
11532 cf_fix_cppflags=no
11533 cf_new_cflags=
11534 cf_new_cppflags=
11535 cf_new_extra_cppflags=
11536
11537 for cf_add_cflags in $cf_temp_xopen_source
11538 do
11539 case $cf_fix_cppflags in
11540 (no)
11541         case $cf_add_cflags in
11542         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11543                 case $cf_add_cflags in
11544                 (-D*)
11545                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11546
11547                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11548                                 && test -z "${cf_tst_cflags}" \
11549                                 && cf_fix_cppflags=yes
11550
11551                         if test $cf_fix_cppflags = yes ; then
11552
11553         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11554         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11555
11556                                 continue
11557                         elif test "${cf_tst_cflags}" = "\"'" ; then
11558
11559         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11560         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11561
11562                                 continue
11563                         fi
11564                         ;;
11565                 esac
11566                 case "$CPPFLAGS" in
11567                 (*$cf_add_cflags)
11568                         ;;
11569                 (*)
11570                         case $cf_add_cflags in
11571                         (-D*)
11572                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11573
11574 CPPFLAGS=`echo "$CPPFLAGS" | \
11575         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11576                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11577
11578                                 ;;
11579                         esac
11580
11581         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11582         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11583
11584                         ;;
11585                 esac
11586                 ;;
11587         (*)
11588
11589         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11590         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11591
11592                 ;;
11593         esac
11594         ;;
11595 (yes)
11596
11597         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11598         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11599
11600         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11601
11602         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11603                 && test -z "${cf_tst_cflags}" \
11604                 && cf_fix_cppflags=no
11605         ;;
11606 esac
11607 done
11608
11609 if test -n "$cf_new_cflags" ; then
11610
11611         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11612         CFLAGS="${CFLAGS}$cf_new_cflags"
11613
11614 fi
11615
11616 if test -n "$cf_new_cppflags" ; then
11617
11618         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11619         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11620
11621 fi
11622
11623 if test -n "$cf_new_extra_cppflags" ; then
11624
11625         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11626         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11627
11628 fi
11629
11630 fi
11631
11632         fi
11633 fi
11634
11635 # Check whether --enable-largefile or --disable-largefile was given.
11636 if test "${enable_largefile+set}" = set; then
11637   enableval="$enable_largefile"
11638
11639 fi;
11640 if test "$enable_largefile" != no; then
11641
11642   echo "$as_me:11642: checking for special C compiler options needed for large files" >&5
11643 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
11644 if test "${ac_cv_sys_largefile_CC+set}" = set; then
11645   echo $ECHO_N "(cached) $ECHO_C" >&6
11646 else
11647   ac_cv_sys_largefile_CC=no
11648      if test "$GCC" != yes; then
11649        ac_save_CC=$CC
11650        while :; do
11651          # IRIX 6.2 and later do not support large files by default,
11652          # so use the C compiler's -n32 option if that helps.
11653          cat >conftest.$ac_ext <<_ACEOF
11654 #line 11654 "configure"
11655 #include "confdefs.h"
11656 #include <sys/types.h>
11657  /* Check that off_t can represent 2**63 - 1 correctly.
11658     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11659     since some C++ compilers masquerading as C compilers
11660     incorrectly reject 9223372036854775807.  */
11661 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11662   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11663                        && LARGE_OFF_T % 2147483647 == 1)
11664                       ? 1 : -1];
11665 int
11666 main (void)
11667 {
11668
11669   ;
11670   return 0;
11671 }
11672 _ACEOF
11673          rm -f conftest.$ac_objext
11674 if { (eval echo "$as_me:11674: \"$ac_compile\"") >&5
11675   (eval $ac_compile) 2>&5
11676   ac_status=$?
11677   echo "$as_me:11677: \$? = $ac_status" >&5
11678   (exit $ac_status); } &&
11679          { ac_try='test -s conftest.$ac_objext'
11680   { (eval echo "$as_me:11680: \"$ac_try\"") >&5
11681   (eval $ac_try) 2>&5
11682   ac_status=$?
11683   echo "$as_me:11683: \$? = $ac_status" >&5
11684   (exit $ac_status); }; }; then
11685   break
11686 else
11687   echo "$as_me: failed program was:" >&5
11688 cat conftest.$ac_ext >&5
11689 fi
11690 rm -f conftest.$ac_objext
11691          CC="$CC -n32"
11692          rm -f conftest.$ac_objext
11693 if { (eval echo "$as_me:11693: \"$ac_compile\"") >&5
11694   (eval $ac_compile) 2>&5
11695   ac_status=$?
11696   echo "$as_me:11696: \$? = $ac_status" >&5
11697   (exit $ac_status); } &&
11698          { ac_try='test -s conftest.$ac_objext'
11699   { (eval echo "$as_me:11699: \"$ac_try\"") >&5
11700   (eval $ac_try) 2>&5
11701   ac_status=$?
11702   echo "$as_me:11702: \$? = $ac_status" >&5
11703   (exit $ac_status); }; }; then
11704   ac_cv_sys_largefile_CC=' -n32'; break
11705 else
11706   echo "$as_me: failed program was:" >&5
11707 cat conftest.$ac_ext >&5
11708 fi
11709 rm -f conftest.$ac_objext
11710          break
11711        done
11712        CC=$ac_save_CC
11713        rm -f conftest.$ac_ext
11714     fi
11715 fi
11716 echo "$as_me:11716: result: $ac_cv_sys_largefile_CC" >&5
11717 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11718   if test "$ac_cv_sys_largefile_CC" != no; then
11719     CC=$CC$ac_cv_sys_largefile_CC
11720   fi
11721
11722   echo "$as_me:11722: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11723 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11724 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11725   echo $ECHO_N "(cached) $ECHO_C" >&6
11726 else
11727   while :; do
11728   ac_cv_sys_file_offset_bits=no
11729   cat >conftest.$ac_ext <<_ACEOF
11730 #line 11730 "configure"
11731 #include "confdefs.h"
11732 #include <sys/types.h>
11733  /* Check that off_t can represent 2**63 - 1 correctly.
11734     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11735     since some C++ compilers masquerading as C compilers
11736     incorrectly reject 9223372036854775807.  */
11737 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11738   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11739                        && LARGE_OFF_T % 2147483647 == 1)
11740                       ? 1 : -1];
11741 int
11742 main (void)
11743 {
11744
11745   ;
11746   return 0;
11747 }
11748 _ACEOF
11749 rm -f conftest.$ac_objext
11750 if { (eval echo "$as_me:11750: \"$ac_compile\"") >&5
11751   (eval $ac_compile) 2>&5
11752   ac_status=$?
11753   echo "$as_me:11753: \$? = $ac_status" >&5
11754   (exit $ac_status); } &&
11755          { ac_try='test -s conftest.$ac_objext'
11756   { (eval echo "$as_me:11756: \"$ac_try\"") >&5
11757   (eval $ac_try) 2>&5
11758   ac_status=$?
11759   echo "$as_me:11759: \$? = $ac_status" >&5
11760   (exit $ac_status); }; }; then
11761   break
11762 else
11763   echo "$as_me: failed program was:" >&5
11764 cat conftest.$ac_ext >&5
11765 fi
11766 rm -f conftest.$ac_objext conftest.$ac_ext
11767   cat >conftest.$ac_ext <<_ACEOF
11768 #line 11768 "configure"
11769 #include "confdefs.h"
11770 #define _FILE_OFFSET_BITS 64
11771 #include <sys/types.h>
11772  /* Check that off_t can represent 2**63 - 1 correctly.
11773     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11774     since some C++ compilers masquerading as C compilers
11775     incorrectly reject 9223372036854775807.  */
11776 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11777   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11778                        && LARGE_OFF_T % 2147483647 == 1)
11779                       ? 1 : -1];
11780 int
11781 main (void)
11782 {
11783
11784   ;
11785   return 0;
11786 }
11787 _ACEOF
11788 rm -f conftest.$ac_objext
11789 if { (eval echo "$as_me:11789: \"$ac_compile\"") >&5
11790   (eval $ac_compile) 2>&5
11791   ac_status=$?
11792   echo "$as_me:11792: \$? = $ac_status" >&5
11793   (exit $ac_status); } &&
11794          { ac_try='test -s conftest.$ac_objext'
11795   { (eval echo "$as_me:11795: \"$ac_try\"") >&5
11796   (eval $ac_try) 2>&5
11797   ac_status=$?
11798   echo "$as_me:11798: \$? = $ac_status" >&5
11799   (exit $ac_status); }; }; then
11800   ac_cv_sys_file_offset_bits=64; break
11801 else
11802   echo "$as_me: failed program was:" >&5
11803 cat conftest.$ac_ext >&5
11804 fi
11805 rm -f conftest.$ac_objext conftest.$ac_ext
11806   break
11807 done
11808 fi
11809 echo "$as_me:11809: result: $ac_cv_sys_file_offset_bits" >&5
11810 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11811 if test "$ac_cv_sys_file_offset_bits" != no; then
11812
11813 cat >>confdefs.h <<EOF
11814 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11815 EOF
11816
11817 fi
11818 rm -rf conftest*
11819   echo "$as_me:11819: checking for _LARGE_FILES value needed for large files" >&5
11820 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11821 if test "${ac_cv_sys_large_files+set}" = set; then
11822   echo $ECHO_N "(cached) $ECHO_C" >&6
11823 else
11824   while :; do
11825   ac_cv_sys_large_files=no
11826   cat >conftest.$ac_ext <<_ACEOF
11827 #line 11827 "configure"
11828 #include "confdefs.h"
11829 #include <sys/types.h>
11830  /* Check that off_t can represent 2**63 - 1 correctly.
11831     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11832     since some C++ compilers masquerading as C compilers
11833     incorrectly reject 9223372036854775807.  */
11834 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11835   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11836                        && LARGE_OFF_T % 2147483647 == 1)
11837                       ? 1 : -1];
11838 int
11839 main (void)
11840 {
11841
11842   ;
11843   return 0;
11844 }
11845 _ACEOF
11846 rm -f conftest.$ac_objext
11847 if { (eval echo "$as_me:11847: \"$ac_compile\"") >&5
11848   (eval $ac_compile) 2>&5
11849   ac_status=$?
11850   echo "$as_me:11850: \$? = $ac_status" >&5
11851   (exit $ac_status); } &&
11852          { ac_try='test -s conftest.$ac_objext'
11853   { (eval echo "$as_me:11853: \"$ac_try\"") >&5
11854   (eval $ac_try) 2>&5
11855   ac_status=$?
11856   echo "$as_me:11856: \$? = $ac_status" >&5
11857   (exit $ac_status); }; }; then
11858   break
11859 else
11860   echo "$as_me: failed program was:" >&5
11861 cat conftest.$ac_ext >&5
11862 fi
11863 rm -f conftest.$ac_objext conftest.$ac_ext
11864   cat >conftest.$ac_ext <<_ACEOF
11865 #line 11865 "configure"
11866 #include "confdefs.h"
11867 #define _LARGE_FILES 1
11868 #include <sys/types.h>
11869  /* Check that off_t can represent 2**63 - 1 correctly.
11870     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11871     since some C++ compilers masquerading as C compilers
11872     incorrectly reject 9223372036854775807.  */
11873 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11874   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11875                        && LARGE_OFF_T % 2147483647 == 1)
11876                       ? 1 : -1];
11877 int
11878 main (void)
11879 {
11880
11881   ;
11882   return 0;
11883 }
11884 _ACEOF
11885 rm -f conftest.$ac_objext
11886 if { (eval echo "$as_me:11886: \"$ac_compile\"") >&5
11887   (eval $ac_compile) 2>&5
11888   ac_status=$?
11889   echo "$as_me:11889: \$? = $ac_status" >&5
11890   (exit $ac_status); } &&
11891          { ac_try='test -s conftest.$ac_objext'
11892   { (eval echo "$as_me:11892: \"$ac_try\"") >&5
11893   (eval $ac_try) 2>&5
11894   ac_status=$?
11895   echo "$as_me:11895: \$? = $ac_status" >&5
11896   (exit $ac_status); }; }; then
11897   ac_cv_sys_large_files=1; break
11898 else
11899   echo "$as_me: failed program was:" >&5
11900 cat conftest.$ac_ext >&5
11901 fi
11902 rm -f conftest.$ac_objext conftest.$ac_ext
11903   break
11904 done
11905 fi
11906 echo "$as_me:11906: result: $ac_cv_sys_large_files" >&5
11907 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11908 if test "$ac_cv_sys_large_files" != no; then
11909
11910 cat >>confdefs.h <<EOF
11911 #define _LARGE_FILES $ac_cv_sys_large_files
11912 EOF
11913
11914 fi
11915 rm -rf conftest*
11916 fi
11917
11918         if test "$enable_largefile" != no ; then
11919         echo "$as_me:11919: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11920 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11921 if test "${ac_cv_sys_largefile_source+set}" = set; then
11922   echo $ECHO_N "(cached) $ECHO_C" >&6
11923 else
11924   while :; do
11925   ac_cv_sys_largefile_source=no
11926   cat >conftest.$ac_ext <<_ACEOF
11927 #line 11927 "configure"
11928 #include "confdefs.h"
11929 #include <stdio.h>
11930 int
11931 main (void)
11932 {
11933 return !fseeko;
11934   ;
11935   return 0;
11936 }
11937 _ACEOF
11938 rm -f conftest.$ac_objext
11939 if { (eval echo "$as_me:11939: \"$ac_compile\"") >&5
11940   (eval $ac_compile) 2>&5
11941   ac_status=$?
11942   echo "$as_me:11942: \$? = $ac_status" >&5
11943   (exit $ac_status); } &&
11944          { ac_try='test -s conftest.$ac_objext'
11945   { (eval echo "$as_me:11945: \"$ac_try\"") >&5
11946   (eval $ac_try) 2>&5
11947   ac_status=$?
11948   echo "$as_me:11948: \$? = $ac_status" >&5
11949   (exit $ac_status); }; }; then
11950   break
11951 else
11952   echo "$as_me: failed program was:" >&5
11953 cat conftest.$ac_ext >&5
11954 fi
11955 rm -f conftest.$ac_objext conftest.$ac_ext
11956   cat >conftest.$ac_ext <<_ACEOF
11957 #line 11957 "configure"
11958 #include "confdefs.h"
11959 #define _LARGEFILE_SOURCE 1
11960 #include <stdio.h>
11961 int
11962 main (void)
11963 {
11964 return !fseeko;
11965   ;
11966   return 0;
11967 }
11968 _ACEOF
11969 rm -f conftest.$ac_objext
11970 if { (eval echo "$as_me:11970: \"$ac_compile\"") >&5
11971   (eval $ac_compile) 2>&5
11972   ac_status=$?
11973   echo "$as_me:11973: \$? = $ac_status" >&5
11974   (exit $ac_status); } &&
11975          { ac_try='test -s conftest.$ac_objext'
11976   { (eval echo "$as_me:11976: \"$ac_try\"") >&5
11977   (eval $ac_try) 2>&5
11978   ac_status=$?
11979   echo "$as_me:11979: \$? = $ac_status" >&5
11980   (exit $ac_status); }; }; then
11981   ac_cv_sys_largefile_source=1; break
11982 else
11983   echo "$as_me: failed program was:" >&5
11984 cat conftest.$ac_ext >&5
11985 fi
11986 rm -f conftest.$ac_objext conftest.$ac_ext
11987   break
11988 done
11989 fi
11990 echo "$as_me:11990: result: $ac_cv_sys_largefile_source" >&5
11991 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11992 if test "$ac_cv_sys_largefile_source" != no; then
11993
11994 cat >>confdefs.h <<EOF
11995 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11996 EOF
11997
11998 fi
11999 rm -rf conftest*
12000
12001 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
12002 # in glibc 2.1.3, but that breaks too many other things.
12003 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
12004 echo "$as_me:12004: checking for fseeko" >&5
12005 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
12006 if test "${ac_cv_func_fseeko+set}" = set; then
12007   echo $ECHO_N "(cached) $ECHO_C" >&6
12008 else
12009   cat >conftest.$ac_ext <<_ACEOF
12010 #line 12010 "configure"
12011 #include "confdefs.h"
12012 #include <stdio.h>
12013 int
12014 main (void)
12015 {
12016 return fseeko && fseeko (stdin, 0, 0);
12017   ;
12018   return 0;
12019 }
12020 _ACEOF
12021 rm -f conftest.$ac_objext conftest$ac_exeext
12022 if { (eval echo "$as_me:12022: \"$ac_link\"") >&5
12023   (eval $ac_link) 2>&5
12024   ac_status=$?
12025   echo "$as_me:12025: \$? = $ac_status" >&5
12026   (exit $ac_status); } &&
12027          { ac_try='test -s conftest$ac_exeext'
12028   { (eval echo "$as_me:12028: \"$ac_try\"") >&5
12029   (eval $ac_try) 2>&5
12030   ac_status=$?
12031   echo "$as_me:12031: \$? = $ac_status" >&5
12032   (exit $ac_status); }; }; then
12033   ac_cv_func_fseeko=yes
12034 else
12035   echo "$as_me: failed program was:" >&5
12036 cat conftest.$ac_ext >&5
12037 ac_cv_func_fseeko=no
12038 fi
12039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12040 fi
12041 echo "$as_me:12041: result: $ac_cv_func_fseeko" >&5
12042 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
12043 if test $ac_cv_func_fseeko = yes; then
12044
12045 cat >>confdefs.h <<\EOF
12046 #define HAVE_FSEEKO 1
12047 EOF
12048
12049 fi
12050
12051         # Normally we would collect these definitions in the config.h,
12052         # but (like _XOPEN_SOURCE), some environments rely on having these
12053         # defined before any of the system headers are included.  Another
12054         # case comes up with C++, e.g., on AIX the compiler compiles the
12055         # header files by themselves before looking at the body files it is
12056         # told to compile.  For ncurses, those header files do not include
12057         # the config.h
12058         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
12059         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
12060         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
12061
12062         echo "$as_me:12062: checking whether to use struct dirent64" >&5
12063 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
12064 if test "${cf_cv_struct_dirent64+set}" = set; then
12065   echo $ECHO_N "(cached) $ECHO_C" >&6
12066 else
12067
12068                 cat >conftest.$ac_ext <<_ACEOF
12069 #line 12069 "configure"
12070 #include "confdefs.h"
12071
12072 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
12073 #include <sys/types.h>
12074 #include <dirent.h>
12075
12076 int
12077 main (void)
12078 {
12079
12080                 /* if transitional largefile support is setup, this is true */
12081                 extern struct dirent64 * readdir(DIR *);
12082                 struct dirent64 *x = readdir((DIR *)0);
12083                 struct dirent *y = readdir((DIR *)0);
12084                 int z = x - y;
12085
12086   ;
12087   return 0;
12088 }
12089 _ACEOF
12090 rm -f conftest.$ac_objext
12091 if { (eval echo "$as_me:12091: \"$ac_compile\"") >&5
12092   (eval $ac_compile) 2>&5
12093   ac_status=$?
12094   echo "$as_me:12094: \$? = $ac_status" >&5
12095   (exit $ac_status); } &&
12096          { ac_try='test -s conftest.$ac_objext'
12097   { (eval echo "$as_me:12097: \"$ac_try\"") >&5
12098   (eval $ac_try) 2>&5
12099   ac_status=$?
12100   echo "$as_me:12100: \$? = $ac_status" >&5
12101   (exit $ac_status); }; }; then
12102   cf_cv_struct_dirent64=yes
12103 else
12104   echo "$as_me: failed program was:" >&5
12105 cat conftest.$ac_ext >&5
12106 cf_cv_struct_dirent64=no
12107 fi
12108 rm -f conftest.$ac_objext conftest.$ac_ext
12109
12110 fi
12111 echo "$as_me:12111: result: $cf_cv_struct_dirent64" >&5
12112 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
12113         test "$cf_cv_struct_dirent64" = yes &&
12114 cat >>confdefs.h <<\EOF
12115 #define HAVE_STRUCT_DIRENT64 1
12116 EOF
12117
12118         fi
12119
12120 ### Enable compiling-in rcs id's
12121 echo "$as_me:12121: checking if RCS identifiers should be compiled-in" >&5
12122 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
12123
12124 # Check whether --with-rcs-ids or --without-rcs-ids was given.
12125 if test "${with_rcs_ids+set}" = set; then
12126   withval="$with_rcs_ids"
12127   with_rcs_ids=$withval
12128 else
12129   with_rcs_ids=no
12130 fi;
12131 echo "$as_me:12131: result: $with_rcs_ids" >&5
12132 echo "${ECHO_T}$with_rcs_ids" >&6
12133 test "$with_rcs_ids" = yes &&
12134 cat >>confdefs.h <<\EOF
12135 #define USE_RCS_IDS 1
12136 EOF
12137
12138 ###############################################################################
12139
12140 ### Note that some functions (such as const) are normally disabled anyway.
12141 echo "$as_me:12141: checking if you want to build with function extensions" >&5
12142 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
12143
12144 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
12145 if test "${enable_ext_funcs+set}" = set; then
12146   enableval="$enable_ext_funcs"
12147   with_ext_funcs=$enableval
12148 else
12149   with_ext_funcs=yes
12150 fi;
12151 echo "$as_me:12151: result: $with_ext_funcs" >&5
12152 echo "${ECHO_T}$with_ext_funcs" >&6
12153 if test "$with_ext_funcs" = yes ; then
12154         NCURSES_EXT_FUNCS=1
12155
12156 cat >>confdefs.h <<\EOF
12157 #define HAVE_USE_DEFAULT_COLORS 1
12158 EOF
12159
12160 cat >>confdefs.h <<\EOF
12161 #define NCURSES_EXT_FUNCS 1
12162 EOF
12163
12164 else
12165         NCURSES_EXT_FUNCS=0
12166 fi
12167
12168 ###   use option --enable-const to turn on use of const beyond that in XSI.
12169 echo "$as_me:12169: checking for extended use of const keyword" >&5
12170 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
12171
12172 # Check whether --enable-const or --disable-const was given.
12173 if test "${enable_const+set}" = set; then
12174   enableval="$enable_const"
12175   with_ext_const=$enableval
12176 else
12177   with_ext_const=no
12178 fi;
12179 echo "$as_me:12179: result: $with_ext_const" >&5
12180 echo "${ECHO_T}$with_ext_const" >&6
12181 NCURSES_CONST='/*nothing*/'
12182 if test "$with_ext_const" = yes ; then
12183         NCURSES_CONST=const
12184 fi
12185
12186 ###############################################################################
12187 # These options are relatively safe to experiment with.
12188
12189 echo "$as_me:12189: checking if you want all development code" >&5
12190 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
12191
12192 # Check whether --with-develop or --without-develop was given.
12193 if test "${with_develop+set}" = set; then
12194   withval="$with_develop"
12195   with_develop=$withval
12196 else
12197   with_develop=no
12198 fi;
12199 echo "$as_me:12199: result: $with_develop" >&5
12200 echo "${ECHO_T}$with_develop" >&6
12201
12202 ###############################################################################
12203 # These are just experimental, probably should not be in a package:
12204
12205 # This is still experimental (20080329), but should ultimately be moved to
12206 # the script-block --with-normal, etc.
12207
12208 echo "$as_me:12208: checking if you want to link with the pthread library" >&5
12209 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
12210
12211 # Check whether --with-pthread or --without-pthread was given.
12212 if test "${with_pthread+set}" = set; then
12213   withval="$with_pthread"
12214   with_pthread=$withval
12215 else
12216   with_pthread=no
12217 fi;
12218 echo "$as_me:12218: result: $with_pthread" >&5
12219 echo "${ECHO_T}$with_pthread" >&6
12220
12221 if test "$with_pthread" != no ; then
12222         echo "$as_me:12222: checking for pthread.h" >&5
12223 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
12224 if test "${ac_cv_header_pthread_h+set}" = set; then
12225   echo $ECHO_N "(cached) $ECHO_C" >&6
12226 else
12227   cat >conftest.$ac_ext <<_ACEOF
12228 #line 12228 "configure"
12229 #include "confdefs.h"
12230 #include <pthread.h>
12231 _ACEOF
12232 if { (eval echo "$as_me:12232: \"$ac_cpp conftest.$ac_ext\"") >&5
12233   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12234   ac_status=$?
12235   egrep -v '^ *\+' conftest.er1 >conftest.err
12236   rm -f conftest.er1
12237   cat conftest.err >&5
12238   echo "$as_me:12238: \$? = $ac_status" >&5
12239   (exit $ac_status); } >/dev/null; then
12240   if test -s conftest.err; then
12241     ac_cpp_err=$ac_c_preproc_warn_flag
12242   else
12243     ac_cpp_err=
12244   fi
12245 else
12246   ac_cpp_err=yes
12247 fi
12248 if test -z "$ac_cpp_err"; then
12249   ac_cv_header_pthread_h=yes
12250 else
12251   echo "$as_me: failed program was:" >&5
12252   cat conftest.$ac_ext >&5
12253   ac_cv_header_pthread_h=no
12254 fi
12255 rm -f conftest.err conftest.$ac_ext
12256 fi
12257 echo "$as_me:12257: result: $ac_cv_header_pthread_h" >&5
12258 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
12259 if test $ac_cv_header_pthread_h = yes; then
12260
12261 cat >>confdefs.h <<\EOF
12262 #define HAVE_PTHREADS_H 1
12263 EOF
12264
12265         for cf_lib_pthread in pthread c_r
12266         do
12267             echo "$as_me:12267: checking if we can link with the $cf_lib_pthread library" >&5
12268 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
12269             cf_save_LIBS="$LIBS"
12270
12271 cf_add_libs="-l$cf_lib_pthread"
12272 # Filter out duplicates - this happens with badly-designed ".pc" files...
12273 for cf_add_1lib in $LIBS
12274 do
12275         for cf_add_2lib in $cf_add_libs
12276         do
12277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12278                 then
12279                         cf_add_1lib=
12280                         break
12281                 fi
12282         done
12283         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12284 done
12285 LIBS="$cf_add_libs"
12286
12287             cat >conftest.$ac_ext <<_ACEOF
12288 #line 12288 "configure"
12289 #include "confdefs.h"
12290
12291 #include <pthread.h>
12292
12293 int
12294 main (void)
12295 {
12296
12297                 int rc = pthread_create(0,0,0,0);
12298                 int r2 = pthread_mutexattr_settype(0, 0);
12299
12300   ;
12301   return 0;
12302 }
12303 _ACEOF
12304 rm -f conftest.$ac_objext conftest$ac_exeext
12305 if { (eval echo "$as_me:12305: \"$ac_link\"") >&5
12306   (eval $ac_link) 2>&5
12307   ac_status=$?
12308   echo "$as_me:12308: \$? = $ac_status" >&5
12309   (exit $ac_status); } &&
12310          { ac_try='test -s conftest$ac_exeext'
12311   { (eval echo "$as_me:12311: \"$ac_try\"") >&5
12312   (eval $ac_try) 2>&5
12313   ac_status=$?
12314   echo "$as_me:12314: \$? = $ac_status" >&5
12315   (exit $ac_status); }; }; then
12316   with_pthread=yes
12317 else
12318   echo "$as_me: failed program was:" >&5
12319 cat conftest.$ac_ext >&5
12320 with_pthread=no
12321 fi
12322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12323             LIBS="$cf_save_LIBS"
12324             echo "$as_me:12324: result: $with_pthread" >&5
12325 echo "${ECHO_T}$with_pthread" >&6
12326             test "$with_pthread" = yes && break
12327         done
12328
12329         if test "$with_pthread" = yes ; then
12330
12331 cf_add_libs="-l$cf_lib_pthread"
12332 # Filter out duplicates - this happens with badly-designed ".pc" files...
12333 for cf_add_1lib in $LIBS
12334 do
12335         for cf_add_2lib in $cf_add_libs
12336         do
12337                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12338                 then
12339                         cf_add_1lib=
12340                         break
12341                 fi
12342         done
12343         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12344 done
12345 LIBS="$cf_add_libs"
12346
12347 cat >>confdefs.h <<\EOF
12348 #define HAVE_LIBPTHREADS 1
12349 EOF
12350
12351         else
12352             { { echo "$as_me:12352: error: Cannot link with pthread library" >&5
12353 echo "$as_me: error: Cannot link with pthread library" >&2;}
12354    { (exit 1); exit 1; }; }
12355         fi
12356
12357 fi
12358
12359 fi
12360
12361 echo "$as_me:12361: checking if you want to use weak-symbols for pthreads" >&5
12362 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
12363
12364 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
12365 if test "${enable_weak_symbols+set}" = set; then
12366   enableval="$enable_weak_symbols"
12367   use_weak_symbols=$withval
12368 else
12369   use_weak_symbols=no
12370 fi;
12371 echo "$as_me:12371: result: $use_weak_symbols" >&5
12372 echo "${ECHO_T}$use_weak_symbols" >&6
12373 if test "$use_weak_symbols" = yes ; then
12374
12375 echo "$as_me:12375: checking if $CC supports weak symbols" >&5
12376 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
12377 if test "${cf_cv_weak_symbols+set}" = set; then
12378   echo $ECHO_N "(cached) $ECHO_C" >&6
12379 else
12380
12381 cat >conftest.$ac_ext <<_ACEOF
12382 #line 12382 "configure"
12383 #include "confdefs.h"
12384
12385 #include <stdio.h>
12386 int
12387 main (void)
12388 {
12389
12390 #if defined(__GNUC__)
12391 #  if defined __USE_ISOC99
12392 #    define _cat_pragma(exp)    _Pragma(#exp)
12393 #    define _weak_pragma(exp)   _cat_pragma(weak name)
12394 #  else
12395 #    define _weak_pragma(exp)
12396 #  endif
12397 #  define _declare(name)        __extension__ extern __typeof__(name) name
12398 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
12399 #endif
12400
12401 weak_symbol(fopen);
12402
12403   ;
12404   return 0;
12405 }
12406 _ACEOF
12407 rm -f conftest.$ac_objext
12408 if { (eval echo "$as_me:12408: \"$ac_compile\"") >&5
12409   (eval $ac_compile) 2>&5
12410   ac_status=$?
12411   echo "$as_me:12411: \$? = $ac_status" >&5
12412   (exit $ac_status); } &&
12413          { ac_try='test -s conftest.$ac_objext'
12414   { (eval echo "$as_me:12414: \"$ac_try\"") >&5
12415   (eval $ac_try) 2>&5
12416   ac_status=$?
12417   echo "$as_me:12417: \$? = $ac_status" >&5
12418   (exit $ac_status); }; }; then
12419   cf_cv_weak_symbols=yes
12420 else
12421   echo "$as_me: failed program was:" >&5
12422 cat conftest.$ac_ext >&5
12423 cf_cv_weak_symbols=no
12424 fi
12425 rm -f conftest.$ac_objext conftest.$ac_ext
12426
12427 fi
12428 echo "$as_me:12428: result: $cf_cv_weak_symbols" >&5
12429 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
12430
12431 else
12432         cf_cv_weak_symbols=no
12433 fi
12434
12435 if test $cf_cv_weak_symbols = yes ; then
12436
12437 cat >>confdefs.h <<\EOF
12438 #define USE_WEAK_SYMBOLS 1
12439 EOF
12440
12441 fi
12442
12443 PTHREAD=
12444 if test "$with_pthread" = "yes" ; then
12445
12446 cat >>confdefs.h <<\EOF
12447 #define USE_PTHREADS 1
12448 EOF
12449
12450         enable_reentrant=yes
12451         if test $cf_cv_weak_symbols = yes ; then
12452                 PTHREAD=-lpthread
12453         fi
12454 fi
12455
12456 # OpenSUSE is installing ncurses6, using reentrant option.
12457 echo "$as_me:12457: checking for _nc_TABSIZE" >&5
12458 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
12459 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
12460   echo $ECHO_N "(cached) $ECHO_C" >&6
12461 else
12462   cat >conftest.$ac_ext <<_ACEOF
12463 #line 12463 "configure"
12464 #include "confdefs.h"
12465 /* System header to define __stub macros and hopefully few prototypes,
12466     which can conflict with char _nc_TABSIZE (); below.  */
12467 #include <assert.h>
12468 /* Override any gcc2 internal prototype to avoid an error.  */
12469 #ifdef __cplusplus
12470 extern "C"
12471 #endif
12472 /* We use char because int might match the return type of a gcc2
12473    builtin and then its argument prototype would still apply.  */
12474 char _nc_TABSIZE ();
12475 char (*f) ();
12476
12477 int
12478 main (void)
12479 {
12480 /* The GNU C library defines this for functions which it implements
12481     to always fail with ENOSYS.  Some functions are actually named
12482     something starting with __ and the normal name is an alias.  */
12483 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
12484 choke me
12485 #else
12486 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12487 #endif
12488
12489   ;
12490   return 0;
12491 }
12492 _ACEOF
12493 rm -f conftest.$ac_objext conftest$ac_exeext
12494 if { (eval echo "$as_me:12494: \"$ac_link\"") >&5
12495   (eval $ac_link) 2>&5
12496   ac_status=$?
12497   echo "$as_me:12497: \$? = $ac_status" >&5
12498   (exit $ac_status); } &&
12499          { ac_try='test -s conftest$ac_exeext'
12500   { (eval echo "$as_me:12500: \"$ac_try\"") >&5
12501   (eval $ac_try) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit $ac_status); }; }; then
12505   ac_cv_func__nc_TABSIZE=yes
12506 else
12507   echo "$as_me: failed program was:" >&5
12508 cat conftest.$ac_ext >&5
12509 ac_cv_func__nc_TABSIZE=no
12510 fi
12511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12512 fi
12513 echo "$as_me:12513: result: $ac_cv_func__nc_TABSIZE" >&5
12514 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
12515 if test $ac_cv_func__nc_TABSIZE = yes; then
12516   assume_reentrant=yes
12517 else
12518   assume_reentrant=no
12519 fi
12520
12521 # Reentrant code has to be opaque; there's little advantage to making ncurses
12522 # opaque outside of that, so there is no --enable-opaque option.  We can use
12523 # this option without --with-pthreads, but this will be always set for
12524 # pthreads.
12525 echo "$as_me:12525: checking if you want experimental reentrant code" >&5
12526 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
12527
12528 # Check whether --enable-reentrant or --disable-reentrant was given.
12529 if test "${enable_reentrant+set}" = set; then
12530   enableval="$enable_reentrant"
12531   with_reentrant=$enableval
12532 else
12533   with_reentrant=$assume_reentrant
12534 fi;
12535 echo "$as_me:12535: result: $with_reentrant" >&5
12536 echo "${ECHO_T}$with_reentrant" >&6
12537 if test "$with_reentrant" = yes ; then
12538         cf_cv_enable_reentrant=1
12539         if test $cf_cv_weak_symbols = yes ; then
12540
12541 # remove pthread library from $LIBS
12542 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
12543
12544         elif test "$assume_reentrant" = no ; then
12545                 LIB_SUFFIX="t${LIB_SUFFIX}"
12546         fi
12547
12548 cat >>confdefs.h <<\EOF
12549 #define USE_REENTRANT 1
12550 EOF
12551
12552 else
12553         cf_cv_enable_reentrant=0
12554 fi
12555
12556 ### Allow using a different wrap-prefix
12557 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
12558         echo "$as_me:12558: checking for prefix used to wrap public variables" >&5
12559 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
12560
12561 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
12562 if test "${with_wrap_prefix+set}" = set; then
12563   withval="$with_wrap_prefix"
12564   NCURSES_WRAP_PREFIX=$withval
12565 else
12566   NCURSES_WRAP_PREFIX=_nc_
12567 fi;
12568         echo "$as_me:12568: result: $NCURSES_WRAP_PREFIX" >&5
12569 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12570 else
12571         NCURSES_WRAP_PREFIX=_nc_
12572 fi
12573
12574 cat >>confdefs.h <<EOF
12575 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
12576 EOF
12577
12578 ###############################################################################
12579
12580 ###     use option --disable-echo to suppress full display compiling commands
12581
12582 echo "$as_me:12582: checking if you want to see long compiling messages" >&5
12583 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
12584
12585 # Check whether --enable-echo or --disable-echo was given.
12586 if test "${enable_echo+set}" = set; then
12587   enableval="$enable_echo"
12588   test "$enableval" != no && enableval=yes
12589         if test "$enableval" != "yes" ; then
12590
12591         ECHO_LT='--silent'
12592         ECHO_LD='@echo linking $@;'
12593         RULE_CC='@echo compiling $<'
12594         SHOW_CC='@echo compiling $@'
12595         ECHO_CC='@'
12596
12597         else
12598
12599         ECHO_LT=''
12600         ECHO_LD=''
12601         RULE_CC=''
12602         SHOW_CC=''
12603         ECHO_CC=''
12604
12605         fi
12606 else
12607   enableval=yes
12608
12609         ECHO_LT=''
12610         ECHO_LD=''
12611         RULE_CC=''
12612         SHOW_CC=''
12613         ECHO_CC=''
12614
12615 fi;
12616 echo "$as_me:12616: result: $enableval" >&5
12617 echo "${ECHO_T}$enableval" >&6
12618
12619 ###     use option --enable-warnings to turn on all gcc warnings
12620 echo "$as_me:12620: checking if you want to see compiler warnings" >&5
12621 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
12622
12623 # Check whether --enable-warnings or --disable-warnings was given.
12624 if test "${enable_warnings+set}" = set; then
12625   enableval="$enable_warnings"
12626   with_warnings=$enableval
12627 fi;
12628 echo "$as_me:12628: result: $with_warnings" >&5
12629 echo "${ECHO_T}$with_warnings" >&6
12630
12631 if test "x$with_warnings" = "xyes"; then
12632
12633         ADAFLAGS="$ADAFLAGS -gnatg"
12634
12635 INTEL_COMPILER=no
12636
12637 if test "$GCC" = yes ; then
12638         case $host_os in
12639         (linux*|gnu*)
12640                 echo "$as_me:12640: checking if this is really Intel C compiler" >&5
12641 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
12642                 cf_save_CFLAGS="$CFLAGS"
12643                 CFLAGS="$CFLAGS -no-gcc"
12644                 cat >conftest.$ac_ext <<_ACEOF
12645 #line 12645 "configure"
12646 #include "confdefs.h"
12647
12648 int
12649 main (void)
12650 {
12651
12652 #ifdef __INTEL_COMPILER
12653 #else
12654 make an error
12655 #endif
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   INTEL_COMPILER=yes
12674 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
12675
12676 else
12677   echo "$as_me: failed program was:" >&5
12678 cat conftest.$ac_ext >&5
12679 fi
12680 rm -f conftest.$ac_objext conftest.$ac_ext
12681                 CFLAGS="$cf_save_CFLAGS"
12682                 echo "$as_me:12682: result: $INTEL_COMPILER" >&5
12683 echo "${ECHO_T}$INTEL_COMPILER" >&6
12684                 ;;
12685         esac
12686 fi
12687
12688 CLANG_COMPILER=no
12689
12690 if test "$GCC" = yes ; then
12691         echo "$as_me:12691: checking if this is really Clang C compiler" >&5
12692 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
12693         cf_save_CFLAGS="$CFLAGS"
12694         CFLAGS="$CFLAGS -Qunused-arguments"
12695         cat >conftest.$ac_ext <<_ACEOF
12696 #line 12696 "configure"
12697 #include "confdefs.h"
12698
12699 int
12700 main (void)
12701 {
12702
12703 #ifdef __clang__
12704 #else
12705 make an error
12706 #endif
12707
12708   ;
12709   return 0;
12710 }
12711 _ACEOF
12712 rm -f conftest.$ac_objext
12713 if { (eval echo "$as_me:12713: \"$ac_compile\"") >&5
12714   (eval $ac_compile) 2>&5
12715   ac_status=$?
12716   echo "$as_me:12716: \$? = $ac_status" >&5
12717   (exit $ac_status); } &&
12718          { ac_try='test -s conftest.$ac_objext'
12719   { (eval echo "$as_me:12719: \"$ac_try\"") >&5
12720   (eval $ac_try) 2>&5
12721   ac_status=$?
12722   echo "$as_me:12722: \$? = $ac_status" >&5
12723   (exit $ac_status); }; }; then
12724   CLANG_COMPILER=yes
12725 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12726
12727 else
12728   echo "$as_me: failed program was:" >&5
12729 cat conftest.$ac_ext >&5
12730 fi
12731 rm -f conftest.$ac_objext conftest.$ac_ext
12732         CFLAGS="$cf_save_CFLAGS"
12733         echo "$as_me:12733: result: $CLANG_COMPILER" >&5
12734 echo "${ECHO_T}$CLANG_COMPILER" >&6
12735 fi
12736
12737 cat > conftest.$ac_ext <<EOF
12738 #line 12738 "${as_me:-configure}"
12739 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12740 EOF
12741
12742 if test "$INTEL_COMPILER" = yes
12743 then
12744 # The "-wdXXX" options suppress warnings:
12745 # remark #1419: external declaration in primary source file
12746 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12747 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12748 # remark #193: zero used for undefined preprocessing identifier
12749 # remark #593: variable "curs_sb_left_arrow" was set but never used
12750 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12751 # remark #869: parameter "tw" was never referenced
12752 # remark #981: operands are evaluated in unspecified order
12753 # warning #279: controlling expression is constant
12754
12755         { echo "$as_me:12755: checking for $CC warning options..." >&5
12756 echo "$as_me: checking for $CC warning options..." >&6;}
12757         cf_save_CFLAGS="$CFLAGS"
12758         EXTRA_CFLAGS="-Wall"
12759         for cf_opt in \
12760                 wd1419 \
12761                 wd1683 \
12762                 wd1684 \
12763                 wd193 \
12764                 wd593 \
12765                 wd279 \
12766                 wd810 \
12767                 wd869 \
12768                 wd981
12769         do
12770                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12771                 if { (eval echo "$as_me:12771: \"$ac_compile\"") >&5
12772   (eval $ac_compile) 2>&5
12773   ac_status=$?
12774   echo "$as_me:12774: \$? = $ac_status" >&5
12775   (exit $ac_status); }; then
12776                         test -n "$verbose" && echo "$as_me:12776: result: ... -$cf_opt" >&5
12777 echo "${ECHO_T}... -$cf_opt" >&6
12778                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12779                 fi
12780         done
12781         CFLAGS="$cf_save_CFLAGS"
12782
12783 elif test "$GCC" = yes
12784 then
12785         { echo "$as_me:12785: checking for $CC warning options..." >&5
12786 echo "$as_me: checking for $CC warning options..." >&6;}
12787         cf_save_CFLAGS="$CFLAGS"
12788         EXTRA_CFLAGS=
12789         cf_warn_CONST=""
12790         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12791         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12792         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12793         for cf_opt in W Wall \
12794                 Wbad-function-cast \
12795                 Wcast-align \
12796                 Wcast-qual \
12797                 Wdeclaration-after-statement \
12798                 Wextra \
12799                 Winline \
12800                 Wmissing-declarations \
12801                 Wmissing-prototypes \
12802                 Wnested-externs \
12803                 Wpointer-arith \
12804                 Wshadow \
12805                 Wstrict-prototypes \
12806                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12807         do
12808                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12809                 if { (eval echo "$as_me:12809: \"$ac_compile\"") >&5
12810   (eval $ac_compile) 2>&5
12811   ac_status=$?
12812   echo "$as_me:12812: \$? = $ac_status" >&5
12813   (exit $ac_status); }; then
12814                         test -n "$verbose" && echo "$as_me:12814: result: ... -$cf_opt" >&5
12815 echo "${ECHO_T}... -$cf_opt" >&6
12816                         case $cf_opt in
12817                         (Wcast-qual)
12818                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12819                                 ;;
12820                         (Winline)
12821                                 case $GCC_VERSION in
12822                                 ([34].*)
12823                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12824
12825 echo "${as_me:-configure}:12825: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12826
12827                                         continue;;
12828                                 esac
12829                                 ;;
12830                         (Wpointer-arith)
12831                                 case $GCC_VERSION in
12832                                 ([12].*)
12833                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12834
12835 echo "${as_me:-configure}:12835: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12836
12837                                         continue;;
12838                                 esac
12839                                 ;;
12840                         esac
12841                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12842                 fi
12843         done
12844         CFLAGS="$cf_save_CFLAGS"
12845 fi
12846 rm -rf conftest*
12847
12848 fi
12849
12850 if test "$GCC" = yes
12851 then
12852 cat > conftest.i <<EOF
12853 #ifndef GCC_PRINTF
12854 #define GCC_PRINTF 0
12855 #endif
12856 #ifndef GCC_SCANF
12857 #define GCC_SCANF 0
12858 #endif
12859 #ifndef GCC_NORETURN
12860 #define GCC_NORETURN /* nothing */
12861 #endif
12862 #ifndef GCC_UNUSED
12863 #define GCC_UNUSED /* nothing */
12864 #endif
12865 EOF
12866 if test "$GCC" = yes
12867 then
12868         { echo "$as_me:12868: checking for $CC __attribute__ directives..." >&5
12869 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12870 cat > conftest.$ac_ext <<EOF
12871 #line 12871 "${as_me:-configure}"
12872 #include "confdefs.h"
12873 #include "conftest.h"
12874 #include "conftest.i"
12875 #if     GCC_PRINTF
12876 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12877 #else
12878 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12879 #endif
12880 #if     GCC_SCANF
12881 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12882 #else
12883 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12884 #endif
12885 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12886 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12887 extern void foo(void) GCC_NORETURN;
12888 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12889 EOF
12890         cf_printf_attribute=no
12891         cf_scanf_attribute=no
12892         for cf_attribute in scanf printf unused noreturn
12893         do
12894
12895 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12896
12897                 cf_directive="__attribute__(($cf_attribute))"
12898                 echo "checking for $CC $cf_directive" 1>&5
12899
12900                 case $cf_attribute in
12901                 (printf)
12902                         cf_printf_attribute=yes
12903                         cat >conftest.h <<EOF
12904 #define GCC_$cf_ATTRIBUTE 1
12905 EOF
12906                         ;;
12907                 (scanf)
12908                         cf_scanf_attribute=yes
12909                         cat >conftest.h <<EOF
12910 #define GCC_$cf_ATTRIBUTE 1
12911 EOF
12912                         ;;
12913                 (*)
12914                         cat >conftest.h <<EOF
12915 #define GCC_$cf_ATTRIBUTE $cf_directive
12916 EOF
12917                         ;;
12918                 esac
12919
12920                 if { (eval echo "$as_me:12920: \"$ac_compile\"") >&5
12921   (eval $ac_compile) 2>&5
12922   ac_status=$?
12923   echo "$as_me:12923: \$? = $ac_status" >&5
12924   (exit $ac_status); }; then
12925                         test -n "$verbose" && echo "$as_me:12925: result: ... $cf_attribute" >&5
12926 echo "${ECHO_T}... $cf_attribute" >&6
12927                         cat conftest.h >>confdefs.h
12928                         case $cf_attribute in
12929                         (noreturn)
12930
12931 cat >>confdefs.h <<EOF
12932 #define GCC_NORETURN $cf_directive
12933 EOF
12934
12935                                 ;;
12936                         (printf)
12937                                 cf_value='/* nothing */'
12938                                 if test "$cf_printf_attribute" != no ; then
12939                                         cf_value='__attribute__((format(printf,fmt,var)))'
12940
12941 cat >>confdefs.h <<\EOF
12942 #define GCC_PRINTF 1
12943 EOF
12944
12945                                 fi
12946
12947 cat >>confdefs.h <<EOF
12948 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12949 EOF
12950
12951                                 ;;
12952                         (scanf)
12953                                 cf_value='/* nothing */'
12954                                 if test "$cf_scanf_attribute" != no ; then
12955                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12956
12957 cat >>confdefs.h <<\EOF
12958 #define GCC_SCANF 1
12959 EOF
12960
12961                                 fi
12962
12963 cat >>confdefs.h <<EOF
12964 #define GCC_SCANFLIKE(fmt,var) $cf_value
12965 EOF
12966
12967                                 ;;
12968                         (unused)
12969
12970 cat >>confdefs.h <<EOF
12971 #define GCC_UNUSED $cf_directive
12972 EOF
12973
12974                                 ;;
12975                         esac
12976                 fi
12977         done
12978 else
12979         fgrep define conftest.i >>confdefs.h
12980 fi
12981 rm -rf conftest*
12982 fi
12983
12984 ###     use option --enable-assertions to turn on generation of assertion code
12985 echo "$as_me:12985: checking if you want to enable runtime assertions" >&5
12986 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12987
12988 # Check whether --enable-assertions or --disable-assertions was given.
12989 if test "${enable_assertions+set}" = set; then
12990   enableval="$enable_assertions"
12991   with_assertions=$enableval
12992 else
12993   with_assertions=no
12994 fi;
12995 echo "$as_me:12995: result: $with_assertions" >&5
12996 echo "${ECHO_T}$with_assertions" >&6
12997 if test -n "$GCC"
12998 then
12999         if test "$with_assertions" = no
13000         then
13001                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
13002         else
13003
13004         ADAFLAGS="$ADAFLAGS -gnata"
13005
13006         fi
13007 fi
13008
13009 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
13010
13011 cat >>confdefs.h <<\EOF
13012 #define HAVE_NC_ALLOC_H 1
13013 EOF
13014
13015 ###     use option --enable-expanded to generate certain macros as functions
13016
13017 # Check whether --enable-expanded or --disable-expanded was given.
13018 if test "${enable_expanded+set}" = set; then
13019   enableval="$enable_expanded"
13020   test "$enableval" = yes &&
13021 cat >>confdefs.h <<\EOF
13022 #define NCURSES_EXPANDED 1
13023 EOF
13024
13025 fi;
13026
13027 ###     use option --disable-macros to suppress macros in favor of functions
13028
13029 # Check whether --enable-macros or --disable-macros was given.
13030 if test "${enable_macros+set}" = set; then
13031   enableval="$enable_macros"
13032   test "$enableval" = no &&
13033 cat >>confdefs.h <<\EOF
13034 #define NCURSES_NOMACROS 1
13035 EOF
13036
13037 fi;
13038
13039 # Normally we only add trace() to the debug-library.  Allow this to be
13040 # extended to all models of the ncurses library:
13041 cf_all_traces=no
13042 case "$CFLAGS $CPPFLAGS" in
13043 (*-DTRACE*)
13044         cf_all_traces=yes
13045         ;;
13046 esac
13047
13048 echo "$as_me:13048: checking whether to add trace feature to all models" >&5
13049 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
13050
13051 # Check whether --with-trace or --without-trace was given.
13052 if test "${with_trace+set}" = set; then
13053   withval="$with_trace"
13054   cf_with_trace=$withval
13055 else
13056   cf_with_trace=$cf_all_traces
13057 fi;
13058 echo "$as_me:13058: result: $cf_with_trace" >&5
13059 echo "${ECHO_T}$cf_with_trace" >&6
13060
13061 if test "$cf_with_trace" = yes ; then
13062         ADA_TRACE=TRUE
13063
13064 cf_fix_cppflags=no
13065 cf_new_cflags=
13066 cf_new_cppflags=
13067 cf_new_extra_cppflags=
13068
13069 for cf_add_cflags in -DTRACE
13070 do
13071 case $cf_fix_cppflags in
13072 (no)
13073         case $cf_add_cflags in
13074         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13075                 case $cf_add_cflags in
13076                 (-D*)
13077                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13078
13079                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13080                                 && test -z "${cf_tst_cflags}" \
13081                                 && cf_fix_cppflags=yes
13082
13083                         if test $cf_fix_cppflags = yes ; then
13084
13085         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13086         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13087
13088                                 continue
13089                         elif test "${cf_tst_cflags}" = "\"'" ; then
13090
13091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13093
13094                                 continue
13095                         fi
13096                         ;;
13097                 esac
13098                 case "$CPPFLAGS" in
13099                 (*$cf_add_cflags)
13100                         ;;
13101                 (*)
13102                         case $cf_add_cflags in
13103                         (-D*)
13104                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13105
13106 CPPFLAGS=`echo "$CPPFLAGS" | \
13107         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13108                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13109
13110                                 ;;
13111                         esac
13112
13113         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13114         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13115
13116                         ;;
13117                 esac
13118                 ;;
13119         (*)
13120
13121         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13122         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13123
13124                 ;;
13125         esac
13126         ;;
13127 (yes)
13128
13129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13131
13132         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13133
13134         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13135                 && test -z "${cf_tst_cflags}" \
13136                 && cf_fix_cppflags=no
13137         ;;
13138 esac
13139 done
13140
13141 if test -n "$cf_new_cflags" ; then
13142
13143         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13144         CFLAGS="${CFLAGS}$cf_new_cflags"
13145
13146 fi
13147
13148 if test -n "$cf_new_cppflags" ; then
13149
13150         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13151         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13152
13153 fi
13154
13155 if test -n "$cf_new_extra_cppflags" ; then
13156
13157         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13158         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13159
13160 fi
13161
13162 else
13163         ADA_TRACE=FALSE
13164 fi
13165
13166 echo "$as_me:13166: checking if we want to use GNAT projects" >&5
13167 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
13168
13169 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
13170 if test "${enable_gnat_projects+set}" = set; then
13171   enableval="$enable_gnat_projects"
13172   test "$enableval" != no && enableval=yes
13173         if test "$enableval" != "yes" ; then
13174     enable_gnat_projects=no
13175         else
13176                 enable_gnat_projects=yes
13177         fi
13178 else
13179   enableval=yes
13180         enable_gnat_projects=yes
13181
13182 fi;
13183 echo "$as_me:13183: result: $enable_gnat_projects" >&5
13184 echo "${ECHO_T}$enable_gnat_projects" >&6
13185
13186 ###     Checks for libraries.
13187 case $cf_cv_system_name in
13188 (*mingw32*)
13189         ;;
13190 (*)
13191 echo "$as_me:13191: checking for gettimeofday" >&5
13192 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
13193 if test "${ac_cv_func_gettimeofday+set}" = set; then
13194   echo $ECHO_N "(cached) $ECHO_C" >&6
13195 else
13196   cat >conftest.$ac_ext <<_ACEOF
13197 #line 13197 "configure"
13198 #include "confdefs.h"
13199 /* System header to define __stub macros and hopefully few prototypes,
13200     which can conflict with char gettimeofday (); below.  */
13201 #include <assert.h>
13202 /* Override any gcc2 internal prototype to avoid an error.  */
13203 #ifdef __cplusplus
13204 extern "C"
13205 #endif
13206 /* We use char because int might match the return type of a gcc2
13207    builtin and then its argument prototype would still apply.  */
13208 char gettimeofday ();
13209 char (*f) ();
13210
13211 int
13212 main (void)
13213 {
13214 /* The GNU C library defines this for functions which it implements
13215     to always fail with ENOSYS.  Some functions are actually named
13216     something starting with __ and the normal name is an alias.  */
13217 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
13218 choke me
13219 #else
13220 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13221 #endif
13222
13223   ;
13224   return 0;
13225 }
13226 _ACEOF
13227 rm -f conftest.$ac_objext conftest$ac_exeext
13228 if { (eval echo "$as_me:13228: \"$ac_link\"") >&5
13229   (eval $ac_link) 2>&5
13230   ac_status=$?
13231   echo "$as_me:13231: \$? = $ac_status" >&5
13232   (exit $ac_status); } &&
13233          { ac_try='test -s conftest$ac_exeext'
13234   { (eval echo "$as_me:13234: \"$ac_try\"") >&5
13235   (eval $ac_try) 2>&5
13236   ac_status=$?
13237   echo "$as_me:13237: \$? = $ac_status" >&5
13238   (exit $ac_status); }; }; then
13239   ac_cv_func_gettimeofday=yes
13240 else
13241   echo "$as_me: failed program was:" >&5
13242 cat conftest.$ac_ext >&5
13243 ac_cv_func_gettimeofday=no
13244 fi
13245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13246 fi
13247 echo "$as_me:13247: result: $ac_cv_func_gettimeofday" >&5
13248 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
13249 if test $ac_cv_func_gettimeofday = yes; then
13250   cat >>confdefs.h <<\EOF
13251 #define HAVE_GETTIMEOFDAY 1
13252 EOF
13253
13254 else
13255
13256 echo "$as_me:13256: checking for gettimeofday in -lbsd" >&5
13257 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
13258 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
13259   echo $ECHO_N "(cached) $ECHO_C" >&6
13260 else
13261   ac_check_lib_save_LIBS=$LIBS
13262 LIBS="-lbsd  $LIBS"
13263 cat >conftest.$ac_ext <<_ACEOF
13264 #line 13264 "configure"
13265 #include "confdefs.h"
13266
13267 /* Override any gcc2 internal prototype to avoid an error.  */
13268 #ifdef __cplusplus
13269 extern "C"
13270 #endif
13271 /* We use char because int might match the return type of a gcc2
13272    builtin and then its argument prototype would still apply.  */
13273 char gettimeofday ();
13274 int
13275 main (void)
13276 {
13277 gettimeofday ();
13278   ;
13279   return 0;
13280 }
13281 _ACEOF
13282 rm -f conftest.$ac_objext conftest$ac_exeext
13283 if { (eval echo "$as_me:13283: \"$ac_link\"") >&5
13284   (eval $ac_link) 2>&5
13285   ac_status=$?
13286   echo "$as_me:13286: \$? = $ac_status" >&5
13287   (exit $ac_status); } &&
13288          { ac_try='test -s conftest$ac_exeext'
13289   { (eval echo "$as_me:13289: \"$ac_try\"") >&5
13290   (eval $ac_try) 2>&5
13291   ac_status=$?
13292   echo "$as_me:13292: \$? = $ac_status" >&5
13293   (exit $ac_status); }; }; then
13294   ac_cv_lib_bsd_gettimeofday=yes
13295 else
13296   echo "$as_me: failed program was:" >&5
13297 cat conftest.$ac_ext >&5
13298 ac_cv_lib_bsd_gettimeofday=no
13299 fi
13300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13301 LIBS=$ac_check_lib_save_LIBS
13302 fi
13303 echo "$as_me:13303: result: $ac_cv_lib_bsd_gettimeofday" >&5
13304 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
13305 if test $ac_cv_lib_bsd_gettimeofday = yes; then
13306
13307 cat >>confdefs.h <<\EOF
13308 #define HAVE_GETTIMEOFDAY 1
13309 EOF
13310
13311         LIBS="$LIBS -lbsd"
13312 fi
13313
13314 fi
13315         ;;
13316 esac
13317
13318 ###     Checks for header files.
13319 echo "$as_me:13319: checking for ANSI C header files" >&5
13320 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13321 if test "${ac_cv_header_stdc+set}" = set; then
13322   echo $ECHO_N "(cached) $ECHO_C" >&6
13323 else
13324   cat >conftest.$ac_ext <<_ACEOF
13325 #line 13325 "configure"
13326 #include "confdefs.h"
13327 #include <stdlib.h>
13328 #include <stdarg.h>
13329 #include <string.h>
13330 #include <float.h>
13331
13332 _ACEOF
13333 if { (eval echo "$as_me:13333: \"$ac_cpp conftest.$ac_ext\"") >&5
13334   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13335   ac_status=$?
13336   egrep -v '^ *\+' conftest.er1 >conftest.err
13337   rm -f conftest.er1
13338   cat conftest.err >&5
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); } >/dev/null; then
13341   if test -s conftest.err; then
13342     ac_cpp_err=$ac_c_preproc_warn_flag
13343   else
13344     ac_cpp_err=
13345   fi
13346 else
13347   ac_cpp_err=yes
13348 fi
13349 if test -z "$ac_cpp_err"; then
13350   ac_cv_header_stdc=yes
13351 else
13352   echo "$as_me: failed program was:" >&5
13353   cat conftest.$ac_ext >&5
13354   ac_cv_header_stdc=no
13355 fi
13356 rm -f conftest.err conftest.$ac_ext
13357
13358 if test $ac_cv_header_stdc = yes; then
13359   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13360   cat >conftest.$ac_ext <<_ACEOF
13361 #line 13361 "configure"
13362 #include "confdefs.h"
13363 #include <string.h>
13364
13365 _ACEOF
13366 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13367   egrep "memchr" >/dev/null 2>&1; then
13368   :
13369 else
13370   ac_cv_header_stdc=no
13371 fi
13372 rm -rf conftest*
13373
13374 fi
13375
13376 if test $ac_cv_header_stdc = yes; then
13377   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13378   cat >conftest.$ac_ext <<_ACEOF
13379 #line 13379 "configure"
13380 #include "confdefs.h"
13381 #include <stdlib.h>
13382
13383 _ACEOF
13384 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13385   egrep "free" >/dev/null 2>&1; then
13386   :
13387 else
13388   ac_cv_header_stdc=no
13389 fi
13390 rm -rf conftest*
13391
13392 fi
13393
13394 if test $ac_cv_header_stdc = yes; then
13395   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13396   if test "$cross_compiling" = yes; then
13397   :
13398 else
13399   cat >conftest.$ac_ext <<_ACEOF
13400 #line 13400 "configure"
13401 #include "confdefs.h"
13402 #include <ctype.h>
13403 #if ((' ' & 0x0FF) == 0x020)
13404 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13405 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13406 #else
13407 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13408                      || ('j' <= (c) && (c) <= 'r') \
13409                      || ('s' <= (c) && (c) <= 'z'))
13410 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13411 #endif
13412
13413 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13414 int
13415 main (void)
13416 {
13417   int i;
13418   for (i = 0; i < 256; i++)
13419     if (XOR (islower (i), ISLOWER (i))
13420         || toupper (i) != TOUPPER (i))
13421       $ac_main_return(2);
13422   $ac_main_return (0);
13423 }
13424 _ACEOF
13425 rm -f conftest$ac_exeext
13426 if { (eval echo "$as_me:13426: \"$ac_link\"") >&5
13427   (eval $ac_link) 2>&5
13428   ac_status=$?
13429   echo "$as_me:13429: \$? = $ac_status" >&5
13430   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13431   { (eval echo "$as_me:13431: \"$ac_try\"") >&5
13432   (eval $ac_try) 2>&5
13433   ac_status=$?
13434   echo "$as_me:13434: \$? = $ac_status" >&5
13435   (exit $ac_status); }; }; then
13436   :
13437 else
13438   echo "$as_me: program exited with status $ac_status" >&5
13439 echo "$as_me: failed program was:" >&5
13440 cat conftest.$ac_ext >&5
13441 ac_cv_header_stdc=no
13442 fi
13443 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13444 fi
13445 fi
13446 fi
13447 echo "$as_me:13447: result: $ac_cv_header_stdc" >&5
13448 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13449 if test $ac_cv_header_stdc = yes; then
13450
13451 cat >>confdefs.h <<\EOF
13452 #define STDC_HEADERS 1
13453 EOF
13454
13455 fi
13456
13457 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13458
13459 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13460                   inttypes.h stdint.h unistd.h
13461 do
13462 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13463 echo "$as_me:13463: checking for $ac_header" >&5
13464 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13465 if eval "test \"\${$as_ac_Header+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 $ac_includes_default
13472 #include <$ac_header>
13473 _ACEOF
13474 rm -f conftest.$ac_objext
13475 if { (eval echo "$as_me:13475: \"$ac_compile\"") >&5
13476   (eval $ac_compile) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); } &&
13480          { ac_try='test -s conftest.$ac_objext'
13481   { (eval echo "$as_me:13481: \"$ac_try\"") >&5
13482   (eval $ac_try) 2>&5
13483   ac_status=$?
13484   echo "$as_me:13484: \$? = $ac_status" >&5
13485   (exit $ac_status); }; }; then
13486   eval "$as_ac_Header=yes"
13487 else
13488   echo "$as_me: failed program was:" >&5
13489 cat conftest.$ac_ext >&5
13490 eval "$as_ac_Header=no"
13491 fi
13492 rm -f conftest.$ac_objext conftest.$ac_ext
13493 fi
13494 echo "$as_me:13494: result: `eval echo '${'$as_ac_Header'}'`" >&5
13495 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13496 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13497   cat >>confdefs.h <<EOF
13498 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13499 EOF
13500
13501 fi
13502 done
13503
13504 echo "$as_me:13504: checking for signed char" >&5
13505 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
13506 if test "${ac_cv_type_signed_char+set}" = set; then
13507   echo $ECHO_N "(cached) $ECHO_C" >&6
13508 else
13509   cat >conftest.$ac_ext <<_ACEOF
13510 #line 13510 "configure"
13511 #include "confdefs.h"
13512 $ac_includes_default
13513 int
13514 main (void)
13515 {
13516 if ((signed char *) 0)
13517   return 0;
13518 if (sizeof (signed char))
13519   return 0;
13520   ;
13521   return 0;
13522 }
13523 _ACEOF
13524 rm -f conftest.$ac_objext
13525 if { (eval echo "$as_me:13525: \"$ac_compile\"") >&5
13526   (eval $ac_compile) 2>&5
13527   ac_status=$?
13528   echo "$as_me:13528: \$? = $ac_status" >&5
13529   (exit $ac_status); } &&
13530          { ac_try='test -s conftest.$ac_objext'
13531   { (eval echo "$as_me:13531: \"$ac_try\"") >&5
13532   (eval $ac_try) 2>&5
13533   ac_status=$?
13534   echo "$as_me:13534: \$? = $ac_status" >&5
13535   (exit $ac_status); }; }; then
13536   ac_cv_type_signed_char=yes
13537 else
13538   echo "$as_me: failed program was:" >&5
13539 cat conftest.$ac_ext >&5
13540 ac_cv_type_signed_char=no
13541 fi
13542 rm -f conftest.$ac_objext conftest.$ac_ext
13543 fi
13544 echo "$as_me:13544: result: $ac_cv_type_signed_char" >&5
13545 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
13546
13547 echo "$as_me:13547: checking size of signed char" >&5
13548 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
13549 if test "${ac_cv_sizeof_signed_char+set}" = set; then
13550   echo $ECHO_N "(cached) $ECHO_C" >&6
13551 else
13552   if test "$ac_cv_type_signed_char" = yes; then
13553   if test "$cross_compiling" = yes; then
13554   # Depending upon the size, compute the lo and hi bounds.
13555 cat >conftest.$ac_ext <<_ACEOF
13556 #line 13556 "configure"
13557 #include "confdefs.h"
13558 $ac_includes_default
13559 int
13560 main (void)
13561 {
13562 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
13563   ;
13564   return 0;
13565 }
13566 _ACEOF
13567 rm -f conftest.$ac_objext
13568 if { (eval echo "$as_me:13568: \"$ac_compile\"") >&5
13569   (eval $ac_compile) 2>&5
13570   ac_status=$?
13571   echo "$as_me:13571: \$? = $ac_status" >&5
13572   (exit $ac_status); } &&
13573          { ac_try='test -s conftest.$ac_objext'
13574   { (eval echo "$as_me:13574: \"$ac_try\"") >&5
13575   (eval $ac_try) 2>&5
13576   ac_status=$?
13577   echo "$as_me:13577: \$? = $ac_status" >&5
13578   (exit $ac_status); }; }; then
13579   ac_lo=0 ac_mid=0
13580   while :; do
13581     cat >conftest.$ac_ext <<_ACEOF
13582 #line 13582 "configure"
13583 #include "confdefs.h"
13584 $ac_includes_default
13585 int
13586 main (void)
13587 {
13588 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13589   ;
13590   return 0;
13591 }
13592 _ACEOF
13593 rm -f conftest.$ac_objext
13594 if { (eval echo "$as_me:13594: \"$ac_compile\"") >&5
13595   (eval $ac_compile) 2>&5
13596   ac_status=$?
13597   echo "$as_me:13597: \$? = $ac_status" >&5
13598   (exit $ac_status); } &&
13599          { ac_try='test -s conftest.$ac_objext'
13600   { (eval echo "$as_me:13600: \"$ac_try\"") >&5
13601   (eval $ac_try) 2>&5
13602   ac_status=$?
13603   echo "$as_me:13603: \$? = $ac_status" >&5
13604   (exit $ac_status); }; }; then
13605   ac_hi=$ac_mid; break
13606 else
13607   echo "$as_me: failed program was:" >&5
13608 cat conftest.$ac_ext >&5
13609 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
13610 fi
13611 rm -f conftest.$ac_objext conftest.$ac_ext
13612   done
13613 else
13614   echo "$as_me: failed program was:" >&5
13615 cat conftest.$ac_ext >&5
13616 ac_hi=-1 ac_mid=-1
13617   while :; do
13618     cat >conftest.$ac_ext <<_ACEOF
13619 #line 13619 "configure"
13620 #include "confdefs.h"
13621 $ac_includes_default
13622 int
13623 main (void)
13624 {
13625 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
13626   ;
13627   return 0;
13628 }
13629 _ACEOF
13630 rm -f conftest.$ac_objext
13631 if { (eval echo "$as_me:13631: \"$ac_compile\"") >&5
13632   (eval $ac_compile) 2>&5
13633   ac_status=$?
13634   echo "$as_me:13634: \$? = $ac_status" >&5
13635   (exit $ac_status); } &&
13636          { ac_try='test -s conftest.$ac_objext'
13637   { (eval echo "$as_me:13637: \"$ac_try\"") >&5
13638   (eval $ac_try) 2>&5
13639   ac_status=$?
13640   echo "$as_me:13640: \$? = $ac_status" >&5
13641   (exit $ac_status); }; }; then
13642   ac_lo=$ac_mid; break
13643 else
13644   echo "$as_me: failed program was:" >&5
13645 cat conftest.$ac_ext >&5
13646 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
13647 fi
13648 rm -f conftest.$ac_objext conftest.$ac_ext
13649   done
13650 fi
13651 rm -f conftest.$ac_objext conftest.$ac_ext
13652 # Binary search between lo and hi bounds.
13653 while test "x$ac_lo" != "x$ac_hi"; do
13654   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
13655   cat >conftest.$ac_ext <<_ACEOF
13656 #line 13656 "configure"
13657 #include "confdefs.h"
13658 $ac_includes_default
13659 int
13660 main (void)
13661 {
13662 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
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   ac_hi=$ac_mid
13680 else
13681   echo "$as_me: failed program was:" >&5
13682 cat conftest.$ac_ext >&5
13683 ac_lo=`expr $ac_mid + 1`
13684 fi
13685 rm -f conftest.$ac_objext conftest.$ac_ext
13686 done
13687 ac_cv_sizeof_signed_char=$ac_lo
13688 else
13689   if test "$cross_compiling" = yes; then
13690   { { echo "$as_me:13690: error: cannot run test program while cross compiling" >&5
13691 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
13692    { (exit 1); exit 1; }; }
13693 else
13694   cat >conftest.$ac_ext <<_ACEOF
13695 #line 13695 "configure"
13696 #include "confdefs.h"
13697 $ac_includes_default
13698 int
13699 main (void)
13700 {
13701 FILE *f = fopen ("conftest.val", "w");
13702 if (!f)
13703   $ac_main_return (1);
13704 fprintf (f, "%d", (sizeof (signed char)));
13705 fclose (f);
13706   ;
13707   return 0;
13708 }
13709 _ACEOF
13710 rm -f conftest$ac_exeext
13711 if { (eval echo "$as_me:13711: \"$ac_link\"") >&5
13712   (eval $ac_link) 2>&5
13713   ac_status=$?
13714   echo "$as_me:13714: \$? = $ac_status" >&5
13715   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13716   { (eval echo "$as_me:13716: \"$ac_try\"") >&5
13717   (eval $ac_try) 2>&5
13718   ac_status=$?
13719   echo "$as_me:13719: \$? = $ac_status" >&5
13720   (exit $ac_status); }; }; then
13721   ac_cv_sizeof_signed_char=`cat conftest.val`
13722 else
13723   echo "$as_me: program exited with status $ac_status" >&5
13724 echo "$as_me: failed program was:" >&5
13725 cat conftest.$ac_ext >&5
13726 fi
13727 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13728 fi
13729 fi
13730 rm -f conftest.val
13731 else
13732   ac_cv_sizeof_signed_char=0
13733 fi
13734 fi
13735 echo "$as_me:13735: result: $ac_cv_sizeof_signed_char" >&5
13736 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13737 cat >>confdefs.h <<EOF
13738 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13739 EOF
13740
13741 echo "$as_me:13741: checking for ANSI C header files" >&5
13742 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13743 if test "${ac_cv_header_stdc+set}" = set; then
13744   echo $ECHO_N "(cached) $ECHO_C" >&6
13745 else
13746   cat >conftest.$ac_ext <<_ACEOF
13747 #line 13747 "configure"
13748 #include "confdefs.h"
13749 #include <stdlib.h>
13750 #include <stdarg.h>
13751 #include <string.h>
13752 #include <float.h>
13753
13754 _ACEOF
13755 if { (eval echo "$as_me:13755: \"$ac_cpp conftest.$ac_ext\"") >&5
13756   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13757   ac_status=$?
13758   egrep -v '^ *\+' conftest.er1 >conftest.err
13759   rm -f conftest.er1
13760   cat conftest.err >&5
13761   echo "$as_me:13761: \$? = $ac_status" >&5
13762   (exit $ac_status); } >/dev/null; then
13763   if test -s conftest.err; then
13764     ac_cpp_err=$ac_c_preproc_warn_flag
13765   else
13766     ac_cpp_err=
13767   fi
13768 else
13769   ac_cpp_err=yes
13770 fi
13771 if test -z "$ac_cpp_err"; then
13772   ac_cv_header_stdc=yes
13773 else
13774   echo "$as_me: failed program was:" >&5
13775   cat conftest.$ac_ext >&5
13776   ac_cv_header_stdc=no
13777 fi
13778 rm -f conftest.err conftest.$ac_ext
13779
13780 if test $ac_cv_header_stdc = yes; then
13781   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13782   cat >conftest.$ac_ext <<_ACEOF
13783 #line 13783 "configure"
13784 #include "confdefs.h"
13785 #include <string.h>
13786
13787 _ACEOF
13788 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13789   egrep "memchr" >/dev/null 2>&1; then
13790   :
13791 else
13792   ac_cv_header_stdc=no
13793 fi
13794 rm -rf conftest*
13795
13796 fi
13797
13798 if test $ac_cv_header_stdc = yes; then
13799   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13800   cat >conftest.$ac_ext <<_ACEOF
13801 #line 13801 "configure"
13802 #include "confdefs.h"
13803 #include <stdlib.h>
13804
13805 _ACEOF
13806 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13807   egrep "free" >/dev/null 2>&1; then
13808   :
13809 else
13810   ac_cv_header_stdc=no
13811 fi
13812 rm -rf conftest*
13813
13814 fi
13815
13816 if test $ac_cv_header_stdc = yes; then
13817   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13818   if test "$cross_compiling" = yes; then
13819   :
13820 else
13821   cat >conftest.$ac_ext <<_ACEOF
13822 #line 13822 "configure"
13823 #include "confdefs.h"
13824 #include <ctype.h>
13825 #if ((' ' & 0x0FF) == 0x020)
13826 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13827 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13828 #else
13829 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13830                      || ('j' <= (c) && (c) <= 'r') \
13831                      || ('s' <= (c) && (c) <= 'z'))
13832 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13833 #endif
13834
13835 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13836 int
13837 main (void)
13838 {
13839   int i;
13840   for (i = 0; i < 256; i++)
13841     if (XOR (islower (i), ISLOWER (i))
13842         || toupper (i) != TOUPPER (i))
13843       $ac_main_return(2);
13844   $ac_main_return (0);
13845 }
13846 _ACEOF
13847 rm -f conftest$ac_exeext
13848 if { (eval echo "$as_me:13848: \"$ac_link\"") >&5
13849   (eval $ac_link) 2>&5
13850   ac_status=$?
13851   echo "$as_me:13851: \$? = $ac_status" >&5
13852   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13853   { (eval echo "$as_me:13853: \"$ac_try\"") >&5
13854   (eval $ac_try) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); }; }; then
13858   :
13859 else
13860   echo "$as_me: program exited with status $ac_status" >&5
13861 echo "$as_me: failed program was:" >&5
13862 cat conftest.$ac_ext >&5
13863 ac_cv_header_stdc=no
13864 fi
13865 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13866 fi
13867 fi
13868 fi
13869 echo "$as_me:13869: result: $ac_cv_header_stdc" >&5
13870 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13871 if test $ac_cv_header_stdc = yes; then
13872
13873 cat >>confdefs.h <<\EOF
13874 #define STDC_HEADERS 1
13875 EOF
13876
13877 fi
13878
13879 ac_header_dirent=no
13880 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13881   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13882 echo "$as_me:13882: checking for $ac_hdr that defines DIR" >&5
13883 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13884 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13885   echo $ECHO_N "(cached) $ECHO_C" >&6
13886 else
13887   cat >conftest.$ac_ext <<_ACEOF
13888 #line 13888 "configure"
13889 #include "confdefs.h"
13890 #include <sys/types.h>
13891 #include <$ac_hdr>
13892
13893 int
13894 main (void)
13895 {
13896 if ((DIR *) 0)
13897 return 0;
13898   ;
13899   return 0;
13900 }
13901 _ACEOF
13902 rm -f conftest.$ac_objext
13903 if { (eval echo "$as_me:13903: \"$ac_compile\"") >&5
13904   (eval $ac_compile) 2>&5
13905   ac_status=$?
13906   echo "$as_me:13906: \$? = $ac_status" >&5
13907   (exit $ac_status); } &&
13908          { ac_try='test -s conftest.$ac_objext'
13909   { (eval echo "$as_me:13909: \"$ac_try\"") >&5
13910   (eval $ac_try) 2>&5
13911   ac_status=$?
13912   echo "$as_me:13912: \$? = $ac_status" >&5
13913   (exit $ac_status); }; }; then
13914   eval "$as_ac_Header=yes"
13915 else
13916   echo "$as_me: failed program was:" >&5
13917 cat conftest.$ac_ext >&5
13918 eval "$as_ac_Header=no"
13919 fi
13920 rm -f conftest.$ac_objext conftest.$ac_ext
13921 fi
13922 echo "$as_me:13922: result: `eval echo '${'$as_ac_Header'}'`" >&5
13923 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13924 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13925   cat >>confdefs.h <<EOF
13926 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13927 EOF
13928
13929 ac_header_dirent=$ac_hdr; break
13930 fi
13931
13932 done
13933 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13934 if test $ac_header_dirent = dirent.h; then
13935   echo "$as_me:13935: checking for opendir in -ldir" >&5
13936 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13937 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13938   echo $ECHO_N "(cached) $ECHO_C" >&6
13939 else
13940   ac_check_lib_save_LIBS=$LIBS
13941 LIBS="-ldir  $LIBS"
13942 cat >conftest.$ac_ext <<_ACEOF
13943 #line 13943 "configure"
13944 #include "confdefs.h"
13945
13946 /* Override any gcc2 internal prototype to avoid an error.  */
13947 #ifdef __cplusplus
13948 extern "C"
13949 #endif
13950 /* We use char because int might match the return type of a gcc2
13951    builtin and then its argument prototype would still apply.  */
13952 char opendir ();
13953 int
13954 main (void)
13955 {
13956 opendir ();
13957   ;
13958   return 0;
13959 }
13960 _ACEOF
13961 rm -f conftest.$ac_objext conftest$ac_exeext
13962 if { (eval echo "$as_me:13962: \"$ac_link\"") >&5
13963   (eval $ac_link) 2>&5
13964   ac_status=$?
13965   echo "$as_me:13965: \$? = $ac_status" >&5
13966   (exit $ac_status); } &&
13967          { ac_try='test -s conftest$ac_exeext'
13968   { (eval echo "$as_me:13968: \"$ac_try\"") >&5
13969   (eval $ac_try) 2>&5
13970   ac_status=$?
13971   echo "$as_me:13971: \$? = $ac_status" >&5
13972   (exit $ac_status); }; }; then
13973   ac_cv_lib_dir_opendir=yes
13974 else
13975   echo "$as_me: failed program was:" >&5
13976 cat conftest.$ac_ext >&5
13977 ac_cv_lib_dir_opendir=no
13978 fi
13979 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13980 LIBS=$ac_check_lib_save_LIBS
13981 fi
13982 echo "$as_me:13982: result: $ac_cv_lib_dir_opendir" >&5
13983 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13984 if test $ac_cv_lib_dir_opendir = yes; then
13985   LIBS="$LIBS -ldir"
13986 fi
13987
13988 else
13989   echo "$as_me:13989: checking for opendir in -lx" >&5
13990 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13991 if test "${ac_cv_lib_x_opendir+set}" = set; then
13992   echo $ECHO_N "(cached) $ECHO_C" >&6
13993 else
13994   ac_check_lib_save_LIBS=$LIBS
13995 LIBS="-lx  $LIBS"
13996 cat >conftest.$ac_ext <<_ACEOF
13997 #line 13997 "configure"
13998 #include "confdefs.h"
13999
14000 /* Override any gcc2 internal prototype to avoid an error.  */
14001 #ifdef __cplusplus
14002 extern "C"
14003 #endif
14004 /* We use char because int might match the return type of a gcc2
14005    builtin and then its argument prototype would still apply.  */
14006 char opendir ();
14007 int
14008 main (void)
14009 {
14010 opendir ();
14011   ;
14012   return 0;
14013 }
14014 _ACEOF
14015 rm -f conftest.$ac_objext conftest$ac_exeext
14016 if { (eval echo "$as_me:14016: \"$ac_link\"") >&5
14017   (eval $ac_link) 2>&5
14018   ac_status=$?
14019   echo "$as_me:14019: \$? = $ac_status" >&5
14020   (exit $ac_status); } &&
14021          { ac_try='test -s conftest$ac_exeext'
14022   { (eval echo "$as_me:14022: \"$ac_try\"") >&5
14023   (eval $ac_try) 2>&5
14024   ac_status=$?
14025   echo "$as_me:14025: \$? = $ac_status" >&5
14026   (exit $ac_status); }; }; then
14027   ac_cv_lib_x_opendir=yes
14028 else
14029   echo "$as_me: failed program was:" >&5
14030 cat conftest.$ac_ext >&5
14031 ac_cv_lib_x_opendir=no
14032 fi
14033 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14034 LIBS=$ac_check_lib_save_LIBS
14035 fi
14036 echo "$as_me:14036: result: $ac_cv_lib_x_opendir" >&5
14037 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
14038 if test $ac_cv_lib_x_opendir = yes; then
14039   LIBS="$LIBS -lx"
14040 fi
14041
14042 fi
14043
14044 echo "$as_me:14044: checking whether time.h and sys/time.h may both be included" >&5
14045 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14046 if test "${ac_cv_header_time+set}" = set; then
14047   echo $ECHO_N "(cached) $ECHO_C" >&6
14048 else
14049   cat >conftest.$ac_ext <<_ACEOF
14050 #line 14050 "configure"
14051 #include "confdefs.h"
14052 #include <sys/types.h>
14053 #include <sys/time.h>
14054 #include <time.h>
14055
14056 int
14057 main (void)
14058 {
14059 if ((struct tm *) 0)
14060 return 0;
14061   ;
14062   return 0;
14063 }
14064 _ACEOF
14065 rm -f conftest.$ac_objext
14066 if { (eval echo "$as_me:14066: \"$ac_compile\"") >&5
14067   (eval $ac_compile) 2>&5
14068   ac_status=$?
14069   echo "$as_me:14069: \$? = $ac_status" >&5
14070   (exit $ac_status); } &&
14071          { ac_try='test -s conftest.$ac_objext'
14072   { (eval echo "$as_me:14072: \"$ac_try\"") >&5
14073   (eval $ac_try) 2>&5
14074   ac_status=$?
14075   echo "$as_me:14075: \$? = $ac_status" >&5
14076   (exit $ac_status); }; }; then
14077   ac_cv_header_time=yes
14078 else
14079   echo "$as_me: failed program was:" >&5
14080 cat conftest.$ac_ext >&5
14081 ac_cv_header_time=no
14082 fi
14083 rm -f conftest.$ac_objext conftest.$ac_ext
14084 fi
14085 echo "$as_me:14085: result: $ac_cv_header_time" >&5
14086 echo "${ECHO_T}$ac_cv_header_time" >&6
14087 if test $ac_cv_header_time = yes; then
14088
14089 cat >>confdefs.h <<\EOF
14090 #define TIME_WITH_SYS_TIME 1
14091 EOF
14092
14093 fi
14094
14095 ###     checks for compiler characteristics
14096 ac_ext=c
14097 ac_cpp='$CPP $CPPFLAGS'
14098 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14099 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14100 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14101 ac_main_return=return
14102
14103 echo "$as_me:14103: checking for an ANSI C-conforming const" >&5
14104 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
14105 if test "${ac_cv_c_const+set}" = set; then
14106   echo $ECHO_N "(cached) $ECHO_C" >&6
14107 else
14108   cat >conftest.$ac_ext <<_ACEOF
14109 #line 14109 "configure"
14110 #include "confdefs.h"
14111
14112 int
14113 main (void)
14114 {
14115 /* FIXME: Include the comments suggested by Paul. */
14116 #ifndef __cplusplus
14117   /* Ultrix mips cc rejects this.  */
14118   typedef int charset[2];
14119   const charset x;
14120   /* SunOS 4.1.1 cc rejects this.  */
14121   char const *const *ccp;
14122   char **p;
14123   /* NEC SVR4.0.2 mips cc rejects this.  */
14124   struct point {int x, y;};
14125   static struct point const zero = {0,0};
14126   /* AIX XL C 1.02.0.0 rejects this.
14127      It does not let you subtract one const X* pointer from another in
14128      an arm of an if-expression whose if-part is not a constant
14129      expression */
14130   const char *g = "string";
14131   ccp = &g + (g ? g-g : 0);
14132   /* HPUX 7.0 cc rejects these. */
14133   ++ccp;
14134   p = (char**) ccp;
14135   ccp = (char const *const *) p;
14136   { /* SCO 3.2v4 cc rejects this.  */
14137     char *t;
14138     char const *s = 0 ? (char *) 0 : (char const *) 0;
14139
14140     *t++ = 0;
14141   }
14142   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14143     int x[] = {25, 17};
14144     const int *foo = &x[0];
14145     ++foo;
14146   }
14147   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14148     typedef const int *iptr;
14149     iptr p = 0;
14150     ++p;
14151   }
14152   { /* AIX XL C 1.02.0.0 rejects this saying
14153        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14154     struct s { int j; const int *ap[3]; };
14155     struct s *b; b->j = 5;
14156   }
14157   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14158     const int foo = 10;
14159   }
14160 #endif
14161
14162   ;
14163   return 0;
14164 }
14165 _ACEOF
14166 rm -f conftest.$ac_objext
14167 if { (eval echo "$as_me:14167: \"$ac_compile\"") >&5
14168   (eval $ac_compile) 2>&5
14169   ac_status=$?
14170   echo "$as_me:14170: \$? = $ac_status" >&5
14171   (exit $ac_status); } &&
14172          { ac_try='test -s conftest.$ac_objext'
14173   { (eval echo "$as_me:14173: \"$ac_try\"") >&5
14174   (eval $ac_try) 2>&5
14175   ac_status=$?
14176   echo "$as_me:14176: \$? = $ac_status" >&5
14177   (exit $ac_status); }; }; then
14178   ac_cv_c_const=yes
14179 else
14180   echo "$as_me: failed program was:" >&5
14181 cat conftest.$ac_ext >&5
14182 ac_cv_c_const=no
14183 fi
14184 rm -f conftest.$ac_objext conftest.$ac_ext
14185 fi
14186 echo "$as_me:14186: result: $ac_cv_c_const" >&5
14187 echo "${ECHO_T}$ac_cv_c_const" >&6
14188 if test $ac_cv_c_const = no; then
14189
14190 cat >>confdefs.h <<\EOF
14191 #define const
14192 EOF
14193
14194 fi
14195
14196 ###     Checks for external-data
14197
14198 echo "$as_me:14198: checking if data-only library module links" >&5
14199 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
14200 if test "${cf_cv_link_dataonly+set}" = set; then
14201   echo $ECHO_N "(cached) $ECHO_C" >&6
14202 else
14203
14204         rm -f conftest.a
14205         cat >conftest.$ac_ext <<EOF
14206 #line 14206 "configure"
14207 int     testdata[3] = { 123, 456, 789 };
14208 EOF
14209         if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5
14210   (eval $ac_compile) 2>&5
14211   ac_status=$?
14212   echo "$as_me:14212: \$? = $ac_status" >&5
14213   (exit $ac_status); } ; then
14214                 mv conftest.o data.o && \
14215                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
14216         fi
14217         rm -f conftest.$ac_ext data.o
14218         cat >conftest.$ac_ext <<EOF
14219 #line 14219 "configure"
14220 int     testfunc(void)
14221 {
14222 #if defined(NeXT)
14223         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
14224 #else
14225         extern int testdata[3];
14226         return testdata[0] == 123
14227            &&  testdata[1] == 456
14228            &&  testdata[2] == 789;
14229 #endif
14230 }
14231 EOF
14232         if { (eval echo "$as_me:14232: \"$ac_compile\"") >&5
14233   (eval $ac_compile) 2>&5
14234   ac_status=$?
14235   echo "$as_me:14235: \$? = $ac_status" >&5
14236   (exit $ac_status); }; then
14237                 mv conftest.o func.o && \
14238                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
14239         fi
14240         rm -f conftest.$ac_ext func.o
14241         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
14242         cf_saveLIBS="$LIBS"
14243         LIBS="conftest.a $LIBS"
14244         if test "$cross_compiling" = yes; then
14245   cf_cv_link_dataonly=unknown
14246 else
14247   cat >conftest.$ac_ext <<_ACEOF
14248 #line 14248 "configure"
14249 #include "confdefs.h"
14250
14251         int main(void)
14252         {
14253                 extern int testfunc();
14254                 ${cf_cv_main_return:-return} (!testfunc());
14255         }
14256
14257 _ACEOF
14258 rm -f conftest$ac_exeext
14259 if { (eval echo "$as_me:14259: \"$ac_link\"") >&5
14260   (eval $ac_link) 2>&5
14261   ac_status=$?
14262   echo "$as_me:14262: \$? = $ac_status" >&5
14263   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14264   { (eval echo "$as_me:14264: \"$ac_try\"") >&5
14265   (eval $ac_try) 2>&5
14266   ac_status=$?
14267   echo "$as_me:14267: \$? = $ac_status" >&5
14268   (exit $ac_status); }; }; then
14269   cf_cv_link_dataonly=yes
14270 else
14271   echo "$as_me: program exited with status $ac_status" >&5
14272 echo "$as_me: failed program was:" >&5
14273 cat conftest.$ac_ext >&5
14274 cf_cv_link_dataonly=no
14275 fi
14276 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14277 fi
14278         LIBS="$cf_saveLIBS"
14279
14280 fi
14281
14282 echo "$as_me:14282: result: $cf_cv_link_dataonly" >&5
14283 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
14284
14285 if test "$cf_cv_link_dataonly" = no ; then
14286
14287 cat >>confdefs.h <<\EOF
14288 #define BROKEN_LINKER 1
14289 EOF
14290
14291         BROKEN_LINKER=1
14292 fi
14293
14294 ###     Checks for library functions.
14295
14296 for ac_header in \
14297 unistd.h \
14298
14299 do
14300 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14301 echo "$as_me:14301: checking for $ac_header" >&5
14302 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14303 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14304   echo $ECHO_N "(cached) $ECHO_C" >&6
14305 else
14306   cat >conftest.$ac_ext <<_ACEOF
14307 #line 14307 "configure"
14308 #include "confdefs.h"
14309 #include <$ac_header>
14310 _ACEOF
14311 if { (eval echo "$as_me:14311: \"$ac_cpp conftest.$ac_ext\"") >&5
14312   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14313   ac_status=$?
14314   egrep -v '^ *\+' conftest.er1 >conftest.err
14315   rm -f conftest.er1
14316   cat conftest.err >&5
14317   echo "$as_me:14317: \$? = $ac_status" >&5
14318   (exit $ac_status); } >/dev/null; then
14319   if test -s conftest.err; then
14320     ac_cpp_err=$ac_c_preproc_warn_flag
14321   else
14322     ac_cpp_err=
14323   fi
14324 else
14325   ac_cpp_err=yes
14326 fi
14327 if test -z "$ac_cpp_err"; then
14328   eval "$as_ac_Header=yes"
14329 else
14330   echo "$as_me: failed program was:" >&5
14331   cat conftest.$ac_ext >&5
14332   eval "$as_ac_Header=no"
14333 fi
14334 rm -f conftest.err conftest.$ac_ext
14335 fi
14336 echo "$as_me:14336: result: `eval echo '${'$as_ac_Header'}'`" >&5
14337 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14338 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14339   cat >>confdefs.h <<EOF
14340 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14341 EOF
14342
14343 fi
14344 done
14345
14346 echo "$as_me:14346: checking for working mkstemp" >&5
14347 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
14348 if test "${cf_cv_func_mkstemp+set}" = set; then
14349   echo $ECHO_N "(cached) $ECHO_C" >&6
14350 else
14351
14352 rm -rf conftest*
14353 if test "$cross_compiling" = yes; then
14354   cf_cv_func_mkstemp=maybe
14355 else
14356   cat >conftest.$ac_ext <<_ACEOF
14357 #line 14357 "configure"
14358 #include "confdefs.h"
14359
14360 #include <sys/types.h>
14361 #ifdef HAVE_UNISTD_H
14362 #include <unistd.h>
14363 #endif
14364 #include <stdlib.h>
14365 #include <stdio.h>
14366 #include <string.h>
14367 #include <sys/stat.h>
14368 int main(void)
14369 {
14370         char *tmpl = "conftestXXXXXX";
14371         char name[2][80];
14372         int n;
14373         int result = 0;
14374         int fd;
14375         struct stat sb;
14376
14377         umask(077);
14378         for (n = 0; n < 2; ++n) {
14379                 strcpy(name[n], tmpl);
14380                 if ((fd = mkstemp(name[n])) >= 0) {
14381                         if (!strcmp(name[n], tmpl)
14382                          || stat(name[n], &sb) != 0
14383                          || (sb.st_mode & S_IFMT) != S_IFREG
14384                          || (sb.st_mode & 077) != 0) {
14385                                 result = 1;
14386                         }
14387                         close(fd);
14388                 }
14389         }
14390         if (result == 0
14391          && !strcmp(name[0], name[1]))
14392                 result = 1;
14393         ${cf_cv_main_return:-return}(result);
14394 }
14395
14396 _ACEOF
14397 rm -f conftest$ac_exeext
14398 if { (eval echo "$as_me:14398: \"$ac_link\"") >&5
14399   (eval $ac_link) 2>&5
14400   ac_status=$?
14401   echo "$as_me:14401: \$? = $ac_status" >&5
14402   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14403   { (eval echo "$as_me:14403: \"$ac_try\"") >&5
14404   (eval $ac_try) 2>&5
14405   ac_status=$?
14406   echo "$as_me:14406: \$? = $ac_status" >&5
14407   (exit $ac_status); }; }; then
14408   cf_cv_func_mkstemp=yes
14409
14410 else
14411   echo "$as_me: program exited with status $ac_status" >&5
14412 echo "$as_me: failed program was:" >&5
14413 cat conftest.$ac_ext >&5
14414 cf_cv_func_mkstemp=no
14415
14416 fi
14417 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14418 fi
14419
14420 fi
14421 echo "$as_me:14421: result: $cf_cv_func_mkstemp" >&5
14422 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
14423 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
14424         echo "$as_me:14424: checking for mkstemp" >&5
14425 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
14426 if test "${ac_cv_func_mkstemp+set}" = set; then
14427   echo $ECHO_N "(cached) $ECHO_C" >&6
14428 else
14429   cat >conftest.$ac_ext <<_ACEOF
14430 #line 14430 "configure"
14431 #include "confdefs.h"
14432 /* System header to define __stub macros and hopefully few prototypes,
14433     which can conflict with char mkstemp (); below.  */
14434 #include <assert.h>
14435 /* Override any gcc2 internal prototype to avoid an error.  */
14436 #ifdef __cplusplus
14437 extern "C"
14438 #endif
14439 /* We use char because int might match the return type of a gcc2
14440    builtin and then its argument prototype would still apply.  */
14441 char mkstemp ();
14442 char (*f) ();
14443
14444 int
14445 main (void)
14446 {
14447 /* The GNU C library defines this for functions which it implements
14448     to always fail with ENOSYS.  Some functions are actually named
14449     something starting with __ and the normal name is an alias.  */
14450 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
14451 choke me
14452 #else
14453 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14454 #endif
14455
14456   ;
14457   return 0;
14458 }
14459 _ACEOF
14460 rm -f conftest.$ac_objext conftest$ac_exeext
14461 if { (eval echo "$as_me:14461: \"$ac_link\"") >&5
14462   (eval $ac_link) 2>&5
14463   ac_status=$?
14464   echo "$as_me:14464: \$? = $ac_status" >&5
14465   (exit $ac_status); } &&
14466          { ac_try='test -s conftest$ac_exeext'
14467   { (eval echo "$as_me:14467: \"$ac_try\"") >&5
14468   (eval $ac_try) 2>&5
14469   ac_status=$?
14470   echo "$as_me:14470: \$? = $ac_status" >&5
14471   (exit $ac_status); }; }; then
14472   ac_cv_func_mkstemp=yes
14473 else
14474   echo "$as_me: failed program was:" >&5
14475 cat conftest.$ac_ext >&5
14476 ac_cv_func_mkstemp=no
14477 fi
14478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14479 fi
14480 echo "$as_me:14480: result: $ac_cv_func_mkstemp" >&5
14481 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
14482
14483 fi
14484 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
14485
14486 cat >>confdefs.h <<\EOF
14487 #define HAVE_MKSTEMP 1
14488 EOF
14489
14490 fi
14491
14492 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
14493         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14494         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14495 fi
14496
14497 cf_with_ada=yes
14498 if test "$cf_with_ada" != "no" ; then
14499
14500 cf_ada_make=gnatmake
14501 cf_ada_config="#"
14502 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
14503 set dummy $cf_ada_make; ac_word=$2
14504 echo "$as_me:14504: checking for $ac_word" >&5
14505 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14506 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
14507   echo $ECHO_N "(cached) $ECHO_C" >&6
14508 else
14509   if test -n "$gnatmake_exists"; then
14510   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
14511 else
14512   ac_save_IFS=$IFS; IFS=$ac_path_separator
14513 ac_dummy="$PATH"
14514 for ac_dir in $ac_dummy; do
14515   IFS=$ac_save_IFS
14516   test -z "$ac_dir" && ac_dir=.
14517   $as_executable_p "$ac_dir/$ac_word" || continue
14518 ac_cv_prog_gnatmake_exists="yes"
14519 echo "$as_me:14519: found $ac_dir/$ac_word" >&5
14520 break
14521 done
14522
14523   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
14524 fi
14525 fi
14526 gnatmake_exists=$ac_cv_prog_gnatmake_exists
14527 if test -n "$gnatmake_exists"; then
14528   echo "$as_me:14528: result: $gnatmake_exists" >&5
14529 echo "${ECHO_T}$gnatmake_exists" >&6
14530 else
14531   echo "$as_me:14531: result: no" >&5
14532 echo "${ECHO_T}no" >&6
14533 fi
14534
14535 if test "$ac_cv_prog_gnatmake_exists" = no; then
14536         cf_ada_make=
14537         cf_cv_prog_gnat_correct=no
14538 else
14539         # Extract the first word of "gprconfig", so it can be a program name with args.
14540 set dummy gprconfig; ac_word=$2
14541 echo "$as_me:14541: checking for $ac_word" >&5
14542 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14543 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
14544   echo $ECHO_N "(cached) $ECHO_C" >&6
14545 else
14546   if test -n "$gprconfig_exists"; then
14547   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
14548 else
14549   ac_save_IFS=$IFS; IFS=$ac_path_separator
14550 ac_dummy="$PATH"
14551 for ac_dir in $ac_dummy; do
14552   IFS=$ac_save_IFS
14553   test -z "$ac_dir" && ac_dir=.
14554   $as_executable_p "$ac_dir/$ac_word" || continue
14555 ac_cv_prog_gprconfig_exists="yes"
14556 echo "$as_me:14556: found $ac_dir/$ac_word" >&5
14557 break
14558 done
14559
14560   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
14561 fi
14562 fi
14563 gprconfig_exists=$ac_cv_prog_gprconfig_exists
14564 if test -n "$gprconfig_exists"; then
14565   echo "$as_me:14565: result: $gprconfig_exists" >&5
14566 echo "${ECHO_T}$gprconfig_exists" >&6
14567 else
14568   echo "$as_me:14568: result: no" >&5
14569 echo "${ECHO_T}no" >&6
14570 fi
14571
14572         if test "$ac_cv_prog_gprconfig_exists" = yes
14573         then
14574                 rm -rf conftest* *~conftest*
14575                 if mkdir conftest.src
14576                 then
14577                         cf_ada_config=""
14578                         cd conftest.src
14579                         for cf_gprconfig in Ada C
14580                         do
14581                                 echo "$as_me:14581: checking for gprconfig name for $cf_gprconfig" >&5
14582 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
14583                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
14584                                 if test -n "$cf_gprconfig_value"
14585                                 then
14586                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
14587                                         echo "$as_me:14587: result: $cf_gprconfig_value" >&5
14588 echo "${ECHO_T}$cf_gprconfig_value" >&6
14589                                 else
14590                                         echo "$as_me:14590: result: missing" >&5
14591 echo "${ECHO_T}missing" >&6
14592                                         cf_ada_config="#"
14593                                         break
14594                                 fi
14595                         done
14596                         cd ..
14597                         rm -rf conftest* *~conftest*
14598                 fi
14599         else
14600                 # gprconfig is newer than gnatmake; we can continue...
14601                 cf_ada_config="##"
14602         fi
14603         if test "x$cf_ada_config" != "x#"
14604         then
14605
14606 echo "$as_me:14606: checking for gnat version" >&5
14607 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
14608 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
14609         grep '[0-9].[0-9][0-9]*' |\
14610         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
14611 echo "$as_me:14611: result: $cf_gnat_version" >&5
14612 echo "${ECHO_T}$cf_gnat_version" >&6
14613
14614 case $cf_gnat_version in
14615 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
14616         cf_cv_prog_gnat_correct=yes
14617         ;;
14618 (*)
14619         { echo "$as_me:14619: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
14620 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
14621         cf_cv_prog_gnat_correct=no
14622         ;;
14623 esac
14624
14625                 # Extract the first word of "m4", so it can be a program name with args.
14626 set dummy m4; ac_word=$2
14627 echo "$as_me:14627: checking for $ac_word" >&5
14628 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14629 if test "${ac_cv_prog_M4_exists+set}" = set; then
14630   echo $ECHO_N "(cached) $ECHO_C" >&6
14631 else
14632   if test -n "$M4_exists"; then
14633   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
14634 else
14635   ac_save_IFS=$IFS; IFS=$ac_path_separator
14636 ac_dummy="$PATH"
14637 for ac_dir in $ac_dummy; do
14638   IFS=$ac_save_IFS
14639   test -z "$ac_dir" && ac_dir=.
14640   $as_executable_p "$ac_dir/$ac_word" || continue
14641 ac_cv_prog_M4_exists="yes"
14642 echo "$as_me:14642: found $ac_dir/$ac_word" >&5
14643 break
14644 done
14645
14646   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
14647 fi
14648 fi
14649 M4_exists=$ac_cv_prog_M4_exists
14650 if test -n "$M4_exists"; then
14651   echo "$as_me:14651: result: $M4_exists" >&5
14652 echo "${ECHO_T}$M4_exists" >&6
14653 else
14654   echo "$as_me:14654: result: no" >&5
14655 echo "${ECHO_T}no" >&6
14656 fi
14657
14658                 if test "$ac_cv_prog_M4_exists" = no; then
14659                         cf_cv_prog_gnat_correct=no
14660                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
14661                 fi
14662                 if test "$cf_cv_prog_gnat_correct" = yes; then
14663                         echo "$as_me:14663: checking if GNAT works" >&5
14664 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
14665
14666 rm -rf conftest* *~conftest*
14667 cat >>conftest.ads <<CF_EOF
14668 procedure conftest;
14669 CF_EOF
14670 cat >>conftest.adb <<CF_EOF
14671 with Text_IO;
14672 with GNAT.OS_Lib;
14673 procedure conftest is
14674 begin
14675    Text_IO.Put ("Hello World");
14676    Text_IO.New_Line;
14677    GNAT.OS_Lib.OS_Exit (0);
14678 end conftest;
14679 CF_EOF
14680 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14681    if ( ./conftest 1>&5 2>&1 ) ; then
14682       cf_cv_prog_gnat_correct=yes
14683    else
14684       cf_cv_prog_gnat_correct=no
14685    fi
14686 else
14687    cf_cv_prog_gnat_correct=no
14688 fi
14689 rm -rf conftest* *~conftest*
14690
14691                         echo "$as_me:14691: result: $cf_cv_prog_gnat_correct" >&5
14692 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
14693                 fi
14694         else
14695                 cf_cv_prog_gnat_correct=no
14696         fi
14697 fi
14698
14699         if test "$cf_cv_prog_gnat_correct" = yes; then
14700
14701         echo "$as_me:14701: checking optimization options for ADAFLAGS" >&5
14702 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
14703         case "$CFLAGS" in
14704         (*-g*)
14705
14706         ADAFLAGS="$ADAFLAGS -g"
14707
14708                 ;;
14709         esac
14710         case "$CFLAGS" in
14711         (*-O*)
14712                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
14713
14714         ADAFLAGS="$ADAFLAGS $cf_O_flag"
14715
14716                 ;;
14717         esac
14718         echo "$as_me:14718: result: $ADAFLAGS" >&5
14719 echo "${ECHO_T}$ADAFLAGS" >&6
14720
14721 echo "$as_me:14721: checking if GNATPREP supports -T option" >&5
14722 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
14723 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
14724   echo $ECHO_N "(cached) $ECHO_C" >&6
14725 else
14726
14727 cf_cv_gnatprep_opt_t=no
14728 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
14729
14730 fi
14731 echo "$as_me:14731: result: $cf_cv_gnatprep_opt_t" >&5
14732 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
14733 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
14734
14735 echo "$as_me:14735: checking if GNAT supports generics" >&5
14736 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
14737 case $cf_gnat_version in
14738 (3.[1-9]*|[4-9].*)
14739         cf_gnat_generics=yes
14740         ;;
14741 (*)
14742         cf_gnat_generics=no
14743         ;;
14744 esac
14745 echo "$as_me:14745: result: $cf_gnat_generics" >&5
14746 echo "${ECHO_T}$cf_gnat_generics" >&6
14747
14748 if test "$cf_gnat_generics" = yes
14749 then
14750         cf_compile_generics=generics
14751         cf_generic_objects="\${GENOBJS}"
14752 else
14753         cf_compile_generics=
14754         cf_generic_objects=
14755 fi
14756
14757 echo "$as_me:14757: checking if GNAT supports SIGINT" >&5
14758 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
14759 if test "${cf_cv_gnat_sigint+set}" = set; then
14760   echo $ECHO_N "(cached) $ECHO_C" >&6
14761 else
14762
14763 rm -rf conftest* *~conftest*
14764 cat >>conftest.ads <<CF_EOF
14765 with Ada.Interrupts.Names;
14766
14767 package ConfTest is
14768
14769    pragma Warnings (Off);  --  the next pragma exists since 3.11p
14770    pragma Unreserve_All_Interrupts;
14771    pragma Warnings (On);
14772
14773    protected Process is
14774       procedure Stop;
14775       function Continue return Boolean;
14776       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
14777    private
14778       Done : Boolean := False;
14779    end Process;
14780
14781 end ConfTest;
14782 CF_EOF
14783 cat >>conftest.adb <<CF_EOF
14784 package body ConfTest is
14785    protected body Process is
14786       procedure Stop is
14787       begin
14788          Done := True;
14789       end Stop;
14790       function Continue return Boolean is
14791       begin
14792          return not Done;
14793       end Continue;
14794    end Process;
14795 end ConfTest;
14796 CF_EOF
14797 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14798       cf_cv_gnat_sigint=yes
14799 else
14800    cf_cv_gnat_sigint=no
14801 fi
14802 rm -rf conftest* *~conftest*
14803
14804 fi
14805 echo "$as_me:14805: result: $cf_cv_gnat_sigint" >&5
14806 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
14807
14808 if test $cf_cv_gnat_sigint = yes ; then
14809         USE_GNAT_SIGINT=""
14810 else
14811         USE_GNAT_SIGINT="#"
14812 fi
14813
14814 cf_gnat_libraries=no
14815 cf_gnat_projects=no
14816
14817 if test "$enable_gnat_projects" != no ; then
14818 echo "$as_me:14818: checking if GNAT supports project files" >&5
14819 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
14820 case $cf_gnat_version in
14821 (3.[0-9]*)
14822         ;;
14823 (*)
14824         case $cf_cv_system_name in
14825         (cygwin*|msys*)
14826                 ;;
14827         (*)
14828                 rm -rf conftest* *~conftest*
14829                 if mkdir conftest.src conftest.bin conftest.lib
14830                 then
14831                         cd conftest.src
14832                         rm -rf conftest* *~conftest*
14833                         cat >>library.gpr <<CF_EOF
14834 project Library is
14835   Kind := External ("LIB_KIND");
14836   for Library_Name use "ConfTest";
14837   for Object_Dir use ".";
14838   for Library_ALI_Dir use External("LIBRARY_DIR");
14839   for Library_Version use External ("SONAME");
14840   for Library_Kind use Kind;
14841   for Library_Dir use External("BUILD_DIR");
14842   Source_Dir := External ("SOURCE_DIR");
14843   for Source_Dirs use (Source_Dir);
14844 end Library;
14845 CF_EOF
14846                         cat >>confpackage.ads <<CF_EOF
14847 package ConfPackage is
14848    procedure conftest;
14849 end ConfPackage;
14850 CF_EOF
14851                         cat >>confpackage.adb <<CF_EOF
14852 with Text_IO;
14853 package body ConfPackage is
14854    procedure conftest is
14855    begin
14856       Text_IO.Put ("Hello World");
14857       Text_IO.New_Line;
14858    end conftest;
14859 end ConfPackage;
14860 CF_EOF
14861                         if ( $cf_ada_make $ADAFLAGS \
14862                                         -Plibrary.gpr \
14863                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14864                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14865                                         -XSOURCE_DIR=`pwd` \
14866                                         -XSONAME=libConfTest.so.1 \
14867                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
14868                                 cf_gnat_projects=yes
14869                         fi
14870                         cd ..
14871                 fi
14872                 if test -f conftest.lib/confpackage.ali
14873                 then
14874                         cf_gnat_libraries=yes
14875                 fi
14876                 rm -rf conftest* *~conftest*
14877                 ;;
14878         esac
14879         ;;
14880 esac
14881 echo "$as_me:14881: result: $cf_gnat_projects" >&5
14882 echo "${ECHO_T}$cf_gnat_projects" >&6
14883 fi # enable_gnat_projects
14884
14885 if test $cf_gnat_projects = yes
14886 then
14887         echo "$as_me:14887: checking if GNAT supports libraries" >&5
14888 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14889         echo "$as_me:14889: result: $cf_gnat_libraries" >&5
14890 echo "${ECHO_T}$cf_gnat_libraries" >&6
14891 fi
14892
14893 if test "$cf_gnat_projects" = yes
14894 then
14895         USE_OLD_MAKERULES="#"
14896         USE_GNAT_PROJECTS=""
14897 else
14898         USE_OLD_MAKERULES=""
14899         USE_GNAT_PROJECTS="#"
14900 fi
14901
14902 if test "$cf_gnat_libraries" = yes
14903 then
14904         USE_GNAT_LIBRARIES=""
14905 else
14906         USE_GNAT_LIBRARIES="#"
14907 fi
14908
14909 echo "$as_me:14909: checking for ada-compiler" >&5
14910 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14911
14912 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14913 if test "${with_ada_compiler+set}" = set; then
14914   withval="$with_ada_compiler"
14915   cf_ada_compiler=$withval
14916 else
14917   cf_ada_compiler=gnatmake
14918 fi;
14919
14920 echo "$as_me:14920: result: $cf_ada_compiler" >&5
14921 echo "${ECHO_T}$cf_ada_compiler" >&6
14922
14923                 cf_ada_package=terminal_interface
14924
14925 echo "$as_me:14925: checking for ada-include" >&5
14926 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14927
14928 # Check whether --with-ada-include or --without-ada-include was given.
14929 if test "${with_ada_include+set}" = set; then
14930   withval="$with_ada_include"
14931
14932 else
14933   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14934 fi; if test -n "$prefix/share/ada/adainclude" ; then
14935
14936 if test "x$prefix" != xNONE; then
14937         cf_path_syntax="$prefix"
14938 else
14939         cf_path_syntax="$ac_default_prefix"
14940 fi
14941
14942 case ".$withval" in
14943 (.\$\(*\)*|.\'*\'*)
14944         ;;
14945 (..|./*|.\\*)
14946         ;;
14947 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14948         ;;
14949 (.\${*prefix}*|.\${*dir}*)
14950         eval withval="$withval"
14951         case ".$withval" in
14952         (.NONE/*)
14953                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14954                 ;;
14955         esac
14956         ;;
14957 (.no|.NONE/*)
14958         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14959         ;;
14960 (*)
14961         { { echo "$as_me:14961: error: expected a pathname, not \"$withval\"" >&5
14962 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14963    { (exit 1); exit 1; }; }
14964         ;;
14965 esac
14966
14967 fi
14968 eval ADA_INCLUDE="$withval"
14969
14970 echo "$as_me:14970: result: $ADA_INCLUDE" >&5
14971 echo "${ECHO_T}$ADA_INCLUDE" >&6
14972
14973 echo "$as_me:14973: checking for ada-objects" >&5
14974 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14975
14976 # Check whether --with-ada-objects or --without-ada-objects was given.
14977 if test "${with_ada_objects+set}" = set; then
14978   withval="$with_ada_objects"
14979
14980 else
14981   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14982 fi; if test -n "$prefix/lib/ada/adalib" ; then
14983
14984 if test "x$prefix" != xNONE; then
14985         cf_path_syntax="$prefix"
14986 else
14987         cf_path_syntax="$ac_default_prefix"
14988 fi
14989
14990 case ".$withval" in
14991 (.\$\(*\)*|.\'*\'*)
14992         ;;
14993 (..|./*|.\\*)
14994         ;;
14995 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14996         ;;
14997 (.\${*prefix}*|.\${*dir}*)
14998         eval withval="$withval"
14999         case ".$withval" in
15000         (.NONE/*)
15001                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15002                 ;;
15003         esac
15004         ;;
15005 (.no|.NONE/*)
15006         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
15007         ;;
15008 (*)
15009         { { echo "$as_me:15009: error: expected a pathname, not \"$withval\"" >&5
15010 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
15011    { (exit 1); exit 1; }; }
15012         ;;
15013 esac
15014
15015 fi
15016 eval ADA_OBJECTS="$withval"
15017
15018 echo "$as_me:15018: result: $ADA_OBJECTS" >&5
15019 echo "${ECHO_T}$ADA_OBJECTS" >&6
15020
15021 echo "$as_me:15021: checking if an Ada95 shared-library should be built" >&5
15022 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
15023
15024 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
15025 if test "${with_ada_sharedlib+set}" = set; then
15026   withval="$with_ada_sharedlib"
15027   with_ada_sharedlib=$withval
15028 else
15029   with_ada_sharedlib=no
15030 fi;
15031 echo "$as_me:15031: result: $with_ada_sharedlib" >&5
15032 echo "${ECHO_T}$with_ada_sharedlib" >&6
15033
15034 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
15035 MAKE_ADA_SHAREDLIB="#"
15036
15037 if test "x$with_ada_sharedlib" != xno
15038 then
15039         MAKE_ADA_SHAREDLIB=
15040         if test "x$with_ada_sharedlib" != xyes
15041         then
15042                 ADA_SHAREDLIB="$with_ada_sharedlib"
15043         fi
15044 fi
15045
15046         else
15047                 { { echo "$as_me:15047: error: No usable Ada compiler found" >&5
15048 echo "$as_me: error: No usable Ada compiler found" >&2;}
15049    { (exit 1); exit 1; }; }
15050         fi
15051 else
15052         { { echo "$as_me:15052: error: The Ada compiler is needed for this package" >&5
15053 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
15054    { (exit 1); exit 1; }; }
15055 fi
15056
15057 ################################################################################
15058
15059 # not needed
15060 TINFO_LDFLAGS2=
15061
15062 TINFO_LIBS=
15063
15064 ### Construct the list of include-directories to be generated
15065
15066 if test "$srcdir" != "."; then
15067         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
15068 fi
15069 CPPFLAGS="-I../include $CPPFLAGS"
15070 if test "$srcdir" != "."; then
15071         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
15072 fi
15073 CPPFLAGS="-I. $CPPFLAGS"
15074
15075 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
15076 if test "$srcdir" != "."; then
15077         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
15078 fi
15079 if test "$GCC" != yes; then
15080         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15081 elif test "$includedir" != "/usr/include"; then
15082         if test "$includedir" = '${prefix}/include' ; then
15083                 if test x$prefix != x/usr ; then
15084                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15085                 fi
15086         else
15087                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
15088         fi
15089 fi
15090
15091 ### Build up pieces for makefile rules
15092 echo "$as_me:15092: checking default library suffix" >&5
15093 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
15094
15095         case $DFT_LWR_MODEL in
15096         (libtool) DFT_ARG_SUFFIX=''   ;;
15097         (normal)  DFT_ARG_SUFFIX=''   ;;
15098         (debug)   DFT_ARG_SUFFIX='_g' ;;
15099         (profile) DFT_ARG_SUFFIX='_p' ;;
15100         (shared)  DFT_ARG_SUFFIX=''   ;;
15101         esac
15102         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
15103 echo "$as_me:15103: result: $DFT_ARG_SUFFIX" >&5
15104 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
15105
15106 echo "$as_me:15106: checking default library-dependency suffix" >&5
15107 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
15108
15109         case X$DFT_LWR_MODEL in
15110         (Xlibtool)
15111                 DFT_LIB_SUFFIX='.la'
15112                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15113                 ;;
15114         (Xdebug)
15115                 DFT_LIB_SUFFIX='_g.a'
15116                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15117                 ;;
15118         (Xprofile)
15119                 DFT_LIB_SUFFIX='_p.a'
15120                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15121                 ;;
15122         (Xshared)
15123                 case $cf_cv_system_name in
15124                 (aix[5-7]*)
15125                         DFT_LIB_SUFFIX='.so'
15126                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15127                         ;;
15128                 (cygwin*|msys*|mingw*)
15129                         DFT_LIB_SUFFIX='.dll'
15130                         DFT_DEP_SUFFIX='.dll.a'
15131                         ;;
15132                 (darwin*)
15133                         DFT_LIB_SUFFIX='.dylib'
15134                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15135                         ;;
15136                 (hpux*)
15137                         case $target in
15138                         (ia64*)
15139                                 DFT_LIB_SUFFIX='.so'
15140                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15141                                 ;;
15142                         (*)
15143                                 DFT_LIB_SUFFIX='.sl'
15144                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15145                                 ;;
15146                         esac
15147                         ;;
15148                 (*)
15149                         DFT_LIB_SUFFIX='.so'
15150                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15151                         ;;
15152                 esac
15153                 ;;
15154         (*)
15155                 DFT_LIB_SUFFIX='.a'
15156                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
15157                 ;;
15158         esac
15159         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
15160         then
15161                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
15162                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
15163         fi
15164 echo "$as_me:15164: result: $DFT_DEP_SUFFIX" >&5
15165 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
15166
15167 echo "$as_me:15167: checking default object directory" >&5
15168 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
15169
15170         case $DFT_LWR_MODEL in
15171         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
15172         (normal)  DFT_OBJ_SUBDIR='objects' ;;
15173         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
15174         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
15175         (shared)
15176                 case $cf_cv_system_name in
15177                 (cygwin|msys)
15178                         DFT_OBJ_SUBDIR='objects' ;;
15179                 (*)
15180                         DFT_OBJ_SUBDIR='obj_s' ;;
15181                 esac
15182         esac
15183 echo "$as_me:15183: result: $DFT_OBJ_SUBDIR" >&5
15184 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
15185
15186 ### Set up low-level terminfo dependencies for makefiles.
15187
15188 if test "$DFT_LWR_MODEL" = shared ; then
15189         case $cf_cv_system_name in
15190         (cygwin*)
15191                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
15192                 ;;
15193         (msys*)
15194                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
15195                 ;;
15196         esac
15197 fi
15198
15199 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
15200
15201 ### Construct the list of subdirectories for which we'll customize makefiles
15202 ### with the appropriate compile-rules.
15203
15204 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
15205
15206 cat >>confdefs.h <<EOF
15207 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
15208 EOF
15209
15210 ### Now that we're done running tests, add the compiler-warnings, if any
15211
15212 cf_fix_cppflags=no
15213 cf_new_cflags=
15214 cf_new_cppflags=
15215 cf_new_extra_cppflags=
15216
15217 for cf_add_cflags in $EXTRA_CFLAGS
15218 do
15219 case $cf_fix_cppflags in
15220 (no)
15221         case $cf_add_cflags in
15222         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15223                 case $cf_add_cflags in
15224                 (-D*)
15225                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15226
15227                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15228                                 && test -z "${cf_tst_cflags}" \
15229                                 && cf_fix_cppflags=yes
15230
15231                         if test $cf_fix_cppflags = yes ; then
15232
15233         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15234         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15235
15236                                 continue
15237                         elif test "${cf_tst_cflags}" = "\"'" ; then
15238
15239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15241
15242                                 continue
15243                         fi
15244                         ;;
15245                 esac
15246                 case "$CPPFLAGS" in
15247                 (*$cf_add_cflags)
15248                         ;;
15249                 (*)
15250                         case $cf_add_cflags in
15251                         (-D*)
15252                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15253
15254 CPPFLAGS=`echo "$CPPFLAGS" | \
15255         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15256                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15257
15258                                 ;;
15259                         esac
15260
15261         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15262         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15263
15264                         ;;
15265                 esac
15266                 ;;
15267         (*)
15268
15269         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15270         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15271
15272                 ;;
15273         esac
15274         ;;
15275 (yes)
15276
15277         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15278         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15279
15280         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15281
15282         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15283                 && test -z "${cf_tst_cflags}" \
15284                 && cf_fix_cppflags=no
15285         ;;
15286 esac
15287 done
15288
15289 if test -n "$cf_new_cflags" ; then
15290
15291         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15292         CFLAGS="${CFLAGS}$cf_new_cflags"
15293
15294 fi
15295
15296 if test -n "$cf_new_cppflags" ; then
15297
15298         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15299         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15300
15301 fi
15302
15303 if test -n "$cf_new_extra_cppflags" ; then
15304
15305         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15306         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15307
15308 fi
15309
15310 ################################################################################
15311
15312 TEST_ARG2=
15313
15314 TEST_LIBS2=
15315
15316 NCURSES_SHLIB2="sh -c"
15317
15318 ADA_SUBDIRS="include gen src doc"
15319 if test "x$cf_with_tests" != "xno" ; then
15320         ADA_SUBDIRS="$ADA_SUBDIRS samples"
15321 fi
15322 for cf_dir in $ADA_SUBDIRS
15323 do
15324         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
15325 done
15326
15327 NCURSES_TREE="#"
15328
15329 EXTERNAL_TREE=
15330
15331 # match layout used by make-tar.sh
15332 ADAHTML_DIR=../doc/ada
15333
15334 if test "x$cross_compiling" = xyes ; then
15335         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
15336 else
15337         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
15338 fi
15339
15340 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
15341 ac_config_commands="$ac_config_commands default"
15342 cat >confcache <<\_ACEOF
15343 # This file is a shell script that caches the results of configure
15344 # tests run on this system so they can be shared between configure
15345 # scripts and configure runs, see configure's option --config-cache.
15346 # It is not useful on other systems.  If it contains results you don't
15347 # want to keep, you may remove or edit it.
15348 #
15349 # config.status only pays attention to the cache file if you give it
15350 # the --recheck option to rerun configure.
15351 #
15352 # `ac_cv_env_foo' variables (set or unset) will be overriden when
15353 # loading this file, other *unset* `ac_cv_foo' will be assigned the
15354 # following values.
15355
15356 _ACEOF
15357
15358 # The following way of writing the cache mishandles newlines in values,
15359 # but we know of no workaround that is simple, portable, and efficient.
15360 # So, don't put newlines in cache variables' values.
15361 # Ultrix sh set writes to stderr and can't be redirected directly,
15362 # and sets the high bit in the cache file unless we assign to the vars.
15363 {
15364   (set) 2>&1 |
15365     case `(ac_space=' '; set | grep ac_space) 2>&1` in
15366     *ac_space=\ *)
15367       # `set' does not quote correctly, so add quotes (double-quote
15368       # substitution turns \\\\ into \\, and sed turns \\ into \).
15369       sed -n \
15370         "s/'/'\\\\''/g;
15371           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
15372       ;;
15373     *)
15374       # `set' quotes correctly as required by POSIX, so do not add quotes.
15375       sed -n \
15376         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15377       ;;
15378     esac;
15379 } |
15380   sed '
15381      t clear
15382      : clear
15383      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15384      t end
15385      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15386      : end' >>confcache
15387 if cmp -s $cache_file confcache; then :; else
15388   if test -w $cache_file; then
15389     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15390     cat confcache >$cache_file
15391   else
15392     echo "not updating unwritable cache $cache_file"
15393   fi
15394 fi
15395 rm -f confcache
15396
15397 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15398 # Let make expand exec_prefix.
15399 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15400
15401 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15402 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15403 # trailing colons and then remove the whole line if VPATH becomes empty
15404 # (actually we leave an empty line to preserve line numbers).
15405 if test "x$srcdir" = x.; then
15406   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15407 s/:*\$(srcdir):*/:/;
15408 s/:*\${srcdir}:*/:/;
15409 s/:*@srcdir@:*/:/;
15410 s/^\([^=]*=[    ]*\):*/\1/;
15411 s/:*$//;
15412 s/^[^=]*=[      ]*$//;
15413 }'
15414 fi
15415
15416 DEFS=-DHAVE_CONFIG_H
15417
15418 : ${CONFIG_STATUS=./config.status}
15419 ac_clean_files_save=$ac_clean_files
15420 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15421 { echo "$as_me:15421: creating $CONFIG_STATUS" >&5
15422 echo "$as_me: creating $CONFIG_STATUS" >&6;}
15423 cat >$CONFIG_STATUS <<_ACEOF
15424 #! $SHELL
15425 # Generated automatically by configure.
15426 # Run this file to recreate the current configuration.
15427 # Compiler output produced by configure, useful for debugging
15428 # configure, is in config.log if it exists.
15429
15430 debug=false
15431 SHELL=\${CONFIG_SHELL-$SHELL}
15432 ac_cs_invocation="\$0 \$@"
15433
15434 _ACEOF
15435
15436 cat >>$CONFIG_STATUS <<\_ACEOF
15437 # Be Bourne compatible
15438 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15439   emulate sh
15440   NULLCMD=:
15441 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
15442   set -o posix
15443 fi
15444
15445 # Name of the executable.
15446 as_me=`echo "$0" |sed 's,.*[\\/],,'`
15447
15448 if expr a : '\(a\)' >/dev/null 2>&1; then
15449   as_expr=expr
15450 else
15451   as_expr=false
15452 fi
15453
15454 rm -f conf$$ conf$$.exe conf$$.file
15455 echo >conf$$.file
15456 if ln -s conf$$.file conf$$ 2>/dev/null; then
15457   # We could just check for DJGPP; but this test a) works b) is more generic
15458   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
15459   if test -f conf$$.exe; then
15460     # Don't use ln at all; we don't have any links
15461     as_ln_s='cp -p'
15462   else
15463     as_ln_s='ln -s'
15464   fi
15465 elif ln conf$$.file conf$$ 2>/dev/null; then
15466   as_ln_s=ln
15467 else
15468   as_ln_s='cp -p'
15469 fi
15470 rm -f conf$$ conf$$.exe conf$$.file
15471
15472 as_executable_p="test -f"
15473
15474 # Support unset when possible.
15475 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
15476   as_unset=unset
15477 else
15478   as_unset=false
15479 fi
15480
15481 # NLS nuisances.
15482 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
15483 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
15484 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
15485 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
15486 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
15487 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
15488 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
15489 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
15490
15491 # IFS
15492 # We need space, tab and new line, in precisely that order.
15493 as_nl='
15494 '
15495 IFS="   $as_nl"
15496
15497 # CDPATH.
15498 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
15499
15500 exec 6>&1
15501
15502 _ACEOF
15503
15504 # Files that config.status was made for.
15505 if test -n "$ac_config_files"; then
15506   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
15507 fi
15508
15509 if test -n "$ac_config_headers"; then
15510   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
15511 fi
15512
15513 if test -n "$ac_config_links"; then
15514   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
15515 fi
15516
15517 if test -n "$ac_config_commands"; then
15518   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
15519 fi
15520
15521 cat >>$CONFIG_STATUS <<\EOF
15522
15523 ac_cs_usage="\
15524 \`$as_me' instantiates files from templates according to the
15525 current configuration.
15526
15527 Usage: $0 [OPTIONS] [FILE]...
15528
15529   -h, --help       print this help, then exit
15530   -V, --version    print version number, then exit
15531   -d, --debug      don't remove temporary files
15532       --recheck    update $as_me by reconfiguring in the same conditions
15533   --file=FILE[:TEMPLATE]
15534                    instantiate the configuration file FILE
15535   --header=FILE[:TEMPLATE]
15536                    instantiate the configuration header FILE
15537
15538 Configuration files:
15539 $config_files
15540
15541 Configuration headers:
15542 $config_headers
15543
15544 Configuration commands:
15545 $config_commands
15546
15547 Report bugs to <dickey@invisible-island.net>."
15548 EOF
15549
15550 cat >>$CONFIG_STATUS <<EOF
15551 ac_cs_version="\\
15552 config.status
15553 configured by $0, generated by GNU Autoconf 2.52.20170501,
15554   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
15555
15556 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
15557 Free Software Foundation, Inc.
15558 This config.status script is free software; the Free Software Foundation
15559 gives unlimited permission to copy, distribute and modify it."
15560 srcdir=$srcdir
15561 INSTALL="$INSTALL"
15562 EOF
15563
15564 cat >>$CONFIG_STATUS <<\EOF
15565 # If no file are specified by the user, then we need to provide default
15566 # value.  By we need to know if files were specified by the user.
15567 ac_need_defaults=:
15568 while test $# != 0
15569 do
15570   case $1 in
15571   --*=*)
15572     ac_option=`expr "x$1" : 'x\([^=]*\)='`
15573     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
15574     shift
15575     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
15576     shift
15577     ;;
15578   -*);;
15579   *) # This is not an option, so the user has probably given explicit
15580      # arguments.
15581      ac_need_defaults=false;;
15582   esac
15583
15584   case $1 in
15585   # Handling of the options.
15586 EOF
15587 cat >>$CONFIG_STATUS <<EOF
15588   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15589     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
15590     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
15591 EOF
15592 cat >>$CONFIG_STATUS <<\EOF
15593   --version | --vers* | -V )
15594     echo "$ac_cs_version"; exit 0 ;;
15595   --he | --h)
15596     # Conflict between --help and --header
15597     { { echo "$as_me:15597: error: ambiguous option: $1
15598 Try \`$0 --help' for more information." >&5
15599 echo "$as_me: error: ambiguous option: $1
15600 Try \`$0 --help' for more information." >&2;}
15601    { (exit 1); exit 1; }; };;
15602   --help | --hel | -h )
15603     echo "$ac_cs_usage"; exit 0 ;;
15604   --debug | --d* | -d )
15605     debug=: ;;
15606   --file | --fil | --fi | --f )
15607     shift
15608     CONFIG_FILES="$CONFIG_FILES $1"
15609     ac_need_defaults=false;;
15610   --header | --heade | --head | --hea )
15611     shift
15612     CONFIG_HEADERS="$CONFIG_HEADERS $1"
15613     ac_need_defaults=false;;
15614
15615   # This is an error.
15616   -*) { { echo "$as_me:15616: error: unrecognized option: $1
15617 Try \`$0 --help' for more information." >&5
15618 echo "$as_me: error: unrecognized option: $1
15619 Try \`$0 --help' for more information." >&2;}
15620    { (exit 1); exit 1; }; } ;;
15621
15622   *) ac_config_targets="$ac_config_targets $1" ;;
15623
15624   esac
15625   shift
15626 done
15627
15628 exec 5>>config.log
15629 cat >&5 << _ACEOF
15630
15631 ## ----------------------- ##
15632 ## Running config.status.  ##
15633 ## ----------------------- ##
15634
15635 This file was extended by $as_me 2.52.20170501, executed with
15636   CONFIG_FILES    = $CONFIG_FILES
15637   CONFIG_HEADERS  = $CONFIG_HEADERS
15638   CONFIG_LINKS    = $CONFIG_LINKS
15639   CONFIG_COMMANDS = $CONFIG_COMMANDS
15640   > $ac_cs_invocation
15641 on `(hostname || uname -n) 2>/dev/null | sed 1q`
15642
15643 _ACEOF
15644 EOF
15645
15646 cat >>$CONFIG_STATUS <<EOF
15647 #
15648 # INIT-COMMANDS section.
15649 #
15650
15651 ### Special initialization commands, used to pass information from the
15652 ### configuration-run into config.status
15653
15654 AWK="$AWK"
15655 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
15656 DFT_LWR_MODEL="$DFT_LWR_MODEL"
15657 LIB_NAME="$LIB_NAME"
15658 LIB_PREFIX="$LIB_PREFIX"
15659 LIB_SUFFIX="$LIB_SUFFIX"
15660 LN_S="$LN_S"
15661 NCURSES_MAJOR="$NCURSES_MAJOR"
15662 NCURSES_MINOR="$NCURSES_MINOR"
15663 NCURSES_PATCH="$NCURSES_PATCH"
15664 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
15665 cf_cv_abi_version="$cf_cv_abi_version"
15666 cf_cv_rel_version="$cf_cv_rel_version"
15667 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
15668 cf_cv_shared_soname='$cf_cv_shared_soname'
15669 cf_cv_shlib_version="$cf_cv_shlib_version"
15670 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
15671 cf_cv_system_name="$cf_cv_system_name"
15672 host="$host"
15673 target="$target"
15674
15675 EOF
15676
15677 cat >>$CONFIG_STATUS <<\EOF
15678 for ac_config_target in $ac_config_targets
15679 do
15680   case "$ac_config_target" in
15681   # Handling of arguments.
15682   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
15683   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
15684   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15685   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15686   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
15687   *) { { echo "$as_me:15687: error: invalid argument: $ac_config_target" >&5
15688 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15689    { (exit 1); exit 1; }; };;
15690   esac
15691 done
15692
15693 # If the user did not use the arguments to specify the items to instantiate,
15694 # then the envvar interface is used.  Set only those that are not.
15695 # We use the long form for the default assignment because of an extremely
15696 # bizarre bug on SunOS 4.1.3.
15697 if $ac_need_defaults; then
15698   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15699   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15700   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15701 fi
15702
15703 # Create a temporary directory, and hook for its removal unless debugging.
15704 $debug ||
15705 {
15706   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15707   trap '{ (exit 1); exit 1; }' 1 2 13 15
15708 }
15709
15710 # Create a (secure) tmp directory for tmp files.
15711 : ${TMPDIR=/tmp}
15712 {
15713   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15714   test -n "$tmp" && test -d "$tmp"
15715 }  ||
15716 {
15717   tmp=$TMPDIR/cs$$-$RANDOM
15718   (umask 077 && mkdir $tmp)
15719 } ||
15720 {
15721    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15722    { (exit 1); exit 1; }
15723 }
15724
15725 EOF
15726
15727 cat >>$CONFIG_STATUS <<EOF
15728
15729 #
15730 # CONFIG_FILES section.
15731 #
15732
15733 # No need to generate the scripts if there are no CONFIG_FILES.
15734 # This happens for instance when ./config.status config.h
15735 if test -n "\$CONFIG_FILES"; then
15736   # Protect against being on the right side of a sed subst in config.status.
15737   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15738    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15739 s,@SHELL@,$SHELL,;t t
15740 s,@exec_prefix@,$exec_prefix,;t t
15741 s,@prefix@,$prefix,;t t
15742 s,@program_transform_name@,$program_transform_name,;t t
15743 s,@bindir@,$bindir,;t t
15744 s,@sbindir@,$sbindir,;t t
15745 s,@libexecdir@,$libexecdir,;t t
15746 s,@datarootdir@,$datarootdir,;t t
15747 s,@datadir@,$datadir,;t t
15748 s,@sysconfdir@,$sysconfdir,;t t
15749 s,@sharedstatedir@,$sharedstatedir,;t t
15750 s,@localstatedir@,$localstatedir,;t t
15751 s,@libdir@,$libdir,;t t
15752 s,@includedir@,$includedir,;t t
15753 s,@oldincludedir@,$oldincludedir,;t t
15754 s,@infodir@,$infodir,;t t
15755 s,@mandir@,$mandir,;t t
15756 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15757 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15758 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15759 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15760 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15761 s,@build_alias@,$build_alias,;t t
15762 s,@host_alias@,$host_alias,;t t
15763 s,@target_alias@,$target_alias,;t t
15764 s,@ECHO_C@,$ECHO_C,;t t
15765 s,@ECHO_N@,$ECHO_N,;t t
15766 s,@ECHO_T@,$ECHO_T,;t t
15767 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15768 s,@DEFS@,$DEFS,;t t
15769 s,@LIBS@,$LIBS,;t t
15770 s,@top_builddir@,$top_builddir,;t t
15771 s,@build@,$build,;t t
15772 s,@build_cpu@,$build_cpu,;t t
15773 s,@build_vendor@,$build_vendor,;t t
15774 s,@build_os@,$build_os,;t t
15775 s,@host@,$host,;t t
15776 s,@host_cpu@,$host_cpu,;t t
15777 s,@host_vendor@,$host_vendor,;t t
15778 s,@host_os@,$host_os,;t t
15779 s,@target@,$target,;t t
15780 s,@target_cpu@,$target_cpu,;t t
15781 s,@target_vendor@,$target_vendor,;t t
15782 s,@target_os@,$target_os,;t t
15783 s,@CC@,$CC,;t t
15784 s,@CFLAGS@,$CFLAGS,;t t
15785 s,@LDFLAGS@,$LDFLAGS,;t t
15786 s,@CPPFLAGS@,$CPPFLAGS,;t t
15787 s,@ac_ct_CC@,$ac_ct_CC,;t t
15788 s,@EXEEXT@,$EXEEXT,;t t
15789 s,@OBJEXT@,$OBJEXT,;t t
15790 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15791 s,@CPP@,$CPP,;t t
15792 s,@AWK@,$AWK,;t t
15793 s,@EGREP@,$EGREP,;t t
15794 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15795 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15796 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15797 s,@LN_S@,$LN_S,;t t
15798 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
15799 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
15800 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15801 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
15802 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
15803 s,@SET_MAKE@,$SET_MAKE,;t t
15804 s,@CTAGS@,$CTAGS,;t t
15805 s,@ETAGS@,$ETAGS,;t t
15806 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15807 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15808 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
15809 s,@RANLIB@,$RANLIB,;t t
15810 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
15811 s,@LD@,$LD,;t t
15812 s,@ac_ct_LD@,$ac_ct_LD,;t t
15813 s,@AR@,$AR,;t t
15814 s,@ac_ct_AR@,$ac_ct_AR,;t t
15815 s,@ARFLAGS@,$ARFLAGS,;t t
15816 s,@DESTDIR@,$DESTDIR,;t t
15817 s,@BUILD_CC@,$BUILD_CC,;t t
15818 s,@BUILD_CPP@,$BUILD_CPP,;t t
15819 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
15820 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
15821 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
15822 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
15823 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
15824 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
15825 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
15826 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15827 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15828 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
15829 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
15830 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
15831 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
15832 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15833 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15834 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
15835 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
15836 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
15837 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
15838 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
15839 s,@CC_G_OPT@,$CC_G_OPT,;t t
15840 s,@LD_MODEL@,$LD_MODEL,;t t
15841 s,@shlibdir@,$shlibdir,;t t
15842 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
15843 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15844 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
15845 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15846 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
15847 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
15848 s,@LINK_PROGS@,$LINK_PROGS,;t t
15849 s,@LINK_TESTS@,$LINK_TESTS,;t t
15850 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
15851 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15852 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
15853 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
15854 s,@RPATH_LIST@,$RPATH_LIST,;t t
15855 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
15856 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
15857 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
15858 s,@PTHREAD@,$PTHREAD,;t t
15859 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
15860 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15861 s,@ECHO_LT@,$ECHO_LT,;t t
15862 s,@ECHO_LD@,$ECHO_LD,;t t
15863 s,@RULE_CC@,$RULE_CC,;t t
15864 s,@SHOW_CC@,$SHOW_CC,;t t
15865 s,@ECHO_CC@,$ECHO_CC,;t t
15866 s,@ADAFLAGS@,$ADAFLAGS,;t t
15867 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15868 s,@ADA_TRACE@,$ADA_TRACE,;t t
15869 s,@gnatmake_exists@,$gnatmake_exists,;t t
15870 s,@gprconfig_exists@,$gprconfig_exists,;t t
15871 s,@M4_exists@,$M4_exists,;t t
15872 s,@cf_ada_make@,$cf_ada_make,;t t
15873 s,@cf_ada_config@,$cf_ada_config,;t t
15874 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
15875 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
15876 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
15877 s,@cf_compile_generics@,$cf_compile_generics,;t t
15878 s,@cf_generic_objects@,$cf_generic_objects,;t t
15879 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
15880 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15881 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15882 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15883 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15884 s,@cf_ada_package@,$cf_ada_package,;t t
15885 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15886 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15887 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15888 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15889 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15890 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15891 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15892 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15893 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15894 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15895 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15896 s,@TEST_ARG2@,$TEST_ARG2,;t t
15897 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15898 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15899 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15900 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15901 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15902 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15903 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15904 CEOF
15905
15906 EOF
15907
15908   cat >>$CONFIG_STATUS <<\EOF
15909   # Split the substitutions into bite-sized pieces for seds with
15910   # small command number limits, like on Digital OSF/1 and HP-UX.
15911   ac_max_sed_lines=48
15912   ac_sed_frag=1 # Number of current file.
15913   ac_beg=1 # First line for current file.
15914   ac_end=$ac_max_sed_lines # Line after last line for current file.
15915   ac_more_lines=:
15916   ac_sed_cmds=
15917   while $ac_more_lines; do
15918     if test $ac_beg -gt 1; then
15919       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15920     else
15921       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15922     fi
15923     if test ! -s $tmp/subs.frag; then
15924       ac_more_lines=false
15925     else
15926       # The purpose of the label and of the branching condition is to
15927       # speed up the sed processing (if there are no `@' at all, there
15928       # is no need to browse any of the substitutions).
15929       # These are the two extra sed commands mentioned above.
15930       (echo ':t
15931   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15932       # It is possible to make a multiline substitution using escaped newlines.
15933       # Ensure that we do not split the substitution between script fragments.
15934       ac_BEG=$ac_end
15935       ac_END=`expr $ac_end + $ac_max_sed_lines`
15936       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15937       if test -s $tmp/subs.next; then
15938         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15939         if test ! -s $tmp/subs.edit; then
15940           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15941           if test ! -s $tmp/subs.edit; then
15942             if test $ac_beg -gt 1; then
15943               ac_end=`expr $ac_end - 1`
15944               continue
15945             fi
15946           fi
15947         fi
15948       fi
15949
15950       if test -z "$ac_sed_cmds"; then
15951         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15952       else
15953         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15954       fi
15955       ac_sed_frag=`expr $ac_sed_frag + 1`
15956       ac_beg=$ac_end
15957       ac_end=`expr $ac_end + $ac_max_sed_lines`
15958     fi
15959   done
15960   if test -z "$ac_sed_cmds"; then
15961     ac_sed_cmds=cat
15962   fi
15963 fi # test -n "$CONFIG_FILES"
15964
15965 EOF
15966 cat >>$CONFIG_STATUS <<\EOF
15967 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15968   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15969   case $ac_file in
15970   - | *:- | *:-:* ) # input from stdin
15971         cat >$tmp/stdin
15972         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15973         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15974   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15975         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15976   * )   ac_file_in=$ac_file.in ;;
15977   esac
15978
15979   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15980   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15981          X"$ac_file" : 'X\(//\)[^/]' \| \
15982          X"$ac_file" : 'X\(//\)$' \| \
15983          X"$ac_file" : 'X\(/\)' \| \
15984          .     : '\(.\)' 2>/dev/null ||
15985 echo X"$ac_file" |
15986     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15987           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15988           /^X\(\/\/\)$/{ s//\1/; q; }
15989           /^X\(\/\).*/{ s//\1/; q; }
15990           s/.*/./; q'`
15991   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15992     { case "$ac_dir" in
15993   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15994   *)                      as_incr_dir=.;;
15995 esac
15996 as_dummy="$ac_dir"
15997 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15998   case $as_mkdir_dir in
15999     # Skip DOS drivespec
16000     ?:) as_incr_dir=$as_mkdir_dir ;;
16001     *)
16002       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16003       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16004     ;;
16005   esac
16006 done; }
16007
16008     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16009     # A "../" for each directory in $ac_dir_suffix.
16010     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16011   else
16012     ac_dir_suffix= ac_dots=
16013   fi
16014
16015   case $srcdir in
16016   .)  ac_srcdir=.
16017       if test -z "$ac_dots"; then
16018          ac_top_srcdir=.
16019       else
16020          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16021       fi ;;
16022   [\\/]* | ?:[\\/]* )
16023       ac_srcdir=$srcdir$ac_dir_suffix;
16024       ac_top_srcdir=$srcdir ;;
16025   *) # Relative path.
16026     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16027     ac_top_srcdir=$ac_dots$srcdir ;;
16028   esac
16029
16030   case $INSTALL in
16031   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16032   *) ac_INSTALL=$ac_dots$INSTALL ;;
16033   esac
16034
16035   if test x"$ac_file" != x-; then
16036     { echo "$as_me:16036: creating $ac_file" >&5
16037 echo "$as_me: creating $ac_file" >&6;}
16038     rm -f "$ac_file"
16039   fi
16040   # Let's still pretend it is `configure' which instantiates (i.e., don't
16041   # use $as_me), people would be surprised to read:
16042   #    /* config.h.  Generated automatically by config.status.  */
16043   configure_input="Generated automatically from `echo $ac_file_in |
16044                                                  sed 's,.*/,,'` by configure."
16045
16046   # First look for the input files in the build tree, otherwise in the
16047   # src tree.
16048   ac_file_inputs=`IFS=:
16049     for f in $ac_file_in; do
16050       case $f in
16051       -) echo $tmp/stdin ;;
16052       [\\/$]*)
16053          # Absolute (can't be DOS-style, as IFS=:)
16054          test -f "$f" || { { echo "$as_me:16054: error: cannot find input file: $f" >&5
16055 echo "$as_me: error: cannot find input file: $f" >&2;}
16056    { (exit 1); exit 1; }; }
16057          echo $f;;
16058       *) # Relative
16059          if test -f "$f"; then
16060            # Build tree
16061            echo $f
16062          elif test -f "$srcdir/$f"; then
16063            # Source tree
16064            echo $srcdir/$f
16065          else
16066            # /dev/null tree
16067            { { echo "$as_me:16067: error: cannot find input file: $f" >&5
16068 echo "$as_me: error: cannot find input file: $f" >&2;}
16069    { (exit 1); exit 1; }; }
16070          fi;;
16071       esac
16072     done` || { (exit 1); exit 1; }
16073 EOF
16074 cat >>$CONFIG_STATUS <<\EOF
16075   ac_warn_datarootdir=no
16076   if test x"$ac_file" != x-; then
16077     for ac_item in $ac_file_inputs
16078     do
16079       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
16080       if test -n "$ac_seen"; then
16081         ac_used=`grep '@datarootdir@' $ac_item`
16082         if test -z "$ac_used"; then
16083           { echo "$as_me:16083: WARNING: datarootdir was used implicitly but not set:
16084 $ac_seen" >&5
16085 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
16086 $ac_seen" >&2;}
16087           ac_warn_datarootdir=yes
16088         fi
16089       fi
16090       ac_seen=`grep '${datarootdir}' $ac_item`
16091       if test -n "$ac_seen"; then
16092         { echo "$as_me:16092: WARNING: datarootdir was used explicitly but not set:
16093 $ac_seen" >&5
16094 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
16095 $ac_seen" >&2;}
16096         ac_warn_datarootdir=yes
16097       fi
16098     done
16099   fi
16100
16101 if test "x$ac_warn_datarootdir" = xyes; then
16102   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
16103 fi
16104
16105 EOF
16106 cat >>$CONFIG_STATUS <<EOF
16107   sed "$ac_vpsub
16108 $extrasub
16109 EOF
16110 cat >>$CONFIG_STATUS <<\EOF
16111 :t
16112 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16113 s,@configure_input@,$configure_input,;t t
16114 s,@srcdir@,$ac_srcdir,;t t
16115 s,@top_srcdir@,$ac_top_srcdir,;t t
16116 s,@INSTALL@,$ac_INSTALL,;t t
16117 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16118   rm -f $tmp/stdin
16119   if test x"$ac_file" != x-; then
16120     cp $tmp/out $ac_file
16121
16122     for ac_name in prefix exec_prefix datarootdir
16123     do
16124         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
16125         if test -n "$ac_seen"; then
16126             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
16127             if test -z "$ac_init"; then
16128               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
16129               { echo "$as_me:16129: WARNING: Variable $ac_name is used but was not set:
16130 $ac_seen" >&5
16131 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
16132 $ac_seen" >&2;}
16133             fi
16134         fi
16135     done
16136     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
16137     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
16138     if test -s $tmp/out; then
16139       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
16140       { echo "$as_me:16140: WARNING: Some variables may not be substituted:
16141 $ac_seen" >&5
16142 echo "$as_me: WARNING: Some variables may not be substituted:
16143 $ac_seen" >&2;}
16144     fi
16145   else
16146     cat $tmp/out
16147   fi
16148   rm -f $tmp/out
16149
16150 done
16151 EOF
16152 cat >>$CONFIG_STATUS <<\EOF
16153
16154 #
16155 # CONFIG_HEADER section.
16156 #
16157
16158 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16159 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16160 #
16161 # ac_d sets the value in "#define NAME VALUE" lines.
16162 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16163 ac_dB='[        ].*$,\1#\2'
16164 ac_dC=' '
16165 ac_dD=',;t'
16166 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16167 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16168 ac_iB='\([      ]\),\1#\2define\3'
16169 ac_iC=' '
16170 ac_iD='\4,;t'
16171 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16172 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16173 ac_uB='$,\1#\2define\3'
16174 ac_uC=' '
16175 ac_uD=',;t'
16176
16177 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16178   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16179   case $ac_file in
16180   - | *:- | *:-:* ) # input from stdin
16181         cat >$tmp/stdin
16182         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16183         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16184   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16185         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16186   * )   ac_file_in=$ac_file.in ;;
16187   esac
16188
16189   test x"$ac_file" != x- && { echo "$as_me:16189: creating $ac_file" >&5
16190 echo "$as_me: creating $ac_file" >&6;}
16191
16192   # First look for the input files in the build tree, otherwise in the
16193   # src tree.
16194   ac_file_inputs=`IFS=:
16195     for f in $ac_file_in; do
16196       case $f in
16197       -) echo $tmp/stdin ;;
16198       [\\/$]*)
16199          # Absolute (can't be DOS-style, as IFS=:)
16200          test -f "$f" || { { echo "$as_me:16200: error: cannot find input file: $f" >&5
16201 echo "$as_me: error: cannot find input file: $f" >&2;}
16202    { (exit 1); exit 1; }; }
16203          echo $f;;
16204       *) # Relative
16205          if test -f "$f"; then
16206            # Build tree
16207            echo $f
16208          elif test -f "$srcdir/$f"; then
16209            # Source tree
16210            echo $srcdir/$f
16211          else
16212            # /dev/null tree
16213            { { echo "$as_me:16213: error: cannot find input file: $f" >&5
16214 echo "$as_me: error: cannot find input file: $f" >&2;}
16215    { (exit 1); exit 1; }; }
16216          fi;;
16217       esac
16218     done` || { (exit 1); exit 1; }
16219   # Remove the trailing spaces.
16220   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16221
16222 EOF
16223
16224 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16225 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16226 # be either 'cat' or 'sort'.
16227 cat confdefs.h | uniq >conftest.vals
16228
16229 # Break up conftest.vals because some shells have a limit on
16230 # the size of here documents, and old seds have small limits too.
16231
16232 rm -f conftest.tail
16233 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16234 while grep . conftest.vals >/dev/null
16235 do
16236   # Write chunks of a limited-size here document to conftest.frag.
16237   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16238   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16239   echo 'CEOF' >> $CONFIG_STATUS
16240   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16241   rm -f conftest.vals
16242   mv conftest.tail conftest.vals
16243 done
16244 rm -f conftest.vals
16245
16246 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16247 # marker @DEFS@.
16248 echo '  cat >> conftest.edit <<CEOF
16249 /@DEFS@/r conftest.frag
16250 /@DEFS@/d
16251 CEOF
16252 sed -f conftest.edit $tmp/in > $tmp/out
16253 rm -f $tmp/in
16254 mv $tmp/out $tmp/in
16255 rm -f conftest.edit conftest.frag
16256 ' >> $CONFIG_STATUS
16257
16258 cat >>$CONFIG_STATUS <<\EOF
16259   # Let's still pretend it is `configure' which instantiates (i.e., don't
16260   # use $as_me), people would be surprised to read:
16261   #    /* config.h.  Generated automatically by config.status.  */
16262   if test x"$ac_file" = x-; then
16263     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16264   else
16265     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16266   fi
16267   cat $tmp/in >>$tmp/config.h
16268   rm -f $tmp/in
16269   if test x"$ac_file" != x-; then
16270     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16271       { echo "$as_me:16271: $ac_file is unchanged" >&5
16272 echo "$as_me: $ac_file is unchanged" >&6;}
16273     else
16274       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16275          X"$ac_file" : 'X\(//\)[^/]' \| \
16276          X"$ac_file" : 'X\(//\)$' \| \
16277          X"$ac_file" : 'X\(/\)' \| \
16278          .     : '\(.\)' 2>/dev/null ||
16279 echo X"$ac_file" |
16280     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16281           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16282           /^X\(\/\/\)$/{ s//\1/; q; }
16283           /^X\(\/\).*/{ s//\1/; q; }
16284           s/.*/./; q'`
16285       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16286         { case "$ac_dir" in
16287   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16288   *)                      as_incr_dir=.;;
16289 esac
16290 as_dummy="$ac_dir"
16291 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16292   case $as_mkdir_dir in
16293     # Skip DOS drivespec
16294     ?:) as_incr_dir=$as_mkdir_dir ;;
16295     *)
16296       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16297       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16298     ;;
16299   esac
16300 done; }
16301
16302       fi
16303       rm -f $ac_file
16304       mv $tmp/config.h $ac_file
16305     fi
16306   else
16307     cat $tmp/config.h
16308     rm -f $tmp/config.h
16309   fi
16310 done
16311 EOF
16312 cat >>$CONFIG_STATUS <<\EOF
16313 #
16314 # CONFIG_COMMANDS section.
16315 #
16316 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
16317   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
16318   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
16319
16320   case $ac_dest in
16321     default )
16322 if test -z "$USE_OLD_MAKERULES" ; then
16323         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
16324 fi
16325  ;;
16326   esac
16327 done
16328 EOF
16329
16330 cat >>$CONFIG_STATUS <<\EOF
16331
16332 { (exit 0); exit 0; }
16333 EOF
16334 chmod +x $CONFIG_STATUS
16335 ac_clean_files=$ac_clean_files_save
16336
16337 # configure is writing to config.log, and then calls config.status.
16338 # config.status does its own redirection, appending to config.log.
16339 # Unfortunately, on DOS this fails, as config.log is still kept open
16340 # by configure, so config.status won't be able to write to it; its
16341 # output is simply discarded.  So we exec the FD to /dev/null,
16342 # effectively closing config.log, so it can be properly (re)opened and
16343 # appended to by config.status.  When coming back to configure, we
16344 # need to make the FD available again.
16345 if test "$no_create" != yes; then
16346   ac_cs_success=:
16347   exec 5>/dev/null
16348   $SHELL $CONFIG_STATUS || ac_cs_success=false
16349   exec 5>>config.log
16350   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
16351   # would make configure fail if this is the last instruction.
16352   $ac_cs_success || { (exit 1); exit 1; }
16353 fi
16354 ${MAKE:-make} preinstall