]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.1 - patch 20180203
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.65 .
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                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
3132                         ;;
3133                 esac
3134         done
3135         rm -f cf_makeflags.tmp
3136
3137 fi
3138 echo "$as_me:3138: result: $cf_cv_makeflags" >&5
3139 echo "${ECHO_T}$cf_cv_makeflags" >&6
3140
3141 if test -n "$ac_tool_prefix"; then
3142   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3143 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3144 echo "$as_me:3144: checking for $ac_word" >&5
3145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3146 if test "${ac_cv_prog_RANLIB+set}" = set; then
3147   echo $ECHO_N "(cached) $ECHO_C" >&6
3148 else
3149   if test -n "$RANLIB"; then
3150   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3151 else
3152   ac_save_IFS=$IFS; IFS=$ac_path_separator
3153 ac_dummy="$PATH"
3154 for ac_dir in $ac_dummy; do
3155   IFS=$ac_save_IFS
3156   test -z "$ac_dir" && ac_dir=.
3157   $as_executable_p "$ac_dir/$ac_word" || continue
3158 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3159 echo "$as_me:3159: found $ac_dir/$ac_word" >&5
3160 break
3161 done
3162
3163 fi
3164 fi
3165 RANLIB=$ac_cv_prog_RANLIB
3166 if test -n "$RANLIB"; then
3167   echo "$as_me:3167: result: $RANLIB" >&5
3168 echo "${ECHO_T}$RANLIB" >&6
3169 else
3170   echo "$as_me:3170: result: no" >&5
3171 echo "${ECHO_T}no" >&6
3172 fi
3173
3174 fi
3175 if test -z "$ac_cv_prog_RANLIB"; then
3176   ac_ct_RANLIB=$RANLIB
3177   # Extract the first word of "ranlib", so it can be a program name with args.
3178 set dummy ranlib; ac_word=$2
3179 echo "$as_me:3179: checking for $ac_word" >&5
3180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3181 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3182   echo $ECHO_N "(cached) $ECHO_C" >&6
3183 else
3184   if test -n "$ac_ct_RANLIB"; then
3185   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3186 else
3187   ac_save_IFS=$IFS; IFS=$ac_path_separator
3188 ac_dummy="$PATH"
3189 for ac_dir in $ac_dummy; do
3190   IFS=$ac_save_IFS
3191   test -z "$ac_dir" && ac_dir=.
3192   $as_executable_p "$ac_dir/$ac_word" || continue
3193 ac_cv_prog_ac_ct_RANLIB="ranlib"
3194 echo "$as_me:3194: found $ac_dir/$ac_word" >&5
3195 break
3196 done
3197
3198   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3199 fi
3200 fi
3201 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3202 if test -n "$ac_ct_RANLIB"; then
3203   echo "$as_me:3203: result: $ac_ct_RANLIB" >&5
3204 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3205 else
3206   echo "$as_me:3206: result: no" >&5
3207 echo "${ECHO_T}no" >&6
3208 fi
3209
3210   RANLIB=$ac_ct_RANLIB
3211 else
3212   RANLIB="$ac_cv_prog_RANLIB"
3213 fi
3214
3215 if test -n "$ac_tool_prefix"; then
3216   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3217 set dummy ${ac_tool_prefix}ld; ac_word=$2
3218 echo "$as_me:3218: checking for $ac_word" >&5
3219 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3220 if test "${ac_cv_prog_LD+set}" = set; then
3221   echo $ECHO_N "(cached) $ECHO_C" >&6
3222 else
3223   if test -n "$LD"; then
3224   ac_cv_prog_LD="$LD" # Let the user override the test.
3225 else
3226   ac_save_IFS=$IFS; IFS=$ac_path_separator
3227 ac_dummy="$PATH"
3228 for ac_dir in $ac_dummy; do
3229   IFS=$ac_save_IFS
3230   test -z "$ac_dir" && ac_dir=.
3231   $as_executable_p "$ac_dir/$ac_word" || continue
3232 ac_cv_prog_LD="${ac_tool_prefix}ld"
3233 echo "$as_me:3233: found $ac_dir/$ac_word" >&5
3234 break
3235 done
3236
3237 fi
3238 fi
3239 LD=$ac_cv_prog_LD
3240 if test -n "$LD"; then
3241   echo "$as_me:3241: result: $LD" >&5
3242 echo "${ECHO_T}$LD" >&6
3243 else
3244   echo "$as_me:3244: result: no" >&5
3245 echo "${ECHO_T}no" >&6
3246 fi
3247
3248 fi
3249 if test -z "$ac_cv_prog_LD"; then
3250   ac_ct_LD=$LD
3251   # Extract the first word of "ld", so it can be a program name with args.
3252 set dummy ld; ac_word=$2
3253 echo "$as_me:3253: checking for $ac_word" >&5
3254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3255 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3256   echo $ECHO_N "(cached) $ECHO_C" >&6
3257 else
3258   if test -n "$ac_ct_LD"; then
3259   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3260 else
3261   ac_save_IFS=$IFS; IFS=$ac_path_separator
3262 ac_dummy="$PATH"
3263 for ac_dir in $ac_dummy; do
3264   IFS=$ac_save_IFS
3265   test -z "$ac_dir" && ac_dir=.
3266   $as_executable_p "$ac_dir/$ac_word" || continue
3267 ac_cv_prog_ac_ct_LD="ld"
3268 echo "$as_me:3268: found $ac_dir/$ac_word" >&5
3269 break
3270 done
3271
3272   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3273 fi
3274 fi
3275 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3276 if test -n "$ac_ct_LD"; then
3277   echo "$as_me:3277: result: $ac_ct_LD" >&5
3278 echo "${ECHO_T}$ac_ct_LD" >&6
3279 else
3280   echo "$as_me:3280: result: no" >&5
3281 echo "${ECHO_T}no" >&6
3282 fi
3283
3284   LD=$ac_ct_LD
3285 else
3286   LD="$ac_cv_prog_LD"
3287 fi
3288
3289 if test -n "$ac_tool_prefix"; then
3290   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3291 set dummy ${ac_tool_prefix}ar; ac_word=$2
3292 echo "$as_me:3292: checking for $ac_word" >&5
3293 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3294 if test "${ac_cv_prog_AR+set}" = set; then
3295   echo $ECHO_N "(cached) $ECHO_C" >&6
3296 else
3297   if test -n "$AR"; then
3298   ac_cv_prog_AR="$AR" # Let the user override the test.
3299 else
3300   ac_save_IFS=$IFS; IFS=$ac_path_separator
3301 ac_dummy="$PATH"
3302 for ac_dir in $ac_dummy; do
3303   IFS=$ac_save_IFS
3304   test -z "$ac_dir" && ac_dir=.
3305   $as_executable_p "$ac_dir/$ac_word" || continue
3306 ac_cv_prog_AR="${ac_tool_prefix}ar"
3307 echo "$as_me:3307: found $ac_dir/$ac_word" >&5
3308 break
3309 done
3310
3311 fi
3312 fi
3313 AR=$ac_cv_prog_AR
3314 if test -n "$AR"; then
3315   echo "$as_me:3315: result: $AR" >&5
3316 echo "${ECHO_T}$AR" >&6
3317 else
3318   echo "$as_me:3318: result: no" >&5
3319 echo "${ECHO_T}no" >&6
3320 fi
3321
3322 fi
3323 if test -z "$ac_cv_prog_AR"; then
3324   ac_ct_AR=$AR
3325   # Extract the first word of "ar", so it can be a program name with args.
3326 set dummy ar; ac_word=$2
3327 echo "$as_me:3327: checking for $ac_word" >&5
3328 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3329 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3330   echo $ECHO_N "(cached) $ECHO_C" >&6
3331 else
3332   if test -n "$ac_ct_AR"; then
3333   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3334 else
3335   ac_save_IFS=$IFS; IFS=$ac_path_separator
3336 ac_dummy="$PATH"
3337 for ac_dir in $ac_dummy; do
3338   IFS=$ac_save_IFS
3339   test -z "$ac_dir" && ac_dir=.
3340   $as_executable_p "$ac_dir/$ac_word" || continue
3341 ac_cv_prog_ac_ct_AR="ar"
3342 echo "$as_me:3342: found $ac_dir/$ac_word" >&5
3343 break
3344 done
3345
3346   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3347 fi
3348 fi
3349 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3350 if test -n "$ac_ct_AR"; then
3351   echo "$as_me:3351: result: $ac_ct_AR" >&5
3352 echo "${ECHO_T}$ac_ct_AR" >&6
3353 else
3354   echo "$as_me:3354: result: no" >&5
3355 echo "${ECHO_T}no" >&6
3356 fi
3357
3358   AR=$ac_ct_AR
3359 else
3360   AR="$ac_cv_prog_AR"
3361 fi
3362
3363 if test -n "$ac_tool_prefix"; then
3364   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3365 set dummy ${ac_tool_prefix}ar; ac_word=$2
3366 echo "$as_me:3366: checking for $ac_word" >&5
3367 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3368 if test "${ac_cv_prog_AR+set}" = set; then
3369   echo $ECHO_N "(cached) $ECHO_C" >&6
3370 else
3371   if test -n "$AR"; then
3372   ac_cv_prog_AR="$AR" # Let the user override the test.
3373 else
3374   ac_save_IFS=$IFS; IFS=$ac_path_separator
3375 ac_dummy="$PATH"
3376 for ac_dir in $ac_dummy; do
3377   IFS=$ac_save_IFS
3378   test -z "$ac_dir" && ac_dir=.
3379   $as_executable_p "$ac_dir/$ac_word" || continue
3380 ac_cv_prog_AR="${ac_tool_prefix}ar"
3381 echo "$as_me:3381: found $ac_dir/$ac_word" >&5
3382 break
3383 done
3384
3385 fi
3386 fi
3387 AR=$ac_cv_prog_AR
3388 if test -n "$AR"; then
3389   echo "$as_me:3389: result: $AR" >&5
3390 echo "${ECHO_T}$AR" >&6
3391 else
3392   echo "$as_me:3392: result: no" >&5
3393 echo "${ECHO_T}no" >&6
3394 fi
3395
3396 fi
3397 if test -z "$ac_cv_prog_AR"; then
3398   ac_ct_AR=$AR
3399   # Extract the first word of "ar", so it can be a program name with args.
3400 set dummy ar; ac_word=$2
3401 echo "$as_me:3401: checking for $ac_word" >&5
3402 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3403 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3404   echo $ECHO_N "(cached) $ECHO_C" >&6
3405 else
3406   if test -n "$ac_ct_AR"; then
3407   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3408 else
3409   ac_save_IFS=$IFS; IFS=$ac_path_separator
3410 ac_dummy="$PATH"
3411 for ac_dir in $ac_dummy; do
3412   IFS=$ac_save_IFS
3413   test -z "$ac_dir" && ac_dir=.
3414   $as_executable_p "$ac_dir/$ac_word" || continue
3415 ac_cv_prog_ac_ct_AR="ar"
3416 echo "$as_me:3416: found $ac_dir/$ac_word" >&5
3417 break
3418 done
3419
3420   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3421 fi
3422 fi
3423 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3424 if test -n "$ac_ct_AR"; then
3425   echo "$as_me:3425: result: $ac_ct_AR" >&5
3426 echo "${ECHO_T}$ac_ct_AR" >&6
3427 else
3428   echo "$as_me:3428: result: no" >&5
3429 echo "${ECHO_T}no" >&6
3430 fi
3431
3432   AR=$ac_ct_AR
3433 else
3434   AR="$ac_cv_prog_AR"
3435 fi
3436
3437 echo "$as_me:3437: checking for options to update archives" >&5
3438 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3439 if test "${cf_cv_ar_flags+set}" = set; then
3440   echo $ECHO_N "(cached) $ECHO_C" >&6
3441 else
3442
3443         cf_cv_ar_flags=unknown
3444         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3445         do
3446
3447                 # check if $ARFLAGS already contains this choice
3448                 if test "x$ARFLAGS" != "x" ; then
3449                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3450                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3451                                 cf_cv_ar_flags=
3452                                 break
3453                         fi
3454                 fi
3455
3456                 rm -f conftest.$ac_cv_objext
3457                 rm -f conftest.a
3458
3459                 cat >conftest.$ac_ext <<EOF
3460 #line 3460 "configure"
3461 int     testdata[3] = { 123, 456, 789 };
3462 EOF
3463                 if { (eval echo "$as_me:3463: \"$ac_compile\"") >&5
3464   (eval $ac_compile) 2>&5
3465   ac_status=$?
3466   echo "$as_me:3466: \$? = $ac_status" >&5
3467   (exit $ac_status); } ; then
3468                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3469                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3470                         if test -f conftest.a ; then
3471                                 cf_cv_ar_flags=$cf_ar_flags
3472                                 break
3473                         fi
3474                 else
3475                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3476
3477 echo "${as_me:-configure}:3477: testing cannot compile test-program ..." 1>&5
3478
3479                         break
3480                 fi
3481         done
3482         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3483
3484 fi
3485 echo "$as_me:3485: result: $cf_cv_ar_flags" >&5
3486 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3487
3488 if test -n "$ARFLAGS" ; then
3489         if test -n "$cf_cv_ar_flags" ; then
3490                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3491         fi
3492 else
3493         ARFLAGS=$cf_cv_ar_flags
3494 fi
3495
3496         echo "$as_me:3496: checking for PATH separator" >&5
3497 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3498         case $cf_cv_system_name in
3499         (os2*)  PATH_SEPARATOR=';'  ;;
3500         (*)     ${PATH_SEPARATOR:=':'}  ;;
3501         esac
3502
3503         echo "$as_me:3503: result: $PATH_SEPARATOR" >&5
3504 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3505
3506 echo "$as_me:3506: checking if you have specified an install-prefix" >&5
3507 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3508
3509 # Check whether --with-install-prefix or --without-install-prefix was given.
3510 if test "${with_install_prefix+set}" = set; then
3511   withval="$with_install_prefix"
3512   case "$withval" in
3513         (yes|no)
3514                 ;;
3515         (*)     DESTDIR="$withval"
3516                 ;;
3517         esac
3518 fi;
3519 echo "$as_me:3519: result: $DESTDIR" >&5
3520 echo "${ECHO_T}$DESTDIR" >&6
3521
3522 ###############################################################################
3523
3524 # If we're cross-compiling, allow the user to override the tools and their
3525 # options.  The configure script is oriented toward identifying the host
3526 # compiler, etc., but we need a build compiler to generate parts of the source.
3527
3528 if test "$cross_compiling" = yes ; then
3529
3530         # defaults that we might want to override
3531         : ${BUILD_CFLAGS:=''}
3532         : ${BUILD_CPPFLAGS:=''}
3533         : ${BUILD_LDFLAGS:=''}
3534         : ${BUILD_LIBS:=''}
3535         : ${BUILD_EXEEXT:='$x'}
3536         : ${BUILD_OBJEXT:='o'}
3537
3538 # Check whether --with-build-cc or --without-build-cc was given.
3539 if test "${with_build_cc+set}" = set; then
3540   withval="$with_build_cc"
3541   BUILD_CC="$withval"
3542 else
3543   for ac_prog in gcc clang c99 c89 cc cl
3544 do
3545   # Extract the first word of "$ac_prog", so it can be a program name with args.
3546 set dummy $ac_prog; ac_word=$2
3547 echo "$as_me:3547: checking for $ac_word" >&5
3548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3549 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3550   echo $ECHO_N "(cached) $ECHO_C" >&6
3551 else
3552   if test -n "$BUILD_CC"; then
3553   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3554 else
3555   ac_save_IFS=$IFS; IFS=$ac_path_separator
3556 ac_dummy="$PATH"
3557 for ac_dir in $ac_dummy; do
3558   IFS=$ac_save_IFS
3559   test -z "$ac_dir" && ac_dir=.
3560   $as_executable_p "$ac_dir/$ac_word" || continue
3561 ac_cv_prog_BUILD_CC="$ac_prog"
3562 echo "$as_me:3562: found $ac_dir/$ac_word" >&5
3563 break
3564 done
3565
3566 fi
3567 fi
3568 BUILD_CC=$ac_cv_prog_BUILD_CC
3569 if test -n "$BUILD_CC"; then
3570   echo "$as_me:3570: result: $BUILD_CC" >&5
3571 echo "${ECHO_T}$BUILD_CC" >&6
3572 else
3573   echo "$as_me:3573: result: no" >&5
3574 echo "${ECHO_T}no" >&6
3575 fi
3576
3577   test -n "$BUILD_CC" && break
3578 done
3579 test -n "$BUILD_CC" || BUILD_CC="none"
3580
3581 fi;
3582         echo "$as_me:3582: checking for native build C compiler" >&5
3583 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3584         echo "$as_me:3584: result: $BUILD_CC" >&5
3585 echo "${ECHO_T}$BUILD_CC" >&6
3586
3587         echo "$as_me:3587: checking for native build C preprocessor" >&5
3588 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3589
3590 # Check whether --with-build-cpp or --without-build-cpp was given.
3591 if test "${with_build_cpp+set}" = set; then
3592   withval="$with_build_cpp"
3593   BUILD_CPP="$withval"
3594 else
3595   BUILD_CPP='${BUILD_CC} -E'
3596 fi;
3597         echo "$as_me:3597: result: $BUILD_CPP" >&5
3598 echo "${ECHO_T}$BUILD_CPP" >&6
3599
3600         echo "$as_me:3600: checking for native build C flags" >&5
3601 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3602
3603 # Check whether --with-build-cflags or --without-build-cflags was given.
3604 if test "${with_build_cflags+set}" = set; then
3605   withval="$with_build_cflags"
3606   BUILD_CFLAGS="$withval"
3607 fi;
3608         echo "$as_me:3608: result: $BUILD_CFLAGS" >&5
3609 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3610
3611         echo "$as_me:3611: checking for native build C preprocessor-flags" >&5
3612 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3613
3614 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3615 if test "${with_build_cppflags+set}" = set; then
3616   withval="$with_build_cppflags"
3617   BUILD_CPPFLAGS="$withval"
3618 fi;
3619         echo "$as_me:3619: result: $BUILD_CPPFLAGS" >&5
3620 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3621
3622         echo "$as_me:3622: checking for native build linker-flags" >&5
3623 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3624
3625 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3626 if test "${with_build_ldflags+set}" = set; then
3627   withval="$with_build_ldflags"
3628   BUILD_LDFLAGS="$withval"
3629 fi;
3630         echo "$as_me:3630: result: $BUILD_LDFLAGS" >&5
3631 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3632
3633         echo "$as_me:3633: checking for native build linker-libraries" >&5
3634 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3635
3636 # Check whether --with-build-libs or --without-build-libs was given.
3637 if test "${with_build_libs+set}" = set; then
3638   withval="$with_build_libs"
3639   BUILD_LIBS="$withval"
3640 fi;
3641         echo "$as_me:3641: result: $BUILD_LIBS" >&5
3642 echo "${ECHO_T}$BUILD_LIBS" >&6
3643
3644         # this assumes we're on Unix.
3645         BUILD_EXEEXT=
3646         BUILD_OBJEXT=o
3647
3648         : ${BUILD_CC:='${CC}'}
3649
3650         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3651                 { { echo "$as_me:3651: error: Cross-build requires two compilers.
3652 Use --with-build-cc to specify the native compiler." >&5
3653 echo "$as_me: error: Cross-build requires two compilers.
3654 Use --with-build-cc to specify the native compiler." >&2;}
3655    { (exit 1); exit 1; }; }
3656         fi
3657
3658 else
3659         : ${BUILD_CC:='${CC}'}
3660         : ${BUILD_CPP:='${CPP}'}
3661         : ${BUILD_CFLAGS:='${CFLAGS}'}
3662         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3663         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3664         : ${BUILD_LIBS:='${LIBS}'}
3665         : ${BUILD_EXEEXT:='$x'}
3666         : ${BUILD_OBJEXT:='o'}
3667 fi
3668
3669 ###############################################################################
3670
3671 ### Options to allow the user to specify the set of libraries which are used.
3672 ### Use "--without-normal --with-shared" to allow the default model to be
3673 ### shared, for example.
3674 cf_list_models=""
3675
3676 echo "$as_me:3676: checking if you want to build shared C-objects" >&5
3677 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3678
3679 # Check whether --with-shared or --without-shared was given.
3680 if test "${with_shared+set}" = set; then
3681   withval="$with_shared"
3682   with_shared=$withval
3683 else
3684   with_shared=no
3685 fi;
3686 echo "$as_me:3686: result: $with_shared" >&5
3687 echo "${ECHO_T}$with_shared" >&6
3688 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3689
3690 echo "$as_me:3690: checking for specified models" >&5
3691 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3692 test -z "$cf_list_models" && cf_list_models=normal
3693 echo "$as_me:3693: result: $cf_list_models" >&5
3694 echo "${ECHO_T}$cf_list_models" >&6
3695
3696 ### Use the first model as the default, and save its suffix for use in building
3697 ### up test-applications.
3698 echo "$as_me:3698: checking for default model" >&5
3699 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3700 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3701 echo "$as_me:3701: result: $DFT_LWR_MODEL" >&5
3702 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3703
3704 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3705
3706 echo "$as_me:3706: checking for specific curses-directory" >&5
3707 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3708
3709 # Check whether --with-curses-dir or --without-curses-dir was given.
3710 if test "${with_curses_dir+set}" = set; then
3711   withval="$with_curses_dir"
3712   cf_cv_curses_dir=$withval
3713 else
3714   cf_cv_curses_dir=no
3715 fi;
3716 echo "$as_me:3716: result: $cf_cv_curses_dir" >&5
3717 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3718
3719 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3720 then
3721
3722 if test "x$prefix" != xNONE; then
3723         cf_path_syntax="$prefix"
3724 else
3725         cf_path_syntax="$ac_default_prefix"
3726 fi
3727
3728 case ".$withval" in
3729 (.\$\(*\)*|.\'*\'*)
3730         ;;
3731 (..|./*|.\\*)
3732         ;;
3733 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3734         ;;
3735 (.\${*prefix}*|.\${*dir}*)
3736         eval withval="$withval"
3737         case ".$withval" in
3738         (.NONE/*)
3739                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3740                 ;;
3741         esac
3742         ;;
3743 (.no|.NONE/*)
3744         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3745         ;;
3746 (*)
3747         { { echo "$as_me:3747: error: expected a pathname, not \"$withval\"" >&5
3748 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3749    { (exit 1); exit 1; }; }
3750         ;;
3751 esac
3752
3753         if test -d "$cf_cv_curses_dir"
3754         then
3755
3756 if test -n "$cf_cv_curses_dir/include" ; then
3757   for cf_add_incdir in $cf_cv_curses_dir/include
3758   do
3759         while test $cf_add_incdir != /usr/include
3760         do
3761           if test -d $cf_add_incdir
3762           then
3763                 cf_have_incdir=no
3764                 if test -n "$CFLAGS$CPPFLAGS" ; then
3765                   # a loop is needed to ensure we can add subdirs of existing dirs
3766                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3767                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3768                           cf_have_incdir=yes; break
3769                         fi
3770                   done
3771                 fi
3772
3773                 if test "$cf_have_incdir" = no ; then
3774                   if test "$cf_add_incdir" = /usr/local/include ; then
3775                         if test "$GCC" = yes
3776                         then
3777                           cf_save_CPPFLAGS=$CPPFLAGS
3778                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3779                           cat >conftest.$ac_ext <<_ACEOF
3780 #line 3780 "configure"
3781 #include "confdefs.h"
3782 #include <stdio.h>
3783 int
3784 main (void)
3785 {
3786 printf("Hello")
3787   ;
3788   return 0;
3789 }
3790 _ACEOF
3791 rm -f conftest.$ac_objext
3792 if { (eval echo "$as_me:3792: \"$ac_compile\"") >&5
3793   (eval $ac_compile) 2>&5
3794   ac_status=$?
3795   echo "$as_me:3795: \$? = $ac_status" >&5
3796   (exit $ac_status); } &&
3797          { ac_try='test -s conftest.$ac_objext'
3798   { (eval echo "$as_me:3798: \"$ac_try\"") >&5
3799   (eval $ac_try) 2>&5
3800   ac_status=$?
3801   echo "$as_me:3801: \$? = $ac_status" >&5
3802   (exit $ac_status); }; }; then
3803   :
3804 else
3805   echo "$as_me: failed program was:" >&5
3806 cat conftest.$ac_ext >&5
3807 cf_have_incdir=yes
3808 fi
3809 rm -f conftest.$ac_objext conftest.$ac_ext
3810                           CPPFLAGS=$cf_save_CPPFLAGS
3811                         fi
3812                   fi
3813                 fi
3814
3815                 if test "$cf_have_incdir" = no ; then
3816                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3817
3818 echo "${as_me:-configure}:3818: testing adding $cf_add_incdir to include-path ..." 1>&5
3819
3820                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3821
3822                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3823                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3824                   cf_add_incdir="$cf_top_incdir"
3825                 else
3826                   break
3827                 fi
3828           else
3829                 break
3830           fi
3831         done
3832   done
3833 fi
3834
3835 if test -n "$cf_cv_curses_dir/lib" ; then
3836         for cf_add_libdir in $cf_cv_curses_dir/lib
3837         do
3838                 if test $cf_add_libdir = /usr/lib ; then
3839                         :
3840                 elif test -d $cf_add_libdir
3841                 then
3842                         cf_have_libdir=no
3843                         if test -n "$LDFLAGS$LIBS" ; then
3844                                 # a loop is needed to ensure we can add subdirs of existing dirs
3845                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3846                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3847                                                 cf_have_libdir=yes; break
3848                                         fi
3849                                 done
3850                         fi
3851                         if test "$cf_have_libdir" = no ; then
3852                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3853
3854 echo "${as_me:-configure}:3854: testing adding $cf_add_libdir to library-path ..." 1>&5
3855
3856                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3857                         fi
3858                 fi
3859         done
3860 fi
3861
3862         fi
3863 fi
3864
3865 cf_ncuconfig_root=ncurses
3866 cf_have_ncuconfig=no
3867
3868 if test "x${PKG_CONFIG:=none}" != xnone; then
3869         echo "$as_me:3869: checking pkg-config for $cf_ncuconfig_root" >&5
3870 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3871         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3872                 echo "$as_me:3872: result: yes" >&5
3873 echo "${ECHO_T}yes" >&6
3874
3875                 echo "$as_me:3875: checking if the $cf_ncuconfig_root package files work" >&5
3876 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3877                 cf_have_ncuconfig=unknown
3878
3879                 cf_save_CPPFLAGS="$CPPFLAGS"
3880                 cf_save_LIBS="$LIBS"
3881
3882                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3883
3884 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3885 # Filter out duplicates - this happens with badly-designed ".pc" files...
3886 for cf_add_1lib in $LIBS
3887 do
3888         for cf_add_2lib in $cf_add_libs
3889         do
3890                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3891                 then
3892                         cf_add_1lib=
3893                         break
3894                 fi
3895         done
3896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3897 done
3898 LIBS="$cf_add_libs"
3899
3900                 cat >conftest.$ac_ext <<_ACEOF
3901 #line 3901 "configure"
3902 #include "confdefs.h"
3903 #include <${cf_cv_ncurses_header:-curses.h}>
3904 int
3905 main (void)
3906 {
3907 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3908   ;
3909   return 0;
3910 }
3911 _ACEOF
3912 rm -f conftest.$ac_objext conftest$ac_exeext
3913 if { (eval echo "$as_me:3913: \"$ac_link\"") >&5
3914   (eval $ac_link) 2>&5
3915   ac_status=$?
3916   echo "$as_me:3916: \$? = $ac_status" >&5
3917   (exit $ac_status); } &&
3918          { ac_try='test -s conftest$ac_exeext'
3919   { (eval echo "$as_me:3919: \"$ac_try\"") >&5
3920   (eval $ac_try) 2>&5
3921   ac_status=$?
3922   echo "$as_me:3922: \$? = $ac_status" >&5
3923   (exit $ac_status); }; }; then
3924   if test "$cross_compiling" = yes; then
3925   cf_have_ncuconfig=maybe
3926 else
3927   cat >conftest.$ac_ext <<_ACEOF
3928 #line 3928 "configure"
3929 #include "confdefs.h"
3930 #include <${cf_cv_ncurses_header:-curses.h}>
3931                                 int main(void)
3932                                 { char *xx = curses_version(); return (xx == 0); }
3933 _ACEOF
3934 rm -f conftest$ac_exeext
3935 if { (eval echo "$as_me:3935: \"$ac_link\"") >&5
3936   (eval $ac_link) 2>&5
3937   ac_status=$?
3938   echo "$as_me:3938: \$? = $ac_status" >&5
3939   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3940   { (eval echo "$as_me:3940: \"$ac_try\"") >&5
3941   (eval $ac_try) 2>&5
3942   ac_status=$?
3943   echo "$as_me:3943: \$? = $ac_status" >&5
3944   (exit $ac_status); }; }; then
3945   cf_have_ncuconfig=yes
3946 else
3947   echo "$as_me: program exited with status $ac_status" >&5
3948 echo "$as_me: failed program was:" >&5
3949 cat conftest.$ac_ext >&5
3950 cf_have_ncuconfig=no
3951 fi
3952 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3953 fi
3954 else
3955   echo "$as_me: failed program was:" >&5
3956 cat conftest.$ac_ext >&5
3957 cf_have_ncuconfig=no
3958 fi
3959 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3960                 echo "$as_me:3960: result: $cf_have_ncuconfig" >&5
3961 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3962                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3963                 if test "$cf_have_ncuconfig" != "yes"
3964                 then
3965                         CPPFLAGS="$cf_save_CPPFLAGS"
3966                         LIBS="$cf_save_LIBS"
3967                         NCURSES_CONFIG_PKG=none
3968                 else
3969
3970 cat >>confdefs.h <<\EOF
3971 #define NCURSES 1
3972 EOF
3973
3974                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3975
3976 echo "$as_me:3976: checking for terminfo header" >&5
3977 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
3978 if test "${cf_cv_term_header+set}" = set; then
3979   echo $ECHO_N "(cached) $ECHO_C" >&6
3980 else
3981
3982 case ${cf_cv_ncurses_header} in
3983 (*/ncurses.h|*/ncursesw.h)
3984         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3985         ;;
3986 (*)
3987         cf_term_header=term.h
3988         ;;
3989 esac
3990
3991 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3992 do
3993 cat >conftest.$ac_ext <<_ACEOF
3994 #line 3994 "configure"
3995 #include "confdefs.h"
3996 #include <stdio.h>
3997 #include <${cf_cv_ncurses_header:-curses.h}>
3998 #include <$cf_test>
3999
4000 int
4001 main (void)
4002 {
4003 int x = auto_left_margin
4004   ;
4005   return 0;
4006 }
4007 _ACEOF
4008 rm -f conftest.$ac_objext
4009 if { (eval echo "$as_me:4009: \"$ac_compile\"") >&5
4010   (eval $ac_compile) 2>&5
4011   ac_status=$?
4012   echo "$as_me:4012: \$? = $ac_status" >&5
4013   (exit $ac_status); } &&
4014          { ac_try='test -s conftest.$ac_objext'
4015   { (eval echo "$as_me:4015: \"$ac_try\"") >&5
4016   (eval $ac_try) 2>&5
4017   ac_status=$?
4018   echo "$as_me:4018: \$? = $ac_status" >&5
4019   (exit $ac_status); }; }; then
4020
4021         cf_cv_term_header="$cf_test"
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat conftest.$ac_ext >&5
4025
4026         cf_cv_term_header=unknown
4027
4028 fi
4029 rm -f conftest.$ac_objext conftest.$ac_ext
4030         test "$cf_cv_term_header" != unknown && break
4031 done
4032
4033 fi
4034 echo "$as_me:4034: result: $cf_cv_term_header" >&5
4035 echo "${ECHO_T}$cf_cv_term_header" >&6
4036
4037 # Set definitions to allow ifdef'ing to accommodate subdirectories
4038
4039 case $cf_cv_term_header in
4040 (*term.h)
4041
4042 cat >>confdefs.h <<\EOF
4043 #define HAVE_TERM_H 1
4044 EOF
4045
4046         ;;
4047 esac
4048
4049 case $cf_cv_term_header in
4050 (ncurses/term.h)
4051
4052 cat >>confdefs.h <<\EOF
4053 #define HAVE_NCURSES_TERM_H 1
4054 EOF
4055
4056         ;;
4057 (ncursesw/term.h)
4058
4059 cat >>confdefs.h <<\EOF
4060 #define HAVE_NCURSESW_TERM_H 1
4061 EOF
4062
4063         ;;
4064 esac
4065
4066                 fi
4067
4068         else
4069                 echo "$as_me:4069: result: no" >&5
4070 echo "${ECHO_T}no" >&6
4071                 NCURSES_CONFIG_PKG=none
4072         fi
4073 else
4074         NCURSES_CONFIG_PKG=none
4075 fi
4076
4077 if test "x$cf_have_ncuconfig" = "xno"; then
4078         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
4079
4080 if test -n "$ac_tool_prefix"; then
4081   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4082   do
4083     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4084 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4085 echo "$as_me:4085: checking for $ac_word" >&5
4086 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4087 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
4088   echo $ECHO_N "(cached) $ECHO_C" >&6
4089 else
4090   if test -n "$NCURSES_CONFIG"; then
4091   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
4092 else
4093   ac_save_IFS=$IFS; IFS=$ac_path_separator
4094 ac_dummy="$PATH"
4095 for ac_dir in $ac_dummy; do
4096   IFS=$ac_save_IFS
4097   test -z "$ac_dir" && ac_dir=.
4098   $as_executable_p "$ac_dir/$ac_word" || continue
4099 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
4100 echo "$as_me:4100: found $ac_dir/$ac_word" >&5
4101 break
4102 done
4103
4104 fi
4105 fi
4106 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
4107 if test -n "$NCURSES_CONFIG"; then
4108   echo "$as_me:4108: result: $NCURSES_CONFIG" >&5
4109 echo "${ECHO_T}$NCURSES_CONFIG" >&6
4110 else
4111   echo "$as_me:4111: result: no" >&5
4112 echo "${ECHO_T}no" >&6
4113 fi
4114
4115     test -n "$NCURSES_CONFIG" && break
4116   done
4117 fi
4118 if test -z "$NCURSES_CONFIG"; then
4119   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
4120   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
4121 do
4122   # Extract the first word of "$ac_prog", so it can be a program name with args.
4123 set dummy $ac_prog; ac_word=$2
4124 echo "$as_me:4124: checking for $ac_word" >&5
4125 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4126 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
4127   echo $ECHO_N "(cached) $ECHO_C" >&6
4128 else
4129   if test -n "$ac_ct_NCURSES_CONFIG"; then
4130   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
4131 else
4132   ac_save_IFS=$IFS; IFS=$ac_path_separator
4133 ac_dummy="$PATH"
4134 for ac_dir in $ac_dummy; do
4135   IFS=$ac_save_IFS
4136   test -z "$ac_dir" && ac_dir=.
4137   $as_executable_p "$ac_dir/$ac_word" || continue
4138 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4139 echo "$as_me:4139: found $ac_dir/$ac_word" >&5
4140 break
4141 done
4142
4143 fi
4144 fi
4145 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4146 if test -n "$ac_ct_NCURSES_CONFIG"; then
4147   echo "$as_me:4147: result: $ac_ct_NCURSES_CONFIG" >&5
4148 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4149 else
4150   echo "$as_me:4150: result: no" >&5
4151 echo "${ECHO_T}no" >&6
4152 fi
4153
4154   test -n "$ac_ct_NCURSES_CONFIG" && break
4155 done
4156 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4157
4158   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4159 fi
4160
4161         if test "$NCURSES_CONFIG" != none ; then
4162
4163                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4164
4165 cf_add_libs="`$NCURSES_CONFIG --libs`"
4166 # Filter out duplicates - this happens with badly-designed ".pc" files...
4167 for cf_add_1lib in $LIBS
4168 do
4169         for cf_add_2lib in $cf_add_libs
4170         do
4171                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4172                 then
4173                         cf_add_1lib=
4174                         break
4175                 fi
4176         done
4177         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4178 done
4179 LIBS="$cf_add_libs"
4180
4181                 # even with config script, some packages use no-override for curses.h
4182
4183 echo "$as_me:4183: checking if we have identified curses headers" >&5
4184 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4185 if test "${cf_cv_ncurses_header+set}" = set; then
4186   echo $ECHO_N "(cached) $ECHO_C" >&6
4187 else
4188
4189 cf_cv_ncurses_header=none
4190 for cf_header in \
4191         ncurses.h ncurses/ncurses.h \
4192         curses.h ncurses/curses.h
4193 do
4194 cat >conftest.$ac_ext <<_ACEOF
4195 #line 4195 "configure"
4196 #include "confdefs.h"
4197 #include <${cf_header}>
4198 int
4199 main (void)
4200 {
4201 initscr(); tgoto("?", 0,0)
4202   ;
4203   return 0;
4204 }
4205 _ACEOF
4206 rm -f conftest.$ac_objext
4207 if { (eval echo "$as_me:4207: \"$ac_compile\"") >&5
4208   (eval $ac_compile) 2>&5
4209   ac_status=$?
4210   echo "$as_me:4210: \$? = $ac_status" >&5
4211   (exit $ac_status); } &&
4212          { ac_try='test -s conftest.$ac_objext'
4213   { (eval echo "$as_me:4213: \"$ac_try\"") >&5
4214   (eval $ac_try) 2>&5
4215   ac_status=$?
4216   echo "$as_me:4216: \$? = $ac_status" >&5
4217   (exit $ac_status); }; }; then
4218   cf_cv_ncurses_header=$cf_header; break
4219 else
4220   echo "$as_me: failed program was:" >&5
4221 cat conftest.$ac_ext >&5
4222 fi
4223 rm -f conftest.$ac_objext conftest.$ac_ext
4224 done
4225
4226 fi
4227 echo "$as_me:4227: result: $cf_cv_ncurses_header" >&5
4228 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4229
4230 if test "$cf_cv_ncurses_header" = none ; then
4231         { { echo "$as_me:4231: error: No curses header-files found" >&5
4232 echo "$as_me: error: No curses header-files found" >&2;}
4233    { (exit 1); exit 1; }; }
4234 fi
4235
4236 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4237
4238 for ac_header in $cf_cv_ncurses_header
4239 do
4240 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4241 echo "$as_me:4241: checking for $ac_header" >&5
4242 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4243 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4244   echo $ECHO_N "(cached) $ECHO_C" >&6
4245 else
4246   cat >conftest.$ac_ext <<_ACEOF
4247 #line 4247 "configure"
4248 #include "confdefs.h"
4249 #include <$ac_header>
4250 _ACEOF
4251 if { (eval echo "$as_me:4251: \"$ac_cpp conftest.$ac_ext\"") >&5
4252   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4253   ac_status=$?
4254   egrep -v '^ *\+' conftest.er1 >conftest.err
4255   rm -f conftest.er1
4256   cat conftest.err >&5
4257   echo "$as_me:4257: \$? = $ac_status" >&5
4258   (exit $ac_status); } >/dev/null; then
4259   if test -s conftest.err; then
4260     ac_cpp_err=$ac_c_preproc_warn_flag
4261   else
4262     ac_cpp_err=
4263   fi
4264 else
4265   ac_cpp_err=yes
4266 fi
4267 if test -z "$ac_cpp_err"; then
4268   eval "$as_ac_Header=yes"
4269 else
4270   echo "$as_me: failed program was:" >&5
4271   cat conftest.$ac_ext >&5
4272   eval "$as_ac_Header=no"
4273 fi
4274 rm -f conftest.err conftest.$ac_ext
4275 fi
4276 echo "$as_me:4276: result: `eval echo '${'$as_ac_Header'}'`" >&5
4277 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4278 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4279   cat >>confdefs.h <<EOF
4280 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4281 EOF
4282
4283 fi
4284 done
4285
4286 cat >>confdefs.h <<\EOF
4287 #define NCURSES 1
4288 EOF
4289
4290 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4291
4292                 cat >>confdefs.h <<EOF
4293 #define $cf_nculib_ROOT 1
4294 EOF
4295
4296                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4297
4298         else
4299
4300 cf_ncuhdr_root=ncurses
4301
4302 test -n "$cf_cv_curses_dir" && \
4303 test "$cf_cv_curses_dir" != "no" && { \
4304
4305 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4306   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4307   do
4308         while test $cf_add_incdir != /usr/include
4309         do
4310           if test -d $cf_add_incdir
4311           then
4312                 cf_have_incdir=no
4313                 if test -n "$CFLAGS$CPPFLAGS" ; then
4314                   # a loop is needed to ensure we can add subdirs of existing dirs
4315                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4316                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4317                           cf_have_incdir=yes; break
4318                         fi
4319                   done
4320                 fi
4321
4322                 if test "$cf_have_incdir" = no ; then
4323                   if test "$cf_add_incdir" = /usr/local/include ; then
4324                         if test "$GCC" = yes
4325                         then
4326                           cf_save_CPPFLAGS=$CPPFLAGS
4327                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4328                           cat >conftest.$ac_ext <<_ACEOF
4329 #line 4329 "configure"
4330 #include "confdefs.h"
4331 #include <stdio.h>
4332 int
4333 main (void)
4334 {
4335 printf("Hello")
4336   ;
4337   return 0;
4338 }
4339 _ACEOF
4340 rm -f conftest.$ac_objext
4341 if { (eval echo "$as_me:4341: \"$ac_compile\"") >&5
4342   (eval $ac_compile) 2>&5
4343   ac_status=$?
4344   echo "$as_me:4344: \$? = $ac_status" >&5
4345   (exit $ac_status); } &&
4346          { ac_try='test -s conftest.$ac_objext'
4347   { (eval echo "$as_me:4347: \"$ac_try\"") >&5
4348   (eval $ac_try) 2>&5
4349   ac_status=$?
4350   echo "$as_me:4350: \$? = $ac_status" >&5
4351   (exit $ac_status); }; }; then
4352   :
4353 else
4354   echo "$as_me: failed program was:" >&5
4355 cat conftest.$ac_ext >&5
4356 cf_have_incdir=yes
4357 fi
4358 rm -f conftest.$ac_objext conftest.$ac_ext
4359                           CPPFLAGS=$cf_save_CPPFLAGS
4360                         fi
4361                   fi
4362                 fi
4363
4364                 if test "$cf_have_incdir" = no ; then
4365                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4366
4367 echo "${as_me:-configure}:4367: testing adding $cf_add_incdir to include-path ..." 1>&5
4368
4369                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4370
4371                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4372                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4373                   cf_add_incdir="$cf_top_incdir"
4374                 else
4375                   break
4376                 fi
4377           else
4378                 break
4379           fi
4380         done
4381   done
4382 fi
4383
4384 }
4385
4386 echo "$as_me:4386: checking for $cf_ncuhdr_root header in include-path" >&5
4387 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4388 if test "${cf_cv_ncurses_h+set}" = set; then
4389   echo $ECHO_N "(cached) $ECHO_C" >&6
4390 else
4391
4392         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4393         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4394         for cf_header in $cf_header_list
4395         do
4396
4397         cat >conftest.$ac_ext <<_ACEOF
4398 #line 4398 "configure"
4399 #include "confdefs.h"
4400
4401 #include <$cf_header>
4402 int
4403 main (void)
4404 {
4405
4406 #ifdef NCURSES_VERSION
4407
4408 printf("%s\n", NCURSES_VERSION);
4409 #else
4410 #ifdef __NCURSES_H
4411 printf("old\n");
4412 #else
4413         make an error
4414 #endif
4415 #endif
4416
4417   ;
4418   return 0;
4419 }
4420 _ACEOF
4421 rm -f conftest.$ac_objext
4422 if { (eval echo "$as_me:4422: \"$ac_compile\"") >&5
4423   (eval $ac_compile) 2>&5
4424   ac_status=$?
4425   echo "$as_me:4425: \$? = $ac_status" >&5
4426   (exit $ac_status); } &&
4427          { ac_try='test -s conftest.$ac_objext'
4428   { (eval echo "$as_me:4428: \"$ac_try\"") >&5
4429   (eval $ac_try) 2>&5
4430   ac_status=$?
4431   echo "$as_me:4431: \$? = $ac_status" >&5
4432   (exit $ac_status); }; }; then
4433   cf_cv_ncurses_h=$cf_header
4434
4435 else
4436   echo "$as_me: failed program was:" >&5
4437 cat conftest.$ac_ext >&5
4438 cf_cv_ncurses_h=no
4439 fi
4440 rm -f conftest.$ac_objext conftest.$ac_ext
4441
4442                 test "$cf_cv_ncurses_h" != no && break
4443         done
4444
4445 fi
4446 echo "$as_me:4446: result: $cf_cv_ncurses_h" >&5
4447 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4448
4449 if test "$cf_cv_ncurses_h" != no ; then
4450         cf_cv_ncurses_header=$cf_cv_ncurses_h
4451 else
4452
4453 echo "$as_me:4453: checking for $cf_ncuhdr_root include-path" >&5
4454 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4455 if test "${cf_cv_ncurses_h2+set}" = set; then
4456   echo $ECHO_N "(cached) $ECHO_C" >&6
4457 else
4458
4459         test -n "$verbose" && echo
4460
4461 cf_search=
4462
4463 # collect the current set of include-directories from compiler flags
4464 cf_header_path_list=""
4465 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4466         for cf_header_path in $CPPFLAGS $CFLAGS
4467         do
4468                 case $cf_header_path in
4469                 (-I*)
4470                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4471
4472 test "x$cf_header_path" != "xNONE" && \
4473 test -d "$cf_header_path" && \
4474  {
4475         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4476         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4477         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4478         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4479         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4480         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"
4481 }
4482
4483                         cf_header_path_list="$cf_header_path_list $cf_search"
4484                         ;;
4485                 esac
4486         done
4487 fi
4488
4489 # add the variations for the package we are looking for
4490
4491 cf_search=
4492
4493 test "x$prefix" != "xNONE" && \
4494 test -d "$prefix" && \
4495  {
4496         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4497         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4498         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4499         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4500         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4501         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4502 }
4503
4504 for cf_subdir_prefix in \
4505         /usr \
4506         /usr/local \
4507         /usr/pkg \
4508         /opt \
4509         /opt/local \
4510         $HOME
4511 do
4512
4513 test "x$cf_subdir_prefix" != "x$prefix" && \
4514 test -d "$cf_subdir_prefix" && \
4515 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4516         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4517         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4518         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4519         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4520         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4521         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"
4522 }
4523
4524 done
4525
4526 test "$includedir" != NONE && \
4527 test "$includedir" != "/usr/include" && \
4528 test -d "$includedir" && {
4529         test -d $includedir &&    cf_search="$cf_search $includedir"
4530         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4531 }
4532
4533 test "$oldincludedir" != NONE && \
4534 test "$oldincludedir" != "/usr/include" && \
4535 test -d "$oldincludedir" && {
4536         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4537         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4538 }
4539
4540 cf_search="$cf_search $cf_header_path_list"
4541
4542         test -n "$verbose" && echo search path $cf_search
4543         cf_save2_CPPFLAGS="$CPPFLAGS"
4544         for cf_incdir in $cf_search
4545         do
4546
4547 if test -n "$cf_incdir" ; then
4548   for cf_add_incdir in $cf_incdir
4549   do
4550         while test $cf_add_incdir != /usr/include
4551         do
4552           if test -d $cf_add_incdir
4553           then
4554                 cf_have_incdir=no
4555                 if test -n "$CFLAGS$CPPFLAGS" ; then
4556                   # a loop is needed to ensure we can add subdirs of existing dirs
4557                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4558                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4559                           cf_have_incdir=yes; break
4560                         fi
4561                   done
4562                 fi
4563
4564                 if test "$cf_have_incdir" = no ; then
4565                   if test "$cf_add_incdir" = /usr/local/include ; then
4566                         if test "$GCC" = yes
4567                         then
4568                           cf_save_CPPFLAGS=$CPPFLAGS
4569                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4570                           cat >conftest.$ac_ext <<_ACEOF
4571 #line 4571 "configure"
4572 #include "confdefs.h"
4573 #include <stdio.h>
4574 int
4575 main (void)
4576 {
4577 printf("Hello")
4578   ;
4579   return 0;
4580 }
4581 _ACEOF
4582 rm -f conftest.$ac_objext
4583 if { (eval echo "$as_me:4583: \"$ac_compile\"") >&5
4584   (eval $ac_compile) 2>&5
4585   ac_status=$?
4586   echo "$as_me:4586: \$? = $ac_status" >&5
4587   (exit $ac_status); } &&
4588          { ac_try='test -s conftest.$ac_objext'
4589   { (eval echo "$as_me:4589: \"$ac_try\"") >&5
4590   (eval $ac_try) 2>&5
4591   ac_status=$?
4592   echo "$as_me:4592: \$? = $ac_status" >&5
4593   (exit $ac_status); }; }; then
4594   :
4595 else
4596   echo "$as_me: failed program was:" >&5
4597 cat conftest.$ac_ext >&5
4598 cf_have_incdir=yes
4599 fi
4600 rm -f conftest.$ac_objext conftest.$ac_ext
4601                           CPPFLAGS=$cf_save_CPPFLAGS
4602                         fi
4603                   fi
4604                 fi
4605
4606                 if test "$cf_have_incdir" = no ; then
4607                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4608
4609 echo "${as_me:-configure}:4609: testing adding $cf_add_incdir to include-path ..." 1>&5
4610
4611                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4612
4613                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4614                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4615                   cf_add_incdir="$cf_top_incdir"
4616                 else
4617                   break
4618                 fi
4619           else
4620                 break
4621           fi
4622         done
4623   done
4624 fi
4625
4626                 for cf_header in \
4627                         ncurses.h \
4628                         curses.h
4629                 do
4630
4631         cat >conftest.$ac_ext <<_ACEOF
4632 #line 4632 "configure"
4633 #include "confdefs.h"
4634
4635 #include <$cf_header>
4636 int
4637 main (void)
4638 {
4639
4640 #ifdef NCURSES_VERSION
4641
4642 printf("%s\n", NCURSES_VERSION);
4643 #else
4644 #ifdef __NCURSES_H
4645 printf("old\n");
4646 #else
4647         make an error
4648 #endif
4649 #endif
4650
4651   ;
4652   return 0;
4653 }
4654 _ACEOF
4655 rm -f conftest.$ac_objext
4656 if { (eval echo "$as_me:4656: \"$ac_compile\"") >&5
4657   (eval $ac_compile) 2>&5
4658   ac_status=$?
4659   echo "$as_me:4659: \$? = $ac_status" >&5
4660   (exit $ac_status); } &&
4661          { ac_try='test -s conftest.$ac_objext'
4662   { (eval echo "$as_me:4662: \"$ac_try\"") >&5
4663   (eval $ac_try) 2>&5
4664   ac_status=$?
4665   echo "$as_me:4665: \$? = $ac_status" >&5
4666   (exit $ac_status); }; }; then
4667   cf_cv_ncurses_h2=$cf_header
4668
4669 else
4670   echo "$as_me: failed program was:" >&5
4671 cat conftest.$ac_ext >&5
4672 cf_cv_ncurses_h2=no
4673 fi
4674 rm -f conftest.$ac_objext conftest.$ac_ext
4675
4676                         if test "$cf_cv_ncurses_h2" != no ; then
4677                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4678                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4679                                 break
4680                         fi
4681                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4682                 done
4683                 CPPFLAGS="$cf_save2_CPPFLAGS"
4684                 test "$cf_cv_ncurses_h2" != no && break
4685         done
4686         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4686: error: not found" >&5
4687 echo "$as_me: error: not found" >&2;}
4688    { (exit 1); exit 1; }; }
4689
4690 fi
4691 echo "$as_me:4691: result: $cf_cv_ncurses_h2" >&5
4692 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4693
4694         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4695         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4696         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4697                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4698         fi
4699
4700 if test -n "$cf_1st_incdir" ; then
4701   for cf_add_incdir in $cf_1st_incdir
4702   do
4703         while test $cf_add_incdir != /usr/include
4704         do
4705           if test -d $cf_add_incdir
4706           then
4707                 cf_have_incdir=no
4708                 if test -n "$CFLAGS$CPPFLAGS" ; then
4709                   # a loop is needed to ensure we can add subdirs of existing dirs
4710                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4711                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4712                           cf_have_incdir=yes; break
4713                         fi
4714                   done
4715                 fi
4716
4717                 if test "$cf_have_incdir" = no ; then
4718                   if test "$cf_add_incdir" = /usr/local/include ; then
4719                         if test "$GCC" = yes
4720                         then
4721                           cf_save_CPPFLAGS=$CPPFLAGS
4722                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4723                           cat >conftest.$ac_ext <<_ACEOF
4724 #line 4724 "configure"
4725 #include "confdefs.h"
4726 #include <stdio.h>
4727 int
4728 main (void)
4729 {
4730 printf("Hello")
4731   ;
4732   return 0;
4733 }
4734 _ACEOF
4735 rm -f conftest.$ac_objext
4736 if { (eval echo "$as_me:4736: \"$ac_compile\"") >&5
4737   (eval $ac_compile) 2>&5
4738   ac_status=$?
4739   echo "$as_me:4739: \$? = $ac_status" >&5
4740   (exit $ac_status); } &&
4741          { ac_try='test -s conftest.$ac_objext'
4742   { (eval echo "$as_me:4742: \"$ac_try\"") >&5
4743   (eval $ac_try) 2>&5
4744   ac_status=$?
4745   echo "$as_me:4745: \$? = $ac_status" >&5
4746   (exit $ac_status); }; }; then
4747   :
4748 else
4749   echo "$as_me: failed program was:" >&5
4750 cat conftest.$ac_ext >&5
4751 cf_have_incdir=yes
4752 fi
4753 rm -f conftest.$ac_objext conftest.$ac_ext
4754                           CPPFLAGS=$cf_save_CPPFLAGS
4755                         fi
4756                   fi
4757                 fi
4758
4759                 if test "$cf_have_incdir" = no ; then
4760                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4761
4762 echo "${as_me:-configure}:4762: testing adding $cf_add_incdir to include-path ..." 1>&5
4763
4764                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4765
4766                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4767                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4768                   cf_add_incdir="$cf_top_incdir"
4769                 else
4770                   break
4771                 fi
4772           else
4773                 break
4774           fi
4775         done
4776   done
4777 fi
4778
4779 fi
4780
4781 # Set definitions to allow ifdef'ing for ncurses.h
4782
4783 case $cf_cv_ncurses_header in
4784 (*ncurses.h)
4785
4786 cat >>confdefs.h <<\EOF
4787 #define HAVE_NCURSES_H 1
4788 EOF
4789
4790         ;;
4791 esac
4792
4793 case $cf_cv_ncurses_header in
4794 (ncurses/curses.h|ncurses/ncurses.h)
4795
4796 cat >>confdefs.h <<\EOF
4797 #define HAVE_NCURSES_NCURSES_H 1
4798 EOF
4799
4800         ;;
4801 (ncursesw/curses.h|ncursesw/ncurses.h)
4802
4803 cat >>confdefs.h <<\EOF
4804 #define HAVE_NCURSESW_NCURSES_H 1
4805 EOF
4806
4807         ;;
4808 esac
4809
4810 echo "$as_me:4810: checking for terminfo header" >&5
4811 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4812 if test "${cf_cv_term_header+set}" = set; then
4813   echo $ECHO_N "(cached) $ECHO_C" >&6
4814 else
4815
4816 case ${cf_cv_ncurses_header} in
4817 (*/ncurses.h|*/ncursesw.h)
4818         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4819         ;;
4820 (*)
4821         cf_term_header=term.h
4822         ;;
4823 esac
4824
4825 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4826 do
4827 cat >conftest.$ac_ext <<_ACEOF
4828 #line 4828 "configure"
4829 #include "confdefs.h"
4830 #include <stdio.h>
4831 #include <${cf_cv_ncurses_header:-curses.h}>
4832 #include <$cf_test>
4833
4834 int
4835 main (void)
4836 {
4837 int x = auto_left_margin
4838   ;
4839   return 0;
4840 }
4841 _ACEOF
4842 rm -f conftest.$ac_objext
4843 if { (eval echo "$as_me:4843: \"$ac_compile\"") >&5
4844   (eval $ac_compile) 2>&5
4845   ac_status=$?
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); } &&
4848          { ac_try='test -s conftest.$ac_objext'
4849   { (eval echo "$as_me:4849: \"$ac_try\"") >&5
4850   (eval $ac_try) 2>&5
4851   ac_status=$?
4852   echo "$as_me:4852: \$? = $ac_status" >&5
4853   (exit $ac_status); }; }; then
4854
4855         cf_cv_term_header="$cf_test"
4856 else
4857   echo "$as_me: failed program was:" >&5
4858 cat conftest.$ac_ext >&5
4859
4860         cf_cv_term_header=unknown
4861
4862 fi
4863 rm -f conftest.$ac_objext conftest.$ac_ext
4864         test "$cf_cv_term_header" != unknown && break
4865 done
4866
4867 fi
4868 echo "$as_me:4868: result: $cf_cv_term_header" >&5
4869 echo "${ECHO_T}$cf_cv_term_header" >&6
4870
4871 # Set definitions to allow ifdef'ing to accommodate subdirectories
4872
4873 case $cf_cv_term_header in
4874 (*term.h)
4875
4876 cat >>confdefs.h <<\EOF
4877 #define HAVE_TERM_H 1
4878 EOF
4879
4880         ;;
4881 esac
4882
4883 case $cf_cv_term_header in
4884 (ncurses/term.h)
4885
4886 cat >>confdefs.h <<\EOF
4887 #define HAVE_NCURSES_TERM_H 1
4888 EOF
4889
4890         ;;
4891 (ncursesw/term.h)
4892
4893 cat >>confdefs.h <<\EOF
4894 #define HAVE_NCURSESW_TERM_H 1
4895 EOF
4896
4897         ;;
4898 esac
4899
4900 # some applications need this, but should check for NCURSES_VERSION
4901
4902 cat >>confdefs.h <<\EOF
4903 #define NCURSES 1
4904 EOF
4905
4906 echo "$as_me:4906: checking for ncurses version" >&5
4907 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4908 if test "${cf_cv_ncurses_version+set}" = set; then
4909   echo $ECHO_N "(cached) $ECHO_C" >&6
4910 else
4911
4912         cf_cv_ncurses_version=no
4913         cf_tempfile=out$$
4914         rm -f $cf_tempfile
4915         if test "$cross_compiling" = yes; then
4916
4917         # This will not work if the preprocessor splits the line after the
4918         # Autoconf token.  The 'unproto' program does that.
4919         cat > conftest.$ac_ext <<EOF
4920 #include <${cf_cv_ncurses_header:-curses.h}>
4921 #undef Autoconf
4922 #ifdef NCURSES_VERSION
4923 Autoconf NCURSES_VERSION
4924 #else
4925 #ifdef __NCURSES_H
4926 Autoconf "old"
4927 #endif
4928 ;
4929 #endif
4930 EOF
4931         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4932         { (eval echo "$as_me:4932: \"$cf_try\"") >&5
4933   (eval $cf_try) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit $ac_status); }
4937         if test -f conftest.out ; then
4938                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4939                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4940                 rm -f conftest.out
4941         fi
4942
4943 else
4944   cat >conftest.$ac_ext <<_ACEOF
4945 #line 4945 "configure"
4946 #include "confdefs.h"
4947
4948 #include <${cf_cv_ncurses_header:-curses.h}>
4949 #include <stdio.h>
4950 int main(void)
4951 {
4952         FILE *fp = fopen("$cf_tempfile", "w");
4953 #ifdef NCURSES_VERSION
4954 # ifdef NCURSES_VERSION_PATCH
4955         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4956 # else
4957         fprintf(fp, "%s\n", NCURSES_VERSION);
4958 # endif
4959 #else
4960 # ifdef __NCURSES_H
4961         fprintf(fp, "old\n");
4962 # else
4963         make an error
4964 # endif
4965 #endif
4966         ${cf_cv_main_return:-return}(0);
4967 }
4968 _ACEOF
4969 rm -f conftest$ac_exeext
4970 if { (eval echo "$as_me:4970: \"$ac_link\"") >&5
4971   (eval $ac_link) 2>&5
4972   ac_status=$?
4973   echo "$as_me:4973: \$? = $ac_status" >&5
4974   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4975   { (eval echo "$as_me:4975: \"$ac_try\"") >&5
4976   (eval $ac_try) 2>&5
4977   ac_status=$?
4978   echo "$as_me:4978: \$? = $ac_status" >&5
4979   (exit $ac_status); }; }; then
4980
4981         cf_cv_ncurses_version=`cat $cf_tempfile`
4982 else
4983   echo "$as_me: program exited with status $ac_status" >&5
4984 echo "$as_me: failed program was:" >&5
4985 cat conftest.$ac_ext >&5
4986 fi
4987 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4988 fi
4989         rm -f $cf_tempfile
4990
4991 fi
4992 echo "$as_me:4992: result: $cf_cv_ncurses_version" >&5
4993 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4994 test "$cf_cv_ncurses_version" = no ||
4995 cat >>confdefs.h <<\EOF
4996 #define NCURSES 1
4997 EOF
4998
4999 cf_nculib_root=ncurses
5000         # This works, except for the special case where we find gpm, but
5001         # ncurses is in a nonstandard location via $LIBS, and we really want
5002         # to link gpm.
5003 cf_ncurses_LIBS=""
5004 cf_ncurses_SAVE="$LIBS"
5005 echo "$as_me:5005: checking for Gpm_Open in -lgpm" >&5
5006 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
5007 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
5008   echo $ECHO_N "(cached) $ECHO_C" >&6
5009 else
5010   ac_check_lib_save_LIBS=$LIBS
5011 LIBS="-lgpm  $LIBS"
5012 cat >conftest.$ac_ext <<_ACEOF
5013 #line 5013 "configure"
5014 #include "confdefs.h"
5015
5016 /* Override any gcc2 internal prototype to avoid an error.  */
5017 #ifdef __cplusplus
5018 extern "C"
5019 #endif
5020 /* We use char because int might match the return type of a gcc2
5021    builtin and then its argument prototype would still apply.  */
5022 char Gpm_Open ();
5023 int
5024 main (void)
5025 {
5026 Gpm_Open ();
5027   ;
5028   return 0;
5029 }
5030 _ACEOF
5031 rm -f conftest.$ac_objext conftest$ac_exeext
5032 if { (eval echo "$as_me:5032: \"$ac_link\"") >&5
5033   (eval $ac_link) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit $ac_status); } &&
5037          { ac_try='test -s conftest$ac_exeext'
5038   { (eval echo "$as_me:5038: \"$ac_try\"") >&5
5039   (eval $ac_try) 2>&5
5040   ac_status=$?
5041   echo "$as_me:5041: \$? = $ac_status" >&5
5042   (exit $ac_status); }; }; then
5043   ac_cv_lib_gpm_Gpm_Open=yes
5044 else
5045   echo "$as_me: failed program was:" >&5
5046 cat conftest.$ac_ext >&5
5047 ac_cv_lib_gpm_Gpm_Open=no
5048 fi
5049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5050 LIBS=$ac_check_lib_save_LIBS
5051 fi
5052 echo "$as_me:5052: result: $ac_cv_lib_gpm_Gpm_Open" >&5
5053 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
5054 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
5055   echo "$as_me:5055: checking for initscr in -lgpm" >&5
5056 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
5057 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
5058   echo $ECHO_N "(cached) $ECHO_C" >&6
5059 else
5060   ac_check_lib_save_LIBS=$LIBS
5061 LIBS="-lgpm  $LIBS"
5062 cat >conftest.$ac_ext <<_ACEOF
5063 #line 5063 "configure"
5064 #include "confdefs.h"
5065
5066 /* Override any gcc2 internal prototype to avoid an error.  */
5067 #ifdef __cplusplus
5068 extern "C"
5069 #endif
5070 /* We use char because int might match the return type of a gcc2
5071    builtin and then its argument prototype would still apply.  */
5072 char initscr ();
5073 int
5074 main (void)
5075 {
5076 initscr ();
5077   ;
5078   return 0;
5079 }
5080 _ACEOF
5081 rm -f conftest.$ac_objext conftest$ac_exeext
5082 if { (eval echo "$as_me:5082: \"$ac_link\"") >&5
5083   (eval $ac_link) 2>&5
5084   ac_status=$?
5085   echo "$as_me:5085: \$? = $ac_status" >&5
5086   (exit $ac_status); } &&
5087          { ac_try='test -s conftest$ac_exeext'
5088   { (eval echo "$as_me:5088: \"$ac_try\"") >&5
5089   (eval $ac_try) 2>&5
5090   ac_status=$?
5091   echo "$as_me:5091: \$? = $ac_status" >&5
5092   (exit $ac_status); }; }; then
5093   ac_cv_lib_gpm_initscr=yes
5094 else
5095   echo "$as_me: failed program was:" >&5
5096 cat conftest.$ac_ext >&5
5097 ac_cv_lib_gpm_initscr=no
5098 fi
5099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5100 LIBS=$ac_check_lib_save_LIBS
5101 fi
5102 echo "$as_me:5102: result: $ac_cv_lib_gpm_initscr" >&5
5103 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
5104 if test $ac_cv_lib_gpm_initscr = yes; then
5105   LIBS="$cf_ncurses_SAVE"
5106 else
5107   cf_ncurses_LIBS="-lgpm"
5108 fi
5109
5110 fi
5111
5112 case $host_os in
5113 (freebsd*)
5114         # This is only necessary if you are linking against an obsolete
5115         # version of ncurses (but it should do no harm, since it's static).
5116         if test "$cf_nculib_root" = ncurses ; then
5117                 echo "$as_me:5117: checking for tgoto in -lmytinfo" >&5
5118 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5119 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5120   echo $ECHO_N "(cached) $ECHO_C" >&6
5121 else
5122   ac_check_lib_save_LIBS=$LIBS
5123 LIBS="-lmytinfo  $LIBS"
5124 cat >conftest.$ac_ext <<_ACEOF
5125 #line 5125 "configure"
5126 #include "confdefs.h"
5127
5128 /* Override any gcc2 internal prototype to avoid an error.  */
5129 #ifdef __cplusplus
5130 extern "C"
5131 #endif
5132 /* We use char because int might match the return type of a gcc2
5133    builtin and then its argument prototype would still apply.  */
5134 char tgoto ();
5135 int
5136 main (void)
5137 {
5138 tgoto ();
5139   ;
5140   return 0;
5141 }
5142 _ACEOF
5143 rm -f conftest.$ac_objext conftest$ac_exeext
5144 if { (eval echo "$as_me:5144: \"$ac_link\"") >&5
5145   (eval $ac_link) 2>&5
5146   ac_status=$?
5147   echo "$as_me:5147: \$? = $ac_status" >&5
5148   (exit $ac_status); } &&
5149          { ac_try='test -s conftest$ac_exeext'
5150   { (eval echo "$as_me:5150: \"$ac_try\"") >&5
5151   (eval $ac_try) 2>&5
5152   ac_status=$?
5153   echo "$as_me:5153: \$? = $ac_status" >&5
5154   (exit $ac_status); }; }; then
5155   ac_cv_lib_mytinfo_tgoto=yes
5156 else
5157   echo "$as_me: failed program was:" >&5
5158 cat conftest.$ac_ext >&5
5159 ac_cv_lib_mytinfo_tgoto=no
5160 fi
5161 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5162 LIBS=$ac_check_lib_save_LIBS
5163 fi
5164 echo "$as_me:5164: result: $ac_cv_lib_mytinfo_tgoto" >&5
5165 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5166 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5167   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5168 fi
5169
5170         fi
5171         ;;
5172 esac
5173
5174 cf_add_libs="$cf_ncurses_LIBS"
5175 # Filter out duplicates - this happens with badly-designed ".pc" files...
5176 for cf_add_1lib in $LIBS
5177 do
5178         for cf_add_2lib in $cf_add_libs
5179         do
5180                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5181                 then
5182                         cf_add_1lib=
5183                         break
5184                 fi
5185         done
5186         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5187 done
5188 LIBS="$cf_add_libs"
5189
5190 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5191 then
5192
5193 cf_add_libs="-l$cf_nculib_root"
5194 # Filter out duplicates - this happens with badly-designed ".pc" files...
5195 for cf_add_1lib in $LIBS
5196 do
5197         for cf_add_2lib in $cf_add_libs
5198         do
5199                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5200                 then
5201                         cf_add_1lib=
5202                         break
5203                 fi
5204         done
5205         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5206 done
5207 LIBS="$cf_add_libs"
5208
5209 else
5210
5211         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5212         cf_libdir=""
5213         echo "$as_me:5213: checking for initscr" >&5
5214 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5215 if test "${ac_cv_func_initscr+set}" = set; then
5216   echo $ECHO_N "(cached) $ECHO_C" >&6
5217 else
5218   cat >conftest.$ac_ext <<_ACEOF
5219 #line 5219 "configure"
5220 #include "confdefs.h"
5221 /* System header to define __stub macros and hopefully few prototypes,
5222     which can conflict with char initscr (); below.  */
5223 #include <assert.h>
5224 /* Override any gcc2 internal prototype to avoid an error.  */
5225 #ifdef __cplusplus
5226 extern "C"
5227 #endif
5228 /* We use char because int might match the return type of a gcc2
5229    builtin and then its argument prototype would still apply.  */
5230 char initscr ();
5231 char (*f) ();
5232
5233 int
5234 main (void)
5235 {
5236 /* The GNU C library defines this for functions which it implements
5237     to always fail with ENOSYS.  Some functions are actually named
5238     something starting with __ and the normal name is an alias.  */
5239 #if defined (__stub_initscr) || defined (__stub___initscr)
5240 choke me
5241 #else
5242 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5243 #endif
5244
5245   ;
5246   return 0;
5247 }
5248 _ACEOF
5249 rm -f conftest.$ac_objext conftest$ac_exeext
5250 if { (eval echo "$as_me:5250: \"$ac_link\"") >&5
5251   (eval $ac_link) 2>&5
5252   ac_status=$?
5253   echo "$as_me:5253: \$? = $ac_status" >&5
5254   (exit $ac_status); } &&
5255          { ac_try='test -s conftest$ac_exeext'
5256   { (eval echo "$as_me:5256: \"$ac_try\"") >&5
5257   (eval $ac_try) 2>&5
5258   ac_status=$?
5259   echo "$as_me:5259: \$? = $ac_status" >&5
5260   (exit $ac_status); }; }; then
5261   ac_cv_func_initscr=yes
5262 else
5263   echo "$as_me: failed program was:" >&5
5264 cat conftest.$ac_ext >&5
5265 ac_cv_func_initscr=no
5266 fi
5267 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5268 fi
5269 echo "$as_me:5269: result: $ac_cv_func_initscr" >&5
5270 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5271 if test $ac_cv_func_initscr = yes; then
5272   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5273 else
5274
5275                 cf_save_LIBS="$LIBS"
5276                 echo "$as_me:5276: checking for initscr in -l$cf_nculib_root" >&5
5277 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5278                 LIBS="-l$cf_nculib_root $LIBS"
5279                 cat >conftest.$ac_ext <<_ACEOF
5280 #line 5280 "configure"
5281 #include "confdefs.h"
5282 #include <${cf_cv_ncurses_header:-curses.h}>
5283 int
5284 main (void)
5285 {
5286 initscr()
5287   ;
5288   return 0;
5289 }
5290 _ACEOF
5291 rm -f conftest.$ac_objext conftest$ac_exeext
5292 if { (eval echo "$as_me:5292: \"$ac_link\"") >&5
5293   (eval $ac_link) 2>&5
5294   ac_status=$?
5295   echo "$as_me:5295: \$? = $ac_status" >&5
5296   (exit $ac_status); } &&
5297          { ac_try='test -s conftest$ac_exeext'
5298   { (eval echo "$as_me:5298: \"$ac_try\"") >&5
5299   (eval $ac_try) 2>&5
5300   ac_status=$?
5301   echo "$as_me:5301: \$? = $ac_status" >&5
5302   (exit $ac_status); }; }; then
5303   echo "$as_me:5303: result: yes" >&5
5304 echo "${ECHO_T}yes" >&6
5305                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5306
5307 else
5308   echo "$as_me: failed program was:" >&5
5309 cat conftest.$ac_ext >&5
5310 echo "$as_me:5310: result: no" >&5
5311 echo "${ECHO_T}no" >&6
5312
5313 cf_search=
5314 cf_library_path_list=""
5315 if test -n "${LDFLAGS}${LIBS}" ; then
5316         for cf_library_path in $LDFLAGS $LIBS
5317         do
5318                 case $cf_library_path in
5319                 (-L*)
5320                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5321
5322 test "x$cf_library_path" != "xNONE" && \
5323 test -d "$cf_library_path" && \
5324  {
5325         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5326         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5327         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5328         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5329         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5330         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"
5331 }
5332
5333                         cf_library_path_list="$cf_library_path_list $cf_search"
5334                         ;;
5335                 esac
5336         done
5337 fi
5338
5339 cf_search=
5340
5341 test "x$prefix" != "xNONE" && \
5342 test -d "$prefix" && \
5343  {
5344         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5345         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5346         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5347         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5348         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5349         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5350 }
5351
5352 for cf_subdir_prefix in \
5353         /usr \
5354         /usr/local \
5355         /usr/pkg \
5356         /opt \
5357         /opt/local \
5358         $HOME
5359 do
5360
5361 test "x$cf_subdir_prefix" != "x$prefix" && \
5362 test -d "$cf_subdir_prefix" && \
5363 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5364         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5365         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5366         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5367         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5368         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5369         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"
5370 }
5371
5372 done
5373
5374 cf_search="$cf_library_path_list $cf_search"
5375
5376                         for cf_libdir in $cf_search
5377                         do
5378                                 echo "$as_me:5378: checking for -l$cf_nculib_root in $cf_libdir" >&5
5379 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5380                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5381                                 cat >conftest.$ac_ext <<_ACEOF
5382 #line 5382 "configure"
5383 #include "confdefs.h"
5384 #include <${cf_cv_ncurses_header:-curses.h}>
5385 int
5386 main (void)
5387 {
5388 initscr()
5389   ;
5390   return 0;
5391 }
5392 _ACEOF
5393 rm -f conftest.$ac_objext conftest$ac_exeext
5394 if { (eval echo "$as_me:5394: \"$ac_link\"") >&5
5395   (eval $ac_link) 2>&5
5396   ac_status=$?
5397   echo "$as_me:5397: \$? = $ac_status" >&5
5398   (exit $ac_status); } &&
5399          { ac_try='test -s conftest$ac_exeext'
5400   { (eval echo "$as_me:5400: \"$ac_try\"") >&5
5401   (eval $ac_try) 2>&5
5402   ac_status=$?
5403   echo "$as_me:5403: \$? = $ac_status" >&5
5404   (exit $ac_status); }; }; then
5405   echo "$as_me:5405: result: yes" >&5
5406 echo "${ECHO_T}yes" >&6
5407                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5408                                          break
5409 else
5410   echo "$as_me: failed program was:" >&5
5411 cat conftest.$ac_ext >&5
5412 echo "$as_me:5412: result: no" >&5
5413 echo "${ECHO_T}no" >&6
5414                                          LIBS="$cf_save_LIBS"
5415 fi
5416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5417                         done
5418
5419 fi
5420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5421
5422 fi
5423
5424 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5425
5426 if test $cf_found_library = no ; then
5427         { { echo "$as_me:5427: error: Cannot link $cf_nculib_root library" >&5
5428 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5429    { (exit 1); exit 1; }; }
5430 fi
5431
5432 fi
5433
5434 if test -n "$cf_ncurses_LIBS" ; then
5435         echo "$as_me:5435: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5436 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5437         cf_ncurses_SAVE="$LIBS"
5438         for p in $cf_ncurses_LIBS ; do
5439                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5440                 if test "$q" != "$LIBS" ; then
5441                         LIBS="$q"
5442                 fi
5443         done
5444         cat >conftest.$ac_ext <<_ACEOF
5445 #line 5445 "configure"
5446 #include "confdefs.h"
5447 #include <${cf_cv_ncurses_header:-curses.h}>
5448 int
5449 main (void)
5450 {
5451 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5452   ;
5453   return 0;
5454 }
5455 _ACEOF
5456 rm -f conftest.$ac_objext conftest$ac_exeext
5457 if { (eval echo "$as_me:5457: \"$ac_link\"") >&5
5458   (eval $ac_link) 2>&5
5459   ac_status=$?
5460   echo "$as_me:5460: \$? = $ac_status" >&5
5461   (exit $ac_status); } &&
5462          { ac_try='test -s conftest$ac_exeext'
5463   { (eval echo "$as_me:5463: \"$ac_try\"") >&5
5464   (eval $ac_try) 2>&5
5465   ac_status=$?
5466   echo "$as_me:5466: \$? = $ac_status" >&5
5467   (exit $ac_status); }; }; then
5468   echo "$as_me:5468: result: yes" >&5
5469 echo "${ECHO_T}yes" >&6
5470 else
5471   echo "$as_me: failed program was:" >&5
5472 cat conftest.$ac_ext >&5
5473 echo "$as_me:5473: result: no" >&5
5474 echo "${ECHO_T}no" >&6
5475                  LIBS="$cf_ncurses_SAVE"
5476 fi
5477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5478 fi
5479
5480 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5481
5482 cat >>confdefs.h <<EOF
5483 #define $cf_nculib_ROOT 1
5484 EOF
5485
5486         fi
5487 else
5488         NCURSES_CONFIG=none
5489 fi
5490
5491 echo "$as_me:5491: checking if you want wide-character code" >&5
5492 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5493
5494 # Check whether --enable-widec or --disable-widec was given.
5495 if test "${enable_widec+set}" = set; then
5496   enableval="$enable_widec"
5497   with_widec=$enableval
5498 else
5499   with_widec=no
5500 fi;
5501 echo "$as_me:5501: result: $with_widec" >&5
5502 echo "${ECHO_T}$with_widec" >&6
5503 if test "$with_widec" = yes ; then
5504
5505 echo "$as_me:5505: checking for multibyte character support" >&5
5506 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5507 if test "${cf_cv_utf8_lib+set}" = set; then
5508   echo $ECHO_N "(cached) $ECHO_C" >&6
5509 else
5510
5511         cf_save_LIBS="$LIBS"
5512         cat >conftest.$ac_ext <<_ACEOF
5513 #line 5513 "configure"
5514 #include "confdefs.h"
5515
5516 #include <stdlib.h>
5517 int
5518 main (void)
5519 {
5520 putwc(0,0);
5521   ;
5522   return 0;
5523 }
5524 _ACEOF
5525 rm -f conftest.$ac_objext conftest$ac_exeext
5526 if { (eval echo "$as_me:5526: \"$ac_link\"") >&5
5527   (eval $ac_link) 2>&5
5528   ac_status=$?
5529   echo "$as_me:5529: \$? = $ac_status" >&5
5530   (exit $ac_status); } &&
5531          { ac_try='test -s conftest$ac_exeext'
5532   { (eval echo "$as_me:5532: \"$ac_try\"") >&5
5533   (eval $ac_try) 2>&5
5534   ac_status=$?
5535   echo "$as_me:5535: \$? = $ac_status" >&5
5536   (exit $ac_status); }; }; then
5537   cf_cv_utf8_lib=yes
5538 else
5539   echo "$as_me: failed program was:" >&5
5540 cat conftest.$ac_ext >&5
5541
5542 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5543 # will be set on completion of the AC_TRY_LINK below.
5544 cf_cv_header_path_utf8=
5545 cf_cv_library_path_utf8=
5546
5547 echo "${as_me:-configure}:5547: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5548
5549 cf_save_LIBS="$LIBS"
5550
5551 cat >conftest.$ac_ext <<_ACEOF
5552 #line 5552 "configure"
5553 #include "confdefs.h"
5554
5555 #include <libutf8.h>
5556 int
5557 main (void)
5558 {
5559 putwc(0,0);
5560   ;
5561   return 0;
5562 }
5563 _ACEOF
5564 rm -f conftest.$ac_objext conftest$ac_exeext
5565 if { (eval echo "$as_me:5565: \"$ac_link\"") >&5
5566   (eval $ac_link) 2>&5
5567   ac_status=$?
5568   echo "$as_me:5568: \$? = $ac_status" >&5
5569   (exit $ac_status); } &&
5570          { ac_try='test -s conftest$ac_exeext'
5571   { (eval echo "$as_me:5571: \"$ac_try\"") >&5
5572   (eval $ac_try) 2>&5
5573   ac_status=$?
5574   echo "$as_me:5574: \$? = $ac_status" >&5
5575   (exit $ac_status); }; }; then
5576
5577         cf_cv_find_linkage_utf8=yes
5578         cf_cv_header_path_utf8=/usr/include
5579         cf_cv_library_path_utf8=/usr/lib
5580
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584
5585 LIBS="-lutf8  $cf_save_LIBS"
5586
5587 cat >conftest.$ac_ext <<_ACEOF
5588 #line 5588 "configure"
5589 #include "confdefs.h"
5590
5591 #include <libutf8.h>
5592 int
5593 main (void)
5594 {
5595 putwc(0,0);
5596   ;
5597   return 0;
5598 }
5599 _ACEOF
5600 rm -f conftest.$ac_objext conftest$ac_exeext
5601 if { (eval echo "$as_me:5601: \"$ac_link\"") >&5
5602   (eval $ac_link) 2>&5
5603   ac_status=$?
5604   echo "$as_me:5604: \$? = $ac_status" >&5
5605   (exit $ac_status); } &&
5606          { ac_try='test -s conftest$ac_exeext'
5607   { (eval echo "$as_me:5607: \"$ac_try\"") >&5
5608   (eval $ac_try) 2>&5
5609   ac_status=$?
5610   echo "$as_me:5610: \$? = $ac_status" >&5
5611   (exit $ac_status); }; }; then
5612
5613         cf_cv_find_linkage_utf8=yes
5614         cf_cv_header_path_utf8=/usr/include
5615         cf_cv_library_path_utf8=/usr/lib
5616         cf_cv_library_file_utf8="-lutf8"
5617
5618 else
5619   echo "$as_me: failed program was:" >&5
5620 cat conftest.$ac_ext >&5
5621
5622         cf_cv_find_linkage_utf8=no
5623         LIBS="$cf_save_LIBS"
5624
5625         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5626
5627 echo "${as_me:-configure}:5627: testing find linkage for utf8 library ..." 1>&5
5628
5629 echo "${as_me:-configure}:5629: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5630
5631         cf_save_CPPFLAGS="$CPPFLAGS"
5632         cf_test_CPPFLAGS="$CPPFLAGS"
5633
5634 cf_search=
5635
5636 # collect the current set of include-directories from compiler flags
5637 cf_header_path_list=""
5638 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5639         for cf_header_path in $CPPFLAGS $CFLAGS
5640         do
5641                 case $cf_header_path in
5642                 (-I*)
5643                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5644
5645 test "x$cf_header_path" != "xNONE" && \
5646 test -d "$cf_header_path" && \
5647  {
5648         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5649         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5650         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5651         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5652         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5653         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5654 }
5655
5656                         cf_header_path_list="$cf_header_path_list $cf_search"
5657                         ;;
5658                 esac
5659         done
5660 fi
5661
5662 # add the variations for the package we are looking for
5663
5664 cf_search=
5665
5666 test "x$prefix" != "xNONE" && \
5667 test -d "$prefix" && \
5668  {
5669         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5670         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5671         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5672         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5673         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5674         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5675 }
5676
5677 for cf_subdir_prefix in \
5678         /usr \
5679         /usr/local \
5680         /usr/pkg \
5681         /opt \
5682         /opt/local \
5683         $HOME
5684 do
5685
5686 test "x$cf_subdir_prefix" != "x$prefix" && \
5687 test -d "$cf_subdir_prefix" && \
5688 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5689         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5690         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5691         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5692         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5693         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5694         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5695 }
5696
5697 done
5698
5699 test "$includedir" != NONE && \
5700 test "$includedir" != "/usr/include" && \
5701 test -d "$includedir" && {
5702         test -d $includedir &&    cf_search="$cf_search $includedir"
5703         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5704 }
5705
5706 test "$oldincludedir" != NONE && \
5707 test "$oldincludedir" != "/usr/include" && \
5708 test -d "$oldincludedir" && {
5709         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5710         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5711 }
5712
5713 cf_search="$cf_search $cf_header_path_list"
5714
5715         for cf_cv_header_path_utf8 in $cf_search
5716         do
5717                 if test -d $cf_cv_header_path_utf8 ; then
5718                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5719
5720 echo "${as_me:-configure}:5720: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5721
5722                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5723                         cat >conftest.$ac_ext <<_ACEOF
5724 #line 5724 "configure"
5725 #include "confdefs.h"
5726
5727 #include <libutf8.h>
5728 int
5729 main (void)
5730 {
5731 putwc(0,0);
5732   ;
5733   return 0;
5734 }
5735 _ACEOF
5736 rm -f conftest.$ac_objext
5737 if { (eval echo "$as_me:5737: \"$ac_compile\"") >&5
5738   (eval $ac_compile) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit $ac_status); } &&
5742          { ac_try='test -s conftest.$ac_objext'
5743   { (eval echo "$as_me:5743: \"$ac_try\"") >&5
5744   (eval $ac_try) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit $ac_status); }; }; then
5748
5749                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5750
5751 echo "${as_me:-configure}:5751: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5752
5753                                 cf_cv_find_linkage_utf8=maybe
5754                                 cf_test_CPPFLAGS="$CPPFLAGS"
5755                                 break
5756 else
5757   echo "$as_me: failed program was:" >&5
5758 cat conftest.$ac_ext >&5
5759
5760                                 CPPFLAGS="$cf_save_CPPFLAGS"
5761
5762 fi
5763 rm -f conftest.$ac_objext conftest.$ac_ext
5764                 fi
5765         done
5766
5767         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5768
5769 echo "${as_me:-configure}:5769: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5770
5771                 cf_save_LIBS="$LIBS"
5772                 cf_save_LDFLAGS="$LDFLAGS"
5773
5774                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5775
5776 cf_search=
5777 cf_library_path_list=""
5778 if test -n "${LDFLAGS}${LIBS}" ; then
5779         for cf_library_path in $LDFLAGS $LIBS
5780         do
5781                 case $cf_library_path in
5782                 (-L*)
5783                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5784
5785 test "x$cf_library_path" != "xNONE" && \
5786 test -d "$cf_library_path" && \
5787  {
5788         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5789         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5790         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5791         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5792         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5793         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5794 }
5795
5796                         cf_library_path_list="$cf_library_path_list $cf_search"
5797                         ;;
5798                 esac
5799         done
5800 fi
5801
5802 cf_search=
5803
5804 test "x$prefix" != "xNONE" && \
5805 test -d "$prefix" && \
5806  {
5807         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5808         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5809         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5810         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5811         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5812         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5813 }
5814
5815 for cf_subdir_prefix in \
5816         /usr \
5817         /usr/local \
5818         /usr/pkg \
5819         /opt \
5820         /opt/local \
5821         $HOME
5822 do
5823
5824 test "x$cf_subdir_prefix" != "x$prefix" && \
5825 test -d "$cf_subdir_prefix" && \
5826 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5827         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5828         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5829         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5830         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5831         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5832         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5833 }
5834
5835 done
5836
5837 cf_search="$cf_library_path_list $cf_search"
5838
5839                         for cf_cv_library_path_utf8 in $cf_search
5840                         do
5841                                 if test -d $cf_cv_library_path_utf8 ; then
5842                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5843
5844 echo "${as_me:-configure}:5844: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5845
5846                                         CPPFLAGS="$cf_test_CPPFLAGS"
5847                                         LIBS="-lutf8  $cf_save_LIBS"
5848                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5849                                         cat >conftest.$ac_ext <<_ACEOF
5850 #line 5850 "configure"
5851 #include "confdefs.h"
5852
5853 #include <libutf8.h>
5854 int
5855 main (void)
5856 {
5857 putwc(0,0);
5858   ;
5859   return 0;
5860 }
5861 _ACEOF
5862 rm -f conftest.$ac_objext conftest$ac_exeext
5863 if { (eval echo "$as_me:5863: \"$ac_link\"") >&5
5864   (eval $ac_link) 2>&5
5865   ac_status=$?
5866   echo "$as_me:5866: \$? = $ac_status" >&5
5867   (exit $ac_status); } &&
5868          { ac_try='test -s conftest$ac_exeext'
5869   { (eval echo "$as_me:5869: \"$ac_try\"") >&5
5870   (eval $ac_try) 2>&5
5871   ac_status=$?
5872   echo "$as_me:5872: \$? = $ac_status" >&5
5873   (exit $ac_status); }; }; then
5874
5875                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5876
5877 echo "${as_me:-configure}:5877: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5878
5879                                         cf_cv_find_linkage_utf8=yes
5880                                         cf_cv_library_file_utf8="-lutf8"
5881                                         break
5882 else
5883   echo "$as_me: failed program was:" >&5
5884 cat conftest.$ac_ext >&5
5885
5886                                         CPPFLAGS="$cf_save_CPPFLAGS"
5887                                         LIBS="$cf_save_LIBS"
5888                                         LDFLAGS="$cf_save_LDFLAGS"
5889
5890 fi
5891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5892                                 fi
5893                         done
5894                         CPPFLAGS="$cf_save_CPPFLAGS"
5895                         LDFLAGS="$cf_save_LDFLAGS"
5896                 fi
5897
5898         else
5899                 cf_cv_find_linkage_utf8=no
5900         fi
5901
5902 fi
5903 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5904
5905 fi
5906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5907
5908 LIBS="$cf_save_LIBS"
5909
5910 if test "$cf_cv_find_linkage_utf8" = yes ; then
5911 cf_cv_utf8_lib=add-on
5912 else
5913 cf_cv_utf8_lib=no
5914 fi
5915
5916 fi
5917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5918 fi
5919 echo "$as_me:5919: result: $cf_cv_utf8_lib" >&5
5920 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5921
5922 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5923 # ncurses/ncursesw:
5924 if test "$cf_cv_utf8_lib" = "add-on" ; then
5925
5926 cat >>confdefs.h <<\EOF
5927 #define HAVE_LIBUTF8_H 1
5928 EOF
5929
5930 if test -n "$cf_cv_header_path_utf8" ; then
5931   for cf_add_incdir in $cf_cv_header_path_utf8
5932   do
5933         while test $cf_add_incdir != /usr/include
5934         do
5935           if test -d $cf_add_incdir
5936           then
5937                 cf_have_incdir=no
5938                 if test -n "$CFLAGS$CPPFLAGS" ; then
5939                   # a loop is needed to ensure we can add subdirs of existing dirs
5940                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5941                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5942                           cf_have_incdir=yes; break
5943                         fi
5944                   done
5945                 fi
5946
5947                 if test "$cf_have_incdir" = no ; then
5948                   if test "$cf_add_incdir" = /usr/local/include ; then
5949                         if test "$GCC" = yes
5950                         then
5951                           cf_save_CPPFLAGS=$CPPFLAGS
5952                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5953                           cat >conftest.$ac_ext <<_ACEOF
5954 #line 5954 "configure"
5955 #include "confdefs.h"
5956 #include <stdio.h>
5957 int
5958 main (void)
5959 {
5960 printf("Hello")
5961   ;
5962   return 0;
5963 }
5964 _ACEOF
5965 rm -f conftest.$ac_objext
5966 if { (eval echo "$as_me:5966: \"$ac_compile\"") >&5
5967   (eval $ac_compile) 2>&5
5968   ac_status=$?
5969   echo "$as_me:5969: \$? = $ac_status" >&5
5970   (exit $ac_status); } &&
5971          { ac_try='test -s conftest.$ac_objext'
5972   { (eval echo "$as_me:5972: \"$ac_try\"") >&5
5973   (eval $ac_try) 2>&5
5974   ac_status=$?
5975   echo "$as_me:5975: \$? = $ac_status" >&5
5976   (exit $ac_status); }; }; then
5977   :
5978 else
5979   echo "$as_me: failed program was:" >&5
5980 cat conftest.$ac_ext >&5
5981 cf_have_incdir=yes
5982 fi
5983 rm -f conftest.$ac_objext conftest.$ac_ext
5984                           CPPFLAGS=$cf_save_CPPFLAGS
5985                         fi
5986                   fi
5987                 fi
5988
5989                 if test "$cf_have_incdir" = no ; then
5990                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5991
5992 echo "${as_me:-configure}:5992: testing adding $cf_add_incdir to include-path ..." 1>&5
5993
5994                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5995
5996                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5997                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5998                   cf_add_incdir="$cf_top_incdir"
5999                 else
6000                   break
6001                 fi
6002           else
6003                 break
6004           fi
6005         done
6006   done
6007 fi
6008
6009 if test -n "$cf_cv_library_path_utf8" ; then
6010         for cf_add_libdir in $cf_cv_library_path_utf8
6011         do
6012                 if test $cf_add_libdir = /usr/lib ; then
6013                         :
6014                 elif test -d $cf_add_libdir
6015                 then
6016                         cf_have_libdir=no
6017                         if test -n "$LDFLAGS$LIBS" ; then
6018                                 # a loop is needed to ensure we can add subdirs of existing dirs
6019                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6020                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6021                                                 cf_have_libdir=yes; break
6022                                         fi
6023                                 done
6024                         fi
6025                         if test "$cf_have_libdir" = no ; then
6026                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6027
6028 echo "${as_me:-configure}:6028: testing adding $cf_add_libdir to library-path ..." 1>&5
6029
6030                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6031                         fi
6032                 fi
6033         done
6034 fi
6035
6036 cf_add_libs="$cf_cv_library_file_utf8"
6037 # Filter out duplicates - this happens with badly-designed ".pc" files...
6038 for cf_add_1lib in $LIBS
6039 do
6040         for cf_add_2lib in $cf_add_libs
6041         do
6042                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6043                 then
6044                         cf_add_1lib=
6045                         break
6046                 fi
6047         done
6048         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6049 done
6050 LIBS="$cf_add_libs"
6051
6052 fi
6053
6054 cf_ncuconfig_root=ncursesw
6055 cf_have_ncuconfig=no
6056
6057 if test "x${PKG_CONFIG:=none}" != xnone; then
6058         echo "$as_me:6058: checking pkg-config for $cf_ncuconfig_root" >&5
6059 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6060         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6061                 echo "$as_me:6061: result: yes" >&5
6062 echo "${ECHO_T}yes" >&6
6063
6064                 echo "$as_me:6064: checking if the $cf_ncuconfig_root package files work" >&5
6065 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6066                 cf_have_ncuconfig=unknown
6067
6068                 cf_save_CPPFLAGS="$CPPFLAGS"
6069                 cf_save_LIBS="$LIBS"
6070
6071                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6072
6073 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6074 # Filter out duplicates - this happens with badly-designed ".pc" files...
6075 for cf_add_1lib in $LIBS
6076 do
6077         for cf_add_2lib in $cf_add_libs
6078         do
6079                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6080                 then
6081                         cf_add_1lib=
6082                         break
6083                 fi
6084         done
6085         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6086 done
6087 LIBS="$cf_add_libs"
6088
6089                 cat >conftest.$ac_ext <<_ACEOF
6090 #line 6090 "configure"
6091 #include "confdefs.h"
6092 #include <${cf_cv_ncurses_header:-curses.h}>
6093 int
6094 main (void)
6095 {
6096 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6097   ;
6098   return 0;
6099 }
6100 _ACEOF
6101 rm -f conftest.$ac_objext conftest$ac_exeext
6102 if { (eval echo "$as_me:6102: \"$ac_link\"") >&5
6103   (eval $ac_link) 2>&5
6104   ac_status=$?
6105   echo "$as_me:6105: \$? = $ac_status" >&5
6106   (exit $ac_status); } &&
6107          { ac_try='test -s conftest$ac_exeext'
6108   { (eval echo "$as_me:6108: \"$ac_try\"") >&5
6109   (eval $ac_try) 2>&5
6110   ac_status=$?
6111   echo "$as_me:6111: \$? = $ac_status" >&5
6112   (exit $ac_status); }; }; then
6113   if test "$cross_compiling" = yes; then
6114   cf_have_ncuconfig=maybe
6115 else
6116   cat >conftest.$ac_ext <<_ACEOF
6117 #line 6117 "configure"
6118 #include "confdefs.h"
6119 #include <${cf_cv_ncurses_header:-curses.h}>
6120                                 int main(void)
6121                                 { char *xx = curses_version(); return (xx == 0); }
6122 _ACEOF
6123 rm -f conftest$ac_exeext
6124 if { (eval echo "$as_me:6124: \"$ac_link\"") >&5
6125   (eval $ac_link) 2>&5
6126   ac_status=$?
6127   echo "$as_me:6127: \$? = $ac_status" >&5
6128   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6129   { (eval echo "$as_me:6129: \"$ac_try\"") >&5
6130   (eval $ac_try) 2>&5
6131   ac_status=$?
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit $ac_status); }; }; then
6134   cf_have_ncuconfig=yes
6135 else
6136   echo "$as_me: program exited with status $ac_status" >&5
6137 echo "$as_me: failed program was:" >&5
6138 cat conftest.$ac_ext >&5
6139 cf_have_ncuconfig=no
6140 fi
6141 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6142 fi
6143 else
6144   echo "$as_me: failed program was:" >&5
6145 cat conftest.$ac_ext >&5
6146 cf_have_ncuconfig=no
6147 fi
6148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6149                 echo "$as_me:6149: result: $cf_have_ncuconfig" >&5
6150 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6151                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6152                 if test "$cf_have_ncuconfig" != "yes"
6153                 then
6154                         CPPFLAGS="$cf_save_CPPFLAGS"
6155                         LIBS="$cf_save_LIBS"
6156                         NCURSES_CONFIG_PKG=none
6157                 else
6158
6159 cat >>confdefs.h <<\EOF
6160 #define NCURSES 1
6161 EOF
6162
6163                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6164
6165 echo "$as_me:6165: checking for terminfo header" >&5
6166 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6167 if test "${cf_cv_term_header+set}" = set; then
6168   echo $ECHO_N "(cached) $ECHO_C" >&6
6169 else
6170
6171 case ${cf_cv_ncurses_header} in
6172 (*/ncurses.h|*/ncursesw.h)
6173         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6174         ;;
6175 (*)
6176         cf_term_header=term.h
6177         ;;
6178 esac
6179
6180 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6181 do
6182 cat >conftest.$ac_ext <<_ACEOF
6183 #line 6183 "configure"
6184 #include "confdefs.h"
6185 #include <stdio.h>
6186 #include <${cf_cv_ncurses_header:-curses.h}>
6187 #include <$cf_test>
6188
6189 int
6190 main (void)
6191 {
6192 int x = auto_left_margin
6193   ;
6194   return 0;
6195 }
6196 _ACEOF
6197 rm -f conftest.$ac_objext
6198 if { (eval echo "$as_me:6198: \"$ac_compile\"") >&5
6199   (eval $ac_compile) 2>&5
6200   ac_status=$?
6201   echo "$as_me:6201: \$? = $ac_status" >&5
6202   (exit $ac_status); } &&
6203          { ac_try='test -s conftest.$ac_objext'
6204   { (eval echo "$as_me:6204: \"$ac_try\"") >&5
6205   (eval $ac_try) 2>&5
6206   ac_status=$?
6207   echo "$as_me:6207: \$? = $ac_status" >&5
6208   (exit $ac_status); }; }; then
6209
6210         cf_cv_term_header="$cf_test"
6211 else
6212   echo "$as_me: failed program was:" >&5
6213 cat conftest.$ac_ext >&5
6214
6215         cf_cv_term_header=unknown
6216
6217 fi
6218 rm -f conftest.$ac_objext conftest.$ac_ext
6219         test "$cf_cv_term_header" != unknown && break
6220 done
6221
6222 fi
6223 echo "$as_me:6223: result: $cf_cv_term_header" >&5
6224 echo "${ECHO_T}$cf_cv_term_header" >&6
6225
6226 # Set definitions to allow ifdef'ing to accommodate subdirectories
6227
6228 case $cf_cv_term_header in
6229 (*term.h)
6230
6231 cat >>confdefs.h <<\EOF
6232 #define HAVE_TERM_H 1
6233 EOF
6234
6235         ;;
6236 esac
6237
6238 case $cf_cv_term_header in
6239 (ncurses/term.h)
6240
6241 cat >>confdefs.h <<\EOF
6242 #define HAVE_NCURSES_TERM_H 1
6243 EOF
6244
6245         ;;
6246 (ncursesw/term.h)
6247
6248 cat >>confdefs.h <<\EOF
6249 #define HAVE_NCURSESW_TERM_H 1
6250 EOF
6251
6252         ;;
6253 esac
6254
6255                 fi
6256
6257         else
6258                 echo "$as_me:6258: result: no" >&5
6259 echo "${ECHO_T}no" >&6
6260                 NCURSES_CONFIG_PKG=none
6261         fi
6262 else
6263         NCURSES_CONFIG_PKG=none
6264 fi
6265
6266 if test "x$cf_have_ncuconfig" = "xno"; then
6267         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6268
6269 if test -n "$ac_tool_prefix"; then
6270   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6271   do
6272     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6273 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6274 echo "$as_me:6274: checking for $ac_word" >&5
6275 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6276 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6277   echo $ECHO_N "(cached) $ECHO_C" >&6
6278 else
6279   if test -n "$NCURSES_CONFIG"; then
6280   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6281 else
6282   ac_save_IFS=$IFS; IFS=$ac_path_separator
6283 ac_dummy="$PATH"
6284 for ac_dir in $ac_dummy; do
6285   IFS=$ac_save_IFS
6286   test -z "$ac_dir" && ac_dir=.
6287   $as_executable_p "$ac_dir/$ac_word" || continue
6288 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6289 echo "$as_me:6289: found $ac_dir/$ac_word" >&5
6290 break
6291 done
6292
6293 fi
6294 fi
6295 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6296 if test -n "$NCURSES_CONFIG"; then
6297   echo "$as_me:6297: result: $NCURSES_CONFIG" >&5
6298 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6299 else
6300   echo "$as_me:6300: result: no" >&5
6301 echo "${ECHO_T}no" >&6
6302 fi
6303
6304     test -n "$NCURSES_CONFIG" && break
6305   done
6306 fi
6307 if test -z "$NCURSES_CONFIG"; then
6308   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6309   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6310 do
6311   # Extract the first word of "$ac_prog", so it can be a program name with args.
6312 set dummy $ac_prog; ac_word=$2
6313 echo "$as_me:6313: checking for $ac_word" >&5
6314 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6315 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6316   echo $ECHO_N "(cached) $ECHO_C" >&6
6317 else
6318   if test -n "$ac_ct_NCURSES_CONFIG"; then
6319   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6320 else
6321   ac_save_IFS=$IFS; IFS=$ac_path_separator
6322 ac_dummy="$PATH"
6323 for ac_dir in $ac_dummy; do
6324   IFS=$ac_save_IFS
6325   test -z "$ac_dir" && ac_dir=.
6326   $as_executable_p "$ac_dir/$ac_word" || continue
6327 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6328 echo "$as_me:6328: found $ac_dir/$ac_word" >&5
6329 break
6330 done
6331
6332 fi
6333 fi
6334 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6335 if test -n "$ac_ct_NCURSES_CONFIG"; then
6336   echo "$as_me:6336: result: $ac_ct_NCURSES_CONFIG" >&5
6337 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6338 else
6339   echo "$as_me:6339: result: no" >&5
6340 echo "${ECHO_T}no" >&6
6341 fi
6342
6343   test -n "$ac_ct_NCURSES_CONFIG" && break
6344 done
6345 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6346
6347   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6348 fi
6349
6350         if test "$NCURSES_CONFIG" != none ; then
6351
6352                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6353
6354 cf_add_libs="`$NCURSES_CONFIG --libs`"
6355 # Filter out duplicates - this happens with badly-designed ".pc" files...
6356 for cf_add_1lib in $LIBS
6357 do
6358         for cf_add_2lib in $cf_add_libs
6359         do
6360                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6361                 then
6362                         cf_add_1lib=
6363                         break
6364                 fi
6365         done
6366         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6367 done
6368 LIBS="$cf_add_libs"
6369
6370                 # even with config script, some packages use no-override for curses.h
6371
6372 echo "$as_me:6372: checking if we have identified curses headers" >&5
6373 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6374 if test "${cf_cv_ncurses_header+set}" = set; then
6375   echo $ECHO_N "(cached) $ECHO_C" >&6
6376 else
6377
6378 cf_cv_ncurses_header=none
6379 for cf_header in \
6380         ncurses.h ncursesw/ncurses.h \
6381         curses.h ncursesw/curses.h
6382 do
6383 cat >conftest.$ac_ext <<_ACEOF
6384 #line 6384 "configure"
6385 #include "confdefs.h"
6386 #include <${cf_header}>
6387 int
6388 main (void)
6389 {
6390 initscr(); tgoto("?", 0,0)
6391   ;
6392   return 0;
6393 }
6394 _ACEOF
6395 rm -f conftest.$ac_objext
6396 if { (eval echo "$as_me:6396: \"$ac_compile\"") >&5
6397   (eval $ac_compile) 2>&5
6398   ac_status=$?
6399   echo "$as_me:6399: \$? = $ac_status" >&5
6400   (exit $ac_status); } &&
6401          { ac_try='test -s conftest.$ac_objext'
6402   { (eval echo "$as_me:6402: \"$ac_try\"") >&5
6403   (eval $ac_try) 2>&5
6404   ac_status=$?
6405   echo "$as_me:6405: \$? = $ac_status" >&5
6406   (exit $ac_status); }; }; then
6407   cf_cv_ncurses_header=$cf_header; break
6408 else
6409   echo "$as_me: failed program was:" >&5
6410 cat conftest.$ac_ext >&5
6411 fi
6412 rm -f conftest.$ac_objext conftest.$ac_ext
6413 done
6414
6415 fi
6416 echo "$as_me:6416: result: $cf_cv_ncurses_header" >&5
6417 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6418
6419 if test "$cf_cv_ncurses_header" = none ; then
6420         { { echo "$as_me:6420: error: No curses header-files found" >&5
6421 echo "$as_me: error: No curses header-files found" >&2;}
6422    { (exit 1); exit 1; }; }
6423 fi
6424
6425 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6426
6427 for ac_header in $cf_cv_ncurses_header
6428 do
6429 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6430 echo "$as_me:6430: checking for $ac_header" >&5
6431 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6432 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6433   echo $ECHO_N "(cached) $ECHO_C" >&6
6434 else
6435   cat >conftest.$ac_ext <<_ACEOF
6436 #line 6436 "configure"
6437 #include "confdefs.h"
6438 #include <$ac_header>
6439 _ACEOF
6440 if { (eval echo "$as_me:6440: \"$ac_cpp conftest.$ac_ext\"") >&5
6441   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6442   ac_status=$?
6443   egrep -v '^ *\+' conftest.er1 >conftest.err
6444   rm -f conftest.er1
6445   cat conftest.err >&5
6446   echo "$as_me:6446: \$? = $ac_status" >&5
6447   (exit $ac_status); } >/dev/null; then
6448   if test -s conftest.err; then
6449     ac_cpp_err=$ac_c_preproc_warn_flag
6450   else
6451     ac_cpp_err=
6452   fi
6453 else
6454   ac_cpp_err=yes
6455 fi
6456 if test -z "$ac_cpp_err"; then
6457   eval "$as_ac_Header=yes"
6458 else
6459   echo "$as_me: failed program was:" >&5
6460   cat conftest.$ac_ext >&5
6461   eval "$as_ac_Header=no"
6462 fi
6463 rm -f conftest.err conftest.$ac_ext
6464 fi
6465 echo "$as_me:6465: result: `eval echo '${'$as_ac_Header'}'`" >&5
6466 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6467 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6468   cat >>confdefs.h <<EOF
6469 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6470 EOF
6471
6472 fi
6473 done
6474
6475 cat >>confdefs.h <<\EOF
6476 #define NCURSES 1
6477 EOF
6478
6479 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6480
6481                 cat >>confdefs.h <<EOF
6482 #define $cf_nculib_ROOT 1
6483 EOF
6484
6485                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6486
6487         else
6488
6489 cf_ncuhdr_root=ncursesw
6490
6491 test -n "$cf_cv_curses_dir" && \
6492 test "$cf_cv_curses_dir" != "no" && { \
6493
6494 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6495   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6496   do
6497         while test $cf_add_incdir != /usr/include
6498         do
6499           if test -d $cf_add_incdir
6500           then
6501                 cf_have_incdir=no
6502                 if test -n "$CFLAGS$CPPFLAGS" ; then
6503                   # a loop is needed to ensure we can add subdirs of existing dirs
6504                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6505                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6506                           cf_have_incdir=yes; break
6507                         fi
6508                   done
6509                 fi
6510
6511                 if test "$cf_have_incdir" = no ; then
6512                   if test "$cf_add_incdir" = /usr/local/include ; then
6513                         if test "$GCC" = yes
6514                         then
6515                           cf_save_CPPFLAGS=$CPPFLAGS
6516                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6517                           cat >conftest.$ac_ext <<_ACEOF
6518 #line 6518 "configure"
6519 #include "confdefs.h"
6520 #include <stdio.h>
6521 int
6522 main (void)
6523 {
6524 printf("Hello")
6525   ;
6526   return 0;
6527 }
6528 _ACEOF
6529 rm -f conftest.$ac_objext
6530 if { (eval echo "$as_me:6530: \"$ac_compile\"") >&5
6531   (eval $ac_compile) 2>&5
6532   ac_status=$?
6533   echo "$as_me:6533: \$? = $ac_status" >&5
6534   (exit $ac_status); } &&
6535          { ac_try='test -s conftest.$ac_objext'
6536   { (eval echo "$as_me:6536: \"$ac_try\"") >&5
6537   (eval $ac_try) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit $ac_status); }; }; then
6541   :
6542 else
6543   echo "$as_me: failed program was:" >&5
6544 cat conftest.$ac_ext >&5
6545 cf_have_incdir=yes
6546 fi
6547 rm -f conftest.$ac_objext conftest.$ac_ext
6548                           CPPFLAGS=$cf_save_CPPFLAGS
6549                         fi
6550                   fi
6551                 fi
6552
6553                 if test "$cf_have_incdir" = no ; then
6554                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6555
6556 echo "${as_me:-configure}:6556: testing adding $cf_add_incdir to include-path ..." 1>&5
6557
6558                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6559
6560                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6561                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6562                   cf_add_incdir="$cf_top_incdir"
6563                 else
6564                   break
6565                 fi
6566           else
6567                 break
6568           fi
6569         done
6570   done
6571 fi
6572
6573 }
6574
6575 echo "$as_me:6575: checking for $cf_ncuhdr_root header in include-path" >&5
6576 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6577 if test "${cf_cv_ncurses_h+set}" = set; then
6578   echo $ECHO_N "(cached) $ECHO_C" >&6
6579 else
6580
6581         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6582         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6583         for cf_header in $cf_header_list
6584         do
6585
6586         cat >conftest.$ac_ext <<_ACEOF
6587 #line 6587 "configure"
6588 #include "confdefs.h"
6589
6590 #define _XOPEN_SOURCE_EXTENDED
6591 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6592 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6593
6594 #include <$cf_header>
6595 int
6596 main (void)
6597 {
6598
6599 #ifdef NCURSES_VERSION
6600
6601 #ifndef WACS_BSSB
6602         make an error
6603 #endif
6604
6605 printf("%s\n", NCURSES_VERSION);
6606 #else
6607 #ifdef __NCURSES_H
6608 printf("old\n");
6609 #else
6610         make an error
6611 #endif
6612 #endif
6613
6614   ;
6615   return 0;
6616 }
6617 _ACEOF
6618 rm -f conftest.$ac_objext
6619 if { (eval echo "$as_me:6619: \"$ac_compile\"") >&5
6620   (eval $ac_compile) 2>&5
6621   ac_status=$?
6622   echo "$as_me:6622: \$? = $ac_status" >&5
6623   (exit $ac_status); } &&
6624          { ac_try='test -s conftest.$ac_objext'
6625   { (eval echo "$as_me:6625: \"$ac_try\"") >&5
6626   (eval $ac_try) 2>&5
6627   ac_status=$?
6628   echo "$as_me:6628: \$? = $ac_status" >&5
6629   (exit $ac_status); }; }; then
6630   cf_cv_ncurses_h=$cf_header
6631
6632 else
6633   echo "$as_me: failed program was:" >&5
6634 cat conftest.$ac_ext >&5
6635 cf_cv_ncurses_h=no
6636 fi
6637 rm -f conftest.$ac_objext conftest.$ac_ext
6638
6639                 test "$cf_cv_ncurses_h" != no && break
6640         done
6641
6642 fi
6643 echo "$as_me:6643: result: $cf_cv_ncurses_h" >&5
6644 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6645
6646 if test "$cf_cv_ncurses_h" != no ; then
6647         cf_cv_ncurses_header=$cf_cv_ncurses_h
6648 else
6649
6650 echo "$as_me:6650: checking for $cf_ncuhdr_root include-path" >&5
6651 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6652 if test "${cf_cv_ncurses_h2+set}" = set; then
6653   echo $ECHO_N "(cached) $ECHO_C" >&6
6654 else
6655
6656         test -n "$verbose" && echo
6657
6658 cf_search=
6659
6660 # collect the current set of include-directories from compiler flags
6661 cf_header_path_list=""
6662 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6663         for cf_header_path in $CPPFLAGS $CFLAGS
6664         do
6665                 case $cf_header_path in
6666                 (-I*)
6667                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6668
6669 test "x$cf_header_path" != "xNONE" && \
6670 test -d "$cf_header_path" && \
6671  {
6672         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6673         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6674         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6675         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6676         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6677         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"
6678 }
6679
6680                         cf_header_path_list="$cf_header_path_list $cf_search"
6681                         ;;
6682                 esac
6683         done
6684 fi
6685
6686 # add the variations for the package we are looking for
6687
6688 cf_search=
6689
6690 test "x$prefix" != "xNONE" && \
6691 test -d "$prefix" && \
6692  {
6693         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6694         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6695         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6696         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6697         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6698         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6699 }
6700
6701 for cf_subdir_prefix in \
6702         /usr \
6703         /usr/local \
6704         /usr/pkg \
6705         /opt \
6706         /opt/local \
6707         $HOME
6708 do
6709
6710 test "x$cf_subdir_prefix" != "x$prefix" && \
6711 test -d "$cf_subdir_prefix" && \
6712 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6713         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6714         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6715         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6716         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6717         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6718         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"
6719 }
6720
6721 done
6722
6723 test "$includedir" != NONE && \
6724 test "$includedir" != "/usr/include" && \
6725 test -d "$includedir" && {
6726         test -d $includedir &&    cf_search="$cf_search $includedir"
6727         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6728 }
6729
6730 test "$oldincludedir" != NONE && \
6731 test "$oldincludedir" != "/usr/include" && \
6732 test -d "$oldincludedir" && {
6733         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6734         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6735 }
6736
6737 cf_search="$cf_search $cf_header_path_list"
6738
6739         test -n "$verbose" && echo search path $cf_search
6740         cf_save2_CPPFLAGS="$CPPFLAGS"
6741         for cf_incdir in $cf_search
6742         do
6743
6744 if test -n "$cf_incdir" ; then
6745   for cf_add_incdir in $cf_incdir
6746   do
6747         while test $cf_add_incdir != /usr/include
6748         do
6749           if test -d $cf_add_incdir
6750           then
6751                 cf_have_incdir=no
6752                 if test -n "$CFLAGS$CPPFLAGS" ; then
6753                   # a loop is needed to ensure we can add subdirs of existing dirs
6754                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6755                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6756                           cf_have_incdir=yes; break
6757                         fi
6758                   done
6759                 fi
6760
6761                 if test "$cf_have_incdir" = no ; then
6762                   if test "$cf_add_incdir" = /usr/local/include ; then
6763                         if test "$GCC" = yes
6764                         then
6765                           cf_save_CPPFLAGS=$CPPFLAGS
6766                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6767                           cat >conftest.$ac_ext <<_ACEOF
6768 #line 6768 "configure"
6769 #include "confdefs.h"
6770 #include <stdio.h>
6771 int
6772 main (void)
6773 {
6774 printf("Hello")
6775   ;
6776   return 0;
6777 }
6778 _ACEOF
6779 rm -f conftest.$ac_objext
6780 if { (eval echo "$as_me:6780: \"$ac_compile\"") >&5
6781   (eval $ac_compile) 2>&5
6782   ac_status=$?
6783   echo "$as_me:6783: \$? = $ac_status" >&5
6784   (exit $ac_status); } &&
6785          { ac_try='test -s conftest.$ac_objext'
6786   { (eval echo "$as_me:6786: \"$ac_try\"") >&5
6787   (eval $ac_try) 2>&5
6788   ac_status=$?
6789   echo "$as_me:6789: \$? = $ac_status" >&5
6790   (exit $ac_status); }; }; then
6791   :
6792 else
6793   echo "$as_me: failed program was:" >&5
6794 cat conftest.$ac_ext >&5
6795 cf_have_incdir=yes
6796 fi
6797 rm -f conftest.$ac_objext conftest.$ac_ext
6798                           CPPFLAGS=$cf_save_CPPFLAGS
6799                         fi
6800                   fi
6801                 fi
6802
6803                 if test "$cf_have_incdir" = no ; then
6804                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6805
6806 echo "${as_me:-configure}:6806: testing adding $cf_add_incdir to include-path ..." 1>&5
6807
6808                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6809
6810                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6811                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6812                   cf_add_incdir="$cf_top_incdir"
6813                 else
6814                   break
6815                 fi
6816           else
6817                 break
6818           fi
6819         done
6820   done
6821 fi
6822
6823                 for cf_header in \
6824                         ncurses.h \
6825                         curses.h
6826                 do
6827
6828         cat >conftest.$ac_ext <<_ACEOF
6829 #line 6829 "configure"
6830 #include "confdefs.h"
6831
6832 #include <$cf_header>
6833 int
6834 main (void)
6835 {
6836
6837 #ifdef NCURSES_VERSION
6838
6839 printf("%s\n", NCURSES_VERSION);
6840 #else
6841 #ifdef __NCURSES_H
6842 printf("old\n");
6843 #else
6844         make an error
6845 #endif
6846 #endif
6847
6848   ;
6849   return 0;
6850 }
6851 _ACEOF
6852 rm -f conftest.$ac_objext
6853 if { (eval echo "$as_me:6853: \"$ac_compile\"") >&5
6854   (eval $ac_compile) 2>&5
6855   ac_status=$?
6856   echo "$as_me:6856: \$? = $ac_status" >&5
6857   (exit $ac_status); } &&
6858          { ac_try='test -s conftest.$ac_objext'
6859   { (eval echo "$as_me:6859: \"$ac_try\"") >&5
6860   (eval $ac_try) 2>&5
6861   ac_status=$?
6862   echo "$as_me:6862: \$? = $ac_status" >&5
6863   (exit $ac_status); }; }; then
6864   cf_cv_ncurses_h2=$cf_header
6865
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat conftest.$ac_ext >&5
6869 cf_cv_ncurses_h2=no
6870 fi
6871 rm -f conftest.$ac_objext conftest.$ac_ext
6872
6873                         if test "$cf_cv_ncurses_h2" != no ; then
6874                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6875                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6876                                 break
6877                         fi
6878                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6879                 done
6880                 CPPFLAGS="$cf_save2_CPPFLAGS"
6881                 test "$cf_cv_ncurses_h2" != no && break
6882         done
6883         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6883: error: not found" >&5
6884 echo "$as_me: error: not found" >&2;}
6885    { (exit 1); exit 1; }; }
6886
6887 fi
6888 echo "$as_me:6888: result: $cf_cv_ncurses_h2" >&5
6889 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6890
6891         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6892         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6893         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6894                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6895         fi
6896
6897 if test -n "$cf_1st_incdir" ; then
6898   for cf_add_incdir in $cf_1st_incdir
6899   do
6900         while test $cf_add_incdir != /usr/include
6901         do
6902           if test -d $cf_add_incdir
6903           then
6904                 cf_have_incdir=no
6905                 if test -n "$CFLAGS$CPPFLAGS" ; then
6906                   # a loop is needed to ensure we can add subdirs of existing dirs
6907                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6908                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6909                           cf_have_incdir=yes; break
6910                         fi
6911                   done
6912                 fi
6913
6914                 if test "$cf_have_incdir" = no ; then
6915                   if test "$cf_add_incdir" = /usr/local/include ; then
6916                         if test "$GCC" = yes
6917                         then
6918                           cf_save_CPPFLAGS=$CPPFLAGS
6919                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6920                           cat >conftest.$ac_ext <<_ACEOF
6921 #line 6921 "configure"
6922 #include "confdefs.h"
6923 #include <stdio.h>
6924 int
6925 main (void)
6926 {
6927 printf("Hello")
6928   ;
6929   return 0;
6930 }
6931 _ACEOF
6932 rm -f conftest.$ac_objext
6933 if { (eval echo "$as_me:6933: \"$ac_compile\"") >&5
6934   (eval $ac_compile) 2>&5
6935   ac_status=$?
6936   echo "$as_me:6936: \$? = $ac_status" >&5
6937   (exit $ac_status); } &&
6938          { ac_try='test -s conftest.$ac_objext'
6939   { (eval echo "$as_me:6939: \"$ac_try\"") >&5
6940   (eval $ac_try) 2>&5
6941   ac_status=$?
6942   echo "$as_me:6942: \$? = $ac_status" >&5
6943   (exit $ac_status); }; }; then
6944   :
6945 else
6946   echo "$as_me: failed program was:" >&5
6947 cat conftest.$ac_ext >&5
6948 cf_have_incdir=yes
6949 fi
6950 rm -f conftest.$ac_objext conftest.$ac_ext
6951                           CPPFLAGS=$cf_save_CPPFLAGS
6952                         fi
6953                   fi
6954                 fi
6955
6956                 if test "$cf_have_incdir" = no ; then
6957                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6958
6959 echo "${as_me:-configure}:6959: testing adding $cf_add_incdir to include-path ..." 1>&5
6960
6961                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6962
6963                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6964                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6965                   cf_add_incdir="$cf_top_incdir"
6966                 else
6967                   break
6968                 fi
6969           else
6970                 break
6971           fi
6972         done
6973   done
6974 fi
6975
6976 fi
6977
6978 # Set definitions to allow ifdef'ing for ncurses.h
6979
6980 case $cf_cv_ncurses_header in
6981 (*ncurses.h)
6982
6983 cat >>confdefs.h <<\EOF
6984 #define HAVE_NCURSES_H 1
6985 EOF
6986
6987         ;;
6988 esac
6989
6990 case $cf_cv_ncurses_header in
6991 (ncurses/curses.h|ncurses/ncurses.h)
6992
6993 cat >>confdefs.h <<\EOF
6994 #define HAVE_NCURSES_NCURSES_H 1
6995 EOF
6996
6997         ;;
6998 (ncursesw/curses.h|ncursesw/ncurses.h)
6999
7000 cat >>confdefs.h <<\EOF
7001 #define HAVE_NCURSESW_NCURSES_H 1
7002 EOF
7003
7004         ;;
7005 esac
7006
7007 echo "$as_me:7007: checking for terminfo header" >&5
7008 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7009 if test "${cf_cv_term_header+set}" = set; then
7010   echo $ECHO_N "(cached) $ECHO_C" >&6
7011 else
7012
7013 case ${cf_cv_ncurses_header} in
7014 (*/ncurses.h|*/ncursesw.h)
7015         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7016         ;;
7017 (*)
7018         cf_term_header=term.h
7019         ;;
7020 esac
7021
7022 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7023 do
7024 cat >conftest.$ac_ext <<_ACEOF
7025 #line 7025 "configure"
7026 #include "confdefs.h"
7027 #include <stdio.h>
7028 #include <${cf_cv_ncurses_header:-curses.h}>
7029 #include <$cf_test>
7030
7031 int
7032 main (void)
7033 {
7034 int x = auto_left_margin
7035   ;
7036   return 0;
7037 }
7038 _ACEOF
7039 rm -f conftest.$ac_objext
7040 if { (eval echo "$as_me:7040: \"$ac_compile\"") >&5
7041   (eval $ac_compile) 2>&5
7042   ac_status=$?
7043   echo "$as_me:7043: \$? = $ac_status" >&5
7044   (exit $ac_status); } &&
7045          { ac_try='test -s conftest.$ac_objext'
7046   { (eval echo "$as_me:7046: \"$ac_try\"") >&5
7047   (eval $ac_try) 2>&5
7048   ac_status=$?
7049   echo "$as_me:7049: \$? = $ac_status" >&5
7050   (exit $ac_status); }; }; then
7051
7052         cf_cv_term_header="$cf_test"
7053 else
7054   echo "$as_me: failed program was:" >&5
7055 cat conftest.$ac_ext >&5
7056
7057         cf_cv_term_header=unknown
7058
7059 fi
7060 rm -f conftest.$ac_objext conftest.$ac_ext
7061         test "$cf_cv_term_header" != unknown && break
7062 done
7063
7064 fi
7065 echo "$as_me:7065: result: $cf_cv_term_header" >&5
7066 echo "${ECHO_T}$cf_cv_term_header" >&6
7067
7068 # Set definitions to allow ifdef'ing to accommodate subdirectories
7069
7070 case $cf_cv_term_header in
7071 (*term.h)
7072
7073 cat >>confdefs.h <<\EOF
7074 #define HAVE_TERM_H 1
7075 EOF
7076
7077         ;;
7078 esac
7079
7080 case $cf_cv_term_header in
7081 (ncurses/term.h)
7082
7083 cat >>confdefs.h <<\EOF
7084 #define HAVE_NCURSES_TERM_H 1
7085 EOF
7086
7087         ;;
7088 (ncursesw/term.h)
7089
7090 cat >>confdefs.h <<\EOF
7091 #define HAVE_NCURSESW_TERM_H 1
7092 EOF
7093
7094         ;;
7095 esac
7096
7097 # some applications need this, but should check for NCURSES_VERSION
7098
7099 cat >>confdefs.h <<\EOF
7100 #define NCURSES 1
7101 EOF
7102
7103 echo "$as_me:7103: checking for ncurses version" >&5
7104 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7105 if test "${cf_cv_ncurses_version+set}" = set; then
7106   echo $ECHO_N "(cached) $ECHO_C" >&6
7107 else
7108
7109         cf_cv_ncurses_version=no
7110         cf_tempfile=out$$
7111         rm -f $cf_tempfile
7112         if test "$cross_compiling" = yes; then
7113
7114         # This will not work if the preprocessor splits the line after the
7115         # Autoconf token.  The 'unproto' program does that.
7116         cat > conftest.$ac_ext <<EOF
7117 #include <${cf_cv_ncurses_header:-curses.h}>
7118 #undef Autoconf
7119 #ifdef NCURSES_VERSION
7120 Autoconf NCURSES_VERSION
7121 #else
7122 #ifdef __NCURSES_H
7123 Autoconf "old"
7124 #endif
7125 ;
7126 #endif
7127 EOF
7128         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7129         { (eval echo "$as_me:7129: \"$cf_try\"") >&5
7130   (eval $cf_try) 2>&5
7131   ac_status=$?
7132   echo "$as_me:7132: \$? = $ac_status" >&5
7133   (exit $ac_status); }
7134         if test -f conftest.out ; then
7135                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7136                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7137                 rm -f conftest.out
7138         fi
7139
7140 else
7141   cat >conftest.$ac_ext <<_ACEOF
7142 #line 7142 "configure"
7143 #include "confdefs.h"
7144
7145 #include <${cf_cv_ncurses_header:-curses.h}>
7146 #include <stdio.h>
7147 int main(void)
7148 {
7149         FILE *fp = fopen("$cf_tempfile", "w");
7150 #ifdef NCURSES_VERSION
7151 # ifdef NCURSES_VERSION_PATCH
7152         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7153 # else
7154         fprintf(fp, "%s\n", NCURSES_VERSION);
7155 # endif
7156 #else
7157 # ifdef __NCURSES_H
7158         fprintf(fp, "old\n");
7159 # else
7160         make an error
7161 # endif
7162 #endif
7163         ${cf_cv_main_return:-return}(0);
7164 }
7165 _ACEOF
7166 rm -f conftest$ac_exeext
7167 if { (eval echo "$as_me:7167: \"$ac_link\"") >&5
7168   (eval $ac_link) 2>&5
7169   ac_status=$?
7170   echo "$as_me:7170: \$? = $ac_status" >&5
7171   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7172   { (eval echo "$as_me:7172: \"$ac_try\"") >&5
7173   (eval $ac_try) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit $ac_status); }; }; then
7177
7178         cf_cv_ncurses_version=`cat $cf_tempfile`
7179 else
7180   echo "$as_me: program exited with status $ac_status" >&5
7181 echo "$as_me: failed program was:" >&5
7182 cat conftest.$ac_ext >&5
7183 fi
7184 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7185 fi
7186         rm -f $cf_tempfile
7187
7188 fi
7189 echo "$as_me:7189: result: $cf_cv_ncurses_version" >&5
7190 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7191 test "$cf_cv_ncurses_version" = no ||
7192 cat >>confdefs.h <<\EOF
7193 #define NCURSES 1
7194 EOF
7195
7196 cf_nculib_root=ncursesw
7197         # This works, except for the special case where we find gpm, but
7198         # ncurses is in a nonstandard location via $LIBS, and we really want
7199         # to link gpm.
7200 cf_ncurses_LIBS=""
7201 cf_ncurses_SAVE="$LIBS"
7202 echo "$as_me:7202: checking for Gpm_Open in -lgpm" >&5
7203 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7204 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7205   echo $ECHO_N "(cached) $ECHO_C" >&6
7206 else
7207   ac_check_lib_save_LIBS=$LIBS
7208 LIBS="-lgpm  $LIBS"
7209 cat >conftest.$ac_ext <<_ACEOF
7210 #line 7210 "configure"
7211 #include "confdefs.h"
7212
7213 /* Override any gcc2 internal prototype to avoid an error.  */
7214 #ifdef __cplusplus
7215 extern "C"
7216 #endif
7217 /* We use char because int might match the return type of a gcc2
7218    builtin and then its argument prototype would still apply.  */
7219 char Gpm_Open ();
7220 int
7221 main (void)
7222 {
7223 Gpm_Open ();
7224   ;
7225   return 0;
7226 }
7227 _ACEOF
7228 rm -f conftest.$ac_objext conftest$ac_exeext
7229 if { (eval echo "$as_me:7229: \"$ac_link\"") >&5
7230   (eval $ac_link) 2>&5
7231   ac_status=$?
7232   echo "$as_me:7232: \$? = $ac_status" >&5
7233   (exit $ac_status); } &&
7234          { ac_try='test -s conftest$ac_exeext'
7235   { (eval echo "$as_me:7235: \"$ac_try\"") >&5
7236   (eval $ac_try) 2>&5
7237   ac_status=$?
7238   echo "$as_me:7238: \$? = $ac_status" >&5
7239   (exit $ac_status); }; }; then
7240   ac_cv_lib_gpm_Gpm_Open=yes
7241 else
7242   echo "$as_me: failed program was:" >&5
7243 cat conftest.$ac_ext >&5
7244 ac_cv_lib_gpm_Gpm_Open=no
7245 fi
7246 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7247 LIBS=$ac_check_lib_save_LIBS
7248 fi
7249 echo "$as_me:7249: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7250 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7251 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7252   echo "$as_me:7252: checking for initscr in -lgpm" >&5
7253 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7254 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7255   echo $ECHO_N "(cached) $ECHO_C" >&6
7256 else
7257   ac_check_lib_save_LIBS=$LIBS
7258 LIBS="-lgpm  $LIBS"
7259 cat >conftest.$ac_ext <<_ACEOF
7260 #line 7260 "configure"
7261 #include "confdefs.h"
7262
7263 /* Override any gcc2 internal prototype to avoid an error.  */
7264 #ifdef __cplusplus
7265 extern "C"
7266 #endif
7267 /* We use char because int might match the return type of a gcc2
7268    builtin and then its argument prototype would still apply.  */
7269 char initscr ();
7270 int
7271 main (void)
7272 {
7273 initscr ();
7274   ;
7275   return 0;
7276 }
7277 _ACEOF
7278 rm -f conftest.$ac_objext conftest$ac_exeext
7279 if { (eval echo "$as_me:7279: \"$ac_link\"") >&5
7280   (eval $ac_link) 2>&5
7281   ac_status=$?
7282   echo "$as_me:7282: \$? = $ac_status" >&5
7283   (exit $ac_status); } &&
7284          { ac_try='test -s conftest$ac_exeext'
7285   { (eval echo "$as_me:7285: \"$ac_try\"") >&5
7286   (eval $ac_try) 2>&5
7287   ac_status=$?
7288   echo "$as_me:7288: \$? = $ac_status" >&5
7289   (exit $ac_status); }; }; then
7290   ac_cv_lib_gpm_initscr=yes
7291 else
7292   echo "$as_me: failed program was:" >&5
7293 cat conftest.$ac_ext >&5
7294 ac_cv_lib_gpm_initscr=no
7295 fi
7296 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7297 LIBS=$ac_check_lib_save_LIBS
7298 fi
7299 echo "$as_me:7299: result: $ac_cv_lib_gpm_initscr" >&5
7300 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7301 if test $ac_cv_lib_gpm_initscr = yes; then
7302   LIBS="$cf_ncurses_SAVE"
7303 else
7304   cf_ncurses_LIBS="-lgpm"
7305 fi
7306
7307 fi
7308
7309 case $host_os in
7310 (freebsd*)
7311         # This is only necessary if you are linking against an obsolete
7312         # version of ncurses (but it should do no harm, since it's static).
7313         if test "$cf_nculib_root" = ncurses ; then
7314                 echo "$as_me:7314: checking for tgoto in -lmytinfo" >&5
7315 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7316 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7317   echo $ECHO_N "(cached) $ECHO_C" >&6
7318 else
7319   ac_check_lib_save_LIBS=$LIBS
7320 LIBS="-lmytinfo  $LIBS"
7321 cat >conftest.$ac_ext <<_ACEOF
7322 #line 7322 "configure"
7323 #include "confdefs.h"
7324
7325 /* Override any gcc2 internal prototype to avoid an error.  */
7326 #ifdef __cplusplus
7327 extern "C"
7328 #endif
7329 /* We use char because int might match the return type of a gcc2
7330    builtin and then its argument prototype would still apply.  */
7331 char tgoto ();
7332 int
7333 main (void)
7334 {
7335 tgoto ();
7336   ;
7337   return 0;
7338 }
7339 _ACEOF
7340 rm -f conftest.$ac_objext conftest$ac_exeext
7341 if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
7342   (eval $ac_link) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); } &&
7346          { ac_try='test -s conftest$ac_exeext'
7347   { (eval echo "$as_me:7347: \"$ac_try\"") >&5
7348   (eval $ac_try) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); }; }; then
7352   ac_cv_lib_mytinfo_tgoto=yes
7353 else
7354   echo "$as_me: failed program was:" >&5
7355 cat conftest.$ac_ext >&5
7356 ac_cv_lib_mytinfo_tgoto=no
7357 fi
7358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7359 LIBS=$ac_check_lib_save_LIBS
7360 fi
7361 echo "$as_me:7361: result: $ac_cv_lib_mytinfo_tgoto" >&5
7362 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7363 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7364   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7365 fi
7366
7367         fi
7368         ;;
7369 esac
7370
7371 cf_add_libs="$cf_ncurses_LIBS"
7372 # Filter out duplicates - this happens with badly-designed ".pc" files...
7373 for cf_add_1lib in $LIBS
7374 do
7375         for cf_add_2lib in $cf_add_libs
7376         do
7377                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7378                 then
7379                         cf_add_1lib=
7380                         break
7381                 fi
7382         done
7383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7384 done
7385 LIBS="$cf_add_libs"
7386
7387 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7388 then
7389
7390 cf_add_libs="-l$cf_nculib_root"
7391 # Filter out duplicates - this happens with badly-designed ".pc" files...
7392 for cf_add_1lib in $LIBS
7393 do
7394         for cf_add_2lib in $cf_add_libs
7395         do
7396                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7397                 then
7398                         cf_add_1lib=
7399                         break
7400                 fi
7401         done
7402         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7403 done
7404 LIBS="$cf_add_libs"
7405
7406 else
7407
7408         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7409         cf_libdir=""
7410         echo "$as_me:7410: checking for initscr" >&5
7411 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7412 if test "${ac_cv_func_initscr+set}" = set; then
7413   echo $ECHO_N "(cached) $ECHO_C" >&6
7414 else
7415   cat >conftest.$ac_ext <<_ACEOF
7416 #line 7416 "configure"
7417 #include "confdefs.h"
7418 /* System header to define __stub macros and hopefully few prototypes,
7419     which can conflict with char initscr (); below.  */
7420 #include <assert.h>
7421 /* Override any gcc2 internal prototype to avoid an error.  */
7422 #ifdef __cplusplus
7423 extern "C"
7424 #endif
7425 /* We use char because int might match the return type of a gcc2
7426    builtin and then its argument prototype would still apply.  */
7427 char initscr ();
7428 char (*f) ();
7429
7430 int
7431 main (void)
7432 {
7433 /* The GNU C library defines this for functions which it implements
7434     to always fail with ENOSYS.  Some functions are actually named
7435     something starting with __ and the normal name is an alias.  */
7436 #if defined (__stub_initscr) || defined (__stub___initscr)
7437 choke me
7438 #else
7439 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7440 #endif
7441
7442   ;
7443   return 0;
7444 }
7445 _ACEOF
7446 rm -f conftest.$ac_objext conftest$ac_exeext
7447 if { (eval echo "$as_me:7447: \"$ac_link\"") >&5
7448   (eval $ac_link) 2>&5
7449   ac_status=$?
7450   echo "$as_me:7450: \$? = $ac_status" >&5
7451   (exit $ac_status); } &&
7452          { ac_try='test -s conftest$ac_exeext'
7453   { (eval echo "$as_me:7453: \"$ac_try\"") >&5
7454   (eval $ac_try) 2>&5
7455   ac_status=$?
7456   echo "$as_me:7456: \$? = $ac_status" >&5
7457   (exit $ac_status); }; }; then
7458   ac_cv_func_initscr=yes
7459 else
7460   echo "$as_me: failed program was:" >&5
7461 cat conftest.$ac_ext >&5
7462 ac_cv_func_initscr=no
7463 fi
7464 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7465 fi
7466 echo "$as_me:7466: result: $ac_cv_func_initscr" >&5
7467 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7468 if test $ac_cv_func_initscr = yes; then
7469   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7470 else
7471
7472                 cf_save_LIBS="$LIBS"
7473                 echo "$as_me:7473: checking for initscr in -l$cf_nculib_root" >&5
7474 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7475                 LIBS="-l$cf_nculib_root $LIBS"
7476                 cat >conftest.$ac_ext <<_ACEOF
7477 #line 7477 "configure"
7478 #include "confdefs.h"
7479 #include <${cf_cv_ncurses_header:-curses.h}>
7480 int
7481 main (void)
7482 {
7483 initscr()
7484   ;
7485   return 0;
7486 }
7487 _ACEOF
7488 rm -f conftest.$ac_objext conftest$ac_exeext
7489 if { (eval echo "$as_me:7489: \"$ac_link\"") >&5
7490   (eval $ac_link) 2>&5
7491   ac_status=$?
7492   echo "$as_me:7492: \$? = $ac_status" >&5
7493   (exit $ac_status); } &&
7494          { ac_try='test -s conftest$ac_exeext'
7495   { (eval echo "$as_me:7495: \"$ac_try\"") >&5
7496   (eval $ac_try) 2>&5
7497   ac_status=$?
7498   echo "$as_me:7498: \$? = $ac_status" >&5
7499   (exit $ac_status); }; }; then
7500   echo "$as_me:7500: result: yes" >&5
7501 echo "${ECHO_T}yes" >&6
7502                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7503
7504 else
7505   echo "$as_me: failed program was:" >&5
7506 cat conftest.$ac_ext >&5
7507 echo "$as_me:7507: result: no" >&5
7508 echo "${ECHO_T}no" >&6
7509
7510 cf_search=
7511 cf_library_path_list=""
7512 if test -n "${LDFLAGS}${LIBS}" ; then
7513         for cf_library_path in $LDFLAGS $LIBS
7514         do
7515                 case $cf_library_path in
7516                 (-L*)
7517                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7518
7519 test "x$cf_library_path" != "xNONE" && \
7520 test -d "$cf_library_path" && \
7521  {
7522         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7523         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7524         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7525         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7526         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7527         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"
7528 }
7529
7530                         cf_library_path_list="$cf_library_path_list $cf_search"
7531                         ;;
7532                 esac
7533         done
7534 fi
7535
7536 cf_search=
7537
7538 test "x$prefix" != "xNONE" && \
7539 test -d "$prefix" && \
7540  {
7541         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7542         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7543         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7544         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7545         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7546         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7547 }
7548
7549 for cf_subdir_prefix in \
7550         /usr \
7551         /usr/local \
7552         /usr/pkg \
7553         /opt \
7554         /opt/local \
7555         $HOME
7556 do
7557
7558 test "x$cf_subdir_prefix" != "x$prefix" && \
7559 test -d "$cf_subdir_prefix" && \
7560 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7561         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7562         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7563         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7564         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7565         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7566         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"
7567 }
7568
7569 done
7570
7571 cf_search="$cf_library_path_list $cf_search"
7572
7573                         for cf_libdir in $cf_search
7574                         do
7575                                 echo "$as_me:7575: checking for -l$cf_nculib_root in $cf_libdir" >&5
7576 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7577                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7578                                 cat >conftest.$ac_ext <<_ACEOF
7579 #line 7579 "configure"
7580 #include "confdefs.h"
7581 #include <${cf_cv_ncurses_header:-curses.h}>
7582 int
7583 main (void)
7584 {
7585 initscr()
7586   ;
7587   return 0;
7588 }
7589 _ACEOF
7590 rm -f conftest.$ac_objext conftest$ac_exeext
7591 if { (eval echo "$as_me:7591: \"$ac_link\"") >&5
7592   (eval $ac_link) 2>&5
7593   ac_status=$?
7594   echo "$as_me:7594: \$? = $ac_status" >&5
7595   (exit $ac_status); } &&
7596          { ac_try='test -s conftest$ac_exeext'
7597   { (eval echo "$as_me:7597: \"$ac_try\"") >&5
7598   (eval $ac_try) 2>&5
7599   ac_status=$?
7600   echo "$as_me:7600: \$? = $ac_status" >&5
7601   (exit $ac_status); }; }; then
7602   echo "$as_me:7602: result: yes" >&5
7603 echo "${ECHO_T}yes" >&6
7604                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7605                                          break
7606 else
7607   echo "$as_me: failed program was:" >&5
7608 cat conftest.$ac_ext >&5
7609 echo "$as_me:7609: result: no" >&5
7610 echo "${ECHO_T}no" >&6
7611                                          LIBS="$cf_save_LIBS"
7612 fi
7613 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7614                         done
7615
7616 fi
7617 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7618
7619 fi
7620
7621 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7622
7623 if test $cf_found_library = no ; then
7624         { { echo "$as_me:7624: error: Cannot link $cf_nculib_root library" >&5
7625 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7626    { (exit 1); exit 1; }; }
7627 fi
7628
7629 fi
7630
7631 if test -n "$cf_ncurses_LIBS" ; then
7632         echo "$as_me:7632: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7633 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7634         cf_ncurses_SAVE="$LIBS"
7635         for p in $cf_ncurses_LIBS ; do
7636                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7637                 if test "$q" != "$LIBS" ; then
7638                         LIBS="$q"
7639                 fi
7640         done
7641         cat >conftest.$ac_ext <<_ACEOF
7642 #line 7642 "configure"
7643 #include "confdefs.h"
7644 #include <${cf_cv_ncurses_header:-curses.h}>
7645 int
7646 main (void)
7647 {
7648 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7649   ;
7650   return 0;
7651 }
7652 _ACEOF
7653 rm -f conftest.$ac_objext conftest$ac_exeext
7654 if { (eval echo "$as_me:7654: \"$ac_link\"") >&5
7655   (eval $ac_link) 2>&5
7656   ac_status=$?
7657   echo "$as_me:7657: \$? = $ac_status" >&5
7658   (exit $ac_status); } &&
7659          { ac_try='test -s conftest$ac_exeext'
7660   { (eval echo "$as_me:7660: \"$ac_try\"") >&5
7661   (eval $ac_try) 2>&5
7662   ac_status=$?
7663   echo "$as_me:7663: \$? = $ac_status" >&5
7664   (exit $ac_status); }; }; then
7665   echo "$as_me:7665: result: yes" >&5
7666 echo "${ECHO_T}yes" >&6
7667 else
7668   echo "$as_me: failed program was:" >&5
7669 cat conftest.$ac_ext >&5
7670 echo "$as_me:7670: result: no" >&5
7671 echo "${ECHO_T}no" >&6
7672                  LIBS="$cf_ncurses_SAVE"
7673 fi
7674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7675 fi
7676
7677 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7678
7679 cat >>confdefs.h <<EOF
7680 #define $cf_nculib_ROOT 1
7681 EOF
7682
7683         fi
7684 else
7685         NCURSES_CONFIG=none
7686 fi
7687
7688 else
7689
7690 cf_ncuconfig_root=ncurses
7691 cf_have_ncuconfig=no
7692
7693 if test "x${PKG_CONFIG:=none}" != xnone; then
7694         echo "$as_me:7694: checking pkg-config for $cf_ncuconfig_root" >&5
7695 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7696         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7697                 echo "$as_me:7697: result: yes" >&5
7698 echo "${ECHO_T}yes" >&6
7699
7700                 echo "$as_me:7700: checking if the $cf_ncuconfig_root package files work" >&5
7701 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7702                 cf_have_ncuconfig=unknown
7703
7704                 cf_save_CPPFLAGS="$CPPFLAGS"
7705                 cf_save_LIBS="$LIBS"
7706
7707                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7708
7709 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7710 # Filter out duplicates - this happens with badly-designed ".pc" files...
7711 for cf_add_1lib in $LIBS
7712 do
7713         for cf_add_2lib in $cf_add_libs
7714         do
7715                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7716                 then
7717                         cf_add_1lib=
7718                         break
7719                 fi
7720         done
7721         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7722 done
7723 LIBS="$cf_add_libs"
7724
7725                 cat >conftest.$ac_ext <<_ACEOF
7726 #line 7726 "configure"
7727 #include "confdefs.h"
7728 #include <${cf_cv_ncurses_header:-curses.h}>
7729 int
7730 main (void)
7731 {
7732 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7733   ;
7734   return 0;
7735 }
7736 _ACEOF
7737 rm -f conftest.$ac_objext conftest$ac_exeext
7738 if { (eval echo "$as_me:7738: \"$ac_link\"") >&5
7739   (eval $ac_link) 2>&5
7740   ac_status=$?
7741   echo "$as_me:7741: \$? = $ac_status" >&5
7742   (exit $ac_status); } &&
7743          { ac_try='test -s conftest$ac_exeext'
7744   { (eval echo "$as_me:7744: \"$ac_try\"") >&5
7745   (eval $ac_try) 2>&5
7746   ac_status=$?
7747   echo "$as_me:7747: \$? = $ac_status" >&5
7748   (exit $ac_status); }; }; then
7749   if test "$cross_compiling" = yes; then
7750   cf_have_ncuconfig=maybe
7751 else
7752   cat >conftest.$ac_ext <<_ACEOF
7753 #line 7753 "configure"
7754 #include "confdefs.h"
7755 #include <${cf_cv_ncurses_header:-curses.h}>
7756                                 int main(void)
7757                                 { char *xx = curses_version(); return (xx == 0); }
7758 _ACEOF
7759 rm -f conftest$ac_exeext
7760 if { (eval echo "$as_me:7760: \"$ac_link\"") >&5
7761   (eval $ac_link) 2>&5
7762   ac_status=$?
7763   echo "$as_me:7763: \$? = $ac_status" >&5
7764   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7765   { (eval echo "$as_me:7765: \"$ac_try\"") >&5
7766   (eval $ac_try) 2>&5
7767   ac_status=$?
7768   echo "$as_me:7768: \$? = $ac_status" >&5
7769   (exit $ac_status); }; }; then
7770   cf_have_ncuconfig=yes
7771 else
7772   echo "$as_me: program exited with status $ac_status" >&5
7773 echo "$as_me: failed program was:" >&5
7774 cat conftest.$ac_ext >&5
7775 cf_have_ncuconfig=no
7776 fi
7777 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7778 fi
7779 else
7780   echo "$as_me: failed program was:" >&5
7781 cat conftest.$ac_ext >&5
7782 cf_have_ncuconfig=no
7783 fi
7784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7785                 echo "$as_me:7785: result: $cf_have_ncuconfig" >&5
7786 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7787                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7788                 if test "$cf_have_ncuconfig" != "yes"
7789                 then
7790                         CPPFLAGS="$cf_save_CPPFLAGS"
7791                         LIBS="$cf_save_LIBS"
7792                         NCURSES_CONFIG_PKG=none
7793                 else
7794
7795 cat >>confdefs.h <<\EOF
7796 #define NCURSES 1
7797 EOF
7798
7799                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7800
7801 echo "$as_me:7801: checking for terminfo header" >&5
7802 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7803 if test "${cf_cv_term_header+set}" = set; then
7804   echo $ECHO_N "(cached) $ECHO_C" >&6
7805 else
7806
7807 case ${cf_cv_ncurses_header} in
7808 (*/ncurses.h|*/ncursesw.h)
7809         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7810         ;;
7811 (*)
7812         cf_term_header=term.h
7813         ;;
7814 esac
7815
7816 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7817 do
7818 cat >conftest.$ac_ext <<_ACEOF
7819 #line 7819 "configure"
7820 #include "confdefs.h"
7821 #include <stdio.h>
7822 #include <${cf_cv_ncurses_header:-curses.h}>
7823 #include <$cf_test>
7824
7825 int
7826 main (void)
7827 {
7828 int x = auto_left_margin
7829   ;
7830   return 0;
7831 }
7832 _ACEOF
7833 rm -f conftest.$ac_objext
7834 if { (eval echo "$as_me:7834: \"$ac_compile\"") >&5
7835   (eval $ac_compile) 2>&5
7836   ac_status=$?
7837   echo "$as_me:7837: \$? = $ac_status" >&5
7838   (exit $ac_status); } &&
7839          { ac_try='test -s conftest.$ac_objext'
7840   { (eval echo "$as_me:7840: \"$ac_try\"") >&5
7841   (eval $ac_try) 2>&5
7842   ac_status=$?
7843   echo "$as_me:7843: \$? = $ac_status" >&5
7844   (exit $ac_status); }; }; then
7845
7846         cf_cv_term_header="$cf_test"
7847 else
7848   echo "$as_me: failed program was:" >&5
7849 cat conftest.$ac_ext >&5
7850
7851         cf_cv_term_header=unknown
7852
7853 fi
7854 rm -f conftest.$ac_objext conftest.$ac_ext
7855         test "$cf_cv_term_header" != unknown && break
7856 done
7857
7858 fi
7859 echo "$as_me:7859: result: $cf_cv_term_header" >&5
7860 echo "${ECHO_T}$cf_cv_term_header" >&6
7861
7862 # Set definitions to allow ifdef'ing to accommodate subdirectories
7863
7864 case $cf_cv_term_header in
7865 (*term.h)
7866
7867 cat >>confdefs.h <<\EOF
7868 #define HAVE_TERM_H 1
7869 EOF
7870
7871         ;;
7872 esac
7873
7874 case $cf_cv_term_header in
7875 (ncurses/term.h)
7876
7877 cat >>confdefs.h <<\EOF
7878 #define HAVE_NCURSES_TERM_H 1
7879 EOF
7880
7881         ;;
7882 (ncursesw/term.h)
7883
7884 cat >>confdefs.h <<\EOF
7885 #define HAVE_NCURSESW_TERM_H 1
7886 EOF
7887
7888         ;;
7889 esac
7890
7891                 fi
7892
7893         else
7894                 echo "$as_me:7894: result: no" >&5
7895 echo "${ECHO_T}no" >&6
7896                 NCURSES_CONFIG_PKG=none
7897         fi
7898 else
7899         NCURSES_CONFIG_PKG=none
7900 fi
7901
7902 if test "x$cf_have_ncuconfig" = "xno"; then
7903         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7904
7905 if test -n "$ac_tool_prefix"; then
7906   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7907   do
7908     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7909 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7910 echo "$as_me:7910: checking for $ac_word" >&5
7911 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7912 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7913   echo $ECHO_N "(cached) $ECHO_C" >&6
7914 else
7915   if test -n "$NCURSES_CONFIG"; then
7916   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7917 else
7918   ac_save_IFS=$IFS; IFS=$ac_path_separator
7919 ac_dummy="$PATH"
7920 for ac_dir in $ac_dummy; do
7921   IFS=$ac_save_IFS
7922   test -z "$ac_dir" && ac_dir=.
7923   $as_executable_p "$ac_dir/$ac_word" || continue
7924 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7925 echo "$as_me:7925: found $ac_dir/$ac_word" >&5
7926 break
7927 done
7928
7929 fi
7930 fi
7931 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7932 if test -n "$NCURSES_CONFIG"; then
7933   echo "$as_me:7933: result: $NCURSES_CONFIG" >&5
7934 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7935 else
7936   echo "$as_me:7936: result: no" >&5
7937 echo "${ECHO_T}no" >&6
7938 fi
7939
7940     test -n "$NCURSES_CONFIG" && break
7941   done
7942 fi
7943 if test -z "$NCURSES_CONFIG"; then
7944   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7945   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7946 do
7947   # Extract the first word of "$ac_prog", so it can be a program name with args.
7948 set dummy $ac_prog; ac_word=$2
7949 echo "$as_me:7949: checking for $ac_word" >&5
7950 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7951 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7952   echo $ECHO_N "(cached) $ECHO_C" >&6
7953 else
7954   if test -n "$ac_ct_NCURSES_CONFIG"; then
7955   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7956 else
7957   ac_save_IFS=$IFS; IFS=$ac_path_separator
7958 ac_dummy="$PATH"
7959 for ac_dir in $ac_dummy; do
7960   IFS=$ac_save_IFS
7961   test -z "$ac_dir" && ac_dir=.
7962   $as_executable_p "$ac_dir/$ac_word" || continue
7963 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7964 echo "$as_me:7964: found $ac_dir/$ac_word" >&5
7965 break
7966 done
7967
7968 fi
7969 fi
7970 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7971 if test -n "$ac_ct_NCURSES_CONFIG"; then
7972   echo "$as_me:7972: result: $ac_ct_NCURSES_CONFIG" >&5
7973 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7974 else
7975   echo "$as_me:7975: result: no" >&5
7976 echo "${ECHO_T}no" >&6
7977 fi
7978
7979   test -n "$ac_ct_NCURSES_CONFIG" && break
7980 done
7981 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7982
7983   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7984 fi
7985
7986         if test "$NCURSES_CONFIG" != none ; then
7987
7988                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7989
7990 cf_add_libs="`$NCURSES_CONFIG --libs`"
7991 # Filter out duplicates - this happens with badly-designed ".pc" files...
7992 for cf_add_1lib in $LIBS
7993 do
7994         for cf_add_2lib in $cf_add_libs
7995         do
7996                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7997                 then
7998                         cf_add_1lib=
7999                         break
8000                 fi
8001         done
8002         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8003 done
8004 LIBS="$cf_add_libs"
8005
8006                 # even with config script, some packages use no-override for curses.h
8007
8008 echo "$as_me:8008: checking if we have identified curses headers" >&5
8009 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8010 if test "${cf_cv_ncurses_header+set}" = set; then
8011   echo $ECHO_N "(cached) $ECHO_C" >&6
8012 else
8013
8014 cf_cv_ncurses_header=none
8015 for cf_header in \
8016         ncurses.h ncurses/ncurses.h \
8017         curses.h ncurses/curses.h
8018 do
8019 cat >conftest.$ac_ext <<_ACEOF
8020 #line 8020 "configure"
8021 #include "confdefs.h"
8022 #include <${cf_header}>
8023 int
8024 main (void)
8025 {
8026 initscr(); tgoto("?", 0,0)
8027   ;
8028   return 0;
8029 }
8030 _ACEOF
8031 rm -f conftest.$ac_objext
8032 if { (eval echo "$as_me:8032: \"$ac_compile\"") >&5
8033   (eval $ac_compile) 2>&5
8034   ac_status=$?
8035   echo "$as_me:8035: \$? = $ac_status" >&5
8036   (exit $ac_status); } &&
8037          { ac_try='test -s conftest.$ac_objext'
8038   { (eval echo "$as_me:8038: \"$ac_try\"") >&5
8039   (eval $ac_try) 2>&5
8040   ac_status=$?
8041   echo "$as_me:8041: \$? = $ac_status" >&5
8042   (exit $ac_status); }; }; then
8043   cf_cv_ncurses_header=$cf_header; break
8044 else
8045   echo "$as_me: failed program was:" >&5
8046 cat conftest.$ac_ext >&5
8047 fi
8048 rm -f conftest.$ac_objext conftest.$ac_ext
8049 done
8050
8051 fi
8052 echo "$as_me:8052: result: $cf_cv_ncurses_header" >&5
8053 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8054
8055 if test "$cf_cv_ncurses_header" = none ; then
8056         { { echo "$as_me:8056: error: No curses header-files found" >&5
8057 echo "$as_me: error: No curses header-files found" >&2;}
8058    { (exit 1); exit 1; }; }
8059 fi
8060
8061 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8062
8063 for ac_header in $cf_cv_ncurses_header
8064 do
8065 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8066 echo "$as_me:8066: checking for $ac_header" >&5
8067 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8068 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8069   echo $ECHO_N "(cached) $ECHO_C" >&6
8070 else
8071   cat >conftest.$ac_ext <<_ACEOF
8072 #line 8072 "configure"
8073 #include "confdefs.h"
8074 #include <$ac_header>
8075 _ACEOF
8076 if { (eval echo "$as_me:8076: \"$ac_cpp conftest.$ac_ext\"") >&5
8077   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8078   ac_status=$?
8079   egrep -v '^ *\+' conftest.er1 >conftest.err
8080   rm -f conftest.er1
8081   cat conftest.err >&5
8082   echo "$as_me:8082: \$? = $ac_status" >&5
8083   (exit $ac_status); } >/dev/null; then
8084   if test -s conftest.err; then
8085     ac_cpp_err=$ac_c_preproc_warn_flag
8086   else
8087     ac_cpp_err=
8088   fi
8089 else
8090   ac_cpp_err=yes
8091 fi
8092 if test -z "$ac_cpp_err"; then
8093   eval "$as_ac_Header=yes"
8094 else
8095   echo "$as_me: failed program was:" >&5
8096   cat conftest.$ac_ext >&5
8097   eval "$as_ac_Header=no"
8098 fi
8099 rm -f conftest.err conftest.$ac_ext
8100 fi
8101 echo "$as_me:8101: result: `eval echo '${'$as_ac_Header'}'`" >&5
8102 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8103 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8104   cat >>confdefs.h <<EOF
8105 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8106 EOF
8107
8108 fi
8109 done
8110
8111 cat >>confdefs.h <<\EOF
8112 #define NCURSES 1
8113 EOF
8114
8115 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8116
8117                 cat >>confdefs.h <<EOF
8118 #define $cf_nculib_ROOT 1
8119 EOF
8120
8121                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8122
8123         else
8124
8125 cf_ncuhdr_root=ncurses
8126
8127 test -n "$cf_cv_curses_dir" && \
8128 test "$cf_cv_curses_dir" != "no" && { \
8129
8130 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8131   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8132   do
8133         while test $cf_add_incdir != /usr/include
8134         do
8135           if test -d $cf_add_incdir
8136           then
8137                 cf_have_incdir=no
8138                 if test -n "$CFLAGS$CPPFLAGS" ; then
8139                   # a loop is needed to ensure we can add subdirs of existing dirs
8140                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8141                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8142                           cf_have_incdir=yes; break
8143                         fi
8144                   done
8145                 fi
8146
8147                 if test "$cf_have_incdir" = no ; then
8148                   if test "$cf_add_incdir" = /usr/local/include ; then
8149                         if test "$GCC" = yes
8150                         then
8151                           cf_save_CPPFLAGS=$CPPFLAGS
8152                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8153                           cat >conftest.$ac_ext <<_ACEOF
8154 #line 8154 "configure"
8155 #include "confdefs.h"
8156 #include <stdio.h>
8157 int
8158 main (void)
8159 {
8160 printf("Hello")
8161   ;
8162   return 0;
8163 }
8164 _ACEOF
8165 rm -f conftest.$ac_objext
8166 if { (eval echo "$as_me:8166: \"$ac_compile\"") >&5
8167   (eval $ac_compile) 2>&5
8168   ac_status=$?
8169   echo "$as_me:8169: \$? = $ac_status" >&5
8170   (exit $ac_status); } &&
8171          { ac_try='test -s conftest.$ac_objext'
8172   { (eval echo "$as_me:8172: \"$ac_try\"") >&5
8173   (eval $ac_try) 2>&5
8174   ac_status=$?
8175   echo "$as_me:8175: \$? = $ac_status" >&5
8176   (exit $ac_status); }; }; then
8177   :
8178 else
8179   echo "$as_me: failed program was:" >&5
8180 cat conftest.$ac_ext >&5
8181 cf_have_incdir=yes
8182 fi
8183 rm -f conftest.$ac_objext conftest.$ac_ext
8184                           CPPFLAGS=$cf_save_CPPFLAGS
8185                         fi
8186                   fi
8187                 fi
8188
8189                 if test "$cf_have_incdir" = no ; then
8190                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8191
8192 echo "${as_me:-configure}:8192: testing adding $cf_add_incdir to include-path ..." 1>&5
8193
8194                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8195
8196                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8197                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8198                   cf_add_incdir="$cf_top_incdir"
8199                 else
8200                   break
8201                 fi
8202           else
8203                 break
8204           fi
8205         done
8206   done
8207 fi
8208
8209 }
8210
8211 echo "$as_me:8211: checking for $cf_ncuhdr_root header in include-path" >&5
8212 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8213 if test "${cf_cv_ncurses_h+set}" = set; then
8214   echo $ECHO_N "(cached) $ECHO_C" >&6
8215 else
8216
8217         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8218         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8219         for cf_header in $cf_header_list
8220         do
8221
8222         cat >conftest.$ac_ext <<_ACEOF
8223 #line 8223 "configure"
8224 #include "confdefs.h"
8225
8226 #include <$cf_header>
8227 int
8228 main (void)
8229 {
8230
8231 #ifdef NCURSES_VERSION
8232
8233 printf("%s\n", NCURSES_VERSION);
8234 #else
8235 #ifdef __NCURSES_H
8236 printf("old\n");
8237 #else
8238         make an error
8239 #endif
8240 #endif
8241
8242   ;
8243   return 0;
8244 }
8245 _ACEOF
8246 rm -f conftest.$ac_objext
8247 if { (eval echo "$as_me:8247: \"$ac_compile\"") >&5
8248   (eval $ac_compile) 2>&5
8249   ac_status=$?
8250   echo "$as_me:8250: \$? = $ac_status" >&5
8251   (exit $ac_status); } &&
8252          { ac_try='test -s conftest.$ac_objext'
8253   { (eval echo "$as_me:8253: \"$ac_try\"") >&5
8254   (eval $ac_try) 2>&5
8255   ac_status=$?
8256   echo "$as_me:8256: \$? = $ac_status" >&5
8257   (exit $ac_status); }; }; then
8258   cf_cv_ncurses_h=$cf_header
8259
8260 else
8261   echo "$as_me: failed program was:" >&5
8262 cat conftest.$ac_ext >&5
8263 cf_cv_ncurses_h=no
8264 fi
8265 rm -f conftest.$ac_objext conftest.$ac_ext
8266
8267                 test "$cf_cv_ncurses_h" != no && break
8268         done
8269
8270 fi
8271 echo "$as_me:8271: result: $cf_cv_ncurses_h" >&5
8272 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8273
8274 if test "$cf_cv_ncurses_h" != no ; then
8275         cf_cv_ncurses_header=$cf_cv_ncurses_h
8276 else
8277
8278 echo "$as_me:8278: checking for $cf_ncuhdr_root include-path" >&5
8279 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8280 if test "${cf_cv_ncurses_h2+set}" = set; then
8281   echo $ECHO_N "(cached) $ECHO_C" >&6
8282 else
8283
8284         test -n "$verbose" && echo
8285
8286 cf_search=
8287
8288 # collect the current set of include-directories from compiler flags
8289 cf_header_path_list=""
8290 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8291         for cf_header_path in $CPPFLAGS $CFLAGS
8292         do
8293                 case $cf_header_path in
8294                 (-I*)
8295                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8296
8297 test "x$cf_header_path" != "xNONE" && \
8298 test -d "$cf_header_path" && \
8299  {
8300         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8301         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8302         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8303         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8304         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8305         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"
8306 }
8307
8308                         cf_header_path_list="$cf_header_path_list $cf_search"
8309                         ;;
8310                 esac
8311         done
8312 fi
8313
8314 # add the variations for the package we are looking for
8315
8316 cf_search=
8317
8318 test "x$prefix" != "xNONE" && \
8319 test -d "$prefix" && \
8320  {
8321         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8322         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8323         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8324         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8325         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8326         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8327 }
8328
8329 for cf_subdir_prefix in \
8330         /usr \
8331         /usr/local \
8332         /usr/pkg \
8333         /opt \
8334         /opt/local \
8335         $HOME
8336 do
8337
8338 test "x$cf_subdir_prefix" != "x$prefix" && \
8339 test -d "$cf_subdir_prefix" && \
8340 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8341         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8342         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8343         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8344         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8345         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8346         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"
8347 }
8348
8349 done
8350
8351 test "$includedir" != NONE && \
8352 test "$includedir" != "/usr/include" && \
8353 test -d "$includedir" && {
8354         test -d $includedir &&    cf_search="$cf_search $includedir"
8355         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8356 }
8357
8358 test "$oldincludedir" != NONE && \
8359 test "$oldincludedir" != "/usr/include" && \
8360 test -d "$oldincludedir" && {
8361         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8362         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8363 }
8364
8365 cf_search="$cf_search $cf_header_path_list"
8366
8367         test -n "$verbose" && echo search path $cf_search
8368         cf_save2_CPPFLAGS="$CPPFLAGS"
8369         for cf_incdir in $cf_search
8370         do
8371
8372 if test -n "$cf_incdir" ; then
8373   for cf_add_incdir in $cf_incdir
8374   do
8375         while test $cf_add_incdir != /usr/include
8376         do
8377           if test -d $cf_add_incdir
8378           then
8379                 cf_have_incdir=no
8380                 if test -n "$CFLAGS$CPPFLAGS" ; then
8381                   # a loop is needed to ensure we can add subdirs of existing dirs
8382                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8383                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8384                           cf_have_incdir=yes; break
8385                         fi
8386                   done
8387                 fi
8388
8389                 if test "$cf_have_incdir" = no ; then
8390                   if test "$cf_add_incdir" = /usr/local/include ; then
8391                         if test "$GCC" = yes
8392                         then
8393                           cf_save_CPPFLAGS=$CPPFLAGS
8394                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8395                           cat >conftest.$ac_ext <<_ACEOF
8396 #line 8396 "configure"
8397 #include "confdefs.h"
8398 #include <stdio.h>
8399 int
8400 main (void)
8401 {
8402 printf("Hello")
8403   ;
8404   return 0;
8405 }
8406 _ACEOF
8407 rm -f conftest.$ac_objext
8408 if { (eval echo "$as_me:8408: \"$ac_compile\"") >&5
8409   (eval $ac_compile) 2>&5
8410   ac_status=$?
8411   echo "$as_me:8411: \$? = $ac_status" >&5
8412   (exit $ac_status); } &&
8413          { ac_try='test -s conftest.$ac_objext'
8414   { (eval echo "$as_me:8414: \"$ac_try\"") >&5
8415   (eval $ac_try) 2>&5
8416   ac_status=$?
8417   echo "$as_me:8417: \$? = $ac_status" >&5
8418   (exit $ac_status); }; }; then
8419   :
8420 else
8421   echo "$as_me: failed program was:" >&5
8422 cat conftest.$ac_ext >&5
8423 cf_have_incdir=yes
8424 fi
8425 rm -f conftest.$ac_objext conftest.$ac_ext
8426                           CPPFLAGS=$cf_save_CPPFLAGS
8427                         fi
8428                   fi
8429                 fi
8430
8431                 if test "$cf_have_incdir" = no ; then
8432                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8433
8434 echo "${as_me:-configure}:8434: testing adding $cf_add_incdir to include-path ..." 1>&5
8435
8436                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8437
8438                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8439                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8440                   cf_add_incdir="$cf_top_incdir"
8441                 else
8442                   break
8443                 fi
8444           else
8445                 break
8446           fi
8447         done
8448   done
8449 fi
8450
8451                 for cf_header in \
8452                         ncurses.h \
8453                         curses.h
8454                 do
8455
8456         cat >conftest.$ac_ext <<_ACEOF
8457 #line 8457 "configure"
8458 #include "confdefs.h"
8459
8460 #include <$cf_header>
8461 int
8462 main (void)
8463 {
8464
8465 #ifdef NCURSES_VERSION
8466
8467 printf("%s\n", NCURSES_VERSION);
8468 #else
8469 #ifdef __NCURSES_H
8470 printf("old\n");
8471 #else
8472         make an error
8473 #endif
8474 #endif
8475
8476   ;
8477   return 0;
8478 }
8479 _ACEOF
8480 rm -f conftest.$ac_objext
8481 if { (eval echo "$as_me:8481: \"$ac_compile\"") >&5
8482   (eval $ac_compile) 2>&5
8483   ac_status=$?
8484   echo "$as_me:8484: \$? = $ac_status" >&5
8485   (exit $ac_status); } &&
8486          { ac_try='test -s conftest.$ac_objext'
8487   { (eval echo "$as_me:8487: \"$ac_try\"") >&5
8488   (eval $ac_try) 2>&5
8489   ac_status=$?
8490   echo "$as_me:8490: \$? = $ac_status" >&5
8491   (exit $ac_status); }; }; then
8492   cf_cv_ncurses_h2=$cf_header
8493
8494 else
8495   echo "$as_me: failed program was:" >&5
8496 cat conftest.$ac_ext >&5
8497 cf_cv_ncurses_h2=no
8498 fi
8499 rm -f conftest.$ac_objext conftest.$ac_ext
8500
8501                         if test "$cf_cv_ncurses_h2" != no ; then
8502                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8503                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8504                                 break
8505                         fi
8506                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8507                 done
8508                 CPPFLAGS="$cf_save2_CPPFLAGS"
8509                 test "$cf_cv_ncurses_h2" != no && break
8510         done
8511         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8511: error: not found" >&5
8512 echo "$as_me: error: not found" >&2;}
8513    { (exit 1); exit 1; }; }
8514
8515 fi
8516 echo "$as_me:8516: result: $cf_cv_ncurses_h2" >&5
8517 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8518
8519         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8520         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8521         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8522                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8523         fi
8524
8525 if test -n "$cf_1st_incdir" ; then
8526   for cf_add_incdir in $cf_1st_incdir
8527   do
8528         while test $cf_add_incdir != /usr/include
8529         do
8530           if test -d $cf_add_incdir
8531           then
8532                 cf_have_incdir=no
8533                 if test -n "$CFLAGS$CPPFLAGS" ; then
8534                   # a loop is needed to ensure we can add subdirs of existing dirs
8535                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8536                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8537                           cf_have_incdir=yes; break
8538                         fi
8539                   done
8540                 fi
8541
8542                 if test "$cf_have_incdir" = no ; then
8543                   if test "$cf_add_incdir" = /usr/local/include ; then
8544                         if test "$GCC" = yes
8545                         then
8546                           cf_save_CPPFLAGS=$CPPFLAGS
8547                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8548                           cat >conftest.$ac_ext <<_ACEOF
8549 #line 8549 "configure"
8550 #include "confdefs.h"
8551 #include <stdio.h>
8552 int
8553 main (void)
8554 {
8555 printf("Hello")
8556   ;
8557   return 0;
8558 }
8559 _ACEOF
8560 rm -f conftest.$ac_objext
8561 if { (eval echo "$as_me:8561: \"$ac_compile\"") >&5
8562   (eval $ac_compile) 2>&5
8563   ac_status=$?
8564   echo "$as_me:8564: \$? = $ac_status" >&5
8565   (exit $ac_status); } &&
8566          { ac_try='test -s conftest.$ac_objext'
8567   { (eval echo "$as_me:8567: \"$ac_try\"") >&5
8568   (eval $ac_try) 2>&5
8569   ac_status=$?
8570   echo "$as_me:8570: \$? = $ac_status" >&5
8571   (exit $ac_status); }; }; then
8572   :
8573 else
8574   echo "$as_me: failed program was:" >&5
8575 cat conftest.$ac_ext >&5
8576 cf_have_incdir=yes
8577 fi
8578 rm -f conftest.$ac_objext conftest.$ac_ext
8579                           CPPFLAGS=$cf_save_CPPFLAGS
8580                         fi
8581                   fi
8582                 fi
8583
8584                 if test "$cf_have_incdir" = no ; then
8585                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8586
8587 echo "${as_me:-configure}:8587: testing adding $cf_add_incdir to include-path ..." 1>&5
8588
8589                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8590
8591                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8592                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8593                   cf_add_incdir="$cf_top_incdir"
8594                 else
8595                   break
8596                 fi
8597           else
8598                 break
8599           fi
8600         done
8601   done
8602 fi
8603
8604 fi
8605
8606 # Set definitions to allow ifdef'ing for ncurses.h
8607
8608 case $cf_cv_ncurses_header in
8609 (*ncurses.h)
8610
8611 cat >>confdefs.h <<\EOF
8612 #define HAVE_NCURSES_H 1
8613 EOF
8614
8615         ;;
8616 esac
8617
8618 case $cf_cv_ncurses_header in
8619 (ncurses/curses.h|ncurses/ncurses.h)
8620
8621 cat >>confdefs.h <<\EOF
8622 #define HAVE_NCURSES_NCURSES_H 1
8623 EOF
8624
8625         ;;
8626 (ncursesw/curses.h|ncursesw/ncurses.h)
8627
8628 cat >>confdefs.h <<\EOF
8629 #define HAVE_NCURSESW_NCURSES_H 1
8630 EOF
8631
8632         ;;
8633 esac
8634
8635 echo "$as_me:8635: checking for terminfo header" >&5
8636 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8637 if test "${cf_cv_term_header+set}" = set; then
8638   echo $ECHO_N "(cached) $ECHO_C" >&6
8639 else
8640
8641 case ${cf_cv_ncurses_header} in
8642 (*/ncurses.h|*/ncursesw.h)
8643         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8644         ;;
8645 (*)
8646         cf_term_header=term.h
8647         ;;
8648 esac
8649
8650 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8651 do
8652 cat >conftest.$ac_ext <<_ACEOF
8653 #line 8653 "configure"
8654 #include "confdefs.h"
8655 #include <stdio.h>
8656 #include <${cf_cv_ncurses_header:-curses.h}>
8657 #include <$cf_test>
8658
8659 int
8660 main (void)
8661 {
8662 int x = auto_left_margin
8663   ;
8664   return 0;
8665 }
8666 _ACEOF
8667 rm -f conftest.$ac_objext
8668 if { (eval echo "$as_me:8668: \"$ac_compile\"") >&5
8669   (eval $ac_compile) 2>&5
8670   ac_status=$?
8671   echo "$as_me:8671: \$? = $ac_status" >&5
8672   (exit $ac_status); } &&
8673          { ac_try='test -s conftest.$ac_objext'
8674   { (eval echo "$as_me:8674: \"$ac_try\"") >&5
8675   (eval $ac_try) 2>&5
8676   ac_status=$?
8677   echo "$as_me:8677: \$? = $ac_status" >&5
8678   (exit $ac_status); }; }; then
8679
8680         cf_cv_term_header="$cf_test"
8681 else
8682   echo "$as_me: failed program was:" >&5
8683 cat conftest.$ac_ext >&5
8684
8685         cf_cv_term_header=unknown
8686
8687 fi
8688 rm -f conftest.$ac_objext conftest.$ac_ext
8689         test "$cf_cv_term_header" != unknown && break
8690 done
8691
8692 fi
8693 echo "$as_me:8693: result: $cf_cv_term_header" >&5
8694 echo "${ECHO_T}$cf_cv_term_header" >&6
8695
8696 # Set definitions to allow ifdef'ing to accommodate subdirectories
8697
8698 case $cf_cv_term_header in
8699 (*term.h)
8700
8701 cat >>confdefs.h <<\EOF
8702 #define HAVE_TERM_H 1
8703 EOF
8704
8705         ;;
8706 esac
8707
8708 case $cf_cv_term_header in
8709 (ncurses/term.h)
8710
8711 cat >>confdefs.h <<\EOF
8712 #define HAVE_NCURSES_TERM_H 1
8713 EOF
8714
8715         ;;
8716 (ncursesw/term.h)
8717
8718 cat >>confdefs.h <<\EOF
8719 #define HAVE_NCURSESW_TERM_H 1
8720 EOF
8721
8722         ;;
8723 esac
8724
8725 # some applications need this, but should check for NCURSES_VERSION
8726
8727 cat >>confdefs.h <<\EOF
8728 #define NCURSES 1
8729 EOF
8730
8731 echo "$as_me:8731: checking for ncurses version" >&5
8732 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8733 if test "${cf_cv_ncurses_version+set}" = set; then
8734   echo $ECHO_N "(cached) $ECHO_C" >&6
8735 else
8736
8737         cf_cv_ncurses_version=no
8738         cf_tempfile=out$$
8739         rm -f $cf_tempfile
8740         if test "$cross_compiling" = yes; then
8741
8742         # This will not work if the preprocessor splits the line after the
8743         # Autoconf token.  The 'unproto' program does that.
8744         cat > conftest.$ac_ext <<EOF
8745 #include <${cf_cv_ncurses_header:-curses.h}>
8746 #undef Autoconf
8747 #ifdef NCURSES_VERSION
8748 Autoconf NCURSES_VERSION
8749 #else
8750 #ifdef __NCURSES_H
8751 Autoconf "old"
8752 #endif
8753 ;
8754 #endif
8755 EOF
8756         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8757         { (eval echo "$as_me:8757: \"$cf_try\"") >&5
8758   (eval $cf_try) 2>&5
8759   ac_status=$?
8760   echo "$as_me:8760: \$? = $ac_status" >&5
8761   (exit $ac_status); }
8762         if test -f conftest.out ; then
8763                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8764                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8765                 rm -f conftest.out
8766         fi
8767
8768 else
8769   cat >conftest.$ac_ext <<_ACEOF
8770 #line 8770 "configure"
8771 #include "confdefs.h"
8772
8773 #include <${cf_cv_ncurses_header:-curses.h}>
8774 #include <stdio.h>
8775 int main(void)
8776 {
8777         FILE *fp = fopen("$cf_tempfile", "w");
8778 #ifdef NCURSES_VERSION
8779 # ifdef NCURSES_VERSION_PATCH
8780         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8781 # else
8782         fprintf(fp, "%s\n", NCURSES_VERSION);
8783 # endif
8784 #else
8785 # ifdef __NCURSES_H
8786         fprintf(fp, "old\n");
8787 # else
8788         make an error
8789 # endif
8790 #endif
8791         ${cf_cv_main_return:-return}(0);
8792 }
8793 _ACEOF
8794 rm -f conftest$ac_exeext
8795 if { (eval echo "$as_me:8795: \"$ac_link\"") >&5
8796   (eval $ac_link) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8800   { (eval echo "$as_me:8800: \"$ac_try\"") >&5
8801   (eval $ac_try) 2>&5
8802   ac_status=$?
8803   echo "$as_me:8803: \$? = $ac_status" >&5
8804   (exit $ac_status); }; }; then
8805
8806         cf_cv_ncurses_version=`cat $cf_tempfile`
8807 else
8808   echo "$as_me: program exited with status $ac_status" >&5
8809 echo "$as_me: failed program was:" >&5
8810 cat conftest.$ac_ext >&5
8811 fi
8812 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8813 fi
8814         rm -f $cf_tempfile
8815
8816 fi
8817 echo "$as_me:8817: result: $cf_cv_ncurses_version" >&5
8818 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8819 test "$cf_cv_ncurses_version" = no ||
8820 cat >>confdefs.h <<\EOF
8821 #define NCURSES 1
8822 EOF
8823
8824 cf_nculib_root=ncurses
8825         # This works, except for the special case where we find gpm, but
8826         # ncurses is in a nonstandard location via $LIBS, and we really want
8827         # to link gpm.
8828 cf_ncurses_LIBS=""
8829 cf_ncurses_SAVE="$LIBS"
8830 echo "$as_me:8830: checking for Gpm_Open in -lgpm" >&5
8831 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8832 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8833   echo $ECHO_N "(cached) $ECHO_C" >&6
8834 else
8835   ac_check_lib_save_LIBS=$LIBS
8836 LIBS="-lgpm  $LIBS"
8837 cat >conftest.$ac_ext <<_ACEOF
8838 #line 8838 "configure"
8839 #include "confdefs.h"
8840
8841 /* Override any gcc2 internal prototype to avoid an error.  */
8842 #ifdef __cplusplus
8843 extern "C"
8844 #endif
8845 /* We use char because int might match the return type of a gcc2
8846    builtin and then its argument prototype would still apply.  */
8847 char Gpm_Open ();
8848 int
8849 main (void)
8850 {
8851 Gpm_Open ();
8852   ;
8853   return 0;
8854 }
8855 _ACEOF
8856 rm -f conftest.$ac_objext conftest$ac_exeext
8857 if { (eval echo "$as_me:8857: \"$ac_link\"") >&5
8858   (eval $ac_link) 2>&5
8859   ac_status=$?
8860   echo "$as_me:8860: \$? = $ac_status" >&5
8861   (exit $ac_status); } &&
8862          { ac_try='test -s conftest$ac_exeext'
8863   { (eval echo "$as_me:8863: \"$ac_try\"") >&5
8864   (eval $ac_try) 2>&5
8865   ac_status=$?
8866   echo "$as_me:8866: \$? = $ac_status" >&5
8867   (exit $ac_status); }; }; then
8868   ac_cv_lib_gpm_Gpm_Open=yes
8869 else
8870   echo "$as_me: failed program was:" >&5
8871 cat conftest.$ac_ext >&5
8872 ac_cv_lib_gpm_Gpm_Open=no
8873 fi
8874 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8875 LIBS=$ac_check_lib_save_LIBS
8876 fi
8877 echo "$as_me:8877: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8878 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8879 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8880   echo "$as_me:8880: checking for initscr in -lgpm" >&5
8881 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8882 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8883   echo $ECHO_N "(cached) $ECHO_C" >&6
8884 else
8885   ac_check_lib_save_LIBS=$LIBS
8886 LIBS="-lgpm  $LIBS"
8887 cat >conftest.$ac_ext <<_ACEOF
8888 #line 8888 "configure"
8889 #include "confdefs.h"
8890
8891 /* Override any gcc2 internal prototype to avoid an error.  */
8892 #ifdef __cplusplus
8893 extern "C"
8894 #endif
8895 /* We use char because int might match the return type of a gcc2
8896    builtin and then its argument prototype would still apply.  */
8897 char initscr ();
8898 int
8899 main (void)
8900 {
8901 initscr ();
8902   ;
8903   return 0;
8904 }
8905 _ACEOF
8906 rm -f conftest.$ac_objext conftest$ac_exeext
8907 if { (eval echo "$as_me:8907: \"$ac_link\"") >&5
8908   (eval $ac_link) 2>&5
8909   ac_status=$?
8910   echo "$as_me:8910: \$? = $ac_status" >&5
8911   (exit $ac_status); } &&
8912          { ac_try='test -s conftest$ac_exeext'
8913   { (eval echo "$as_me:8913: \"$ac_try\"") >&5
8914   (eval $ac_try) 2>&5
8915   ac_status=$?
8916   echo "$as_me:8916: \$? = $ac_status" >&5
8917   (exit $ac_status); }; }; then
8918   ac_cv_lib_gpm_initscr=yes
8919 else
8920   echo "$as_me: failed program was:" >&5
8921 cat conftest.$ac_ext >&5
8922 ac_cv_lib_gpm_initscr=no
8923 fi
8924 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8925 LIBS=$ac_check_lib_save_LIBS
8926 fi
8927 echo "$as_me:8927: result: $ac_cv_lib_gpm_initscr" >&5
8928 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8929 if test $ac_cv_lib_gpm_initscr = yes; then
8930   LIBS="$cf_ncurses_SAVE"
8931 else
8932   cf_ncurses_LIBS="-lgpm"
8933 fi
8934
8935 fi
8936
8937 case $host_os in
8938 (freebsd*)
8939         # This is only necessary if you are linking against an obsolete
8940         # version of ncurses (but it should do no harm, since it's static).
8941         if test "$cf_nculib_root" = ncurses ; then
8942                 echo "$as_me:8942: checking for tgoto in -lmytinfo" >&5
8943 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8944 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8945   echo $ECHO_N "(cached) $ECHO_C" >&6
8946 else
8947   ac_check_lib_save_LIBS=$LIBS
8948 LIBS="-lmytinfo  $LIBS"
8949 cat >conftest.$ac_ext <<_ACEOF
8950 #line 8950 "configure"
8951 #include "confdefs.h"
8952
8953 /* Override any gcc2 internal prototype to avoid an error.  */
8954 #ifdef __cplusplus
8955 extern "C"
8956 #endif
8957 /* We use char because int might match the return type of a gcc2
8958    builtin and then its argument prototype would still apply.  */
8959 char tgoto ();
8960 int
8961 main (void)
8962 {
8963 tgoto ();
8964   ;
8965   return 0;
8966 }
8967 _ACEOF
8968 rm -f conftest.$ac_objext conftest$ac_exeext
8969 if { (eval echo "$as_me:8969: \"$ac_link\"") >&5
8970   (eval $ac_link) 2>&5
8971   ac_status=$?
8972   echo "$as_me:8972: \$? = $ac_status" >&5
8973   (exit $ac_status); } &&
8974          { ac_try='test -s conftest$ac_exeext'
8975   { (eval echo "$as_me:8975: \"$ac_try\"") >&5
8976   (eval $ac_try) 2>&5
8977   ac_status=$?
8978   echo "$as_me:8978: \$? = $ac_status" >&5
8979   (exit $ac_status); }; }; then
8980   ac_cv_lib_mytinfo_tgoto=yes
8981 else
8982   echo "$as_me: failed program was:" >&5
8983 cat conftest.$ac_ext >&5
8984 ac_cv_lib_mytinfo_tgoto=no
8985 fi
8986 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8987 LIBS=$ac_check_lib_save_LIBS
8988 fi
8989 echo "$as_me:8989: result: $ac_cv_lib_mytinfo_tgoto" >&5
8990 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8991 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8992   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8993 fi
8994
8995         fi
8996         ;;
8997 esac
8998
8999 cf_add_libs="$cf_ncurses_LIBS"
9000 # Filter out duplicates - this happens with badly-designed ".pc" files...
9001 for cf_add_1lib in $LIBS
9002 do
9003         for cf_add_2lib in $cf_add_libs
9004         do
9005                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9006                 then
9007                         cf_add_1lib=
9008                         break
9009                 fi
9010         done
9011         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9012 done
9013 LIBS="$cf_add_libs"
9014
9015 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9016 then
9017
9018 cf_add_libs="-l$cf_nculib_root"
9019 # Filter out duplicates - this happens with badly-designed ".pc" files...
9020 for cf_add_1lib in $LIBS
9021 do
9022         for cf_add_2lib in $cf_add_libs
9023         do
9024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9025                 then
9026                         cf_add_1lib=
9027                         break
9028                 fi
9029         done
9030         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9031 done
9032 LIBS="$cf_add_libs"
9033
9034 else
9035
9036         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9037         cf_libdir=""
9038         echo "$as_me:9038: checking for initscr" >&5
9039 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9040 if test "${ac_cv_func_initscr+set}" = set; then
9041   echo $ECHO_N "(cached) $ECHO_C" >&6
9042 else
9043   cat >conftest.$ac_ext <<_ACEOF
9044 #line 9044 "configure"
9045 #include "confdefs.h"
9046 /* System header to define __stub macros and hopefully few prototypes,
9047     which can conflict with char initscr (); below.  */
9048 #include <assert.h>
9049 /* Override any gcc2 internal prototype to avoid an error.  */
9050 #ifdef __cplusplus
9051 extern "C"
9052 #endif
9053 /* We use char because int might match the return type of a gcc2
9054    builtin and then its argument prototype would still apply.  */
9055 char initscr ();
9056 char (*f) ();
9057
9058 int
9059 main (void)
9060 {
9061 /* The GNU C library defines this for functions which it implements
9062     to always fail with ENOSYS.  Some functions are actually named
9063     something starting with __ and the normal name is an alias.  */
9064 #if defined (__stub_initscr) || defined (__stub___initscr)
9065 choke me
9066 #else
9067 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9068 #endif
9069
9070   ;
9071   return 0;
9072 }
9073 _ACEOF
9074 rm -f conftest.$ac_objext conftest$ac_exeext
9075 if { (eval echo "$as_me:9075: \"$ac_link\"") >&5
9076   (eval $ac_link) 2>&5
9077   ac_status=$?
9078   echo "$as_me:9078: \$? = $ac_status" >&5
9079   (exit $ac_status); } &&
9080          { ac_try='test -s conftest$ac_exeext'
9081   { (eval echo "$as_me:9081: \"$ac_try\"") >&5
9082   (eval $ac_try) 2>&5
9083   ac_status=$?
9084   echo "$as_me:9084: \$? = $ac_status" >&5
9085   (exit $ac_status); }; }; then
9086   ac_cv_func_initscr=yes
9087 else
9088   echo "$as_me: failed program was:" >&5
9089 cat conftest.$ac_ext >&5
9090 ac_cv_func_initscr=no
9091 fi
9092 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9093 fi
9094 echo "$as_me:9094: result: $ac_cv_func_initscr" >&5
9095 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9096 if test $ac_cv_func_initscr = yes; then
9097   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9098 else
9099
9100                 cf_save_LIBS="$LIBS"
9101                 echo "$as_me:9101: checking for initscr in -l$cf_nculib_root" >&5
9102 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9103                 LIBS="-l$cf_nculib_root $LIBS"
9104                 cat >conftest.$ac_ext <<_ACEOF
9105 #line 9105 "configure"
9106 #include "confdefs.h"
9107 #include <${cf_cv_ncurses_header:-curses.h}>
9108 int
9109 main (void)
9110 {
9111 initscr()
9112   ;
9113   return 0;
9114 }
9115 _ACEOF
9116 rm -f conftest.$ac_objext conftest$ac_exeext
9117 if { (eval echo "$as_me:9117: \"$ac_link\"") >&5
9118   (eval $ac_link) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); } &&
9122          { ac_try='test -s conftest$ac_exeext'
9123   { (eval echo "$as_me:9123: \"$ac_try\"") >&5
9124   (eval $ac_try) 2>&5
9125   ac_status=$?
9126   echo "$as_me:9126: \$? = $ac_status" >&5
9127   (exit $ac_status); }; }; then
9128   echo "$as_me:9128: result: yes" >&5
9129 echo "${ECHO_T}yes" >&6
9130                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9131
9132 else
9133   echo "$as_me: failed program was:" >&5
9134 cat conftest.$ac_ext >&5
9135 echo "$as_me:9135: result: no" >&5
9136 echo "${ECHO_T}no" >&6
9137
9138 cf_search=
9139 cf_library_path_list=""
9140 if test -n "${LDFLAGS}${LIBS}" ; then
9141         for cf_library_path in $LDFLAGS $LIBS
9142         do
9143                 case $cf_library_path in
9144                 (-L*)
9145                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9146
9147 test "x$cf_library_path" != "xNONE" && \
9148 test -d "$cf_library_path" && \
9149  {
9150         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9151         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9152         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9153         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9154         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9155         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"
9156 }
9157
9158                         cf_library_path_list="$cf_library_path_list $cf_search"
9159                         ;;
9160                 esac
9161         done
9162 fi
9163
9164 cf_search=
9165
9166 test "x$prefix" != "xNONE" && \
9167 test -d "$prefix" && \
9168  {
9169         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9170         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9171         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9172         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9173         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9174         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9175 }
9176
9177 for cf_subdir_prefix in \
9178         /usr \
9179         /usr/local \
9180         /usr/pkg \
9181         /opt \
9182         /opt/local \
9183         $HOME
9184 do
9185
9186 test "x$cf_subdir_prefix" != "x$prefix" && \
9187 test -d "$cf_subdir_prefix" && \
9188 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9189         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9190         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9191         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9192         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9193         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9194         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"
9195 }
9196
9197 done
9198
9199 cf_search="$cf_library_path_list $cf_search"
9200
9201                         for cf_libdir in $cf_search
9202                         do
9203                                 echo "$as_me:9203: checking for -l$cf_nculib_root in $cf_libdir" >&5
9204 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9205                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9206                                 cat >conftest.$ac_ext <<_ACEOF
9207 #line 9207 "configure"
9208 #include "confdefs.h"
9209 #include <${cf_cv_ncurses_header:-curses.h}>
9210 int
9211 main (void)
9212 {
9213 initscr()
9214   ;
9215   return 0;
9216 }
9217 _ACEOF
9218 rm -f conftest.$ac_objext conftest$ac_exeext
9219 if { (eval echo "$as_me:9219: \"$ac_link\"") >&5
9220   (eval $ac_link) 2>&5
9221   ac_status=$?
9222   echo "$as_me:9222: \$? = $ac_status" >&5
9223   (exit $ac_status); } &&
9224          { ac_try='test -s conftest$ac_exeext'
9225   { (eval echo "$as_me:9225: \"$ac_try\"") >&5
9226   (eval $ac_try) 2>&5
9227   ac_status=$?
9228   echo "$as_me:9228: \$? = $ac_status" >&5
9229   (exit $ac_status); }; }; then
9230   echo "$as_me:9230: result: yes" >&5
9231 echo "${ECHO_T}yes" >&6
9232                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9233                                          break
9234 else
9235   echo "$as_me: failed program was:" >&5
9236 cat conftest.$ac_ext >&5
9237 echo "$as_me:9237: result: no" >&5
9238 echo "${ECHO_T}no" >&6
9239                                          LIBS="$cf_save_LIBS"
9240 fi
9241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9242                         done
9243
9244 fi
9245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9246
9247 fi
9248
9249 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9250
9251 if test $cf_found_library = no ; then
9252         { { echo "$as_me:9252: error: Cannot link $cf_nculib_root library" >&5
9253 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9254    { (exit 1); exit 1; }; }
9255 fi
9256
9257 fi
9258
9259 if test -n "$cf_ncurses_LIBS" ; then
9260         echo "$as_me:9260: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9261 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9262         cf_ncurses_SAVE="$LIBS"
9263         for p in $cf_ncurses_LIBS ; do
9264                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9265                 if test "$q" != "$LIBS" ; then
9266                         LIBS="$q"
9267                 fi
9268         done
9269         cat >conftest.$ac_ext <<_ACEOF
9270 #line 9270 "configure"
9271 #include "confdefs.h"
9272 #include <${cf_cv_ncurses_header:-curses.h}>
9273 int
9274 main (void)
9275 {
9276 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9277   ;
9278   return 0;
9279 }
9280 _ACEOF
9281 rm -f conftest.$ac_objext conftest$ac_exeext
9282 if { (eval echo "$as_me:9282: \"$ac_link\"") >&5
9283   (eval $ac_link) 2>&5
9284   ac_status=$?
9285   echo "$as_me:9285: \$? = $ac_status" >&5
9286   (exit $ac_status); } &&
9287          { ac_try='test -s conftest$ac_exeext'
9288   { (eval echo "$as_me:9288: \"$ac_try\"") >&5
9289   (eval $ac_try) 2>&5
9290   ac_status=$?
9291   echo "$as_me:9291: \$? = $ac_status" >&5
9292   (exit $ac_status); }; }; then
9293   echo "$as_me:9293: result: yes" >&5
9294 echo "${ECHO_T}yes" >&6
9295 else
9296   echo "$as_me: failed program was:" >&5
9297 cat conftest.$ac_ext >&5
9298 echo "$as_me:9298: result: no" >&5
9299 echo "${ECHO_T}no" >&6
9300                  LIBS="$cf_ncurses_SAVE"
9301 fi
9302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9303 fi
9304
9305 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9306
9307 cat >>confdefs.h <<EOF
9308 #define $cf_nculib_ROOT 1
9309 EOF
9310
9311         fi
9312 else
9313         NCURSES_CONFIG=none
9314 fi
9315
9316 fi
9317
9318 if test "$NCURSES_CONFIG_PKG" != none ; then
9319         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
9320
9321         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9322         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9323         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9324
9325         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
9326         if test -z "$cf_cv_abi_version"
9327         then
9328                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
9329         fi
9330
9331 elif test "$NCURSES_CONFIG" != none ; then
9332
9333         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
9334
9335         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9336         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9337         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9338
9339         # ABI version is not available from headers
9340         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
9341
9342 else
9343
9344         for cf_name in MAJOR MINOR PATCH
9345         do
9346         cat >conftest.$ac_ext <<CF_EOF
9347         #include <${cf_cv_ncurses_header:-curses.h}>
9348         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
9349 CF_EOF
9350                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
9351                 { (eval echo "$as_me:9351: \"$cf_try\"") >&5
9352   (eval $cf_try) 2>&5
9353   ac_status=$?
9354   echo "$as_me:9354: \$? = $ac_status" >&5
9355   (exit $ac_status); }
9356                 if test -f conftest.out ; then
9357                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
9358                         eval NCURSES_$cf_name=\"$cf_result\"
9359                         # cat conftest.$ac_ext
9360                         # cat conftest.out
9361                 fi
9362         done
9363
9364         cf_cv_abi_version=${NCURSES_MAJOR}
9365
9366 fi
9367
9368 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
9369
9370 cf_cv_timestamp=`date`
9371
9372 echo "$as_me:9372: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
9373 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
9374
9375 echo "$as_me:9375: checking if you want to have a library-prefix" >&5
9376 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
9377
9378 # Check whether --with-lib-prefix or --without-lib-prefix was given.
9379 if test "${with_lib_prefix+set}" = set; then
9380   withval="$with_lib_prefix"
9381   with_lib_prefix=$withval
9382 else
9383   with_lib_prefix=auto
9384 fi;
9385 echo "$as_me:9385: result: $with_lib_prefix" >&5
9386 echo "${ECHO_T}$with_lib_prefix" >&6
9387
9388 if test $with_lib_prefix = auto
9389 then
9390
9391         case $cf_cv_system_name in
9392         (OS/2*|os2*)
9393                 if test "$DFT_LWR_MODEL" = libtool; then
9394                         LIB_PREFIX='lib'
9395                 else
9396                         LIB_PREFIX=''
9397                 fi
9398                 ;;
9399         (*)     LIB_PREFIX='lib'
9400                 ;;
9401         esac
9402 cf_prefix=$LIB_PREFIX
9403
9404 elif test $with_lib_prefix = no
9405 then
9406         LIB_PREFIX=
9407 else
9408         LIB_PREFIX=$with_lib_prefix
9409 fi
9410
9411 LIB_SUFFIX=
9412
9413 ###############################################################################
9414
9415 if test X"$CC_G_OPT" = X"" ; then
9416         CC_G_OPT='-g'
9417         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
9418 fi
9419
9420 echo "$as_me:9420: checking for default loader flags" >&5
9421 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
9422 case $DFT_LWR_MODEL in
9423 (normal)  LD_MODEL=''   ;;
9424 (debug)   LD_MODEL=$CC_G_OPT ;;
9425 (profile) LD_MODEL='-pg';;
9426 (shared)  LD_MODEL=''   ;;
9427 esac
9428 echo "$as_me:9428: result: $LD_MODEL" >&5
9429 echo "${ECHO_T}$LD_MODEL" >&6
9430
9431 LD_RPATH_OPT=
9432 echo "$as_me:9432: checking for an rpath option" >&5
9433 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9434 case $cf_cv_system_name in
9435 (irix*)
9436         if test "$GCC" = yes; then
9437                 LD_RPATH_OPT="-Wl,-rpath,"
9438         else
9439                 LD_RPATH_OPT="-rpath "
9440         fi
9441         ;;
9442 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9443         LD_RPATH_OPT="-Wl,-rpath,"
9444         ;;
9445 (openbsd[2-9].*|mirbsd*)
9446         LD_RPATH_OPT="-Wl,-rpath,"
9447         ;;
9448 (dragonfly*)
9449         LD_RPATH_OPT="-rpath "
9450         ;;
9451 (netbsd*)
9452         LD_RPATH_OPT="-Wl,-rpath,"
9453         ;;
9454 (osf*|mls+*)
9455         LD_RPATH_OPT="-rpath "
9456         ;;
9457 (solaris2*)
9458         LD_RPATH_OPT="-R"
9459         ;;
9460 (*)
9461         ;;
9462 esac
9463 echo "$as_me:9463: result: $LD_RPATH_OPT" >&5
9464 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9465
9466 case "x$LD_RPATH_OPT" in
9467 (x-R*)
9468         echo "$as_me:9468: checking if we need a space after rpath option" >&5
9469 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9470         cf_save_LIBS="$LIBS"
9471
9472 cf_add_libs="${LD_RPATH_OPT}$libdir"
9473 # Filter out duplicates - this happens with badly-designed ".pc" files...
9474 for cf_add_1lib in $LIBS
9475 do
9476         for cf_add_2lib in $cf_add_libs
9477         do
9478                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9479                 then
9480                         cf_add_1lib=
9481                         break
9482                 fi
9483         done
9484         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9485 done
9486 LIBS="$cf_add_libs"
9487
9488         cat >conftest.$ac_ext <<_ACEOF
9489 #line 9489 "configure"
9490 #include "confdefs.h"
9491
9492 int
9493 main (void)
9494 {
9495
9496   ;
9497   return 0;
9498 }
9499 _ACEOF
9500 rm -f conftest.$ac_objext conftest$ac_exeext
9501 if { (eval echo "$as_me:9501: \"$ac_link\"") >&5
9502   (eval $ac_link) 2>&5
9503   ac_status=$?
9504   echo "$as_me:9504: \$? = $ac_status" >&5
9505   (exit $ac_status); } &&
9506          { ac_try='test -s conftest$ac_exeext'
9507   { (eval echo "$as_me:9507: \"$ac_try\"") >&5
9508   (eval $ac_try) 2>&5
9509   ac_status=$?
9510   echo "$as_me:9510: \$? = $ac_status" >&5
9511   (exit $ac_status); }; }; then
9512   cf_rpath_space=no
9513 else
9514   echo "$as_me: failed program was:" >&5
9515 cat conftest.$ac_ext >&5
9516 cf_rpath_space=yes
9517 fi
9518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9519         LIBS="$cf_save_LIBS"
9520         echo "$as_me:9520: result: $cf_rpath_space" >&5
9521 echo "${ECHO_T}$cf_rpath_space" >&6
9522         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9523         ;;
9524 esac
9525
9526         RM_SHARED_OPTS=
9527         LOCAL_LDFLAGS=
9528         LOCAL_LDFLAGS2=
9529         LD_SHARED_OPTS=
9530         INSTALL_LIB="-m 644"
9531         : ${rel_builddir:=.}
9532
9533         shlibdir=$libdir
9534
9535         MAKE_DLLS="#"
9536
9537         cf_cv_do_symlinks=no
9538         cf_ld_rpath_opt=
9539         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9540
9541         echo "$as_me:9541: checking if release/abi version should be used for shared libs" >&5
9542 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9543
9544 # Check whether --with-shlib-version or --without-shlib-version was given.
9545 if test "${with_shlib_version+set}" = set; then
9546   withval="$with_shlib_version"
9547   test -z "$withval" && withval=auto
9548         case $withval in
9549         (yes)
9550                 cf_cv_shlib_version=auto
9551                 ;;
9552         (rel|abi|auto)
9553                 cf_cv_shlib_version=$withval
9554                 ;;
9555         (*)
9556                 echo "$as_me:9556: result: $withval" >&5
9557 echo "${ECHO_T}$withval" >&6
9558                 { { echo "$as_me:9558: error: option value must be one of: rel, abi, or auto" >&5
9559 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9560    { (exit 1); exit 1; }; }
9561                 ;;
9562         esac
9563
9564 else
9565   cf_cv_shlib_version=auto
9566 fi;
9567         echo "$as_me:9567: result: $cf_cv_shlib_version" >&5
9568 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9569
9570         cf_cv_rm_so_locs=no
9571         cf_try_cflags=
9572
9573         # Some less-capable ports of gcc support only -fpic
9574         CC_SHARED_OPTS=
9575
9576         cf_try_fPIC=no
9577         if test "$GCC" = yes
9578         then
9579                 cf_try_fPIC=yes
9580         else
9581                 case $cf_cv_system_name in
9582                 (*linux*)       # e.g., PGI compiler
9583                         cf_try_fPIC=yes
9584                         ;;
9585                 esac
9586         fi
9587
9588         if test "$cf_try_fPIC" = yes
9589         then
9590                 echo "$as_me:9590: checking which $CC option to use" >&5
9591 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9592                 cf_save_CFLAGS="$CFLAGS"
9593                 for CC_SHARED_OPTS in -fPIC -fpic ''
9594                 do
9595                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9596                         cat >conftest.$ac_ext <<_ACEOF
9597 #line 9597 "configure"
9598 #include "confdefs.h"
9599 #include <stdio.h>
9600 int
9601 main (void)
9602 {
9603 int x = 1
9604   ;
9605   return 0;
9606 }
9607 _ACEOF
9608 rm -f conftest.$ac_objext
9609 if { (eval echo "$as_me:9609: \"$ac_compile\"") >&5
9610   (eval $ac_compile) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); } &&
9614          { ac_try='test -s conftest.$ac_objext'
9615   { (eval echo "$as_me:9615: \"$ac_try\"") >&5
9616   (eval $ac_try) 2>&5
9617   ac_status=$?
9618   echo "$as_me:9618: \$? = $ac_status" >&5
9619   (exit $ac_status); }; }; then
9620   break
9621 else
9622   echo "$as_me: failed program was:" >&5
9623 cat conftest.$ac_ext >&5
9624 fi
9625 rm -f conftest.$ac_objext conftest.$ac_ext
9626                 done
9627                 echo "$as_me:9627: result: $CC_SHARED_OPTS" >&5
9628 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9629                 CFLAGS="$cf_save_CFLAGS"
9630         fi
9631
9632         cf_cv_shlib_version_infix=no
9633
9634         case $cf_cv_system_name in
9635         (aix4.3-9*|aix[5-7]*)
9636                 if test "$GCC" = yes; then
9637                         CC_SHARED_OPTS='-Wl,-brtl'
9638                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9639                 else
9640                         CC_SHARED_OPTS='-brtl'
9641                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9642                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9643                 fi
9644                 ;;
9645         (beos*)
9646                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9647                 ;;
9648         (cygwin*)
9649                 CC_SHARED_OPTS=
9650                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9651                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9652                 cf_cv_shlib_version=cygdll
9653                 cf_cv_shlib_version_infix=cygdll
9654                 shlibdir=$bindir
9655                 MAKE_DLLS=
9656                 cat >mk_shared_lib.sh <<-CF_EOF
9657                 #!$SHELL
9658                 SHARED_LIB=\$1
9659                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9660                 shift
9661                 cat <<-EOF
9662                 Linking shared library
9663                 ** SHARED_LIB \$SHARED_LIB
9664                 ** IMPORT_LIB \$IMPORT_LIB
9665 EOF
9666                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9667 CF_EOF
9668                 chmod +x mk_shared_lib.sh
9669                 ;;
9670         (msys*)
9671                 CC_SHARED_OPTS=
9672                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9673                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9674                 cf_cv_shlib_version=msysdll
9675                 cf_cv_shlib_version_infix=msysdll
9676                 shlibdir=$bindir
9677                 MAKE_DLLS=
9678                 cat >mk_shared_lib.sh <<-CF_EOF
9679                 #!$SHELL
9680                 SHARED_LIB=\$1
9681                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9682                 shift
9683                 cat <<-EOF
9684                 Linking shared library
9685                 ** SHARED_LIB \$SHARED_LIB
9686                 ** IMPORT_LIB \$IMPORT_LIB
9687 EOF
9688                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9689 CF_EOF
9690                 chmod +x mk_shared_lib.sh
9691                 ;;
9692         (darwin*)
9693                 cf_try_cflags="no-cpp-precomp"
9694                 CC_SHARED_OPTS="-dynamic"
9695                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9696                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9697                 cf_cv_shlib_version_infix=yes
9698                 echo "$as_me:9698: checking if ld -search_paths_first works" >&5
9699 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9700 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9701   echo $ECHO_N "(cached) $ECHO_C" >&6
9702 else
9703
9704                         cf_save_LDFLAGS=$LDFLAGS
9705                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9706                         cat >conftest.$ac_ext <<_ACEOF
9707 #line 9707 "configure"
9708 #include "confdefs.h"
9709
9710 int
9711 main (void)
9712 {
9713 int i;
9714   ;
9715   return 0;
9716 }
9717 _ACEOF
9718 rm -f conftest.$ac_objext conftest$ac_exeext
9719 if { (eval echo "$as_me:9719: \"$ac_link\"") >&5
9720   (eval $ac_link) 2>&5
9721   ac_status=$?
9722   echo "$as_me:9722: \$? = $ac_status" >&5
9723   (exit $ac_status); } &&
9724          { ac_try='test -s conftest$ac_exeext'
9725   { (eval echo "$as_me:9725: \"$ac_try\"") >&5
9726   (eval $ac_try) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit $ac_status); }; }; then
9730   cf_cv_ldflags_search_paths_first=yes
9731 else
9732   echo "$as_me: failed program was:" >&5
9733 cat conftest.$ac_ext >&5
9734 cf_cv_ldflags_search_paths_first=no
9735 fi
9736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9737                                 LDFLAGS=$cf_save_LDFLAGS
9738 fi
9739 echo "$as_me:9739: result: $cf_cv_ldflags_search_paths_first" >&5
9740 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9741                 if test $cf_cv_ldflags_search_paths_first = yes; then
9742                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9743                 fi
9744                 ;;
9745         (hpux[7-8]*)
9746                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9747                 if test "$GCC" != yes; then
9748                         CC_SHARED_OPTS='+Z'
9749                 fi
9750                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
9751                 INSTALL_LIB="-m 555"
9752                 ;;
9753         (hpux*)
9754                 # (tested with gcc 2.7.2 -- I don't have c89)
9755                 if test "$GCC" = yes; then
9756                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9757                 else
9758                         CC_SHARED_OPTS='+Z'
9759                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9760                 fi
9761                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
9762                 # HP-UX shared libraries must be executable, and should be
9763                 # readonly to exploit a quirk in the memory manager.
9764                 INSTALL_LIB="-m 555"
9765                 ;;
9766         (interix*)
9767                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9768                 if test "$cf_cv_shlib_version" = rel; then
9769                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9770                 else
9771                         cf_shared_soname='`basename $@`'
9772                 fi
9773                 CC_SHARED_OPTS=
9774                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
9775                 ;;
9776         (irix*)
9777                 if test "$cf_cv_enable_rpath" = yes ; then
9778                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9779                 fi
9780                 # tested with IRIX 5.2 and 'cc'.
9781                 if test "$GCC" != yes; then
9782                         CC_SHARED_OPTS='-KPIC'
9783                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
9784                 else
9785                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
9786                 fi
9787                 cf_cv_rm_so_locs=yes
9788                 ;;
9789         (linux*|gnu*|k*bsd*-gnu)
9790                 if test "$DFT_LWR_MODEL" = "shared" ; then
9791                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9792                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9793                 fi
9794                 if test "$cf_cv_enable_rpath" = yes ; then
9795                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9796                 fi
9797
9798         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9799         if test "$cf_cv_shlib_version" = rel; then
9800                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9801         else
9802                 cf_cv_shared_soname='`basename $@`'
9803         fi
9804
9805                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9806                 ;;
9807         (mingw*)
9808                 cf_cv_shlib_version=mingw
9809                 cf_cv_shlib_version_infix=mingw
9810                 shlibdir=$bindir
9811                 MAKE_DLLS=
9812                 if test "$DFT_LWR_MODEL" = "shared" ; then
9813                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9814                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9815                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9816                 fi
9817                 CC_SHARED_OPTS=
9818                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9819                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9820                 cat >mk_shared_lib.sh <<-CF_EOF
9821                 #!$SHELL
9822                 SHARED_LIB=\$1
9823                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9824                 shift
9825                 cat <<-EOF
9826                 Linking shared library
9827                 ** SHARED_LIB \$SHARED_LIB
9828                 ** IMPORT_LIB \$IMPORT_LIB
9829 EOF
9830                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9831 CF_EOF
9832                 chmod +x mk_shared_lib.sh
9833                 ;;
9834         (openbsd[2-9].*|mirbsd*)
9835                 if test "$DFT_LWR_MODEL" = "shared" ; then
9836                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9837                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9838                 fi
9839                 if test "$cf_cv_enable_rpath" = yes ; then
9840                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9841                 fi
9842                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9843
9844         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9845         if test "$cf_cv_shlib_version" = rel; then
9846                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9847         else
9848                 cf_cv_shared_soname='`basename $@`'
9849         fi
9850
9851                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9852                 ;;
9853         (nto-qnx*|openbsd*|freebsd[12].*)
9854                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9855                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
9856                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9857                 ;;
9858         (dragonfly*|freebsd*)
9859                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9860                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9861                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9862                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9863                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9864                 fi
9865
9866         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9867         if test "$cf_cv_shlib_version" = rel; then
9868                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9869         else
9870                 cf_cv_shared_soname='`basename $@`'
9871         fi
9872
9873                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9874                 ;;
9875         (netbsd*)
9876                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9877                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9878                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9879                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9880                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9881                         if test "$cf_cv_shlib_version" = auto; then
9882                         if test -f /usr/libexec/ld.elf_so; then
9883                                 cf_cv_shlib_version=abi
9884                         else
9885                                 cf_cv_shlib_version=rel
9886                         fi
9887                         fi
9888
9889         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9890         if test "$cf_cv_shlib_version" = rel; then
9891                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9892         else
9893                 cf_cv_shared_soname='`basename $@`'
9894         fi
9895
9896                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9897                 else
9898                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
9899                 fi
9900                 ;;
9901         (osf*|mls+*)
9902                 # tested with OSF/1 V3.2 and 'cc'
9903                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9904                 # link with shared libs).
9905                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9906                 case $host_os in
9907                 (osf4*)
9908                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9909                         ;;
9910                 esac
9911                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9912                 if test "$DFT_LWR_MODEL" = "shared" ; then
9913                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9914                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9915                 fi
9916                 cf_cv_rm_so_locs=yes
9917                 ;;
9918         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9919                 # tested with osr5.0.5
9920                 if test "$GCC" != yes; then
9921                         CC_SHARED_OPTS='-belf -KPIC'
9922                 fi
9923                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9924                 if test "$cf_cv_enable_rpath" = yes ; then
9925                         # only way is to set LD_RUN_PATH but no switch for it
9926                         RUN_PATH=$libdir
9927                 fi
9928                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9929                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9930                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9931                 ;;
9932         (sunos4*)
9933                 # tested with SunOS 4.1.1 and gcc 2.7.0
9934                 if test "$GCC" != yes; then
9935                         CC_SHARED_OPTS='-KPIC'
9936                 fi
9937                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
9938                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9939                 ;;
9940         (solaris2*)
9941                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9942                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9943                 if test "$DFT_LWR_MODEL" = "shared" ; then
9944                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9945                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9946                 fi
9947                 if test "$cf_cv_enable_rpath" = yes ; then
9948                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9949                 fi
9950
9951         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9952         if test "$cf_cv_shlib_version" = rel; then
9953                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9954         else
9955                 cf_cv_shared_soname='`basename $@`'
9956         fi
9957
9958                 if test "$GCC" != yes; then
9959                         cf_save_CFLAGS="$CFLAGS"
9960                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9961                         do
9962                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9963                                 cat >conftest.$ac_ext <<_ACEOF
9964 #line 9964 "configure"
9965 #include "confdefs.h"
9966 #include <stdio.h>
9967 int
9968 main (void)
9969 {
9970 printf("Hello\n");
9971   ;
9972   return 0;
9973 }
9974 _ACEOF
9975 rm -f conftest.$ac_objext
9976 if { (eval echo "$as_me:9976: \"$ac_compile\"") >&5
9977   (eval $ac_compile) 2>&5
9978   ac_status=$?
9979   echo "$as_me:9979: \$? = $ac_status" >&5
9980   (exit $ac_status); } &&
9981          { ac_try='test -s conftest.$ac_objext'
9982   { (eval echo "$as_me:9982: \"$ac_try\"") >&5
9983   (eval $ac_try) 2>&5
9984   ac_status=$?
9985   echo "$as_me:9985: \$? = $ac_status" >&5
9986   (exit $ac_status); }; }; then
9987   break
9988 else
9989   echo "$as_me: failed program was:" >&5
9990 cat conftest.$ac_ext >&5
9991 fi
9992 rm -f conftest.$ac_objext conftest.$ac_ext
9993                         done
9994                         CFLAGS="$cf_save_CFLAGS"
9995                         CC_SHARED_OPTS=$cf_shared_opts
9996                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
9997                 else
9998                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9999                 fi
10000                 ;;
10001         (sysv5uw7*|unix_sv*)
10002                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
10003                 if test "$GCC" != yes; then
10004                         CC_SHARED_OPTS='-KPIC'
10005                 fi
10006                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
10007                 ;;
10008         (*)
10009                 CC_SHARED_OPTS='unknown'
10010                 MK_SHARED_LIB='echo unknown'
10011                 ;;
10012         esac
10013
10014         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
10015         case "$cf_cv_shlib_version" in
10016         (rel|abi)
10017                 case "$MK_SHARED_LIB" in
10018                 (*'-o $@')
10019                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
10020                         ;;
10021                 (*)
10022                         { echo "$as_me:10022: WARNING: ignored --with-shlib-version" >&5
10023 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
10024                         ;;
10025                 esac
10026                 ;;
10027         esac
10028
10029         if test -n "$cf_try_cflags"
10030         then
10031 cat > conftest.$ac_ext <<EOF
10032 #line 10032 "${as_me:-configure}"
10033 #include <stdio.h>
10034 int main(int argc, char *argv[])
10035 {
10036         printf("hello\n");
10037         return (argv[argc-1] == 0) ;
10038 }
10039 EOF
10040                 cf_save_CFLAGS="$CFLAGS"
10041                 for cf_opt in $cf_try_cflags
10042                 do
10043                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
10044                         echo "$as_me:10044: checking if CFLAGS option -$cf_opt works" >&5
10045 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
10046                         if { (eval echo "$as_me:10046: \"$ac_compile\"") >&5
10047   (eval $ac_compile) 2>&5
10048   ac_status=$?
10049   echo "$as_me:10049: \$? = $ac_status" >&5
10050   (exit $ac_status); }; then
10051                                 echo "$as_me:10051: result: yes" >&5
10052 echo "${ECHO_T}yes" >&6
10053                                 cf_save_CFLAGS="$CFLAGS"
10054                         else
10055                                 echo "$as_me:10055: result: no" >&5
10056 echo "${ECHO_T}no" >&6
10057                         fi
10058                 done
10059                 CFLAGS="$cf_save_CFLAGS"
10060         fi
10061
10062         # RPATH_LIST is a colon-separated list of directories
10063         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
10064         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
10065
10066         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
10067
10068         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
10069
10070 echo "${as_me:-configure}:10070: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
10071
10072         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
10073
10074 echo "${as_me:-configure}:10074: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
10075
10076 # The test/sample programs in the original tree link using rpath option.
10077 # Make it optional for packagers.
10078 if test -n "$LOCAL_LDFLAGS"
10079 then
10080         echo "$as_me:10080: checking if you want to link sample programs with rpath option" >&5
10081 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
10082
10083 # Check whether --enable-rpath-link or --disable-rpath-link was given.
10084 if test "${enable_rpath_link+set}" = set; then
10085   enableval="$enable_rpath_link"
10086   with_rpath_link=$enableval
10087 else
10088   with_rpath_link=yes
10089 fi;
10090         echo "$as_me:10090: result: $with_rpath_link" >&5
10091 echo "${ECHO_T}$with_rpath_link" >&6
10092         if test "$with_rpath_link" = no
10093         then
10094                 LOCAL_LDFLAGS=
10095                 LOCAL_LDFLAGS2=
10096         fi
10097 fi
10098
10099 ###############################################################################
10100
10101 ###   use option --enable-broken-linker to force on use of broken-linker support
10102 echo "$as_me:10102: checking if you want broken-linker support code" >&5
10103 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
10104
10105 # Check whether --enable-broken_linker or --disable-broken_linker was given.
10106 if test "${enable_broken_linker+set}" = set; then
10107   enableval="$enable_broken_linker"
10108   with_broken_linker=$enableval
10109 else
10110   with_broken_linker=${BROKEN_LINKER:-no}
10111 fi;
10112 echo "$as_me:10112: result: $with_broken_linker" >&5
10113 echo "${ECHO_T}$with_broken_linker" >&6
10114
10115 BROKEN_LINKER=0
10116 if test "$with_broken_linker" = yes ; then
10117         cat >>confdefs.h <<\EOF
10118 #define BROKEN_LINKER 1
10119 EOF
10120
10121         BROKEN_LINKER=1
10122 elif test "$DFT_LWR_MODEL" = shared ; then
10123         case $cf_cv_system_name in
10124         (cygwin*)
10125                 cat >>confdefs.h <<\EOF
10126 #define BROKEN_LINKER 1
10127 EOF
10128
10129                 BROKEN_LINKER=1
10130                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
10131
10132 echo "${as_me:-configure}:10132: testing cygwin linker is broken anyway ..." 1>&5
10133
10134                 ;;
10135         esac
10136 fi
10137
10138 # Check to define _XOPEN_SOURCE "automatically"
10139
10140 cf_XOPEN_SOURCE=500
10141 cf_POSIX_C_SOURCE=199506L
10142 cf_xopen_source=
10143
10144 case $host_os in
10145 (aix[4-7]*)
10146         cf_xopen_source="-D_ALL_SOURCE"
10147         ;;
10148 (msys)
10149         cf_XOPEN_SOURCE=600
10150         ;;
10151 (darwin[0-8].*)
10152         cf_xopen_source="-D_APPLE_C_SOURCE"
10153         ;;
10154 (darwin*)
10155         cf_xopen_source="-D_DARWIN_C_SOURCE"
10156         cf_XOPEN_SOURCE=
10157         ;;
10158 (freebsd*|dragonfly*)
10159         # 5.x headers associate
10160         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10161         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10162         cf_POSIX_C_SOURCE=200112L
10163         cf_XOPEN_SOURCE=600
10164         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10165         ;;
10166 (hpux11*)
10167         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10168         ;;
10169 (hpux*)
10170         cf_xopen_source="-D_HPUX_SOURCE"
10171         ;;
10172 (irix[56].*)
10173         cf_xopen_source="-D_SGI_SOURCE"
10174         cf_XOPEN_SOURCE=
10175         ;;
10176 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10177
10178 echo "$as_me:10178: checking if we must define _GNU_SOURCE" >&5
10179 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
10180 if test "${cf_cv_gnu_source+set}" = set; then
10181   echo $ECHO_N "(cached) $ECHO_C" >&6
10182 else
10183
10184 cat >conftest.$ac_ext <<_ACEOF
10185 #line 10185 "configure"
10186 #include "confdefs.h"
10187 #include <sys/types.h>
10188 int
10189 main (void)
10190 {
10191
10192 #ifndef _XOPEN_SOURCE
10193 make an error
10194 #endif
10195   ;
10196   return 0;
10197 }
10198 _ACEOF
10199 rm -f conftest.$ac_objext
10200 if { (eval echo "$as_me:10200: \"$ac_compile\"") >&5
10201   (eval $ac_compile) 2>&5
10202   ac_status=$?
10203   echo "$as_me:10203: \$? = $ac_status" >&5
10204   (exit $ac_status); } &&
10205          { ac_try='test -s conftest.$ac_objext'
10206   { (eval echo "$as_me:10206: \"$ac_try\"") >&5
10207   (eval $ac_try) 2>&5
10208   ac_status=$?
10209   echo "$as_me:10209: \$? = $ac_status" >&5
10210   (exit $ac_status); }; }; then
10211   cf_cv_gnu_source=no
10212 else
10213   echo "$as_me: failed program was:" >&5
10214 cat conftest.$ac_ext >&5
10215 cf_save="$CPPFLAGS"
10216          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10217          cat >conftest.$ac_ext <<_ACEOF
10218 #line 10218 "configure"
10219 #include "confdefs.h"
10220 #include <sys/types.h>
10221 int
10222 main (void)
10223 {
10224
10225 #ifdef _XOPEN_SOURCE
10226 make an error
10227 #endif
10228   ;
10229   return 0;
10230 }
10231 _ACEOF
10232 rm -f conftest.$ac_objext
10233 if { (eval echo "$as_me:10233: \"$ac_compile\"") >&5
10234   (eval $ac_compile) 2>&5
10235   ac_status=$?
10236   echo "$as_me:10236: \$? = $ac_status" >&5
10237   (exit $ac_status); } &&
10238          { ac_try='test -s conftest.$ac_objext'
10239   { (eval echo "$as_me:10239: \"$ac_try\"") >&5
10240   (eval $ac_try) 2>&5
10241   ac_status=$?
10242   echo "$as_me:10242: \$? = $ac_status" >&5
10243   (exit $ac_status); }; }; then
10244   cf_cv_gnu_source=no
10245 else
10246   echo "$as_me: failed program was:" >&5
10247 cat conftest.$ac_ext >&5
10248 cf_cv_gnu_source=yes
10249 fi
10250 rm -f conftest.$ac_objext conftest.$ac_ext
10251         CPPFLAGS="$cf_save"
10252
10253 fi
10254 rm -f conftest.$ac_objext conftest.$ac_ext
10255
10256 fi
10257 echo "$as_me:10257: result: $cf_cv_gnu_source" >&5
10258 echo "${ECHO_T}$cf_cv_gnu_source" >&6
10259
10260 if test "$cf_cv_gnu_source" = yes
10261 then
10262 echo "$as_me:10262: checking if we should also define _DEFAULT_SOURCE" >&5
10263 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
10264 if test "${cf_cv_default_source+set}" = set; then
10265   echo $ECHO_N "(cached) $ECHO_C" >&6
10266 else
10267
10268 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10269         cat >conftest.$ac_ext <<_ACEOF
10270 #line 10270 "configure"
10271 #include "confdefs.h"
10272 #include <sys/types.h>
10273 int
10274 main (void)
10275 {
10276
10277 #ifdef _DEFAULT_SOURCE
10278 make an error
10279 #endif
10280   ;
10281   return 0;
10282 }
10283 _ACEOF
10284 rm -f conftest.$ac_objext
10285 if { (eval echo "$as_me:10285: \"$ac_compile\"") >&5
10286   (eval $ac_compile) 2>&5
10287   ac_status=$?
10288   echo "$as_me:10288: \$? = $ac_status" >&5
10289   (exit $ac_status); } &&
10290          { ac_try='test -s conftest.$ac_objext'
10291   { (eval echo "$as_me:10291: \"$ac_try\"") >&5
10292   (eval $ac_try) 2>&5
10293   ac_status=$?
10294   echo "$as_me:10294: \$? = $ac_status" >&5
10295   (exit $ac_status); }; }; then
10296   cf_cv_default_source=no
10297 else
10298   echo "$as_me: failed program was:" >&5
10299 cat conftest.$ac_ext >&5
10300 cf_cv_default_source=yes
10301 fi
10302 rm -f conftest.$ac_objext conftest.$ac_ext
10303
10304 fi
10305 echo "$as_me:10305: result: $cf_cv_default_source" >&5
10306 echo "${ECHO_T}$cf_cv_default_source" >&6
10307 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
10308 fi
10309
10310         ;;
10311 (minix*)
10312         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
10313         ;;
10314 (mirbsd*)
10315         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
10316         cf_XOPEN_SOURCE=
10317
10318 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10319
10320 cf_save_CFLAGS="$CFLAGS"
10321 cf_save_CPPFLAGS="$CPPFLAGS"
10322
10323 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10324         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10325                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10326
10327 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10328         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10329                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10330
10331 echo "$as_me:10331: checking if we should define _POSIX_C_SOURCE" >&5
10332 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10333 if test "${cf_cv_posix_c_source+set}" = set; then
10334   echo $ECHO_N "(cached) $ECHO_C" >&6
10335 else
10336
10337 echo "${as_me:-configure}:10337: testing if the symbol is already defined go no further ..." 1>&5
10338
10339         cat >conftest.$ac_ext <<_ACEOF
10340 #line 10340 "configure"
10341 #include "confdefs.h"
10342 #include <sys/types.h>
10343 int
10344 main (void)
10345 {
10346
10347 #ifndef _POSIX_C_SOURCE
10348 make an error
10349 #endif
10350   ;
10351   return 0;
10352 }
10353 _ACEOF
10354 rm -f conftest.$ac_objext
10355 if { (eval echo "$as_me:10355: \"$ac_compile\"") >&5
10356   (eval $ac_compile) 2>&5
10357   ac_status=$?
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); } &&
10360          { ac_try='test -s conftest.$ac_objext'
10361   { (eval echo "$as_me:10361: \"$ac_try\"") >&5
10362   (eval $ac_try) 2>&5
10363   ac_status=$?
10364   echo "$as_me:10364: \$? = $ac_status" >&5
10365   (exit $ac_status); }; }; then
10366   cf_cv_posix_c_source=no
10367 else
10368   echo "$as_me: failed program was:" >&5
10369 cat conftest.$ac_ext >&5
10370 cf_want_posix_source=no
10371          case .$cf_POSIX_C_SOURCE in
10372          (.[12]??*)
10373                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10374                 ;;
10375          (.2)
10376                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10377                 cf_want_posix_source=yes
10378                 ;;
10379          (.*)
10380                 cf_want_posix_source=yes
10381                 ;;
10382          esac
10383          if test "$cf_want_posix_source" = yes ; then
10384                 cat >conftest.$ac_ext <<_ACEOF
10385 #line 10385 "configure"
10386 #include "confdefs.h"
10387 #include <sys/types.h>
10388 int
10389 main (void)
10390 {
10391
10392 #ifdef _POSIX_SOURCE
10393 make an error
10394 #endif
10395   ;
10396   return 0;
10397 }
10398 _ACEOF
10399 rm -f conftest.$ac_objext
10400 if { (eval echo "$as_me:10400: \"$ac_compile\"") >&5
10401   (eval $ac_compile) 2>&5
10402   ac_status=$?
10403   echo "$as_me:10403: \$? = $ac_status" >&5
10404   (exit $ac_status); } &&
10405          { ac_try='test -s conftest.$ac_objext'
10406   { (eval echo "$as_me:10406: \"$ac_try\"") >&5
10407   (eval $ac_try) 2>&5
10408   ac_status=$?
10409   echo "$as_me:10409: \$? = $ac_status" >&5
10410   (exit $ac_status); }; }; then
10411   :
10412 else
10413   echo "$as_me: failed program was:" >&5
10414 cat conftest.$ac_ext >&5
10415 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10416 fi
10417 rm -f conftest.$ac_objext conftest.$ac_ext
10418          fi
10419
10420 echo "${as_me:-configure}:10420: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10421
10422          CFLAGS="$cf_trim_CFLAGS"
10423          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10424
10425 echo "${as_me:-configure}:10425: testing if the second compile does not leave our definition intact error ..." 1>&5
10426
10427          cat >conftest.$ac_ext <<_ACEOF
10428 #line 10428 "configure"
10429 #include "confdefs.h"
10430 #include <sys/types.h>
10431 int
10432 main (void)
10433 {
10434
10435 #ifndef _POSIX_C_SOURCE
10436 make an error
10437 #endif
10438   ;
10439   return 0;
10440 }
10441 _ACEOF
10442 rm -f conftest.$ac_objext
10443 if { (eval echo "$as_me:10443: \"$ac_compile\"") >&5
10444   (eval $ac_compile) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); } &&
10448          { ac_try='test -s conftest.$ac_objext'
10449   { (eval echo "$as_me:10449: \"$ac_try\"") >&5
10450   (eval $ac_try) 2>&5
10451   ac_status=$?
10452   echo "$as_me:10452: \$? = $ac_status" >&5
10453   (exit $ac_status); }; }; then
10454   :
10455 else
10456   echo "$as_me: failed program was:" >&5
10457 cat conftest.$ac_ext >&5
10458 cf_cv_posix_c_source=no
10459 fi
10460 rm -f conftest.$ac_objext conftest.$ac_ext
10461          CFLAGS="$cf_save_CFLAGS"
10462          CPPFLAGS="$cf_save_CPPFLAGS"
10463
10464 fi
10465 rm -f conftest.$ac_objext conftest.$ac_ext
10466
10467 fi
10468 echo "$as_me:10468: result: $cf_cv_posix_c_source" >&5
10469 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10470
10471 if test "$cf_cv_posix_c_source" != no ; then
10472         CFLAGS="$cf_trim_CFLAGS"
10473         CPPFLAGS="$cf_trim_CPPFLAGS"
10474
10475 cf_fix_cppflags=no
10476 cf_new_cflags=
10477 cf_new_cppflags=
10478 cf_new_extra_cppflags=
10479
10480 for cf_add_cflags in $cf_cv_posix_c_source
10481 do
10482 case $cf_fix_cppflags in
10483 (no)
10484         case $cf_add_cflags in
10485         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10486                 case $cf_add_cflags in
10487                 (-D*)
10488                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10489
10490                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10491                                 && test -z "${cf_tst_cflags}" \
10492                                 && cf_fix_cppflags=yes
10493
10494                         if test $cf_fix_cppflags = yes ; then
10495
10496         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10497         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10498
10499                                 continue
10500                         elif test "${cf_tst_cflags}" = "\"'" ; then
10501
10502         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10503         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10504
10505                                 continue
10506                         fi
10507                         ;;
10508                 esac
10509                 case "$CPPFLAGS" in
10510                 (*$cf_add_cflags)
10511                         ;;
10512                 (*)
10513                         case $cf_add_cflags in
10514                         (-D*)
10515                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10516
10517 CPPFLAGS=`echo "$CPPFLAGS" | \
10518         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10519                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10520
10521                                 ;;
10522                         esac
10523
10524         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10525         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10526
10527                         ;;
10528                 esac
10529                 ;;
10530         (*)
10531
10532         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10533         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10534
10535                 ;;
10536         esac
10537         ;;
10538 (yes)
10539
10540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10542
10543         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10544
10545         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10546                 && test -z "${cf_tst_cflags}" \
10547                 && cf_fix_cppflags=no
10548         ;;
10549 esac
10550 done
10551
10552 if test -n "$cf_new_cflags" ; then
10553
10554         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10555         CFLAGS="${CFLAGS}$cf_new_cflags"
10556
10557 fi
10558
10559 if test -n "$cf_new_cppflags" ; then
10560
10561         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10562         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10563
10564 fi
10565
10566 if test -n "$cf_new_extra_cppflags" ; then
10567
10568         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10569         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10570
10571 fi
10572
10573 fi
10574
10575         ;;
10576 (netbsd*)
10577         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10578         ;;
10579 (openbsd[4-9]*)
10580         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10581         cf_xopen_source="-D_BSD_SOURCE"
10582         cf_XOPEN_SOURCE=600
10583         ;;
10584 (openbsd*)
10585         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10586         ;;
10587 (osf[45]*)
10588         cf_xopen_source="-D_OSF_SOURCE"
10589         ;;
10590 (nto-qnx*)
10591         cf_xopen_source="-D_QNX_SOURCE"
10592         ;;
10593 (sco*)
10594         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10595         ;;
10596 (solaris2.*)
10597         cf_xopen_source="-D__EXTENSIONS__"
10598         cf_cv_xopen_source=broken
10599         ;;
10600 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10601         cf_XOPEN_SOURCE=
10602         cf_POSIX_C_SOURCE=
10603         ;;
10604 (*)
10605
10606 echo "$as_me:10606: checking if we should define _XOPEN_SOURCE" >&5
10607 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10608 if test "${cf_cv_xopen_source+set}" = set; then
10609   echo $ECHO_N "(cached) $ECHO_C" >&6
10610 else
10611
10612         cat >conftest.$ac_ext <<_ACEOF
10613 #line 10613 "configure"
10614 #include "confdefs.h"
10615
10616 #include <stdlib.h>
10617 #include <string.h>
10618 #include <sys/types.h>
10619
10620 int
10621 main (void)
10622 {
10623
10624 #ifndef _XOPEN_SOURCE
10625 make an error
10626 #endif
10627   ;
10628   return 0;
10629 }
10630 _ACEOF
10631 rm -f conftest.$ac_objext
10632 if { (eval echo "$as_me:10632: \"$ac_compile\"") >&5
10633   (eval $ac_compile) 2>&5
10634   ac_status=$?
10635   echo "$as_me:10635: \$? = $ac_status" >&5
10636   (exit $ac_status); } &&
10637          { ac_try='test -s conftest.$ac_objext'
10638   { (eval echo "$as_me:10638: \"$ac_try\"") >&5
10639   (eval $ac_try) 2>&5
10640   ac_status=$?
10641   echo "$as_me:10641: \$? = $ac_status" >&5
10642   (exit $ac_status); }; }; then
10643   cf_cv_xopen_source=no
10644 else
10645   echo "$as_me: failed program was:" >&5
10646 cat conftest.$ac_ext >&5
10647 cf_save="$CPPFLAGS"
10648          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10649          cat >conftest.$ac_ext <<_ACEOF
10650 #line 10650 "configure"
10651 #include "confdefs.h"
10652
10653 #include <stdlib.h>
10654 #include <string.h>
10655 #include <sys/types.h>
10656
10657 int
10658 main (void)
10659 {
10660
10661 #ifdef _XOPEN_SOURCE
10662 make an error
10663 #endif
10664   ;
10665   return 0;
10666 }
10667 _ACEOF
10668 rm -f conftest.$ac_objext
10669 if { (eval echo "$as_me:10669: \"$ac_compile\"") >&5
10670   (eval $ac_compile) 2>&5
10671   ac_status=$?
10672   echo "$as_me:10672: \$? = $ac_status" >&5
10673   (exit $ac_status); } &&
10674          { ac_try='test -s conftest.$ac_objext'
10675   { (eval echo "$as_me:10675: \"$ac_try\"") >&5
10676   (eval $ac_try) 2>&5
10677   ac_status=$?
10678   echo "$as_me:10678: \$? = $ac_status" >&5
10679   (exit $ac_status); }; }; then
10680   cf_cv_xopen_source=no
10681 else
10682   echo "$as_me: failed program was:" >&5
10683 cat conftest.$ac_ext >&5
10684 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10685 fi
10686 rm -f conftest.$ac_objext conftest.$ac_ext
10687         CPPFLAGS="$cf_save"
10688
10689 fi
10690 rm -f conftest.$ac_objext conftest.$ac_ext
10691
10692 fi
10693 echo "$as_me:10693: result: $cf_cv_xopen_source" >&5
10694 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10695
10696 if test "$cf_cv_xopen_source" != no ; then
10697
10698 CFLAGS=`echo "$CFLAGS" | \
10699         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10700                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10701
10702 CPPFLAGS=`echo "$CPPFLAGS" | \
10703         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10704                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10705
10706         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10707
10708 cf_fix_cppflags=no
10709 cf_new_cflags=
10710 cf_new_cppflags=
10711 cf_new_extra_cppflags=
10712
10713 for cf_add_cflags in $cf_temp_xopen_source
10714 do
10715 case $cf_fix_cppflags in
10716 (no)
10717         case $cf_add_cflags in
10718         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10719                 case $cf_add_cflags in
10720                 (-D*)
10721                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10722
10723                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10724                                 && test -z "${cf_tst_cflags}" \
10725                                 && cf_fix_cppflags=yes
10726
10727                         if test $cf_fix_cppflags = yes ; then
10728
10729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10731
10732                                 continue
10733                         elif test "${cf_tst_cflags}" = "\"'" ; then
10734
10735         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10736         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10737
10738                                 continue
10739                         fi
10740                         ;;
10741                 esac
10742                 case "$CPPFLAGS" in
10743                 (*$cf_add_cflags)
10744                         ;;
10745                 (*)
10746                         case $cf_add_cflags in
10747                         (-D*)
10748                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10749
10750 CPPFLAGS=`echo "$CPPFLAGS" | \
10751         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10752                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10753
10754                                 ;;
10755                         esac
10756
10757         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10758         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10759
10760                         ;;
10761                 esac
10762                 ;;
10763         (*)
10764
10765         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10766         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10767
10768                 ;;
10769         esac
10770         ;;
10771 (yes)
10772
10773         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10774         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10775
10776         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10777
10778         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10779                 && test -z "${cf_tst_cflags}" \
10780                 && cf_fix_cppflags=no
10781         ;;
10782 esac
10783 done
10784
10785 if test -n "$cf_new_cflags" ; then
10786
10787         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10788         CFLAGS="${CFLAGS}$cf_new_cflags"
10789
10790 fi
10791
10792 if test -n "$cf_new_cppflags" ; then
10793
10794         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10795         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10796
10797 fi
10798
10799 if test -n "$cf_new_extra_cppflags" ; then
10800
10801         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10802         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10803
10804 fi
10805
10806 fi
10807
10808 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10809
10810 cf_save_CFLAGS="$CFLAGS"
10811 cf_save_CPPFLAGS="$CPPFLAGS"
10812
10813 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10814         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10815                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10816
10817 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10818         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10819                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10820
10821 echo "$as_me:10821: checking if we should define _POSIX_C_SOURCE" >&5
10822 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10823 if test "${cf_cv_posix_c_source+set}" = set; then
10824   echo $ECHO_N "(cached) $ECHO_C" >&6
10825 else
10826
10827 echo "${as_me:-configure}:10827: testing if the symbol is already defined go no further ..." 1>&5
10828
10829         cat >conftest.$ac_ext <<_ACEOF
10830 #line 10830 "configure"
10831 #include "confdefs.h"
10832 #include <sys/types.h>
10833 int
10834 main (void)
10835 {
10836
10837 #ifndef _POSIX_C_SOURCE
10838 make an error
10839 #endif
10840   ;
10841   return 0;
10842 }
10843 _ACEOF
10844 rm -f conftest.$ac_objext
10845 if { (eval echo "$as_me:10845: \"$ac_compile\"") >&5
10846   (eval $ac_compile) 2>&5
10847   ac_status=$?
10848   echo "$as_me:10848: \$? = $ac_status" >&5
10849   (exit $ac_status); } &&
10850          { ac_try='test -s conftest.$ac_objext'
10851   { (eval echo "$as_me:10851: \"$ac_try\"") >&5
10852   (eval $ac_try) 2>&5
10853   ac_status=$?
10854   echo "$as_me:10854: \$? = $ac_status" >&5
10855   (exit $ac_status); }; }; then
10856   cf_cv_posix_c_source=no
10857 else
10858   echo "$as_me: failed program was:" >&5
10859 cat conftest.$ac_ext >&5
10860 cf_want_posix_source=no
10861          case .$cf_POSIX_C_SOURCE in
10862          (.[12]??*)
10863                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10864                 ;;
10865          (.2)
10866                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10867                 cf_want_posix_source=yes
10868                 ;;
10869          (.*)
10870                 cf_want_posix_source=yes
10871                 ;;
10872          esac
10873          if test "$cf_want_posix_source" = yes ; then
10874                 cat >conftest.$ac_ext <<_ACEOF
10875 #line 10875 "configure"
10876 #include "confdefs.h"
10877 #include <sys/types.h>
10878 int
10879 main (void)
10880 {
10881
10882 #ifdef _POSIX_SOURCE
10883 make an error
10884 #endif
10885   ;
10886   return 0;
10887 }
10888 _ACEOF
10889 rm -f conftest.$ac_objext
10890 if { (eval echo "$as_me:10890: \"$ac_compile\"") >&5
10891   (eval $ac_compile) 2>&5
10892   ac_status=$?
10893   echo "$as_me:10893: \$? = $ac_status" >&5
10894   (exit $ac_status); } &&
10895          { ac_try='test -s conftest.$ac_objext'
10896   { (eval echo "$as_me:10896: \"$ac_try\"") >&5
10897   (eval $ac_try) 2>&5
10898   ac_status=$?
10899   echo "$as_me:10899: \$? = $ac_status" >&5
10900   (exit $ac_status); }; }; then
10901   :
10902 else
10903   echo "$as_me: failed program was:" >&5
10904 cat conftest.$ac_ext >&5
10905 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10906 fi
10907 rm -f conftest.$ac_objext conftest.$ac_ext
10908          fi
10909
10910 echo "${as_me:-configure}:10910: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10911
10912          CFLAGS="$cf_trim_CFLAGS"
10913          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10914
10915 echo "${as_me:-configure}:10915: testing if the second compile does not leave our definition intact error ..." 1>&5
10916
10917          cat >conftest.$ac_ext <<_ACEOF
10918 #line 10918 "configure"
10919 #include "confdefs.h"
10920 #include <sys/types.h>
10921 int
10922 main (void)
10923 {
10924
10925 #ifndef _POSIX_C_SOURCE
10926 make an error
10927 #endif
10928   ;
10929   return 0;
10930 }
10931 _ACEOF
10932 rm -f conftest.$ac_objext
10933 if { (eval echo "$as_me:10933: \"$ac_compile\"") >&5
10934   (eval $ac_compile) 2>&5
10935   ac_status=$?
10936   echo "$as_me:10936: \$? = $ac_status" >&5
10937   (exit $ac_status); } &&
10938          { ac_try='test -s conftest.$ac_objext'
10939   { (eval echo "$as_me:10939: \"$ac_try\"") >&5
10940   (eval $ac_try) 2>&5
10941   ac_status=$?
10942   echo "$as_me:10942: \$? = $ac_status" >&5
10943   (exit $ac_status); }; }; then
10944   :
10945 else
10946   echo "$as_me: failed program was:" >&5
10947 cat conftest.$ac_ext >&5
10948 cf_cv_posix_c_source=no
10949 fi
10950 rm -f conftest.$ac_objext conftest.$ac_ext
10951          CFLAGS="$cf_save_CFLAGS"
10952          CPPFLAGS="$cf_save_CPPFLAGS"
10953
10954 fi
10955 rm -f conftest.$ac_objext conftest.$ac_ext
10956
10957 fi
10958 echo "$as_me:10958: result: $cf_cv_posix_c_source" >&5
10959 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10960
10961 if test "$cf_cv_posix_c_source" != no ; then
10962         CFLAGS="$cf_trim_CFLAGS"
10963         CPPFLAGS="$cf_trim_CPPFLAGS"
10964
10965 cf_fix_cppflags=no
10966 cf_new_cflags=
10967 cf_new_cppflags=
10968 cf_new_extra_cppflags=
10969
10970 for cf_add_cflags in $cf_cv_posix_c_source
10971 do
10972 case $cf_fix_cppflags in
10973 (no)
10974         case $cf_add_cflags in
10975         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10976                 case $cf_add_cflags in
10977                 (-D*)
10978                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10979
10980                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10981                                 && test -z "${cf_tst_cflags}" \
10982                                 && cf_fix_cppflags=yes
10983
10984                         if test $cf_fix_cppflags = yes ; then
10985
10986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10988
10989                                 continue
10990                         elif test "${cf_tst_cflags}" = "\"'" ; then
10991
10992         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10993         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10994
10995                                 continue
10996                         fi
10997                         ;;
10998                 esac
10999                 case "$CPPFLAGS" in
11000                 (*$cf_add_cflags)
11001                         ;;
11002                 (*)
11003                         case $cf_add_cflags in
11004                         (-D*)
11005                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11006
11007 CPPFLAGS=`echo "$CPPFLAGS" | \
11008         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11009                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11010
11011                                 ;;
11012                         esac
11013
11014         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11015         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11016
11017                         ;;
11018                 esac
11019                 ;;
11020         (*)
11021
11022         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11023         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11024
11025                 ;;
11026         esac
11027         ;;
11028 (yes)
11029
11030         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11031         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11032
11033         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11034
11035         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11036                 && test -z "${cf_tst_cflags}" \
11037                 && cf_fix_cppflags=no
11038         ;;
11039 esac
11040 done
11041
11042 if test -n "$cf_new_cflags" ; then
11043
11044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11045         CFLAGS="${CFLAGS}$cf_new_cflags"
11046
11047 fi
11048
11049 if test -n "$cf_new_cppflags" ; then
11050
11051         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11052         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11053
11054 fi
11055
11056 if test -n "$cf_new_extra_cppflags" ; then
11057
11058         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11059         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11060
11061 fi
11062
11063 fi
11064
11065         ;;
11066 esac
11067
11068 if test -n "$cf_xopen_source" ; then
11069
11070 cf_fix_cppflags=no
11071 cf_new_cflags=
11072 cf_new_cppflags=
11073 cf_new_extra_cppflags=
11074
11075 for cf_add_cflags in $cf_xopen_source
11076 do
11077 case $cf_fix_cppflags in
11078 (no)
11079         case $cf_add_cflags in
11080         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11081                 case $cf_add_cflags in
11082                 (-D*)
11083                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11084
11085                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11086                                 && test -z "${cf_tst_cflags}" \
11087                                 && cf_fix_cppflags=yes
11088
11089                         if test $cf_fix_cppflags = yes ; then
11090
11091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11093
11094                                 continue
11095                         elif test "${cf_tst_cflags}" = "\"'" ; then
11096
11097         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11098         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11099
11100                                 continue
11101                         fi
11102                         ;;
11103                 esac
11104                 case "$CPPFLAGS" in
11105                 (*$cf_add_cflags)
11106                         ;;
11107                 (*)
11108                         case $cf_add_cflags in
11109                         (-D*)
11110                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11111
11112 CPPFLAGS=`echo "$CPPFLAGS" | \
11113         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11114                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11115
11116                                 ;;
11117                         esac
11118
11119         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11120         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11121
11122                         ;;
11123                 esac
11124                 ;;
11125         (*)
11126
11127         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11128         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11129
11130                 ;;
11131         esac
11132         ;;
11133 (yes)
11134
11135         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11136         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11137
11138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11139
11140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11141                 && test -z "${cf_tst_cflags}" \
11142                 && cf_fix_cppflags=no
11143         ;;
11144 esac
11145 done
11146
11147 if test -n "$cf_new_cflags" ; then
11148         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11149
11150 echo "${as_me:-configure}:11150: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11151
11152         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11153         CFLAGS="${CFLAGS}$cf_new_cflags"
11154
11155 fi
11156
11157 if test -n "$cf_new_cppflags" ; then
11158         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11159
11160 echo "${as_me:-configure}:11160: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11161
11162         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11163         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11164
11165 fi
11166
11167 if test -n "$cf_new_extra_cppflags" ; then
11168         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11169
11170 echo "${as_me:-configure}:11170: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11171
11172         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11173         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11174
11175 fi
11176
11177 fi
11178
11179 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
11180         echo "$as_me:11180: checking if _XOPEN_SOURCE really is set" >&5
11181 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
11182         cat >conftest.$ac_ext <<_ACEOF
11183 #line 11183 "configure"
11184 #include "confdefs.h"
11185 #include <stdlib.h>
11186 int
11187 main (void)
11188 {
11189
11190 #ifndef _XOPEN_SOURCE
11191 make an error
11192 #endif
11193   ;
11194   return 0;
11195 }
11196 _ACEOF
11197 rm -f conftest.$ac_objext
11198 if { (eval echo "$as_me:11198: \"$ac_compile\"") >&5
11199   (eval $ac_compile) 2>&5
11200   ac_status=$?
11201   echo "$as_me:11201: \$? = $ac_status" >&5
11202   (exit $ac_status); } &&
11203          { ac_try='test -s conftest.$ac_objext'
11204   { (eval echo "$as_me:11204: \"$ac_try\"") >&5
11205   (eval $ac_try) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); }; }; then
11209   cf_XOPEN_SOURCE_set=yes
11210 else
11211   echo "$as_me: failed program was:" >&5
11212 cat conftest.$ac_ext >&5
11213 cf_XOPEN_SOURCE_set=no
11214 fi
11215 rm -f conftest.$ac_objext conftest.$ac_ext
11216         echo "$as_me:11216: result: $cf_XOPEN_SOURCE_set" >&5
11217 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
11218         if test $cf_XOPEN_SOURCE_set = yes
11219         then
11220                 cat >conftest.$ac_ext <<_ACEOF
11221 #line 11221 "configure"
11222 #include "confdefs.h"
11223 #include <stdlib.h>
11224 int
11225 main (void)
11226 {
11227
11228 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
11229 make an error
11230 #endif
11231   ;
11232   return 0;
11233 }
11234 _ACEOF
11235 rm -f conftest.$ac_objext
11236 if { (eval echo "$as_me:11236: \"$ac_compile\"") >&5
11237   (eval $ac_compile) 2>&5
11238   ac_status=$?
11239   echo "$as_me:11239: \$? = $ac_status" >&5
11240   (exit $ac_status); } &&
11241          { ac_try='test -s conftest.$ac_objext'
11242   { (eval echo "$as_me:11242: \"$ac_try\"") >&5
11243   (eval $ac_try) 2>&5
11244   ac_status=$?
11245   echo "$as_me:11245: \$? = $ac_status" >&5
11246   (exit $ac_status); }; }; then
11247   cf_XOPEN_SOURCE_set_ok=yes
11248 else
11249   echo "$as_me: failed program was:" >&5
11250 cat conftest.$ac_ext >&5
11251 cf_XOPEN_SOURCE_set_ok=no
11252 fi
11253 rm -f conftest.$ac_objext conftest.$ac_ext
11254                 if test $cf_XOPEN_SOURCE_set_ok = no
11255                 then
11256                         { echo "$as_me:11256: WARNING: _XOPEN_SOURCE is lower than requested" >&5
11257 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
11258                 fi
11259         else
11260
11261 echo "$as_me:11261: checking if we should define _XOPEN_SOURCE" >&5
11262 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11263 if test "${cf_cv_xopen_source+set}" = set; then
11264   echo $ECHO_N "(cached) $ECHO_C" >&6
11265 else
11266
11267         cat >conftest.$ac_ext <<_ACEOF
11268 #line 11268 "configure"
11269 #include "confdefs.h"
11270
11271 #include <stdlib.h>
11272 #include <string.h>
11273 #include <sys/types.h>
11274
11275 int
11276 main (void)
11277 {
11278
11279 #ifndef _XOPEN_SOURCE
11280 make an error
11281 #endif
11282   ;
11283   return 0;
11284 }
11285 _ACEOF
11286 rm -f conftest.$ac_objext
11287 if { (eval echo "$as_me:11287: \"$ac_compile\"") >&5
11288   (eval $ac_compile) 2>&5
11289   ac_status=$?
11290   echo "$as_me:11290: \$? = $ac_status" >&5
11291   (exit $ac_status); } &&
11292          { ac_try='test -s conftest.$ac_objext'
11293   { (eval echo "$as_me:11293: \"$ac_try\"") >&5
11294   (eval $ac_try) 2>&5
11295   ac_status=$?
11296   echo "$as_me:11296: \$? = $ac_status" >&5
11297   (exit $ac_status); }; }; then
11298   cf_cv_xopen_source=no
11299 else
11300   echo "$as_me: failed program was:" >&5
11301 cat conftest.$ac_ext >&5
11302 cf_save="$CPPFLAGS"
11303          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11304          cat >conftest.$ac_ext <<_ACEOF
11305 #line 11305 "configure"
11306 #include "confdefs.h"
11307
11308 #include <stdlib.h>
11309 #include <string.h>
11310 #include <sys/types.h>
11311
11312 int
11313 main (void)
11314 {
11315
11316 #ifdef _XOPEN_SOURCE
11317 make an error
11318 #endif
11319   ;
11320   return 0;
11321 }
11322 _ACEOF
11323 rm -f conftest.$ac_objext
11324 if { (eval echo "$as_me:11324: \"$ac_compile\"") >&5
11325   (eval $ac_compile) 2>&5
11326   ac_status=$?
11327   echo "$as_me:11327: \$? = $ac_status" >&5
11328   (exit $ac_status); } &&
11329          { ac_try='test -s conftest.$ac_objext'
11330   { (eval echo "$as_me:11330: \"$ac_try\"") >&5
11331   (eval $ac_try) 2>&5
11332   ac_status=$?
11333   echo "$as_me:11333: \$? = $ac_status" >&5
11334   (exit $ac_status); }; }; then
11335   cf_cv_xopen_source=no
11336 else
11337   echo "$as_me: failed program was:" >&5
11338 cat conftest.$ac_ext >&5
11339 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11340 fi
11341 rm -f conftest.$ac_objext conftest.$ac_ext
11342         CPPFLAGS="$cf_save"
11343
11344 fi
11345 rm -f conftest.$ac_objext conftest.$ac_ext
11346
11347 fi
11348 echo "$as_me:11348: result: $cf_cv_xopen_source" >&5
11349 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11350
11351 if test "$cf_cv_xopen_source" != no ; then
11352
11353 CFLAGS=`echo "$CFLAGS" | \
11354         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11355                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11356
11357 CPPFLAGS=`echo "$CPPFLAGS" | \
11358         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11359                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11360
11361         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11362
11363 cf_fix_cppflags=no
11364 cf_new_cflags=
11365 cf_new_cppflags=
11366 cf_new_extra_cppflags=
11367
11368 for cf_add_cflags in $cf_temp_xopen_source
11369 do
11370 case $cf_fix_cppflags in
11371 (no)
11372         case $cf_add_cflags in
11373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11374                 case $cf_add_cflags in
11375                 (-D*)
11376                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11377
11378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11379                                 && test -z "${cf_tst_cflags}" \
11380                                 && cf_fix_cppflags=yes
11381
11382                         if test $cf_fix_cppflags = yes ; then
11383
11384         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11385         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11386
11387                                 continue
11388                         elif test "${cf_tst_cflags}" = "\"'" ; then
11389
11390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11392
11393                                 continue
11394                         fi
11395                         ;;
11396                 esac
11397                 case "$CPPFLAGS" in
11398                 (*$cf_add_cflags)
11399                         ;;
11400                 (*)
11401                         case $cf_add_cflags in
11402                         (-D*)
11403                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11404
11405 CPPFLAGS=`echo "$CPPFLAGS" | \
11406         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11407                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11408
11409                                 ;;
11410                         esac
11411
11412         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11413         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11414
11415                         ;;
11416                 esac
11417                 ;;
11418         (*)
11419
11420         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11421         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11422
11423                 ;;
11424         esac
11425         ;;
11426 (yes)
11427
11428         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11429         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11430
11431         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11432
11433         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11434                 && test -z "${cf_tst_cflags}" \
11435                 && cf_fix_cppflags=no
11436         ;;
11437 esac
11438 done
11439
11440 if test -n "$cf_new_cflags" ; then
11441
11442         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11443         CFLAGS="${CFLAGS}$cf_new_cflags"
11444
11445 fi
11446
11447 if test -n "$cf_new_cppflags" ; then
11448
11449         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11450         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11451
11452 fi
11453
11454 if test -n "$cf_new_extra_cppflags" ; then
11455
11456         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11457         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11458
11459 fi
11460
11461 fi
11462
11463         fi
11464 fi
11465
11466 # Check whether --enable-largefile or --disable-largefile was given.
11467 if test "${enable_largefile+set}" = set; then
11468   enableval="$enable_largefile"
11469
11470 fi;
11471 if test "$enable_largefile" != no; then
11472
11473   echo "$as_me:11473: checking for special C compiler options needed for large files" >&5
11474 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
11475 if test "${ac_cv_sys_largefile_CC+set}" = set; then
11476   echo $ECHO_N "(cached) $ECHO_C" >&6
11477 else
11478   ac_cv_sys_largefile_CC=no
11479      if test "$GCC" != yes; then
11480        ac_save_CC=$CC
11481        while :; do
11482          # IRIX 6.2 and later do not support large files by default,
11483          # so use the C compiler's -n32 option if that helps.
11484          cat >conftest.$ac_ext <<_ACEOF
11485 #line 11485 "configure"
11486 #include "confdefs.h"
11487 #include <sys/types.h>
11488  /* Check that off_t can represent 2**63 - 1 correctly.
11489     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11490     since some C++ compilers masquerading as C compilers
11491     incorrectly reject 9223372036854775807.  */
11492 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11493   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11494                        && LARGE_OFF_T % 2147483647 == 1)
11495                       ? 1 : -1];
11496 int
11497 main (void)
11498 {
11499
11500   ;
11501   return 0;
11502 }
11503 _ACEOF
11504          rm -f conftest.$ac_objext
11505 if { (eval echo "$as_me:11505: \"$ac_compile\"") >&5
11506   (eval $ac_compile) 2>&5
11507   ac_status=$?
11508   echo "$as_me:11508: \$? = $ac_status" >&5
11509   (exit $ac_status); } &&
11510          { ac_try='test -s conftest.$ac_objext'
11511   { (eval echo "$as_me:11511: \"$ac_try\"") >&5
11512   (eval $ac_try) 2>&5
11513   ac_status=$?
11514   echo "$as_me:11514: \$? = $ac_status" >&5
11515   (exit $ac_status); }; }; then
11516   break
11517 else
11518   echo "$as_me: failed program was:" >&5
11519 cat conftest.$ac_ext >&5
11520 fi
11521 rm -f conftest.$ac_objext
11522          CC="$CC -n32"
11523          rm -f conftest.$ac_objext
11524 if { (eval echo "$as_me:11524: \"$ac_compile\"") >&5
11525   (eval $ac_compile) 2>&5
11526   ac_status=$?
11527   echo "$as_me:11527: \$? = $ac_status" >&5
11528   (exit $ac_status); } &&
11529          { ac_try='test -s conftest.$ac_objext'
11530   { (eval echo "$as_me:11530: \"$ac_try\"") >&5
11531   (eval $ac_try) 2>&5
11532   ac_status=$?
11533   echo "$as_me:11533: \$? = $ac_status" >&5
11534   (exit $ac_status); }; }; then
11535   ac_cv_sys_largefile_CC=' -n32'; break
11536 else
11537   echo "$as_me: failed program was:" >&5
11538 cat conftest.$ac_ext >&5
11539 fi
11540 rm -f conftest.$ac_objext
11541          break
11542        done
11543        CC=$ac_save_CC
11544        rm -f conftest.$ac_ext
11545     fi
11546 fi
11547 echo "$as_me:11547: result: $ac_cv_sys_largefile_CC" >&5
11548 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11549   if test "$ac_cv_sys_largefile_CC" != no; then
11550     CC=$CC$ac_cv_sys_largefile_CC
11551   fi
11552
11553   echo "$as_me:11553: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11554 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11555 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11556   echo $ECHO_N "(cached) $ECHO_C" >&6
11557 else
11558   while :; do
11559   ac_cv_sys_file_offset_bits=no
11560   cat >conftest.$ac_ext <<_ACEOF
11561 #line 11561 "configure"
11562 #include "confdefs.h"
11563 #include <sys/types.h>
11564  /* Check that off_t can represent 2**63 - 1 correctly.
11565     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11566     since some C++ compilers masquerading as C compilers
11567     incorrectly reject 9223372036854775807.  */
11568 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11569   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11570                        && LARGE_OFF_T % 2147483647 == 1)
11571                       ? 1 : -1];
11572 int
11573 main (void)
11574 {
11575
11576   ;
11577   return 0;
11578 }
11579 _ACEOF
11580 rm -f conftest.$ac_objext
11581 if { (eval echo "$as_me:11581: \"$ac_compile\"") >&5
11582   (eval $ac_compile) 2>&5
11583   ac_status=$?
11584   echo "$as_me:11584: \$? = $ac_status" >&5
11585   (exit $ac_status); } &&
11586          { ac_try='test -s conftest.$ac_objext'
11587   { (eval echo "$as_me:11587: \"$ac_try\"") >&5
11588   (eval $ac_try) 2>&5
11589   ac_status=$?
11590   echo "$as_me:11590: \$? = $ac_status" >&5
11591   (exit $ac_status); }; }; then
11592   break
11593 else
11594   echo "$as_me: failed program was:" >&5
11595 cat conftest.$ac_ext >&5
11596 fi
11597 rm -f conftest.$ac_objext conftest.$ac_ext
11598   cat >conftest.$ac_ext <<_ACEOF
11599 #line 11599 "configure"
11600 #include "confdefs.h"
11601 #define _FILE_OFFSET_BITS 64
11602 #include <sys/types.h>
11603  /* Check that off_t can represent 2**63 - 1 correctly.
11604     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11605     since some C++ compilers masquerading as C compilers
11606     incorrectly reject 9223372036854775807.  */
11607 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11608   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11609                        && LARGE_OFF_T % 2147483647 == 1)
11610                       ? 1 : -1];
11611 int
11612 main (void)
11613 {
11614
11615   ;
11616   return 0;
11617 }
11618 _ACEOF
11619 rm -f conftest.$ac_objext
11620 if { (eval echo "$as_me:11620: \"$ac_compile\"") >&5
11621   (eval $ac_compile) 2>&5
11622   ac_status=$?
11623   echo "$as_me:11623: \$? = $ac_status" >&5
11624   (exit $ac_status); } &&
11625          { ac_try='test -s conftest.$ac_objext'
11626   { (eval echo "$as_me:11626: \"$ac_try\"") >&5
11627   (eval $ac_try) 2>&5
11628   ac_status=$?
11629   echo "$as_me:11629: \$? = $ac_status" >&5
11630   (exit $ac_status); }; }; then
11631   ac_cv_sys_file_offset_bits=64; break
11632 else
11633   echo "$as_me: failed program was:" >&5
11634 cat conftest.$ac_ext >&5
11635 fi
11636 rm -f conftest.$ac_objext conftest.$ac_ext
11637   break
11638 done
11639 fi
11640 echo "$as_me:11640: result: $ac_cv_sys_file_offset_bits" >&5
11641 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11642 if test "$ac_cv_sys_file_offset_bits" != no; then
11643
11644 cat >>confdefs.h <<EOF
11645 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11646 EOF
11647
11648 fi
11649 rm -rf conftest*
11650   echo "$as_me:11650: checking for _LARGE_FILES value needed for large files" >&5
11651 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11652 if test "${ac_cv_sys_large_files+set}" = set; then
11653   echo $ECHO_N "(cached) $ECHO_C" >&6
11654 else
11655   while :; do
11656   ac_cv_sys_large_files=no
11657   cat >conftest.$ac_ext <<_ACEOF
11658 #line 11658 "configure"
11659 #include "confdefs.h"
11660 #include <sys/types.h>
11661  /* Check that off_t can represent 2**63 - 1 correctly.
11662     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11663     since some C++ compilers masquerading as C compilers
11664     incorrectly reject 9223372036854775807.  */
11665 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11666   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11667                        && LARGE_OFF_T % 2147483647 == 1)
11668                       ? 1 : -1];
11669 int
11670 main (void)
11671 {
11672
11673   ;
11674   return 0;
11675 }
11676 _ACEOF
11677 rm -f conftest.$ac_objext
11678 if { (eval echo "$as_me:11678: \"$ac_compile\"") >&5
11679   (eval $ac_compile) 2>&5
11680   ac_status=$?
11681   echo "$as_me:11681: \$? = $ac_status" >&5
11682   (exit $ac_status); } &&
11683          { ac_try='test -s conftest.$ac_objext'
11684   { (eval echo "$as_me:11684: \"$ac_try\"") >&5
11685   (eval $ac_try) 2>&5
11686   ac_status=$?
11687   echo "$as_me:11687: \$? = $ac_status" >&5
11688   (exit $ac_status); }; }; then
11689   break
11690 else
11691   echo "$as_me: failed program was:" >&5
11692 cat conftest.$ac_ext >&5
11693 fi
11694 rm -f conftest.$ac_objext conftest.$ac_ext
11695   cat >conftest.$ac_ext <<_ACEOF
11696 #line 11696 "configure"
11697 #include "confdefs.h"
11698 #define _LARGE_FILES 1
11699 #include <sys/types.h>
11700  /* Check that off_t can represent 2**63 - 1 correctly.
11701     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11702     since some C++ compilers masquerading as C compilers
11703     incorrectly reject 9223372036854775807.  */
11704 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11705   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11706                        && LARGE_OFF_T % 2147483647 == 1)
11707                       ? 1 : -1];
11708 int
11709 main (void)
11710 {
11711
11712   ;
11713   return 0;
11714 }
11715 _ACEOF
11716 rm -f conftest.$ac_objext
11717 if { (eval echo "$as_me:11717: \"$ac_compile\"") >&5
11718   (eval $ac_compile) 2>&5
11719   ac_status=$?
11720   echo "$as_me:11720: \$? = $ac_status" >&5
11721   (exit $ac_status); } &&
11722          { ac_try='test -s conftest.$ac_objext'
11723   { (eval echo "$as_me:11723: \"$ac_try\"") >&5
11724   (eval $ac_try) 2>&5
11725   ac_status=$?
11726   echo "$as_me:11726: \$? = $ac_status" >&5
11727   (exit $ac_status); }; }; then
11728   ac_cv_sys_large_files=1; break
11729 else
11730   echo "$as_me: failed program was:" >&5
11731 cat conftest.$ac_ext >&5
11732 fi
11733 rm -f conftest.$ac_objext conftest.$ac_ext
11734   break
11735 done
11736 fi
11737 echo "$as_me:11737: result: $ac_cv_sys_large_files" >&5
11738 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11739 if test "$ac_cv_sys_large_files" != no; then
11740
11741 cat >>confdefs.h <<EOF
11742 #define _LARGE_FILES $ac_cv_sys_large_files
11743 EOF
11744
11745 fi
11746 rm -rf conftest*
11747 fi
11748
11749         if test "$enable_largefile" != no ; then
11750         echo "$as_me:11750: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11751 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11752 if test "${ac_cv_sys_largefile_source+set}" = set; then
11753   echo $ECHO_N "(cached) $ECHO_C" >&6
11754 else
11755   while :; do
11756   ac_cv_sys_largefile_source=no
11757   cat >conftest.$ac_ext <<_ACEOF
11758 #line 11758 "configure"
11759 #include "confdefs.h"
11760 #include <stdio.h>
11761 int
11762 main (void)
11763 {
11764 return !fseeko;
11765   ;
11766   return 0;
11767 }
11768 _ACEOF
11769 rm -f conftest.$ac_objext
11770 if { (eval echo "$as_me:11770: \"$ac_compile\"") >&5
11771   (eval $ac_compile) 2>&5
11772   ac_status=$?
11773   echo "$as_me:11773: \$? = $ac_status" >&5
11774   (exit $ac_status); } &&
11775          { ac_try='test -s conftest.$ac_objext'
11776   { (eval echo "$as_me:11776: \"$ac_try\"") >&5
11777   (eval $ac_try) 2>&5
11778   ac_status=$?
11779   echo "$as_me:11779: \$? = $ac_status" >&5
11780   (exit $ac_status); }; }; then
11781   break
11782 else
11783   echo "$as_me: failed program was:" >&5
11784 cat conftest.$ac_ext >&5
11785 fi
11786 rm -f conftest.$ac_objext conftest.$ac_ext
11787   cat >conftest.$ac_ext <<_ACEOF
11788 #line 11788 "configure"
11789 #include "confdefs.h"
11790 #define _LARGEFILE_SOURCE 1
11791 #include <stdio.h>
11792 int
11793 main (void)
11794 {
11795 return !fseeko;
11796   ;
11797   return 0;
11798 }
11799 _ACEOF
11800 rm -f conftest.$ac_objext
11801 if { (eval echo "$as_me:11801: \"$ac_compile\"") >&5
11802   (eval $ac_compile) 2>&5
11803   ac_status=$?
11804   echo "$as_me:11804: \$? = $ac_status" >&5
11805   (exit $ac_status); } &&
11806          { ac_try='test -s conftest.$ac_objext'
11807   { (eval echo "$as_me:11807: \"$ac_try\"") >&5
11808   (eval $ac_try) 2>&5
11809   ac_status=$?
11810   echo "$as_me:11810: \$? = $ac_status" >&5
11811   (exit $ac_status); }; }; then
11812   ac_cv_sys_largefile_source=1; break
11813 else
11814   echo "$as_me: failed program was:" >&5
11815 cat conftest.$ac_ext >&5
11816 fi
11817 rm -f conftest.$ac_objext conftest.$ac_ext
11818   break
11819 done
11820 fi
11821 echo "$as_me:11821: result: $ac_cv_sys_largefile_source" >&5
11822 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11823 if test "$ac_cv_sys_largefile_source" != no; then
11824
11825 cat >>confdefs.h <<EOF
11826 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11827 EOF
11828
11829 fi
11830 rm -rf conftest*
11831
11832 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11833 # in glibc 2.1.3, but that breaks too many other things.
11834 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11835 echo "$as_me:11835: checking for fseeko" >&5
11836 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11837 if test "${ac_cv_func_fseeko+set}" = set; then
11838   echo $ECHO_N "(cached) $ECHO_C" >&6
11839 else
11840   cat >conftest.$ac_ext <<_ACEOF
11841 #line 11841 "configure"
11842 #include "confdefs.h"
11843 #include <stdio.h>
11844 int
11845 main (void)
11846 {
11847 return fseeko && fseeko (stdin, 0, 0);
11848   ;
11849   return 0;
11850 }
11851 _ACEOF
11852 rm -f conftest.$ac_objext conftest$ac_exeext
11853 if { (eval echo "$as_me:11853: \"$ac_link\"") >&5
11854   (eval $ac_link) 2>&5
11855   ac_status=$?
11856   echo "$as_me:11856: \$? = $ac_status" >&5
11857   (exit $ac_status); } &&
11858          { ac_try='test -s conftest$ac_exeext'
11859   { (eval echo "$as_me:11859: \"$ac_try\"") >&5
11860   (eval $ac_try) 2>&5
11861   ac_status=$?
11862   echo "$as_me:11862: \$? = $ac_status" >&5
11863   (exit $ac_status); }; }; then
11864   ac_cv_func_fseeko=yes
11865 else
11866   echo "$as_me: failed program was:" >&5
11867 cat conftest.$ac_ext >&5
11868 ac_cv_func_fseeko=no
11869 fi
11870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11871 fi
11872 echo "$as_me:11872: result: $ac_cv_func_fseeko" >&5
11873 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11874 if test $ac_cv_func_fseeko = yes; then
11875
11876 cat >>confdefs.h <<\EOF
11877 #define HAVE_FSEEKO 1
11878 EOF
11879
11880 fi
11881
11882         # Normally we would collect these definitions in the config.h,
11883         # but (like _XOPEN_SOURCE), some environments rely on having these
11884         # defined before any of the system headers are included.  Another
11885         # case comes up with C++, e.g., on AIX the compiler compiles the
11886         # header files by themselves before looking at the body files it is
11887         # told to compile.  For ncurses, those header files do not include
11888         # the config.h
11889         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11890         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11891         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11892
11893         echo "$as_me:11893: checking whether to use struct dirent64" >&5
11894 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11895 if test "${cf_cv_struct_dirent64+set}" = set; then
11896   echo $ECHO_N "(cached) $ECHO_C" >&6
11897 else
11898
11899                 cat >conftest.$ac_ext <<_ACEOF
11900 #line 11900 "configure"
11901 #include "confdefs.h"
11902
11903 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
11904 #include <sys/types.h>
11905 #include <dirent.h>
11906
11907 int
11908 main (void)
11909 {
11910
11911                 /* if transitional largefile support is setup, this is true */
11912                 extern struct dirent64 * readdir(DIR *);
11913                 struct dirent64 *x = readdir((DIR *)0);
11914                 struct dirent *y = readdir((DIR *)0);
11915                 int z = x - y;
11916
11917   ;
11918   return 0;
11919 }
11920 _ACEOF
11921 rm -f conftest.$ac_objext
11922 if { (eval echo "$as_me:11922: \"$ac_compile\"") >&5
11923   (eval $ac_compile) 2>&5
11924   ac_status=$?
11925   echo "$as_me:11925: \$? = $ac_status" >&5
11926   (exit $ac_status); } &&
11927          { ac_try='test -s conftest.$ac_objext'
11928   { (eval echo "$as_me:11928: \"$ac_try\"") >&5
11929   (eval $ac_try) 2>&5
11930   ac_status=$?
11931   echo "$as_me:11931: \$? = $ac_status" >&5
11932   (exit $ac_status); }; }; then
11933   cf_cv_struct_dirent64=yes
11934 else
11935   echo "$as_me: failed program was:" >&5
11936 cat conftest.$ac_ext >&5
11937 cf_cv_struct_dirent64=no
11938 fi
11939 rm -f conftest.$ac_objext conftest.$ac_ext
11940
11941 fi
11942 echo "$as_me:11942: result: $cf_cv_struct_dirent64" >&5
11943 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11944         test "$cf_cv_struct_dirent64" = yes &&
11945 cat >>confdefs.h <<\EOF
11946 #define HAVE_STRUCT_DIRENT64 1
11947 EOF
11948
11949         fi
11950
11951 ### Enable compiling-in rcs id's
11952 echo "$as_me:11952: checking if RCS identifiers should be compiled-in" >&5
11953 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11954
11955 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11956 if test "${with_rcs_ids+set}" = set; then
11957   withval="$with_rcs_ids"
11958   with_rcs_ids=$withval
11959 else
11960   with_rcs_ids=no
11961 fi;
11962 echo "$as_me:11962: result: $with_rcs_ids" >&5
11963 echo "${ECHO_T}$with_rcs_ids" >&6
11964 test "$with_rcs_ids" = yes &&
11965 cat >>confdefs.h <<\EOF
11966 #define USE_RCS_IDS 1
11967 EOF
11968
11969 ###############################################################################
11970
11971 ### Note that some functions (such as const) are normally disabled anyway.
11972 echo "$as_me:11972: checking if you want to build with function extensions" >&5
11973 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11974
11975 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11976 if test "${enable_ext_funcs+set}" = set; then
11977   enableval="$enable_ext_funcs"
11978   with_ext_funcs=$enableval
11979 else
11980   with_ext_funcs=yes
11981 fi;
11982 echo "$as_me:11982: result: $with_ext_funcs" >&5
11983 echo "${ECHO_T}$with_ext_funcs" >&6
11984 if test "$with_ext_funcs" = yes ; then
11985         NCURSES_EXT_FUNCS=1
11986
11987 cat >>confdefs.h <<\EOF
11988 #define HAVE_USE_DEFAULT_COLORS 1
11989 EOF
11990
11991 cat >>confdefs.h <<\EOF
11992 #define NCURSES_EXT_FUNCS 1
11993 EOF
11994
11995 else
11996         NCURSES_EXT_FUNCS=0
11997 fi
11998
11999 ###   use option --enable-const to turn on use of const beyond that in XSI.
12000 echo "$as_me:12000: checking for extended use of const keyword" >&5
12001 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
12002
12003 # Check whether --enable-const or --disable-const was given.
12004 if test "${enable_const+set}" = set; then
12005   enableval="$enable_const"
12006   with_ext_const=$enableval
12007 else
12008   with_ext_const=no
12009 fi;
12010 echo "$as_me:12010: result: $with_ext_const" >&5
12011 echo "${ECHO_T}$with_ext_const" >&6
12012 NCURSES_CONST='/*nothing*/'
12013 if test "$with_ext_const" = yes ; then
12014         NCURSES_CONST=const
12015 fi
12016
12017 ###############################################################################
12018 # These options are relatively safe to experiment with.
12019
12020 echo "$as_me:12020: checking if you want all development code" >&5
12021 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
12022
12023 # Check whether --with-develop or --without-develop was given.
12024 if test "${with_develop+set}" = set; then
12025   withval="$with_develop"
12026   with_develop=$withval
12027 else
12028   with_develop=no
12029 fi;
12030 echo "$as_me:12030: result: $with_develop" >&5
12031 echo "${ECHO_T}$with_develop" >&6
12032
12033 ###############################################################################
12034 # These are just experimental, probably should not be in a package:
12035
12036 # This is still experimental (20080329), but should ultimately be moved to
12037 # the script-block --with-normal, etc.
12038
12039 echo "$as_me:12039: checking if you want to link with the pthread library" >&5
12040 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
12041
12042 # Check whether --with-pthread or --without-pthread was given.
12043 if test "${with_pthread+set}" = set; then
12044   withval="$with_pthread"
12045   with_pthread=$withval
12046 else
12047   with_pthread=no
12048 fi;
12049 echo "$as_me:12049: result: $with_pthread" >&5
12050 echo "${ECHO_T}$with_pthread" >&6
12051
12052 if test "$with_pthread" != no ; then
12053         echo "$as_me:12053: checking for pthread.h" >&5
12054 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
12055 if test "${ac_cv_header_pthread_h+set}" = set; then
12056   echo $ECHO_N "(cached) $ECHO_C" >&6
12057 else
12058   cat >conftest.$ac_ext <<_ACEOF
12059 #line 12059 "configure"
12060 #include "confdefs.h"
12061 #include <pthread.h>
12062 _ACEOF
12063 if { (eval echo "$as_me:12063: \"$ac_cpp conftest.$ac_ext\"") >&5
12064   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12065   ac_status=$?
12066   egrep -v '^ *\+' conftest.er1 >conftest.err
12067   rm -f conftest.er1
12068   cat conftest.err >&5
12069   echo "$as_me:12069: \$? = $ac_status" >&5
12070   (exit $ac_status); } >/dev/null; then
12071   if test -s conftest.err; then
12072     ac_cpp_err=$ac_c_preproc_warn_flag
12073   else
12074     ac_cpp_err=
12075   fi
12076 else
12077   ac_cpp_err=yes
12078 fi
12079 if test -z "$ac_cpp_err"; then
12080   ac_cv_header_pthread_h=yes
12081 else
12082   echo "$as_me: failed program was:" >&5
12083   cat conftest.$ac_ext >&5
12084   ac_cv_header_pthread_h=no
12085 fi
12086 rm -f conftest.err conftest.$ac_ext
12087 fi
12088 echo "$as_me:12088: result: $ac_cv_header_pthread_h" >&5
12089 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
12090 if test $ac_cv_header_pthread_h = yes; then
12091
12092 cat >>confdefs.h <<\EOF
12093 #define HAVE_PTHREADS_H 1
12094 EOF
12095
12096         for cf_lib_pthread in pthread c_r
12097         do
12098             echo "$as_me:12098: checking if we can link with the $cf_lib_pthread library" >&5
12099 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
12100             cf_save_LIBS="$LIBS"
12101
12102 cf_add_libs="-l$cf_lib_pthread"
12103 # Filter out duplicates - this happens with badly-designed ".pc" files...
12104 for cf_add_1lib in $LIBS
12105 do
12106         for cf_add_2lib in $cf_add_libs
12107         do
12108                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12109                 then
12110                         cf_add_1lib=
12111                         break
12112                 fi
12113         done
12114         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12115 done
12116 LIBS="$cf_add_libs"
12117
12118             cat >conftest.$ac_ext <<_ACEOF
12119 #line 12119 "configure"
12120 #include "confdefs.h"
12121
12122 #include <pthread.h>
12123
12124 int
12125 main (void)
12126 {
12127
12128                 int rc = pthread_create(0,0,0,0);
12129                 int r2 = pthread_mutexattr_settype(0, 0);
12130
12131   ;
12132   return 0;
12133 }
12134 _ACEOF
12135 rm -f conftest.$ac_objext conftest$ac_exeext
12136 if { (eval echo "$as_me:12136: \"$ac_link\"") >&5
12137   (eval $ac_link) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit $ac_status); } &&
12141          { ac_try='test -s conftest$ac_exeext'
12142   { (eval echo "$as_me:12142: \"$ac_try\"") >&5
12143   (eval $ac_try) 2>&5
12144   ac_status=$?
12145   echo "$as_me:12145: \$? = $ac_status" >&5
12146   (exit $ac_status); }; }; then
12147   with_pthread=yes
12148 else
12149   echo "$as_me: failed program was:" >&5
12150 cat conftest.$ac_ext >&5
12151 with_pthread=no
12152 fi
12153 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12154             LIBS="$cf_save_LIBS"
12155             echo "$as_me:12155: result: $with_pthread" >&5
12156 echo "${ECHO_T}$with_pthread" >&6
12157             test "$with_pthread" = yes && break
12158         done
12159
12160         if test "$with_pthread" = yes ; then
12161
12162 cf_add_libs="-l$cf_lib_pthread"
12163 # Filter out duplicates - this happens with badly-designed ".pc" files...
12164 for cf_add_1lib in $LIBS
12165 do
12166         for cf_add_2lib in $cf_add_libs
12167         do
12168                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12169                 then
12170                         cf_add_1lib=
12171                         break
12172                 fi
12173         done
12174         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12175 done
12176 LIBS="$cf_add_libs"
12177
12178 cat >>confdefs.h <<\EOF
12179 #define HAVE_LIBPTHREADS 1
12180 EOF
12181
12182         else
12183             { { echo "$as_me:12183: error: Cannot link with pthread library" >&5
12184 echo "$as_me: error: Cannot link with pthread library" >&2;}
12185    { (exit 1); exit 1; }; }
12186         fi
12187
12188 fi
12189
12190 fi
12191
12192 echo "$as_me:12192: checking if you want to use weak-symbols for pthreads" >&5
12193 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
12194
12195 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
12196 if test "${enable_weak_symbols+set}" = set; then
12197   enableval="$enable_weak_symbols"
12198   use_weak_symbols=$withval
12199 else
12200   use_weak_symbols=no
12201 fi;
12202 echo "$as_me:12202: result: $use_weak_symbols" >&5
12203 echo "${ECHO_T}$use_weak_symbols" >&6
12204 if test "$use_weak_symbols" = yes ; then
12205
12206 echo "$as_me:12206: checking if $CC supports weak symbols" >&5
12207 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
12208 if test "${cf_cv_weak_symbols+set}" = set; then
12209   echo $ECHO_N "(cached) $ECHO_C" >&6
12210 else
12211
12212 cat >conftest.$ac_ext <<_ACEOF
12213 #line 12213 "configure"
12214 #include "confdefs.h"
12215
12216 #include <stdio.h>
12217 int
12218 main (void)
12219 {
12220
12221 #if defined(__GNUC__)
12222 #  if defined __USE_ISOC99
12223 #    define _cat_pragma(exp)    _Pragma(#exp)
12224 #    define _weak_pragma(exp)   _cat_pragma(weak name)
12225 #  else
12226 #    define _weak_pragma(exp)
12227 #  endif
12228 #  define _declare(name)        __extension__ extern __typeof__(name) name
12229 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
12230 #endif
12231
12232 weak_symbol(fopen);
12233
12234   ;
12235   return 0;
12236 }
12237 _ACEOF
12238 rm -f conftest.$ac_objext
12239 if { (eval echo "$as_me:12239: \"$ac_compile\"") >&5
12240   (eval $ac_compile) 2>&5
12241   ac_status=$?
12242   echo "$as_me:12242: \$? = $ac_status" >&5
12243   (exit $ac_status); } &&
12244          { ac_try='test -s conftest.$ac_objext'
12245   { (eval echo "$as_me:12245: \"$ac_try\"") >&5
12246   (eval $ac_try) 2>&5
12247   ac_status=$?
12248   echo "$as_me:12248: \$? = $ac_status" >&5
12249   (exit $ac_status); }; }; then
12250   cf_cv_weak_symbols=yes
12251 else
12252   echo "$as_me: failed program was:" >&5
12253 cat conftest.$ac_ext >&5
12254 cf_cv_weak_symbols=no
12255 fi
12256 rm -f conftest.$ac_objext conftest.$ac_ext
12257
12258 fi
12259 echo "$as_me:12259: result: $cf_cv_weak_symbols" >&5
12260 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
12261
12262 else
12263         cf_cv_weak_symbols=no
12264 fi
12265
12266 if test $cf_cv_weak_symbols = yes ; then
12267
12268 cat >>confdefs.h <<\EOF
12269 #define USE_WEAK_SYMBOLS 1
12270 EOF
12271
12272 fi
12273
12274 PTHREAD=
12275 if test "$with_pthread" = "yes" ; then
12276
12277 cat >>confdefs.h <<\EOF
12278 #define USE_PTHREADS 1
12279 EOF
12280
12281         enable_reentrant=yes
12282         if test $cf_cv_weak_symbols = yes ; then
12283                 PTHREAD=-lpthread
12284         fi
12285 fi
12286
12287 # OpenSUSE is installing ncurses6, using reentrant option.
12288 echo "$as_me:12288: checking for _nc_TABSIZE" >&5
12289 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
12290 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
12291   echo $ECHO_N "(cached) $ECHO_C" >&6
12292 else
12293   cat >conftest.$ac_ext <<_ACEOF
12294 #line 12294 "configure"
12295 #include "confdefs.h"
12296 /* System header to define __stub macros and hopefully few prototypes,
12297     which can conflict with char _nc_TABSIZE (); below.  */
12298 #include <assert.h>
12299 /* Override any gcc2 internal prototype to avoid an error.  */
12300 #ifdef __cplusplus
12301 extern "C"
12302 #endif
12303 /* We use char because int might match the return type of a gcc2
12304    builtin and then its argument prototype would still apply.  */
12305 char _nc_TABSIZE ();
12306 char (*f) ();
12307
12308 int
12309 main (void)
12310 {
12311 /* The GNU C library defines this for functions which it implements
12312     to always fail with ENOSYS.  Some functions are actually named
12313     something starting with __ and the normal name is an alias.  */
12314 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
12315 choke me
12316 #else
12317 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12318 #endif
12319
12320   ;
12321   return 0;
12322 }
12323 _ACEOF
12324 rm -f conftest.$ac_objext conftest$ac_exeext
12325 if { (eval echo "$as_me:12325: \"$ac_link\"") >&5
12326   (eval $ac_link) 2>&5
12327   ac_status=$?
12328   echo "$as_me:12328: \$? = $ac_status" >&5
12329   (exit $ac_status); } &&
12330          { ac_try='test -s conftest$ac_exeext'
12331   { (eval echo "$as_me:12331: \"$ac_try\"") >&5
12332   (eval $ac_try) 2>&5
12333   ac_status=$?
12334   echo "$as_me:12334: \$? = $ac_status" >&5
12335   (exit $ac_status); }; }; then
12336   ac_cv_func__nc_TABSIZE=yes
12337 else
12338   echo "$as_me: failed program was:" >&5
12339 cat conftest.$ac_ext >&5
12340 ac_cv_func__nc_TABSIZE=no
12341 fi
12342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12343 fi
12344 echo "$as_me:12344: result: $ac_cv_func__nc_TABSIZE" >&5
12345 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
12346 if test $ac_cv_func__nc_TABSIZE = yes; then
12347   assume_reentrant=yes
12348 else
12349   assume_reentrant=no
12350 fi
12351
12352 # Reentrant code has to be opaque; there's little advantage to making ncurses
12353 # opaque outside of that, so there is no --enable-opaque option.  We can use
12354 # this option without --with-pthreads, but this will be always set for
12355 # pthreads.
12356 echo "$as_me:12356: checking if you want experimental reentrant code" >&5
12357 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
12358
12359 # Check whether --enable-reentrant or --disable-reentrant was given.
12360 if test "${enable_reentrant+set}" = set; then
12361   enableval="$enable_reentrant"
12362   with_reentrant=$enableval
12363 else
12364   with_reentrant=$assume_reentrant
12365 fi;
12366 echo "$as_me:12366: result: $with_reentrant" >&5
12367 echo "${ECHO_T}$with_reentrant" >&6
12368 if test "$with_reentrant" = yes ; then
12369         cf_cv_enable_reentrant=1
12370         if test $cf_cv_weak_symbols = yes ; then
12371
12372 # remove pthread library from $LIBS
12373 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
12374
12375         elif test "$assume_reentrant" = no ; then
12376                 LIB_SUFFIX="t${LIB_SUFFIX}"
12377         fi
12378
12379 cat >>confdefs.h <<\EOF
12380 #define USE_REENTRANT 1
12381 EOF
12382
12383 else
12384         cf_cv_enable_reentrant=0
12385 fi
12386
12387 ### Allow using a different wrap-prefix
12388 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
12389         echo "$as_me:12389: checking for prefix used to wrap public variables" >&5
12390 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
12391
12392 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
12393 if test "${with_wrap_prefix+set}" = set; then
12394   withval="$with_wrap_prefix"
12395   NCURSES_WRAP_PREFIX=$withval
12396 else
12397   NCURSES_WRAP_PREFIX=_nc_
12398 fi;
12399         echo "$as_me:12399: result: $NCURSES_WRAP_PREFIX" >&5
12400 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12401 else
12402         NCURSES_WRAP_PREFIX=_nc_
12403 fi
12404
12405 cat >>confdefs.h <<EOF
12406 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
12407 EOF
12408
12409 ###############################################################################
12410
12411 ###     use option --disable-echo to suppress full display compiling commands
12412
12413 echo "$as_me:12413: checking if you want to see long compiling messages" >&5
12414 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
12415
12416 # Check whether --enable-echo or --disable-echo was given.
12417 if test "${enable_echo+set}" = set; then
12418   enableval="$enable_echo"
12419   test "$enableval" != no && enableval=yes
12420         if test "$enableval" != "yes" ; then
12421
12422         ECHO_LT='--silent'
12423         ECHO_LD='@echo linking $@;'
12424         RULE_CC='@echo compiling $<'
12425         SHOW_CC='@echo compiling $@'
12426         ECHO_CC='@'
12427
12428         else
12429
12430         ECHO_LT=''
12431         ECHO_LD=''
12432         RULE_CC=''
12433         SHOW_CC=''
12434         ECHO_CC=''
12435
12436         fi
12437 else
12438   enableval=yes
12439
12440         ECHO_LT=''
12441         ECHO_LD=''
12442         RULE_CC=''
12443         SHOW_CC=''
12444         ECHO_CC=''
12445
12446 fi;
12447 echo "$as_me:12447: result: $enableval" >&5
12448 echo "${ECHO_T}$enableval" >&6
12449
12450 ###     use option --enable-warnings to turn on all gcc warnings
12451 echo "$as_me:12451: checking if you want to see compiler warnings" >&5
12452 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
12453
12454 # Check whether --enable-warnings or --disable-warnings was given.
12455 if test "${enable_warnings+set}" = set; then
12456   enableval="$enable_warnings"
12457   with_warnings=$enableval
12458 fi;
12459 echo "$as_me:12459: result: $with_warnings" >&5
12460 echo "${ECHO_T}$with_warnings" >&6
12461
12462 if test "x$with_warnings" = "xyes"; then
12463
12464         ADAFLAGS="$ADAFLAGS -gnatg"
12465
12466 INTEL_COMPILER=no
12467
12468 if test "$GCC" = yes ; then
12469         case $host_os in
12470         (linux*|gnu*)
12471                 echo "$as_me:12471: checking if this is really Intel C compiler" >&5
12472 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
12473                 cf_save_CFLAGS="$CFLAGS"
12474                 CFLAGS="$CFLAGS -no-gcc"
12475                 cat >conftest.$ac_ext <<_ACEOF
12476 #line 12476 "configure"
12477 #include "confdefs.h"
12478
12479 int
12480 main (void)
12481 {
12482
12483 #ifdef __INTEL_COMPILER
12484 #else
12485 make an error
12486 #endif
12487
12488   ;
12489   return 0;
12490 }
12491 _ACEOF
12492 rm -f conftest.$ac_objext
12493 if { (eval echo "$as_me:12493: \"$ac_compile\"") >&5
12494   (eval $ac_compile) 2>&5
12495   ac_status=$?
12496   echo "$as_me:12496: \$? = $ac_status" >&5
12497   (exit $ac_status); } &&
12498          { ac_try='test -s conftest.$ac_objext'
12499   { (eval echo "$as_me:12499: \"$ac_try\"") >&5
12500   (eval $ac_try) 2>&5
12501   ac_status=$?
12502   echo "$as_me:12502: \$? = $ac_status" >&5
12503   (exit $ac_status); }; }; then
12504   INTEL_COMPILER=yes
12505 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
12506
12507 else
12508   echo "$as_me: failed program was:" >&5
12509 cat conftest.$ac_ext >&5
12510 fi
12511 rm -f conftest.$ac_objext conftest.$ac_ext
12512                 CFLAGS="$cf_save_CFLAGS"
12513                 echo "$as_me:12513: result: $INTEL_COMPILER" >&5
12514 echo "${ECHO_T}$INTEL_COMPILER" >&6
12515                 ;;
12516         esac
12517 fi
12518
12519 CLANG_COMPILER=no
12520
12521 if test "$GCC" = yes ; then
12522         echo "$as_me:12522: checking if this is really Clang C compiler" >&5
12523 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
12524         cf_save_CFLAGS="$CFLAGS"
12525         CFLAGS="$CFLAGS -Qunused-arguments"
12526         cat >conftest.$ac_ext <<_ACEOF
12527 #line 12527 "configure"
12528 #include "confdefs.h"
12529
12530 int
12531 main (void)
12532 {
12533
12534 #ifdef __clang__
12535 #else
12536 make an error
12537 #endif
12538
12539   ;
12540   return 0;
12541 }
12542 _ACEOF
12543 rm -f conftest.$ac_objext
12544 if { (eval echo "$as_me:12544: \"$ac_compile\"") >&5
12545   (eval $ac_compile) 2>&5
12546   ac_status=$?
12547   echo "$as_me:12547: \$? = $ac_status" >&5
12548   (exit $ac_status); } &&
12549          { ac_try='test -s conftest.$ac_objext'
12550   { (eval echo "$as_me:12550: \"$ac_try\"") >&5
12551   (eval $ac_try) 2>&5
12552   ac_status=$?
12553   echo "$as_me:12553: \$? = $ac_status" >&5
12554   (exit $ac_status); }; }; then
12555   CLANG_COMPILER=yes
12556 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12557
12558 else
12559   echo "$as_me: failed program was:" >&5
12560 cat conftest.$ac_ext >&5
12561 fi
12562 rm -f conftest.$ac_objext conftest.$ac_ext
12563         CFLAGS="$cf_save_CFLAGS"
12564         echo "$as_me:12564: result: $CLANG_COMPILER" >&5
12565 echo "${ECHO_T}$CLANG_COMPILER" >&6
12566 fi
12567
12568 cat > conftest.$ac_ext <<EOF
12569 #line 12569 "${as_me:-configure}"
12570 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12571 EOF
12572
12573 if test "$INTEL_COMPILER" = yes
12574 then
12575 # The "-wdXXX" options suppress warnings:
12576 # remark #1419: external declaration in primary source file
12577 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12578 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12579 # remark #193: zero used for undefined preprocessing identifier
12580 # remark #593: variable "curs_sb_left_arrow" was set but never used
12581 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12582 # remark #869: parameter "tw" was never referenced
12583 # remark #981: operands are evaluated in unspecified order
12584 # warning #279: controlling expression is constant
12585
12586         { echo "$as_me:12586: checking for $CC warning options..." >&5
12587 echo "$as_me: checking for $CC warning options..." >&6;}
12588         cf_save_CFLAGS="$CFLAGS"
12589         EXTRA_CFLAGS="-Wall"
12590         for cf_opt in \
12591                 wd1419 \
12592                 wd1683 \
12593                 wd1684 \
12594                 wd193 \
12595                 wd593 \
12596                 wd279 \
12597                 wd810 \
12598                 wd869 \
12599                 wd981
12600         do
12601                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12602                 if { (eval echo "$as_me:12602: \"$ac_compile\"") >&5
12603   (eval $ac_compile) 2>&5
12604   ac_status=$?
12605   echo "$as_me:12605: \$? = $ac_status" >&5
12606   (exit $ac_status); }; then
12607                         test -n "$verbose" && echo "$as_me:12607: result: ... -$cf_opt" >&5
12608 echo "${ECHO_T}... -$cf_opt" >&6
12609                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12610                 fi
12611         done
12612         CFLAGS="$cf_save_CFLAGS"
12613
12614 elif test "$GCC" = yes
12615 then
12616         { echo "$as_me:12616: checking for $CC warning options..." >&5
12617 echo "$as_me: checking for $CC warning options..." >&6;}
12618         cf_save_CFLAGS="$CFLAGS"
12619         EXTRA_CFLAGS=
12620         cf_warn_CONST=""
12621         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12622         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12623         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12624         for cf_opt in W Wall \
12625                 Wbad-function-cast \
12626                 Wcast-align \
12627                 Wcast-qual \
12628                 Wdeclaration-after-statement \
12629                 Wextra \
12630                 Winline \
12631                 Wmissing-declarations \
12632                 Wmissing-prototypes \
12633                 Wnested-externs \
12634                 Wpointer-arith \
12635                 Wshadow \
12636                 Wstrict-prototypes \
12637                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12638         do
12639                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12640                 if { (eval echo "$as_me:12640: \"$ac_compile\"") >&5
12641   (eval $ac_compile) 2>&5
12642   ac_status=$?
12643   echo "$as_me:12643: \$? = $ac_status" >&5
12644   (exit $ac_status); }; then
12645                         test -n "$verbose" && echo "$as_me:12645: result: ... -$cf_opt" >&5
12646 echo "${ECHO_T}... -$cf_opt" >&6
12647                         case $cf_opt in
12648                         (Wcast-qual)
12649                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12650                                 ;;
12651                         (Winline)
12652                                 case $GCC_VERSION in
12653                                 ([34].*)
12654                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12655
12656 echo "${as_me:-configure}:12656: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12657
12658                                         continue;;
12659                                 esac
12660                                 ;;
12661                         (Wpointer-arith)
12662                                 case $GCC_VERSION in
12663                                 ([12].*)
12664                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12665
12666 echo "${as_me:-configure}:12666: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12667
12668                                         continue;;
12669                                 esac
12670                                 ;;
12671                         esac
12672                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12673                 fi
12674         done
12675         CFLAGS="$cf_save_CFLAGS"
12676 fi
12677 rm -rf conftest*
12678
12679 fi
12680
12681 if test "$GCC" = yes
12682 then
12683 cat > conftest.i <<EOF
12684 #ifndef GCC_PRINTF
12685 #define GCC_PRINTF 0
12686 #endif
12687 #ifndef GCC_SCANF
12688 #define GCC_SCANF 0
12689 #endif
12690 #ifndef GCC_NORETURN
12691 #define GCC_NORETURN /* nothing */
12692 #endif
12693 #ifndef GCC_UNUSED
12694 #define GCC_UNUSED /* nothing */
12695 #endif
12696 EOF
12697 if test "$GCC" = yes
12698 then
12699         { echo "$as_me:12699: checking for $CC __attribute__ directives..." >&5
12700 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12701 cat > conftest.$ac_ext <<EOF
12702 #line 12702 "${as_me:-configure}"
12703 #include "confdefs.h"
12704 #include "conftest.h"
12705 #include "conftest.i"
12706 #if     GCC_PRINTF
12707 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12708 #else
12709 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12710 #endif
12711 #if     GCC_SCANF
12712 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12713 #else
12714 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12715 #endif
12716 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12717 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12718 extern void foo(void) GCC_NORETURN;
12719 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12720 EOF
12721         cf_printf_attribute=no
12722         cf_scanf_attribute=no
12723         for cf_attribute in scanf printf unused noreturn
12724         do
12725
12726 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12727
12728                 cf_directive="__attribute__(($cf_attribute))"
12729                 echo "checking for $CC $cf_directive" 1>&5
12730
12731                 case $cf_attribute in
12732                 (printf)
12733                         cf_printf_attribute=yes
12734                         cat >conftest.h <<EOF
12735 #define GCC_$cf_ATTRIBUTE 1
12736 EOF
12737                         ;;
12738                 (scanf)
12739                         cf_scanf_attribute=yes
12740                         cat >conftest.h <<EOF
12741 #define GCC_$cf_ATTRIBUTE 1
12742 EOF
12743                         ;;
12744                 (*)
12745                         cat >conftest.h <<EOF
12746 #define GCC_$cf_ATTRIBUTE $cf_directive
12747 EOF
12748                         ;;
12749                 esac
12750
12751                 if { (eval echo "$as_me:12751: \"$ac_compile\"") >&5
12752   (eval $ac_compile) 2>&5
12753   ac_status=$?
12754   echo "$as_me:12754: \$? = $ac_status" >&5
12755   (exit $ac_status); }; then
12756                         test -n "$verbose" && echo "$as_me:12756: result: ... $cf_attribute" >&5
12757 echo "${ECHO_T}... $cf_attribute" >&6
12758                         cat conftest.h >>confdefs.h
12759                         case $cf_attribute in
12760                         (noreturn)
12761
12762 cat >>confdefs.h <<EOF
12763 #define GCC_NORETURN $cf_directive
12764 EOF
12765
12766                                 ;;
12767                         (printf)
12768                                 cf_value='/* nothing */'
12769                                 if test "$cf_printf_attribute" != no ; then
12770                                         cf_value='__attribute__((format(printf,fmt,var)))'
12771
12772 cat >>confdefs.h <<\EOF
12773 #define GCC_PRINTF 1
12774 EOF
12775
12776                                 fi
12777
12778 cat >>confdefs.h <<EOF
12779 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12780 EOF
12781
12782                                 ;;
12783                         (scanf)
12784                                 cf_value='/* nothing */'
12785                                 if test "$cf_scanf_attribute" != no ; then
12786                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12787
12788 cat >>confdefs.h <<\EOF
12789 #define GCC_SCANF 1
12790 EOF
12791
12792                                 fi
12793
12794 cat >>confdefs.h <<EOF
12795 #define GCC_SCANFLIKE(fmt,var) $cf_value
12796 EOF
12797
12798                                 ;;
12799                         (unused)
12800
12801 cat >>confdefs.h <<EOF
12802 #define GCC_UNUSED $cf_directive
12803 EOF
12804
12805                                 ;;
12806                         esac
12807                 fi
12808         done
12809 else
12810         fgrep define conftest.i >>confdefs.h
12811 fi
12812 rm -rf conftest*
12813 fi
12814
12815 ###     use option --enable-assertions to turn on generation of assertion code
12816 echo "$as_me:12816: checking if you want to enable runtime assertions" >&5
12817 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12818
12819 # Check whether --enable-assertions or --disable-assertions was given.
12820 if test "${enable_assertions+set}" = set; then
12821   enableval="$enable_assertions"
12822   with_assertions=$enableval
12823 else
12824   with_assertions=no
12825 fi;
12826 echo "$as_me:12826: result: $with_assertions" >&5
12827 echo "${ECHO_T}$with_assertions" >&6
12828 if test -n "$GCC"
12829 then
12830         if test "$with_assertions" = no
12831         then
12832                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12833         else
12834
12835         ADAFLAGS="$ADAFLAGS -gnata"
12836
12837         fi
12838 fi
12839
12840 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12841
12842 cat >>confdefs.h <<\EOF
12843 #define HAVE_NC_ALLOC_H 1
12844 EOF
12845
12846 ###     use option --enable-expanded to generate certain macros as functions
12847
12848 # Check whether --enable-expanded or --disable-expanded was given.
12849 if test "${enable_expanded+set}" = set; then
12850   enableval="$enable_expanded"
12851   test "$enableval" = yes &&
12852 cat >>confdefs.h <<\EOF
12853 #define NCURSES_EXPANDED 1
12854 EOF
12855
12856 fi;
12857
12858 ###     use option --disable-macros to suppress macros in favor of functions
12859
12860 # Check whether --enable-macros or --disable-macros was given.
12861 if test "${enable_macros+set}" = set; then
12862   enableval="$enable_macros"
12863   test "$enableval" = no &&
12864 cat >>confdefs.h <<\EOF
12865 #define NCURSES_NOMACROS 1
12866 EOF
12867
12868 fi;
12869
12870 # Normally we only add trace() to the debug-library.  Allow this to be
12871 # extended to all models of the ncurses library:
12872 cf_all_traces=no
12873 case "$CFLAGS $CPPFLAGS" in
12874 (*-DTRACE*)
12875         cf_all_traces=yes
12876         ;;
12877 esac
12878
12879 echo "$as_me:12879: checking whether to add trace feature to all models" >&5
12880 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12881
12882 # Check whether --with-trace or --without-trace was given.
12883 if test "${with_trace+set}" = set; then
12884   withval="$with_trace"
12885   cf_with_trace=$withval
12886 else
12887   cf_with_trace=$cf_all_traces
12888 fi;
12889 echo "$as_me:12889: result: $cf_with_trace" >&5
12890 echo "${ECHO_T}$cf_with_trace" >&6
12891
12892 if test "$cf_with_trace" = yes ; then
12893         ADA_TRACE=TRUE
12894
12895 cf_fix_cppflags=no
12896 cf_new_cflags=
12897 cf_new_cppflags=
12898 cf_new_extra_cppflags=
12899
12900 for cf_add_cflags in -DTRACE
12901 do
12902 case $cf_fix_cppflags in
12903 (no)
12904         case $cf_add_cflags in
12905         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12906                 case $cf_add_cflags in
12907                 (-D*)
12908                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12909
12910                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12911                                 && test -z "${cf_tst_cflags}" \
12912                                 && cf_fix_cppflags=yes
12913
12914                         if test $cf_fix_cppflags = yes ; then
12915
12916         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12917         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12918
12919                                 continue
12920                         elif test "${cf_tst_cflags}" = "\"'" ; then
12921
12922         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12923         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12924
12925                                 continue
12926                         fi
12927                         ;;
12928                 esac
12929                 case "$CPPFLAGS" in
12930                 (*$cf_add_cflags)
12931                         ;;
12932                 (*)
12933                         case $cf_add_cflags in
12934                         (-D*)
12935                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12936
12937 CPPFLAGS=`echo "$CPPFLAGS" | \
12938         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12939                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12940
12941                                 ;;
12942                         esac
12943
12944         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12945         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12946
12947                         ;;
12948                 esac
12949                 ;;
12950         (*)
12951
12952         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12953         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12954
12955                 ;;
12956         esac
12957         ;;
12958 (yes)
12959
12960         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12961         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12962
12963         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12964
12965         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12966                 && test -z "${cf_tst_cflags}" \
12967                 && cf_fix_cppflags=no
12968         ;;
12969 esac
12970 done
12971
12972 if test -n "$cf_new_cflags" ; then
12973
12974         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12975         CFLAGS="${CFLAGS}$cf_new_cflags"
12976
12977 fi
12978
12979 if test -n "$cf_new_cppflags" ; then
12980
12981         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12982         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12983
12984 fi
12985
12986 if test -n "$cf_new_extra_cppflags" ; then
12987
12988         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12989         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12990
12991 fi
12992
12993 else
12994         ADA_TRACE=FALSE
12995 fi
12996
12997 echo "$as_me:12997: checking if we want to use GNAT projects" >&5
12998 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12999
13000 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
13001 if test "${enable_gnat_projects+set}" = set; then
13002   enableval="$enable_gnat_projects"
13003   test "$enableval" != no && enableval=yes
13004         if test "$enableval" != "yes" ; then
13005     enable_gnat_projects=no
13006         else
13007                 enable_gnat_projects=yes
13008         fi
13009 else
13010   enableval=yes
13011         enable_gnat_projects=yes
13012
13013 fi;
13014 echo "$as_me:13014: result: $enable_gnat_projects" >&5
13015 echo "${ECHO_T}$enable_gnat_projects" >&6
13016
13017 ###     Checks for libraries.
13018 case $cf_cv_system_name in
13019 (*mingw32*)
13020         ;;
13021 (*)
13022 echo "$as_me:13022: checking for gettimeofday" >&5
13023 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
13024 if test "${ac_cv_func_gettimeofday+set}" = set; then
13025   echo $ECHO_N "(cached) $ECHO_C" >&6
13026 else
13027   cat >conftest.$ac_ext <<_ACEOF
13028 #line 13028 "configure"
13029 #include "confdefs.h"
13030 /* System header to define __stub macros and hopefully few prototypes,
13031     which can conflict with char gettimeofday (); below.  */
13032 #include <assert.h>
13033 /* Override any gcc2 internal prototype to avoid an error.  */
13034 #ifdef __cplusplus
13035 extern "C"
13036 #endif
13037 /* We use char because int might match the return type of a gcc2
13038    builtin and then its argument prototype would still apply.  */
13039 char gettimeofday ();
13040 char (*f) ();
13041
13042 int
13043 main (void)
13044 {
13045 /* The GNU C library defines this for functions which it implements
13046     to always fail with ENOSYS.  Some functions are actually named
13047     something starting with __ and the normal name is an alias.  */
13048 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
13049 choke me
13050 #else
13051 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13052 #endif
13053
13054   ;
13055   return 0;
13056 }
13057 _ACEOF
13058 rm -f conftest.$ac_objext conftest$ac_exeext
13059 if { (eval echo "$as_me:13059: \"$ac_link\"") >&5
13060   (eval $ac_link) 2>&5
13061   ac_status=$?
13062   echo "$as_me:13062: \$? = $ac_status" >&5
13063   (exit $ac_status); } &&
13064          { ac_try='test -s conftest$ac_exeext'
13065   { (eval echo "$as_me:13065: \"$ac_try\"") >&5
13066   (eval $ac_try) 2>&5
13067   ac_status=$?
13068   echo "$as_me:13068: \$? = $ac_status" >&5
13069   (exit $ac_status); }; }; then
13070   ac_cv_func_gettimeofday=yes
13071 else
13072   echo "$as_me: failed program was:" >&5
13073 cat conftest.$ac_ext >&5
13074 ac_cv_func_gettimeofday=no
13075 fi
13076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13077 fi
13078 echo "$as_me:13078: result: $ac_cv_func_gettimeofday" >&5
13079 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
13080 if test $ac_cv_func_gettimeofday = yes; then
13081   cat >>confdefs.h <<\EOF
13082 #define HAVE_GETTIMEOFDAY 1
13083 EOF
13084
13085 else
13086
13087 echo "$as_me:13087: checking for gettimeofday in -lbsd" >&5
13088 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
13089 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
13090   echo $ECHO_N "(cached) $ECHO_C" >&6
13091 else
13092   ac_check_lib_save_LIBS=$LIBS
13093 LIBS="-lbsd  $LIBS"
13094 cat >conftest.$ac_ext <<_ACEOF
13095 #line 13095 "configure"
13096 #include "confdefs.h"
13097
13098 /* Override any gcc2 internal prototype to avoid an error.  */
13099 #ifdef __cplusplus
13100 extern "C"
13101 #endif
13102 /* We use char because int might match the return type of a gcc2
13103    builtin and then its argument prototype would still apply.  */
13104 char gettimeofday ();
13105 int
13106 main (void)
13107 {
13108 gettimeofday ();
13109   ;
13110   return 0;
13111 }
13112 _ACEOF
13113 rm -f conftest.$ac_objext conftest$ac_exeext
13114 if { (eval echo "$as_me:13114: \"$ac_link\"") >&5
13115   (eval $ac_link) 2>&5
13116   ac_status=$?
13117   echo "$as_me:13117: \$? = $ac_status" >&5
13118   (exit $ac_status); } &&
13119          { ac_try='test -s conftest$ac_exeext'
13120   { (eval echo "$as_me:13120: \"$ac_try\"") >&5
13121   (eval $ac_try) 2>&5
13122   ac_status=$?
13123   echo "$as_me:13123: \$? = $ac_status" >&5
13124   (exit $ac_status); }; }; then
13125   ac_cv_lib_bsd_gettimeofday=yes
13126 else
13127   echo "$as_me: failed program was:" >&5
13128 cat conftest.$ac_ext >&5
13129 ac_cv_lib_bsd_gettimeofday=no
13130 fi
13131 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13132 LIBS=$ac_check_lib_save_LIBS
13133 fi
13134 echo "$as_me:13134: result: $ac_cv_lib_bsd_gettimeofday" >&5
13135 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
13136 if test $ac_cv_lib_bsd_gettimeofday = yes; then
13137
13138 cat >>confdefs.h <<\EOF
13139 #define HAVE_GETTIMEOFDAY 1
13140 EOF
13141
13142         LIBS="$LIBS -lbsd"
13143 fi
13144
13145 fi
13146         ;;
13147 esac
13148
13149 ###     Checks for header files.
13150 echo "$as_me:13150: checking for ANSI C header files" >&5
13151 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13152 if test "${ac_cv_header_stdc+set}" = set; then
13153   echo $ECHO_N "(cached) $ECHO_C" >&6
13154 else
13155   cat >conftest.$ac_ext <<_ACEOF
13156 #line 13156 "configure"
13157 #include "confdefs.h"
13158 #include <stdlib.h>
13159 #include <stdarg.h>
13160 #include <string.h>
13161 #include <float.h>
13162
13163 _ACEOF
13164 if { (eval echo "$as_me:13164: \"$ac_cpp conftest.$ac_ext\"") >&5
13165   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13166   ac_status=$?
13167   egrep -v '^ *\+' conftest.er1 >conftest.err
13168   rm -f conftest.er1
13169   cat conftest.err >&5
13170   echo "$as_me:13170: \$? = $ac_status" >&5
13171   (exit $ac_status); } >/dev/null; then
13172   if test -s conftest.err; then
13173     ac_cpp_err=$ac_c_preproc_warn_flag
13174   else
13175     ac_cpp_err=
13176   fi
13177 else
13178   ac_cpp_err=yes
13179 fi
13180 if test -z "$ac_cpp_err"; then
13181   ac_cv_header_stdc=yes
13182 else
13183   echo "$as_me: failed program was:" >&5
13184   cat conftest.$ac_ext >&5
13185   ac_cv_header_stdc=no
13186 fi
13187 rm -f conftest.err conftest.$ac_ext
13188
13189 if test $ac_cv_header_stdc = yes; then
13190   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13191   cat >conftest.$ac_ext <<_ACEOF
13192 #line 13192 "configure"
13193 #include "confdefs.h"
13194 #include <string.h>
13195
13196 _ACEOF
13197 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13198   egrep "memchr" >/dev/null 2>&1; then
13199   :
13200 else
13201   ac_cv_header_stdc=no
13202 fi
13203 rm -rf conftest*
13204
13205 fi
13206
13207 if test $ac_cv_header_stdc = yes; then
13208   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13209   cat >conftest.$ac_ext <<_ACEOF
13210 #line 13210 "configure"
13211 #include "confdefs.h"
13212 #include <stdlib.h>
13213
13214 _ACEOF
13215 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13216   egrep "free" >/dev/null 2>&1; then
13217   :
13218 else
13219   ac_cv_header_stdc=no
13220 fi
13221 rm -rf conftest*
13222
13223 fi
13224
13225 if test $ac_cv_header_stdc = yes; then
13226   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13227   if test "$cross_compiling" = yes; then
13228   :
13229 else
13230   cat >conftest.$ac_ext <<_ACEOF
13231 #line 13231 "configure"
13232 #include "confdefs.h"
13233 #include <ctype.h>
13234 #if ((' ' & 0x0FF) == 0x020)
13235 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13236 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13237 #else
13238 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13239                      || ('j' <= (c) && (c) <= 'r') \
13240                      || ('s' <= (c) && (c) <= 'z'))
13241 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13242 #endif
13243
13244 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13245 int
13246 main (void)
13247 {
13248   int i;
13249   for (i = 0; i < 256; i++)
13250     if (XOR (islower (i), ISLOWER (i))
13251         || toupper (i) != TOUPPER (i))
13252       $ac_main_return(2);
13253   $ac_main_return (0);
13254 }
13255 _ACEOF
13256 rm -f conftest$ac_exeext
13257 if { (eval echo "$as_me:13257: \"$ac_link\"") >&5
13258   (eval $ac_link) 2>&5
13259   ac_status=$?
13260   echo "$as_me:13260: \$? = $ac_status" >&5
13261   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13262   { (eval echo "$as_me:13262: \"$ac_try\"") >&5
13263   (eval $ac_try) 2>&5
13264   ac_status=$?
13265   echo "$as_me:13265: \$? = $ac_status" >&5
13266   (exit $ac_status); }; }; then
13267   :
13268 else
13269   echo "$as_me: program exited with status $ac_status" >&5
13270 echo "$as_me: failed program was:" >&5
13271 cat conftest.$ac_ext >&5
13272 ac_cv_header_stdc=no
13273 fi
13274 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13275 fi
13276 fi
13277 fi
13278 echo "$as_me:13278: result: $ac_cv_header_stdc" >&5
13279 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13280 if test $ac_cv_header_stdc = yes; then
13281
13282 cat >>confdefs.h <<\EOF
13283 #define STDC_HEADERS 1
13284 EOF
13285
13286 fi
13287
13288 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13289
13290 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13291                   inttypes.h stdint.h unistd.h
13292 do
13293 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13294 echo "$as_me:13294: checking for $ac_header" >&5
13295 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13296 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13297   echo $ECHO_N "(cached) $ECHO_C" >&6
13298 else
13299   cat >conftest.$ac_ext <<_ACEOF
13300 #line 13300 "configure"
13301 #include "confdefs.h"
13302 $ac_includes_default
13303 #include <$ac_header>
13304 _ACEOF
13305 rm -f conftest.$ac_objext
13306 if { (eval echo "$as_me:13306: \"$ac_compile\"") >&5
13307   (eval $ac_compile) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit $ac_status); } &&
13311          { ac_try='test -s conftest.$ac_objext'
13312   { (eval echo "$as_me:13312: \"$ac_try\"") >&5
13313   (eval $ac_try) 2>&5
13314   ac_status=$?
13315   echo "$as_me:13315: \$? = $ac_status" >&5
13316   (exit $ac_status); }; }; then
13317   eval "$as_ac_Header=yes"
13318 else
13319   echo "$as_me: failed program was:" >&5
13320 cat conftest.$ac_ext >&5
13321 eval "$as_ac_Header=no"
13322 fi
13323 rm -f conftest.$ac_objext conftest.$ac_ext
13324 fi
13325 echo "$as_me:13325: result: `eval echo '${'$as_ac_Header'}'`" >&5
13326 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13327 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13328   cat >>confdefs.h <<EOF
13329 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13330 EOF
13331
13332 fi
13333 done
13334
13335 echo "$as_me:13335: checking for signed char" >&5
13336 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
13337 if test "${ac_cv_type_signed_char+set}" = set; then
13338   echo $ECHO_N "(cached) $ECHO_C" >&6
13339 else
13340   cat >conftest.$ac_ext <<_ACEOF
13341 #line 13341 "configure"
13342 #include "confdefs.h"
13343 $ac_includes_default
13344 int
13345 main (void)
13346 {
13347 if ((signed char *) 0)
13348   return 0;
13349 if (sizeof (signed char))
13350   return 0;
13351   ;
13352   return 0;
13353 }
13354 _ACEOF
13355 rm -f conftest.$ac_objext
13356 if { (eval echo "$as_me:13356: \"$ac_compile\"") >&5
13357   (eval $ac_compile) 2>&5
13358   ac_status=$?
13359   echo "$as_me:13359: \$? = $ac_status" >&5
13360   (exit $ac_status); } &&
13361          { ac_try='test -s conftest.$ac_objext'
13362   { (eval echo "$as_me:13362: \"$ac_try\"") >&5
13363   (eval $ac_try) 2>&5
13364   ac_status=$?
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); }; }; then
13367   ac_cv_type_signed_char=yes
13368 else
13369   echo "$as_me: failed program was:" >&5
13370 cat conftest.$ac_ext >&5
13371 ac_cv_type_signed_char=no
13372 fi
13373 rm -f conftest.$ac_objext conftest.$ac_ext
13374 fi
13375 echo "$as_me:13375: result: $ac_cv_type_signed_char" >&5
13376 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
13377
13378 echo "$as_me:13378: checking size of signed char" >&5
13379 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
13380 if test "${ac_cv_sizeof_signed_char+set}" = set; then
13381   echo $ECHO_N "(cached) $ECHO_C" >&6
13382 else
13383   if test "$ac_cv_type_signed_char" = yes; then
13384   if test "$cross_compiling" = yes; then
13385   # Depending upon the size, compute the lo and hi bounds.
13386 cat >conftest.$ac_ext <<_ACEOF
13387 #line 13387 "configure"
13388 #include "confdefs.h"
13389 $ac_includes_default
13390 int
13391 main (void)
13392 {
13393 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
13394   ;
13395   return 0;
13396 }
13397 _ACEOF
13398 rm -f conftest.$ac_objext
13399 if { (eval echo "$as_me:13399: \"$ac_compile\"") >&5
13400   (eval $ac_compile) 2>&5
13401   ac_status=$?
13402   echo "$as_me:13402: \$? = $ac_status" >&5
13403   (exit $ac_status); } &&
13404          { ac_try='test -s conftest.$ac_objext'
13405   { (eval echo "$as_me:13405: \"$ac_try\"") >&5
13406   (eval $ac_try) 2>&5
13407   ac_status=$?
13408   echo "$as_me:13408: \$? = $ac_status" >&5
13409   (exit $ac_status); }; }; then
13410   ac_lo=0 ac_mid=0
13411   while :; do
13412     cat >conftest.$ac_ext <<_ACEOF
13413 #line 13413 "configure"
13414 #include "confdefs.h"
13415 $ac_includes_default
13416 int
13417 main (void)
13418 {
13419 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13420   ;
13421   return 0;
13422 }
13423 _ACEOF
13424 rm -f conftest.$ac_objext
13425 if { (eval echo "$as_me:13425: \"$ac_compile\"") >&5
13426   (eval $ac_compile) 2>&5
13427   ac_status=$?
13428   echo "$as_me:13428: \$? = $ac_status" >&5
13429   (exit $ac_status); } &&
13430          { ac_try='test -s conftest.$ac_objext'
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   ac_hi=$ac_mid; break
13437 else
13438   echo "$as_me: failed program was:" >&5
13439 cat conftest.$ac_ext >&5
13440 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
13441 fi
13442 rm -f conftest.$ac_objext conftest.$ac_ext
13443   done
13444 else
13445   echo "$as_me: failed program was:" >&5
13446 cat conftest.$ac_ext >&5
13447 ac_hi=-1 ac_mid=-1
13448   while :; do
13449     cat >conftest.$ac_ext <<_ACEOF
13450 #line 13450 "configure"
13451 #include "confdefs.h"
13452 $ac_includes_default
13453 int
13454 main (void)
13455 {
13456 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
13457   ;
13458   return 0;
13459 }
13460 _ACEOF
13461 rm -f conftest.$ac_objext
13462 if { (eval echo "$as_me:13462: \"$ac_compile\"") >&5
13463   (eval $ac_compile) 2>&5
13464   ac_status=$?
13465   echo "$as_me:13465: \$? = $ac_status" >&5
13466   (exit $ac_status); } &&
13467          { ac_try='test -s conftest.$ac_objext'
13468   { (eval echo "$as_me:13468: \"$ac_try\"") >&5
13469   (eval $ac_try) 2>&5
13470   ac_status=$?
13471   echo "$as_me:13471: \$? = $ac_status" >&5
13472   (exit $ac_status); }; }; then
13473   ac_lo=$ac_mid; break
13474 else
13475   echo "$as_me: failed program was:" >&5
13476 cat conftest.$ac_ext >&5
13477 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
13478 fi
13479 rm -f conftest.$ac_objext conftest.$ac_ext
13480   done
13481 fi
13482 rm -f conftest.$ac_objext conftest.$ac_ext
13483 # Binary search between lo and hi bounds.
13484 while test "x$ac_lo" != "x$ac_hi"; do
13485   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
13486   cat >conftest.$ac_ext <<_ACEOF
13487 #line 13487 "configure"
13488 #include "confdefs.h"
13489 $ac_includes_default
13490 int
13491 main (void)
13492 {
13493 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13494   ;
13495   return 0;
13496 }
13497 _ACEOF
13498 rm -f conftest.$ac_objext
13499 if { (eval echo "$as_me:13499: \"$ac_compile\"") >&5
13500   (eval $ac_compile) 2>&5
13501   ac_status=$?
13502   echo "$as_me:13502: \$? = $ac_status" >&5
13503   (exit $ac_status); } &&
13504          { ac_try='test -s conftest.$ac_objext'
13505   { (eval echo "$as_me:13505: \"$ac_try\"") >&5
13506   (eval $ac_try) 2>&5
13507   ac_status=$?
13508   echo "$as_me:13508: \$? = $ac_status" >&5
13509   (exit $ac_status); }; }; then
13510   ac_hi=$ac_mid
13511 else
13512   echo "$as_me: failed program was:" >&5
13513 cat conftest.$ac_ext >&5
13514 ac_lo=`expr $ac_mid + 1`
13515 fi
13516 rm -f conftest.$ac_objext conftest.$ac_ext
13517 done
13518 ac_cv_sizeof_signed_char=$ac_lo
13519 else
13520   if test "$cross_compiling" = yes; then
13521   { { echo "$as_me:13521: error: cannot run test program while cross compiling" >&5
13522 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
13523    { (exit 1); exit 1; }; }
13524 else
13525   cat >conftest.$ac_ext <<_ACEOF
13526 #line 13526 "configure"
13527 #include "confdefs.h"
13528 $ac_includes_default
13529 int
13530 main (void)
13531 {
13532 FILE *f = fopen ("conftest.val", "w");
13533 if (!f)
13534   $ac_main_return (1);
13535 fprintf (f, "%d", (sizeof (signed char)));
13536 fclose (f);
13537   ;
13538   return 0;
13539 }
13540 _ACEOF
13541 rm -f conftest$ac_exeext
13542 if { (eval echo "$as_me:13542: \"$ac_link\"") >&5
13543   (eval $ac_link) 2>&5
13544   ac_status=$?
13545   echo "$as_me:13545: \$? = $ac_status" >&5
13546   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13547   { (eval echo "$as_me:13547: \"$ac_try\"") >&5
13548   (eval $ac_try) 2>&5
13549   ac_status=$?
13550   echo "$as_me:13550: \$? = $ac_status" >&5
13551   (exit $ac_status); }; }; then
13552   ac_cv_sizeof_signed_char=`cat conftest.val`
13553 else
13554   echo "$as_me: program exited with status $ac_status" >&5
13555 echo "$as_me: failed program was:" >&5
13556 cat conftest.$ac_ext >&5
13557 fi
13558 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13559 fi
13560 fi
13561 rm -f conftest.val
13562 else
13563   ac_cv_sizeof_signed_char=0
13564 fi
13565 fi
13566 echo "$as_me:13566: result: $ac_cv_sizeof_signed_char" >&5
13567 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13568 cat >>confdefs.h <<EOF
13569 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13570 EOF
13571
13572 echo "$as_me:13572: checking for ANSI C header files" >&5
13573 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13574 if test "${ac_cv_header_stdc+set}" = set; then
13575   echo $ECHO_N "(cached) $ECHO_C" >&6
13576 else
13577   cat >conftest.$ac_ext <<_ACEOF
13578 #line 13578 "configure"
13579 #include "confdefs.h"
13580 #include <stdlib.h>
13581 #include <stdarg.h>
13582 #include <string.h>
13583 #include <float.h>
13584
13585 _ACEOF
13586 if { (eval echo "$as_me:13586: \"$ac_cpp conftest.$ac_ext\"") >&5
13587   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13588   ac_status=$?
13589   egrep -v '^ *\+' conftest.er1 >conftest.err
13590   rm -f conftest.er1
13591   cat conftest.err >&5
13592   echo "$as_me:13592: \$? = $ac_status" >&5
13593   (exit $ac_status); } >/dev/null; then
13594   if test -s conftest.err; then
13595     ac_cpp_err=$ac_c_preproc_warn_flag
13596   else
13597     ac_cpp_err=
13598   fi
13599 else
13600   ac_cpp_err=yes
13601 fi
13602 if test -z "$ac_cpp_err"; then
13603   ac_cv_header_stdc=yes
13604 else
13605   echo "$as_me: failed program was:" >&5
13606   cat conftest.$ac_ext >&5
13607   ac_cv_header_stdc=no
13608 fi
13609 rm -f conftest.err conftest.$ac_ext
13610
13611 if test $ac_cv_header_stdc = yes; then
13612   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13613   cat >conftest.$ac_ext <<_ACEOF
13614 #line 13614 "configure"
13615 #include "confdefs.h"
13616 #include <string.h>
13617
13618 _ACEOF
13619 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13620   egrep "memchr" >/dev/null 2>&1; then
13621   :
13622 else
13623   ac_cv_header_stdc=no
13624 fi
13625 rm -rf conftest*
13626
13627 fi
13628
13629 if test $ac_cv_header_stdc = yes; then
13630   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13631   cat >conftest.$ac_ext <<_ACEOF
13632 #line 13632 "configure"
13633 #include "confdefs.h"
13634 #include <stdlib.h>
13635
13636 _ACEOF
13637 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13638   egrep "free" >/dev/null 2>&1; then
13639   :
13640 else
13641   ac_cv_header_stdc=no
13642 fi
13643 rm -rf conftest*
13644
13645 fi
13646
13647 if test $ac_cv_header_stdc = yes; then
13648   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13649   if test "$cross_compiling" = yes; then
13650   :
13651 else
13652   cat >conftest.$ac_ext <<_ACEOF
13653 #line 13653 "configure"
13654 #include "confdefs.h"
13655 #include <ctype.h>
13656 #if ((' ' & 0x0FF) == 0x020)
13657 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13658 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13659 #else
13660 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13661                      || ('j' <= (c) && (c) <= 'r') \
13662                      || ('s' <= (c) && (c) <= 'z'))
13663 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13664 #endif
13665
13666 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13667 int
13668 main (void)
13669 {
13670   int i;
13671   for (i = 0; i < 256; i++)
13672     if (XOR (islower (i), ISLOWER (i))
13673         || toupper (i) != TOUPPER (i))
13674       $ac_main_return(2);
13675   $ac_main_return (0);
13676 }
13677 _ACEOF
13678 rm -f conftest$ac_exeext
13679 if { (eval echo "$as_me:13679: \"$ac_link\"") >&5
13680   (eval $ac_link) 2>&5
13681   ac_status=$?
13682   echo "$as_me:13682: \$? = $ac_status" >&5
13683   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13684   { (eval echo "$as_me:13684: \"$ac_try\"") >&5
13685   (eval $ac_try) 2>&5
13686   ac_status=$?
13687   echo "$as_me:13687: \$? = $ac_status" >&5
13688   (exit $ac_status); }; }; then
13689   :
13690 else
13691   echo "$as_me: program exited with status $ac_status" >&5
13692 echo "$as_me: failed program was:" >&5
13693 cat conftest.$ac_ext >&5
13694 ac_cv_header_stdc=no
13695 fi
13696 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13697 fi
13698 fi
13699 fi
13700 echo "$as_me:13700: result: $ac_cv_header_stdc" >&5
13701 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13702 if test $ac_cv_header_stdc = yes; then
13703
13704 cat >>confdefs.h <<\EOF
13705 #define STDC_HEADERS 1
13706 EOF
13707
13708 fi
13709
13710 ac_header_dirent=no
13711 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13712   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13713 echo "$as_me:13713: checking for $ac_hdr that defines DIR" >&5
13714 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13715 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13716   echo $ECHO_N "(cached) $ECHO_C" >&6
13717 else
13718   cat >conftest.$ac_ext <<_ACEOF
13719 #line 13719 "configure"
13720 #include "confdefs.h"
13721 #include <sys/types.h>
13722 #include <$ac_hdr>
13723
13724 int
13725 main (void)
13726 {
13727 if ((DIR *) 0)
13728 return 0;
13729   ;
13730   return 0;
13731 }
13732 _ACEOF
13733 rm -f conftest.$ac_objext
13734 if { (eval echo "$as_me:13734: \"$ac_compile\"") >&5
13735   (eval $ac_compile) 2>&5
13736   ac_status=$?
13737   echo "$as_me:13737: \$? = $ac_status" >&5
13738   (exit $ac_status); } &&
13739          { ac_try='test -s conftest.$ac_objext'
13740   { (eval echo "$as_me:13740: \"$ac_try\"") >&5
13741   (eval $ac_try) 2>&5
13742   ac_status=$?
13743   echo "$as_me:13743: \$? = $ac_status" >&5
13744   (exit $ac_status); }; }; then
13745   eval "$as_ac_Header=yes"
13746 else
13747   echo "$as_me: failed program was:" >&5
13748 cat conftest.$ac_ext >&5
13749 eval "$as_ac_Header=no"
13750 fi
13751 rm -f conftest.$ac_objext conftest.$ac_ext
13752 fi
13753 echo "$as_me:13753: result: `eval echo '${'$as_ac_Header'}'`" >&5
13754 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13755 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13756   cat >>confdefs.h <<EOF
13757 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13758 EOF
13759
13760 ac_header_dirent=$ac_hdr; break
13761 fi
13762
13763 done
13764 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13765 if test $ac_header_dirent = dirent.h; then
13766   echo "$as_me:13766: checking for opendir in -ldir" >&5
13767 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13768 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13769   echo $ECHO_N "(cached) $ECHO_C" >&6
13770 else
13771   ac_check_lib_save_LIBS=$LIBS
13772 LIBS="-ldir  $LIBS"
13773 cat >conftest.$ac_ext <<_ACEOF
13774 #line 13774 "configure"
13775 #include "confdefs.h"
13776
13777 /* Override any gcc2 internal prototype to avoid an error.  */
13778 #ifdef __cplusplus
13779 extern "C"
13780 #endif
13781 /* We use char because int might match the return type of a gcc2
13782    builtin and then its argument prototype would still apply.  */
13783 char opendir ();
13784 int
13785 main (void)
13786 {
13787 opendir ();
13788   ;
13789   return 0;
13790 }
13791 _ACEOF
13792 rm -f conftest.$ac_objext conftest$ac_exeext
13793 if { (eval echo "$as_me:13793: \"$ac_link\"") >&5
13794   (eval $ac_link) 2>&5
13795   ac_status=$?
13796   echo "$as_me:13796: \$? = $ac_status" >&5
13797   (exit $ac_status); } &&
13798          { ac_try='test -s conftest$ac_exeext'
13799   { (eval echo "$as_me:13799: \"$ac_try\"") >&5
13800   (eval $ac_try) 2>&5
13801   ac_status=$?
13802   echo "$as_me:13802: \$? = $ac_status" >&5
13803   (exit $ac_status); }; }; then
13804   ac_cv_lib_dir_opendir=yes
13805 else
13806   echo "$as_me: failed program was:" >&5
13807 cat conftest.$ac_ext >&5
13808 ac_cv_lib_dir_opendir=no
13809 fi
13810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13811 LIBS=$ac_check_lib_save_LIBS
13812 fi
13813 echo "$as_me:13813: result: $ac_cv_lib_dir_opendir" >&5
13814 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13815 if test $ac_cv_lib_dir_opendir = yes; then
13816   LIBS="$LIBS -ldir"
13817 fi
13818
13819 else
13820   echo "$as_me:13820: checking for opendir in -lx" >&5
13821 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13822 if test "${ac_cv_lib_x_opendir+set}" = set; then
13823   echo $ECHO_N "(cached) $ECHO_C" >&6
13824 else
13825   ac_check_lib_save_LIBS=$LIBS
13826 LIBS="-lx  $LIBS"
13827 cat >conftest.$ac_ext <<_ACEOF
13828 #line 13828 "configure"
13829 #include "confdefs.h"
13830
13831 /* Override any gcc2 internal prototype to avoid an error.  */
13832 #ifdef __cplusplus
13833 extern "C"
13834 #endif
13835 /* We use char because int might match the return type of a gcc2
13836    builtin and then its argument prototype would still apply.  */
13837 char opendir ();
13838 int
13839 main (void)
13840 {
13841 opendir ();
13842   ;
13843   return 0;
13844 }
13845 _ACEOF
13846 rm -f conftest.$ac_objext conftest$ac_exeext
13847 if { (eval echo "$as_me:13847: \"$ac_link\"") >&5
13848   (eval $ac_link) 2>&5
13849   ac_status=$?
13850   echo "$as_me:13850: \$? = $ac_status" >&5
13851   (exit $ac_status); } &&
13852          { ac_try='test -s 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   ac_cv_lib_x_opendir=yes
13859 else
13860   echo "$as_me: failed program was:" >&5
13861 cat conftest.$ac_ext >&5
13862 ac_cv_lib_x_opendir=no
13863 fi
13864 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13865 LIBS=$ac_check_lib_save_LIBS
13866 fi
13867 echo "$as_me:13867: result: $ac_cv_lib_x_opendir" >&5
13868 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13869 if test $ac_cv_lib_x_opendir = yes; then
13870   LIBS="$LIBS -lx"
13871 fi
13872
13873 fi
13874
13875 echo "$as_me:13875: checking whether time.h and sys/time.h may both be included" >&5
13876 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13877 if test "${ac_cv_header_time+set}" = set; then
13878   echo $ECHO_N "(cached) $ECHO_C" >&6
13879 else
13880   cat >conftest.$ac_ext <<_ACEOF
13881 #line 13881 "configure"
13882 #include "confdefs.h"
13883 #include <sys/types.h>
13884 #include <sys/time.h>
13885 #include <time.h>
13886
13887 int
13888 main (void)
13889 {
13890 if ((struct tm *) 0)
13891 return 0;
13892   ;
13893   return 0;
13894 }
13895 _ACEOF
13896 rm -f conftest.$ac_objext
13897 if { (eval echo "$as_me:13897: \"$ac_compile\"") >&5
13898   (eval $ac_compile) 2>&5
13899   ac_status=$?
13900   echo "$as_me:13900: \$? = $ac_status" >&5
13901   (exit $ac_status); } &&
13902          { ac_try='test -s conftest.$ac_objext'
13903   { (eval echo "$as_me:13903: \"$ac_try\"") >&5
13904   (eval $ac_try) 2>&5
13905   ac_status=$?
13906   echo "$as_me:13906: \$? = $ac_status" >&5
13907   (exit $ac_status); }; }; then
13908   ac_cv_header_time=yes
13909 else
13910   echo "$as_me: failed program was:" >&5
13911 cat conftest.$ac_ext >&5
13912 ac_cv_header_time=no
13913 fi
13914 rm -f conftest.$ac_objext conftest.$ac_ext
13915 fi
13916 echo "$as_me:13916: result: $ac_cv_header_time" >&5
13917 echo "${ECHO_T}$ac_cv_header_time" >&6
13918 if test $ac_cv_header_time = yes; then
13919
13920 cat >>confdefs.h <<\EOF
13921 #define TIME_WITH_SYS_TIME 1
13922 EOF
13923
13924 fi
13925
13926 ###     checks for compiler characteristics
13927 ac_ext=c
13928 ac_cpp='$CPP $CPPFLAGS'
13929 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13930 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13931 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13932 ac_main_return=return
13933
13934 echo "$as_me:13934: checking for an ANSI C-conforming const" >&5
13935 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13936 if test "${ac_cv_c_const+set}" = set; then
13937   echo $ECHO_N "(cached) $ECHO_C" >&6
13938 else
13939   cat >conftest.$ac_ext <<_ACEOF
13940 #line 13940 "configure"
13941 #include "confdefs.h"
13942
13943 int
13944 main (void)
13945 {
13946 /* FIXME: Include the comments suggested by Paul. */
13947 #ifndef __cplusplus
13948   /* Ultrix mips cc rejects this.  */
13949   typedef int charset[2];
13950   const charset x;
13951   /* SunOS 4.1.1 cc rejects this.  */
13952   char const *const *ccp;
13953   char **p;
13954   /* NEC SVR4.0.2 mips cc rejects this.  */
13955   struct point {int x, y;};
13956   static struct point const zero = {0,0};
13957   /* AIX XL C 1.02.0.0 rejects this.
13958      It does not let you subtract one const X* pointer from another in
13959      an arm of an if-expression whose if-part is not a constant
13960      expression */
13961   const char *g = "string";
13962   ccp = &g + (g ? g-g : 0);
13963   /* HPUX 7.0 cc rejects these. */
13964   ++ccp;
13965   p = (char**) ccp;
13966   ccp = (char const *const *) p;
13967   { /* SCO 3.2v4 cc rejects this.  */
13968     char *t;
13969     char const *s = 0 ? (char *) 0 : (char const *) 0;
13970
13971     *t++ = 0;
13972   }
13973   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13974     int x[] = {25, 17};
13975     const int *foo = &x[0];
13976     ++foo;
13977   }
13978   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13979     typedef const int *iptr;
13980     iptr p = 0;
13981     ++p;
13982   }
13983   { /* AIX XL C 1.02.0.0 rejects this saying
13984        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13985     struct s { int j; const int *ap[3]; };
13986     struct s *b; b->j = 5;
13987   }
13988   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13989     const int foo = 10;
13990   }
13991 #endif
13992
13993   ;
13994   return 0;
13995 }
13996 _ACEOF
13997 rm -f conftest.$ac_objext
13998 if { (eval echo "$as_me:13998: \"$ac_compile\"") >&5
13999   (eval $ac_compile) 2>&5
14000   ac_status=$?
14001   echo "$as_me:14001: \$? = $ac_status" >&5
14002   (exit $ac_status); } &&
14003          { ac_try='test -s conftest.$ac_objext'
14004   { (eval echo "$as_me:14004: \"$ac_try\"") >&5
14005   (eval $ac_try) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit $ac_status); }; }; then
14009   ac_cv_c_const=yes
14010 else
14011   echo "$as_me: failed program was:" >&5
14012 cat conftest.$ac_ext >&5
14013 ac_cv_c_const=no
14014 fi
14015 rm -f conftest.$ac_objext conftest.$ac_ext
14016 fi
14017 echo "$as_me:14017: result: $ac_cv_c_const" >&5
14018 echo "${ECHO_T}$ac_cv_c_const" >&6
14019 if test $ac_cv_c_const = no; then
14020
14021 cat >>confdefs.h <<\EOF
14022 #define const
14023 EOF
14024
14025 fi
14026
14027 ###     Checks for external-data
14028
14029 echo "$as_me:14029: checking if data-only library module links" >&5
14030 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
14031 if test "${cf_cv_link_dataonly+set}" = set; then
14032   echo $ECHO_N "(cached) $ECHO_C" >&6
14033 else
14034
14035         rm -f conftest.a
14036         cat >conftest.$ac_ext <<EOF
14037 #line 14037 "configure"
14038 int     testdata[3] = { 123, 456, 789 };
14039 EOF
14040         if { (eval echo "$as_me:14040: \"$ac_compile\"") >&5
14041   (eval $ac_compile) 2>&5
14042   ac_status=$?
14043   echo "$as_me:14043: \$? = $ac_status" >&5
14044   (exit $ac_status); } ; then
14045                 mv conftest.o data.o && \
14046                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
14047         fi
14048         rm -f conftest.$ac_ext data.o
14049         cat >conftest.$ac_ext <<EOF
14050 #line 14050 "configure"
14051 int     testfunc(void)
14052 {
14053 #if defined(NeXT)
14054         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
14055 #else
14056         extern int testdata[3];
14057         return testdata[0] == 123
14058            &&  testdata[1] == 456
14059            &&  testdata[2] == 789;
14060 #endif
14061 }
14062 EOF
14063         if { (eval echo "$as_me:14063: \"$ac_compile\"") >&5
14064   (eval $ac_compile) 2>&5
14065   ac_status=$?
14066   echo "$as_me:14066: \$? = $ac_status" >&5
14067   (exit $ac_status); }; then
14068                 mv conftest.o func.o && \
14069                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
14070         fi
14071         rm -f conftest.$ac_ext func.o
14072         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
14073         cf_saveLIBS="$LIBS"
14074         LIBS="conftest.a $LIBS"
14075         if test "$cross_compiling" = yes; then
14076   cf_cv_link_dataonly=unknown
14077 else
14078   cat >conftest.$ac_ext <<_ACEOF
14079 #line 14079 "configure"
14080 #include "confdefs.h"
14081
14082         int main(void)
14083         {
14084                 extern int testfunc();
14085                 ${cf_cv_main_return:-return} (!testfunc());
14086         }
14087
14088 _ACEOF
14089 rm -f conftest$ac_exeext
14090 if { (eval echo "$as_me:14090: \"$ac_link\"") >&5
14091   (eval $ac_link) 2>&5
14092   ac_status=$?
14093   echo "$as_me:14093: \$? = $ac_status" >&5
14094   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14095   { (eval echo "$as_me:14095: \"$ac_try\"") >&5
14096   (eval $ac_try) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit $ac_status); }; }; then
14100   cf_cv_link_dataonly=yes
14101 else
14102   echo "$as_me: program exited with status $ac_status" >&5
14103 echo "$as_me: failed program was:" >&5
14104 cat conftest.$ac_ext >&5
14105 cf_cv_link_dataonly=no
14106 fi
14107 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14108 fi
14109         LIBS="$cf_saveLIBS"
14110
14111 fi
14112
14113 echo "$as_me:14113: result: $cf_cv_link_dataonly" >&5
14114 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
14115
14116 if test "$cf_cv_link_dataonly" = no ; then
14117
14118 cat >>confdefs.h <<\EOF
14119 #define BROKEN_LINKER 1
14120 EOF
14121
14122         BROKEN_LINKER=1
14123 fi
14124
14125 ###     Checks for library functions.
14126
14127 for ac_header in \
14128 unistd.h \
14129
14130 do
14131 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14132 echo "$as_me:14132: checking for $ac_header" >&5
14133 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14134 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14135   echo $ECHO_N "(cached) $ECHO_C" >&6
14136 else
14137   cat >conftest.$ac_ext <<_ACEOF
14138 #line 14138 "configure"
14139 #include "confdefs.h"
14140 #include <$ac_header>
14141 _ACEOF
14142 if { (eval echo "$as_me:14142: \"$ac_cpp conftest.$ac_ext\"") >&5
14143   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14144   ac_status=$?
14145   egrep -v '^ *\+' conftest.er1 >conftest.err
14146   rm -f conftest.er1
14147   cat conftest.err >&5
14148   echo "$as_me:14148: \$? = $ac_status" >&5
14149   (exit $ac_status); } >/dev/null; then
14150   if test -s conftest.err; then
14151     ac_cpp_err=$ac_c_preproc_warn_flag
14152   else
14153     ac_cpp_err=
14154   fi
14155 else
14156   ac_cpp_err=yes
14157 fi
14158 if test -z "$ac_cpp_err"; then
14159   eval "$as_ac_Header=yes"
14160 else
14161   echo "$as_me: failed program was:" >&5
14162   cat conftest.$ac_ext >&5
14163   eval "$as_ac_Header=no"
14164 fi
14165 rm -f conftest.err conftest.$ac_ext
14166 fi
14167 echo "$as_me:14167: result: `eval echo '${'$as_ac_Header'}'`" >&5
14168 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14169 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14170   cat >>confdefs.h <<EOF
14171 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14172 EOF
14173
14174 fi
14175 done
14176
14177 echo "$as_me:14177: checking for working mkstemp" >&5
14178 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
14179 if test "${cf_cv_func_mkstemp+set}" = set; then
14180   echo $ECHO_N "(cached) $ECHO_C" >&6
14181 else
14182
14183 rm -rf conftest*
14184 if test "$cross_compiling" = yes; then
14185   cf_cv_func_mkstemp=maybe
14186 else
14187   cat >conftest.$ac_ext <<_ACEOF
14188 #line 14188 "configure"
14189 #include "confdefs.h"
14190
14191 #include <sys/types.h>
14192 #ifdef HAVE_UNISTD_H
14193 #include <unistd.h>
14194 #endif
14195 #include <stdlib.h>
14196 #include <stdio.h>
14197 #include <string.h>
14198 #include <sys/stat.h>
14199 int main(void)
14200 {
14201         char *tmpl = "conftestXXXXXX";
14202         char name[2][80];
14203         int n;
14204         int result = 0;
14205         int fd;
14206         struct stat sb;
14207
14208         umask(077);
14209         for (n = 0; n < 2; ++n) {
14210                 strcpy(name[n], tmpl);
14211                 if ((fd = mkstemp(name[n])) >= 0) {
14212                         if (!strcmp(name[n], tmpl)
14213                          || stat(name[n], &sb) != 0
14214                          || (sb.st_mode & S_IFMT) != S_IFREG
14215                          || (sb.st_mode & 077) != 0) {
14216                                 result = 1;
14217                         }
14218                         close(fd);
14219                 }
14220         }
14221         if (result == 0
14222          && !strcmp(name[0], name[1]))
14223                 result = 1;
14224         ${cf_cv_main_return:-return}(result);
14225 }
14226
14227 _ACEOF
14228 rm -f conftest$ac_exeext
14229 if { (eval echo "$as_me:14229: \"$ac_link\"") >&5
14230   (eval $ac_link) 2>&5
14231   ac_status=$?
14232   echo "$as_me:14232: \$? = $ac_status" >&5
14233   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14234   { (eval echo "$as_me:14234: \"$ac_try\"") >&5
14235   (eval $ac_try) 2>&5
14236   ac_status=$?
14237   echo "$as_me:14237: \$? = $ac_status" >&5
14238   (exit $ac_status); }; }; then
14239   cf_cv_func_mkstemp=yes
14240
14241 else
14242   echo "$as_me: program exited with status $ac_status" >&5
14243 echo "$as_me: failed program was:" >&5
14244 cat conftest.$ac_ext >&5
14245 cf_cv_func_mkstemp=no
14246
14247 fi
14248 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14249 fi
14250
14251 fi
14252 echo "$as_me:14252: result: $cf_cv_func_mkstemp" >&5
14253 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
14254 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
14255         echo "$as_me:14255: checking for mkstemp" >&5
14256 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
14257 if test "${ac_cv_func_mkstemp+set}" = set; then
14258   echo $ECHO_N "(cached) $ECHO_C" >&6
14259 else
14260   cat >conftest.$ac_ext <<_ACEOF
14261 #line 14261 "configure"
14262 #include "confdefs.h"
14263 /* System header to define __stub macros and hopefully few prototypes,
14264     which can conflict with char mkstemp (); below.  */
14265 #include <assert.h>
14266 /* Override any gcc2 internal prototype to avoid an error.  */
14267 #ifdef __cplusplus
14268 extern "C"
14269 #endif
14270 /* We use char because int might match the return type of a gcc2
14271    builtin and then its argument prototype would still apply.  */
14272 char mkstemp ();
14273 char (*f) ();
14274
14275 int
14276 main (void)
14277 {
14278 /* The GNU C library defines this for functions which it implements
14279     to always fail with ENOSYS.  Some functions are actually named
14280     something starting with __ and the normal name is an alias.  */
14281 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
14282 choke me
14283 #else
14284 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14285 #endif
14286
14287   ;
14288   return 0;
14289 }
14290 _ACEOF
14291 rm -f conftest.$ac_objext conftest$ac_exeext
14292 if { (eval echo "$as_me:14292: \"$ac_link\"") >&5
14293   (eval $ac_link) 2>&5
14294   ac_status=$?
14295   echo "$as_me:14295: \$? = $ac_status" >&5
14296   (exit $ac_status); } &&
14297          { ac_try='test -s conftest$ac_exeext'
14298   { (eval echo "$as_me:14298: \"$ac_try\"") >&5
14299   (eval $ac_try) 2>&5
14300   ac_status=$?
14301   echo "$as_me:14301: \$? = $ac_status" >&5
14302   (exit $ac_status); }; }; then
14303   ac_cv_func_mkstemp=yes
14304 else
14305   echo "$as_me: failed program was:" >&5
14306 cat conftest.$ac_ext >&5
14307 ac_cv_func_mkstemp=no
14308 fi
14309 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14310 fi
14311 echo "$as_me:14311: result: $ac_cv_func_mkstemp" >&5
14312 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
14313
14314 fi
14315 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
14316
14317 cat >>confdefs.h <<\EOF
14318 #define HAVE_MKSTEMP 1
14319 EOF
14320
14321 fi
14322
14323 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
14324         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14325         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14326 fi
14327
14328 cf_with_ada=yes
14329 if test "$cf_with_ada" != "no" ; then
14330
14331 cf_ada_make=gnatmake
14332 cf_ada_config="#"
14333 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
14334 set dummy $cf_ada_make; ac_word=$2
14335 echo "$as_me:14335: checking for $ac_word" >&5
14336 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14337 if test "${ac_cv_prog_gnatmake_exists+set}" = set; then
14338   echo $ECHO_N "(cached) $ECHO_C" >&6
14339 else
14340   if test -n "$gnatmake_exists"; then
14341   ac_cv_prog_gnatmake_exists="$gnatmake_exists" # Let the user override the test.
14342 else
14343   ac_save_IFS=$IFS; IFS=$ac_path_separator
14344 ac_dummy="$PATH"
14345 for ac_dir in $ac_dummy; do
14346   IFS=$ac_save_IFS
14347   test -z "$ac_dir" && ac_dir=.
14348   $as_executable_p "$ac_dir/$ac_word" || continue
14349 ac_cv_prog_gnatmake_exists="yes"
14350 echo "$as_me:14350: found $ac_dir/$ac_word" >&5
14351 break
14352 done
14353
14354   test -z "$ac_cv_prog_gnatmake_exists" && ac_cv_prog_gnatmake_exists="no"
14355 fi
14356 fi
14357 gnatmake_exists=$ac_cv_prog_gnatmake_exists
14358 if test -n "$gnatmake_exists"; then
14359   echo "$as_me:14359: result: $gnatmake_exists" >&5
14360 echo "${ECHO_T}$gnatmake_exists" >&6
14361 else
14362   echo "$as_me:14362: result: no" >&5
14363 echo "${ECHO_T}no" >&6
14364 fi
14365
14366 if test "$ac_cv_prog_gnatmake_exists" = no; then
14367         cf_ada_make=
14368         cf_cv_prog_gnat_correct=no
14369 else
14370         # Extract the first word of "gprconfig", so it can be a program name with args.
14371 set dummy gprconfig; ac_word=$2
14372 echo "$as_me:14372: checking for $ac_word" >&5
14373 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14374 if test "${ac_cv_prog_gprconfig_exists+set}" = set; then
14375   echo $ECHO_N "(cached) $ECHO_C" >&6
14376 else
14377   if test -n "$gprconfig_exists"; then
14378   ac_cv_prog_gprconfig_exists="$gprconfig_exists" # Let the user override the test.
14379 else
14380   ac_save_IFS=$IFS; IFS=$ac_path_separator
14381 ac_dummy="$PATH"
14382 for ac_dir in $ac_dummy; do
14383   IFS=$ac_save_IFS
14384   test -z "$ac_dir" && ac_dir=.
14385   $as_executable_p "$ac_dir/$ac_word" || continue
14386 ac_cv_prog_gprconfig_exists="yes"
14387 echo "$as_me:14387: found $ac_dir/$ac_word" >&5
14388 break
14389 done
14390
14391   test -z "$ac_cv_prog_gprconfig_exists" && ac_cv_prog_gprconfig_exists="no"
14392 fi
14393 fi
14394 gprconfig_exists=$ac_cv_prog_gprconfig_exists
14395 if test -n "$gprconfig_exists"; then
14396   echo "$as_me:14396: result: $gprconfig_exists" >&5
14397 echo "${ECHO_T}$gprconfig_exists" >&6
14398 else
14399   echo "$as_me:14399: result: no" >&5
14400 echo "${ECHO_T}no" >&6
14401 fi
14402
14403         if test "$ac_cv_prog_gprconfig_exists" = yes
14404         then
14405                 rm -rf conftest* *~conftest*
14406                 if mkdir conftest.src
14407                 then
14408                         cf_ada_config=""
14409                         cd conftest.src
14410                         for cf_gprconfig in Ada C
14411                         do
14412                                 echo "$as_me:14412: checking for gprconfig name for $cf_gprconfig" >&5
14413 echo $ECHO_N "checking for gprconfig name for $cf_gprconfig... $ECHO_C" >&6
14414                                 cf_gprconfig_value=`echo s| gprconfig --config=$cf_gprconfig 2>&5 | ${AWK:-awk} '/^\*/{print $3;}' | head -n 1`
14415                                 if test -n "$cf_gprconfig_value"
14416                                 then
14417                                         eval cf_ada_config_$cf_gprconfig=$cf_gprconfig_value
14418                                         echo "$as_me:14418: result: $cf_gprconfig_value" >&5
14419 echo "${ECHO_T}$cf_gprconfig_value" >&6
14420                                 else
14421                                         echo "$as_me:14421: result: missing" >&5
14422 echo "${ECHO_T}missing" >&6
14423                                         cf_ada_config="#"
14424                                         break
14425                                 fi
14426                         done
14427                         cd ..
14428                         rm -rf conftest* *~conftest*
14429                 fi
14430         else
14431                 # gprconfig is newer than gnatmake; we can continue...
14432                 cf_ada_config="##"
14433         fi
14434         if test "x$cf_ada_config" != "x#"
14435         then
14436
14437 echo "$as_me:14437: checking for gnat version" >&5
14438 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
14439 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
14440         grep '[0-9].[0-9][0-9]*' |\
14441         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
14442 echo "$as_me:14442: result: $cf_gnat_version" >&5
14443 echo "${ECHO_T}$cf_gnat_version" >&6
14444
14445 case $cf_gnat_version in
14446 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
14447         cf_cv_prog_gnat_correct=yes
14448         ;;
14449 (*)
14450         { echo "$as_me:14450: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
14451 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
14452         cf_cv_prog_gnat_correct=no
14453         ;;
14454 esac
14455
14456                 # Extract the first word of "m4", so it can be a program name with args.
14457 set dummy m4; ac_word=$2
14458 echo "$as_me:14458: checking for $ac_word" >&5
14459 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14460 if test "${ac_cv_prog_M4_exists+set}" = set; then
14461   echo $ECHO_N "(cached) $ECHO_C" >&6
14462 else
14463   if test -n "$M4_exists"; then
14464   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
14465 else
14466   ac_save_IFS=$IFS; IFS=$ac_path_separator
14467 ac_dummy="$PATH"
14468 for ac_dir in $ac_dummy; do
14469   IFS=$ac_save_IFS
14470   test -z "$ac_dir" && ac_dir=.
14471   $as_executable_p "$ac_dir/$ac_word" || continue
14472 ac_cv_prog_M4_exists="yes"
14473 echo "$as_me:14473: found $ac_dir/$ac_word" >&5
14474 break
14475 done
14476
14477   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
14478 fi
14479 fi
14480 M4_exists=$ac_cv_prog_M4_exists
14481 if test -n "$M4_exists"; then
14482   echo "$as_me:14482: result: $M4_exists" >&5
14483 echo "${ECHO_T}$M4_exists" >&6
14484 else
14485   echo "$as_me:14485: result: no" >&5
14486 echo "${ECHO_T}no" >&6
14487 fi
14488
14489                 if test "$ac_cv_prog_M4_exists" = no; then
14490                         cf_cv_prog_gnat_correct=no
14491                         echo Ada95 binding required program m4 not found. Ada95 binding disabled.
14492                 fi
14493                 if test "$cf_cv_prog_gnat_correct" = yes; then
14494                         echo "$as_me:14494: checking if GNAT works" >&5
14495 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
14496
14497 rm -rf conftest* *~conftest*
14498 cat >>conftest.ads <<CF_EOF
14499 procedure conftest;
14500 CF_EOF
14501 cat >>conftest.adb <<CF_EOF
14502 with Text_IO;
14503 with GNAT.OS_Lib;
14504 procedure conftest is
14505 begin
14506    Text_IO.Put ("Hello World");
14507    Text_IO.New_Line;
14508    GNAT.OS_Lib.OS_Exit (0);
14509 end conftest;
14510 CF_EOF
14511 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14512    if ( ./conftest 1>&5 2>&1 ) ; then
14513       cf_cv_prog_gnat_correct=yes
14514    else
14515       cf_cv_prog_gnat_correct=no
14516    fi
14517 else
14518    cf_cv_prog_gnat_correct=no
14519 fi
14520 rm -rf conftest* *~conftest*
14521
14522                         echo "$as_me:14522: result: $cf_cv_prog_gnat_correct" >&5
14523 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
14524                 fi
14525         else
14526                 cf_cv_prog_gnat_correct=no
14527         fi
14528 fi
14529
14530         if test "$cf_cv_prog_gnat_correct" = yes; then
14531
14532         echo "$as_me:14532: checking optimization options for ADAFLAGS" >&5
14533 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
14534         case "$CFLAGS" in
14535         (*-g*)
14536
14537         ADAFLAGS="$ADAFLAGS -g"
14538
14539                 ;;
14540         esac
14541         case "$CFLAGS" in
14542         (*-O*)
14543                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
14544
14545         ADAFLAGS="$ADAFLAGS $cf_O_flag"
14546
14547                 ;;
14548         esac
14549         echo "$as_me:14549: result: $ADAFLAGS" >&5
14550 echo "${ECHO_T}$ADAFLAGS" >&6
14551
14552 echo "$as_me:14552: checking if GNATPREP supports -T option" >&5
14553 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
14554 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
14555   echo $ECHO_N "(cached) $ECHO_C" >&6
14556 else
14557
14558 cf_cv_gnatprep_opt_t=no
14559 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
14560
14561 fi
14562 echo "$as_me:14562: result: $cf_cv_gnatprep_opt_t" >&5
14563 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
14564 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
14565
14566 echo "$as_me:14566: checking if GNAT supports generics" >&5
14567 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
14568 case $cf_gnat_version in
14569 (3.[1-9]*|[4-9].*)
14570         cf_gnat_generics=yes
14571         ;;
14572 (*)
14573         cf_gnat_generics=no
14574         ;;
14575 esac
14576 echo "$as_me:14576: result: $cf_gnat_generics" >&5
14577 echo "${ECHO_T}$cf_gnat_generics" >&6
14578
14579 if test "$cf_gnat_generics" = yes
14580 then
14581         cf_compile_generics=generics
14582         cf_generic_objects="\${GENOBJS}"
14583 else
14584         cf_compile_generics=
14585         cf_generic_objects=
14586 fi
14587
14588 echo "$as_me:14588: checking if GNAT supports SIGINT" >&5
14589 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
14590 if test "${cf_cv_gnat_sigint+set}" = set; then
14591   echo $ECHO_N "(cached) $ECHO_C" >&6
14592 else
14593
14594 rm -rf conftest* *~conftest*
14595 cat >>conftest.ads <<CF_EOF
14596 with Ada.Interrupts.Names;
14597
14598 package ConfTest is
14599
14600    pragma Warnings (Off);  --  the next pragma exists since 3.11p
14601    pragma Unreserve_All_Interrupts;
14602    pragma Warnings (On);
14603
14604    protected Process is
14605       procedure Stop;
14606       function Continue return Boolean;
14607       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
14608    private
14609       Done : Boolean := False;
14610    end Process;
14611
14612 end ConfTest;
14613 CF_EOF
14614 cat >>conftest.adb <<CF_EOF
14615 package body ConfTest is
14616    protected body Process is
14617       procedure Stop is
14618       begin
14619          Done := True;
14620       end Stop;
14621       function Continue return Boolean is
14622       begin
14623          return not Done;
14624       end Continue;
14625    end Process;
14626 end ConfTest;
14627 CF_EOF
14628 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14629       cf_cv_gnat_sigint=yes
14630 else
14631    cf_cv_gnat_sigint=no
14632 fi
14633 rm -rf conftest* *~conftest*
14634
14635 fi
14636 echo "$as_me:14636: result: $cf_cv_gnat_sigint" >&5
14637 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
14638
14639 if test $cf_cv_gnat_sigint = yes ; then
14640         USE_GNAT_SIGINT=""
14641 else
14642         USE_GNAT_SIGINT="#"
14643 fi
14644
14645 cf_gnat_libraries=no
14646 cf_gnat_projects=no
14647
14648 if test "$enable_gnat_projects" != no ; then
14649 echo "$as_me:14649: checking if GNAT supports project files" >&5
14650 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
14651 case $cf_gnat_version in
14652 (3.[0-9]*)
14653         ;;
14654 (*)
14655         case $cf_cv_system_name in
14656         (cygwin*|msys*)
14657                 ;;
14658         (*)
14659                 rm -rf conftest* *~conftest*
14660                 if mkdir conftest.src conftest.bin conftest.lib
14661                 then
14662                         cd conftest.src
14663                         rm -rf conftest* *~conftest*
14664                         cat >>library.gpr <<CF_EOF
14665 project Library is
14666   Kind := External ("LIB_KIND");
14667   for Library_Name use "ConfTest";
14668   for Object_Dir use ".";
14669   for Library_ALI_Dir use External("LIBRARY_DIR");
14670   for Library_Version use External ("SONAME");
14671   for Library_Kind use Kind;
14672   for Library_Dir use External("BUILD_DIR");
14673   Source_Dir := External ("SOURCE_DIR");
14674   for Source_Dirs use (Source_Dir);
14675 end Library;
14676 CF_EOF
14677                         cat >>confpackage.ads <<CF_EOF
14678 package ConfPackage is
14679    procedure conftest;
14680 end ConfPackage;
14681 CF_EOF
14682                         cat >>confpackage.adb <<CF_EOF
14683 with Text_IO;
14684 package body ConfPackage is
14685    procedure conftest is
14686    begin
14687       Text_IO.Put ("Hello World");
14688       Text_IO.New_Line;
14689    end conftest;
14690 end ConfPackage;
14691 CF_EOF
14692                         if ( $cf_ada_make $ADAFLAGS \
14693                                         -Plibrary.gpr \
14694                                         -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14695                                         -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14696                                         -XSOURCE_DIR=`pwd` \
14697                                         -XSONAME=libConfTest.so.1 \
14698                                         -XLIB_KIND=static 1>&5 2>&1 ) ; then
14699                                 cf_gnat_projects=yes
14700                         fi
14701                         cd ..
14702                 fi
14703                 if test -f conftest.lib/confpackage.ali
14704                 then
14705                         cf_gnat_libraries=yes
14706                 fi
14707                 rm -rf conftest* *~conftest*
14708                 ;;
14709         esac
14710         ;;
14711 esac
14712 echo "$as_me:14712: result: $cf_gnat_projects" >&5
14713 echo "${ECHO_T}$cf_gnat_projects" >&6
14714 fi # enable_gnat_projects
14715
14716 if test $cf_gnat_projects = yes
14717 then
14718         echo "$as_me:14718: checking if GNAT supports libraries" >&5
14719 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14720         echo "$as_me:14720: result: $cf_gnat_libraries" >&5
14721 echo "${ECHO_T}$cf_gnat_libraries" >&6
14722 fi
14723
14724 if test "$cf_gnat_projects" = yes
14725 then
14726         USE_OLD_MAKERULES="#"
14727         USE_GNAT_PROJECTS=""
14728 else
14729         USE_OLD_MAKERULES=""
14730         USE_GNAT_PROJECTS="#"
14731 fi
14732
14733 if test "$cf_gnat_libraries" = yes
14734 then
14735         USE_GNAT_LIBRARIES=""
14736 else
14737         USE_GNAT_LIBRARIES="#"
14738 fi
14739
14740 echo "$as_me:14740: checking for ada-compiler" >&5
14741 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14742
14743 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14744 if test "${with_ada_compiler+set}" = set; then
14745   withval="$with_ada_compiler"
14746   cf_ada_compiler=$withval
14747 else
14748   cf_ada_compiler=gnatmake
14749 fi;
14750
14751 echo "$as_me:14751: result: $cf_ada_compiler" >&5
14752 echo "${ECHO_T}$cf_ada_compiler" >&6
14753
14754                 cf_ada_package=terminal_interface
14755
14756 echo "$as_me:14756: checking for ada-include" >&5
14757 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14758
14759 # Check whether --with-ada-include or --without-ada-include was given.
14760 if test "${with_ada_include+set}" = set; then
14761   withval="$with_ada_include"
14762
14763 else
14764   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14765 fi; if test -n "$prefix/share/ada/adainclude" ; then
14766
14767 if test "x$prefix" != xNONE; then
14768         cf_path_syntax="$prefix"
14769 else
14770         cf_path_syntax="$ac_default_prefix"
14771 fi
14772
14773 case ".$withval" in
14774 (.\$\(*\)*|.\'*\'*)
14775         ;;
14776 (..|./*|.\\*)
14777         ;;
14778 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14779         ;;
14780 (.\${*prefix}*|.\${*dir}*)
14781         eval withval="$withval"
14782         case ".$withval" in
14783         (.NONE/*)
14784                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14785                 ;;
14786         esac
14787         ;;
14788 (.no|.NONE/*)
14789         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14790         ;;
14791 (*)
14792         { { echo "$as_me:14792: error: expected a pathname, not \"$withval\"" >&5
14793 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14794    { (exit 1); exit 1; }; }
14795         ;;
14796 esac
14797
14798 fi
14799 eval ADA_INCLUDE="$withval"
14800
14801 echo "$as_me:14801: result: $ADA_INCLUDE" >&5
14802 echo "${ECHO_T}$ADA_INCLUDE" >&6
14803
14804 echo "$as_me:14804: checking for ada-objects" >&5
14805 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14806
14807 # Check whether --with-ada-objects or --without-ada-objects was given.
14808 if test "${with_ada_objects+set}" = set; then
14809   withval="$with_ada_objects"
14810
14811 else
14812   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14813 fi; if test -n "$prefix/lib/ada/adalib" ; then
14814
14815 if test "x$prefix" != xNONE; then
14816         cf_path_syntax="$prefix"
14817 else
14818         cf_path_syntax="$ac_default_prefix"
14819 fi
14820
14821 case ".$withval" in
14822 (.\$\(*\)*|.\'*\'*)
14823         ;;
14824 (..|./*|.\\*)
14825         ;;
14826 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14827         ;;
14828 (.\${*prefix}*|.\${*dir}*)
14829         eval withval="$withval"
14830         case ".$withval" in
14831         (.NONE/*)
14832                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14833                 ;;
14834         esac
14835         ;;
14836 (.no|.NONE/*)
14837         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14838         ;;
14839 (*)
14840         { { echo "$as_me:14840: error: expected a pathname, not \"$withval\"" >&5
14841 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14842    { (exit 1); exit 1; }; }
14843         ;;
14844 esac
14845
14846 fi
14847 eval ADA_OBJECTS="$withval"
14848
14849 echo "$as_me:14849: result: $ADA_OBJECTS" >&5
14850 echo "${ECHO_T}$ADA_OBJECTS" >&6
14851
14852 echo "$as_me:14852: checking if an Ada95 shared-library should be built" >&5
14853 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14854
14855 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14856 if test "${with_ada_sharedlib+set}" = set; then
14857   withval="$with_ada_sharedlib"
14858   with_ada_sharedlib=$withval
14859 else
14860   with_ada_sharedlib=no
14861 fi;
14862 echo "$as_me:14862: result: $with_ada_sharedlib" >&5
14863 echo "${ECHO_T}$with_ada_sharedlib" >&6
14864
14865 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14866 MAKE_ADA_SHAREDLIB="#"
14867
14868 if test "x$with_ada_sharedlib" != xno
14869 then
14870         MAKE_ADA_SHAREDLIB=
14871         if test "x$with_ada_sharedlib" != xyes
14872         then
14873                 ADA_SHAREDLIB="$with_ada_sharedlib"
14874         fi
14875 fi
14876
14877         else
14878                 { { echo "$as_me:14878: error: No usable Ada compiler found" >&5
14879 echo "$as_me: error: No usable Ada compiler found" >&2;}
14880    { (exit 1); exit 1; }; }
14881         fi
14882 else
14883         { { echo "$as_me:14883: error: The Ada compiler is needed for this package" >&5
14884 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14885    { (exit 1); exit 1; }; }
14886 fi
14887
14888 ################################################################################
14889
14890 # not needed
14891 TINFO_LDFLAGS2=
14892
14893 TINFO_LIBS=
14894
14895 ### Construct the list of include-directories to be generated
14896
14897 if test "$srcdir" != "."; then
14898         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14899 fi
14900 CPPFLAGS="-I../include $CPPFLAGS"
14901 if test "$srcdir" != "."; then
14902         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14903 fi
14904 CPPFLAGS="-I. $CPPFLAGS"
14905
14906 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14907 if test "$srcdir" != "."; then
14908         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14909 fi
14910 if test "$GCC" != yes; then
14911         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14912 elif test "$includedir" != "/usr/include"; then
14913         if test "$includedir" = '${prefix}/include' ; then
14914                 if test x$prefix != x/usr ; then
14915                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14916                 fi
14917         else
14918                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14919         fi
14920 fi
14921
14922 ### Build up pieces for makefile rules
14923 echo "$as_me:14923: checking default library suffix" >&5
14924 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14925
14926         case $DFT_LWR_MODEL in
14927         (libtool) DFT_ARG_SUFFIX=''   ;;
14928         (normal)  DFT_ARG_SUFFIX=''   ;;
14929         (debug)   DFT_ARG_SUFFIX='_g' ;;
14930         (profile) DFT_ARG_SUFFIX='_p' ;;
14931         (shared)  DFT_ARG_SUFFIX=''   ;;
14932         esac
14933         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14934 echo "$as_me:14934: result: $DFT_ARG_SUFFIX" >&5
14935 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14936
14937 echo "$as_me:14937: checking default library-dependency suffix" >&5
14938 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14939
14940         case X$DFT_LWR_MODEL in
14941         (Xlibtool)
14942                 DFT_LIB_SUFFIX='.la'
14943                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14944                 ;;
14945         (Xdebug)
14946                 DFT_LIB_SUFFIX='_g.a'
14947                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14948                 ;;
14949         (Xprofile)
14950                 DFT_LIB_SUFFIX='_p.a'
14951                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14952                 ;;
14953         (Xshared)
14954                 case $cf_cv_system_name in
14955                 (aix[5-7]*)
14956                         DFT_LIB_SUFFIX='.so'
14957                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14958                         ;;
14959                 (cygwin*|msys*|mingw*)
14960                         DFT_LIB_SUFFIX='.dll'
14961                         DFT_DEP_SUFFIX='.dll.a'
14962                         ;;
14963                 (darwin*)
14964                         DFT_LIB_SUFFIX='.dylib'
14965                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14966                         ;;
14967                 (hpux*)
14968                         case $target in
14969                         (ia64*)
14970                                 DFT_LIB_SUFFIX='.so'
14971                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14972                                 ;;
14973                         (*)
14974                                 DFT_LIB_SUFFIX='.sl'
14975                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14976                                 ;;
14977                         esac
14978                         ;;
14979                 (*)
14980                         DFT_LIB_SUFFIX='.so'
14981                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14982                         ;;
14983                 esac
14984                 ;;
14985         (*)
14986                 DFT_LIB_SUFFIX='.a'
14987                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14988                 ;;
14989         esac
14990         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14991         then
14992                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14993                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14994         fi
14995 echo "$as_me:14995: result: $DFT_DEP_SUFFIX" >&5
14996 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14997
14998 echo "$as_me:14998: checking default object directory" >&5
14999 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
15000
15001         case $DFT_LWR_MODEL in
15002         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
15003         (normal)  DFT_OBJ_SUBDIR='objects' ;;
15004         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
15005         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
15006         (shared)
15007                 case $cf_cv_system_name in
15008                 (cygwin|msys)
15009                         DFT_OBJ_SUBDIR='objects' ;;
15010                 (*)
15011                         DFT_OBJ_SUBDIR='obj_s' ;;
15012                 esac
15013         esac
15014 echo "$as_me:15014: result: $DFT_OBJ_SUBDIR" >&5
15015 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
15016
15017 ### Set up low-level terminfo dependencies for makefiles.
15018
15019 if test "$DFT_LWR_MODEL" = shared ; then
15020         case $cf_cv_system_name in
15021         (cygwin*)
15022                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
15023                 ;;
15024         (msys*)
15025                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
15026                 ;;
15027         esac
15028 fi
15029
15030 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
15031
15032 ### Construct the list of subdirectories for which we'll customize makefiles
15033 ### with the appropriate compile-rules.
15034
15035 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
15036
15037 cat >>confdefs.h <<EOF
15038 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
15039 EOF
15040
15041 ### Now that we're done running tests, add the compiler-warnings, if any
15042
15043 cf_fix_cppflags=no
15044 cf_new_cflags=
15045 cf_new_cppflags=
15046 cf_new_extra_cppflags=
15047
15048 for cf_add_cflags in $EXTRA_CFLAGS
15049 do
15050 case $cf_fix_cppflags in
15051 (no)
15052         case $cf_add_cflags in
15053         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15054                 case $cf_add_cflags in
15055                 (-D*)
15056                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15057
15058                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15059                                 && test -z "${cf_tst_cflags}" \
15060                                 && cf_fix_cppflags=yes
15061
15062                         if test $cf_fix_cppflags = yes ; then
15063
15064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15066
15067                                 continue
15068                         elif test "${cf_tst_cflags}" = "\"'" ; then
15069
15070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15072
15073                                 continue
15074                         fi
15075                         ;;
15076                 esac
15077                 case "$CPPFLAGS" in
15078                 (*$cf_add_cflags)
15079                         ;;
15080                 (*)
15081                         case $cf_add_cflags in
15082                         (-D*)
15083                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15084
15085 CPPFLAGS=`echo "$CPPFLAGS" | \
15086         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15087                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15088
15089                                 ;;
15090                         esac
15091
15092         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15093         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15094
15095                         ;;
15096                 esac
15097                 ;;
15098         (*)
15099
15100         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15101         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15102
15103                 ;;
15104         esac
15105         ;;
15106 (yes)
15107
15108         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15109         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15110
15111         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15112
15113         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15114                 && test -z "${cf_tst_cflags}" \
15115                 && cf_fix_cppflags=no
15116         ;;
15117 esac
15118 done
15119
15120 if test -n "$cf_new_cflags" ; then
15121
15122         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15123         CFLAGS="${CFLAGS}$cf_new_cflags"
15124
15125 fi
15126
15127 if test -n "$cf_new_cppflags" ; then
15128
15129         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15130         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15131
15132 fi
15133
15134 if test -n "$cf_new_extra_cppflags" ; then
15135
15136         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15137         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15138
15139 fi
15140
15141 ################################################################################
15142
15143 TEST_ARG2=
15144
15145 TEST_LIBS2=
15146
15147 NCURSES_SHLIB2="sh -c"
15148
15149 ADA_SUBDIRS="include gen src doc"
15150 if test "x$cf_with_tests" != "xno" ; then
15151         ADA_SUBDIRS="$ADA_SUBDIRS samples"
15152 fi
15153 for cf_dir in $ADA_SUBDIRS
15154 do
15155         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
15156 done
15157
15158 NCURSES_TREE="#"
15159
15160 EXTERNAL_TREE=
15161
15162 # match layout used by make-tar.sh
15163 ADAHTML_DIR=../doc/ada
15164
15165 if test "x$cross_compiling" = xyes ; then
15166         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
15167 else
15168         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
15169 fi
15170
15171 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
15172 ac_config_commands="$ac_config_commands default"
15173 cat >confcache <<\_ACEOF
15174 # This file is a shell script that caches the results of configure
15175 # tests run on this system so they can be shared between configure
15176 # scripts and configure runs, see configure's option --config-cache.
15177 # It is not useful on other systems.  If it contains results you don't
15178 # want to keep, you may remove or edit it.
15179 #
15180 # config.status only pays attention to the cache file if you give it
15181 # the --recheck option to rerun configure.
15182 #
15183 # `ac_cv_env_foo' variables (set or unset) will be overriden when
15184 # loading this file, other *unset* `ac_cv_foo' will be assigned the
15185 # following values.
15186
15187 _ACEOF
15188
15189 # The following way of writing the cache mishandles newlines in values,
15190 # but we know of no workaround that is simple, portable, and efficient.
15191 # So, don't put newlines in cache variables' values.
15192 # Ultrix sh set writes to stderr and can't be redirected directly,
15193 # and sets the high bit in the cache file unless we assign to the vars.
15194 {
15195   (set) 2>&1 |
15196     case `(ac_space=' '; set | grep ac_space) 2>&1` in
15197     *ac_space=\ *)
15198       # `set' does not quote correctly, so add quotes (double-quote
15199       # substitution turns \\\\ into \\, and sed turns \\ into \).
15200       sed -n \
15201         "s/'/'\\\\''/g;
15202           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
15203       ;;
15204     *)
15205       # `set' quotes correctly as required by POSIX, so do not add quotes.
15206       sed -n \
15207         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15208       ;;
15209     esac;
15210 } |
15211   sed '
15212      t clear
15213      : clear
15214      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15215      t end
15216      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15217      : end' >>confcache
15218 if cmp -s $cache_file confcache; then :; else
15219   if test -w $cache_file; then
15220     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15221     cat confcache >$cache_file
15222   else
15223     echo "not updating unwritable cache $cache_file"
15224   fi
15225 fi
15226 rm -f confcache
15227
15228 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15229 # Let make expand exec_prefix.
15230 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15231
15232 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15233 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15234 # trailing colons and then remove the whole line if VPATH becomes empty
15235 # (actually we leave an empty line to preserve line numbers).
15236 if test "x$srcdir" = x.; then
15237   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15238 s/:*\$(srcdir):*/:/;
15239 s/:*\${srcdir}:*/:/;
15240 s/:*@srcdir@:*/:/;
15241 s/^\([^=]*=[    ]*\):*/\1/;
15242 s/:*$//;
15243 s/^[^=]*=[      ]*$//;
15244 }'
15245 fi
15246
15247 DEFS=-DHAVE_CONFIG_H
15248
15249 : ${CONFIG_STATUS=./config.status}
15250 ac_clean_files_save=$ac_clean_files
15251 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15252 { echo "$as_me:15252: creating $CONFIG_STATUS" >&5
15253 echo "$as_me: creating $CONFIG_STATUS" >&6;}
15254 cat >$CONFIG_STATUS <<_ACEOF
15255 #! $SHELL
15256 # Generated automatically by configure.
15257 # Run this file to recreate the current configuration.
15258 # Compiler output produced by configure, useful for debugging
15259 # configure, is in config.log if it exists.
15260
15261 debug=false
15262 SHELL=\${CONFIG_SHELL-$SHELL}
15263 ac_cs_invocation="\$0 \$@"
15264
15265 _ACEOF
15266
15267 cat >>$CONFIG_STATUS <<\_ACEOF
15268 # Be Bourne compatible
15269 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15270   emulate sh
15271   NULLCMD=:
15272 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
15273   set -o posix
15274 fi
15275
15276 # Name of the executable.
15277 as_me=`echo "$0" |sed 's,.*[\\/],,'`
15278
15279 if expr a : '\(a\)' >/dev/null 2>&1; then
15280   as_expr=expr
15281 else
15282   as_expr=false
15283 fi
15284
15285 rm -f conf$$ conf$$.exe conf$$.file
15286 echo >conf$$.file
15287 if ln -s conf$$.file conf$$ 2>/dev/null; then
15288   # We could just check for DJGPP; but this test a) works b) is more generic
15289   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
15290   if test -f conf$$.exe; then
15291     # Don't use ln at all; we don't have any links
15292     as_ln_s='cp -p'
15293   else
15294     as_ln_s='ln -s'
15295   fi
15296 elif ln conf$$.file conf$$ 2>/dev/null; then
15297   as_ln_s=ln
15298 else
15299   as_ln_s='cp -p'
15300 fi
15301 rm -f conf$$ conf$$.exe conf$$.file
15302
15303 as_executable_p="test -f"
15304
15305 # Support unset when possible.
15306 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
15307   as_unset=unset
15308 else
15309   as_unset=false
15310 fi
15311
15312 # NLS nuisances.
15313 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
15314 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
15315 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
15316 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
15317 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
15318 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
15319 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
15320 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
15321
15322 # IFS
15323 # We need space, tab and new line, in precisely that order.
15324 as_nl='
15325 '
15326 IFS="   $as_nl"
15327
15328 # CDPATH.
15329 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
15330
15331 exec 6>&1
15332
15333 _ACEOF
15334
15335 # Files that config.status was made for.
15336 if test -n "$ac_config_files"; then
15337   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
15338 fi
15339
15340 if test -n "$ac_config_headers"; then
15341   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
15342 fi
15343
15344 if test -n "$ac_config_links"; then
15345   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
15346 fi
15347
15348 if test -n "$ac_config_commands"; then
15349   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
15350 fi
15351
15352 cat >>$CONFIG_STATUS <<\EOF
15353
15354 ac_cs_usage="\
15355 \`$as_me' instantiates files from templates according to the
15356 current configuration.
15357
15358 Usage: $0 [OPTIONS] [FILE]...
15359
15360   -h, --help       print this help, then exit
15361   -V, --version    print version number, then exit
15362   -d, --debug      don't remove temporary files
15363       --recheck    update $as_me by reconfiguring in the same conditions
15364   --file=FILE[:TEMPLATE]
15365                    instantiate the configuration file FILE
15366   --header=FILE[:TEMPLATE]
15367                    instantiate the configuration header FILE
15368
15369 Configuration files:
15370 $config_files
15371
15372 Configuration headers:
15373 $config_headers
15374
15375 Configuration commands:
15376 $config_commands
15377
15378 Report bugs to <dickey@invisible-island.net>."
15379 EOF
15380
15381 cat >>$CONFIG_STATUS <<EOF
15382 ac_cs_version="\\
15383 config.status
15384 configured by $0, generated by GNU Autoconf 2.52.20170501,
15385   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
15386
15387 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
15388 Free Software Foundation, Inc.
15389 This config.status script is free software; the Free Software Foundation
15390 gives unlimited permission to copy, distribute and modify it."
15391 srcdir=$srcdir
15392 INSTALL="$INSTALL"
15393 EOF
15394
15395 cat >>$CONFIG_STATUS <<\EOF
15396 # If no file are specified by the user, then we need to provide default
15397 # value.  By we need to know if files were specified by the user.
15398 ac_need_defaults=:
15399 while test $# != 0
15400 do
15401   case $1 in
15402   --*=*)
15403     ac_option=`expr "x$1" : 'x\([^=]*\)='`
15404     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
15405     shift
15406     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
15407     shift
15408     ;;
15409   -*);;
15410   *) # This is not an option, so the user has probably given explicit
15411      # arguments.
15412      ac_need_defaults=false;;
15413   esac
15414
15415   case $1 in
15416   # Handling of the options.
15417 EOF
15418 cat >>$CONFIG_STATUS <<EOF
15419   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15420     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
15421     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
15422 EOF
15423 cat >>$CONFIG_STATUS <<\EOF
15424   --version | --vers* | -V )
15425     echo "$ac_cs_version"; exit 0 ;;
15426   --he | --h)
15427     # Conflict between --help and --header
15428     { { echo "$as_me:15428: error: ambiguous option: $1
15429 Try \`$0 --help' for more information." >&5
15430 echo "$as_me: error: ambiguous option: $1
15431 Try \`$0 --help' for more information." >&2;}
15432    { (exit 1); exit 1; }; };;
15433   --help | --hel | -h )
15434     echo "$ac_cs_usage"; exit 0 ;;
15435   --debug | --d* | -d )
15436     debug=: ;;
15437   --file | --fil | --fi | --f )
15438     shift
15439     CONFIG_FILES="$CONFIG_FILES $1"
15440     ac_need_defaults=false;;
15441   --header | --heade | --head | --hea )
15442     shift
15443     CONFIG_HEADERS="$CONFIG_HEADERS $1"
15444     ac_need_defaults=false;;
15445
15446   # This is an error.
15447   -*) { { echo "$as_me:15447: error: unrecognized option: $1
15448 Try \`$0 --help' for more information." >&5
15449 echo "$as_me: error: unrecognized option: $1
15450 Try \`$0 --help' for more information." >&2;}
15451    { (exit 1); exit 1; }; } ;;
15452
15453   *) ac_config_targets="$ac_config_targets $1" ;;
15454
15455   esac
15456   shift
15457 done
15458
15459 exec 5>>config.log
15460 cat >&5 << _ACEOF
15461
15462 ## ----------------------- ##
15463 ## Running config.status.  ##
15464 ## ----------------------- ##
15465
15466 This file was extended by $as_me 2.52.20170501, executed with
15467   CONFIG_FILES    = $CONFIG_FILES
15468   CONFIG_HEADERS  = $CONFIG_HEADERS
15469   CONFIG_LINKS    = $CONFIG_LINKS
15470   CONFIG_COMMANDS = $CONFIG_COMMANDS
15471   > $ac_cs_invocation
15472 on `(hostname || uname -n) 2>/dev/null | sed 1q`
15473
15474 _ACEOF
15475 EOF
15476
15477 cat >>$CONFIG_STATUS <<EOF
15478 #
15479 # INIT-COMMANDS section.
15480 #
15481
15482 ### Special initialization commands, used to pass information from the
15483 ### configuration-run into config.status
15484
15485 AWK="$AWK"
15486 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
15487 DFT_LWR_MODEL="$DFT_LWR_MODEL"
15488 LIB_NAME="$LIB_NAME"
15489 LIB_PREFIX="$LIB_PREFIX"
15490 LIB_SUFFIX="$LIB_SUFFIX"
15491 LN_S="$LN_S"
15492 NCURSES_MAJOR="$NCURSES_MAJOR"
15493 NCURSES_MINOR="$NCURSES_MINOR"
15494 NCURSES_PATCH="$NCURSES_PATCH"
15495 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
15496 cf_cv_abi_version="$cf_cv_abi_version"
15497 cf_cv_rel_version="$cf_cv_rel_version"
15498 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
15499 cf_cv_shared_soname='$cf_cv_shared_soname'
15500 cf_cv_shlib_version="$cf_cv_shlib_version"
15501 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
15502 cf_cv_system_name="$cf_cv_system_name"
15503 host="$host"
15504 target="$target"
15505
15506 EOF
15507
15508 cat >>$CONFIG_STATUS <<\EOF
15509 for ac_config_target in $ac_config_targets
15510 do
15511   case "$ac_config_target" in
15512   # Handling of arguments.
15513   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
15514   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
15515   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15516   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15517   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
15518   *) { { echo "$as_me:15518: error: invalid argument: $ac_config_target" >&5
15519 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15520    { (exit 1); exit 1; }; };;
15521   esac
15522 done
15523
15524 # If the user did not use the arguments to specify the items to instantiate,
15525 # then the envvar interface is used.  Set only those that are not.
15526 # We use the long form for the default assignment because of an extremely
15527 # bizarre bug on SunOS 4.1.3.
15528 if $ac_need_defaults; then
15529   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15530   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15531   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15532 fi
15533
15534 # Create a temporary directory, and hook for its removal unless debugging.
15535 $debug ||
15536 {
15537   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15538   trap '{ (exit 1); exit 1; }' 1 2 13 15
15539 }
15540
15541 # Create a (secure) tmp directory for tmp files.
15542 : ${TMPDIR=/tmp}
15543 {
15544   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15545   test -n "$tmp" && test -d "$tmp"
15546 }  ||
15547 {
15548   tmp=$TMPDIR/cs$$-$RANDOM
15549   (umask 077 && mkdir $tmp)
15550 } ||
15551 {
15552    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15553    { (exit 1); exit 1; }
15554 }
15555
15556 EOF
15557
15558 cat >>$CONFIG_STATUS <<EOF
15559
15560 #
15561 # CONFIG_FILES section.
15562 #
15563
15564 # No need to generate the scripts if there are no CONFIG_FILES.
15565 # This happens for instance when ./config.status config.h
15566 if test -n "\$CONFIG_FILES"; then
15567   # Protect against being on the right side of a sed subst in config.status.
15568   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15569    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15570 s,@SHELL@,$SHELL,;t t
15571 s,@exec_prefix@,$exec_prefix,;t t
15572 s,@prefix@,$prefix,;t t
15573 s,@program_transform_name@,$program_transform_name,;t t
15574 s,@bindir@,$bindir,;t t
15575 s,@sbindir@,$sbindir,;t t
15576 s,@libexecdir@,$libexecdir,;t t
15577 s,@datarootdir@,$datarootdir,;t t
15578 s,@datadir@,$datadir,;t t
15579 s,@sysconfdir@,$sysconfdir,;t t
15580 s,@sharedstatedir@,$sharedstatedir,;t t
15581 s,@localstatedir@,$localstatedir,;t t
15582 s,@libdir@,$libdir,;t t
15583 s,@includedir@,$includedir,;t t
15584 s,@oldincludedir@,$oldincludedir,;t t
15585 s,@infodir@,$infodir,;t t
15586 s,@mandir@,$mandir,;t t
15587 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15588 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15589 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15590 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15591 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15592 s,@build_alias@,$build_alias,;t t
15593 s,@host_alias@,$host_alias,;t t
15594 s,@target_alias@,$target_alias,;t t
15595 s,@ECHO_C@,$ECHO_C,;t t
15596 s,@ECHO_N@,$ECHO_N,;t t
15597 s,@ECHO_T@,$ECHO_T,;t t
15598 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15599 s,@DEFS@,$DEFS,;t t
15600 s,@LIBS@,$LIBS,;t t
15601 s,@top_builddir@,$top_builddir,;t t
15602 s,@build@,$build,;t t
15603 s,@build_cpu@,$build_cpu,;t t
15604 s,@build_vendor@,$build_vendor,;t t
15605 s,@build_os@,$build_os,;t t
15606 s,@host@,$host,;t t
15607 s,@host_cpu@,$host_cpu,;t t
15608 s,@host_vendor@,$host_vendor,;t t
15609 s,@host_os@,$host_os,;t t
15610 s,@target@,$target,;t t
15611 s,@target_cpu@,$target_cpu,;t t
15612 s,@target_vendor@,$target_vendor,;t t
15613 s,@target_os@,$target_os,;t t
15614 s,@CC@,$CC,;t t
15615 s,@CFLAGS@,$CFLAGS,;t t
15616 s,@LDFLAGS@,$LDFLAGS,;t t
15617 s,@CPPFLAGS@,$CPPFLAGS,;t t
15618 s,@ac_ct_CC@,$ac_ct_CC,;t t
15619 s,@EXEEXT@,$EXEEXT,;t t
15620 s,@OBJEXT@,$OBJEXT,;t t
15621 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15622 s,@CPP@,$CPP,;t t
15623 s,@AWK@,$AWK,;t t
15624 s,@EGREP@,$EGREP,;t t
15625 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15626 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15627 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15628 s,@LN_S@,$LN_S,;t t
15629 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
15630 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
15631 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15632 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
15633 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
15634 s,@SET_MAKE@,$SET_MAKE,;t t
15635 s,@CTAGS@,$CTAGS,;t t
15636 s,@ETAGS@,$ETAGS,;t t
15637 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15638 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15639 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
15640 s,@RANLIB@,$RANLIB,;t t
15641 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
15642 s,@LD@,$LD,;t t
15643 s,@ac_ct_LD@,$ac_ct_LD,;t t
15644 s,@AR@,$AR,;t t
15645 s,@ac_ct_AR@,$ac_ct_AR,;t t
15646 s,@ARFLAGS@,$ARFLAGS,;t t
15647 s,@DESTDIR@,$DESTDIR,;t t
15648 s,@BUILD_CC@,$BUILD_CC,;t t
15649 s,@BUILD_CPP@,$BUILD_CPP,;t t
15650 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
15651 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
15652 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
15653 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
15654 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
15655 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
15656 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
15657 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15658 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15659 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
15660 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
15661 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
15662 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
15663 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15664 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15665 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
15666 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
15667 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
15668 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
15669 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
15670 s,@CC_G_OPT@,$CC_G_OPT,;t t
15671 s,@LD_MODEL@,$LD_MODEL,;t t
15672 s,@shlibdir@,$shlibdir,;t t
15673 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
15674 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15675 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
15676 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15677 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
15678 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
15679 s,@LINK_PROGS@,$LINK_PROGS,;t t
15680 s,@LINK_TESTS@,$LINK_TESTS,;t t
15681 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
15682 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15683 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
15684 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
15685 s,@RPATH_LIST@,$RPATH_LIST,;t t
15686 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
15687 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
15688 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
15689 s,@PTHREAD@,$PTHREAD,;t t
15690 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
15691 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15692 s,@ECHO_LT@,$ECHO_LT,;t t
15693 s,@ECHO_LD@,$ECHO_LD,;t t
15694 s,@RULE_CC@,$RULE_CC,;t t
15695 s,@SHOW_CC@,$SHOW_CC,;t t
15696 s,@ECHO_CC@,$ECHO_CC,;t t
15697 s,@ADAFLAGS@,$ADAFLAGS,;t t
15698 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15699 s,@ADA_TRACE@,$ADA_TRACE,;t t
15700 s,@gnatmake_exists@,$gnatmake_exists,;t t
15701 s,@gprconfig_exists@,$gprconfig_exists,;t t
15702 s,@M4_exists@,$M4_exists,;t t
15703 s,@cf_ada_make@,$cf_ada_make,;t t
15704 s,@cf_ada_config@,$cf_ada_config,;t t
15705 s,@cf_ada_config_Ada@,$cf_ada_config_Ada,;t t
15706 s,@cf_ada_config_C@,$cf_ada_config_C,;t t
15707 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
15708 s,@cf_compile_generics@,$cf_compile_generics,;t t
15709 s,@cf_generic_objects@,$cf_generic_objects,;t t
15710 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
15711 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15712 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15713 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15714 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15715 s,@cf_ada_package@,$cf_ada_package,;t t
15716 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15717 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15718 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15719 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15720 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15721 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15722 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15723 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15724 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15725 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15726 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15727 s,@TEST_ARG2@,$TEST_ARG2,;t t
15728 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15729 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15730 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15731 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15732 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15733 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15734 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15735 CEOF
15736
15737 EOF
15738
15739   cat >>$CONFIG_STATUS <<\EOF
15740   # Split the substitutions into bite-sized pieces for seds with
15741   # small command number limits, like on Digital OSF/1 and HP-UX.
15742   ac_max_sed_lines=48
15743   ac_sed_frag=1 # Number of current file.
15744   ac_beg=1 # First line for current file.
15745   ac_end=$ac_max_sed_lines # Line after last line for current file.
15746   ac_more_lines=:
15747   ac_sed_cmds=
15748   while $ac_more_lines; do
15749     if test $ac_beg -gt 1; then
15750       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15751     else
15752       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15753     fi
15754     if test ! -s $tmp/subs.frag; then
15755       ac_more_lines=false
15756     else
15757       # The purpose of the label and of the branching condition is to
15758       # speed up the sed processing (if there are no `@' at all, there
15759       # is no need to browse any of the substitutions).
15760       # These are the two extra sed commands mentioned above.
15761       (echo ':t
15762   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15763       # It is possible to make a multiline substitution using escaped newlines.
15764       # Ensure that we do not split the substitution between script fragments.
15765       ac_BEG=$ac_end
15766       ac_END=`expr $ac_end + $ac_max_sed_lines`
15767       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15768       if test -s $tmp/subs.next; then
15769         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15770         if test ! -s $tmp/subs.edit; then
15771           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15772           if test ! -s $tmp/subs.edit; then
15773             if test $ac_beg -gt 1; then
15774               ac_end=`expr $ac_end - 1`
15775               continue
15776             fi
15777           fi
15778         fi
15779       fi
15780
15781       if test -z "$ac_sed_cmds"; then
15782         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15783       else
15784         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15785       fi
15786       ac_sed_frag=`expr $ac_sed_frag + 1`
15787       ac_beg=$ac_end
15788       ac_end=`expr $ac_end + $ac_max_sed_lines`
15789     fi
15790   done
15791   if test -z "$ac_sed_cmds"; then
15792     ac_sed_cmds=cat
15793   fi
15794 fi # test -n "$CONFIG_FILES"
15795
15796 EOF
15797 cat >>$CONFIG_STATUS <<\EOF
15798 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15799   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15800   case $ac_file in
15801   - | *:- | *:-:* ) # input from stdin
15802         cat >$tmp/stdin
15803         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15804         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15805   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15806         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15807   * )   ac_file_in=$ac_file.in ;;
15808   esac
15809
15810   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15811   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15812          X"$ac_file" : 'X\(//\)[^/]' \| \
15813          X"$ac_file" : 'X\(//\)$' \| \
15814          X"$ac_file" : 'X\(/\)' \| \
15815          .     : '\(.\)' 2>/dev/null ||
15816 echo X"$ac_file" |
15817     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15818           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15819           /^X\(\/\/\)$/{ s//\1/; q; }
15820           /^X\(\/\).*/{ s//\1/; q; }
15821           s/.*/./; q'`
15822   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15823     { case "$ac_dir" in
15824   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15825   *)                      as_incr_dir=.;;
15826 esac
15827 as_dummy="$ac_dir"
15828 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15829   case $as_mkdir_dir in
15830     # Skip DOS drivespec
15831     ?:) as_incr_dir=$as_mkdir_dir ;;
15832     *)
15833       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15834       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15835     ;;
15836   esac
15837 done; }
15838
15839     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15840     # A "../" for each directory in $ac_dir_suffix.
15841     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15842   else
15843     ac_dir_suffix= ac_dots=
15844   fi
15845
15846   case $srcdir in
15847   .)  ac_srcdir=.
15848       if test -z "$ac_dots"; then
15849          ac_top_srcdir=.
15850       else
15851          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15852       fi ;;
15853   [\\/]* | ?:[\\/]* )
15854       ac_srcdir=$srcdir$ac_dir_suffix;
15855       ac_top_srcdir=$srcdir ;;
15856   *) # Relative path.
15857     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15858     ac_top_srcdir=$ac_dots$srcdir ;;
15859   esac
15860
15861   case $INSTALL in
15862   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15863   *) ac_INSTALL=$ac_dots$INSTALL ;;
15864   esac
15865
15866   if test x"$ac_file" != x-; then
15867     { echo "$as_me:15867: creating $ac_file" >&5
15868 echo "$as_me: creating $ac_file" >&6;}
15869     rm -f "$ac_file"
15870   fi
15871   # Let's still pretend it is `configure' which instantiates (i.e., don't
15872   # use $as_me), people would be surprised to read:
15873   #    /* config.h.  Generated automatically by config.status.  */
15874   configure_input="Generated automatically from `echo $ac_file_in |
15875                                                  sed 's,.*/,,'` by configure."
15876
15877   # First look for the input files in the build tree, otherwise in the
15878   # src tree.
15879   ac_file_inputs=`IFS=:
15880     for f in $ac_file_in; do
15881       case $f in
15882       -) echo $tmp/stdin ;;
15883       [\\/$]*)
15884          # Absolute (can't be DOS-style, as IFS=:)
15885          test -f "$f" || { { echo "$as_me:15885: error: cannot find input file: $f" >&5
15886 echo "$as_me: error: cannot find input file: $f" >&2;}
15887    { (exit 1); exit 1; }; }
15888          echo $f;;
15889       *) # Relative
15890          if test -f "$f"; then
15891            # Build tree
15892            echo $f
15893          elif test -f "$srcdir/$f"; then
15894            # Source tree
15895            echo $srcdir/$f
15896          else
15897            # /dev/null tree
15898            { { echo "$as_me:15898: error: cannot find input file: $f" >&5
15899 echo "$as_me: error: cannot find input file: $f" >&2;}
15900    { (exit 1); exit 1; }; }
15901          fi;;
15902       esac
15903     done` || { (exit 1); exit 1; }
15904 EOF
15905 cat >>$CONFIG_STATUS <<\EOF
15906   ac_warn_datarootdir=no
15907   if test x"$ac_file" != x-; then
15908     for ac_item in $ac_file_inputs
15909     do
15910       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15911       if test -n "$ac_seen"; then
15912         ac_used=`grep '@datarootdir@' $ac_item`
15913         if test -z "$ac_used"; then
15914           { echo "$as_me:15914: WARNING: datarootdir was used implicitly but not set:
15915 $ac_seen" >&5
15916 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15917 $ac_seen" >&2;}
15918           ac_warn_datarootdir=yes
15919         fi
15920       fi
15921       ac_seen=`grep '${datarootdir}' $ac_item`
15922       if test -n "$ac_seen"; then
15923         { echo "$as_me:15923: WARNING: datarootdir was used explicitly but not set:
15924 $ac_seen" >&5
15925 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15926 $ac_seen" >&2;}
15927         ac_warn_datarootdir=yes
15928       fi
15929     done
15930   fi
15931
15932 if test "x$ac_warn_datarootdir" = xyes; then
15933   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15934 fi
15935
15936 EOF
15937 cat >>$CONFIG_STATUS <<EOF
15938   sed "$ac_vpsub
15939 $extrasub
15940 EOF
15941 cat >>$CONFIG_STATUS <<\EOF
15942 :t
15943 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15944 s,@configure_input@,$configure_input,;t t
15945 s,@srcdir@,$ac_srcdir,;t t
15946 s,@top_srcdir@,$ac_top_srcdir,;t t
15947 s,@INSTALL@,$ac_INSTALL,;t t
15948 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15949   rm -f $tmp/stdin
15950   if test x"$ac_file" != x-; then
15951     cp $tmp/out $ac_file
15952
15953     for ac_name in prefix exec_prefix datarootdir
15954     do
15955         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15956         if test -n "$ac_seen"; then
15957             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15958             if test -z "$ac_init"; then
15959               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15960               { echo "$as_me:15960: WARNING: Variable $ac_name is used but was not set:
15961 $ac_seen" >&5
15962 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15963 $ac_seen" >&2;}
15964             fi
15965         fi
15966     done
15967     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15968     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15969     if test -s $tmp/out; then
15970       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15971       { echo "$as_me:15971: WARNING: Some variables may not be substituted:
15972 $ac_seen" >&5
15973 echo "$as_me: WARNING: Some variables may not be substituted:
15974 $ac_seen" >&2;}
15975     fi
15976   else
15977     cat $tmp/out
15978   fi
15979   rm -f $tmp/out
15980
15981 done
15982 EOF
15983 cat >>$CONFIG_STATUS <<\EOF
15984
15985 #
15986 # CONFIG_HEADER section.
15987 #
15988
15989 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15990 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15991 #
15992 # ac_d sets the value in "#define NAME VALUE" lines.
15993 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15994 ac_dB='[        ].*$,\1#\2'
15995 ac_dC=' '
15996 ac_dD=',;t'
15997 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15998 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15999 ac_iB='\([      ]\),\1#\2define\3'
16000 ac_iC=' '
16001 ac_iD='\4,;t'
16002 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16003 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16004 ac_uB='$,\1#\2define\3'
16005 ac_uC=' '
16006 ac_uD=',;t'
16007
16008 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16009   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16010   case $ac_file in
16011   - | *:- | *:-:* ) # input from stdin
16012         cat >$tmp/stdin
16013         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16014         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16015   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16016         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16017   * )   ac_file_in=$ac_file.in ;;
16018   esac
16019
16020   test x"$ac_file" != x- && { echo "$as_me:16020: creating $ac_file" >&5
16021 echo "$as_me: creating $ac_file" >&6;}
16022
16023   # First look for the input files in the build tree, otherwise in the
16024   # src tree.
16025   ac_file_inputs=`IFS=:
16026     for f in $ac_file_in; do
16027       case $f in
16028       -) echo $tmp/stdin ;;
16029       [\\/$]*)
16030          # Absolute (can't be DOS-style, as IFS=:)
16031          test -f "$f" || { { echo "$as_me:16031: error: cannot find input file: $f" >&5
16032 echo "$as_me: error: cannot find input file: $f" >&2;}
16033    { (exit 1); exit 1; }; }
16034          echo $f;;
16035       *) # Relative
16036          if test -f "$f"; then
16037            # Build tree
16038            echo $f
16039          elif test -f "$srcdir/$f"; then
16040            # Source tree
16041            echo $srcdir/$f
16042          else
16043            # /dev/null tree
16044            { { echo "$as_me:16044: error: cannot find input file: $f" >&5
16045 echo "$as_me: error: cannot find input file: $f" >&2;}
16046    { (exit 1); exit 1; }; }
16047          fi;;
16048       esac
16049     done` || { (exit 1); exit 1; }
16050   # Remove the trailing spaces.
16051   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
16052
16053 EOF
16054
16055 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
16056 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
16057 # be either 'cat' or 'sort'.
16058 cat confdefs.h | uniq >conftest.vals
16059
16060 # Break up conftest.vals because some shells have a limit on
16061 # the size of here documents, and old seds have small limits too.
16062
16063 rm -f conftest.tail
16064 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
16065 while grep . conftest.vals >/dev/null
16066 do
16067   # Write chunks of a limited-size here document to conftest.frag.
16068   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
16069   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
16070   echo 'CEOF' >> $CONFIG_STATUS
16071   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16072   rm -f conftest.vals
16073   mv conftest.tail conftest.vals
16074 done
16075 rm -f conftest.vals
16076
16077 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
16078 # marker @DEFS@.
16079 echo '  cat >> conftest.edit <<CEOF
16080 /@DEFS@/r conftest.frag
16081 /@DEFS@/d
16082 CEOF
16083 sed -f conftest.edit $tmp/in > $tmp/out
16084 rm -f $tmp/in
16085 mv $tmp/out $tmp/in
16086 rm -f conftest.edit conftest.frag
16087 ' >> $CONFIG_STATUS
16088
16089 cat >>$CONFIG_STATUS <<\EOF
16090   # Let's still pretend it is `configure' which instantiates (i.e., don't
16091   # use $as_me), people would be surprised to read:
16092   #    /* config.h.  Generated automatically by config.status.  */
16093   if test x"$ac_file" = x-; then
16094     echo "/* Generated automatically by configure.  */" >$tmp/config.h
16095   else
16096     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
16097   fi
16098   cat $tmp/in >>$tmp/config.h
16099   rm -f $tmp/in
16100   if test x"$ac_file" != x-; then
16101     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
16102       { echo "$as_me:16102: $ac_file is unchanged" >&5
16103 echo "$as_me: $ac_file is unchanged" >&6;}
16104     else
16105       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16106          X"$ac_file" : 'X\(//\)[^/]' \| \
16107          X"$ac_file" : 'X\(//\)$' \| \
16108          X"$ac_file" : 'X\(/\)' \| \
16109          .     : '\(.\)' 2>/dev/null ||
16110 echo X"$ac_file" |
16111     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16112           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16113           /^X\(\/\/\)$/{ s//\1/; q; }
16114           /^X\(\/\).*/{ s//\1/; q; }
16115           s/.*/./; q'`
16116       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16117         { case "$ac_dir" in
16118   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16119   *)                      as_incr_dir=.;;
16120 esac
16121 as_dummy="$ac_dir"
16122 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16123   case $as_mkdir_dir in
16124     # Skip DOS drivespec
16125     ?:) as_incr_dir=$as_mkdir_dir ;;
16126     *)
16127       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16128       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16129     ;;
16130   esac
16131 done; }
16132
16133       fi
16134       rm -f $ac_file
16135       mv $tmp/config.h $ac_file
16136     fi
16137   else
16138     cat $tmp/config.h
16139     rm -f $tmp/config.h
16140   fi
16141 done
16142 EOF
16143 cat >>$CONFIG_STATUS <<\EOF
16144 #
16145 # CONFIG_COMMANDS section.
16146 #
16147 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
16148   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
16149   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
16150
16151   case $ac_dest in
16152     default )
16153 if test -z "$USE_OLD_MAKERULES" ; then
16154         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
16155 fi
16156  ;;
16157   esac
16158 done
16159 EOF
16160
16161 cat >>$CONFIG_STATUS <<\EOF
16162
16163 { (exit 0); exit 0; }
16164 EOF
16165 chmod +x $CONFIG_STATUS
16166 ac_clean_files=$ac_clean_files_save
16167
16168 # configure is writing to config.log, and then calls config.status.
16169 # config.status does its own redirection, appending to config.log.
16170 # Unfortunately, on DOS this fails, as config.log is still kept open
16171 # by configure, so config.status won't be able to write to it; its
16172 # output is simply discarded.  So we exec the FD to /dev/null,
16173 # effectively closing config.log, so it can be properly (re)opened and
16174 # appended to by config.status.  When coming back to configure, we
16175 # need to make the FD available again.
16176 if test "$no_create" != yes; then
16177   ac_cs_success=:
16178   exec 5>/dev/null
16179   $SHELL $CONFIG_STATUS || ac_cs_success=false
16180   exec 5>>config.log
16181   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
16182   # would make configure fail if this is the last instruction.
16183   $ac_cs_success || { (exit 1); exit 1; }
16184 fi
16185 ${MAKE:-make} preinstall