]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
abba87a0fa6ab22456c802e9b805c91a90dabdbd
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.62 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20150926.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 libdir='${exec_prefix}/lib'
180 includedir='${prefix}/include'
181 oldincludedir='/usr/include'
182 infodir='${datarootdir}/info'
183 mandir='${datarootdir}/man'
184
185 # Identity of this package.
186 PACKAGE_NAME=
187 PACKAGE_TARNAME=
188 PACKAGE_VERSION=
189 PACKAGE_STRING=
190 PACKAGE_BUGREPORT=
191
192 ac_prev=
193 for ac_option
194 do
195   # If the previous option needs an argument, assign it.
196   if test -n "$ac_prev"; then
197     eval "$ac_prev=\$ac_option"
198     ac_prev=
199     continue
200   fi
201
202   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
203
204   # Accept the important Cygnus configure options, so we can diagnose typos.
205
206   case $ac_option in
207
208   -bindir | --bindir | --bindi | --bind | --bin | --bi)
209     ac_prev=bindir ;;
210   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
211     bindir=$ac_optarg ;;
212
213   -build | --build | --buil | --bui | --bu)
214     ac_prev=build_alias ;;
215   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
216     build_alias=$ac_optarg ;;
217
218   -cache-file | --cache-file | --cache-fil | --cache-fi \
219   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
220     ac_prev=cache_file ;;
221   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
222   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
223     cache_file=$ac_optarg ;;
224
225   --config-cache | -C)
226     cache_file=config.cache ;;
227
228   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
229     ac_prev=datadir ;;
230   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
231   | --da=*)
232     datadir=$ac_optarg ;;
233
234   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
235   | --dataroo | --dataro | --datar)
236     ac_prev=datarootdir ;;
237   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
238   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
239     datarootdir=$ac_optarg ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     eval "enable_$ac_feature=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
252     # Reject names that are not valid shell variable names.
253     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
254       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
255    { (exit 1); exit 1; }; }
256     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
257     case $ac_option in
258       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_$ac_feature='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix=$ac_optarg ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he | -h)
277     ac_init_help=long ;;
278   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
279     ac_init_help=recursive ;;
280   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
281     ac_init_help=short ;;
282
283   -host | --host | --hos | --ho)
284     ac_prev=host_alias ;;
285   -host=* | --host=* | --hos=* | --ho=*)
286     host_alias=$ac_optarg ;;
287
288   -includedir | --includedir | --includedi | --included | --include \
289   | --includ | --inclu | --incl | --inc)
290     ac_prev=includedir ;;
291   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
292   | --includ=* | --inclu=* | --incl=* | --inc=*)
293     includedir=$ac_optarg ;;
294
295   -infodir | --infodir | --infodi | --infod | --info | --inf)
296     ac_prev=infodir ;;
297   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
298     infodir=$ac_optarg ;;
299
300   -libdir | --libdir | --libdi | --libd)
301     ac_prev=libdir ;;
302   -libdir=* | --libdir=* | --libdi=* | --libd=*)
303     libdir=$ac_optarg ;;
304
305   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
306   | --libexe | --libex | --libe)
307     ac_prev=libexecdir ;;
308   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
309   | --libexe=* | --libex=* | --libe=*)
310     libexecdir=$ac_optarg ;;
311
312   -localstatedir | --localstatedir | --localstatedi | --localstated \
313   | --localstate | --localstat | --localsta | --localst \
314   | --locals | --local | --loca | --loc | --lo)
315     ac_prev=localstatedir ;;
316   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
317   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
318   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
319     localstatedir=$ac_optarg ;;
320
321   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
322     ac_prev=mandir ;;
323   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
324     mandir=$ac_optarg ;;
325
326   -nfp | --nfp | --nf)
327     # Obsolete; use --without-fp.
328     with_fp=no ;;
329
330   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
331   | --no-cr | --no-c)
332     no_create=yes ;;
333
334   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
335   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
336     no_recursion=yes ;;
337
338   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
339   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
340   | --oldin | --oldi | --old | --ol | --o)
341     ac_prev=oldincludedir ;;
342   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
343   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
344   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
345     oldincludedir=$ac_optarg ;;
346
347   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
348     ac_prev=prefix ;;
349   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
350     prefix=$ac_optarg ;;
351
352   -program-prefix | --program-prefix | --program-prefi | --program-pref \
353   | --program-pre | --program-pr | --program-p)
354     ac_prev=program_prefix ;;
355   -program-prefix=* | --program-prefix=* | --program-prefi=* \
356   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
357     program_prefix=$ac_optarg ;;
358
359   -program-suffix | --program-suffix | --program-suffi | --program-suff \
360   | --program-suf | --program-su | --program-s)
361     ac_prev=program_suffix ;;
362   -program-suffix=* | --program-suffix=* | --program-suffi=* \
363   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
364     program_suffix=$ac_optarg ;;
365
366   -program-transform-name | --program-transform-name \
367   | --program-transform-nam | --program-transform-na \
368   | --program-transform-n | --program-transform- \
369   | --program-transform | --program-transfor \
370   | --program-transfo | --program-transf \
371   | --program-trans | --program-tran \
372   | --progr-tra | --program-tr | --program-t)
373     ac_prev=program_transform_name ;;
374   -program-transform-name=* | --program-transform-name=* \
375   | --program-transform-nam=* | --program-transform-na=* \
376   | --program-transform-n=* | --program-transform-=* \
377   | --program-transform=* | --program-transfor=* \
378   | --program-transfo=* | --program-transf=* \
379   | --program-trans=* | --program-tran=* \
380   | --progr-tra=* | --program-tr=* | --program-t=*)
381     program_transform_name=$ac_optarg ;;
382
383   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
384   | -silent | --silent | --silen | --sile | --sil)
385     silent=yes ;;
386
387   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
388     ac_prev=sbindir ;;
389   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
390   | --sbi=* | --sb=*)
391     sbindir=$ac_optarg ;;
392
393   -sharedstatedir | --sharedstatedir | --sharedstatedi \
394   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
395   | --sharedst | --shareds | --shared | --share | --shar \
396   | --sha | --sh)
397     ac_prev=sharedstatedir ;;
398   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
399   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
400   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
401   | --sha=* | --sh=*)
402     sharedstatedir=$ac_optarg ;;
403
404   -site | --site | --sit)
405     ac_prev=site ;;
406   -site=* | --site=* | --sit=*)
407     site=$ac_optarg ;;
408
409   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
410     ac_prev=srcdir ;;
411   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
412     srcdir=$ac_optarg ;;
413
414   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
415   | --syscon | --sysco | --sysc | --sys | --sy)
416     ac_prev=sysconfdir ;;
417   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
418   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
419     sysconfdir=$ac_optarg ;;
420
421   -target | --target | --targe | --targ | --tar | --ta | --t)
422     ac_prev=target_alias ;;
423   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
424     target_alias=$ac_optarg ;;
425
426   -v | -verbose | --verbose | --verbos | --verbo | --verb)
427     verbose=yes ;;
428
429   -version | --version | --versio | --versi | --vers | -V)
430     ac_init_version=: ;;
431
432   -with-* | --with-*)
433     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid package name: $ac_package" >&2
437    { (exit 1); exit 1; }; }
438     ac_package=`echo $ac_package| sed 's/-/_/g'`
439     case $ac_option in
440       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
441       *) ac_optarg=yes ;;
442     esac
443     eval "with_$ac_package='$ac_optarg'" ;;
444
445   -without-* | --without-*)
446     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
447     # Reject names that are not valid shell variable names.
448     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
449       { echo "$as_me: error: invalid package name: $ac_package" >&2
450    { (exit 1); exit 1; }; }
451     ac_package=`echo $ac_package | sed 's/-/_/g'`
452     eval "with_$ac_package=no" ;;
453
454   --x)
455     # Obsolete; use --with-x.
456     with_x=yes ;;
457
458   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
459   | --x-incl | --x-inc | --x-in | --x-i)
460     ac_prev=x_includes ;;
461   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
462   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
463     x_includes=$ac_optarg ;;
464
465   -x-libraries | --x-libraries | --x-librarie | --x-librari \
466   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
467     ac_prev=x_libraries ;;
468   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
469   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
470     x_libraries=$ac_optarg ;;
471
472   -*) { echo "$as_me: error: unrecognized option: $ac_option
473 Try \`$0 --help' for more information." >&2
474    { (exit 1); exit 1; }; }
475     ;;
476
477   *=*)
478     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
479     # Reject names that are not valid shell variable names.
480     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
481       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
482    { (exit 1); exit 1; }; }
483     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
484     eval "$ac_envvar='$ac_optarg'"
485     export $ac_envvar ;;
486
487   *)
488     # FIXME: should be removed in autoconf 3.0.
489     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
490     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
491       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
492     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
493     ;;
494
495   esac
496 done
497
498 if test -n "$ac_prev"; then
499   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
500   { echo "$as_me: error: missing argument to $ac_option" >&2
501    { (exit 1); exit 1; }; }
502 fi
503
504 # Be sure to have absolute paths.
505 for ac_var in exec_prefix prefix
506 do
507   eval ac_val=$`echo $ac_var`
508   case $ac_val in
509     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
510     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
511    { (exit 1); exit 1; }; };;
512   esac
513 done
514
515 # Be sure to have absolute paths.
516 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
517               localstatedir libdir includedir oldincludedir infodir mandir
518 do
519   eval ac_val=$`echo $ac_var`
520   case $ac_val in
521     [\\/$]* | ?:[\\/]* ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # There might be people who depend on the old broken behavior: `$host'
528 # used to hold the argument of --host etc.
529 build=$build_alias
530 host=$host_alias
531 target=$target_alias
532
533 # FIXME: should be removed in autoconf 3.0.
534 if test "x$host_alias" != x; then
535   if test "x$build_alias" = x; then
536     cross_compiling=maybe
537     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
538     If a cross compiler is detected then cross compile mode will be used." >&2
539   elif test "x$build_alias" != "x$host_alias"; then
540     cross_compiling=yes
541   fi
542 fi
543
544 ac_tool_prefix=
545 test -n "$host_alias" && ac_tool_prefix=$host_alias-
546
547 test "$silent" = yes && exec 6>/dev/null
548
549 # Find the source files, if location was not specified.
550 if test -z "$srcdir"; then
551   ac_srcdir_defaulted=yes
552   # Try the directory containing this script, then its parent.
553   ac_prog=$0
554   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
555   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
556   srcdir=$ac_confdir
557   if test ! -r $srcdir/$ac_unique_file; then
558     srcdir=..
559   fi
560 else
561   ac_srcdir_defaulted=no
562 fi
563 if test ! -r $srcdir/$ac_unique_file; then
564   if test "$ac_srcdir_defaulted" = yes; then
565     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
566    { (exit 1); exit 1; }; }
567   else
568     { echo "$as_me: error: cannot find sources in $srcdir" >&2
569    { (exit 1); exit 1; }; }
570   fi
571 fi
572 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
573 ac_env_build_alias_set=${build_alias+set}
574 ac_env_build_alias_value=$build_alias
575 ac_cv_env_build_alias_set=${build_alias+set}
576 ac_cv_env_build_alias_value=$build_alias
577 ac_env_host_alias_set=${host_alias+set}
578 ac_env_host_alias_value=$host_alias
579 ac_cv_env_host_alias_set=${host_alias+set}
580 ac_cv_env_host_alias_value=$host_alias
581 ac_env_target_alias_set=${target_alias+set}
582 ac_env_target_alias_value=$target_alias
583 ac_cv_env_target_alias_set=${target_alias+set}
584 ac_cv_env_target_alias_value=$target_alias
585 ac_env_CC_set=${CC+set}
586 ac_env_CC_value=$CC
587 ac_cv_env_CC_set=${CC+set}
588 ac_cv_env_CC_value=$CC
589 ac_env_CFLAGS_set=${CFLAGS+set}
590 ac_env_CFLAGS_value=$CFLAGS
591 ac_cv_env_CFLAGS_set=${CFLAGS+set}
592 ac_cv_env_CFLAGS_value=$CFLAGS
593 ac_env_LDFLAGS_set=${LDFLAGS+set}
594 ac_env_LDFLAGS_value=$LDFLAGS
595 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
596 ac_cv_env_LDFLAGS_value=$LDFLAGS
597 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
598 ac_env_CPPFLAGS_value=$CPPFLAGS
599 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
600 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
601 ac_env_CPP_set=${CPP+set}
602 ac_env_CPP_value=$CPP
603 ac_cv_env_CPP_set=${CPP+set}
604 ac_cv_env_CPP_value=$CPP
605
606 #
607 # Report the --help message.
608 #
609 if test "$ac_init_help" = "long"; then
610   # Omit some internal or obsolete options to make the list less imposing.
611   # This message is too long to be a string in the A/UX 3.1 sh.
612   cat <<EOF
613 \`configure' configures this package to adapt to many kinds of systems.
614
615 Usage: $0 [OPTION]... [VAR=VALUE]...
616
617 To assign environment variables (e.g., CC, CFLAGS...), specify them as
618 VAR=VALUE.  See below for descriptions of some of the useful variables.
619
620 Defaults for the options are specified in brackets.
621
622 Configuration:
623   -h, --help              display this help and exit
624       --help=short        display options specific to this package
625       --help=recursive    display the short help of all the included packages
626   -V, --version           display version information and exit
627   -q, --quiet, --silent   do not print \`checking...' messages
628       --cache-file=FILE   cache test results in FILE [disabled]
629   -C, --config-cache      alias for \`--cache-file=config.cache'
630   -n, --no-create         do not create output files
631       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
632
633 EOF
634
635   cat <<EOF
636 Installation directories:
637   --prefix=PREFIX         install architecture-independent files in PREFIX
638                           [$ac_default_prefix]
639   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
640                           [PREFIX]
641
642 By default, \`make install' will install all the files in
643 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
644 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
645 for instance \`--prefix=\$HOME'.
646
647 For better control, use the options below.
648
649 Fine tuning of the installation directories:
650   --bindir=DIR            user executables [EPREFIX/bin]
651   --sbindir=DIR           system admin executables [EPREFIX/sbin]
652   --libexecdir=DIR        program executables [EPREFIX/libexec]
653   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
654   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
655   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
656   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
657   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
658   --libdir=DIR            object code libraries [EPREFIX/lib]
659   --includedir=DIR        C header files [PREFIX/include]
660   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
661   --infodir=DIR           info documentation [DATAROOTDIR/info]
662   --mandir=DIR            man documentation [DATAROOTDIR/man]
663 EOF
664
665   cat <<\EOF
666
667 Program names:
668   --program-prefix=PREFIX            prepend PREFIX to installed program names
669   --program-suffix=SUFFIX            append SUFFIX to installed program names
670   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
671
672 System types:
673   --build=BUILD           configure for building on BUILD [guessed]
674   --host=HOST       build programs to run on HOST [BUILD]
675   --target=TARGET   configure for building compilers for TARGET [HOST]
676 EOF
677 fi
678
679 if test -n "$ac_init_help"; then
680
681   cat <<\EOF
682
683 Optional Packages:
684   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
685   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
686
687 Optional Features:
688   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
689   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
690
691   --with-system-type=XXX  test: override derived host system-type
692   --with-pkg-config{=path} enable/disable use of pkg-config
693   --with-pkg-config-libdir=XXX use given directory for installing pc-files
694   --without-tests         suppress build with test-programs
695   --enable-mixed-case     tic should assume mixed-case filenames
696   --with-install-prefix   prefixes actual install-location ($DESTDIR)
697 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
698   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
699   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
700   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
701   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
702   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
703   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
704 Options to Specify the Libraries Built/Used:
705   --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)
706   --with-curses-dir=DIR   directory in which (n)curses is installed
707   --enable-widec          compile with wide-char/UTF-8 code
708   --with-lib-prefix       override library-prefix
709   --with-shlib-version=X  Specify rel or abi version for shared libs
710   --enable-rpath-link     link sample programs with rpath option
711 Fine-Tuning Your Configuration:
712   --enable-broken_linker  compile with broken-linker support code
713   --disable-largefile     omit support for large files
714   --with-rcs-ids          compile-in RCS identifiers
715 Extensions:
716   --disable-ext-funcs     disable function-extensions
717   --enable-const          compile with extra/non-standard const
718 Development Code:
719   --without-develop       disable development options
720 Experimental Code:
721   --with-pthread          use POSIX thread library
722   --enable-weak-symbols   enable weak-symbols for pthreads
723   --enable-reentrant      compile with experimental reentrant code
724   --with-wrap-prefix=XXX  override prefix used for public variables
725 Testing/development Options:
726   --disable-echo          do not display "compiling" commands
727   --enable-warnings       build: turn on GCC compiler warnings
728   --enable-assertions     test: turn on generation of assertion code
729   --enable-expanded       test: generate functions for certain macros
730   --disable-macros        test: use functions rather than macros
731   --with-trace            test: add trace() function to all models of ncurses
732   --disable-gnat-projects test: disable GNAT projects even if usable
733 Ada95 Binding Options:
734   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
735   --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
736   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
737   --with-ada-sharedlib=soname build shared-library (requires GNAT projects)
738
739 Some influential environment variables:
740   CC          C compiler command
741   CFLAGS      C compiler flags
742   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
743               nonstandard directory <lib dir>
744   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
745               headers in a nonstandard directory <include dir>
746   CPP         C preprocessor
747
748 Use these variables to override the choices made by `configure' or to help
749 it to find libraries and programs with nonstandard names/locations.
750
751 EOF
752 fi
753
754 if test "$ac_init_help" = "recursive"; then
755   # If there are subdirs, report their specific --help.
756   ac_popdir=`pwd`
757   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
758     cd $ac_subdir
759     # A "../" for each directory in /$ac_subdir.
760     ac_dots=`echo $ac_subdir |
761              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
762
763     case $srcdir in
764     .) # No --srcdir option.  We are building in place.
765       ac_sub_srcdir=$srcdir ;;
766     [\\/]* | ?:[\\/]* ) # Absolute path.
767       ac_sub_srcdir=$srcdir/$ac_subdir ;;
768     *) # Relative path.
769       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
770     esac
771
772     # Check for guested configure; otherwise get Cygnus style configure.
773     if test -f $ac_sub_srcdir/configure.gnu; then
774       echo
775       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
776     elif test -f $ac_sub_srcdir/configure; then
777       echo
778       $SHELL $ac_sub_srcdir/configure  --help=recursive
779     elif test -f $ac_sub_srcdir/configure.ac ||
780            test -f $ac_sub_srcdir/configure.in; then
781       echo
782       $ac_configure --help
783     else
784       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
785     fi
786     cd $ac_popdir
787   done
788 fi
789
790 test -n "$ac_init_help" && exit 0
791 if $ac_init_version; then
792   cat <<\EOF
793
794 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
795 Free Software Foundation, Inc.
796 This configure script is free software; the Free Software Foundation
797 gives unlimited permission to copy, distribute and modify it.
798 EOF
799   exit 0
800 fi
801 exec 5>config.log
802 cat >&5 <<EOF
803 This file contains any messages produced by compilers while
804 running configure, to aid debugging if configure makes a mistake.
805
806 It was created by $as_me, which was
807 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
808
809   $ $0 $@
810
811 EOF
812 {
813 cat <<_ASUNAME
814 ## ---------- ##
815 ## Platform.  ##
816 ## ---------- ##
817
818 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
819 uname -m = `(uname -m) 2>/dev/null || echo unknown`
820 uname -r = `(uname -r) 2>/dev/null || echo unknown`
821 uname -s = `(uname -s) 2>/dev/null || echo unknown`
822 uname -v = `(uname -v) 2>/dev/null || echo unknown`
823
824 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
825 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
826
827 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
828 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
829 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
830 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
831 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
832 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
833 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
834
835 PATH = $PATH
836
837 _ASUNAME
838 } >&5
839
840 cat >&5 <<EOF
841 ## ------------ ##
842 ## Core tests.  ##
843 ## ------------ ##
844
845 EOF
846
847 # Keep a trace of the command line.
848 # Strip out --no-create and --no-recursion so they do not pile up.
849 # Also quote any args containing shell meta-characters.
850 ac_configure_args=
851 ac_sep=
852 for ac_arg
853 do
854   case $ac_arg in
855   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
856   | --no-cr | --no-c) ;;
857   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
858   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
859   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
860     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
861     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
862     ac_sep=" " ;;
863   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
864      ac_sep=" " ;;
865   esac
866   # Get rid of the leading space.
867 done
868
869 # When interrupted or exit'd, cleanup temporary files, and complete
870 # config.log.  We remove comments because anyway the quotes in there
871 # would cause problems or look ugly.
872 trap 'exit_status=$?
873   # Save into config.log some information that might help in debugging.
874   echo >&5
875   echo "## ----------------- ##" >&5
876   echo "## Cache variables.  ##" >&5
877   echo "## ----------------- ##" >&5
878   echo >&5
879   # The following way of writing the cache mishandles newlines in values,
880 {
881   (set) 2>&1 |
882     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
883     *ac_space=\ *)
884       sed -n \
885         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
886           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
887       ;;
888     *)
889       sed -n \
890         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
891       ;;
892     esac;
893 } >&5
894   sed "/^$/d" confdefs.h >conftest.log
895   if test -s conftest.log; then
896     echo >&5
897     echo "## ------------ ##" >&5
898     echo "## confdefs.h.  ##" >&5
899     echo "## ------------ ##" >&5
900     echo >&5
901     cat conftest.log >&5
902   fi
903   (echo; echo) >&5
904   test "$ac_signal" != 0 &&
905     echo "$as_me: caught signal $ac_signal" >&5
906   echo "$as_me: exit $exit_status" >&5
907   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
908     exit $exit_status
909      ' 0
910 for ac_signal in 1 2 13 15; do
911   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
912 done
913 ac_signal=0
914
915 # confdefs.h avoids OS command line length limits that DEFS can exceed.
916 rm -rf conftest* confdefs.h
917 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
918 echo >confdefs.h
919
920 # Let the site file select an alternate cache file if it wants to.
921 # Prefer explicitly selected file to automatically selected ones.
922 if test -z "$CONFIG_SITE"; then
923   if test "x$prefix" != xNONE; then
924     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
925   else
926     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
927   fi
928 fi
929 for ac_site_file in $CONFIG_SITE; do
930   if test -r "$ac_site_file"; then
931     { echo "$as_me:931: loading site script $ac_site_file" >&5
932 echo "$as_me: loading site script $ac_site_file" >&6;}
933     cat "$ac_site_file" >&5
934     . "$ac_site_file"
935   fi
936 done
937
938 if test -r "$cache_file"; then
939   # Some versions of bash will fail to source /dev/null (special
940   # files actually), so we avoid doing that.
941   if test -f "$cache_file"; then
942     { echo "$as_me:942: loading cache $cache_file" >&5
943 echo "$as_me: loading cache $cache_file" >&6;}
944     case $cache_file in
945       [\\/]* | ?:[\\/]* ) . $cache_file;;
946       *)                      . ./$cache_file;;
947     esac
948   fi
949 else
950   { echo "$as_me:950: creating cache $cache_file" >&5
951 echo "$as_me: creating cache $cache_file" >&6;}
952   >$cache_file
953 fi
954
955 # Check that the precious variables saved in the cache have kept the same
956 # value.
957 ac_cache_corrupted=false
958 for ac_var in `(set) 2>&1 |
959                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
960   eval ac_old_set=\$ac_cv_env_${ac_var}_set
961   eval ac_new_set=\$ac_env_${ac_var}_set
962   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
963   eval ac_new_val="\$ac_env_${ac_var}_value"
964   case $ac_old_set,$ac_new_set in
965     set,)
966       { echo "$as_me:966: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
967 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
968       ac_cache_corrupted=: ;;
969     ,set)
970       { echo "$as_me:970: error: \`$ac_var' was not set in the previous run" >&5
971 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
972       ac_cache_corrupted=: ;;
973     ,);;
974     *)
975       if test "x$ac_old_val" != "x$ac_new_val"; then
976         { echo "$as_me:976: error: \`$ac_var' has changed since the previous run:" >&5
977 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
978         { echo "$as_me:978:   former value:  $ac_old_val" >&5
979 echo "$as_me:   former value:  $ac_old_val" >&2;}
980         { echo "$as_me:980:   current value: $ac_new_val" >&5
981 echo "$as_me:   current value: $ac_new_val" >&2;}
982         ac_cache_corrupted=:
983       fi;;
984   esac
985   # Pass precious variables to config.status.  It doesn't matter if
986   # we pass some twice (in addition to the command line arguments).
987   if test "$ac_new_set" = set; then
988     case $ac_new_val in
989     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
990       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
991       ac_configure_args="$ac_configure_args '$ac_arg'"
992       ;;
993     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
994        ;;
995     esac
996   fi
997 done
998 if $ac_cache_corrupted; then
999   { echo "$as_me:999: error: changes in the environment can compromise the build" >&5
1000 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1001   { { echo "$as_me:1001: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1002 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005
1006 ac_ext=c
1007 ac_cpp='$CPP $CPPFLAGS'
1008 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1009 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1010 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1011 ac_main_return=return
1012
1013 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
1014   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
1015                    ECHO_T='     ' ;;
1016   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
1017   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
1018 esac
1019 echo "#! $SHELL" >conftest.sh
1020 echo  "exit 0"   >>conftest.sh
1021 chmod +x conftest.sh
1022 if { (echo "$as_me:1022: PATH=\".;.\"; conftest.sh") >&5
1023   (PATH=".;."; conftest.sh) 2>&5
1024   ac_status=$?
1025   echo "$as_me:1025: \$? = $ac_status" >&5
1026   (exit $ac_status); }; then
1027   ac_path_separator=';'
1028 else
1029   ac_path_separator=:
1030 fi
1031 PATH_SEPARATOR="$ac_path_separator"
1032 rm -f conftest.sh
1033
1034 ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
1035
1036 top_builddir=`pwd`
1037
1038 ac_aux_dir=
1039 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1040   if test -f $ac_dir/install-sh; then
1041     ac_aux_dir=$ac_dir
1042     ac_install_sh="$ac_aux_dir/install-sh -c"
1043     break
1044   elif test -f $ac_dir/install.sh; then
1045     ac_aux_dir=$ac_dir
1046     ac_install_sh="$ac_aux_dir/install.sh -c"
1047     break
1048   elif test -f $ac_dir/shtool; then
1049     ac_aux_dir=$ac_dir
1050     ac_install_sh="$ac_aux_dir/shtool install -c"
1051     break
1052   fi
1053 done
1054 if test -z "$ac_aux_dir"; then
1055   { { echo "$as_me:1055: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1056 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1057    { (exit 1); exit 1; }; }
1058 fi
1059 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1060 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1061 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1062
1063 # Make sure we can run config.sub.
1064 $ac_config_sub sun4 >/dev/null 2>&1 ||
1065   { { echo "$as_me:1065: error: cannot run $ac_config_sub" >&5
1066 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1067    { (exit 1); exit 1; }; }
1068
1069 echo "$as_me:1069: checking build system type" >&5
1070 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1071 if test "${ac_cv_build+set}" = set; then
1072   echo $ECHO_N "(cached) $ECHO_C" >&6
1073 else
1074   ac_cv_build_alias=$build_alias
1075 test -z "$ac_cv_build_alias" &&
1076   ac_cv_build_alias=`$ac_config_guess`
1077 test -z "$ac_cv_build_alias" &&
1078   { { echo "$as_me:1078: error: cannot guess build type; you must specify one" >&5
1079 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1080    { (exit 1); exit 1; }; }
1081 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1082   { { echo "$as_me:1082: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1083 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1084    { (exit 1); exit 1; }; }
1085
1086 fi
1087 echo "$as_me:1087: result: $ac_cv_build" >&5
1088 echo "${ECHO_T}$ac_cv_build" >&6
1089 build=$ac_cv_build
1090 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1091 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1092 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1093
1094 echo "$as_me:1094: checking host system type" >&5
1095 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1096 if test "${ac_cv_host+set}" = set; then
1097   echo $ECHO_N "(cached) $ECHO_C" >&6
1098 else
1099   ac_cv_host_alias=$host_alias
1100 test -z "$ac_cv_host_alias" &&
1101   ac_cv_host_alias=$ac_cv_build_alias
1102 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1103   { { echo "$as_me:1103: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1104 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1105    { (exit 1); exit 1; }; }
1106
1107 fi
1108 echo "$as_me:1108: result: $ac_cv_host" >&5
1109 echo "${ECHO_T}$ac_cv_host" >&6
1110 host=$ac_cv_host
1111 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1112 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1113 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1114
1115 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1116         echo "$as_me:1116: checking target system type" >&5
1117 echo $ECHO_N "checking target system type... $ECHO_C" >&6
1118 if test "${ac_cv_target+set}" = set; then
1119   echo $ECHO_N "(cached) $ECHO_C" >&6
1120 else
1121   ac_cv_target_alias=$target_alias
1122 test "x$ac_cv_target_alias" = "x" &&
1123   ac_cv_target_alias=$ac_cv_host_alias
1124 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1125   { { echo "$as_me:1125: error: $ac_config_sub $ac_cv_target_alias failed" >&5
1126 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
1127    { (exit 1); exit 1; }; }
1128
1129 fi
1130 echo "$as_me:1130: result: $ac_cv_target" >&5
1131 echo "${ECHO_T}$ac_cv_target" >&6
1132 target=$ac_cv_target
1133 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1134 target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1135 target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1136
1137 # The aliases save the names the user supplied, while $host etc.
1138 # will get canonicalized.
1139 test -n "$target_alias" &&
1140   test "$program_prefix$program_suffix$program_transform_name" = \
1141     NONENONEs,x,x, &&
1142   program_prefix=${target_alias}-
1143         system_name="$host_os"
1144 else
1145         system_name="`(uname -s -r) 2>/dev/null`"
1146         if test -z "$system_name" ; then
1147                 system_name="`(hostname) 2>/dev/null`"
1148         fi
1149 fi
1150 test -n "$system_name" &&
1151 cat >>confdefs.h <<EOF
1152 #define SYSTEM_NAME "$system_name"
1153 EOF
1154
1155 if test "${cf_cv_system_name+set}" = set; then
1156   echo $ECHO_N "(cached) $ECHO_C" >&6
1157 else
1158   cf_cv_system_name="$system_name"
1159 fi
1160
1161 test -z "$system_name" && system_name="$cf_cv_system_name"
1162 test -n "$cf_cv_system_name" && echo "$as_me:1162: result: Configuring for $cf_cv_system_name" >&5
1163 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1164
1165 if test ".$system_name" != ".$cf_cv_system_name" ; then
1166         echo "$as_me:1166: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1167 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1168         { { echo "$as_me:1168: error: \"Please remove config.cache and try again.\"" >&5
1169 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1170    { (exit 1); exit 1; }; }
1171 fi
1172
1173 # Check whether --with-system-type or --without-system-type was given.
1174 if test "${with_system_type+set}" = set; then
1175   withval="$with_system_type"
1176   { echo "$as_me:1176: WARNING: overriding system type to $withval" >&5
1177 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
1178         cf_cv_system_name=$withval
1179         host_os=$withval
1180
1181 fi;
1182
1183 ###     Save the given $CFLAGS to allow user-override.
1184 cf_user_CFLAGS="$CFLAGS"
1185
1186 ###     Default install-location
1187
1188 echo "$as_me:1188: checking for prefix" >&5
1189 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
1190 if test "x$prefix" = "xNONE" ; then
1191         case "$cf_cv_system_name" in
1192                 # non-vendor systems don't have a conflict
1193         (openbsd*|freebsd*|mirbsd*|linux*|cygwin*|msys*|k*bsd*-gnu|mingw*)
1194                 prefix=/usr
1195                 ;;
1196         (*)     prefix=$ac_default_prefix
1197                 ;;
1198         esac
1199 fi
1200 echo "$as_me:1200: result: $prefix" >&5
1201 echo "${ECHO_T}$prefix" >&6
1202
1203 if test "x$prefix" = "xNONE" ; then
1204 echo "$as_me:1204: checking for default include-directory" >&5
1205 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
1206 test -n "$verbose" && echo 1>&6
1207 for cf_symbol in \
1208         $includedir \
1209         $includedir/ncurses \
1210         $prefix/include \
1211         $prefix/include/ncurses \
1212         /usr/local/include \
1213         /usr/local/include/ncurses \
1214         /usr/include \
1215         /usr/include/ncurses
1216 do
1217         cf_dir=`eval echo $cf_symbol`
1218         if test -f $cf_dir/curses.h ; then
1219         if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
1220                 includedir="$cf_symbol"
1221                 test -n "$verbose"  && echo $ac_n "     found " 1>&6
1222                 break
1223         fi
1224         fi
1225         test -n "$verbose"  && echo "   tested $cf_dir" 1>&6
1226 done
1227 echo "$as_me:1227: result: $includedir" >&5
1228 echo "${ECHO_T}$includedir" >&6
1229 fi
1230
1231 ###     Checks for programs.
1232
1233 ac_ext=c
1234 ac_cpp='$CPP $CPPFLAGS'
1235 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1236 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1237 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1238 ac_main_return=return
1239 if test -n "$ac_tool_prefix"; then
1240   for ac_prog in gnatgcc gcc cc
1241   do
1242     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1243 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1244 echo "$as_me:1244: checking for $ac_word" >&5
1245 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1246 if test "${ac_cv_prog_CC+set}" = set; then
1247   echo $ECHO_N "(cached) $ECHO_C" >&6
1248 else
1249   if test -n "$CC"; then
1250   ac_cv_prog_CC="$CC" # Let the user override the test.
1251 else
1252   ac_save_IFS=$IFS; IFS=$ac_path_separator
1253 ac_dummy="$PATH"
1254 for ac_dir in $ac_dummy; do
1255   IFS=$ac_save_IFS
1256   test -z "$ac_dir" && ac_dir=.
1257   $as_executable_p "$ac_dir/$ac_word" || continue
1258 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1259 echo "$as_me:1259: found $ac_dir/$ac_word" >&5
1260 break
1261 done
1262
1263 fi
1264 fi
1265 CC=$ac_cv_prog_CC
1266 if test -n "$CC"; then
1267   echo "$as_me:1267: result: $CC" >&5
1268 echo "${ECHO_T}$CC" >&6
1269 else
1270   echo "$as_me:1270: result: no" >&5
1271 echo "${ECHO_T}no" >&6
1272 fi
1273
1274     test -n "$CC" && break
1275   done
1276 fi
1277 if test -z "$CC"; then
1278   ac_ct_CC=$CC
1279   for ac_prog in gnatgcc gcc cc
1280 do
1281   # Extract the first word of "$ac_prog", so it can be a program name with args.
1282 set dummy $ac_prog; ac_word=$2
1283 echo "$as_me:1283: checking for $ac_word" >&5
1284 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1285 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1286   echo $ECHO_N "(cached) $ECHO_C" >&6
1287 else
1288   if test -n "$ac_ct_CC"; then
1289   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1290 else
1291   ac_save_IFS=$IFS; IFS=$ac_path_separator
1292 ac_dummy="$PATH"
1293 for ac_dir in $ac_dummy; do
1294   IFS=$ac_save_IFS
1295   test -z "$ac_dir" && ac_dir=.
1296   $as_executable_p "$ac_dir/$ac_word" || continue
1297 ac_cv_prog_ac_ct_CC="$ac_prog"
1298 echo "$as_me:1298: found $ac_dir/$ac_word" >&5
1299 break
1300 done
1301
1302 fi
1303 fi
1304 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1305 if test -n "$ac_ct_CC"; then
1306   echo "$as_me:1306: result: $ac_ct_CC" >&5
1307 echo "${ECHO_T}$ac_ct_CC" >&6
1308 else
1309   echo "$as_me:1309: result: no" >&5
1310 echo "${ECHO_T}no" >&6
1311 fi
1312
1313   test -n "$ac_ct_CC" && break
1314 done
1315
1316   CC=$ac_ct_CC
1317 fi
1318
1319 test -z "$CC" && { { echo "$as_me:1319: error: no acceptable cc found in \$PATH" >&5
1320 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1321    { (exit 1); exit 1; }; }
1322
1323 # Provide some information about the compiler.
1324 echo "$as_me:1324:" \
1325      "checking for C compiler version" >&5
1326 ac_compiler=`set X $ac_compile; echo $2`
1327 { (eval echo "$as_me:1327: \"$ac_compiler --version </dev/null >&5\"") >&5
1328   (eval $ac_compiler --version </dev/null >&5) 2>&5
1329   ac_status=$?
1330   echo "$as_me:1330: \$? = $ac_status" >&5
1331   (exit $ac_status); }
1332 { (eval echo "$as_me:1332: \"$ac_compiler -v </dev/null >&5\"") >&5
1333   (eval $ac_compiler -v </dev/null >&5) 2>&5
1334   ac_status=$?
1335   echo "$as_me:1335: \$? = $ac_status" >&5
1336   (exit $ac_status); }
1337 { (eval echo "$as_me:1337: \"$ac_compiler -V </dev/null >&5\"") >&5
1338   (eval $ac_compiler -V </dev/null >&5) 2>&5
1339   ac_status=$?
1340   echo "$as_me:1340: \$? = $ac_status" >&5
1341   (exit $ac_status); }
1342
1343 cat >conftest.$ac_ext <<_ACEOF
1344 #line 1344 "configure"
1345 #include "confdefs.h"
1346
1347 int
1348 main ()
1349 {
1350
1351   ;
1352   return 0;
1353 }
1354 _ACEOF
1355 ac_clean_files_save=$ac_clean_files
1356 ac_clean_files="$ac_clean_files a.out a.exe"
1357 # Try to create an executable without -o first, disregard a.out.
1358 # It will help us diagnose broken compilers, and finding out an intuition
1359 # of exeext.
1360 echo "$as_me:1360: checking for C compiler default output" >&5
1361 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1362 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1363 if { (eval echo "$as_me:1363: \"$ac_link_default\"") >&5
1364   (eval $ac_link_default) 2>&5
1365   ac_status=$?
1366   echo "$as_me:1366: \$? = $ac_status" >&5
1367   (exit $ac_status); }; then
1368   # Find the output, starting from the most likely.  This scheme is
1369 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1370 # resort.
1371 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1372                 ls a.out conftest 2>/dev/null;
1373                 ls a.* conftest.* 2>/dev/null`; do
1374   case $ac_file in
1375     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1376     a.out ) # We found the default executable, but exeext='' is most
1377             # certainly right.
1378             break;;
1379     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1380           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1381           export ac_cv_exeext
1382           break;;
1383     * ) break;;
1384   esac
1385 done
1386 else
1387   echo "$as_me: failed program was:" >&5
1388 cat conftest.$ac_ext >&5
1389 { { echo "$as_me:1389: error: C compiler cannot create executables" >&5
1390 echo "$as_me: error: C compiler cannot create executables" >&2;}
1391    { (exit 77); exit 77; }; }
1392 fi
1393
1394 ac_exeext=$ac_cv_exeext
1395 echo "$as_me:1395: result: $ac_file" >&5
1396 echo "${ECHO_T}$ac_file" >&6
1397
1398 # Check the compiler produces executables we can run.  If not, either
1399 # the compiler is broken, or we cross compile.
1400 echo "$as_me:1400: checking whether the C compiler works" >&5
1401 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1402 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1403 # If not cross compiling, check that we can run a simple program.
1404 if test "$cross_compiling" != yes; then
1405   if { ac_try='./$ac_file'
1406   { (eval echo "$as_me:1406: \"$ac_try\"") >&5
1407   (eval $ac_try) 2>&5
1408   ac_status=$?
1409   echo "$as_me:1409: \$? = $ac_status" >&5
1410   (exit $ac_status); }; }; then
1411     cross_compiling=no
1412   else
1413     if test "$cross_compiling" = maybe; then
1414         cross_compiling=yes
1415     else
1416         { { echo "$as_me:1416: error: cannot run C compiled programs.
1417 If you meant to cross compile, use \`--host'." >&5
1418 echo "$as_me: error: cannot run C compiled programs.
1419 If you meant to cross compile, use \`--host'." >&2;}
1420    { (exit 1); exit 1; }; }
1421     fi
1422   fi
1423 fi
1424 echo "$as_me:1424: result: yes" >&5
1425 echo "${ECHO_T}yes" >&6
1426
1427 rm -f a.out a.exe conftest$ac_cv_exeext
1428 ac_clean_files=$ac_clean_files_save
1429 # Check the compiler produces executables we can run.  If not, either
1430 # the compiler is broken, or we cross compile.
1431 echo "$as_me:1431: checking whether we are cross compiling" >&5
1432 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1433 echo "$as_me:1433: result: $cross_compiling" >&5
1434 echo "${ECHO_T}$cross_compiling" >&6
1435
1436 echo "$as_me:1436: checking for executable suffix" >&5
1437 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1438 if { (eval echo "$as_me:1438: \"$ac_link\"") >&5
1439   (eval $ac_link) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }; then
1443   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1444 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1445 # work properly (i.e., refer to `conftest.exe'), while it won't with
1446 # `rm'.
1447 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1448   case $ac_file in
1449     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1450     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1451           export ac_cv_exeext
1452           break;;
1453     * ) break;;
1454   esac
1455 done
1456 else
1457   { { echo "$as_me:1457: error: cannot compute EXEEXT: cannot compile and link" >&5
1458 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1459    { (exit 1); exit 1; }; }
1460 fi
1461
1462 rm -f conftest$ac_cv_exeext
1463 echo "$as_me:1463: result: $ac_cv_exeext" >&5
1464 echo "${ECHO_T}$ac_cv_exeext" >&6
1465
1466 rm -f conftest.$ac_ext
1467 EXEEXT=$ac_cv_exeext
1468 ac_exeext=$EXEEXT
1469 echo "$as_me:1469: checking for object suffix" >&5
1470 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1471 if test "${ac_cv_objext+set}" = set; then
1472   echo $ECHO_N "(cached) $ECHO_C" >&6
1473 else
1474   cat >conftest.$ac_ext <<_ACEOF
1475 #line 1475 "configure"
1476 #include "confdefs.h"
1477
1478 int
1479 main ()
1480 {
1481
1482   ;
1483   return 0;
1484 }
1485 _ACEOF
1486 rm -f conftest.o conftest.obj
1487 if { (eval echo "$as_me:1487: \"$ac_compile\"") >&5
1488   (eval $ac_compile) 2>&5
1489   ac_status=$?
1490   echo "$as_me:1490: \$? = $ac_status" >&5
1491   (exit $ac_status); }; then
1492   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1493   case $ac_file in
1494     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1495     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1496        break;;
1497   esac
1498 done
1499 else
1500   echo "$as_me: failed program was:" >&5
1501 cat conftest.$ac_ext >&5
1502 { { echo "$as_me:1502: error: cannot compute OBJEXT: cannot compile" >&5
1503 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1504    { (exit 1); exit 1; }; }
1505 fi
1506
1507 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1508 fi
1509 echo "$as_me:1509: result: $ac_cv_objext" >&5
1510 echo "${ECHO_T}$ac_cv_objext" >&6
1511 OBJEXT=$ac_cv_objext
1512 ac_objext=$OBJEXT
1513 echo "$as_me:1513: checking whether we are using the GNU C compiler" >&5
1514 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1515 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1516   echo $ECHO_N "(cached) $ECHO_C" >&6
1517 else
1518   cat >conftest.$ac_ext <<_ACEOF
1519 #line 1519 "configure"
1520 #include "confdefs.h"
1521
1522 int
1523 main ()
1524 {
1525 #ifndef __GNUC__
1526        choke me
1527 #endif
1528
1529   ;
1530   return 0;
1531 }
1532 _ACEOF
1533 rm -f conftest.$ac_objext
1534 if { (eval echo "$as_me:1534: \"$ac_compile\"") >&5
1535   (eval $ac_compile) 2>&5
1536   ac_status=$?
1537   echo "$as_me:1537: \$? = $ac_status" >&5
1538   (exit $ac_status); } &&
1539          { ac_try='test -s conftest.$ac_objext'
1540   { (eval echo "$as_me:1540: \"$ac_try\"") >&5
1541   (eval $ac_try) 2>&5
1542   ac_status=$?
1543   echo "$as_me:1543: \$? = $ac_status" >&5
1544   (exit $ac_status); }; }; then
1545   ac_compiler_gnu=yes
1546 else
1547   echo "$as_me: failed program was:" >&5
1548 cat conftest.$ac_ext >&5
1549 ac_compiler_gnu=no
1550 fi
1551 rm -f conftest.$ac_objext conftest.$ac_ext
1552 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1553
1554 fi
1555 echo "$as_me:1555: result: $ac_cv_c_compiler_gnu" >&5
1556 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1557 GCC=`test $ac_compiler_gnu = yes && echo yes`
1558 ac_test_CFLAGS=${CFLAGS+set}
1559 ac_save_CFLAGS=$CFLAGS
1560 CFLAGS="-g"
1561 echo "$as_me:1561: checking whether $CC accepts -g" >&5
1562 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1563 if test "${ac_cv_prog_cc_g+set}" = set; then
1564   echo $ECHO_N "(cached) $ECHO_C" >&6
1565 else
1566   cat >conftest.$ac_ext <<_ACEOF
1567 #line 1567 "configure"
1568 #include "confdefs.h"
1569
1570 int
1571 main ()
1572 {
1573
1574   ;
1575   return 0;
1576 }
1577 _ACEOF
1578 rm -f conftest.$ac_objext
1579 if { (eval echo "$as_me:1579: \"$ac_compile\"") >&5
1580   (eval $ac_compile) 2>&5
1581   ac_status=$?
1582   echo "$as_me:1582: \$? = $ac_status" >&5
1583   (exit $ac_status); } &&
1584          { ac_try='test -s conftest.$ac_objext'
1585   { (eval echo "$as_me:1585: \"$ac_try\"") >&5
1586   (eval $ac_try) 2>&5
1587   ac_status=$?
1588   echo "$as_me:1588: \$? = $ac_status" >&5
1589   (exit $ac_status); }; }; then
1590   ac_cv_prog_cc_g=yes
1591 else
1592   echo "$as_me: failed program was:" >&5
1593 cat conftest.$ac_ext >&5
1594 ac_cv_prog_cc_g=no
1595 fi
1596 rm -f conftest.$ac_objext conftest.$ac_ext
1597 fi
1598 echo "$as_me:1598: result: $ac_cv_prog_cc_g" >&5
1599 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1600 if test "$ac_test_CFLAGS" = set; then
1601   CFLAGS=$ac_save_CFLAGS
1602 elif test $ac_cv_prog_cc_g = yes; then
1603   if test "$GCC" = yes; then
1604     CFLAGS="-g -O2"
1605   else
1606     CFLAGS="-g"
1607   fi
1608 else
1609   if test "$GCC" = yes; then
1610     CFLAGS="-O2"
1611   else
1612     CFLAGS=
1613   fi
1614 fi
1615 # Some people use a C++ compiler to compile C.  Since we use `exit',
1616 # in C++ we need to declare it.  In case someone uses the same compiler
1617 # for both compiling C and C++ we need to have the C++ compiler decide
1618 # the declaration of exit, since it's the most demanding environment.
1619 cat >conftest.$ac_ext <<_ACEOF
1620 #ifndef __cplusplus
1621   choke me
1622 #endif
1623 _ACEOF
1624 rm -f conftest.$ac_objext
1625 if { (eval echo "$as_me:1625: \"$ac_compile\"") >&5
1626   (eval $ac_compile) 2>&5
1627   ac_status=$?
1628   echo "$as_me:1628: \$? = $ac_status" >&5
1629   (exit $ac_status); } &&
1630          { ac_try='test -s conftest.$ac_objext'
1631   { (eval echo "$as_me:1631: \"$ac_try\"") >&5
1632   (eval $ac_try) 2>&5
1633   ac_status=$?
1634   echo "$as_me:1634: \$? = $ac_status" >&5
1635   (exit $ac_status); }; }; then
1636   for ac_declaration in \
1637    ''\
1638    '#include <stdlib.h>' \
1639    'extern "C" void std::exit (int) throw (); using std::exit;' \
1640    'extern "C" void std::exit (int); using std::exit;' \
1641    'extern "C" void exit (int) throw ();' \
1642    'extern "C" void exit (int);' \
1643    'void exit (int);'
1644 do
1645   cat >conftest.$ac_ext <<_ACEOF
1646 #line 1646 "configure"
1647 #include "confdefs.h"
1648 #include <stdlib.h>
1649 $ac_declaration
1650 int
1651 main ()
1652 {
1653 exit (42);
1654   ;
1655   return 0;
1656 }
1657 _ACEOF
1658 rm -f conftest.$ac_objext
1659 if { (eval echo "$as_me:1659: \"$ac_compile\"") >&5
1660   (eval $ac_compile) 2>&5
1661   ac_status=$?
1662   echo "$as_me:1662: \$? = $ac_status" >&5
1663   (exit $ac_status); } &&
1664          { ac_try='test -s conftest.$ac_objext'
1665   { (eval echo "$as_me:1665: \"$ac_try\"") >&5
1666   (eval $ac_try) 2>&5
1667   ac_status=$?
1668   echo "$as_me:1668: \$? = $ac_status" >&5
1669   (exit $ac_status); }; }; then
1670   :
1671 else
1672   echo "$as_me: failed program was:" >&5
1673 cat conftest.$ac_ext >&5
1674 continue
1675 fi
1676 rm -f conftest.$ac_objext conftest.$ac_ext
1677   cat >conftest.$ac_ext <<_ACEOF
1678 #line 1678 "configure"
1679 #include "confdefs.h"
1680 $ac_declaration
1681 int
1682 main ()
1683 {
1684 exit (42);
1685   ;
1686   return 0;
1687 }
1688 _ACEOF
1689 rm -f conftest.$ac_objext
1690 if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
1691   (eval $ac_compile) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); } &&
1695          { ac_try='test -s conftest.$ac_objext'
1696   { (eval echo "$as_me:1696: \"$ac_try\"") >&5
1697   (eval $ac_try) 2>&5
1698   ac_status=$?
1699   echo "$as_me:1699: \$? = $ac_status" >&5
1700   (exit $ac_status); }; }; then
1701   break
1702 else
1703   echo "$as_me: failed program was:" >&5
1704 cat conftest.$ac_ext >&5
1705 fi
1706 rm -f conftest.$ac_objext conftest.$ac_ext
1707 done
1708 rm -rf conftest*
1709 if test -n "$ac_declaration"; then
1710   echo '#ifdef __cplusplus' >>confdefs.h
1711   echo $ac_declaration      >>confdefs.h
1712   echo '#endif'             >>confdefs.h
1713 fi
1714
1715 else
1716   echo "$as_me: failed program was:" >&5
1717 cat conftest.$ac_ext >&5
1718 fi
1719 rm -f conftest.$ac_objext conftest.$ac_ext
1720 ac_ext=c
1721 ac_cpp='$CPP $CPPFLAGS'
1722 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1723 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1724 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1725 ac_main_return=return
1726
1727 GCC_VERSION=none
1728 if test "$GCC" = yes ; then
1729         echo "$as_me:1729: checking version of $CC" >&5
1730 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1731         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1732         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1733         echo "$as_me:1733: result: $GCC_VERSION" >&5
1734 echo "${ECHO_T}$GCC_VERSION" >&6
1735 fi
1736
1737 echo "$as_me:1737: checking for $CC option to accept ANSI C" >&5
1738 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1739 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1740   echo $ECHO_N "(cached) $ECHO_C" >&6
1741 else
1742   ac_cv_prog_cc_stdc=no
1743 ac_save_CC=$CC
1744 cat >conftest.$ac_ext <<_ACEOF
1745 #line 1745 "configure"
1746 #include "confdefs.h"
1747 #include <stdarg.h>
1748 #include <stdio.h>
1749 #include <sys/types.h>
1750 #include <sys/stat.h>
1751 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1752 struct buf { int x; };
1753 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1754 static char *e (p, i)
1755      char **p;
1756      int i;
1757 {
1758   return p[i];
1759 }
1760 static char *f (char * (*g) (char **, int), char **p, ...)
1761 {
1762   char *s;
1763   va_list v;
1764   va_start (v,p);
1765   s = g (p, va_arg (v,int));
1766   va_end (v);
1767   return s;
1768 }
1769 int test (int i, double x);
1770 struct s1 {int (*f) (int a);};
1771 struct s2 {int (*f) (double a);};
1772 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1773 int argc;
1774 char **argv;
1775 int
1776 main ()
1777 {
1778 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1779   ;
1780   return 0;
1781 }
1782 _ACEOF
1783 # Don't try gcc -ansi; that turns off useful extensions and
1784 # breaks some systems' header files.
1785 # AIX                   -qlanglvl=ansi
1786 # Ultrix and OSF/1      -std1
1787 # HP-UX 10.20 and later -Ae
1788 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1789 # SVR4                  -Xc -D__EXTENSIONS__
1790 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1791 do
1792   CC="$ac_save_CC $ac_arg"
1793   rm -f conftest.$ac_objext
1794 if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
1795   (eval $ac_compile) 2>&5
1796   ac_status=$?
1797   echo "$as_me:1797: \$? = $ac_status" >&5
1798   (exit $ac_status); } &&
1799          { ac_try='test -s conftest.$ac_objext'
1800   { (eval echo "$as_me:1800: \"$ac_try\"") >&5
1801   (eval $ac_try) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit $ac_status); }; }; then
1805   ac_cv_prog_cc_stdc=$ac_arg
1806 break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext
1812 done
1813 rm -f conftest.$ac_ext conftest.$ac_objext
1814 CC=$ac_save_CC
1815
1816 fi
1817
1818 case "x$ac_cv_prog_cc_stdc" in
1819   x|xno)
1820     echo "$as_me:1820: result: none needed" >&5
1821 echo "${ECHO_T}none needed" >&6 ;;
1822   *)
1823     echo "$as_me:1823: result: $ac_cv_prog_cc_stdc" >&5
1824 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1825     CC="$CC $ac_cv_prog_cc_stdc" ;;
1826 esac
1827
1828 # This should have been defined by AC_PROG_CC
1829 : ${CC:=cc}
1830
1831 echo "$as_me:1831: checking \$CC variable" >&5
1832 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1833 case "$CC" in
1834 (*[\ \  ]-*)
1835         echo "$as_me:1835: result: broken" >&5
1836 echo "${ECHO_T}broken" >&6
1837         { echo "$as_me:1837: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1838 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1839         # humor him...
1840         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1841         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1842         CC="$cf_prog"
1843         for cf_arg in $cf_flags
1844         do
1845                 case "x$cf_arg" in
1846                 (x-[IUDfgOW]*)
1847
1848 cf_fix_cppflags=no
1849 cf_new_cflags=
1850 cf_new_cppflags=
1851 cf_new_extra_cppflags=
1852
1853 for cf_add_cflags in $cf_arg
1854 do
1855 case $cf_fix_cppflags in
1856 (no)
1857         case $cf_add_cflags in
1858         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1859                 case $cf_add_cflags in
1860                 (-D*)
1861                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1862
1863                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1864                                 && test -z "${cf_tst_cflags}" \
1865                                 && cf_fix_cppflags=yes
1866
1867                         if test $cf_fix_cppflags = yes ; then
1868
1869         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1870         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1871
1872                                 continue
1873                         elif test "${cf_tst_cflags}" = "\"'" ; then
1874
1875         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1876         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1877
1878                                 continue
1879                         fi
1880                         ;;
1881                 esac
1882                 case "$CPPFLAGS" in
1883                 (*$cf_add_cflags)
1884                         ;;
1885                 (*)
1886                         case $cf_add_cflags in
1887                         (-D*)
1888                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1889
1890 CPPFLAGS=`echo "$CPPFLAGS" | \
1891         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1892                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1893
1894                                 ;;
1895                         esac
1896
1897         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
1898         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
1899
1900                         ;;
1901                 esac
1902                 ;;
1903         (*)
1904
1905         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
1906         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
1907
1908                 ;;
1909         esac
1910         ;;
1911 (yes)
1912
1913         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1914         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1915
1916         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
1917
1918         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1919                 && test -z "${cf_tst_cflags}" \
1920                 && cf_fix_cppflags=no
1921         ;;
1922 esac
1923 done
1924
1925 if test -n "$cf_new_cflags" ; then
1926
1927         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
1928         CFLAGS="${CFLAGS}$cf_new_cflags"
1929
1930 fi
1931
1932 if test -n "$cf_new_cppflags" ; then
1933
1934         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
1935         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
1936
1937 fi
1938
1939 if test -n "$cf_new_extra_cppflags" ; then
1940
1941         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
1942         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
1943
1944 fi
1945
1946                         ;;
1947                 (*)
1948                         CC="$CC $cf_arg"
1949                         ;;
1950                 esac
1951         done
1952         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
1953
1954 echo "${as_me:-configure}:1954: testing resulting CC: '$CC' ..." 1>&5
1955
1956         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
1957
1958 echo "${as_me:-configure}:1958: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
1959
1960         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
1961
1962 echo "${as_me:-configure}:1962: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
1963
1964         ;;
1965 (*)
1966         echo "$as_me:1966: result: ok" >&5
1967 echo "${ECHO_T}ok" >&6
1968         ;;
1969 esac
1970
1971 ac_ext=c
1972 ac_cpp='$CPP $CPPFLAGS'
1973 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1974 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1975 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1976 ac_main_return=return
1977 echo "$as_me:1977: checking how to run the C preprocessor" >&5
1978 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1979 # On Suns, sometimes $CPP names a directory.
1980 if test -n "$CPP" && test -d "$CPP"; then
1981   CPP=
1982 fi
1983 if test -z "$CPP"; then
1984   if test "${ac_cv_prog_CPP+set}" = set; then
1985   echo $ECHO_N "(cached) $ECHO_C" >&6
1986 else
1987       # Double quotes because CPP needs to be expanded
1988     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1989     do
1990       ac_preproc_ok=false
1991 for ac_c_preproc_warn_flag in '' yes
1992 do
1993   # Use a header file that comes with gcc, so configuring glibc
1994   # with a fresh cross-compiler works.
1995   # On the NeXT, cc -E runs the code through the compiler's parser,
1996   # not just through cpp. "Syntax error" is here to catch this case.
1997   cat >conftest.$ac_ext <<_ACEOF
1998 #line 1998 "configure"
1999 #include "confdefs.h"
2000 #include <assert.h>
2001                      Syntax error
2002 _ACEOF
2003 if { (eval echo "$as_me:2003: \"$ac_cpp conftest.$ac_ext\"") >&5
2004   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2005   ac_status=$?
2006   egrep -v '^ *\+' conftest.er1 >conftest.err
2007   rm -f conftest.er1
2008   cat conftest.err >&5
2009   echo "$as_me:2009: \$? = $ac_status" >&5
2010   (exit $ac_status); } >/dev/null; then
2011   if test -s conftest.err; then
2012     ac_cpp_err=$ac_c_preproc_warn_flag
2013   else
2014     ac_cpp_err=
2015   fi
2016 else
2017   ac_cpp_err=yes
2018 fi
2019 if test -z "$ac_cpp_err"; then
2020   :
2021 else
2022   echo "$as_me: failed program was:" >&5
2023   cat conftest.$ac_ext >&5
2024   # Broken: fails on valid input.
2025 continue
2026 fi
2027 rm -f conftest.err conftest.$ac_ext
2028
2029   # OK, works on sane cases.  Now check whether non-existent headers
2030   # can be detected and how.
2031   cat >conftest.$ac_ext <<_ACEOF
2032 #line 2032 "configure"
2033 #include "confdefs.h"
2034 #include <ac_nonexistent.h>
2035 _ACEOF
2036 if { (eval echo "$as_me:2036: \"$ac_cpp conftest.$ac_ext\"") >&5
2037   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2038   ac_status=$?
2039   egrep -v '^ *\+' conftest.er1 >conftest.err
2040   rm -f conftest.er1
2041   cat conftest.err >&5
2042   echo "$as_me:2042: \$? = $ac_status" >&5
2043   (exit $ac_status); } >/dev/null; then
2044   if test -s conftest.err; then
2045     ac_cpp_err=$ac_c_preproc_warn_flag
2046   else
2047     ac_cpp_err=
2048   fi
2049 else
2050   ac_cpp_err=yes
2051 fi
2052 if test -z "$ac_cpp_err"; then
2053   # Broken: success on invalid input.
2054 continue
2055 else
2056   echo "$as_me: failed program was:" >&5
2057   cat conftest.$ac_ext >&5
2058   # Passes both tests.
2059 ac_preproc_ok=:
2060 break
2061 fi
2062 rm -f conftest.err conftest.$ac_ext
2063
2064 done
2065 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2066 rm -f conftest.err conftest.$ac_ext
2067 if $ac_preproc_ok; then
2068   break
2069 fi
2070
2071     done
2072     ac_cv_prog_CPP=$CPP
2073
2074 fi
2075   CPP=$ac_cv_prog_CPP
2076 else
2077   ac_cv_prog_CPP=$CPP
2078 fi
2079 echo "$as_me:2079: result: $CPP" >&5
2080 echo "${ECHO_T}$CPP" >&6
2081 ac_preproc_ok=false
2082 for ac_c_preproc_warn_flag in '' yes
2083 do
2084   # Use a header file that comes with gcc, so configuring glibc
2085   # with a fresh cross-compiler works.
2086   # On the NeXT, cc -E runs the code through the compiler's parser,
2087   # not just through cpp. "Syntax error" is here to catch this case.
2088   cat >conftest.$ac_ext <<_ACEOF
2089 #line 2089 "configure"
2090 #include "confdefs.h"
2091 #include <assert.h>
2092                      Syntax error
2093 _ACEOF
2094 if { (eval echo "$as_me:2094: \"$ac_cpp conftest.$ac_ext\"") >&5
2095   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2096   ac_status=$?
2097   egrep -v '^ *\+' conftest.er1 >conftest.err
2098   rm -f conftest.er1
2099   cat conftest.err >&5
2100   echo "$as_me:2100: \$? = $ac_status" >&5
2101   (exit $ac_status); } >/dev/null; then
2102   if test -s conftest.err; then
2103     ac_cpp_err=$ac_c_preproc_warn_flag
2104   else
2105     ac_cpp_err=
2106   fi
2107 else
2108   ac_cpp_err=yes
2109 fi
2110 if test -z "$ac_cpp_err"; then
2111   :
2112 else
2113   echo "$as_me: failed program was:" >&5
2114   cat conftest.$ac_ext >&5
2115   # Broken: fails on valid input.
2116 continue
2117 fi
2118 rm -f conftest.err conftest.$ac_ext
2119
2120   # OK, works on sane cases.  Now check whether non-existent headers
2121   # can be detected and how.
2122   cat >conftest.$ac_ext <<_ACEOF
2123 #line 2123 "configure"
2124 #include "confdefs.h"
2125 #include <ac_nonexistent.h>
2126 _ACEOF
2127 if { (eval echo "$as_me:2127: \"$ac_cpp conftest.$ac_ext\"") >&5
2128   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2129   ac_status=$?
2130   egrep -v '^ *\+' conftest.er1 >conftest.err
2131   rm -f conftest.er1
2132   cat conftest.err >&5
2133   echo "$as_me:2133: \$? = $ac_status" >&5
2134   (exit $ac_status); } >/dev/null; then
2135   if test -s conftest.err; then
2136     ac_cpp_err=$ac_c_preproc_warn_flag
2137   else
2138     ac_cpp_err=
2139   fi
2140 else
2141   ac_cpp_err=yes
2142 fi
2143 if test -z "$ac_cpp_err"; then
2144   # Broken: success on invalid input.
2145 continue
2146 else
2147   echo "$as_me: failed program was:" >&5
2148   cat conftest.$ac_ext >&5
2149   # Passes both tests.
2150 ac_preproc_ok=:
2151 break
2152 fi
2153 rm -f conftest.err conftest.$ac_ext
2154
2155 done
2156 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2157 rm -f conftest.err conftest.$ac_ext
2158 if $ac_preproc_ok; then
2159   :
2160 else
2161   { { echo "$as_me:2161: error: C preprocessor \"$CPP\" fails sanity check" >&5
2162 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2163    { (exit 1); exit 1; }; }
2164 fi
2165
2166 ac_ext=c
2167 ac_cpp='$CPP $CPPFLAGS'
2168 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2169 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2171 ac_main_return=return
2172
2173 if test $ac_cv_c_compiler_gnu = yes; then
2174     echo "$as_me:2174: checking whether $CC needs -traditional" >&5
2175 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
2176 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
2177   echo $ECHO_N "(cached) $ECHO_C" >&6
2178 else
2179     ac_pattern="Autoconf.*'x'"
2180   cat >conftest.$ac_ext <<_ACEOF
2181 #line 2181 "configure"
2182 #include "confdefs.h"
2183 #include <sgtty.h>
2184 int Autoconf = TIOCGETP;
2185 _ACEOF
2186 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2187   egrep "$ac_pattern" >/dev/null 2>&1; then
2188   ac_cv_prog_gcc_traditional=yes
2189 else
2190   ac_cv_prog_gcc_traditional=no
2191 fi
2192 rm -rf conftest*
2193
2194   if test $ac_cv_prog_gcc_traditional = no; then
2195     cat >conftest.$ac_ext <<_ACEOF
2196 #line 2196 "configure"
2197 #include "confdefs.h"
2198 #include <termio.h>
2199 int Autoconf = TCGETA;
2200 _ACEOF
2201 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2202   egrep "$ac_pattern" >/dev/null 2>&1; then
2203   ac_cv_prog_gcc_traditional=yes
2204 fi
2205 rm -rf conftest*
2206
2207   fi
2208 fi
2209 echo "$as_me:2209: result: $ac_cv_prog_gcc_traditional" >&5
2210 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
2211   if test $ac_cv_prog_gcc_traditional = yes; then
2212     CC="$CC -traditional"
2213   fi
2214 fi
2215
2216 echo "$as_me:2216: checking whether $CC understands -c and -o together" >&5
2217 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
2218 if test "${cf_cv_prog_CC_c_o+set}" = set; then
2219   echo $ECHO_N "(cached) $ECHO_C" >&6
2220 else
2221
2222 cat > conftest.$ac_ext <<CF_EOF
2223 int main(void)
2224 {
2225         ${cf_cv_main_return:-return}(0);
2226 }
2227 CF_EOF
2228 # We do the test twice because some compilers refuse to overwrite an
2229 # existing .o file with -o, though they will create one.
2230 ac_try='$CC $CFLAGS $CPPFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
2231 if { (eval echo "$as_me:2231: \"$ac_try\"") >&5
2232   (eval $ac_try) 2>&5
2233   ac_status=$?
2234   echo "$as_me:2234: \$? = $ac_status" >&5
2235   (exit $ac_status); } &&
2236   test -f conftest2.$ac_objext && { (eval echo "$as_me:2236: \"$ac_try\"") >&5
2237   (eval $ac_try) 2>&5
2238   ac_status=$?
2239   echo "$as_me:2239: \$? = $ac_status" >&5
2240   (exit $ac_status); };
2241 then
2242   eval cf_cv_prog_CC_c_o=yes
2243 else
2244   eval cf_cv_prog_CC_c_o=no
2245 fi
2246 rm -rf conftest*
2247
2248 fi
2249 if test $cf_cv_prog_CC_c_o = yes; then
2250   echo "$as_me:2250: result: yes" >&5
2251 echo "${ECHO_T}yes" >&6
2252 else
2253   echo "$as_me:2253: result: no" >&5
2254 echo "${ECHO_T}no" >&6
2255 fi
2256
2257 test "$program_prefix" != NONE &&
2258   program_transform_name="s,^,$program_prefix,;$program_transform_name"
2259 # Use a double $ so make ignores it.
2260 test "$program_suffix" != NONE &&
2261   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
2262 # Double any \ or $.  echo might interpret backslashes.
2263 # By default was `s,x,x', remove it if useless.
2264 cat <<\_ACEOF >conftest.sed
2265 s/[\\$]/&&/g;s/;s,x,x,$//
2266 _ACEOF
2267 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
2268 rm conftest.sed
2269
2270 for ac_prog in mawk gawk nawk awk
2271 do
2272   # Extract the first word of "$ac_prog", so it can be a program name with args.
2273 set dummy $ac_prog; ac_word=$2
2274 echo "$as_me:2274: checking for $ac_word" >&5
2275 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2276 if test "${ac_cv_prog_AWK+set}" = set; then
2277   echo $ECHO_N "(cached) $ECHO_C" >&6
2278 else
2279   if test -n "$AWK"; then
2280   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2281 else
2282   ac_save_IFS=$IFS; IFS=$ac_path_separator
2283 ac_dummy="$PATH"
2284 for ac_dir in $ac_dummy; do
2285   IFS=$ac_save_IFS
2286   test -z "$ac_dir" && ac_dir=.
2287   $as_executable_p "$ac_dir/$ac_word" || continue
2288 ac_cv_prog_AWK="$ac_prog"
2289 echo "$as_me:2289: found $ac_dir/$ac_word" >&5
2290 break
2291 done
2292
2293 fi
2294 fi
2295 AWK=$ac_cv_prog_AWK
2296 if test -n "$AWK"; then
2297   echo "$as_me:2297: result: $AWK" >&5
2298 echo "${ECHO_T}$AWK" >&6
2299 else
2300   echo "$as_me:2300: result: no" >&5
2301 echo "${ECHO_T}no" >&6
2302 fi
2303
2304   test -n "$AWK" && break
2305 done
2306
2307 test -z "$AWK" && { { echo "$as_me:2307: error: No awk program found" >&5
2308 echo "$as_me: error: No awk program found" >&2;}
2309    { (exit 1); exit 1; }; }
2310
2311 echo "$as_me:2311: checking for egrep" >&5
2312 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
2313 if test "${ac_cv_prog_egrep+set}" = set; then
2314   echo $ECHO_N "(cached) $ECHO_C" >&6
2315 else
2316   if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2317                 then ac_cv_prog_egrep='grep -E'
2318                 else ac_cv_prog_egrep='egrep'
2319         fi
2320 fi
2321 echo "$as_me:2321: result: $ac_cv_prog_egrep" >&5
2322 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
2323         EGREP=$ac_cv_prog_egrep
2324
2325         test -z "$EGREP" && { { echo "$as_me:2325: error: No egrep program found" >&5
2326 echo "$as_me: error: No egrep program found" >&2;}
2327    { (exit 1); exit 1; }; }
2328
2329 # Find a good install program.  We prefer a C program (faster),
2330 # so one script is as good as another.  But avoid the broken or
2331 # incompatible versions:
2332 # SysV /etc/install, /usr/sbin/install
2333 # SunOS /usr/etc/install
2334 # IRIX /sbin/install
2335 # AIX /bin/install
2336 # AmigaOS /C/install, which installs bootblocks on floppy discs
2337 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2338 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2339 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2340 # ./install, which can be erroneously created by make from ./install.sh.
2341 echo "$as_me:2341: checking for a BSD compatible install" >&5
2342 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2343 if test -z "$INSTALL"; then
2344 if test "${ac_cv_path_install+set}" = set; then
2345   echo $ECHO_N "(cached) $ECHO_C" >&6
2346 else
2347     ac_save_IFS=$IFS; IFS=$ac_path_separator
2348   for ac_dir in $PATH; do
2349     IFS=$ac_save_IFS
2350     # Account for people who put trailing slashes in PATH elements.
2351     case $ac_dir/ in
2352     / | ./ | .// | /cC/* \
2353     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2354     | /usr/ucb/* ) ;;
2355     *)
2356       # OSF1 and SCO ODT 3.0 have their own names for install.
2357       # Don't use installbsd from OSF since it installs stuff as root
2358       # by default.
2359       for ac_prog in ginstall scoinst install; do
2360         if $as_executable_p "$ac_dir/$ac_prog"; then
2361           if test $ac_prog = install &&
2362             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2363             # AIX install.  It has an incompatible calling convention.
2364             :
2365           elif test $ac_prog = install &&
2366             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2367             # program-specific install script used by HP pwplus--don't use.
2368             :
2369           else
2370             ac_cv_path_install="$ac_dir/$ac_prog -c"
2371             break 2
2372           fi
2373         fi
2374       done
2375       ;;
2376     esac
2377   done
2378
2379 fi
2380   if test "${ac_cv_path_install+set}" = set; then
2381     INSTALL=$ac_cv_path_install
2382   else
2383     # As a last resort, use the slow shell script.  We don't cache a
2384     # path for INSTALL within a source directory, because that will
2385     # break other packages using the cache if that directory is
2386     # removed, or if the path is relative.
2387     INSTALL=$ac_install_sh
2388   fi
2389 fi
2390 echo "$as_me:2390: result: $INSTALL" >&5
2391 echo "${ECHO_T}$INSTALL" >&6
2392
2393 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2394 # It thinks the first close brace ends the variable substitution.
2395 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2396
2397 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2398
2399 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2400
2401 echo "$as_me:2401: checking whether ln -s works" >&5
2402 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
2403 LN_S=$as_ln_s
2404 if test "$LN_S" = "ln -s"; then
2405   echo "$as_me:2405: result: yes" >&5
2406 echo "${ECHO_T}yes" >&6
2407 else
2408   echo "$as_me:2408: result: no, using $LN_S" >&5
2409 echo "${ECHO_T}no, using $LN_S" >&6
2410 fi
2411
2412 echo "$as_me:2412: checking if $LN_S -f options work" >&5
2413 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
2414
2415 rm -f conf$$.src conf$$dst
2416 echo >conf$$.dst
2417 echo first >conf$$.src
2418 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
2419         cf_prog_ln_sf=yes
2420 else
2421         cf_prog_ln_sf=no
2422 fi
2423 rm -f conf$$.dst conf$$src
2424 echo "$as_me:2424: result: $cf_prog_ln_sf" >&5
2425 echo "${ECHO_T}$cf_prog_ln_sf" >&6
2426
2427 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
2428
2429 echo "$as_me:2429: checking for long file names" >&5
2430 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
2431 if test "${ac_cv_sys_long_file_names+set}" = set; then
2432   echo $ECHO_N "(cached) $ECHO_C" >&6
2433 else
2434   ac_cv_sys_long_file_names=yes
2435 # Test for long file names in all the places we know might matter:
2436 #      .                the current directory, where building will happen
2437 #      $prefix/lib      where we will be installing things
2438 #      $exec_prefix/lib likewise
2439 # eval it to expand exec_prefix.
2440 #      $TMPDIR          if set, where it might want to write temporary files
2441 # if $TMPDIR is not set:
2442 #      /tmp             where it might want to write temporary files
2443 #      /var/tmp         likewise
2444 #      /usr/tmp         likewise
2445 if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
2446   ac_tmpdirs=$TMPDIR
2447 else
2448   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
2449 fi
2450 for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
2451   test -d $ac_dir || continue
2452   test -w $ac_dir || continue # It is less confusing to not echo anything here.
2453   ac_xdir=$ac_dir/cf$$
2454   (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
2455   ac_tf1=$ac_xdir/conftest9012345
2456   ac_tf2=$ac_xdir/conftest9012346
2457   (echo 1 >$ac_tf1) 2>/dev/null
2458   (echo 2 >$ac_tf2) 2>/dev/null
2459   ac_val=`cat $ac_tf1 2>/dev/null`
2460   if test ! -f $ac_tf1 || test "$ac_val" != 1; then
2461     ac_cv_sys_long_file_names=no
2462     rm -rf $ac_xdir 2>/dev/null
2463     break
2464   fi
2465   rm -rf $ac_xdir 2>/dev/null
2466 done
2467 fi
2468 echo "$as_me:2468: result: $ac_cv_sys_long_file_names" >&5
2469 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
2470 if test $ac_cv_sys_long_file_names = yes; then
2471
2472 cat >>confdefs.h <<\EOF
2473 #define HAVE_LONG_FILE_NAMES 1
2474 EOF
2475
2476 fi
2477
2478 # if we find pkg-config, check if we should install the ".pc" files.
2479
2480 echo "$as_me:2480: checking if you want to use pkg-config" >&5
2481 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
2482
2483 # Check whether --with-pkg-config or --without-pkg-config was given.
2484 if test "${with_pkg_config+set}" = set; then
2485   withval="$with_pkg_config"
2486   cf_pkg_config=$withval
2487 else
2488   cf_pkg_config=yes
2489 fi;
2490 echo "$as_me:2490: result: $cf_pkg_config" >&5
2491 echo "${ECHO_T}$cf_pkg_config" >&6
2492
2493 case $cf_pkg_config in
2494 (no)
2495         PKG_CONFIG=none
2496         ;;
2497 (yes)
2498
2499 if test -n "$ac_tool_prefix"; then
2500   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
2501 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
2502 echo "$as_me:2502: checking for $ac_word" >&5
2503 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2504 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
2505   echo $ECHO_N "(cached) $ECHO_C" >&6
2506 else
2507   case $PKG_CONFIG in
2508   [\\/]* | ?:[\\/]*)
2509   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
2510   ;;
2511   *)
2512   ac_save_IFS=$IFS; IFS=$ac_path_separator
2513 ac_dummy="$PATH"
2514 for ac_dir in $ac_dummy; do
2515   IFS=$ac_save_IFS
2516   test -z "$ac_dir" && ac_dir=.
2517   if $as_executable_p "$ac_dir/$ac_word"; then
2518    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
2519    echo "$as_me:2519: found $ac_dir/$ac_word" >&5
2520    break
2521 fi
2522 done
2523
2524   ;;
2525 esac
2526 fi
2527 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
2528
2529 if test -n "$PKG_CONFIG"; then
2530   echo "$as_me:2530: result: $PKG_CONFIG" >&5
2531 echo "${ECHO_T}$PKG_CONFIG" >&6
2532 else
2533   echo "$as_me:2533: result: no" >&5
2534 echo "${ECHO_T}no" >&6
2535 fi
2536
2537 fi
2538 if test -z "$ac_cv_path_PKG_CONFIG"; then
2539   ac_pt_PKG_CONFIG=$PKG_CONFIG
2540   # Extract the first word of "pkg-config", so it can be a program name with args.
2541 set dummy pkg-config; ac_word=$2
2542 echo "$as_me:2542: checking for $ac_word" >&5
2543 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2544 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
2545   echo $ECHO_N "(cached) $ECHO_C" >&6
2546 else
2547   case $ac_pt_PKG_CONFIG in
2548   [\\/]* | ?:[\\/]*)
2549   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
2550   ;;
2551   *)
2552   ac_save_IFS=$IFS; IFS=$ac_path_separator
2553 ac_dummy="$PATH"
2554 for ac_dir in $ac_dummy; do
2555   IFS=$ac_save_IFS
2556   test -z "$ac_dir" && ac_dir=.
2557   if $as_executable_p "$ac_dir/$ac_word"; then
2558    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
2559    echo "$as_me:2559: found $ac_dir/$ac_word" >&5
2560    break
2561 fi
2562 done
2563
2564   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
2565   ;;
2566 esac
2567 fi
2568 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
2569
2570 if test -n "$ac_pt_PKG_CONFIG"; then
2571   echo "$as_me:2571: result: $ac_pt_PKG_CONFIG" >&5
2572 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
2573 else
2574   echo "$as_me:2574: result: no" >&5
2575 echo "${ECHO_T}no" >&6
2576 fi
2577
2578   PKG_CONFIG=$ac_pt_PKG_CONFIG
2579 else
2580   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
2581 fi
2582
2583         ;;
2584 (*)
2585         PKG_CONFIG=$withval
2586         ;;
2587 esac
2588
2589 test -z "$PKG_CONFIG" && PKG_CONFIG=none
2590 if test "$PKG_CONFIG" != none ; then
2591
2592 if test "x$prefix" != xNONE; then
2593         cf_path_syntax="$prefix"
2594 else
2595         cf_path_syntax="$ac_default_prefix"
2596 fi
2597
2598 case ".$PKG_CONFIG" in
2599 (.\$\(*\)*|.\'*\'*)
2600         ;;
2601 (..|./*|.\\*)
2602         ;;
2603 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
2604         ;;
2605 (.\${*prefix}*|.\${*dir}*)
2606         eval PKG_CONFIG="$PKG_CONFIG"
2607         case ".$PKG_CONFIG" in
2608         (.NONE/*)
2609                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2610                 ;;
2611         esac
2612         ;;
2613 (.no|.NONE/*)
2614         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
2615         ;;
2616 (*)
2617         { { echo "$as_me:2617: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
2618 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
2619    { (exit 1); exit 1; }; }
2620         ;;
2621 esac
2622
2623 elif test "x$cf_pkg_config" != xno ; then
2624         { echo "$as_me:2624: WARNING: pkg-config is not installed" >&5
2625 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
2626 fi
2627
2628 case $PKG_CONFIG in
2629 (no|none|yes)
2630         echo "$as_me:2630: checking for pkg-config library directory" >&5
2631 echo $ECHO_N "checking for pkg-config library directory... $ECHO_C" >&6
2632         ;;
2633 (*)
2634         echo "$as_me:2634: checking for $PKG_CONFIG library directory" >&5
2635 echo $ECHO_N "checking for $PKG_CONFIG library directory... $ECHO_C" >&6
2636         ;;
2637 esac
2638
2639 PKG_CONFIG_LIBDIR=no
2640
2641 # Check whether --with-pkg-config-libdir or --without-pkg-config-libdir was given.
2642 if test "${with_pkg_config_libdir+set}" = set; then
2643   withval="$with_pkg_config_libdir"
2644   PKG_CONFIG_LIBDIR=$withval
2645 else
2646   test "x$PKG_CONFIG" != xnone && PKG_CONFIG_LIBDIR=yes
2647 fi;
2648
2649 case x$PKG_CONFIG_LIBDIR in
2650 (x/*)
2651         ;;
2652 (xyes)
2653         # Look for the library directory using the same prefix as the executable
2654         if test "x$PKG_CONFIG" = xnone
2655         then
2656                 cf_path=$prefix
2657         else
2658                 cf_path=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`
2659         fi
2660
2661         # If you don't like using the default architecture, you have to specify the
2662         # intended library directory and corresponding compiler/linker options.
2663         #
2664         # This case allows for Debian's 2014-flavor of multiarch, along with the
2665         # most common variations before that point.  Some other variants spell the
2666         # directory differently, e.g., "pkg-config", and put it in unusual places.
2667         # pkg-config has always been poorly standardized, which is ironic...
2668         case x`(arch) 2>/dev/null` in
2669         (*64)
2670                 cf_search_path="\
2671                         $cf_path/lib/*64-linux-gnu \
2672                         $cf_path/share \
2673                         $cf_path/lib64 \
2674                         $cf_path/lib32 \
2675                         $cf_path/lib"
2676                 ;;
2677         (*)
2678                 cf_search_path="\
2679                         $cf_path/lib/*-linux-gnu \
2680                         $cf_path/share \
2681                         $cf_path/lib32 \
2682                         $cf_path/lib \
2683                         $cf_path/libdata"
2684                 ;;
2685         esac
2686
2687         test -n "$verbose" && echo "    list..." 1>&6
2688
2689 echo "${as_me:-configure}:2689: testing list... ..." 1>&5
2690
2691         for cf_config in $cf_search_path
2692         do
2693                 test -n "$verbose" && echo "    checking $cf_config/pkgconfig" 1>&6
2694
2695 echo "${as_me:-configure}:2695: testing checking $cf_config/pkgconfig ..." 1>&5
2696
2697                 if test -d $cf_config/pkgconfig
2698                 then
2699                         PKG_CONFIG_LIBDIR=$cf_config/pkgconfig
2700                         echo "$as_me:2700: checking done" >&5
2701 echo $ECHO_N "checking done... $ECHO_C" >&6
2702                         break
2703                 fi
2704         done
2705         ;;
2706 (*)
2707         ;;
2708 esac
2709
2710 if test "x$PKG_CONFIG_LIBDIR" != xno ; then
2711         echo "$as_me:2711: result: $PKG_CONFIG_LIBDIR" >&5
2712 echo "${ECHO_T}$PKG_CONFIG_LIBDIR" >&6
2713 fi
2714
2715 echo "$as_me:2715: checking if you want to build test-programs" >&5
2716 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
2717
2718 # Check whether --with-tests or --without-tests was given.
2719 if test "${with_tests+set}" = set; then
2720   withval="$with_tests"
2721   cf_with_tests=$withval
2722 else
2723   cf_with_tests=yes
2724 fi;
2725 echo "$as_me:2725: result: $cf_with_tests" >&5
2726 echo "${ECHO_T}$cf_with_tests" >&6
2727
2728 echo "$as_me:2728: checking if we should assume mixed-case filenames" >&5
2729 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
2730
2731 # Check whether --enable-mixed-case or --disable-mixed-case was given.
2732 if test "${enable_mixed_case+set}" = set; then
2733   enableval="$enable_mixed_case"
2734   enable_mixedcase=$enableval
2735 else
2736   enable_mixedcase=auto
2737 fi;
2738 echo "$as_me:2738: result: $enable_mixedcase" >&5
2739 echo "${ECHO_T}$enable_mixedcase" >&6
2740 if test "$enable_mixedcase" = "auto" ; then
2741
2742 echo "$as_me:2742: checking if filesystem supports mixed-case filenames" >&5
2743 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2744 if test "${cf_cv_mixedcase+set}" = set; then
2745   echo $ECHO_N "(cached) $ECHO_C" >&6
2746 else
2747
2748 if test "$cross_compiling" = yes ; then
2749         case $target_alias in
2750         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2751                 cf_cv_mixedcase=no
2752                 ;;
2753         (*)
2754                 cf_cv_mixedcase=yes
2755                 ;;
2756         esac
2757 else
2758         rm -f conftest CONFTEST
2759         echo test >conftest
2760         if test -f CONFTEST ; then
2761                 cf_cv_mixedcase=no
2762         else
2763                 cf_cv_mixedcase=yes
2764         fi
2765         rm -f conftest CONFTEST
2766 fi
2767
2768 fi
2769 echo "$as_me:2769: result: $cf_cv_mixedcase" >&5
2770 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2771 test "$cf_cv_mixedcase" = yes &&
2772 cat >>confdefs.h <<\EOF
2773 #define MIXEDCASE_FILENAMES 1
2774 EOF
2775
2776 else
2777         cf_cv_mixedcase=$enable_mixedcase
2778         if test "$enable_mixedcase" = "yes" ; then
2779                 cat >>confdefs.h <<\EOF
2780 #define MIXEDCASE_FILENAMES 1
2781 EOF
2782
2783         fi
2784 fi
2785
2786 # do this after mixed-case option (tags/TAGS is not as important as tic).
2787 echo "$as_me:2787: checking whether ${MAKE-make} sets \${MAKE}" >&5
2788 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
2789 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
2790 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
2791   echo $ECHO_N "(cached) $ECHO_C" >&6
2792 else
2793   cat >conftest.make <<\EOF
2794 all:
2795         @echo 'ac_maketemp="${MAKE}"'
2796 EOF
2797 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
2798 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
2799 if test -n "$ac_maketemp"; then
2800   eval ac_cv_prog_make_${ac_make}_set=yes
2801 else
2802   eval ac_cv_prog_make_${ac_make}_set=no
2803 fi
2804 rm -f conftest.make
2805 fi
2806 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
2807   echo "$as_me:2807: result: yes" >&5
2808 echo "${ECHO_T}yes" >&6
2809   SET_MAKE=
2810 else
2811   echo "$as_me:2811: result: no" >&5
2812 echo "${ECHO_T}no" >&6
2813   SET_MAKE="MAKE=${MAKE-make}"
2814 fi
2815
2816 for ac_prog in exctags ctags
2817 do
2818   # Extract the first word of "$ac_prog", so it can be a program name with args.
2819 set dummy $ac_prog; ac_word=$2
2820 echo "$as_me:2820: checking for $ac_word" >&5
2821 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2822 if test "${ac_cv_prog_CTAGS+set}" = set; then
2823   echo $ECHO_N "(cached) $ECHO_C" >&6
2824 else
2825   if test -n "$CTAGS"; then
2826   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2827 else
2828   ac_save_IFS=$IFS; IFS=$ac_path_separator
2829 ac_dummy="$PATH"
2830 for ac_dir in $ac_dummy; do
2831   IFS=$ac_save_IFS
2832   test -z "$ac_dir" && ac_dir=.
2833   $as_executable_p "$ac_dir/$ac_word" || continue
2834 ac_cv_prog_CTAGS="$ac_prog"
2835 echo "$as_me:2835: found $ac_dir/$ac_word" >&5
2836 break
2837 done
2838
2839 fi
2840 fi
2841 CTAGS=$ac_cv_prog_CTAGS
2842 if test -n "$CTAGS"; then
2843   echo "$as_me:2843: result: $CTAGS" >&5
2844 echo "${ECHO_T}$CTAGS" >&6
2845 else
2846   echo "$as_me:2846: result: no" >&5
2847 echo "${ECHO_T}no" >&6
2848 fi
2849
2850   test -n "$CTAGS" && break
2851 done
2852
2853 for ac_prog in exetags etags
2854 do
2855   # Extract the first word of "$ac_prog", so it can be a program name with args.
2856 set dummy $ac_prog; ac_word=$2
2857 echo "$as_me:2857: checking for $ac_word" >&5
2858 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2859 if test "${ac_cv_prog_ETAGS+set}" = set; then
2860   echo $ECHO_N "(cached) $ECHO_C" >&6
2861 else
2862   if test -n "$ETAGS"; then
2863   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2864 else
2865   ac_save_IFS=$IFS; IFS=$ac_path_separator
2866 ac_dummy="$PATH"
2867 for ac_dir in $ac_dummy; do
2868   IFS=$ac_save_IFS
2869   test -z "$ac_dir" && ac_dir=.
2870   $as_executable_p "$ac_dir/$ac_word" || continue
2871 ac_cv_prog_ETAGS="$ac_prog"
2872 echo "$as_me:2872: found $ac_dir/$ac_word" >&5
2873 break
2874 done
2875
2876 fi
2877 fi
2878 ETAGS=$ac_cv_prog_ETAGS
2879 if test -n "$ETAGS"; then
2880   echo "$as_me:2880: result: $ETAGS" >&5
2881 echo "${ECHO_T}$ETAGS" >&6
2882 else
2883   echo "$as_me:2883: result: no" >&5
2884 echo "${ECHO_T}no" >&6
2885 fi
2886
2887   test -n "$ETAGS" && break
2888 done
2889
2890 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2891 set dummy ${CTAGS:-ctags}; ac_word=$2
2892 echo "$as_me:2892: checking for $ac_word" >&5
2893 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2894 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2895   echo $ECHO_N "(cached) $ECHO_C" >&6
2896 else
2897   if test -n "$MAKE_LOWER_TAGS"; then
2898   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2899 else
2900   ac_save_IFS=$IFS; IFS=$ac_path_separator
2901 ac_dummy="$PATH"
2902 for ac_dir in $ac_dummy; do
2903   IFS=$ac_save_IFS
2904   test -z "$ac_dir" && ac_dir=.
2905   $as_executable_p "$ac_dir/$ac_word" || continue
2906 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2907 echo "$as_me:2907: found $ac_dir/$ac_word" >&5
2908 break
2909 done
2910
2911   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2912 fi
2913 fi
2914 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2915 if test -n "$MAKE_LOWER_TAGS"; then
2916   echo "$as_me:2916: result: $MAKE_LOWER_TAGS" >&5
2917 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2918 else
2919   echo "$as_me:2919: result: no" >&5
2920 echo "${ECHO_T}no" >&6
2921 fi
2922
2923 if test "$cf_cv_mixedcase" = yes ; then
2924         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2925 set dummy ${ETAGS:-etags}; ac_word=$2
2926 echo "$as_me:2926: checking for $ac_word" >&5
2927 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2928 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2929   echo $ECHO_N "(cached) $ECHO_C" >&6
2930 else
2931   if test -n "$MAKE_UPPER_TAGS"; then
2932   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2933 else
2934   ac_save_IFS=$IFS; IFS=$ac_path_separator
2935 ac_dummy="$PATH"
2936 for ac_dir in $ac_dummy; do
2937   IFS=$ac_save_IFS
2938   test -z "$ac_dir" && ac_dir=.
2939   $as_executable_p "$ac_dir/$ac_word" || continue
2940 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2941 echo "$as_me:2941: found $ac_dir/$ac_word" >&5
2942 break
2943 done
2944
2945   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2946 fi
2947 fi
2948 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2949 if test -n "$MAKE_UPPER_TAGS"; then
2950   echo "$as_me:2950: result: $MAKE_UPPER_TAGS" >&5
2951 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2952 else
2953   echo "$as_me:2953: result: no" >&5
2954 echo "${ECHO_T}no" >&6
2955 fi
2956
2957 else
2958         MAKE_UPPER_TAGS=no
2959 fi
2960
2961 if test "$MAKE_UPPER_TAGS" = yes ; then
2962         MAKE_UPPER_TAGS=
2963 else
2964         MAKE_UPPER_TAGS="#"
2965 fi
2966
2967 if test "$MAKE_LOWER_TAGS" = yes ; then
2968         MAKE_LOWER_TAGS=
2969 else
2970         MAKE_LOWER_TAGS="#"
2971 fi
2972
2973 echo "$as_me:2973: checking for makeflags variable" >&5
2974 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
2975 if test "${cf_cv_makeflags+set}" = set; then
2976   echo $ECHO_N "(cached) $ECHO_C" >&6
2977 else
2978
2979         cf_cv_makeflags=''
2980         for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2981         do
2982                 cat >cf_makeflags.tmp <<CF_EOF
2983 SHELL = $SHELL
2984 all :
2985         @ echo '.$cf_option'
2986 CF_EOF
2987                 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[    ]*$,,'`
2988                 case "$cf_result" in
2989                 (.*k|.*kw)
2990                         cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2991                         case "$cf_result" in
2992                         (.*CC=*)        cf_cv_makeflags=
2993                                 ;;
2994                         (*)     cf_cv_makeflags=$cf_option
2995                                 ;;
2996                         esac
2997                         break
2998                         ;;
2999                 (.-)    ;;
3000                 (*)     echo "given option \"$cf_option\", no match \"$cf_result\""
3001                         ;;
3002                 esac
3003         done
3004         rm -f cf_makeflags.tmp
3005
3006 fi
3007 echo "$as_me:3007: result: $cf_cv_makeflags" >&5
3008 echo "${ECHO_T}$cf_cv_makeflags" >&6
3009
3010 if test -n "$ac_tool_prefix"; then
3011   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3012 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3013 echo "$as_me:3013: checking for $ac_word" >&5
3014 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3015 if test "${ac_cv_prog_RANLIB+set}" = set; then
3016   echo $ECHO_N "(cached) $ECHO_C" >&6
3017 else
3018   if test -n "$RANLIB"; then
3019   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3020 else
3021   ac_save_IFS=$IFS; IFS=$ac_path_separator
3022 ac_dummy="$PATH"
3023 for ac_dir in $ac_dummy; do
3024   IFS=$ac_save_IFS
3025   test -z "$ac_dir" && ac_dir=.
3026   $as_executable_p "$ac_dir/$ac_word" || continue
3027 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3028 echo "$as_me:3028: found $ac_dir/$ac_word" >&5
3029 break
3030 done
3031
3032 fi
3033 fi
3034 RANLIB=$ac_cv_prog_RANLIB
3035 if test -n "$RANLIB"; then
3036   echo "$as_me:3036: result: $RANLIB" >&5
3037 echo "${ECHO_T}$RANLIB" >&6
3038 else
3039   echo "$as_me:3039: result: no" >&5
3040 echo "${ECHO_T}no" >&6
3041 fi
3042
3043 fi
3044 if test -z "$ac_cv_prog_RANLIB"; then
3045   ac_ct_RANLIB=$RANLIB
3046   # Extract the first word of "ranlib", so it can be a program name with args.
3047 set dummy ranlib; ac_word=$2
3048 echo "$as_me:3048: checking for $ac_word" >&5
3049 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3050 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
3051   echo $ECHO_N "(cached) $ECHO_C" >&6
3052 else
3053   if test -n "$ac_ct_RANLIB"; then
3054   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
3055 else
3056   ac_save_IFS=$IFS; IFS=$ac_path_separator
3057 ac_dummy="$PATH"
3058 for ac_dir in $ac_dummy; do
3059   IFS=$ac_save_IFS
3060   test -z "$ac_dir" && ac_dir=.
3061   $as_executable_p "$ac_dir/$ac_word" || continue
3062 ac_cv_prog_ac_ct_RANLIB="ranlib"
3063 echo "$as_me:3063: found $ac_dir/$ac_word" >&5
3064 break
3065 done
3066
3067   test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
3068 fi
3069 fi
3070 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3071 if test -n "$ac_ct_RANLIB"; then
3072   echo "$as_me:3072: result: $ac_ct_RANLIB" >&5
3073 echo "${ECHO_T}$ac_ct_RANLIB" >&6
3074 else
3075   echo "$as_me:3075: result: no" >&5
3076 echo "${ECHO_T}no" >&6
3077 fi
3078
3079   RANLIB=$ac_ct_RANLIB
3080 else
3081   RANLIB="$ac_cv_prog_RANLIB"
3082 fi
3083
3084 if test -n "$ac_tool_prefix"; then
3085   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
3086 set dummy ${ac_tool_prefix}ld; ac_word=$2
3087 echo "$as_me:3087: checking for $ac_word" >&5
3088 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3089 if test "${ac_cv_prog_LD+set}" = set; then
3090   echo $ECHO_N "(cached) $ECHO_C" >&6
3091 else
3092   if test -n "$LD"; then
3093   ac_cv_prog_LD="$LD" # Let the user override the test.
3094 else
3095   ac_save_IFS=$IFS; IFS=$ac_path_separator
3096 ac_dummy="$PATH"
3097 for ac_dir in $ac_dummy; do
3098   IFS=$ac_save_IFS
3099   test -z "$ac_dir" && ac_dir=.
3100   $as_executable_p "$ac_dir/$ac_word" || continue
3101 ac_cv_prog_LD="${ac_tool_prefix}ld"
3102 echo "$as_me:3102: found $ac_dir/$ac_word" >&5
3103 break
3104 done
3105
3106 fi
3107 fi
3108 LD=$ac_cv_prog_LD
3109 if test -n "$LD"; then
3110   echo "$as_me:3110: result: $LD" >&5
3111 echo "${ECHO_T}$LD" >&6
3112 else
3113   echo "$as_me:3113: result: no" >&5
3114 echo "${ECHO_T}no" >&6
3115 fi
3116
3117 fi
3118 if test -z "$ac_cv_prog_LD"; then
3119   ac_ct_LD=$LD
3120   # Extract the first word of "ld", so it can be a program name with args.
3121 set dummy ld; ac_word=$2
3122 echo "$as_me:3122: checking for $ac_word" >&5
3123 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3124 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
3125   echo $ECHO_N "(cached) $ECHO_C" >&6
3126 else
3127   if test -n "$ac_ct_LD"; then
3128   ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
3129 else
3130   ac_save_IFS=$IFS; IFS=$ac_path_separator
3131 ac_dummy="$PATH"
3132 for ac_dir in $ac_dummy; do
3133   IFS=$ac_save_IFS
3134   test -z "$ac_dir" && ac_dir=.
3135   $as_executable_p "$ac_dir/$ac_word" || continue
3136 ac_cv_prog_ac_ct_LD="ld"
3137 echo "$as_me:3137: found $ac_dir/$ac_word" >&5
3138 break
3139 done
3140
3141   test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
3142 fi
3143 fi
3144 ac_ct_LD=$ac_cv_prog_ac_ct_LD
3145 if test -n "$ac_ct_LD"; then
3146   echo "$as_me:3146: result: $ac_ct_LD" >&5
3147 echo "${ECHO_T}$ac_ct_LD" >&6
3148 else
3149   echo "$as_me:3149: result: no" >&5
3150 echo "${ECHO_T}no" >&6
3151 fi
3152
3153   LD=$ac_ct_LD
3154 else
3155   LD="$ac_cv_prog_LD"
3156 fi
3157
3158 if test -n "$ac_tool_prefix"; then
3159   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3160 set dummy ${ac_tool_prefix}ar; ac_word=$2
3161 echo "$as_me:3161: checking for $ac_word" >&5
3162 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3163 if test "${ac_cv_prog_AR+set}" = set; then
3164   echo $ECHO_N "(cached) $ECHO_C" >&6
3165 else
3166   if test -n "$AR"; then
3167   ac_cv_prog_AR="$AR" # Let the user override the test.
3168 else
3169   ac_save_IFS=$IFS; IFS=$ac_path_separator
3170 ac_dummy="$PATH"
3171 for ac_dir in $ac_dummy; do
3172   IFS=$ac_save_IFS
3173   test -z "$ac_dir" && ac_dir=.
3174   $as_executable_p "$ac_dir/$ac_word" || continue
3175 ac_cv_prog_AR="${ac_tool_prefix}ar"
3176 echo "$as_me:3176: found $ac_dir/$ac_word" >&5
3177 break
3178 done
3179
3180 fi
3181 fi
3182 AR=$ac_cv_prog_AR
3183 if test -n "$AR"; then
3184   echo "$as_me:3184: result: $AR" >&5
3185 echo "${ECHO_T}$AR" >&6
3186 else
3187   echo "$as_me:3187: result: no" >&5
3188 echo "${ECHO_T}no" >&6
3189 fi
3190
3191 fi
3192 if test -z "$ac_cv_prog_AR"; then
3193   ac_ct_AR=$AR
3194   # Extract the first word of "ar", so it can be a program name with args.
3195 set dummy ar; ac_word=$2
3196 echo "$as_me:3196: checking for $ac_word" >&5
3197 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3198 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3199   echo $ECHO_N "(cached) $ECHO_C" >&6
3200 else
3201   if test -n "$ac_ct_AR"; then
3202   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3203 else
3204   ac_save_IFS=$IFS; IFS=$ac_path_separator
3205 ac_dummy="$PATH"
3206 for ac_dir in $ac_dummy; do
3207   IFS=$ac_save_IFS
3208   test -z "$ac_dir" && ac_dir=.
3209   $as_executable_p "$ac_dir/$ac_word" || continue
3210 ac_cv_prog_ac_ct_AR="ar"
3211 echo "$as_me:3211: found $ac_dir/$ac_word" >&5
3212 break
3213 done
3214
3215   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3216 fi
3217 fi
3218 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3219 if test -n "$ac_ct_AR"; then
3220   echo "$as_me:3220: result: $ac_ct_AR" >&5
3221 echo "${ECHO_T}$ac_ct_AR" >&6
3222 else
3223   echo "$as_me:3223: result: no" >&5
3224 echo "${ECHO_T}no" >&6
3225 fi
3226
3227   AR=$ac_ct_AR
3228 else
3229   AR="$ac_cv_prog_AR"
3230 fi
3231
3232 if test -n "$ac_tool_prefix"; then
3233   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
3234 set dummy ${ac_tool_prefix}ar; ac_word=$2
3235 echo "$as_me:3235: checking for $ac_word" >&5
3236 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3237 if test "${ac_cv_prog_AR+set}" = set; then
3238   echo $ECHO_N "(cached) $ECHO_C" >&6
3239 else
3240   if test -n "$AR"; then
3241   ac_cv_prog_AR="$AR" # Let the user override the test.
3242 else
3243   ac_save_IFS=$IFS; IFS=$ac_path_separator
3244 ac_dummy="$PATH"
3245 for ac_dir in $ac_dummy; do
3246   IFS=$ac_save_IFS
3247   test -z "$ac_dir" && ac_dir=.
3248   $as_executable_p "$ac_dir/$ac_word" || continue
3249 ac_cv_prog_AR="${ac_tool_prefix}ar"
3250 echo "$as_me:3250: found $ac_dir/$ac_word" >&5
3251 break
3252 done
3253
3254 fi
3255 fi
3256 AR=$ac_cv_prog_AR
3257 if test -n "$AR"; then
3258   echo "$as_me:3258: result: $AR" >&5
3259 echo "${ECHO_T}$AR" >&6
3260 else
3261   echo "$as_me:3261: result: no" >&5
3262 echo "${ECHO_T}no" >&6
3263 fi
3264
3265 fi
3266 if test -z "$ac_cv_prog_AR"; then
3267   ac_ct_AR=$AR
3268   # Extract the first word of "ar", so it can be a program name with args.
3269 set dummy ar; ac_word=$2
3270 echo "$as_me:3270: checking for $ac_word" >&5
3271 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3272 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
3273   echo $ECHO_N "(cached) $ECHO_C" >&6
3274 else
3275   if test -n "$ac_ct_AR"; then
3276   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3277 else
3278   ac_save_IFS=$IFS; IFS=$ac_path_separator
3279 ac_dummy="$PATH"
3280 for ac_dir in $ac_dummy; do
3281   IFS=$ac_save_IFS
3282   test -z "$ac_dir" && ac_dir=.
3283   $as_executable_p "$ac_dir/$ac_word" || continue
3284 ac_cv_prog_ac_ct_AR="ar"
3285 echo "$as_me:3285: found $ac_dir/$ac_word" >&5
3286 break
3287 done
3288
3289   test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
3290 fi
3291 fi
3292 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3293 if test -n "$ac_ct_AR"; then
3294   echo "$as_me:3294: result: $ac_ct_AR" >&5
3295 echo "${ECHO_T}$ac_ct_AR" >&6
3296 else
3297   echo "$as_me:3297: result: no" >&5
3298 echo "${ECHO_T}no" >&6
3299 fi
3300
3301   AR=$ac_ct_AR
3302 else
3303   AR="$ac_cv_prog_AR"
3304 fi
3305
3306 echo "$as_me:3306: checking for options to update archives" >&5
3307 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
3308 if test "${cf_cv_ar_flags+set}" = set; then
3309   echo $ECHO_N "(cached) $ECHO_C" >&6
3310 else
3311
3312         cf_cv_ar_flags=unknown
3313         for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
3314         do
3315
3316                 # check if $ARFLAGS already contains this choice
3317                 if test "x$ARFLAGS" != "x" ; then
3318                         cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
3319                         if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
3320                                 cf_cv_ar_flags=
3321                                 break
3322                         fi
3323                 fi
3324
3325                 rm -f conftest.$ac_cv_objext
3326                 rm -f conftest.a
3327
3328                 cat >conftest.$ac_ext <<EOF
3329 #line 3329 "configure"
3330 int     testdata[3] = { 123, 456, 789 };
3331 EOF
3332                 if { (eval echo "$as_me:3332: \"$ac_compile\"") >&5
3333   (eval $ac_compile) 2>&5
3334   ac_status=$?
3335   echo "$as_me:3335: \$? = $ac_status" >&5
3336   (exit $ac_status); } ; then
3337                         echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
3338                         $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
3339                         if test -f conftest.a ; then
3340                                 cf_cv_ar_flags=$cf_ar_flags
3341                                 break
3342                         fi
3343                 else
3344                         test -n "$verbose" && echo "    cannot compile test-program" 1>&6
3345
3346 echo "${as_me:-configure}:3346: testing cannot compile test-program ..." 1>&5
3347
3348                         break
3349                 fi
3350         done
3351         rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
3352
3353 fi
3354 echo "$as_me:3354: result: $cf_cv_ar_flags" >&5
3355 echo "${ECHO_T}$cf_cv_ar_flags" >&6
3356
3357 if test -n "$ARFLAGS" ; then
3358         if test -n "$cf_cv_ar_flags" ; then
3359                 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
3360         fi
3361 else
3362         ARFLAGS=$cf_cv_ar_flags
3363 fi
3364
3365         echo "$as_me:3365: checking for PATH separator" >&5
3366 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6
3367         case $cf_cv_system_name in
3368         (os2*)  PATH_SEPARATOR=';'  ;;
3369         (*)     ${PATH_SEPARATOR:=':'}  ;;
3370         esac
3371
3372         echo "$as_me:3372: result: $PATH_SEPARATOR" >&5
3373 echo "${ECHO_T}$PATH_SEPARATOR" >&6
3374
3375 echo "$as_me:3375: checking if you have specified an install-prefix" >&5
3376 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
3377
3378 # Check whether --with-install-prefix or --without-install-prefix was given.
3379 if test "${with_install_prefix+set}" = set; then
3380   withval="$with_install_prefix"
3381   case "$withval" in
3382         (yes|no)
3383                 ;;
3384         (*)     DESTDIR="$withval"
3385                 ;;
3386         esac
3387 fi;
3388 echo "$as_me:3388: result: $DESTDIR" >&5
3389 echo "${ECHO_T}$DESTDIR" >&6
3390
3391 ###############################################################################
3392
3393 # If we're cross-compiling, allow the user to override the tools and their
3394 # options.  The configure script is oriented toward identifying the host
3395 # compiler, etc., but we need a build compiler to generate parts of the source.
3396
3397 if test "$cross_compiling" = yes ; then
3398
3399         # defaults that we might want to override
3400         : ${BUILD_CFLAGS:=''}
3401         : ${BUILD_CPPFLAGS:=''}
3402         : ${BUILD_LDFLAGS:=''}
3403         : ${BUILD_LIBS:=''}
3404         : ${BUILD_EXEEXT:='$x'}
3405         : ${BUILD_OBJEXT:='o'}
3406
3407 # Check whether --with-build-cc or --without-build-cc was given.
3408 if test "${with_build_cc+set}" = set; then
3409   withval="$with_build_cc"
3410   BUILD_CC="$withval"
3411 else
3412   for ac_prog in gcc cc cl
3413 do
3414   # Extract the first word of "$ac_prog", so it can be a program name with args.
3415 set dummy $ac_prog; ac_word=$2
3416 echo "$as_me:3416: checking for $ac_word" >&5
3417 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3418 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
3419   echo $ECHO_N "(cached) $ECHO_C" >&6
3420 else
3421   if test -n "$BUILD_CC"; then
3422   ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
3423 else
3424   ac_save_IFS=$IFS; IFS=$ac_path_separator
3425 ac_dummy="$PATH"
3426 for ac_dir in $ac_dummy; do
3427   IFS=$ac_save_IFS
3428   test -z "$ac_dir" && ac_dir=.
3429   $as_executable_p "$ac_dir/$ac_word" || continue
3430 ac_cv_prog_BUILD_CC="$ac_prog"
3431 echo "$as_me:3431: found $ac_dir/$ac_word" >&5
3432 break
3433 done
3434
3435 fi
3436 fi
3437 BUILD_CC=$ac_cv_prog_BUILD_CC
3438 if test -n "$BUILD_CC"; then
3439   echo "$as_me:3439: result: $BUILD_CC" >&5
3440 echo "${ECHO_T}$BUILD_CC" >&6
3441 else
3442   echo "$as_me:3442: result: no" >&5
3443 echo "${ECHO_T}no" >&6
3444 fi
3445
3446   test -n "$BUILD_CC" && break
3447 done
3448
3449 fi;
3450         echo "$as_me:3450: checking for native build C compiler" >&5
3451 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3452         echo "$as_me:3452: result: $BUILD_CC" >&5
3453 echo "${ECHO_T}$BUILD_CC" >&6
3454
3455         echo "$as_me:3455: checking for native build C preprocessor" >&5
3456 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3457
3458 # Check whether --with-build-cpp or --without-build-cpp was given.
3459 if test "${with_build_cpp+set}" = set; then
3460   withval="$with_build_cpp"
3461   BUILD_CPP="$withval"
3462 else
3463   BUILD_CPP='${BUILD_CC} -E'
3464 fi;
3465         echo "$as_me:3465: result: $BUILD_CPP" >&5
3466 echo "${ECHO_T}$BUILD_CPP" >&6
3467
3468         echo "$as_me:3468: checking for native build C flags" >&5
3469 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3470
3471 # Check whether --with-build-cflags or --without-build-cflags was given.
3472 if test "${with_build_cflags+set}" = set; then
3473   withval="$with_build_cflags"
3474   BUILD_CFLAGS="$withval"
3475 fi;
3476         echo "$as_me:3476: result: $BUILD_CFLAGS" >&5
3477 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3478
3479         echo "$as_me:3479: checking for native build C preprocessor-flags" >&5
3480 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3481
3482 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3483 if test "${with_build_cppflags+set}" = set; then
3484   withval="$with_build_cppflags"
3485   BUILD_CPPFLAGS="$withval"
3486 fi;
3487         echo "$as_me:3487: result: $BUILD_CPPFLAGS" >&5
3488 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3489
3490         echo "$as_me:3490: checking for native build linker-flags" >&5
3491 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3492
3493 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3494 if test "${with_build_ldflags+set}" = set; then
3495   withval="$with_build_ldflags"
3496   BUILD_LDFLAGS="$withval"
3497 fi;
3498         echo "$as_me:3498: result: $BUILD_LDFLAGS" >&5
3499 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3500
3501         echo "$as_me:3501: checking for native build linker-libraries" >&5
3502 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3503
3504 # Check whether --with-build-libs or --without-build-libs was given.
3505 if test "${with_build_libs+set}" = set; then
3506   withval="$with_build_libs"
3507   BUILD_LIBS="$withval"
3508 fi;
3509         echo "$as_me:3509: result: $BUILD_LIBS" >&5
3510 echo "${ECHO_T}$BUILD_LIBS" >&6
3511
3512         # this assumes we're on Unix.
3513         BUILD_EXEEXT=
3514         BUILD_OBJEXT=o
3515
3516         : ${BUILD_CC:='${CC}'}
3517
3518         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3519                 { { echo "$as_me:3519: error: Cross-build requires two compilers.
3520 Use --with-build-cc to specify the native compiler." >&5
3521 echo "$as_me: error: Cross-build requires two compilers.
3522 Use --with-build-cc to specify the native compiler." >&2;}
3523    { (exit 1); exit 1; }; }
3524         fi
3525
3526 else
3527         : ${BUILD_CC:='${CC}'}
3528         : ${BUILD_CPP:='${CPP}'}
3529         : ${BUILD_CFLAGS:='${CFLAGS}'}
3530         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3531         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3532         : ${BUILD_LIBS:='${LIBS}'}
3533         : ${BUILD_EXEEXT:='$x'}
3534         : ${BUILD_OBJEXT:='o'}
3535 fi
3536
3537 ###############################################################################
3538
3539 ### Options to allow the user to specify the set of libraries which are used.
3540 ### Use "--without-normal --with-shared" to allow the default model to be
3541 ### shared, for example.
3542 cf_list_models=""
3543
3544 echo "$as_me:3544: checking if you want to build shared C-objects" >&5
3545 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3546
3547 # Check whether --with-shared or --without-shared was given.
3548 if test "${with_shared+set}" = set; then
3549   withval="$with_shared"
3550   with_shared=$withval
3551 else
3552   with_shared=no
3553 fi;
3554 echo "$as_me:3554: result: $with_shared" >&5
3555 echo "${ECHO_T}$with_shared" >&6
3556 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3557
3558 echo "$as_me:3558: checking for specified models" >&5
3559 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3560 test -z "$cf_list_models" && cf_list_models=normal
3561 echo "$as_me:3561: result: $cf_list_models" >&5
3562 echo "${ECHO_T}$cf_list_models" >&6
3563
3564 ### Use the first model as the default, and save its suffix for use in building
3565 ### up test-applications.
3566 echo "$as_me:3566: checking for default model" >&5
3567 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3568 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3569 echo "$as_me:3569: result: $DFT_LWR_MODEL" >&5
3570 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3571
3572 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3573
3574 echo "$as_me:3574: checking for specific curses-directory" >&5
3575 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3576
3577 # Check whether --with-curses-dir or --without-curses-dir was given.
3578 if test "${with_curses_dir+set}" = set; then
3579   withval="$with_curses_dir"
3580   cf_cv_curses_dir=$withval
3581 else
3582   cf_cv_curses_dir=no
3583 fi;
3584 echo "$as_me:3584: result: $cf_cv_curses_dir" >&5
3585 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3586
3587 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3588 then
3589
3590 if test "x$prefix" != xNONE; then
3591         cf_path_syntax="$prefix"
3592 else
3593         cf_path_syntax="$ac_default_prefix"
3594 fi
3595
3596 case ".$withval" in
3597 (.\$\(*\)*|.\'*\'*)
3598         ;;
3599 (..|./*|.\\*)
3600         ;;
3601 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3602         ;;
3603 (.\${*prefix}*|.\${*dir}*)
3604         eval withval="$withval"
3605         case ".$withval" in
3606         (.NONE/*)
3607                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3608                 ;;
3609         esac
3610         ;;
3611 (.no|.NONE/*)
3612         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3613         ;;
3614 (*)
3615         { { echo "$as_me:3615: error: expected a pathname, not \"$withval\"" >&5
3616 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3617    { (exit 1); exit 1; }; }
3618         ;;
3619 esac
3620
3621         if test -d "$cf_cv_curses_dir"
3622         then
3623
3624 if test -n "$cf_cv_curses_dir/include" ; then
3625   for cf_add_incdir in $cf_cv_curses_dir/include
3626   do
3627         while test $cf_add_incdir != /usr/include
3628         do
3629           if test -d $cf_add_incdir
3630           then
3631                 cf_have_incdir=no
3632                 if test -n "$CFLAGS$CPPFLAGS" ; then
3633                   # a loop is needed to ensure we can add subdirs of existing dirs
3634                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3635                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3636                           cf_have_incdir=yes; break
3637                         fi
3638                   done
3639                 fi
3640
3641                 if test "$cf_have_incdir" = no ; then
3642                   if test "$cf_add_incdir" = /usr/local/include ; then
3643                         if test "$GCC" = yes
3644                         then
3645                           cf_save_CPPFLAGS=$CPPFLAGS
3646                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3647                           cat >conftest.$ac_ext <<_ACEOF
3648 #line 3648 "configure"
3649 #include "confdefs.h"
3650 #include <stdio.h>
3651 int
3652 main ()
3653 {
3654 printf("Hello")
3655   ;
3656   return 0;
3657 }
3658 _ACEOF
3659 rm -f conftest.$ac_objext
3660 if { (eval echo "$as_me:3660: \"$ac_compile\"") >&5
3661   (eval $ac_compile) 2>&5
3662   ac_status=$?
3663   echo "$as_me:3663: \$? = $ac_status" >&5
3664   (exit $ac_status); } &&
3665          { ac_try='test -s conftest.$ac_objext'
3666   { (eval echo "$as_me:3666: \"$ac_try\"") >&5
3667   (eval $ac_try) 2>&5
3668   ac_status=$?
3669   echo "$as_me:3669: \$? = $ac_status" >&5
3670   (exit $ac_status); }; }; then
3671   :
3672 else
3673   echo "$as_me: failed program was:" >&5
3674 cat conftest.$ac_ext >&5
3675 cf_have_incdir=yes
3676 fi
3677 rm -f conftest.$ac_objext conftest.$ac_ext
3678                           CPPFLAGS=$cf_save_CPPFLAGS
3679                         fi
3680                   fi
3681                 fi
3682
3683                 if test "$cf_have_incdir" = no ; then
3684                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3685
3686 echo "${as_me:-configure}:3686: testing adding $cf_add_incdir to include-path ..." 1>&5
3687
3688                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3689
3690                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3691                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3692                   cf_add_incdir="$cf_top_incdir"
3693                 else
3694                   break
3695                 fi
3696           else
3697                 break
3698           fi
3699         done
3700   done
3701 fi
3702
3703 if test -n "$cf_cv_curses_dir/lib" ; then
3704         for cf_add_libdir in $cf_cv_curses_dir/lib
3705         do
3706                 if test $cf_add_libdir = /usr/lib ; then
3707                         :
3708                 elif test -d $cf_add_libdir
3709                 then
3710                         cf_have_libdir=no
3711                         if test -n "$LDFLAGS$LIBS" ; then
3712                                 # a loop is needed to ensure we can add subdirs of existing dirs
3713                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3714                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3715                                                 cf_have_libdir=yes; break
3716                                         fi
3717                                 done
3718                         fi
3719                         if test "$cf_have_libdir" = no ; then
3720                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3721
3722 echo "${as_me:-configure}:3722: testing adding $cf_add_libdir to library-path ..." 1>&5
3723
3724                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3725                         fi
3726                 fi
3727         done
3728 fi
3729
3730         fi
3731 fi
3732
3733 cf_ncuconfig_root=ncurses
3734 cf_have_ncuconfig=no
3735
3736 if test "x${PKG_CONFIG:=none}" != xnone; then
3737         echo "$as_me:3737: checking pkg-config for $cf_ncuconfig_root" >&5
3738 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3739         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3740                 echo "$as_me:3740: result: yes" >&5
3741 echo "${ECHO_T}yes" >&6
3742
3743                 echo "$as_me:3743: checking if the $cf_ncuconfig_root package files work" >&5
3744 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3745                 cf_have_ncuconfig=unknown
3746
3747                 cf_save_CPPFLAGS="$CPPFLAGS"
3748                 cf_save_LIBS="$LIBS"
3749
3750                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3751
3752 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3753 # Filter out duplicates - this happens with badly-designed ".pc" files...
3754 for cf_add_1lib in $LIBS
3755 do
3756         for cf_add_2lib in $cf_add_libs
3757         do
3758                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3759                 then
3760                         cf_add_1lib=
3761                         break
3762                 fi
3763         done
3764         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3765 done
3766 LIBS="$cf_add_libs"
3767
3768                 cat >conftest.$ac_ext <<_ACEOF
3769 #line 3769 "configure"
3770 #include "confdefs.h"
3771 #include <${cf_cv_ncurses_header:-curses.h}>
3772 int
3773 main ()
3774 {
3775 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3776   ;
3777   return 0;
3778 }
3779 _ACEOF
3780 rm -f conftest.$ac_objext conftest$ac_exeext
3781 if { (eval echo "$as_me:3781: \"$ac_link\"") >&5
3782   (eval $ac_link) 2>&5
3783   ac_status=$?
3784   echo "$as_me:3784: \$? = $ac_status" >&5
3785   (exit $ac_status); } &&
3786          { ac_try='test -s conftest$ac_exeext'
3787   { (eval echo "$as_me:3787: \"$ac_try\"") >&5
3788   (eval $ac_try) 2>&5
3789   ac_status=$?
3790   echo "$as_me:3790: \$? = $ac_status" >&5
3791   (exit $ac_status); }; }; then
3792   if test "$cross_compiling" = yes; then
3793   cf_have_ncuconfig=maybe
3794 else
3795   cat >conftest.$ac_ext <<_ACEOF
3796 #line 3796 "configure"
3797 #include "confdefs.h"
3798 #include <${cf_cv_ncurses_header:-curses.h}>
3799                                 int main(void)
3800                                 { char *xx = curses_version(); return (xx == 0); }
3801 _ACEOF
3802 rm -f conftest$ac_exeext
3803 if { (eval echo "$as_me:3803: \"$ac_link\"") >&5
3804   (eval $ac_link) 2>&5
3805   ac_status=$?
3806   echo "$as_me:3806: \$? = $ac_status" >&5
3807   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3808   { (eval echo "$as_me:3808: \"$ac_try\"") >&5
3809   (eval $ac_try) 2>&5
3810   ac_status=$?
3811   echo "$as_me:3811: \$? = $ac_status" >&5
3812   (exit $ac_status); }; }; then
3813   cf_have_ncuconfig=yes
3814 else
3815   echo "$as_me: program exited with status $ac_status" >&5
3816 echo "$as_me: failed program was:" >&5
3817 cat conftest.$ac_ext >&5
3818 cf_have_ncuconfig=no
3819 fi
3820 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3821 fi
3822 else
3823   echo "$as_me: failed program was:" >&5
3824 cat conftest.$ac_ext >&5
3825 cf_have_ncuconfig=no
3826 fi
3827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3828                 echo "$as_me:3828: result: $cf_have_ncuconfig" >&5
3829 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3830                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3831                 if test "$cf_have_ncuconfig" != "yes"
3832                 then
3833                         CPPFLAGS="$cf_save_CPPFLAGS"
3834                         LIBS="$cf_save_LIBS"
3835                         NCURSES_CONFIG_PKG=none
3836                 else
3837
3838 cat >>confdefs.h <<\EOF
3839 #define NCURSES 1
3840 EOF
3841
3842                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3843                 fi
3844
3845         else
3846                 echo "$as_me:3846: result: no" >&5
3847 echo "${ECHO_T}no" >&6
3848                 NCURSES_CONFIG_PKG=none
3849         fi
3850 else
3851         NCURSES_CONFIG_PKG=none
3852 fi
3853
3854 if test "x$cf_have_ncuconfig" = "xno"; then
3855         echo "Looking for ${cf_ncuconfig_root}-config"
3856
3857 if test -n "$ac_tool_prefix"; then
3858   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3859   do
3860     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3861 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3862 echo "$as_me:3862: checking for $ac_word" >&5
3863 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3864 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3865   echo $ECHO_N "(cached) $ECHO_C" >&6
3866 else
3867   if test -n "$NCURSES_CONFIG"; then
3868   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3869 else
3870   ac_save_IFS=$IFS; IFS=$ac_path_separator
3871 ac_dummy="$PATH"
3872 for ac_dir in $ac_dummy; do
3873   IFS=$ac_save_IFS
3874   test -z "$ac_dir" && ac_dir=.
3875   $as_executable_p "$ac_dir/$ac_word" || continue
3876 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3877 echo "$as_me:3877: found $ac_dir/$ac_word" >&5
3878 break
3879 done
3880
3881 fi
3882 fi
3883 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3884 if test -n "$NCURSES_CONFIG"; then
3885   echo "$as_me:3885: result: $NCURSES_CONFIG" >&5
3886 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3887 else
3888   echo "$as_me:3888: result: no" >&5
3889 echo "${ECHO_T}no" >&6
3890 fi
3891
3892     test -n "$NCURSES_CONFIG" && break
3893   done
3894 fi
3895 if test -z "$NCURSES_CONFIG"; then
3896   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3897   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3898 do
3899   # Extract the first word of "$ac_prog", so it can be a program name with args.
3900 set dummy $ac_prog; ac_word=$2
3901 echo "$as_me:3901: checking for $ac_word" >&5
3902 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3903 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3904   echo $ECHO_N "(cached) $ECHO_C" >&6
3905 else
3906   if test -n "$ac_ct_NCURSES_CONFIG"; then
3907   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3908 else
3909   ac_save_IFS=$IFS; IFS=$ac_path_separator
3910 ac_dummy="$PATH"
3911 for ac_dir in $ac_dummy; do
3912   IFS=$ac_save_IFS
3913   test -z "$ac_dir" && ac_dir=.
3914   $as_executable_p "$ac_dir/$ac_word" || continue
3915 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
3916 echo "$as_me:3916: found $ac_dir/$ac_word" >&5
3917 break
3918 done
3919
3920 fi
3921 fi
3922 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
3923 if test -n "$ac_ct_NCURSES_CONFIG"; then
3924   echo "$as_me:3924: result: $ac_ct_NCURSES_CONFIG" >&5
3925 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
3926 else
3927   echo "$as_me:3927: result: no" >&5
3928 echo "${ECHO_T}no" >&6
3929 fi
3930
3931   test -n "$ac_ct_NCURSES_CONFIG" && break
3932 done
3933 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
3934
3935   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
3936 fi
3937
3938         if test "$NCURSES_CONFIG" != none ; then
3939
3940                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
3941
3942 cf_add_libs="`$NCURSES_CONFIG --libs`"
3943 # Filter out duplicates - this happens with badly-designed ".pc" files...
3944 for cf_add_1lib in $LIBS
3945 do
3946         for cf_add_2lib in $cf_add_libs
3947         do
3948                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3949                 then
3950                         cf_add_1lib=
3951                         break
3952                 fi
3953         done
3954         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3955 done
3956 LIBS="$cf_add_libs"
3957
3958                 # even with config script, some packages use no-override for curses.h
3959
3960 echo "$as_me:3960: checking if we have identified curses headers" >&5
3961 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
3962 if test "${cf_cv_ncurses_header+set}" = set; then
3963   echo $ECHO_N "(cached) $ECHO_C" >&6
3964 else
3965
3966 cf_cv_ncurses_header=none
3967 for cf_header in \
3968         ncurses.h ncurses/ncurses.h \
3969         curses.h ncurses/curses.h
3970 do
3971 cat >conftest.$ac_ext <<_ACEOF
3972 #line 3972 "configure"
3973 #include "confdefs.h"
3974 #include <${cf_header}>
3975 int
3976 main ()
3977 {
3978 initscr(); tgoto("?", 0,0)
3979   ;
3980   return 0;
3981 }
3982 _ACEOF
3983 rm -f conftest.$ac_objext
3984 if { (eval echo "$as_me:3984: \"$ac_compile\"") >&5
3985   (eval $ac_compile) 2>&5
3986   ac_status=$?
3987   echo "$as_me:3987: \$? = $ac_status" >&5
3988   (exit $ac_status); } &&
3989          { ac_try='test -s conftest.$ac_objext'
3990   { (eval echo "$as_me:3990: \"$ac_try\"") >&5
3991   (eval $ac_try) 2>&5
3992   ac_status=$?
3993   echo "$as_me:3993: \$? = $ac_status" >&5
3994   (exit $ac_status); }; }; then
3995   cf_cv_ncurses_header=$cf_header; break
3996 else
3997   echo "$as_me: failed program was:" >&5
3998 cat conftest.$ac_ext >&5
3999 fi
4000 rm -f conftest.$ac_objext conftest.$ac_ext
4001 done
4002
4003 fi
4004 echo "$as_me:4004: result: $cf_cv_ncurses_header" >&5
4005 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4006
4007 if test "$cf_cv_ncurses_header" = none ; then
4008         { { echo "$as_me:4008: error: No curses header-files found" >&5
4009 echo "$as_me: error: No curses header-files found" >&2;}
4010    { (exit 1); exit 1; }; }
4011 fi
4012
4013 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4014
4015 for ac_header in $cf_cv_ncurses_header
4016 do
4017 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4018 echo "$as_me:4018: checking for $ac_header" >&5
4019 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4020 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4021   echo $ECHO_N "(cached) $ECHO_C" >&6
4022 else
4023   cat >conftest.$ac_ext <<_ACEOF
4024 #line 4024 "configure"
4025 #include "confdefs.h"
4026 #include <$ac_header>
4027 _ACEOF
4028 if { (eval echo "$as_me:4028: \"$ac_cpp conftest.$ac_ext\"") >&5
4029   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4030   ac_status=$?
4031   egrep -v '^ *\+' conftest.er1 >conftest.err
4032   rm -f conftest.er1
4033   cat conftest.err >&5
4034   echo "$as_me:4034: \$? = $ac_status" >&5
4035   (exit $ac_status); } >/dev/null; then
4036   if test -s conftest.err; then
4037     ac_cpp_err=$ac_c_preproc_warn_flag
4038   else
4039     ac_cpp_err=
4040   fi
4041 else
4042   ac_cpp_err=yes
4043 fi
4044 if test -z "$ac_cpp_err"; then
4045   eval "$as_ac_Header=yes"
4046 else
4047   echo "$as_me: failed program was:" >&5
4048   cat conftest.$ac_ext >&5
4049   eval "$as_ac_Header=no"
4050 fi
4051 rm -f conftest.err conftest.$ac_ext
4052 fi
4053 echo "$as_me:4053: result: `eval echo '${'$as_ac_Header'}'`" >&5
4054 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4055 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4056   cat >>confdefs.h <<EOF
4057 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4058 EOF
4059
4060 fi
4061 done
4062
4063 cat >>confdefs.h <<\EOF
4064 #define NCURSES 1
4065 EOF
4066
4067 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4068
4069                 cat >>confdefs.h <<EOF
4070 #define $cf_nculib_ROOT 1
4071 EOF
4072
4073                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4074
4075         else
4076
4077 cf_ncuhdr_root=ncurses
4078
4079 test -n "$cf_cv_curses_dir" && \
4080 test "$cf_cv_curses_dir" != "no" && { \
4081
4082 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4083   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4084   do
4085         while test $cf_add_incdir != /usr/include
4086         do
4087           if test -d $cf_add_incdir
4088           then
4089                 cf_have_incdir=no
4090                 if test -n "$CFLAGS$CPPFLAGS" ; then
4091                   # a loop is needed to ensure we can add subdirs of existing dirs
4092                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4093                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4094                           cf_have_incdir=yes; break
4095                         fi
4096                   done
4097                 fi
4098
4099                 if test "$cf_have_incdir" = no ; then
4100                   if test "$cf_add_incdir" = /usr/local/include ; then
4101                         if test "$GCC" = yes
4102                         then
4103                           cf_save_CPPFLAGS=$CPPFLAGS
4104                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4105                           cat >conftest.$ac_ext <<_ACEOF
4106 #line 4106 "configure"
4107 #include "confdefs.h"
4108 #include <stdio.h>
4109 int
4110 main ()
4111 {
4112 printf("Hello")
4113   ;
4114   return 0;
4115 }
4116 _ACEOF
4117 rm -f conftest.$ac_objext
4118 if { (eval echo "$as_me:4118: \"$ac_compile\"") >&5
4119   (eval $ac_compile) 2>&5
4120   ac_status=$?
4121   echo "$as_me:4121: \$? = $ac_status" >&5
4122   (exit $ac_status); } &&
4123          { ac_try='test -s conftest.$ac_objext'
4124   { (eval echo "$as_me:4124: \"$ac_try\"") >&5
4125   (eval $ac_try) 2>&5
4126   ac_status=$?
4127   echo "$as_me:4127: \$? = $ac_status" >&5
4128   (exit $ac_status); }; }; then
4129   :
4130 else
4131   echo "$as_me: failed program was:" >&5
4132 cat conftest.$ac_ext >&5
4133 cf_have_incdir=yes
4134 fi
4135 rm -f conftest.$ac_objext conftest.$ac_ext
4136                           CPPFLAGS=$cf_save_CPPFLAGS
4137                         fi
4138                   fi
4139                 fi
4140
4141                 if test "$cf_have_incdir" = no ; then
4142                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4143
4144 echo "${as_me:-configure}:4144: testing adding $cf_add_incdir to include-path ..." 1>&5
4145
4146                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4147
4148                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4149                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4150                   cf_add_incdir="$cf_top_incdir"
4151                 else
4152                   break
4153                 fi
4154           else
4155                 break
4156           fi
4157         done
4158   done
4159 fi
4160
4161 }
4162
4163 echo "$as_me:4163: checking for $cf_ncuhdr_root header in include-path" >&5
4164 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4165 if test "${cf_cv_ncurses_h+set}" = set; then
4166   echo $ECHO_N "(cached) $ECHO_C" >&6
4167 else
4168
4169         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4170         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4171         for cf_header in $cf_header_list
4172         do
4173
4174         cat >conftest.$ac_ext <<_ACEOF
4175 #line 4175 "configure"
4176 #include "confdefs.h"
4177
4178 #include <$cf_header>
4179 int
4180 main ()
4181 {
4182
4183 #ifdef NCURSES_VERSION
4184
4185 printf("%s\n", NCURSES_VERSION);
4186 #else
4187 #ifdef __NCURSES_H
4188 printf("old\n");
4189 #else
4190         make an error
4191 #endif
4192 #endif
4193
4194   ;
4195   return 0;
4196 }
4197 _ACEOF
4198 rm -f conftest.$ac_objext
4199 if { (eval echo "$as_me:4199: \"$ac_compile\"") >&5
4200   (eval $ac_compile) 2>&5
4201   ac_status=$?
4202   echo "$as_me:4202: \$? = $ac_status" >&5
4203   (exit $ac_status); } &&
4204          { ac_try='test -s conftest.$ac_objext'
4205   { (eval echo "$as_me:4205: \"$ac_try\"") >&5
4206   (eval $ac_try) 2>&5
4207   ac_status=$?
4208   echo "$as_me:4208: \$? = $ac_status" >&5
4209   (exit $ac_status); }; }; then
4210   cf_cv_ncurses_h=$cf_header
4211
4212 else
4213   echo "$as_me: failed program was:" >&5
4214 cat conftest.$ac_ext >&5
4215 cf_cv_ncurses_h=no
4216 fi
4217 rm -f conftest.$ac_objext conftest.$ac_ext
4218
4219                 test "$cf_cv_ncurses_h" != no && break
4220         done
4221
4222 fi
4223 echo "$as_me:4223: result: $cf_cv_ncurses_h" >&5
4224 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4225
4226 if test "$cf_cv_ncurses_h" != no ; then
4227         cf_cv_ncurses_header=$cf_cv_ncurses_h
4228 else
4229
4230 echo "$as_me:4230: checking for $cf_ncuhdr_root include-path" >&5
4231 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4232 if test "${cf_cv_ncurses_h2+set}" = set; then
4233   echo $ECHO_N "(cached) $ECHO_C" >&6
4234 else
4235
4236         test -n "$verbose" && echo
4237
4238 cf_search=
4239
4240 # collect the current set of include-directories from compiler flags
4241 cf_header_path_list=""
4242 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4243         for cf_header_path in $CPPFLAGS $CFLAGS
4244         do
4245                 case $cf_header_path in
4246                 (-I*)
4247                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4248
4249 test "x$cf_header_path" != "xNONE" && \
4250 test -d "$cf_header_path" && \
4251  {
4252         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4253         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4254         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4255         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4256         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4257         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"
4258 }
4259
4260                         cf_header_path_list="$cf_header_path_list $cf_search"
4261                         ;;
4262                 esac
4263         done
4264 fi
4265
4266 # add the variations for the package we are looking for
4267
4268 cf_search=
4269
4270 test "x$prefix" != "xNONE" && \
4271 test -d "$prefix" && \
4272  {
4273         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4274         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4275         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4276         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4277         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4278         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4279 }
4280
4281 for cf_subdir_prefix in \
4282         /usr \
4283         /usr/local \
4284         /usr/pkg \
4285         /opt \
4286         /opt/local \
4287         $HOME
4288 do
4289
4290 test "x$cf_subdir_prefix" != "x$prefix" && \
4291 test -d "$cf_subdir_prefix" && \
4292 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4293         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4294         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4295         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4296         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4297         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4298         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"
4299 }
4300
4301 done
4302
4303 test "$includedir" != NONE && \
4304 test "$includedir" != "/usr/include" && \
4305 test -d "$includedir" && {
4306         test -d $includedir &&    cf_search="$cf_search $includedir"
4307         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4308 }
4309
4310 test "$oldincludedir" != NONE && \
4311 test "$oldincludedir" != "/usr/include" && \
4312 test -d "$oldincludedir" && {
4313         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4314         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4315 }
4316
4317 cf_search="$cf_search $cf_header_path_list"
4318
4319         test -n "$verbose" && echo search path $cf_search
4320         cf_save2_CPPFLAGS="$CPPFLAGS"
4321         for cf_incdir in $cf_search
4322         do
4323
4324 if test -n "$cf_incdir" ; then
4325   for cf_add_incdir in $cf_incdir
4326   do
4327         while test $cf_add_incdir != /usr/include
4328         do
4329           if test -d $cf_add_incdir
4330           then
4331                 cf_have_incdir=no
4332                 if test -n "$CFLAGS$CPPFLAGS" ; then
4333                   # a loop is needed to ensure we can add subdirs of existing dirs
4334                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4335                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4336                           cf_have_incdir=yes; break
4337                         fi
4338                   done
4339                 fi
4340
4341                 if test "$cf_have_incdir" = no ; then
4342                   if test "$cf_add_incdir" = /usr/local/include ; then
4343                         if test "$GCC" = yes
4344                         then
4345                           cf_save_CPPFLAGS=$CPPFLAGS
4346                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4347                           cat >conftest.$ac_ext <<_ACEOF
4348 #line 4348 "configure"
4349 #include "confdefs.h"
4350 #include <stdio.h>
4351 int
4352 main ()
4353 {
4354 printf("Hello")
4355   ;
4356   return 0;
4357 }
4358 _ACEOF
4359 rm -f conftest.$ac_objext
4360 if { (eval echo "$as_me:4360: \"$ac_compile\"") >&5
4361   (eval $ac_compile) 2>&5
4362   ac_status=$?
4363   echo "$as_me:4363: \$? = $ac_status" >&5
4364   (exit $ac_status); } &&
4365          { ac_try='test -s conftest.$ac_objext'
4366   { (eval echo "$as_me:4366: \"$ac_try\"") >&5
4367   (eval $ac_try) 2>&5
4368   ac_status=$?
4369   echo "$as_me:4369: \$? = $ac_status" >&5
4370   (exit $ac_status); }; }; then
4371   :
4372 else
4373   echo "$as_me: failed program was:" >&5
4374 cat conftest.$ac_ext >&5
4375 cf_have_incdir=yes
4376 fi
4377 rm -f conftest.$ac_objext conftest.$ac_ext
4378                           CPPFLAGS=$cf_save_CPPFLAGS
4379                         fi
4380                   fi
4381                 fi
4382
4383                 if test "$cf_have_incdir" = no ; then
4384                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4385
4386 echo "${as_me:-configure}:4386: testing adding $cf_add_incdir to include-path ..." 1>&5
4387
4388                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4389
4390                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4391                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4392                   cf_add_incdir="$cf_top_incdir"
4393                 else
4394                   break
4395                 fi
4396           else
4397                 break
4398           fi
4399         done
4400   done
4401 fi
4402
4403                 for cf_header in \
4404                         ncurses.h \
4405                         curses.h
4406                 do
4407
4408         cat >conftest.$ac_ext <<_ACEOF
4409 #line 4409 "configure"
4410 #include "confdefs.h"
4411
4412 #include <$cf_header>
4413 int
4414 main ()
4415 {
4416
4417 #ifdef NCURSES_VERSION
4418
4419 printf("%s\n", NCURSES_VERSION);
4420 #else
4421 #ifdef __NCURSES_H
4422 printf("old\n");
4423 #else
4424         make an error
4425 #endif
4426 #endif
4427
4428   ;
4429   return 0;
4430 }
4431 _ACEOF
4432 rm -f conftest.$ac_objext
4433 if { (eval echo "$as_me:4433: \"$ac_compile\"") >&5
4434   (eval $ac_compile) 2>&5
4435   ac_status=$?
4436   echo "$as_me:4436: \$? = $ac_status" >&5
4437   (exit $ac_status); } &&
4438          { ac_try='test -s conftest.$ac_objext'
4439   { (eval echo "$as_me:4439: \"$ac_try\"") >&5
4440   (eval $ac_try) 2>&5
4441   ac_status=$?
4442   echo "$as_me:4442: \$? = $ac_status" >&5
4443   (exit $ac_status); }; }; then
4444   cf_cv_ncurses_h2=$cf_header
4445
4446 else
4447   echo "$as_me: failed program was:" >&5
4448 cat conftest.$ac_ext >&5
4449 cf_cv_ncurses_h2=no
4450 fi
4451 rm -f conftest.$ac_objext conftest.$ac_ext
4452
4453                         if test "$cf_cv_ncurses_h2" != no ; then
4454                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4455                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4456                                 break
4457                         fi
4458                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4459                 done
4460                 CPPFLAGS="$cf_save2_CPPFLAGS"
4461                 test "$cf_cv_ncurses_h2" != no && break
4462         done
4463         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4463: error: not found" >&5
4464 echo "$as_me: error: not found" >&2;}
4465    { (exit 1); exit 1; }; }
4466
4467 fi
4468 echo "$as_me:4468: result: $cf_cv_ncurses_h2" >&5
4469 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4470
4471         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4472         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4473         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4474                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4475         fi
4476
4477 if test -n "$cf_1st_incdir" ; then
4478   for cf_add_incdir in $cf_1st_incdir
4479   do
4480         while test $cf_add_incdir != /usr/include
4481         do
4482           if test -d $cf_add_incdir
4483           then
4484                 cf_have_incdir=no
4485                 if test -n "$CFLAGS$CPPFLAGS" ; then
4486                   # a loop is needed to ensure we can add subdirs of existing dirs
4487                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4488                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4489                           cf_have_incdir=yes; break
4490                         fi
4491                   done
4492                 fi
4493
4494                 if test "$cf_have_incdir" = no ; then
4495                   if test "$cf_add_incdir" = /usr/local/include ; then
4496                         if test "$GCC" = yes
4497                         then
4498                           cf_save_CPPFLAGS=$CPPFLAGS
4499                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4500                           cat >conftest.$ac_ext <<_ACEOF
4501 #line 4501 "configure"
4502 #include "confdefs.h"
4503 #include <stdio.h>
4504 int
4505 main ()
4506 {
4507 printf("Hello")
4508   ;
4509   return 0;
4510 }
4511 _ACEOF
4512 rm -f conftest.$ac_objext
4513 if { (eval echo "$as_me:4513: \"$ac_compile\"") >&5
4514   (eval $ac_compile) 2>&5
4515   ac_status=$?
4516   echo "$as_me:4516: \$? = $ac_status" >&5
4517   (exit $ac_status); } &&
4518          { ac_try='test -s conftest.$ac_objext'
4519   { (eval echo "$as_me:4519: \"$ac_try\"") >&5
4520   (eval $ac_try) 2>&5
4521   ac_status=$?
4522   echo "$as_me:4522: \$? = $ac_status" >&5
4523   (exit $ac_status); }; }; then
4524   :
4525 else
4526   echo "$as_me: failed program was:" >&5
4527 cat conftest.$ac_ext >&5
4528 cf_have_incdir=yes
4529 fi
4530 rm -f conftest.$ac_objext conftest.$ac_ext
4531                           CPPFLAGS=$cf_save_CPPFLAGS
4532                         fi
4533                   fi
4534                 fi
4535
4536                 if test "$cf_have_incdir" = no ; then
4537                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4538
4539 echo "${as_me:-configure}:4539: testing adding $cf_add_incdir to include-path ..." 1>&5
4540
4541                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4542
4543                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4544                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4545                   cf_add_incdir="$cf_top_incdir"
4546                 else
4547                   break
4548                 fi
4549           else
4550                 break
4551           fi
4552         done
4553   done
4554 fi
4555
4556 fi
4557
4558 # Set definitions to allow ifdef'ing for ncurses.h
4559
4560 case $cf_cv_ncurses_header in
4561 (*ncurses.h)
4562
4563 cat >>confdefs.h <<\EOF
4564 #define HAVE_NCURSES_H 1
4565 EOF
4566
4567         ;;
4568 esac
4569
4570 case $cf_cv_ncurses_header in
4571 (ncurses/curses.h|ncurses/ncurses.h)
4572
4573 cat >>confdefs.h <<\EOF
4574 #define HAVE_NCURSES_NCURSES_H 1
4575 EOF
4576
4577         ;;
4578 (ncursesw/curses.h|ncursesw/ncurses.h)
4579
4580 cat >>confdefs.h <<\EOF
4581 #define HAVE_NCURSESW_NCURSES_H 1
4582 EOF
4583
4584         ;;
4585 esac
4586
4587 echo "$as_me:4587: checking for terminfo header" >&5
4588 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4589 if test "${cf_cv_term_header+set}" = set; then
4590   echo $ECHO_N "(cached) $ECHO_C" >&6
4591 else
4592
4593 case ${cf_cv_ncurses_header} in
4594 (*/ncurses.h|*/ncursesw.h)
4595         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4596         ;;
4597 (*)
4598         cf_term_header=term.h
4599         ;;
4600 esac
4601
4602 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4603 do
4604 cat >conftest.$ac_ext <<_ACEOF
4605 #line 4605 "configure"
4606 #include "confdefs.h"
4607 #include <stdio.h>
4608 #include <${cf_cv_ncurses_header:-curses.h}>
4609 #include <$cf_test>
4610
4611 int
4612 main ()
4613 {
4614 int x = auto_left_margin
4615   ;
4616   return 0;
4617 }
4618 _ACEOF
4619 rm -f conftest.$ac_objext
4620 if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
4621   (eval $ac_compile) 2>&5
4622   ac_status=$?
4623   echo "$as_me:4623: \$? = $ac_status" >&5
4624   (exit $ac_status); } &&
4625          { ac_try='test -s conftest.$ac_objext'
4626   { (eval echo "$as_me:4626: \"$ac_try\"") >&5
4627   (eval $ac_try) 2>&5
4628   ac_status=$?
4629   echo "$as_me:4629: \$? = $ac_status" >&5
4630   (exit $ac_status); }; }; then
4631
4632         cf_cv_term_header="$cf_test"
4633 else
4634   echo "$as_me: failed program was:" >&5
4635 cat conftest.$ac_ext >&5
4636
4637         cf_cv_term_header=unknown
4638
4639 fi
4640 rm -f conftest.$ac_objext conftest.$ac_ext
4641         test "$cf_cv_term_header" != unknown && break
4642 done
4643
4644 fi
4645 echo "$as_me:4645: result: $cf_cv_term_header" >&5
4646 echo "${ECHO_T}$cf_cv_term_header" >&6
4647
4648 # Set definitions to allow ifdef'ing to accommodate subdirectories
4649
4650 case $cf_cv_term_header in
4651 (*term.h)
4652
4653 cat >>confdefs.h <<\EOF
4654 #define HAVE_TERM_H 1
4655 EOF
4656
4657         ;;
4658 esac
4659
4660 case $cf_cv_term_header in
4661 (ncurses/term.h)
4662
4663 cat >>confdefs.h <<\EOF
4664 #define HAVE_NCURSES_TERM_H 1
4665 EOF
4666
4667         ;;
4668 (ncursesw/term.h)
4669
4670 cat >>confdefs.h <<\EOF
4671 #define HAVE_NCURSESW_TERM_H 1
4672 EOF
4673
4674         ;;
4675 esac
4676
4677 # some applications need this, but should check for NCURSES_VERSION
4678
4679 cat >>confdefs.h <<\EOF
4680 #define NCURSES 1
4681 EOF
4682
4683 echo "$as_me:4683: checking for ncurses version" >&5
4684 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4685 if test "${cf_cv_ncurses_version+set}" = set; then
4686   echo $ECHO_N "(cached) $ECHO_C" >&6
4687 else
4688
4689         cf_cv_ncurses_version=no
4690         cf_tempfile=out$$
4691         rm -f $cf_tempfile
4692         if test "$cross_compiling" = yes; then
4693
4694         # This will not work if the preprocessor splits the line after the
4695         # Autoconf token.  The 'unproto' program does that.
4696         cat > conftest.$ac_ext <<EOF
4697 #include <${cf_cv_ncurses_header:-curses.h}>
4698 #undef Autoconf
4699 #ifdef NCURSES_VERSION
4700 Autoconf NCURSES_VERSION
4701 #else
4702 #ifdef __NCURSES_H
4703 Autoconf "old"
4704 #endif
4705 ;
4706 #endif
4707 EOF
4708         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4709         { (eval echo "$as_me:4709: \"$cf_try\"") >&5
4710   (eval $cf_try) 2>&5
4711   ac_status=$?
4712   echo "$as_me:4712: \$? = $ac_status" >&5
4713   (exit $ac_status); }
4714         if test -f conftest.out ; then
4715                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4716                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4717                 rm -f conftest.out
4718         fi
4719
4720 else
4721   cat >conftest.$ac_ext <<_ACEOF
4722 #line 4722 "configure"
4723 #include "confdefs.h"
4724
4725 #include <${cf_cv_ncurses_header:-curses.h}>
4726 #include <stdio.h>
4727 int main()
4728 {
4729         FILE *fp = fopen("$cf_tempfile", "w");
4730 #ifdef NCURSES_VERSION
4731 # ifdef NCURSES_VERSION_PATCH
4732         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4733 # else
4734         fprintf(fp, "%s\n", NCURSES_VERSION);
4735 # endif
4736 #else
4737 # ifdef __NCURSES_H
4738         fprintf(fp, "old\n");
4739 # else
4740         make an error
4741 # endif
4742 #endif
4743         ${cf_cv_main_return:-return}(0);
4744 }
4745 _ACEOF
4746 rm -f conftest$ac_exeext
4747 if { (eval echo "$as_me:4747: \"$ac_link\"") >&5
4748   (eval $ac_link) 2>&5
4749   ac_status=$?
4750   echo "$as_me:4750: \$? = $ac_status" >&5
4751   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4752   { (eval echo "$as_me:4752: \"$ac_try\"") >&5
4753   (eval $ac_try) 2>&5
4754   ac_status=$?
4755   echo "$as_me:4755: \$? = $ac_status" >&5
4756   (exit $ac_status); }; }; then
4757
4758         cf_cv_ncurses_version=`cat $cf_tempfile`
4759 else
4760   echo "$as_me: program exited with status $ac_status" >&5
4761 echo "$as_me: failed program was:" >&5
4762 cat conftest.$ac_ext >&5
4763 fi
4764 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4765 fi
4766         rm -f $cf_tempfile
4767
4768 fi
4769 echo "$as_me:4769: result: $cf_cv_ncurses_version" >&5
4770 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4771 test "$cf_cv_ncurses_version" = no ||
4772 cat >>confdefs.h <<\EOF
4773 #define NCURSES 1
4774 EOF
4775
4776 cf_nculib_root=ncurses
4777         # This works, except for the special case where we find gpm, but
4778         # ncurses is in a nonstandard location via $LIBS, and we really want
4779         # to link gpm.
4780 cf_ncurses_LIBS=""
4781 cf_ncurses_SAVE="$LIBS"
4782 echo "$as_me:4782: checking for Gpm_Open in -lgpm" >&5
4783 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4784 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4785   echo $ECHO_N "(cached) $ECHO_C" >&6
4786 else
4787   ac_check_lib_save_LIBS=$LIBS
4788 LIBS="-lgpm  $LIBS"
4789 cat >conftest.$ac_ext <<_ACEOF
4790 #line 4790 "configure"
4791 #include "confdefs.h"
4792
4793 /* Override any gcc2 internal prototype to avoid an error.  */
4794 #ifdef __cplusplus
4795 extern "C"
4796 #endif
4797 /* We use char because int might match the return type of a gcc2
4798    builtin and then its argument prototype would still apply.  */
4799 char Gpm_Open ();
4800 int
4801 main ()
4802 {
4803 Gpm_Open ();
4804   ;
4805   return 0;
4806 }
4807 _ACEOF
4808 rm -f conftest.$ac_objext conftest$ac_exeext
4809 if { (eval echo "$as_me:4809: \"$ac_link\"") >&5
4810   (eval $ac_link) 2>&5
4811   ac_status=$?
4812   echo "$as_me:4812: \$? = $ac_status" >&5
4813   (exit $ac_status); } &&
4814          { ac_try='test -s conftest$ac_exeext'
4815   { (eval echo "$as_me:4815: \"$ac_try\"") >&5
4816   (eval $ac_try) 2>&5
4817   ac_status=$?
4818   echo "$as_me:4818: \$? = $ac_status" >&5
4819   (exit $ac_status); }; }; then
4820   ac_cv_lib_gpm_Gpm_Open=yes
4821 else
4822   echo "$as_me: failed program was:" >&5
4823 cat conftest.$ac_ext >&5
4824 ac_cv_lib_gpm_Gpm_Open=no
4825 fi
4826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4827 LIBS=$ac_check_lib_save_LIBS
4828 fi
4829 echo "$as_me:4829: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4830 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4831 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4832   echo "$as_me:4832: checking for initscr in -lgpm" >&5
4833 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4834 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4835   echo $ECHO_N "(cached) $ECHO_C" >&6
4836 else
4837   ac_check_lib_save_LIBS=$LIBS
4838 LIBS="-lgpm  $LIBS"
4839 cat >conftest.$ac_ext <<_ACEOF
4840 #line 4840 "configure"
4841 #include "confdefs.h"
4842
4843 /* Override any gcc2 internal prototype to avoid an error.  */
4844 #ifdef __cplusplus
4845 extern "C"
4846 #endif
4847 /* We use char because int might match the return type of a gcc2
4848    builtin and then its argument prototype would still apply.  */
4849 char initscr ();
4850 int
4851 main ()
4852 {
4853 initscr ();
4854   ;
4855   return 0;
4856 }
4857 _ACEOF
4858 rm -f conftest.$ac_objext conftest$ac_exeext
4859 if { (eval echo "$as_me:4859: \"$ac_link\"") >&5
4860   (eval $ac_link) 2>&5
4861   ac_status=$?
4862   echo "$as_me:4862: \$? = $ac_status" >&5
4863   (exit $ac_status); } &&
4864          { ac_try='test -s conftest$ac_exeext'
4865   { (eval echo "$as_me:4865: \"$ac_try\"") >&5
4866   (eval $ac_try) 2>&5
4867   ac_status=$?
4868   echo "$as_me:4868: \$? = $ac_status" >&5
4869   (exit $ac_status); }; }; then
4870   ac_cv_lib_gpm_initscr=yes
4871 else
4872   echo "$as_me: failed program was:" >&5
4873 cat conftest.$ac_ext >&5
4874 ac_cv_lib_gpm_initscr=no
4875 fi
4876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4877 LIBS=$ac_check_lib_save_LIBS
4878 fi
4879 echo "$as_me:4879: result: $ac_cv_lib_gpm_initscr" >&5
4880 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4881 if test $ac_cv_lib_gpm_initscr = yes; then
4882   LIBS="$cf_ncurses_SAVE"
4883 else
4884   cf_ncurses_LIBS="-lgpm"
4885 fi
4886
4887 fi
4888
4889 case $host_os in
4890 (freebsd*)
4891         # This is only necessary if you are linking against an obsolete
4892         # version of ncurses (but it should do no harm, since it's static).
4893         if test "$cf_nculib_root" = ncurses ; then
4894                 echo "$as_me:4894: checking for tgoto in -lmytinfo" >&5
4895 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4896 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4897   echo $ECHO_N "(cached) $ECHO_C" >&6
4898 else
4899   ac_check_lib_save_LIBS=$LIBS
4900 LIBS="-lmytinfo  $LIBS"
4901 cat >conftest.$ac_ext <<_ACEOF
4902 #line 4902 "configure"
4903 #include "confdefs.h"
4904
4905 /* Override any gcc2 internal prototype to avoid an error.  */
4906 #ifdef __cplusplus
4907 extern "C"
4908 #endif
4909 /* We use char because int might match the return type of a gcc2
4910    builtin and then its argument prototype would still apply.  */
4911 char tgoto ();
4912 int
4913 main ()
4914 {
4915 tgoto ();
4916   ;
4917   return 0;
4918 }
4919 _ACEOF
4920 rm -f conftest.$ac_objext conftest$ac_exeext
4921 if { (eval echo "$as_me:4921: \"$ac_link\"") >&5
4922   (eval $ac_link) 2>&5
4923   ac_status=$?
4924   echo "$as_me:4924: \$? = $ac_status" >&5
4925   (exit $ac_status); } &&
4926          { ac_try='test -s conftest$ac_exeext'
4927   { (eval echo "$as_me:4927: \"$ac_try\"") >&5
4928   (eval $ac_try) 2>&5
4929   ac_status=$?
4930   echo "$as_me:4930: \$? = $ac_status" >&5
4931   (exit $ac_status); }; }; then
4932   ac_cv_lib_mytinfo_tgoto=yes
4933 else
4934   echo "$as_me: failed program was:" >&5
4935 cat conftest.$ac_ext >&5
4936 ac_cv_lib_mytinfo_tgoto=no
4937 fi
4938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4939 LIBS=$ac_check_lib_save_LIBS
4940 fi
4941 echo "$as_me:4941: result: $ac_cv_lib_mytinfo_tgoto" >&5
4942 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4943 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4944   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
4945 fi
4946
4947         fi
4948         ;;
4949 esac
4950
4951 cf_add_libs="$cf_ncurses_LIBS"
4952 # Filter out duplicates - this happens with badly-designed ".pc" files...
4953 for cf_add_1lib in $LIBS
4954 do
4955         for cf_add_2lib in $cf_add_libs
4956         do
4957                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4958                 then
4959                         cf_add_1lib=
4960                         break
4961                 fi
4962         done
4963         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4964 done
4965 LIBS="$cf_add_libs"
4966
4967 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4968 then
4969
4970 cf_add_libs="-l$cf_nculib_root"
4971 # Filter out duplicates - this happens with badly-designed ".pc" files...
4972 for cf_add_1lib in $LIBS
4973 do
4974         for cf_add_2lib in $cf_add_libs
4975         do
4976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4977                 then
4978                         cf_add_1lib=
4979                         break
4980                 fi
4981         done
4982         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4983 done
4984 LIBS="$cf_add_libs"
4985
4986 else
4987
4988         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
4989         cf_libdir=""
4990         echo "$as_me:4990: checking for initscr" >&5
4991 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
4992 if test "${ac_cv_func_initscr+set}" = set; then
4993   echo $ECHO_N "(cached) $ECHO_C" >&6
4994 else
4995   cat >conftest.$ac_ext <<_ACEOF
4996 #line 4996 "configure"
4997 #include "confdefs.h"
4998 /* System header to define __stub macros and hopefully few prototypes,
4999     which can conflict with char initscr (); below.  */
5000 #include <assert.h>
5001 /* Override any gcc2 internal prototype to avoid an error.  */
5002 #ifdef __cplusplus
5003 extern "C"
5004 #endif
5005 /* We use char because int might match the return type of a gcc2
5006    builtin and then its argument prototype would still apply.  */
5007 char initscr ();
5008 char (*f) ();
5009
5010 int
5011 main ()
5012 {
5013 /* The GNU C library defines this for functions which it implements
5014     to always fail with ENOSYS.  Some functions are actually named
5015     something starting with __ and the normal name is an alias.  */
5016 #if defined (__stub_initscr) || defined (__stub___initscr)
5017 choke me
5018 #else
5019 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5020 #endif
5021
5022   ;
5023   return 0;
5024 }
5025 _ACEOF
5026 rm -f conftest.$ac_objext conftest$ac_exeext
5027 if { (eval echo "$as_me:5027: \"$ac_link\"") >&5
5028   (eval $ac_link) 2>&5
5029   ac_status=$?
5030   echo "$as_me:5030: \$? = $ac_status" >&5
5031   (exit $ac_status); } &&
5032          { ac_try='test -s conftest$ac_exeext'
5033   { (eval echo "$as_me:5033: \"$ac_try\"") >&5
5034   (eval $ac_try) 2>&5
5035   ac_status=$?
5036   echo "$as_me:5036: \$? = $ac_status" >&5
5037   (exit $ac_status); }; }; then
5038   ac_cv_func_initscr=yes
5039 else
5040   echo "$as_me: failed program was:" >&5
5041 cat conftest.$ac_ext >&5
5042 ac_cv_func_initscr=no
5043 fi
5044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5045 fi
5046 echo "$as_me:5046: result: $ac_cv_func_initscr" >&5
5047 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5048 if test $ac_cv_func_initscr = yes; then
5049   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5050 else
5051
5052                 cf_save_LIBS="$LIBS"
5053                 echo "$as_me:5053: checking for initscr in -l$cf_nculib_root" >&5
5054 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5055                 LIBS="-l$cf_nculib_root $LIBS"
5056                 cat >conftest.$ac_ext <<_ACEOF
5057 #line 5057 "configure"
5058 #include "confdefs.h"
5059 #include <${cf_cv_ncurses_header:-curses.h}>
5060 int
5061 main ()
5062 {
5063 initscr()
5064   ;
5065   return 0;
5066 }
5067 _ACEOF
5068 rm -f conftest.$ac_objext conftest$ac_exeext
5069 if { (eval echo "$as_me:5069: \"$ac_link\"") >&5
5070   (eval $ac_link) 2>&5
5071   ac_status=$?
5072   echo "$as_me:5072: \$? = $ac_status" >&5
5073   (exit $ac_status); } &&
5074          { ac_try='test -s conftest$ac_exeext'
5075   { (eval echo "$as_me:5075: \"$ac_try\"") >&5
5076   (eval $ac_try) 2>&5
5077   ac_status=$?
5078   echo "$as_me:5078: \$? = $ac_status" >&5
5079   (exit $ac_status); }; }; then
5080   echo "$as_me:5080: result: yes" >&5
5081 echo "${ECHO_T}yes" >&6
5082                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5083
5084 else
5085   echo "$as_me: failed program was:" >&5
5086 cat conftest.$ac_ext >&5
5087 echo "$as_me:5087: result: no" >&5
5088 echo "${ECHO_T}no" >&6
5089
5090 cf_search=
5091 cf_library_path_list=""
5092 if test -n "${LDFLAGS}${LIBS}" ; then
5093         for cf_library_path in $LDFLAGS $LIBS
5094         do
5095                 case $cf_library_path in
5096                 (-L*)
5097                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5098
5099 test "x$cf_library_path" != "xNONE" && \
5100 test -d "$cf_library_path" && \
5101  {
5102         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5103         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5104         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5105         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5106         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5107         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"
5108 }
5109
5110                         cf_library_path_list="$cf_library_path_list $cf_search"
5111                         ;;
5112                 esac
5113         done
5114 fi
5115
5116 cf_search=
5117
5118 test "x$prefix" != "xNONE" && \
5119 test -d "$prefix" && \
5120  {
5121         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5122         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5123         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5124         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5125         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5126         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5127 }
5128
5129 for cf_subdir_prefix in \
5130         /usr \
5131         /usr/local \
5132         /usr/pkg \
5133         /opt \
5134         /opt/local \
5135         $HOME
5136 do
5137
5138 test "x$cf_subdir_prefix" != "x$prefix" && \
5139 test -d "$cf_subdir_prefix" && \
5140 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5141         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5142         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5143         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5144         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5145         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5146         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"
5147 }
5148
5149 done
5150
5151 cf_search="$cf_library_path_list $cf_search"
5152
5153                         for cf_libdir in $cf_search
5154                         do
5155                                 echo "$as_me:5155: checking for -l$cf_nculib_root in $cf_libdir" >&5
5156 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5157                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5158                                 cat >conftest.$ac_ext <<_ACEOF
5159 #line 5159 "configure"
5160 #include "confdefs.h"
5161 #include <${cf_cv_ncurses_header:-curses.h}>
5162 int
5163 main ()
5164 {
5165 initscr()
5166   ;
5167   return 0;
5168 }
5169 _ACEOF
5170 rm -f conftest.$ac_objext conftest$ac_exeext
5171 if { (eval echo "$as_me:5171: \"$ac_link\"") >&5
5172   (eval $ac_link) 2>&5
5173   ac_status=$?
5174   echo "$as_me:5174: \$? = $ac_status" >&5
5175   (exit $ac_status); } &&
5176          { ac_try='test -s conftest$ac_exeext'
5177   { (eval echo "$as_me:5177: \"$ac_try\"") >&5
5178   (eval $ac_try) 2>&5
5179   ac_status=$?
5180   echo "$as_me:5180: \$? = $ac_status" >&5
5181   (exit $ac_status); }; }; then
5182   echo "$as_me:5182: result: yes" >&5
5183 echo "${ECHO_T}yes" >&6
5184                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5185                                          break
5186 else
5187   echo "$as_me: failed program was:" >&5
5188 cat conftest.$ac_ext >&5
5189 echo "$as_me:5189: result: no" >&5
5190 echo "${ECHO_T}no" >&6
5191                                          LIBS="$cf_save_LIBS"
5192 fi
5193 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5194                         done
5195
5196 fi
5197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5198
5199 fi
5200
5201 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5202
5203 if test $cf_found_library = no ; then
5204         { { echo "$as_me:5204: error: Cannot link $cf_nculib_root library" >&5
5205 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5206    { (exit 1); exit 1; }; }
5207 fi
5208
5209 fi
5210
5211 if test -n "$cf_ncurses_LIBS" ; then
5212         echo "$as_me:5212: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5213 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5214         cf_ncurses_SAVE="$LIBS"
5215         for p in $cf_ncurses_LIBS ; do
5216                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5217                 if test "$q" != "$LIBS" ; then
5218                         LIBS="$q"
5219                 fi
5220         done
5221         cat >conftest.$ac_ext <<_ACEOF
5222 #line 5222 "configure"
5223 #include "confdefs.h"
5224 #include <${cf_cv_ncurses_header:-curses.h}>
5225 int
5226 main ()
5227 {
5228 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5229   ;
5230   return 0;
5231 }
5232 _ACEOF
5233 rm -f conftest.$ac_objext conftest$ac_exeext
5234 if { (eval echo "$as_me:5234: \"$ac_link\"") >&5
5235   (eval $ac_link) 2>&5
5236   ac_status=$?
5237   echo "$as_me:5237: \$? = $ac_status" >&5
5238   (exit $ac_status); } &&
5239          { ac_try='test -s conftest$ac_exeext'
5240   { (eval echo "$as_me:5240: \"$ac_try\"") >&5
5241   (eval $ac_try) 2>&5
5242   ac_status=$?
5243   echo "$as_me:5243: \$? = $ac_status" >&5
5244   (exit $ac_status); }; }; then
5245   echo "$as_me:5245: result: yes" >&5
5246 echo "${ECHO_T}yes" >&6
5247 else
5248   echo "$as_me: failed program was:" >&5
5249 cat conftest.$ac_ext >&5
5250 echo "$as_me:5250: result: no" >&5
5251 echo "${ECHO_T}no" >&6
5252                  LIBS="$cf_ncurses_SAVE"
5253 fi
5254 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5255 fi
5256
5257 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5258
5259 cat >>confdefs.h <<EOF
5260 #define $cf_nculib_ROOT 1
5261 EOF
5262
5263         fi
5264 else
5265         NCURSES_CONFIG=none
5266 fi
5267
5268 echo "$as_me:5268: checking if you want wide-character code" >&5
5269 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5270
5271 # Check whether --enable-widec or --disable-widec was given.
5272 if test "${enable_widec+set}" = set; then
5273   enableval="$enable_widec"
5274   with_widec=$enableval
5275 else
5276   with_widec=no
5277 fi;
5278 echo "$as_me:5278: result: $with_widec" >&5
5279 echo "${ECHO_T}$with_widec" >&6
5280 if test "$with_widec" = yes ; then
5281
5282 echo "$as_me:5282: checking for multibyte character support" >&5
5283 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5284 if test "${cf_cv_utf8_lib+set}" = set; then
5285   echo $ECHO_N "(cached) $ECHO_C" >&6
5286 else
5287
5288         cf_save_LIBS="$LIBS"
5289         cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 #include <stdlib.h>
5294 int
5295 main ()
5296 {
5297 putwc(0,0);
5298   ;
5299   return 0;
5300 }
5301 _ACEOF
5302 rm -f conftest.$ac_objext conftest$ac_exeext
5303 if { (eval echo "$as_me:5303: \"$ac_link\"") >&5
5304   (eval $ac_link) 2>&5
5305   ac_status=$?
5306   echo "$as_me:5306: \$? = $ac_status" >&5
5307   (exit $ac_status); } &&
5308          { ac_try='test -s conftest$ac_exeext'
5309   { (eval echo "$as_me:5309: \"$ac_try\"") >&5
5310   (eval $ac_try) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); }; }; then
5314   cf_cv_utf8_lib=yes
5315 else
5316   echo "$as_me: failed program was:" >&5
5317 cat conftest.$ac_ext >&5
5318
5319 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5320 # will be set on completion of the AC_TRY_LINK below.
5321 cf_cv_header_path_utf8=
5322 cf_cv_library_path_utf8=
5323
5324 echo "${as_me:-configure}:5324: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5325
5326 cf_save_LIBS="$LIBS"
5327
5328 cat >conftest.$ac_ext <<_ACEOF
5329 #line 5329 "configure"
5330 #include "confdefs.h"
5331
5332 #include <libutf8.h>
5333 int
5334 main ()
5335 {
5336 putwc(0,0);
5337   ;
5338   return 0;
5339 }
5340 _ACEOF
5341 rm -f conftest.$ac_objext conftest$ac_exeext
5342 if { (eval echo "$as_me:5342: \"$ac_link\"") >&5
5343   (eval $ac_link) 2>&5
5344   ac_status=$?
5345   echo "$as_me:5345: \$? = $ac_status" >&5
5346   (exit $ac_status); } &&
5347          { ac_try='test -s conftest$ac_exeext'
5348   { (eval echo "$as_me:5348: \"$ac_try\"") >&5
5349   (eval $ac_try) 2>&5
5350   ac_status=$?
5351   echo "$as_me:5351: \$? = $ac_status" >&5
5352   (exit $ac_status); }; }; then
5353
5354         cf_cv_find_linkage_utf8=yes
5355         cf_cv_header_path_utf8=/usr/include
5356         cf_cv_library_path_utf8=/usr/lib
5357
5358 else
5359   echo "$as_me: failed program was:" >&5
5360 cat conftest.$ac_ext >&5
5361
5362 LIBS="-lutf8  $cf_save_LIBS"
5363
5364 cat >conftest.$ac_ext <<_ACEOF
5365 #line 5365 "configure"
5366 #include "confdefs.h"
5367
5368 #include <libutf8.h>
5369 int
5370 main ()
5371 {
5372 putwc(0,0);
5373   ;
5374   return 0;
5375 }
5376 _ACEOF
5377 rm -f conftest.$ac_objext conftest$ac_exeext
5378 if { (eval echo "$as_me:5378: \"$ac_link\"") >&5
5379   (eval $ac_link) 2>&5
5380   ac_status=$?
5381   echo "$as_me:5381: \$? = $ac_status" >&5
5382   (exit $ac_status); } &&
5383          { ac_try='test -s conftest$ac_exeext'
5384   { (eval echo "$as_me:5384: \"$ac_try\"") >&5
5385   (eval $ac_try) 2>&5
5386   ac_status=$?
5387   echo "$as_me:5387: \$? = $ac_status" >&5
5388   (exit $ac_status); }; }; then
5389
5390         cf_cv_find_linkage_utf8=yes
5391         cf_cv_header_path_utf8=/usr/include
5392         cf_cv_library_path_utf8=/usr/lib
5393         cf_cv_library_file_utf8="-lutf8"
5394
5395 else
5396   echo "$as_me: failed program was:" >&5
5397 cat conftest.$ac_ext >&5
5398
5399         cf_cv_find_linkage_utf8=no
5400         LIBS="$cf_save_LIBS"
5401
5402         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5403
5404 echo "${as_me:-configure}:5404: testing find linkage for utf8 library ..." 1>&5
5405
5406 echo "${as_me:-configure}:5406: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5407
5408         cf_save_CPPFLAGS="$CPPFLAGS"
5409         cf_test_CPPFLAGS="$CPPFLAGS"
5410
5411 cf_search=
5412
5413 # collect the current set of include-directories from compiler flags
5414 cf_header_path_list=""
5415 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5416         for cf_header_path in $CPPFLAGS $CFLAGS
5417         do
5418                 case $cf_header_path in
5419                 (-I*)
5420                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5421
5422 test "x$cf_header_path" != "xNONE" && \
5423 test -d "$cf_header_path" && \
5424  {
5425         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5426         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5427         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5428         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5429         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5430         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5431 }
5432
5433                         cf_header_path_list="$cf_header_path_list $cf_search"
5434                         ;;
5435                 esac
5436         done
5437 fi
5438
5439 # add the variations for the package we are looking for
5440
5441 cf_search=
5442
5443 test "x$prefix" != "xNONE" && \
5444 test -d "$prefix" && \
5445  {
5446         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5447         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5448         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5449         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5450         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5451         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5452 }
5453
5454 for cf_subdir_prefix in \
5455         /usr \
5456         /usr/local \
5457         /usr/pkg \
5458         /opt \
5459         /opt/local \
5460         $HOME
5461 do
5462
5463 test "x$cf_subdir_prefix" != "x$prefix" && \
5464 test -d "$cf_subdir_prefix" && \
5465 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5466         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5467         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5468         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5469         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5470         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5471         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5472 }
5473
5474 done
5475
5476 test "$includedir" != NONE && \
5477 test "$includedir" != "/usr/include" && \
5478 test -d "$includedir" && {
5479         test -d $includedir &&    cf_search="$cf_search $includedir"
5480         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5481 }
5482
5483 test "$oldincludedir" != NONE && \
5484 test "$oldincludedir" != "/usr/include" && \
5485 test -d "$oldincludedir" && {
5486         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5487         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5488 }
5489
5490 cf_search="$cf_search $cf_header_path_list"
5491
5492         for cf_cv_header_path_utf8 in $cf_search
5493         do
5494                 if test -d $cf_cv_header_path_utf8 ; then
5495                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5496
5497 echo "${as_me:-configure}:5497: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5498
5499                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5500                         cat >conftest.$ac_ext <<_ACEOF
5501 #line 5501 "configure"
5502 #include "confdefs.h"
5503
5504 #include <libutf8.h>
5505 int
5506 main ()
5507 {
5508 putwc(0,0);
5509   ;
5510   return 0;
5511 }
5512 _ACEOF
5513 rm -f conftest.$ac_objext
5514 if { (eval echo "$as_me:5514: \"$ac_compile\"") >&5
5515   (eval $ac_compile) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); } &&
5519          { ac_try='test -s conftest.$ac_objext'
5520   { (eval echo "$as_me:5520: \"$ac_try\"") >&5
5521   (eval $ac_try) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit $ac_status); }; }; then
5525
5526                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5527
5528 echo "${as_me:-configure}:5528: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5529
5530                                 cf_cv_find_linkage_utf8=maybe
5531                                 cf_test_CPPFLAGS="$CPPFLAGS"
5532                                 break
5533 else
5534   echo "$as_me: failed program was:" >&5
5535 cat conftest.$ac_ext >&5
5536
5537                                 CPPFLAGS="$cf_save_CPPFLAGS"
5538
5539 fi
5540 rm -f conftest.$ac_objext conftest.$ac_ext
5541                 fi
5542         done
5543
5544         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5545
5546 echo "${as_me:-configure}:5546: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5547
5548                 cf_save_LIBS="$LIBS"
5549                 cf_save_LDFLAGS="$LDFLAGS"
5550
5551                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5552
5553 cf_search=
5554 cf_library_path_list=""
5555 if test -n "${LDFLAGS}${LIBS}" ; then
5556         for cf_library_path in $LDFLAGS $LIBS
5557         do
5558                 case $cf_library_path in
5559                 (-L*)
5560                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5561
5562 test "x$cf_library_path" != "xNONE" && \
5563 test -d "$cf_library_path" && \
5564  {
5565         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5566         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5567         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5568         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5569         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5570         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5571 }
5572
5573                         cf_library_path_list="$cf_library_path_list $cf_search"
5574                         ;;
5575                 esac
5576         done
5577 fi
5578
5579 cf_search=
5580
5581 test "x$prefix" != "xNONE" && \
5582 test -d "$prefix" && \
5583  {
5584         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5585         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5586         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5587         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5588         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5589         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5590 }
5591
5592 for cf_subdir_prefix in \
5593         /usr \
5594         /usr/local \
5595         /usr/pkg \
5596         /opt \
5597         /opt/local \
5598         $HOME
5599 do
5600
5601 test "x$cf_subdir_prefix" != "x$prefix" && \
5602 test -d "$cf_subdir_prefix" && \
5603 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5604         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5605         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5606         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5607         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5608         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5609         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5610 }
5611
5612 done
5613
5614 cf_search="$cf_library_path_list $cf_search"
5615
5616                         for cf_cv_library_path_utf8 in $cf_search
5617                         do
5618                                 if test -d $cf_cv_library_path_utf8 ; then
5619                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5620
5621 echo "${as_me:-configure}:5621: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5622
5623                                         CPPFLAGS="$cf_test_CPPFLAGS"
5624                                         LIBS="-lutf8  $cf_save_LIBS"
5625                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5626                                         cat >conftest.$ac_ext <<_ACEOF
5627 #line 5627 "configure"
5628 #include "confdefs.h"
5629
5630 #include <libutf8.h>
5631 int
5632 main ()
5633 {
5634 putwc(0,0);
5635   ;
5636   return 0;
5637 }
5638 _ACEOF
5639 rm -f conftest.$ac_objext conftest$ac_exeext
5640 if { (eval echo "$as_me:5640: \"$ac_link\"") >&5
5641   (eval $ac_link) 2>&5
5642   ac_status=$?
5643   echo "$as_me:5643: \$? = $ac_status" >&5
5644   (exit $ac_status); } &&
5645          { ac_try='test -s conftest$ac_exeext'
5646   { (eval echo "$as_me:5646: \"$ac_try\"") >&5
5647   (eval $ac_try) 2>&5
5648   ac_status=$?
5649   echo "$as_me:5649: \$? = $ac_status" >&5
5650   (exit $ac_status); }; }; then
5651
5652                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5653
5654 echo "${as_me:-configure}:5654: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5655
5656                                         cf_cv_find_linkage_utf8=yes
5657                                         cf_cv_library_file_utf8="-lutf8"
5658                                         break
5659 else
5660   echo "$as_me: failed program was:" >&5
5661 cat conftest.$ac_ext >&5
5662
5663                                         CPPFLAGS="$cf_save_CPPFLAGS"
5664                                         LIBS="$cf_save_LIBS"
5665                                         LDFLAGS="$cf_save_LDFLAGS"
5666
5667 fi
5668 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5669                                 fi
5670                         done
5671                         CPPFLAGS="$cf_save_CPPFLAGS"
5672                         LDFLAGS="$cf_save_LDFLAGS"
5673                 fi
5674
5675         else
5676                 cf_cv_find_linkage_utf8=no
5677         fi
5678
5679 fi
5680 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5681
5682 fi
5683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5684
5685 LIBS="$cf_save_LIBS"
5686
5687 if test "$cf_cv_find_linkage_utf8" = yes ; then
5688 cf_cv_utf8_lib=add-on
5689 else
5690 cf_cv_utf8_lib=no
5691 fi
5692
5693 fi
5694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5695 fi
5696 echo "$as_me:5696: result: $cf_cv_utf8_lib" >&5
5697 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5698
5699 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5700 # ncurses/ncursesw:
5701 if test "$cf_cv_utf8_lib" = "add-on" ; then
5702
5703 cat >>confdefs.h <<\EOF
5704 #define HAVE_LIBUTF8_H 1
5705 EOF
5706
5707 if test -n "$cf_cv_header_path_utf8" ; then
5708   for cf_add_incdir in $cf_cv_header_path_utf8
5709   do
5710         while test $cf_add_incdir != /usr/include
5711         do
5712           if test -d $cf_add_incdir
5713           then
5714                 cf_have_incdir=no
5715                 if test -n "$CFLAGS$CPPFLAGS" ; then
5716                   # a loop is needed to ensure we can add subdirs of existing dirs
5717                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5718                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5719                           cf_have_incdir=yes; break
5720                         fi
5721                   done
5722                 fi
5723
5724                 if test "$cf_have_incdir" = no ; then
5725                   if test "$cf_add_incdir" = /usr/local/include ; then
5726                         if test "$GCC" = yes
5727                         then
5728                           cf_save_CPPFLAGS=$CPPFLAGS
5729                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5730                           cat >conftest.$ac_ext <<_ACEOF
5731 #line 5731 "configure"
5732 #include "confdefs.h"
5733 #include <stdio.h>
5734 int
5735 main ()
5736 {
5737 printf("Hello")
5738   ;
5739   return 0;
5740 }
5741 _ACEOF
5742 rm -f conftest.$ac_objext
5743 if { (eval echo "$as_me:5743: \"$ac_compile\"") >&5
5744   (eval $ac_compile) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit $ac_status); } &&
5748          { ac_try='test -s conftest.$ac_objext'
5749   { (eval echo "$as_me:5749: \"$ac_try\"") >&5
5750   (eval $ac_try) 2>&5
5751   ac_status=$?
5752   echo "$as_me:5752: \$? = $ac_status" >&5
5753   (exit $ac_status); }; }; then
5754   :
5755 else
5756   echo "$as_me: failed program was:" >&5
5757 cat conftest.$ac_ext >&5
5758 cf_have_incdir=yes
5759 fi
5760 rm -f conftest.$ac_objext conftest.$ac_ext
5761                           CPPFLAGS=$cf_save_CPPFLAGS
5762                         fi
5763                   fi
5764                 fi
5765
5766                 if test "$cf_have_incdir" = no ; then
5767                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5768
5769 echo "${as_me:-configure}:5769: testing adding $cf_add_incdir to include-path ..." 1>&5
5770
5771                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5772
5773                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5774                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5775                   cf_add_incdir="$cf_top_incdir"
5776                 else
5777                   break
5778                 fi
5779           else
5780                 break
5781           fi
5782         done
5783   done
5784 fi
5785
5786 if test -n "$cf_cv_library_path_utf8" ; then
5787         for cf_add_libdir in $cf_cv_library_path_utf8
5788         do
5789                 if test $cf_add_libdir = /usr/lib ; then
5790                         :
5791                 elif test -d $cf_add_libdir
5792                 then
5793                         cf_have_libdir=no
5794                         if test -n "$LDFLAGS$LIBS" ; then
5795                                 # a loop is needed to ensure we can add subdirs of existing dirs
5796                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5797                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5798                                                 cf_have_libdir=yes; break
5799                                         fi
5800                                 done
5801                         fi
5802                         if test "$cf_have_libdir" = no ; then
5803                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5804
5805 echo "${as_me:-configure}:5805: testing adding $cf_add_libdir to library-path ..." 1>&5
5806
5807                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5808                         fi
5809                 fi
5810         done
5811 fi
5812
5813 cf_add_libs="$cf_cv_library_file_utf8"
5814 # Filter out duplicates - this happens with badly-designed ".pc" files...
5815 for cf_add_1lib in $LIBS
5816 do
5817         for cf_add_2lib in $cf_add_libs
5818         do
5819                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5820                 then
5821                         cf_add_1lib=
5822                         break
5823                 fi
5824         done
5825         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5826 done
5827 LIBS="$cf_add_libs"
5828
5829 fi
5830
5831 cf_ncuconfig_root=ncursesw
5832 cf_have_ncuconfig=no
5833
5834 if test "x${PKG_CONFIG:=none}" != xnone; then
5835         echo "$as_me:5835: checking pkg-config for $cf_ncuconfig_root" >&5
5836 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5837         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5838                 echo "$as_me:5838: result: yes" >&5
5839 echo "${ECHO_T}yes" >&6
5840
5841                 echo "$as_me:5841: checking if the $cf_ncuconfig_root package files work" >&5
5842 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5843                 cf_have_ncuconfig=unknown
5844
5845                 cf_save_CPPFLAGS="$CPPFLAGS"
5846                 cf_save_LIBS="$LIBS"
5847
5848                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5849
5850 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5851 # Filter out duplicates - this happens with badly-designed ".pc" files...
5852 for cf_add_1lib in $LIBS
5853 do
5854         for cf_add_2lib in $cf_add_libs
5855         do
5856                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5857                 then
5858                         cf_add_1lib=
5859                         break
5860                 fi
5861         done
5862         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5863 done
5864 LIBS="$cf_add_libs"
5865
5866                 cat >conftest.$ac_ext <<_ACEOF
5867 #line 5867 "configure"
5868 #include "confdefs.h"
5869 #include <${cf_cv_ncurses_header:-curses.h}>
5870 int
5871 main ()
5872 {
5873 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5874   ;
5875   return 0;
5876 }
5877 _ACEOF
5878 rm -f conftest.$ac_objext conftest$ac_exeext
5879 if { (eval echo "$as_me:5879: \"$ac_link\"") >&5
5880   (eval $ac_link) 2>&5
5881   ac_status=$?
5882   echo "$as_me:5882: \$? = $ac_status" >&5
5883   (exit $ac_status); } &&
5884          { ac_try='test -s conftest$ac_exeext'
5885   { (eval echo "$as_me:5885: \"$ac_try\"") >&5
5886   (eval $ac_try) 2>&5
5887   ac_status=$?
5888   echo "$as_me:5888: \$? = $ac_status" >&5
5889   (exit $ac_status); }; }; then
5890   if test "$cross_compiling" = yes; then
5891   cf_have_ncuconfig=maybe
5892 else
5893   cat >conftest.$ac_ext <<_ACEOF
5894 #line 5894 "configure"
5895 #include "confdefs.h"
5896 #include <${cf_cv_ncurses_header:-curses.h}>
5897                                 int main(void)
5898                                 { char *xx = curses_version(); return (xx == 0); }
5899 _ACEOF
5900 rm -f conftest$ac_exeext
5901 if { (eval echo "$as_me:5901: \"$ac_link\"") >&5
5902   (eval $ac_link) 2>&5
5903   ac_status=$?
5904   echo "$as_me:5904: \$? = $ac_status" >&5
5905   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5906   { (eval echo "$as_me:5906: \"$ac_try\"") >&5
5907   (eval $ac_try) 2>&5
5908   ac_status=$?
5909   echo "$as_me:5909: \$? = $ac_status" >&5
5910   (exit $ac_status); }; }; then
5911   cf_have_ncuconfig=yes
5912 else
5913   echo "$as_me: program exited with status $ac_status" >&5
5914 echo "$as_me: failed program was:" >&5
5915 cat conftest.$ac_ext >&5
5916 cf_have_ncuconfig=no
5917 fi
5918 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5919 fi
5920 else
5921   echo "$as_me: failed program was:" >&5
5922 cat conftest.$ac_ext >&5
5923 cf_have_ncuconfig=no
5924 fi
5925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5926                 echo "$as_me:5926: result: $cf_have_ncuconfig" >&5
5927 echo "${ECHO_T}$cf_have_ncuconfig" >&6
5928                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
5929                 if test "$cf_have_ncuconfig" != "yes"
5930                 then
5931                         CPPFLAGS="$cf_save_CPPFLAGS"
5932                         LIBS="$cf_save_LIBS"
5933                         NCURSES_CONFIG_PKG=none
5934                 else
5935
5936 cat >>confdefs.h <<\EOF
5937 #define NCURSES 1
5938 EOF
5939
5940                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
5941                 fi
5942
5943         else
5944                 echo "$as_me:5944: result: no" >&5
5945 echo "${ECHO_T}no" >&6
5946                 NCURSES_CONFIG_PKG=none
5947         fi
5948 else
5949         NCURSES_CONFIG_PKG=none
5950 fi
5951
5952 if test "x$cf_have_ncuconfig" = "xno"; then
5953         echo "Looking for ${cf_ncuconfig_root}-config"
5954
5955 if test -n "$ac_tool_prefix"; then
5956   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5957   do
5958     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5959 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5960 echo "$as_me:5960: checking for $ac_word" >&5
5961 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5962 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
5963   echo $ECHO_N "(cached) $ECHO_C" >&6
5964 else
5965   if test -n "$NCURSES_CONFIG"; then
5966   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
5967 else
5968   ac_save_IFS=$IFS; IFS=$ac_path_separator
5969 ac_dummy="$PATH"
5970 for ac_dir in $ac_dummy; do
5971   IFS=$ac_save_IFS
5972   test -z "$ac_dir" && ac_dir=.
5973   $as_executable_p "$ac_dir/$ac_word" || continue
5974 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
5975 echo "$as_me:5975: found $ac_dir/$ac_word" >&5
5976 break
5977 done
5978
5979 fi
5980 fi
5981 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
5982 if test -n "$NCURSES_CONFIG"; then
5983   echo "$as_me:5983: result: $NCURSES_CONFIG" >&5
5984 echo "${ECHO_T}$NCURSES_CONFIG" >&6
5985 else
5986   echo "$as_me:5986: result: no" >&5
5987 echo "${ECHO_T}no" >&6
5988 fi
5989
5990     test -n "$NCURSES_CONFIG" && break
5991   done
5992 fi
5993 if test -z "$NCURSES_CONFIG"; then
5994   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
5995   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
5996 do
5997   # Extract the first word of "$ac_prog", so it can be a program name with args.
5998 set dummy $ac_prog; ac_word=$2
5999 echo "$as_me:5999: checking for $ac_word" >&5
6000 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6001 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6002   echo $ECHO_N "(cached) $ECHO_C" >&6
6003 else
6004   if test -n "$ac_ct_NCURSES_CONFIG"; then
6005   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6006 else
6007   ac_save_IFS=$IFS; IFS=$ac_path_separator
6008 ac_dummy="$PATH"
6009 for ac_dir in $ac_dummy; do
6010   IFS=$ac_save_IFS
6011   test -z "$ac_dir" && ac_dir=.
6012   $as_executable_p "$ac_dir/$ac_word" || continue
6013 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6014 echo "$as_me:6014: found $ac_dir/$ac_word" >&5
6015 break
6016 done
6017
6018 fi
6019 fi
6020 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6021 if test -n "$ac_ct_NCURSES_CONFIG"; then
6022   echo "$as_me:6022: result: $ac_ct_NCURSES_CONFIG" >&5
6023 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6024 else
6025   echo "$as_me:6025: result: no" >&5
6026 echo "${ECHO_T}no" >&6
6027 fi
6028
6029   test -n "$ac_ct_NCURSES_CONFIG" && break
6030 done
6031 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6032
6033   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6034 fi
6035
6036         if test "$NCURSES_CONFIG" != none ; then
6037
6038                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6039
6040 cf_add_libs="`$NCURSES_CONFIG --libs`"
6041 # Filter out duplicates - this happens with badly-designed ".pc" files...
6042 for cf_add_1lib in $LIBS
6043 do
6044         for cf_add_2lib in $cf_add_libs
6045         do
6046                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6047                 then
6048                         cf_add_1lib=
6049                         break
6050                 fi
6051         done
6052         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6053 done
6054 LIBS="$cf_add_libs"
6055
6056                 # even with config script, some packages use no-override for curses.h
6057
6058 echo "$as_me:6058: checking if we have identified curses headers" >&5
6059 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6060 if test "${cf_cv_ncurses_header+set}" = set; then
6061   echo $ECHO_N "(cached) $ECHO_C" >&6
6062 else
6063
6064 cf_cv_ncurses_header=none
6065 for cf_header in \
6066         ncurses.h ncursesw/ncurses.h \
6067         curses.h ncursesw/curses.h
6068 do
6069 cat >conftest.$ac_ext <<_ACEOF
6070 #line 6070 "configure"
6071 #include "confdefs.h"
6072 #include <${cf_header}>
6073 int
6074 main ()
6075 {
6076 initscr(); tgoto("?", 0,0)
6077   ;
6078   return 0;
6079 }
6080 _ACEOF
6081 rm -f conftest.$ac_objext
6082 if { (eval echo "$as_me:6082: \"$ac_compile\"") >&5
6083   (eval $ac_compile) 2>&5
6084   ac_status=$?
6085   echo "$as_me:6085: \$? = $ac_status" >&5
6086   (exit $ac_status); } &&
6087          { ac_try='test -s conftest.$ac_objext'
6088   { (eval echo "$as_me:6088: \"$ac_try\"") >&5
6089   (eval $ac_try) 2>&5
6090   ac_status=$?
6091   echo "$as_me:6091: \$? = $ac_status" >&5
6092   (exit $ac_status); }; }; then
6093   cf_cv_ncurses_header=$cf_header; break
6094 else
6095   echo "$as_me: failed program was:" >&5
6096 cat conftest.$ac_ext >&5
6097 fi
6098 rm -f conftest.$ac_objext conftest.$ac_ext
6099 done
6100
6101 fi
6102 echo "$as_me:6102: result: $cf_cv_ncurses_header" >&5
6103 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6104
6105 if test "$cf_cv_ncurses_header" = none ; then
6106         { { echo "$as_me:6106: error: No curses header-files found" >&5
6107 echo "$as_me: error: No curses header-files found" >&2;}
6108    { (exit 1); exit 1; }; }
6109 fi
6110
6111 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6112
6113 for ac_header in $cf_cv_ncurses_header
6114 do
6115 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6116 echo "$as_me:6116: checking for $ac_header" >&5
6117 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6118 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6119   echo $ECHO_N "(cached) $ECHO_C" >&6
6120 else
6121   cat >conftest.$ac_ext <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124 #include <$ac_header>
6125 _ACEOF
6126 if { (eval echo "$as_me:6126: \"$ac_cpp conftest.$ac_ext\"") >&5
6127   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6128   ac_status=$?
6129   egrep -v '^ *\+' conftest.er1 >conftest.err
6130   rm -f conftest.er1
6131   cat conftest.err >&5
6132   echo "$as_me:6132: \$? = $ac_status" >&5
6133   (exit $ac_status); } >/dev/null; then
6134   if test -s conftest.err; then
6135     ac_cpp_err=$ac_c_preproc_warn_flag
6136   else
6137     ac_cpp_err=
6138   fi
6139 else
6140   ac_cpp_err=yes
6141 fi
6142 if test -z "$ac_cpp_err"; then
6143   eval "$as_ac_Header=yes"
6144 else
6145   echo "$as_me: failed program was:" >&5
6146   cat conftest.$ac_ext >&5
6147   eval "$as_ac_Header=no"
6148 fi
6149 rm -f conftest.err conftest.$ac_ext
6150 fi
6151 echo "$as_me:6151: result: `eval echo '${'$as_ac_Header'}'`" >&5
6152 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6153 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6154   cat >>confdefs.h <<EOF
6155 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6156 EOF
6157
6158 fi
6159 done
6160
6161 cat >>confdefs.h <<\EOF
6162 #define NCURSES 1
6163 EOF
6164
6165 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6166
6167                 cat >>confdefs.h <<EOF
6168 #define $cf_nculib_ROOT 1
6169 EOF
6170
6171                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6172
6173         else
6174
6175 cf_ncuhdr_root=ncursesw
6176
6177 test -n "$cf_cv_curses_dir" && \
6178 test "$cf_cv_curses_dir" != "no" && { \
6179
6180 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6181   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6182   do
6183         while test $cf_add_incdir != /usr/include
6184         do
6185           if test -d $cf_add_incdir
6186           then
6187                 cf_have_incdir=no
6188                 if test -n "$CFLAGS$CPPFLAGS" ; then
6189                   # a loop is needed to ensure we can add subdirs of existing dirs
6190                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6191                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6192                           cf_have_incdir=yes; break
6193                         fi
6194                   done
6195                 fi
6196
6197                 if test "$cf_have_incdir" = no ; then
6198                   if test "$cf_add_incdir" = /usr/local/include ; then
6199                         if test "$GCC" = yes
6200                         then
6201                           cf_save_CPPFLAGS=$CPPFLAGS
6202                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6203                           cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206 #include <stdio.h>
6207 int
6208 main ()
6209 {
6210 printf("Hello")
6211   ;
6212   return 0;
6213 }
6214 _ACEOF
6215 rm -f conftest.$ac_objext
6216 if { (eval echo "$as_me:6216: \"$ac_compile\"") >&5
6217   (eval $ac_compile) 2>&5
6218   ac_status=$?
6219   echo "$as_me:6219: \$? = $ac_status" >&5
6220   (exit $ac_status); } &&
6221          { ac_try='test -s conftest.$ac_objext'
6222   { (eval echo "$as_me:6222: \"$ac_try\"") >&5
6223   (eval $ac_try) 2>&5
6224   ac_status=$?
6225   echo "$as_me:6225: \$? = $ac_status" >&5
6226   (exit $ac_status); }; }; then
6227   :
6228 else
6229   echo "$as_me: failed program was:" >&5
6230 cat conftest.$ac_ext >&5
6231 cf_have_incdir=yes
6232 fi
6233 rm -f conftest.$ac_objext conftest.$ac_ext
6234                           CPPFLAGS=$cf_save_CPPFLAGS
6235                         fi
6236                   fi
6237                 fi
6238
6239                 if test "$cf_have_incdir" = no ; then
6240                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6241
6242 echo "${as_me:-configure}:6242: testing adding $cf_add_incdir to include-path ..." 1>&5
6243
6244                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6245
6246                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6247                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6248                   cf_add_incdir="$cf_top_incdir"
6249                 else
6250                   break
6251                 fi
6252           else
6253                 break
6254           fi
6255         done
6256   done
6257 fi
6258
6259 }
6260
6261 echo "$as_me:6261: checking for $cf_ncuhdr_root header in include-path" >&5
6262 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6263 if test "${cf_cv_ncurses_h+set}" = set; then
6264   echo $ECHO_N "(cached) $ECHO_C" >&6
6265 else
6266
6267         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6268         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6269         for cf_header in $cf_header_list
6270         do
6271
6272         cat >conftest.$ac_ext <<_ACEOF
6273 #line 6273 "configure"
6274 #include "confdefs.h"
6275
6276 #define _XOPEN_SOURCE_EXTENDED
6277 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6278 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6279
6280 #include <$cf_header>
6281 int
6282 main ()
6283 {
6284
6285 #ifdef NCURSES_VERSION
6286
6287 #ifndef WACS_BSSB
6288         make an error
6289 #endif
6290
6291 printf("%s\n", NCURSES_VERSION);
6292 #else
6293 #ifdef __NCURSES_H
6294 printf("old\n");
6295 #else
6296         make an error
6297 #endif
6298 #endif
6299
6300   ;
6301   return 0;
6302 }
6303 _ACEOF
6304 rm -f conftest.$ac_objext
6305 if { (eval echo "$as_me:6305: \"$ac_compile\"") >&5
6306   (eval $ac_compile) 2>&5
6307   ac_status=$?
6308   echo "$as_me:6308: \$? = $ac_status" >&5
6309   (exit $ac_status); } &&
6310          { ac_try='test -s conftest.$ac_objext'
6311   { (eval echo "$as_me:6311: \"$ac_try\"") >&5
6312   (eval $ac_try) 2>&5
6313   ac_status=$?
6314   echo "$as_me:6314: \$? = $ac_status" >&5
6315   (exit $ac_status); }; }; then
6316   cf_cv_ncurses_h=$cf_header
6317
6318 else
6319   echo "$as_me: failed program was:" >&5
6320 cat conftest.$ac_ext >&5
6321 cf_cv_ncurses_h=no
6322 fi
6323 rm -f conftest.$ac_objext conftest.$ac_ext
6324
6325                 test "$cf_cv_ncurses_h" != no && break
6326         done
6327
6328 fi
6329 echo "$as_me:6329: result: $cf_cv_ncurses_h" >&5
6330 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6331
6332 if test "$cf_cv_ncurses_h" != no ; then
6333         cf_cv_ncurses_header=$cf_cv_ncurses_h
6334 else
6335
6336 echo "$as_me:6336: checking for $cf_ncuhdr_root include-path" >&5
6337 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6338 if test "${cf_cv_ncurses_h2+set}" = set; then
6339   echo $ECHO_N "(cached) $ECHO_C" >&6
6340 else
6341
6342         test -n "$verbose" && echo
6343
6344 cf_search=
6345
6346 # collect the current set of include-directories from compiler flags
6347 cf_header_path_list=""
6348 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6349         for cf_header_path in $CPPFLAGS $CFLAGS
6350         do
6351                 case $cf_header_path in
6352                 (-I*)
6353                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6354
6355 test "x$cf_header_path" != "xNONE" && \
6356 test -d "$cf_header_path" && \
6357  {
6358         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6359         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6360         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6361         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6362         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6363         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"
6364 }
6365
6366                         cf_header_path_list="$cf_header_path_list $cf_search"
6367                         ;;
6368                 esac
6369         done
6370 fi
6371
6372 # add the variations for the package we are looking for
6373
6374 cf_search=
6375
6376 test "x$prefix" != "xNONE" && \
6377 test -d "$prefix" && \
6378  {
6379         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6380         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6381         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6382         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6383         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6384         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6385 }
6386
6387 for cf_subdir_prefix in \
6388         /usr \
6389         /usr/local \
6390         /usr/pkg \
6391         /opt \
6392         /opt/local \
6393         $HOME
6394 do
6395
6396 test "x$cf_subdir_prefix" != "x$prefix" && \
6397 test -d "$cf_subdir_prefix" && \
6398 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6399         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6400         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6401         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6402         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6403         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6404         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"
6405 }
6406
6407 done
6408
6409 test "$includedir" != NONE && \
6410 test "$includedir" != "/usr/include" && \
6411 test -d "$includedir" && {
6412         test -d $includedir &&    cf_search="$cf_search $includedir"
6413         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6414 }
6415
6416 test "$oldincludedir" != NONE && \
6417 test "$oldincludedir" != "/usr/include" && \
6418 test -d "$oldincludedir" && {
6419         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6420         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6421 }
6422
6423 cf_search="$cf_search $cf_header_path_list"
6424
6425         test -n "$verbose" && echo search path $cf_search
6426         cf_save2_CPPFLAGS="$CPPFLAGS"
6427         for cf_incdir in $cf_search
6428         do
6429
6430 if test -n "$cf_incdir" ; then
6431   for cf_add_incdir in $cf_incdir
6432   do
6433         while test $cf_add_incdir != /usr/include
6434         do
6435           if test -d $cf_add_incdir
6436           then
6437                 cf_have_incdir=no
6438                 if test -n "$CFLAGS$CPPFLAGS" ; then
6439                   # a loop is needed to ensure we can add subdirs of existing dirs
6440                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6441                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6442                           cf_have_incdir=yes; break
6443                         fi
6444                   done
6445                 fi
6446
6447                 if test "$cf_have_incdir" = no ; then
6448                   if test "$cf_add_incdir" = /usr/local/include ; then
6449                         if test "$GCC" = yes
6450                         then
6451                           cf_save_CPPFLAGS=$CPPFLAGS
6452                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6453                           cat >conftest.$ac_ext <<_ACEOF
6454 #line 6454 "configure"
6455 #include "confdefs.h"
6456 #include <stdio.h>
6457 int
6458 main ()
6459 {
6460 printf("Hello")
6461   ;
6462   return 0;
6463 }
6464 _ACEOF
6465 rm -f conftest.$ac_objext
6466 if { (eval echo "$as_me:6466: \"$ac_compile\"") >&5
6467   (eval $ac_compile) 2>&5
6468   ac_status=$?
6469   echo "$as_me:6469: \$? = $ac_status" >&5
6470   (exit $ac_status); } &&
6471          { ac_try='test -s conftest.$ac_objext'
6472   { (eval echo "$as_me:6472: \"$ac_try\"") >&5
6473   (eval $ac_try) 2>&5
6474   ac_status=$?
6475   echo "$as_me:6475: \$? = $ac_status" >&5
6476   (exit $ac_status); }; }; then
6477   :
6478 else
6479   echo "$as_me: failed program was:" >&5
6480 cat conftest.$ac_ext >&5
6481 cf_have_incdir=yes
6482 fi
6483 rm -f conftest.$ac_objext conftest.$ac_ext
6484                           CPPFLAGS=$cf_save_CPPFLAGS
6485                         fi
6486                   fi
6487                 fi
6488
6489                 if test "$cf_have_incdir" = no ; then
6490                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6491
6492 echo "${as_me:-configure}:6492: testing adding $cf_add_incdir to include-path ..." 1>&5
6493
6494                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6495
6496                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6497                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6498                   cf_add_incdir="$cf_top_incdir"
6499                 else
6500                   break
6501                 fi
6502           else
6503                 break
6504           fi
6505         done
6506   done
6507 fi
6508
6509                 for cf_header in \
6510                         ncurses.h \
6511                         curses.h
6512                 do
6513
6514         cat >conftest.$ac_ext <<_ACEOF
6515 #line 6515 "configure"
6516 #include "confdefs.h"
6517
6518 #include <$cf_header>
6519 int
6520 main ()
6521 {
6522
6523 #ifdef NCURSES_VERSION
6524
6525 printf("%s\n", NCURSES_VERSION);
6526 #else
6527 #ifdef __NCURSES_H
6528 printf("old\n");
6529 #else
6530         make an error
6531 #endif
6532 #endif
6533
6534   ;
6535   return 0;
6536 }
6537 _ACEOF
6538 rm -f conftest.$ac_objext
6539 if { (eval echo "$as_me:6539: \"$ac_compile\"") >&5
6540   (eval $ac_compile) 2>&5
6541   ac_status=$?
6542   echo "$as_me:6542: \$? = $ac_status" >&5
6543   (exit $ac_status); } &&
6544          { ac_try='test -s conftest.$ac_objext'
6545   { (eval echo "$as_me:6545: \"$ac_try\"") >&5
6546   (eval $ac_try) 2>&5
6547   ac_status=$?
6548   echo "$as_me:6548: \$? = $ac_status" >&5
6549   (exit $ac_status); }; }; then
6550   cf_cv_ncurses_h2=$cf_header
6551
6552 else
6553   echo "$as_me: failed program was:" >&5
6554 cat conftest.$ac_ext >&5
6555 cf_cv_ncurses_h2=no
6556 fi
6557 rm -f conftest.$ac_objext conftest.$ac_ext
6558
6559                         if test "$cf_cv_ncurses_h2" != no ; then
6560                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6561                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6562                                 break
6563                         fi
6564                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6565                 done
6566                 CPPFLAGS="$cf_save2_CPPFLAGS"
6567                 test "$cf_cv_ncurses_h2" != no && break
6568         done
6569         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6569: error: not found" >&5
6570 echo "$as_me: error: not found" >&2;}
6571    { (exit 1); exit 1; }; }
6572
6573 fi
6574 echo "$as_me:6574: result: $cf_cv_ncurses_h2" >&5
6575 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6576
6577         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6578         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6579         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6580                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6581         fi
6582
6583 if test -n "$cf_1st_incdir" ; then
6584   for cf_add_incdir in $cf_1st_incdir
6585   do
6586         while test $cf_add_incdir != /usr/include
6587         do
6588           if test -d $cf_add_incdir
6589           then
6590                 cf_have_incdir=no
6591                 if test -n "$CFLAGS$CPPFLAGS" ; then
6592                   # a loop is needed to ensure we can add subdirs of existing dirs
6593                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6594                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6595                           cf_have_incdir=yes; break
6596                         fi
6597                   done
6598                 fi
6599
6600                 if test "$cf_have_incdir" = no ; then
6601                   if test "$cf_add_incdir" = /usr/local/include ; then
6602                         if test "$GCC" = yes
6603                         then
6604                           cf_save_CPPFLAGS=$CPPFLAGS
6605                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6606                           cat >conftest.$ac_ext <<_ACEOF
6607 #line 6607 "configure"
6608 #include "confdefs.h"
6609 #include <stdio.h>
6610 int
6611 main ()
6612 {
6613 printf("Hello")
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   :
6631 else
6632   echo "$as_me: failed program was:" >&5
6633 cat conftest.$ac_ext >&5
6634 cf_have_incdir=yes
6635 fi
6636 rm -f conftest.$ac_objext conftest.$ac_ext
6637                           CPPFLAGS=$cf_save_CPPFLAGS
6638                         fi
6639                   fi
6640                 fi
6641
6642                 if test "$cf_have_incdir" = no ; then
6643                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6644
6645 echo "${as_me:-configure}:6645: testing adding $cf_add_incdir to include-path ..." 1>&5
6646
6647                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6648
6649                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6650                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6651                   cf_add_incdir="$cf_top_incdir"
6652                 else
6653                   break
6654                 fi
6655           else
6656                 break
6657           fi
6658         done
6659   done
6660 fi
6661
6662 fi
6663
6664 # Set definitions to allow ifdef'ing for ncurses.h
6665
6666 case $cf_cv_ncurses_header in
6667 (*ncurses.h)
6668
6669 cat >>confdefs.h <<\EOF
6670 #define HAVE_NCURSES_H 1
6671 EOF
6672
6673         ;;
6674 esac
6675
6676 case $cf_cv_ncurses_header in
6677 (ncurses/curses.h|ncurses/ncurses.h)
6678
6679 cat >>confdefs.h <<\EOF
6680 #define HAVE_NCURSES_NCURSES_H 1
6681 EOF
6682
6683         ;;
6684 (ncursesw/curses.h|ncursesw/ncurses.h)
6685
6686 cat >>confdefs.h <<\EOF
6687 #define HAVE_NCURSESW_NCURSES_H 1
6688 EOF
6689
6690         ;;
6691 esac
6692
6693 echo "$as_me:6693: checking for terminfo header" >&5
6694 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6695 if test "${cf_cv_term_header+set}" = set; then
6696   echo $ECHO_N "(cached) $ECHO_C" >&6
6697 else
6698
6699 case ${cf_cv_ncurses_header} in
6700 (*/ncurses.h|*/ncursesw.h)
6701         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6702         ;;
6703 (*)
6704         cf_term_header=term.h
6705         ;;
6706 esac
6707
6708 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6709 do
6710 cat >conftest.$ac_ext <<_ACEOF
6711 #line 6711 "configure"
6712 #include "confdefs.h"
6713 #include <stdio.h>
6714 #include <${cf_cv_ncurses_header:-curses.h}>
6715 #include <$cf_test>
6716
6717 int
6718 main ()
6719 {
6720 int x = auto_left_margin
6721   ;
6722   return 0;
6723 }
6724 _ACEOF
6725 rm -f conftest.$ac_objext
6726 if { (eval echo "$as_me:6726: \"$ac_compile\"") >&5
6727   (eval $ac_compile) 2>&5
6728   ac_status=$?
6729   echo "$as_me:6729: \$? = $ac_status" >&5
6730   (exit $ac_status); } &&
6731          { ac_try='test -s conftest.$ac_objext'
6732   { (eval echo "$as_me:6732: \"$ac_try\"") >&5
6733   (eval $ac_try) 2>&5
6734   ac_status=$?
6735   echo "$as_me:6735: \$? = $ac_status" >&5
6736   (exit $ac_status); }; }; then
6737
6738         cf_cv_term_header="$cf_test"
6739 else
6740   echo "$as_me: failed program was:" >&5
6741 cat conftest.$ac_ext >&5
6742
6743         cf_cv_term_header=unknown
6744
6745 fi
6746 rm -f conftest.$ac_objext conftest.$ac_ext
6747         test "$cf_cv_term_header" != unknown && break
6748 done
6749
6750 fi
6751 echo "$as_me:6751: result: $cf_cv_term_header" >&5
6752 echo "${ECHO_T}$cf_cv_term_header" >&6
6753
6754 # Set definitions to allow ifdef'ing to accommodate subdirectories
6755
6756 case $cf_cv_term_header in
6757 (*term.h)
6758
6759 cat >>confdefs.h <<\EOF
6760 #define HAVE_TERM_H 1
6761 EOF
6762
6763         ;;
6764 esac
6765
6766 case $cf_cv_term_header in
6767 (ncurses/term.h)
6768
6769 cat >>confdefs.h <<\EOF
6770 #define HAVE_NCURSES_TERM_H 1
6771 EOF
6772
6773         ;;
6774 (ncursesw/term.h)
6775
6776 cat >>confdefs.h <<\EOF
6777 #define HAVE_NCURSESW_TERM_H 1
6778 EOF
6779
6780         ;;
6781 esac
6782
6783 # some applications need this, but should check for NCURSES_VERSION
6784
6785 cat >>confdefs.h <<\EOF
6786 #define NCURSES 1
6787 EOF
6788
6789 echo "$as_me:6789: checking for ncurses version" >&5
6790 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6791 if test "${cf_cv_ncurses_version+set}" = set; then
6792   echo $ECHO_N "(cached) $ECHO_C" >&6
6793 else
6794
6795         cf_cv_ncurses_version=no
6796         cf_tempfile=out$$
6797         rm -f $cf_tempfile
6798         if test "$cross_compiling" = yes; then
6799
6800         # This will not work if the preprocessor splits the line after the
6801         # Autoconf token.  The 'unproto' program does that.
6802         cat > conftest.$ac_ext <<EOF
6803 #include <${cf_cv_ncurses_header:-curses.h}>
6804 #undef Autoconf
6805 #ifdef NCURSES_VERSION
6806 Autoconf NCURSES_VERSION
6807 #else
6808 #ifdef __NCURSES_H
6809 Autoconf "old"
6810 #endif
6811 ;
6812 #endif
6813 EOF
6814         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6815         { (eval echo "$as_me:6815: \"$cf_try\"") >&5
6816   (eval $cf_try) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit $ac_status); }
6820         if test -f conftest.out ; then
6821                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6822                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6823                 rm -f conftest.out
6824         fi
6825
6826 else
6827   cat >conftest.$ac_ext <<_ACEOF
6828 #line 6828 "configure"
6829 #include "confdefs.h"
6830
6831 #include <${cf_cv_ncurses_header:-curses.h}>
6832 #include <stdio.h>
6833 int main()
6834 {
6835         FILE *fp = fopen("$cf_tempfile", "w");
6836 #ifdef NCURSES_VERSION
6837 # ifdef NCURSES_VERSION_PATCH
6838         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6839 # else
6840         fprintf(fp, "%s\n", NCURSES_VERSION);
6841 # endif
6842 #else
6843 # ifdef __NCURSES_H
6844         fprintf(fp, "old\n");
6845 # else
6846         make an error
6847 # endif
6848 #endif
6849         ${cf_cv_main_return:-return}(0);
6850 }
6851 _ACEOF
6852 rm -f conftest$ac_exeext
6853 if { (eval echo "$as_me:6853: \"$ac_link\"") >&5
6854   (eval $ac_link) 2>&5
6855   ac_status=$?
6856   echo "$as_me:6856: \$? = $ac_status" >&5
6857   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6858   { (eval echo "$as_me:6858: \"$ac_try\"") >&5
6859   (eval $ac_try) 2>&5
6860   ac_status=$?
6861   echo "$as_me:6861: \$? = $ac_status" >&5
6862   (exit $ac_status); }; }; then
6863
6864         cf_cv_ncurses_version=`cat $cf_tempfile`
6865 else
6866   echo "$as_me: program exited with status $ac_status" >&5
6867 echo "$as_me: failed program was:" >&5
6868 cat conftest.$ac_ext >&5
6869 fi
6870 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6871 fi
6872         rm -f $cf_tempfile
6873
6874 fi
6875 echo "$as_me:6875: result: $cf_cv_ncurses_version" >&5
6876 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6877 test "$cf_cv_ncurses_version" = no ||
6878 cat >>confdefs.h <<\EOF
6879 #define NCURSES 1
6880 EOF
6881
6882 cf_nculib_root=ncursesw
6883         # This works, except for the special case where we find gpm, but
6884         # ncurses is in a nonstandard location via $LIBS, and we really want
6885         # to link gpm.
6886 cf_ncurses_LIBS=""
6887 cf_ncurses_SAVE="$LIBS"
6888 echo "$as_me:6888: checking for Gpm_Open in -lgpm" >&5
6889 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
6890 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
6891   echo $ECHO_N "(cached) $ECHO_C" >&6
6892 else
6893   ac_check_lib_save_LIBS=$LIBS
6894 LIBS="-lgpm  $LIBS"
6895 cat >conftest.$ac_ext <<_ACEOF
6896 #line 6896 "configure"
6897 #include "confdefs.h"
6898
6899 /* Override any gcc2 internal prototype to avoid an error.  */
6900 #ifdef __cplusplus
6901 extern "C"
6902 #endif
6903 /* We use char because int might match the return type of a gcc2
6904    builtin and then its argument prototype would still apply.  */
6905 char Gpm_Open ();
6906 int
6907 main ()
6908 {
6909 Gpm_Open ();
6910   ;
6911   return 0;
6912 }
6913 _ACEOF
6914 rm -f conftest.$ac_objext conftest$ac_exeext
6915 if { (eval echo "$as_me:6915: \"$ac_link\"") >&5
6916   (eval $ac_link) 2>&5
6917   ac_status=$?
6918   echo "$as_me:6918: \$? = $ac_status" >&5
6919   (exit $ac_status); } &&
6920          { ac_try='test -s conftest$ac_exeext'
6921   { (eval echo "$as_me:6921: \"$ac_try\"") >&5
6922   (eval $ac_try) 2>&5
6923   ac_status=$?
6924   echo "$as_me:6924: \$? = $ac_status" >&5
6925   (exit $ac_status); }; }; then
6926   ac_cv_lib_gpm_Gpm_Open=yes
6927 else
6928   echo "$as_me: failed program was:" >&5
6929 cat conftest.$ac_ext >&5
6930 ac_cv_lib_gpm_Gpm_Open=no
6931 fi
6932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6933 LIBS=$ac_check_lib_save_LIBS
6934 fi
6935 echo "$as_me:6935: result: $ac_cv_lib_gpm_Gpm_Open" >&5
6936 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
6937 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
6938   echo "$as_me:6938: checking for initscr in -lgpm" >&5
6939 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
6940 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
6941   echo $ECHO_N "(cached) $ECHO_C" >&6
6942 else
6943   ac_check_lib_save_LIBS=$LIBS
6944 LIBS="-lgpm  $LIBS"
6945 cat >conftest.$ac_ext <<_ACEOF
6946 #line 6946 "configure"
6947 #include "confdefs.h"
6948
6949 /* Override any gcc2 internal prototype to avoid an error.  */
6950 #ifdef __cplusplus
6951 extern "C"
6952 #endif
6953 /* We use char because int might match the return type of a gcc2
6954    builtin and then its argument prototype would still apply.  */
6955 char initscr ();
6956 int
6957 main ()
6958 {
6959 initscr ();
6960   ;
6961   return 0;
6962 }
6963 _ACEOF
6964 rm -f conftest.$ac_objext conftest$ac_exeext
6965 if { (eval echo "$as_me:6965: \"$ac_link\"") >&5
6966   (eval $ac_link) 2>&5
6967   ac_status=$?
6968   echo "$as_me:6968: \$? = $ac_status" >&5
6969   (exit $ac_status); } &&
6970          { ac_try='test -s conftest$ac_exeext'
6971   { (eval echo "$as_me:6971: \"$ac_try\"") >&5
6972   (eval $ac_try) 2>&5
6973   ac_status=$?
6974   echo "$as_me:6974: \$? = $ac_status" >&5
6975   (exit $ac_status); }; }; then
6976   ac_cv_lib_gpm_initscr=yes
6977 else
6978   echo "$as_me: failed program was:" >&5
6979 cat conftest.$ac_ext >&5
6980 ac_cv_lib_gpm_initscr=no
6981 fi
6982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6983 LIBS=$ac_check_lib_save_LIBS
6984 fi
6985 echo "$as_me:6985: result: $ac_cv_lib_gpm_initscr" >&5
6986 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
6987 if test $ac_cv_lib_gpm_initscr = yes; then
6988   LIBS="$cf_ncurses_SAVE"
6989 else
6990   cf_ncurses_LIBS="-lgpm"
6991 fi
6992
6993 fi
6994
6995 case $host_os in
6996 (freebsd*)
6997         # This is only necessary if you are linking against an obsolete
6998         # version of ncurses (but it should do no harm, since it's static).
6999         if test "$cf_nculib_root" = ncurses ; then
7000                 echo "$as_me:7000: checking for tgoto in -lmytinfo" >&5
7001 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7002 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7003   echo $ECHO_N "(cached) $ECHO_C" >&6
7004 else
7005   ac_check_lib_save_LIBS=$LIBS
7006 LIBS="-lmytinfo  $LIBS"
7007 cat >conftest.$ac_ext <<_ACEOF
7008 #line 7008 "configure"
7009 #include "confdefs.h"
7010
7011 /* Override any gcc2 internal prototype to avoid an error.  */
7012 #ifdef __cplusplus
7013 extern "C"
7014 #endif
7015 /* We use char because int might match the return type of a gcc2
7016    builtin and then its argument prototype would still apply.  */
7017 char tgoto ();
7018 int
7019 main ()
7020 {
7021 tgoto ();
7022   ;
7023   return 0;
7024 }
7025 _ACEOF
7026 rm -f conftest.$ac_objext conftest$ac_exeext
7027 if { (eval echo "$as_me:7027: \"$ac_link\"") >&5
7028   (eval $ac_link) 2>&5
7029   ac_status=$?
7030   echo "$as_me:7030: \$? = $ac_status" >&5
7031   (exit $ac_status); } &&
7032          { ac_try='test -s conftest$ac_exeext'
7033   { (eval echo "$as_me:7033: \"$ac_try\"") >&5
7034   (eval $ac_try) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); }; }; then
7038   ac_cv_lib_mytinfo_tgoto=yes
7039 else
7040   echo "$as_me: failed program was:" >&5
7041 cat conftest.$ac_ext >&5
7042 ac_cv_lib_mytinfo_tgoto=no
7043 fi
7044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7045 LIBS=$ac_check_lib_save_LIBS
7046 fi
7047 echo "$as_me:7047: result: $ac_cv_lib_mytinfo_tgoto" >&5
7048 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7049 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7050   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7051 fi
7052
7053         fi
7054         ;;
7055 esac
7056
7057 cf_add_libs="$cf_ncurses_LIBS"
7058 # Filter out duplicates - this happens with badly-designed ".pc" files...
7059 for cf_add_1lib in $LIBS
7060 do
7061         for cf_add_2lib in $cf_add_libs
7062         do
7063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7064                 then
7065                         cf_add_1lib=
7066                         break
7067                 fi
7068         done
7069         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7070 done
7071 LIBS="$cf_add_libs"
7072
7073 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7074 then
7075
7076 cf_add_libs="-l$cf_nculib_root"
7077 # Filter out duplicates - this happens with badly-designed ".pc" files...
7078 for cf_add_1lib in $LIBS
7079 do
7080         for cf_add_2lib in $cf_add_libs
7081         do
7082                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7083                 then
7084                         cf_add_1lib=
7085                         break
7086                 fi
7087         done
7088         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7089 done
7090 LIBS="$cf_add_libs"
7091
7092 else
7093
7094         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7095         cf_libdir=""
7096         echo "$as_me:7096: checking for initscr" >&5
7097 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7098 if test "${ac_cv_func_initscr+set}" = set; then
7099   echo $ECHO_N "(cached) $ECHO_C" >&6
7100 else
7101   cat >conftest.$ac_ext <<_ACEOF
7102 #line 7102 "configure"
7103 #include "confdefs.h"
7104 /* System header to define __stub macros and hopefully few prototypes,
7105     which can conflict with char initscr (); below.  */
7106 #include <assert.h>
7107 /* Override any gcc2 internal prototype to avoid an error.  */
7108 #ifdef __cplusplus
7109 extern "C"
7110 #endif
7111 /* We use char because int might match the return type of a gcc2
7112    builtin and then its argument prototype would still apply.  */
7113 char initscr ();
7114 char (*f) ();
7115
7116 int
7117 main ()
7118 {
7119 /* The GNU C library defines this for functions which it implements
7120     to always fail with ENOSYS.  Some functions are actually named
7121     something starting with __ and the normal name is an alias.  */
7122 #if defined (__stub_initscr) || defined (__stub___initscr)
7123 choke me
7124 #else
7125 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7126 #endif
7127
7128   ;
7129   return 0;
7130 }
7131 _ACEOF
7132 rm -f conftest.$ac_objext conftest$ac_exeext
7133 if { (eval echo "$as_me:7133: \"$ac_link\"") >&5
7134   (eval $ac_link) 2>&5
7135   ac_status=$?
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); } &&
7138          { ac_try='test -s conftest$ac_exeext'
7139   { (eval echo "$as_me:7139: \"$ac_try\"") >&5
7140   (eval $ac_try) 2>&5
7141   ac_status=$?
7142   echo "$as_me:7142: \$? = $ac_status" >&5
7143   (exit $ac_status); }; }; then
7144   ac_cv_func_initscr=yes
7145 else
7146   echo "$as_me: failed program was:" >&5
7147 cat conftest.$ac_ext >&5
7148 ac_cv_func_initscr=no
7149 fi
7150 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7151 fi
7152 echo "$as_me:7152: result: $ac_cv_func_initscr" >&5
7153 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7154 if test $ac_cv_func_initscr = yes; then
7155   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7156 else
7157
7158                 cf_save_LIBS="$LIBS"
7159                 echo "$as_me:7159: checking for initscr in -l$cf_nculib_root" >&5
7160 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7161                 LIBS="-l$cf_nculib_root $LIBS"
7162                 cat >conftest.$ac_ext <<_ACEOF
7163 #line 7163 "configure"
7164 #include "confdefs.h"
7165 #include <${cf_cv_ncurses_header:-curses.h}>
7166 int
7167 main ()
7168 {
7169 initscr()
7170   ;
7171   return 0;
7172 }
7173 _ACEOF
7174 rm -f conftest.$ac_objext conftest$ac_exeext
7175 if { (eval echo "$as_me:7175: \"$ac_link\"") >&5
7176   (eval $ac_link) 2>&5
7177   ac_status=$?
7178   echo "$as_me:7178: \$? = $ac_status" >&5
7179   (exit $ac_status); } &&
7180          { ac_try='test -s conftest$ac_exeext'
7181   { (eval echo "$as_me:7181: \"$ac_try\"") >&5
7182   (eval $ac_try) 2>&5
7183   ac_status=$?
7184   echo "$as_me:7184: \$? = $ac_status" >&5
7185   (exit $ac_status); }; }; then
7186   echo "$as_me:7186: result: yes" >&5
7187 echo "${ECHO_T}yes" >&6
7188                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7189
7190 else
7191   echo "$as_me: failed program was:" >&5
7192 cat conftest.$ac_ext >&5
7193 echo "$as_me:7193: result: no" >&5
7194 echo "${ECHO_T}no" >&6
7195
7196 cf_search=
7197 cf_library_path_list=""
7198 if test -n "${LDFLAGS}${LIBS}" ; then
7199         for cf_library_path in $LDFLAGS $LIBS
7200         do
7201                 case $cf_library_path in
7202                 (-L*)
7203                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7204
7205 test "x$cf_library_path" != "xNONE" && \
7206 test -d "$cf_library_path" && \
7207  {
7208         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7209         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7210         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7211         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7212         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7213         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"
7214 }
7215
7216                         cf_library_path_list="$cf_library_path_list $cf_search"
7217                         ;;
7218                 esac
7219         done
7220 fi
7221
7222 cf_search=
7223
7224 test "x$prefix" != "xNONE" && \
7225 test -d "$prefix" && \
7226  {
7227         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7228         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7229         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7230         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7231         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7232         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7233 }
7234
7235 for cf_subdir_prefix in \
7236         /usr \
7237         /usr/local \
7238         /usr/pkg \
7239         /opt \
7240         /opt/local \
7241         $HOME
7242 do
7243
7244 test "x$cf_subdir_prefix" != "x$prefix" && \
7245 test -d "$cf_subdir_prefix" && \
7246 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7247         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7248         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7249         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7250         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7251         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7252         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"
7253 }
7254
7255 done
7256
7257 cf_search="$cf_library_path_list $cf_search"
7258
7259                         for cf_libdir in $cf_search
7260                         do
7261                                 echo "$as_me:7261: checking for -l$cf_nculib_root in $cf_libdir" >&5
7262 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7263                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7264                                 cat >conftest.$ac_ext <<_ACEOF
7265 #line 7265 "configure"
7266 #include "confdefs.h"
7267 #include <${cf_cv_ncurses_header:-curses.h}>
7268 int
7269 main ()
7270 {
7271 initscr()
7272   ;
7273   return 0;
7274 }
7275 _ACEOF
7276 rm -f conftest.$ac_objext conftest$ac_exeext
7277 if { (eval echo "$as_me:7277: \"$ac_link\"") >&5
7278   (eval $ac_link) 2>&5
7279   ac_status=$?
7280   echo "$as_me:7280: \$? = $ac_status" >&5
7281   (exit $ac_status); } &&
7282          { ac_try='test -s conftest$ac_exeext'
7283   { (eval echo "$as_me:7283: \"$ac_try\"") >&5
7284   (eval $ac_try) 2>&5
7285   ac_status=$?
7286   echo "$as_me:7286: \$? = $ac_status" >&5
7287   (exit $ac_status); }; }; then
7288   echo "$as_me:7288: result: yes" >&5
7289 echo "${ECHO_T}yes" >&6
7290                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7291                                          break
7292 else
7293   echo "$as_me: failed program was:" >&5
7294 cat conftest.$ac_ext >&5
7295 echo "$as_me:7295: result: no" >&5
7296 echo "${ECHO_T}no" >&6
7297                                          LIBS="$cf_save_LIBS"
7298 fi
7299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7300                         done
7301
7302 fi
7303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7304
7305 fi
7306
7307 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7308
7309 if test $cf_found_library = no ; then
7310         { { echo "$as_me:7310: error: Cannot link $cf_nculib_root library" >&5
7311 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7312    { (exit 1); exit 1; }; }
7313 fi
7314
7315 fi
7316
7317 if test -n "$cf_ncurses_LIBS" ; then
7318         echo "$as_me:7318: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7319 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7320         cf_ncurses_SAVE="$LIBS"
7321         for p in $cf_ncurses_LIBS ; do
7322                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7323                 if test "$q" != "$LIBS" ; then
7324                         LIBS="$q"
7325                 fi
7326         done
7327         cat >conftest.$ac_ext <<_ACEOF
7328 #line 7328 "configure"
7329 #include "confdefs.h"
7330 #include <${cf_cv_ncurses_header:-curses.h}>
7331 int
7332 main ()
7333 {
7334 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7335   ;
7336   return 0;
7337 }
7338 _ACEOF
7339 rm -f conftest.$ac_objext conftest$ac_exeext
7340 if { (eval echo "$as_me:7340: \"$ac_link\"") >&5
7341   (eval $ac_link) 2>&5
7342   ac_status=$?
7343   echo "$as_me:7343: \$? = $ac_status" >&5
7344   (exit $ac_status); } &&
7345          { ac_try='test -s conftest$ac_exeext'
7346   { (eval echo "$as_me:7346: \"$ac_try\"") >&5
7347   (eval $ac_try) 2>&5
7348   ac_status=$?
7349   echo "$as_me:7349: \$? = $ac_status" >&5
7350   (exit $ac_status); }; }; then
7351   echo "$as_me:7351: result: yes" >&5
7352 echo "${ECHO_T}yes" >&6
7353 else
7354   echo "$as_me: failed program was:" >&5
7355 cat conftest.$ac_ext >&5
7356 echo "$as_me:7356: result: no" >&5
7357 echo "${ECHO_T}no" >&6
7358                  LIBS="$cf_ncurses_SAVE"
7359 fi
7360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7361 fi
7362
7363 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7364
7365 cat >>confdefs.h <<EOF
7366 #define $cf_nculib_ROOT 1
7367 EOF
7368
7369         fi
7370 else
7371         NCURSES_CONFIG=none
7372 fi
7373
7374 else
7375
7376 cf_ncuconfig_root=ncurses
7377 cf_have_ncuconfig=no
7378
7379 if test "x${PKG_CONFIG:=none}" != xnone; then
7380         echo "$as_me:7380: checking pkg-config for $cf_ncuconfig_root" >&5
7381 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7382         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7383                 echo "$as_me:7383: result: yes" >&5
7384 echo "${ECHO_T}yes" >&6
7385
7386                 echo "$as_me:7386: checking if the $cf_ncuconfig_root package files work" >&5
7387 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7388                 cf_have_ncuconfig=unknown
7389
7390                 cf_save_CPPFLAGS="$CPPFLAGS"
7391                 cf_save_LIBS="$LIBS"
7392
7393                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7394
7395 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7396 # Filter out duplicates - this happens with badly-designed ".pc" files...
7397 for cf_add_1lib in $LIBS
7398 do
7399         for cf_add_2lib in $cf_add_libs
7400         do
7401                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7402                 then
7403                         cf_add_1lib=
7404                         break
7405                 fi
7406         done
7407         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7408 done
7409 LIBS="$cf_add_libs"
7410
7411                 cat >conftest.$ac_ext <<_ACEOF
7412 #line 7412 "configure"
7413 #include "confdefs.h"
7414 #include <${cf_cv_ncurses_header:-curses.h}>
7415 int
7416 main ()
7417 {
7418 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7419   ;
7420   return 0;
7421 }
7422 _ACEOF
7423 rm -f conftest.$ac_objext conftest$ac_exeext
7424 if { (eval echo "$as_me:7424: \"$ac_link\"") >&5
7425   (eval $ac_link) 2>&5
7426   ac_status=$?
7427   echo "$as_me:7427: \$? = $ac_status" >&5
7428   (exit $ac_status); } &&
7429          { ac_try='test -s conftest$ac_exeext'
7430   { (eval echo "$as_me:7430: \"$ac_try\"") >&5
7431   (eval $ac_try) 2>&5
7432   ac_status=$?
7433   echo "$as_me:7433: \$? = $ac_status" >&5
7434   (exit $ac_status); }; }; then
7435   if test "$cross_compiling" = yes; then
7436   cf_have_ncuconfig=maybe
7437 else
7438   cat >conftest.$ac_ext <<_ACEOF
7439 #line 7439 "configure"
7440 #include "confdefs.h"
7441 #include <${cf_cv_ncurses_header:-curses.h}>
7442                                 int main(void)
7443                                 { char *xx = curses_version(); return (xx == 0); }
7444 _ACEOF
7445 rm -f conftest$ac_exeext
7446 if { (eval echo "$as_me:7446: \"$ac_link\"") >&5
7447   (eval $ac_link) 2>&5
7448   ac_status=$?
7449   echo "$as_me:7449: \$? = $ac_status" >&5
7450   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7451   { (eval echo "$as_me:7451: \"$ac_try\"") >&5
7452   (eval $ac_try) 2>&5
7453   ac_status=$?
7454   echo "$as_me:7454: \$? = $ac_status" >&5
7455   (exit $ac_status); }; }; then
7456   cf_have_ncuconfig=yes
7457 else
7458   echo "$as_me: program exited with status $ac_status" >&5
7459 echo "$as_me: failed program was:" >&5
7460 cat conftest.$ac_ext >&5
7461 cf_have_ncuconfig=no
7462 fi
7463 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7464 fi
7465 else
7466   echo "$as_me: failed program was:" >&5
7467 cat conftest.$ac_ext >&5
7468 cf_have_ncuconfig=no
7469 fi
7470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7471                 echo "$as_me:7471: result: $cf_have_ncuconfig" >&5
7472 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7473                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7474                 if test "$cf_have_ncuconfig" != "yes"
7475                 then
7476                         CPPFLAGS="$cf_save_CPPFLAGS"
7477                         LIBS="$cf_save_LIBS"
7478                         NCURSES_CONFIG_PKG=none
7479                 else
7480
7481 cat >>confdefs.h <<\EOF
7482 #define NCURSES 1
7483 EOF
7484
7485                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7486                 fi
7487
7488         else
7489                 echo "$as_me:7489: result: no" >&5
7490 echo "${ECHO_T}no" >&6
7491                 NCURSES_CONFIG_PKG=none
7492         fi
7493 else
7494         NCURSES_CONFIG_PKG=none
7495 fi
7496
7497 if test "x$cf_have_ncuconfig" = "xno"; then
7498         echo "Looking for ${cf_ncuconfig_root}-config"
7499
7500 if test -n "$ac_tool_prefix"; then
7501   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7502   do
7503     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7504 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7505 echo "$as_me:7505: checking for $ac_word" >&5
7506 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7507 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7508   echo $ECHO_N "(cached) $ECHO_C" >&6
7509 else
7510   if test -n "$NCURSES_CONFIG"; then
7511   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7512 else
7513   ac_save_IFS=$IFS; IFS=$ac_path_separator
7514 ac_dummy="$PATH"
7515 for ac_dir in $ac_dummy; do
7516   IFS=$ac_save_IFS
7517   test -z "$ac_dir" && ac_dir=.
7518   $as_executable_p "$ac_dir/$ac_word" || continue
7519 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7520 echo "$as_me:7520: found $ac_dir/$ac_word" >&5
7521 break
7522 done
7523
7524 fi
7525 fi
7526 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7527 if test -n "$NCURSES_CONFIG"; then
7528   echo "$as_me:7528: result: $NCURSES_CONFIG" >&5
7529 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7530 else
7531   echo "$as_me:7531: result: no" >&5
7532 echo "${ECHO_T}no" >&6
7533 fi
7534
7535     test -n "$NCURSES_CONFIG" && break
7536   done
7537 fi
7538 if test -z "$NCURSES_CONFIG"; then
7539   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7540   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7541 do
7542   # Extract the first word of "$ac_prog", so it can be a program name with args.
7543 set dummy $ac_prog; ac_word=$2
7544 echo "$as_me:7544: checking for $ac_word" >&5
7545 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7546 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7547   echo $ECHO_N "(cached) $ECHO_C" >&6
7548 else
7549   if test -n "$ac_ct_NCURSES_CONFIG"; then
7550   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7551 else
7552   ac_save_IFS=$IFS; IFS=$ac_path_separator
7553 ac_dummy="$PATH"
7554 for ac_dir in $ac_dummy; do
7555   IFS=$ac_save_IFS
7556   test -z "$ac_dir" && ac_dir=.
7557   $as_executable_p "$ac_dir/$ac_word" || continue
7558 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7559 echo "$as_me:7559: found $ac_dir/$ac_word" >&5
7560 break
7561 done
7562
7563 fi
7564 fi
7565 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7566 if test -n "$ac_ct_NCURSES_CONFIG"; then
7567   echo "$as_me:7567: result: $ac_ct_NCURSES_CONFIG" >&5
7568 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7569 else
7570   echo "$as_me:7570: result: no" >&5
7571 echo "${ECHO_T}no" >&6
7572 fi
7573
7574   test -n "$ac_ct_NCURSES_CONFIG" && break
7575 done
7576 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7577
7578   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7579 fi
7580
7581         if test "$NCURSES_CONFIG" != none ; then
7582
7583                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7584
7585 cf_add_libs="`$NCURSES_CONFIG --libs`"
7586 # Filter out duplicates - this happens with badly-designed ".pc" files...
7587 for cf_add_1lib in $LIBS
7588 do
7589         for cf_add_2lib in $cf_add_libs
7590         do
7591                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7592                 then
7593                         cf_add_1lib=
7594                         break
7595                 fi
7596         done
7597         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7598 done
7599 LIBS="$cf_add_libs"
7600
7601                 # even with config script, some packages use no-override for curses.h
7602
7603 echo "$as_me:7603: checking if we have identified curses headers" >&5
7604 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7605 if test "${cf_cv_ncurses_header+set}" = set; then
7606   echo $ECHO_N "(cached) $ECHO_C" >&6
7607 else
7608
7609 cf_cv_ncurses_header=none
7610 for cf_header in \
7611         ncurses.h ncurses/ncurses.h \
7612         curses.h ncurses/curses.h
7613 do
7614 cat >conftest.$ac_ext <<_ACEOF
7615 #line 7615 "configure"
7616 #include "confdefs.h"
7617 #include <${cf_header}>
7618 int
7619 main ()
7620 {
7621 initscr(); tgoto("?", 0,0)
7622   ;
7623   return 0;
7624 }
7625 _ACEOF
7626 rm -f conftest.$ac_objext
7627 if { (eval echo "$as_me:7627: \"$ac_compile\"") >&5
7628   (eval $ac_compile) 2>&5
7629   ac_status=$?
7630   echo "$as_me:7630: \$? = $ac_status" >&5
7631   (exit $ac_status); } &&
7632          { ac_try='test -s conftest.$ac_objext'
7633   { (eval echo "$as_me:7633: \"$ac_try\"") >&5
7634   (eval $ac_try) 2>&5
7635   ac_status=$?
7636   echo "$as_me:7636: \$? = $ac_status" >&5
7637   (exit $ac_status); }; }; then
7638   cf_cv_ncurses_header=$cf_header; break
7639 else
7640   echo "$as_me: failed program was:" >&5
7641 cat conftest.$ac_ext >&5
7642 fi
7643 rm -f conftest.$ac_objext conftest.$ac_ext
7644 done
7645
7646 fi
7647 echo "$as_me:7647: result: $cf_cv_ncurses_header" >&5
7648 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7649
7650 if test "$cf_cv_ncurses_header" = none ; then
7651         { { echo "$as_me:7651: error: No curses header-files found" >&5
7652 echo "$as_me: error: No curses header-files found" >&2;}
7653    { (exit 1); exit 1; }; }
7654 fi
7655
7656 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7657
7658 for ac_header in $cf_cv_ncurses_header
7659 do
7660 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7661 echo "$as_me:7661: checking for $ac_header" >&5
7662 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7663 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7664   echo $ECHO_N "(cached) $ECHO_C" >&6
7665 else
7666   cat >conftest.$ac_ext <<_ACEOF
7667 #line 7667 "configure"
7668 #include "confdefs.h"
7669 #include <$ac_header>
7670 _ACEOF
7671 if { (eval echo "$as_me:7671: \"$ac_cpp conftest.$ac_ext\"") >&5
7672   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7673   ac_status=$?
7674   egrep -v '^ *\+' conftest.er1 >conftest.err
7675   rm -f conftest.er1
7676   cat conftest.err >&5
7677   echo "$as_me:7677: \$? = $ac_status" >&5
7678   (exit $ac_status); } >/dev/null; then
7679   if test -s conftest.err; then
7680     ac_cpp_err=$ac_c_preproc_warn_flag
7681   else
7682     ac_cpp_err=
7683   fi
7684 else
7685   ac_cpp_err=yes
7686 fi
7687 if test -z "$ac_cpp_err"; then
7688   eval "$as_ac_Header=yes"
7689 else
7690   echo "$as_me: failed program was:" >&5
7691   cat conftest.$ac_ext >&5
7692   eval "$as_ac_Header=no"
7693 fi
7694 rm -f conftest.err conftest.$ac_ext
7695 fi
7696 echo "$as_me:7696: result: `eval echo '${'$as_ac_Header'}'`" >&5
7697 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7698 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7699   cat >>confdefs.h <<EOF
7700 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7701 EOF
7702
7703 fi
7704 done
7705
7706 cat >>confdefs.h <<\EOF
7707 #define NCURSES 1
7708 EOF
7709
7710 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7711
7712                 cat >>confdefs.h <<EOF
7713 #define $cf_nculib_ROOT 1
7714 EOF
7715
7716                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7717
7718         else
7719
7720 cf_ncuhdr_root=ncurses
7721
7722 test -n "$cf_cv_curses_dir" && \
7723 test "$cf_cv_curses_dir" != "no" && { \
7724
7725 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7726   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7727   do
7728         while test $cf_add_incdir != /usr/include
7729         do
7730           if test -d $cf_add_incdir
7731           then
7732                 cf_have_incdir=no
7733                 if test -n "$CFLAGS$CPPFLAGS" ; then
7734                   # a loop is needed to ensure we can add subdirs of existing dirs
7735                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7736                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7737                           cf_have_incdir=yes; break
7738                         fi
7739                   done
7740                 fi
7741
7742                 if test "$cf_have_incdir" = no ; then
7743                   if test "$cf_add_incdir" = /usr/local/include ; then
7744                         if test "$GCC" = yes
7745                         then
7746                           cf_save_CPPFLAGS=$CPPFLAGS
7747                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7748                           cat >conftest.$ac_ext <<_ACEOF
7749 #line 7749 "configure"
7750 #include "confdefs.h"
7751 #include <stdio.h>
7752 int
7753 main ()
7754 {
7755 printf("Hello")
7756   ;
7757   return 0;
7758 }
7759 _ACEOF
7760 rm -f conftest.$ac_objext
7761 if { (eval echo "$as_me:7761: \"$ac_compile\"") >&5
7762   (eval $ac_compile) 2>&5
7763   ac_status=$?
7764   echo "$as_me:7764: \$? = $ac_status" >&5
7765   (exit $ac_status); } &&
7766          { ac_try='test -s conftest.$ac_objext'
7767   { (eval echo "$as_me:7767: \"$ac_try\"") >&5
7768   (eval $ac_try) 2>&5
7769   ac_status=$?
7770   echo "$as_me:7770: \$? = $ac_status" >&5
7771   (exit $ac_status); }; }; then
7772   :
7773 else
7774   echo "$as_me: failed program was:" >&5
7775 cat conftest.$ac_ext >&5
7776 cf_have_incdir=yes
7777 fi
7778 rm -f conftest.$ac_objext conftest.$ac_ext
7779                           CPPFLAGS=$cf_save_CPPFLAGS
7780                         fi
7781                   fi
7782                 fi
7783
7784                 if test "$cf_have_incdir" = no ; then
7785                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7786
7787 echo "${as_me:-configure}:7787: testing adding $cf_add_incdir to include-path ..." 1>&5
7788
7789                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7790
7791                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7792                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7793                   cf_add_incdir="$cf_top_incdir"
7794                 else
7795                   break
7796                 fi
7797           else
7798                 break
7799           fi
7800         done
7801   done
7802 fi
7803
7804 }
7805
7806 echo "$as_me:7806: checking for $cf_ncuhdr_root header in include-path" >&5
7807 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7808 if test "${cf_cv_ncurses_h+set}" = set; then
7809   echo $ECHO_N "(cached) $ECHO_C" >&6
7810 else
7811
7812         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7813         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7814         for cf_header in $cf_header_list
7815         do
7816
7817         cat >conftest.$ac_ext <<_ACEOF
7818 #line 7818 "configure"
7819 #include "confdefs.h"
7820
7821 #include <$cf_header>
7822 int
7823 main ()
7824 {
7825
7826 #ifdef NCURSES_VERSION
7827
7828 printf("%s\n", NCURSES_VERSION);
7829 #else
7830 #ifdef __NCURSES_H
7831 printf("old\n");
7832 #else
7833         make an error
7834 #endif
7835 #endif
7836
7837   ;
7838   return 0;
7839 }
7840 _ACEOF
7841 rm -f conftest.$ac_objext
7842 if { (eval echo "$as_me:7842: \"$ac_compile\"") >&5
7843   (eval $ac_compile) 2>&5
7844   ac_status=$?
7845   echo "$as_me:7845: \$? = $ac_status" >&5
7846   (exit $ac_status); } &&
7847          { ac_try='test -s conftest.$ac_objext'
7848   { (eval echo "$as_me:7848: \"$ac_try\"") >&5
7849   (eval $ac_try) 2>&5
7850   ac_status=$?
7851   echo "$as_me:7851: \$? = $ac_status" >&5
7852   (exit $ac_status); }; }; then
7853   cf_cv_ncurses_h=$cf_header
7854
7855 else
7856   echo "$as_me: failed program was:" >&5
7857 cat conftest.$ac_ext >&5
7858 cf_cv_ncurses_h=no
7859 fi
7860 rm -f conftest.$ac_objext conftest.$ac_ext
7861
7862                 test "$cf_cv_ncurses_h" != no && break
7863         done
7864
7865 fi
7866 echo "$as_me:7866: result: $cf_cv_ncurses_h" >&5
7867 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7868
7869 if test "$cf_cv_ncurses_h" != no ; then
7870         cf_cv_ncurses_header=$cf_cv_ncurses_h
7871 else
7872
7873 echo "$as_me:7873: checking for $cf_ncuhdr_root include-path" >&5
7874 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7875 if test "${cf_cv_ncurses_h2+set}" = set; then
7876   echo $ECHO_N "(cached) $ECHO_C" >&6
7877 else
7878
7879         test -n "$verbose" && echo
7880
7881 cf_search=
7882
7883 # collect the current set of include-directories from compiler flags
7884 cf_header_path_list=""
7885 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7886         for cf_header_path in $CPPFLAGS $CFLAGS
7887         do
7888                 case $cf_header_path in
7889                 (-I*)
7890                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7891
7892 test "x$cf_header_path" != "xNONE" && \
7893 test -d "$cf_header_path" && \
7894  {
7895         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7896         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7897         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7898         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7899         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7900         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"
7901 }
7902
7903                         cf_header_path_list="$cf_header_path_list $cf_search"
7904                         ;;
7905                 esac
7906         done
7907 fi
7908
7909 # add the variations for the package we are looking for
7910
7911 cf_search=
7912
7913 test "x$prefix" != "xNONE" && \
7914 test -d "$prefix" && \
7915  {
7916         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7917         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7918         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7919         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7920         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7921         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7922 }
7923
7924 for cf_subdir_prefix in \
7925         /usr \
7926         /usr/local \
7927         /usr/pkg \
7928         /opt \
7929         /opt/local \
7930         $HOME
7931 do
7932
7933 test "x$cf_subdir_prefix" != "x$prefix" && \
7934 test -d "$cf_subdir_prefix" && \
7935 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7936         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7937         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7938         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7939         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7940         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7941         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"
7942 }
7943
7944 done
7945
7946 test "$includedir" != NONE && \
7947 test "$includedir" != "/usr/include" && \
7948 test -d "$includedir" && {
7949         test -d $includedir &&    cf_search="$cf_search $includedir"
7950         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7951 }
7952
7953 test "$oldincludedir" != NONE && \
7954 test "$oldincludedir" != "/usr/include" && \
7955 test -d "$oldincludedir" && {
7956         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7957         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7958 }
7959
7960 cf_search="$cf_search $cf_header_path_list"
7961
7962         test -n "$verbose" && echo search path $cf_search
7963         cf_save2_CPPFLAGS="$CPPFLAGS"
7964         for cf_incdir in $cf_search
7965         do
7966
7967 if test -n "$cf_incdir" ; then
7968   for cf_add_incdir in $cf_incdir
7969   do
7970         while test $cf_add_incdir != /usr/include
7971         do
7972           if test -d $cf_add_incdir
7973           then
7974                 cf_have_incdir=no
7975                 if test -n "$CFLAGS$CPPFLAGS" ; then
7976                   # a loop is needed to ensure we can add subdirs of existing dirs
7977                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7978                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7979                           cf_have_incdir=yes; break
7980                         fi
7981                   done
7982                 fi
7983
7984                 if test "$cf_have_incdir" = no ; then
7985                   if test "$cf_add_incdir" = /usr/local/include ; then
7986                         if test "$GCC" = yes
7987                         then
7988                           cf_save_CPPFLAGS=$CPPFLAGS
7989                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7990                           cat >conftest.$ac_ext <<_ACEOF
7991 #line 7991 "configure"
7992 #include "confdefs.h"
7993 #include <stdio.h>
7994 int
7995 main ()
7996 {
7997 printf("Hello")
7998   ;
7999   return 0;
8000 }
8001 _ACEOF
8002 rm -f conftest.$ac_objext
8003 if { (eval echo "$as_me:8003: \"$ac_compile\"") >&5
8004   (eval $ac_compile) 2>&5
8005   ac_status=$?
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit $ac_status); } &&
8008          { ac_try='test -s conftest.$ac_objext'
8009   { (eval echo "$as_me:8009: \"$ac_try\"") >&5
8010   (eval $ac_try) 2>&5
8011   ac_status=$?
8012   echo "$as_me:8012: \$? = $ac_status" >&5
8013   (exit $ac_status); }; }; then
8014   :
8015 else
8016   echo "$as_me: failed program was:" >&5
8017 cat conftest.$ac_ext >&5
8018 cf_have_incdir=yes
8019 fi
8020 rm -f conftest.$ac_objext conftest.$ac_ext
8021                           CPPFLAGS=$cf_save_CPPFLAGS
8022                         fi
8023                   fi
8024                 fi
8025
8026                 if test "$cf_have_incdir" = no ; then
8027                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8028
8029 echo "${as_me:-configure}:8029: testing adding $cf_add_incdir to include-path ..." 1>&5
8030
8031                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8032
8033                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8034                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8035                   cf_add_incdir="$cf_top_incdir"
8036                 else
8037                   break
8038                 fi
8039           else
8040                 break
8041           fi
8042         done
8043   done
8044 fi
8045
8046                 for cf_header in \
8047                         ncurses.h \
8048                         curses.h
8049                 do
8050
8051         cat >conftest.$ac_ext <<_ACEOF
8052 #line 8052 "configure"
8053 #include "confdefs.h"
8054
8055 #include <$cf_header>
8056 int
8057 main ()
8058 {
8059
8060 #ifdef NCURSES_VERSION
8061
8062 printf("%s\n", NCURSES_VERSION);
8063 #else
8064 #ifdef __NCURSES_H
8065 printf("old\n");
8066 #else
8067         make an error
8068 #endif
8069 #endif
8070
8071   ;
8072   return 0;
8073 }
8074 _ACEOF
8075 rm -f conftest.$ac_objext
8076 if { (eval echo "$as_me:8076: \"$ac_compile\"") >&5
8077   (eval $ac_compile) 2>&5
8078   ac_status=$?
8079   echo "$as_me:8079: \$? = $ac_status" >&5
8080   (exit $ac_status); } &&
8081          { ac_try='test -s conftest.$ac_objext'
8082   { (eval echo "$as_me:8082: \"$ac_try\"") >&5
8083   (eval $ac_try) 2>&5
8084   ac_status=$?
8085   echo "$as_me:8085: \$? = $ac_status" >&5
8086   (exit $ac_status); }; }; then
8087   cf_cv_ncurses_h2=$cf_header
8088
8089 else
8090   echo "$as_me: failed program was:" >&5
8091 cat conftest.$ac_ext >&5
8092 cf_cv_ncurses_h2=no
8093 fi
8094 rm -f conftest.$ac_objext conftest.$ac_ext
8095
8096                         if test "$cf_cv_ncurses_h2" != no ; then
8097                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8098                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8099                                 break
8100                         fi
8101                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8102                 done
8103                 CPPFLAGS="$cf_save2_CPPFLAGS"
8104                 test "$cf_cv_ncurses_h2" != no && break
8105         done
8106         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8106: error: not found" >&5
8107 echo "$as_me: error: not found" >&2;}
8108    { (exit 1); exit 1; }; }
8109
8110 fi
8111 echo "$as_me:8111: result: $cf_cv_ncurses_h2" >&5
8112 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8113
8114         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8115         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8116         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8117                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8118         fi
8119
8120 if test -n "$cf_1st_incdir" ; then
8121   for cf_add_incdir in $cf_1st_incdir
8122   do
8123         while test $cf_add_incdir != /usr/include
8124         do
8125           if test -d $cf_add_incdir
8126           then
8127                 cf_have_incdir=no
8128                 if test -n "$CFLAGS$CPPFLAGS" ; then
8129                   # a loop is needed to ensure we can add subdirs of existing dirs
8130                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8131                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8132                           cf_have_incdir=yes; break
8133                         fi
8134                   done
8135                 fi
8136
8137                 if test "$cf_have_incdir" = no ; then
8138                   if test "$cf_add_incdir" = /usr/local/include ; then
8139                         if test "$GCC" = yes
8140                         then
8141                           cf_save_CPPFLAGS=$CPPFLAGS
8142                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8143                           cat >conftest.$ac_ext <<_ACEOF
8144 #line 8144 "configure"
8145 #include "confdefs.h"
8146 #include <stdio.h>
8147 int
8148 main ()
8149 {
8150 printf("Hello")
8151   ;
8152   return 0;
8153 }
8154 _ACEOF
8155 rm -f conftest.$ac_objext
8156 if { (eval echo "$as_me:8156: \"$ac_compile\"") >&5
8157   (eval $ac_compile) 2>&5
8158   ac_status=$?
8159   echo "$as_me:8159: \$? = $ac_status" >&5
8160   (exit $ac_status); } &&
8161          { ac_try='test -s conftest.$ac_objext'
8162   { (eval echo "$as_me:8162: \"$ac_try\"") >&5
8163   (eval $ac_try) 2>&5
8164   ac_status=$?
8165   echo "$as_me:8165: \$? = $ac_status" >&5
8166   (exit $ac_status); }; }; then
8167   :
8168 else
8169   echo "$as_me: failed program was:" >&5
8170 cat conftest.$ac_ext >&5
8171 cf_have_incdir=yes
8172 fi
8173 rm -f conftest.$ac_objext conftest.$ac_ext
8174                           CPPFLAGS=$cf_save_CPPFLAGS
8175                         fi
8176                   fi
8177                 fi
8178
8179                 if test "$cf_have_incdir" = no ; then
8180                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8181
8182 echo "${as_me:-configure}:8182: testing adding $cf_add_incdir to include-path ..." 1>&5
8183
8184                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8185
8186                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8187                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8188                   cf_add_incdir="$cf_top_incdir"
8189                 else
8190                   break
8191                 fi
8192           else
8193                 break
8194           fi
8195         done
8196   done
8197 fi
8198
8199 fi
8200
8201 # Set definitions to allow ifdef'ing for ncurses.h
8202
8203 case $cf_cv_ncurses_header in
8204 (*ncurses.h)
8205
8206 cat >>confdefs.h <<\EOF
8207 #define HAVE_NCURSES_H 1
8208 EOF
8209
8210         ;;
8211 esac
8212
8213 case $cf_cv_ncurses_header in
8214 (ncurses/curses.h|ncurses/ncurses.h)
8215
8216 cat >>confdefs.h <<\EOF
8217 #define HAVE_NCURSES_NCURSES_H 1
8218 EOF
8219
8220         ;;
8221 (ncursesw/curses.h|ncursesw/ncurses.h)
8222
8223 cat >>confdefs.h <<\EOF
8224 #define HAVE_NCURSESW_NCURSES_H 1
8225 EOF
8226
8227         ;;
8228 esac
8229
8230 echo "$as_me:8230: checking for terminfo header" >&5
8231 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8232 if test "${cf_cv_term_header+set}" = set; then
8233   echo $ECHO_N "(cached) $ECHO_C" >&6
8234 else
8235
8236 case ${cf_cv_ncurses_header} in
8237 (*/ncurses.h|*/ncursesw.h)
8238         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8239         ;;
8240 (*)
8241         cf_term_header=term.h
8242         ;;
8243 esac
8244
8245 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8246 do
8247 cat >conftest.$ac_ext <<_ACEOF
8248 #line 8248 "configure"
8249 #include "confdefs.h"
8250 #include <stdio.h>
8251 #include <${cf_cv_ncurses_header:-curses.h}>
8252 #include <$cf_test>
8253
8254 int
8255 main ()
8256 {
8257 int x = auto_left_margin
8258   ;
8259   return 0;
8260 }
8261 _ACEOF
8262 rm -f conftest.$ac_objext
8263 if { (eval echo "$as_me:8263: \"$ac_compile\"") >&5
8264   (eval $ac_compile) 2>&5
8265   ac_status=$?
8266   echo "$as_me:8266: \$? = $ac_status" >&5
8267   (exit $ac_status); } &&
8268          { ac_try='test -s conftest.$ac_objext'
8269   { (eval echo "$as_me:8269: \"$ac_try\"") >&5
8270   (eval $ac_try) 2>&5
8271   ac_status=$?
8272   echo "$as_me:8272: \$? = $ac_status" >&5
8273   (exit $ac_status); }; }; then
8274
8275         cf_cv_term_header="$cf_test"
8276 else
8277   echo "$as_me: failed program was:" >&5
8278 cat conftest.$ac_ext >&5
8279
8280         cf_cv_term_header=unknown
8281
8282 fi
8283 rm -f conftest.$ac_objext conftest.$ac_ext
8284         test "$cf_cv_term_header" != unknown && break
8285 done
8286
8287 fi
8288 echo "$as_me:8288: result: $cf_cv_term_header" >&5
8289 echo "${ECHO_T}$cf_cv_term_header" >&6
8290
8291 # Set definitions to allow ifdef'ing to accommodate subdirectories
8292
8293 case $cf_cv_term_header in
8294 (*term.h)
8295
8296 cat >>confdefs.h <<\EOF
8297 #define HAVE_TERM_H 1
8298 EOF
8299
8300         ;;
8301 esac
8302
8303 case $cf_cv_term_header in
8304 (ncurses/term.h)
8305
8306 cat >>confdefs.h <<\EOF
8307 #define HAVE_NCURSES_TERM_H 1
8308 EOF
8309
8310         ;;
8311 (ncursesw/term.h)
8312
8313 cat >>confdefs.h <<\EOF
8314 #define HAVE_NCURSESW_TERM_H 1
8315 EOF
8316
8317         ;;
8318 esac
8319
8320 # some applications need this, but should check for NCURSES_VERSION
8321
8322 cat >>confdefs.h <<\EOF
8323 #define NCURSES 1
8324 EOF
8325
8326 echo "$as_me:8326: checking for ncurses version" >&5
8327 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8328 if test "${cf_cv_ncurses_version+set}" = set; then
8329   echo $ECHO_N "(cached) $ECHO_C" >&6
8330 else
8331
8332         cf_cv_ncurses_version=no
8333         cf_tempfile=out$$
8334         rm -f $cf_tempfile
8335         if test "$cross_compiling" = yes; then
8336
8337         # This will not work if the preprocessor splits the line after the
8338         # Autoconf token.  The 'unproto' program does that.
8339         cat > conftest.$ac_ext <<EOF
8340 #include <${cf_cv_ncurses_header:-curses.h}>
8341 #undef Autoconf
8342 #ifdef NCURSES_VERSION
8343 Autoconf NCURSES_VERSION
8344 #else
8345 #ifdef __NCURSES_H
8346 Autoconf "old"
8347 #endif
8348 ;
8349 #endif
8350 EOF
8351         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8352         { (eval echo "$as_me:8352: \"$cf_try\"") >&5
8353   (eval $cf_try) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit $ac_status); }
8357         if test -f conftest.out ; then
8358                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8359                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8360                 rm -f conftest.out
8361         fi
8362
8363 else
8364   cat >conftest.$ac_ext <<_ACEOF
8365 #line 8365 "configure"
8366 #include "confdefs.h"
8367
8368 #include <${cf_cv_ncurses_header:-curses.h}>
8369 #include <stdio.h>
8370 int main()
8371 {
8372         FILE *fp = fopen("$cf_tempfile", "w");
8373 #ifdef NCURSES_VERSION
8374 # ifdef NCURSES_VERSION_PATCH
8375         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8376 # else
8377         fprintf(fp, "%s\n", NCURSES_VERSION);
8378 # endif
8379 #else
8380 # ifdef __NCURSES_H
8381         fprintf(fp, "old\n");
8382 # else
8383         make an error
8384 # endif
8385 #endif
8386         ${cf_cv_main_return:-return}(0);
8387 }
8388 _ACEOF
8389 rm -f conftest$ac_exeext
8390 if { (eval echo "$as_me:8390: \"$ac_link\"") >&5
8391   (eval $ac_link) 2>&5
8392   ac_status=$?
8393   echo "$as_me:8393: \$? = $ac_status" >&5
8394   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8395   { (eval echo "$as_me:8395: \"$ac_try\"") >&5
8396   (eval $ac_try) 2>&5
8397   ac_status=$?
8398   echo "$as_me:8398: \$? = $ac_status" >&5
8399   (exit $ac_status); }; }; then
8400
8401         cf_cv_ncurses_version=`cat $cf_tempfile`
8402 else
8403   echo "$as_me: program exited with status $ac_status" >&5
8404 echo "$as_me: failed program was:" >&5
8405 cat conftest.$ac_ext >&5
8406 fi
8407 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8408 fi
8409         rm -f $cf_tempfile
8410
8411 fi
8412 echo "$as_me:8412: result: $cf_cv_ncurses_version" >&5
8413 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8414 test "$cf_cv_ncurses_version" = no ||
8415 cat >>confdefs.h <<\EOF
8416 #define NCURSES 1
8417 EOF
8418
8419 cf_nculib_root=ncurses
8420         # This works, except for the special case where we find gpm, but
8421         # ncurses is in a nonstandard location via $LIBS, and we really want
8422         # to link gpm.
8423 cf_ncurses_LIBS=""
8424 cf_ncurses_SAVE="$LIBS"
8425 echo "$as_me:8425: checking for Gpm_Open in -lgpm" >&5
8426 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8427 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8428   echo $ECHO_N "(cached) $ECHO_C" >&6
8429 else
8430   ac_check_lib_save_LIBS=$LIBS
8431 LIBS="-lgpm  $LIBS"
8432 cat >conftest.$ac_ext <<_ACEOF
8433 #line 8433 "configure"
8434 #include "confdefs.h"
8435
8436 /* Override any gcc2 internal prototype to avoid an error.  */
8437 #ifdef __cplusplus
8438 extern "C"
8439 #endif
8440 /* We use char because int might match the return type of a gcc2
8441    builtin and then its argument prototype would still apply.  */
8442 char Gpm_Open ();
8443 int
8444 main ()
8445 {
8446 Gpm_Open ();
8447   ;
8448   return 0;
8449 }
8450 _ACEOF
8451 rm -f conftest.$ac_objext conftest$ac_exeext
8452 if { (eval echo "$as_me:8452: \"$ac_link\"") >&5
8453   (eval $ac_link) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit $ac_status); } &&
8457          { ac_try='test -s conftest$ac_exeext'
8458   { (eval echo "$as_me:8458: \"$ac_try\"") >&5
8459   (eval $ac_try) 2>&5
8460   ac_status=$?
8461   echo "$as_me:8461: \$? = $ac_status" >&5
8462   (exit $ac_status); }; }; then
8463   ac_cv_lib_gpm_Gpm_Open=yes
8464 else
8465   echo "$as_me: failed program was:" >&5
8466 cat conftest.$ac_ext >&5
8467 ac_cv_lib_gpm_Gpm_Open=no
8468 fi
8469 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8470 LIBS=$ac_check_lib_save_LIBS
8471 fi
8472 echo "$as_me:8472: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8473 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8474 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8475   echo "$as_me:8475: checking for initscr in -lgpm" >&5
8476 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8477 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8478   echo $ECHO_N "(cached) $ECHO_C" >&6
8479 else
8480   ac_check_lib_save_LIBS=$LIBS
8481 LIBS="-lgpm  $LIBS"
8482 cat >conftest.$ac_ext <<_ACEOF
8483 #line 8483 "configure"
8484 #include "confdefs.h"
8485
8486 /* Override any gcc2 internal prototype to avoid an error.  */
8487 #ifdef __cplusplus
8488 extern "C"
8489 #endif
8490 /* We use char because int might match the return type of a gcc2
8491    builtin and then its argument prototype would still apply.  */
8492 char initscr ();
8493 int
8494 main ()
8495 {
8496 initscr ();
8497   ;
8498   return 0;
8499 }
8500 _ACEOF
8501 rm -f conftest.$ac_objext conftest$ac_exeext
8502 if { (eval echo "$as_me:8502: \"$ac_link\"") >&5
8503   (eval $ac_link) 2>&5
8504   ac_status=$?
8505   echo "$as_me:8505: \$? = $ac_status" >&5
8506   (exit $ac_status); } &&
8507          { ac_try='test -s conftest$ac_exeext'
8508   { (eval echo "$as_me:8508: \"$ac_try\"") >&5
8509   (eval $ac_try) 2>&5
8510   ac_status=$?
8511   echo "$as_me:8511: \$? = $ac_status" >&5
8512   (exit $ac_status); }; }; then
8513   ac_cv_lib_gpm_initscr=yes
8514 else
8515   echo "$as_me: failed program was:" >&5
8516 cat conftest.$ac_ext >&5
8517 ac_cv_lib_gpm_initscr=no
8518 fi
8519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8520 LIBS=$ac_check_lib_save_LIBS
8521 fi
8522 echo "$as_me:8522: result: $ac_cv_lib_gpm_initscr" >&5
8523 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8524 if test $ac_cv_lib_gpm_initscr = yes; then
8525   LIBS="$cf_ncurses_SAVE"
8526 else
8527   cf_ncurses_LIBS="-lgpm"
8528 fi
8529
8530 fi
8531
8532 case $host_os in
8533 (freebsd*)
8534         # This is only necessary if you are linking against an obsolete
8535         # version of ncurses (but it should do no harm, since it's static).
8536         if test "$cf_nculib_root" = ncurses ; then
8537                 echo "$as_me:8537: checking for tgoto in -lmytinfo" >&5
8538 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8539 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8540   echo $ECHO_N "(cached) $ECHO_C" >&6
8541 else
8542   ac_check_lib_save_LIBS=$LIBS
8543 LIBS="-lmytinfo  $LIBS"
8544 cat >conftest.$ac_ext <<_ACEOF
8545 #line 8545 "configure"
8546 #include "confdefs.h"
8547
8548 /* Override any gcc2 internal prototype to avoid an error.  */
8549 #ifdef __cplusplus
8550 extern "C"
8551 #endif
8552 /* We use char because int might match the return type of a gcc2
8553    builtin and then its argument prototype would still apply.  */
8554 char tgoto ();
8555 int
8556 main ()
8557 {
8558 tgoto ();
8559   ;
8560   return 0;
8561 }
8562 _ACEOF
8563 rm -f conftest.$ac_objext conftest$ac_exeext
8564 if { (eval echo "$as_me:8564: \"$ac_link\"") >&5
8565   (eval $ac_link) 2>&5
8566   ac_status=$?
8567   echo "$as_me:8567: \$? = $ac_status" >&5
8568   (exit $ac_status); } &&
8569          { ac_try='test -s conftest$ac_exeext'
8570   { (eval echo "$as_me:8570: \"$ac_try\"") >&5
8571   (eval $ac_try) 2>&5
8572   ac_status=$?
8573   echo "$as_me:8573: \$? = $ac_status" >&5
8574   (exit $ac_status); }; }; then
8575   ac_cv_lib_mytinfo_tgoto=yes
8576 else
8577   echo "$as_me: failed program was:" >&5
8578 cat conftest.$ac_ext >&5
8579 ac_cv_lib_mytinfo_tgoto=no
8580 fi
8581 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8582 LIBS=$ac_check_lib_save_LIBS
8583 fi
8584 echo "$as_me:8584: result: $ac_cv_lib_mytinfo_tgoto" >&5
8585 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8586 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8587   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8588 fi
8589
8590         fi
8591         ;;
8592 esac
8593
8594 cf_add_libs="$cf_ncurses_LIBS"
8595 # Filter out duplicates - this happens with badly-designed ".pc" files...
8596 for cf_add_1lib in $LIBS
8597 do
8598         for cf_add_2lib in $cf_add_libs
8599         do
8600                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8601                 then
8602                         cf_add_1lib=
8603                         break
8604                 fi
8605         done
8606         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8607 done
8608 LIBS="$cf_add_libs"
8609
8610 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8611 then
8612
8613 cf_add_libs="-l$cf_nculib_root"
8614 # Filter out duplicates - this happens with badly-designed ".pc" files...
8615 for cf_add_1lib in $LIBS
8616 do
8617         for cf_add_2lib in $cf_add_libs
8618         do
8619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8620                 then
8621                         cf_add_1lib=
8622                         break
8623                 fi
8624         done
8625         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8626 done
8627 LIBS="$cf_add_libs"
8628
8629 else
8630
8631         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8632         cf_libdir=""
8633         echo "$as_me:8633: checking for initscr" >&5
8634 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8635 if test "${ac_cv_func_initscr+set}" = set; then
8636   echo $ECHO_N "(cached) $ECHO_C" >&6
8637 else
8638   cat >conftest.$ac_ext <<_ACEOF
8639 #line 8639 "configure"
8640 #include "confdefs.h"
8641 /* System header to define __stub macros and hopefully few prototypes,
8642     which can conflict with char initscr (); below.  */
8643 #include <assert.h>
8644 /* Override any gcc2 internal prototype to avoid an error.  */
8645 #ifdef __cplusplus
8646 extern "C"
8647 #endif
8648 /* We use char because int might match the return type of a gcc2
8649    builtin and then its argument prototype would still apply.  */
8650 char initscr ();
8651 char (*f) ();
8652
8653 int
8654 main ()
8655 {
8656 /* The GNU C library defines this for functions which it implements
8657     to always fail with ENOSYS.  Some functions are actually named
8658     something starting with __ and the normal name is an alias.  */
8659 #if defined (__stub_initscr) || defined (__stub___initscr)
8660 choke me
8661 #else
8662 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8663 #endif
8664
8665   ;
8666   return 0;
8667 }
8668 _ACEOF
8669 rm -f conftest.$ac_objext conftest$ac_exeext
8670 if { (eval echo "$as_me:8670: \"$ac_link\"") >&5
8671   (eval $ac_link) 2>&5
8672   ac_status=$?
8673   echo "$as_me:8673: \$? = $ac_status" >&5
8674   (exit $ac_status); } &&
8675          { ac_try='test -s conftest$ac_exeext'
8676   { (eval echo "$as_me:8676: \"$ac_try\"") >&5
8677   (eval $ac_try) 2>&5
8678   ac_status=$?
8679   echo "$as_me:8679: \$? = $ac_status" >&5
8680   (exit $ac_status); }; }; then
8681   ac_cv_func_initscr=yes
8682 else
8683   echo "$as_me: failed program was:" >&5
8684 cat conftest.$ac_ext >&5
8685 ac_cv_func_initscr=no
8686 fi
8687 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8688 fi
8689 echo "$as_me:8689: result: $ac_cv_func_initscr" >&5
8690 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8691 if test $ac_cv_func_initscr = yes; then
8692   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8693 else
8694
8695                 cf_save_LIBS="$LIBS"
8696                 echo "$as_me:8696: checking for initscr in -l$cf_nculib_root" >&5
8697 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8698                 LIBS="-l$cf_nculib_root $LIBS"
8699                 cat >conftest.$ac_ext <<_ACEOF
8700 #line 8700 "configure"
8701 #include "confdefs.h"
8702 #include <${cf_cv_ncurses_header:-curses.h}>
8703 int
8704 main ()
8705 {
8706 initscr()
8707   ;
8708   return 0;
8709 }
8710 _ACEOF
8711 rm -f conftest.$ac_objext conftest$ac_exeext
8712 if { (eval echo "$as_me:8712: \"$ac_link\"") >&5
8713   (eval $ac_link) 2>&5
8714   ac_status=$?
8715   echo "$as_me:8715: \$? = $ac_status" >&5
8716   (exit $ac_status); } &&
8717          { ac_try='test -s conftest$ac_exeext'
8718   { (eval echo "$as_me:8718: \"$ac_try\"") >&5
8719   (eval $ac_try) 2>&5
8720   ac_status=$?
8721   echo "$as_me:8721: \$? = $ac_status" >&5
8722   (exit $ac_status); }; }; then
8723   echo "$as_me:8723: result: yes" >&5
8724 echo "${ECHO_T}yes" >&6
8725                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8726
8727 else
8728   echo "$as_me: failed program was:" >&5
8729 cat conftest.$ac_ext >&5
8730 echo "$as_me:8730: result: no" >&5
8731 echo "${ECHO_T}no" >&6
8732
8733 cf_search=
8734 cf_library_path_list=""
8735 if test -n "${LDFLAGS}${LIBS}" ; then
8736         for cf_library_path in $LDFLAGS $LIBS
8737         do
8738                 case $cf_library_path in
8739                 (-L*)
8740                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8741
8742 test "x$cf_library_path" != "xNONE" && \
8743 test -d "$cf_library_path" && \
8744  {
8745         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8746         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8747         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8748         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8749         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8750         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"
8751 }
8752
8753                         cf_library_path_list="$cf_library_path_list $cf_search"
8754                         ;;
8755                 esac
8756         done
8757 fi
8758
8759 cf_search=
8760
8761 test "x$prefix" != "xNONE" && \
8762 test -d "$prefix" && \
8763  {
8764         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8765         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8766         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8767         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8768         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8769         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8770 }
8771
8772 for cf_subdir_prefix in \
8773         /usr \
8774         /usr/local \
8775         /usr/pkg \
8776         /opt \
8777         /opt/local \
8778         $HOME
8779 do
8780
8781 test "x$cf_subdir_prefix" != "x$prefix" && \
8782 test -d "$cf_subdir_prefix" && \
8783 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8784         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8785         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8786         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8787         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8788         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8789         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"
8790 }
8791
8792 done
8793
8794 cf_search="$cf_library_path_list $cf_search"
8795
8796                         for cf_libdir in $cf_search
8797                         do
8798                                 echo "$as_me:8798: checking for -l$cf_nculib_root in $cf_libdir" >&5
8799 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8800                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8801                                 cat >conftest.$ac_ext <<_ACEOF
8802 #line 8802 "configure"
8803 #include "confdefs.h"
8804 #include <${cf_cv_ncurses_header:-curses.h}>
8805 int
8806 main ()
8807 {
8808 initscr()
8809   ;
8810   return 0;
8811 }
8812 _ACEOF
8813 rm -f conftest.$ac_objext conftest$ac_exeext
8814 if { (eval echo "$as_me:8814: \"$ac_link\"") >&5
8815   (eval $ac_link) 2>&5
8816   ac_status=$?
8817   echo "$as_me:8817: \$? = $ac_status" >&5
8818   (exit $ac_status); } &&
8819          { ac_try='test -s conftest$ac_exeext'
8820   { (eval echo "$as_me:8820: \"$ac_try\"") >&5
8821   (eval $ac_try) 2>&5
8822   ac_status=$?
8823   echo "$as_me:8823: \$? = $ac_status" >&5
8824   (exit $ac_status); }; }; then
8825   echo "$as_me:8825: result: yes" >&5
8826 echo "${ECHO_T}yes" >&6
8827                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8828                                          break
8829 else
8830   echo "$as_me: failed program was:" >&5
8831 cat conftest.$ac_ext >&5
8832 echo "$as_me:8832: result: no" >&5
8833 echo "${ECHO_T}no" >&6
8834                                          LIBS="$cf_save_LIBS"
8835 fi
8836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8837                         done
8838
8839 fi
8840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8841
8842 fi
8843
8844 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8845
8846 if test $cf_found_library = no ; then
8847         { { echo "$as_me:8847: error: Cannot link $cf_nculib_root library" >&5
8848 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8849    { (exit 1); exit 1; }; }
8850 fi
8851
8852 fi
8853
8854 if test -n "$cf_ncurses_LIBS" ; then
8855         echo "$as_me:8855: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8856 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8857         cf_ncurses_SAVE="$LIBS"
8858         for p in $cf_ncurses_LIBS ; do
8859                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8860                 if test "$q" != "$LIBS" ; then
8861                         LIBS="$q"
8862                 fi
8863         done
8864         cat >conftest.$ac_ext <<_ACEOF
8865 #line 8865 "configure"
8866 #include "confdefs.h"
8867 #include <${cf_cv_ncurses_header:-curses.h}>
8868 int
8869 main ()
8870 {
8871 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8872   ;
8873   return 0;
8874 }
8875 _ACEOF
8876 rm -f conftest.$ac_objext conftest$ac_exeext
8877 if { (eval echo "$as_me:8877: \"$ac_link\"") >&5
8878   (eval $ac_link) 2>&5
8879   ac_status=$?
8880   echo "$as_me:8880: \$? = $ac_status" >&5
8881   (exit $ac_status); } &&
8882          { ac_try='test -s conftest$ac_exeext'
8883   { (eval echo "$as_me:8883: \"$ac_try\"") >&5
8884   (eval $ac_try) 2>&5
8885   ac_status=$?
8886   echo "$as_me:8886: \$? = $ac_status" >&5
8887   (exit $ac_status); }; }; then
8888   echo "$as_me:8888: result: yes" >&5
8889 echo "${ECHO_T}yes" >&6
8890 else
8891   echo "$as_me: failed program was:" >&5
8892 cat conftest.$ac_ext >&5
8893 echo "$as_me:8893: result: no" >&5
8894 echo "${ECHO_T}no" >&6
8895                  LIBS="$cf_ncurses_SAVE"
8896 fi
8897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8898 fi
8899
8900 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8901
8902 cat >>confdefs.h <<EOF
8903 #define $cf_nculib_ROOT 1
8904 EOF
8905
8906         fi
8907 else
8908         NCURSES_CONFIG=none
8909 fi
8910
8911 fi
8912
8913 if test "$NCURSES_CONFIG_PKG" != none ; then
8914         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
8915
8916         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8917         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8918         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8919
8920         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
8921         if test -z "$cf_cv_abi_version"
8922         then
8923                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
8924         fi
8925
8926 elif test "$NCURSES_CONFIG" != none ; then
8927
8928         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
8929
8930         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
8931         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
8932         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
8933
8934         # ABI version is not available from headers
8935         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
8936
8937 else
8938
8939         for cf_name in MAJOR MINOR PATCH
8940         do
8941         cat >conftest.$ac_ext <<CF_EOF
8942         #include <${cf_cv_ncurses_header:-curses.h}>
8943         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
8944 CF_EOF
8945                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
8946                 { (eval echo "$as_me:8946: \"$cf_try\"") >&5
8947   (eval $cf_try) 2>&5
8948   ac_status=$?
8949   echo "$as_me:8949: \$? = $ac_status" >&5
8950   (exit $ac_status); }
8951                 if test -f conftest.out ; then
8952                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
8953                         eval NCURSES_$cf_name=\"$cf_result\"
8954                         # cat conftest.$ac_ext
8955                         # cat conftest.out
8956                 fi
8957         done
8958
8959         cf_cv_abi_version=${NCURSES_MAJOR}
8960
8961 fi
8962
8963 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
8964
8965 cf_cv_timestamp=`date`
8966
8967 echo "$as_me:8967: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
8968 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
8969
8970 echo "$as_me:8970: checking if you want to have a library-prefix" >&5
8971 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
8972
8973 # Check whether --with-lib-prefix or --without-lib-prefix was given.
8974 if test "${with_lib_prefix+set}" = set; then
8975   withval="$with_lib_prefix"
8976   with_lib_prefix=$withval
8977 else
8978   with_lib_prefix=auto
8979 fi;
8980 echo "$as_me:8980: result: $with_lib_prefix" >&5
8981 echo "${ECHO_T}$with_lib_prefix" >&6
8982
8983 if test $with_lib_prefix = auto
8984 then
8985
8986         case $cf_cv_system_name in
8987         (OS/2*|os2*)
8988                 if test "$DFT_LWR_MODEL" = libtool; then
8989                         LIB_PREFIX='lib'
8990                 else
8991                         LIB_PREFIX=''
8992                 fi
8993                 ;;
8994         (*)     LIB_PREFIX='lib'
8995                 ;;
8996         esac
8997 cf_prefix=$LIB_PREFIX
8998
8999 elif test $with_lib_prefix = no
9000 then
9001         LIB_PREFIX=
9002 else
9003         LIB_PREFIX=$with_lib_prefix
9004 fi
9005
9006 LIB_SUFFIX=
9007
9008 ###############################################################################
9009
9010 if test X"$CC_G_OPT" = X"" ; then
9011         CC_G_OPT='-g'
9012         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
9013 fi
9014
9015 echo "$as_me:9015: checking for default loader flags" >&5
9016 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
9017 case $DFT_LWR_MODEL in
9018 (normal)  LD_MODEL=''   ;;
9019 (debug)   LD_MODEL=$CC_G_OPT ;;
9020 (profile) LD_MODEL='-pg';;
9021 (shared)  LD_MODEL=''   ;;
9022 esac
9023 echo "$as_me:9023: result: $LD_MODEL" >&5
9024 echo "${ECHO_T}$LD_MODEL" >&6
9025
9026 LD_RPATH_OPT=
9027 echo "$as_me:9027: checking for an rpath option" >&5
9028 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9029 case $cf_cv_system_name in
9030 (irix*)
9031         if test "$GCC" = yes; then
9032                 LD_RPATH_OPT="-Wl,-rpath,"
9033         else
9034                 LD_RPATH_OPT="-rpath "
9035         fi
9036         ;;
9037 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9038         LD_RPATH_OPT="-Wl,-rpath,"
9039         ;;
9040 (openbsd[2-9].*|mirbsd*)
9041         LD_RPATH_OPT="-Wl,-rpath,"
9042         ;;
9043 (dragonfly*)
9044         LD_RPATH_OPT="-rpath "
9045         ;;
9046 (netbsd*)
9047         LD_RPATH_OPT="-Wl,-rpath,"
9048         ;;
9049 (osf*|mls+*)
9050         LD_RPATH_OPT="-rpath "
9051         ;;
9052 (solaris2*)
9053         LD_RPATH_OPT="-R"
9054         ;;
9055 (*)
9056         ;;
9057 esac
9058 echo "$as_me:9058: result: $LD_RPATH_OPT" >&5
9059 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9060
9061 case "x$LD_RPATH_OPT" in
9062 (x-R*)
9063         echo "$as_me:9063: checking if we need a space after rpath option" >&5
9064 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9065         cf_save_LIBS="$LIBS"
9066
9067 cf_add_libs="${LD_RPATH_OPT}$libdir"
9068 # Filter out duplicates - this happens with badly-designed ".pc" files...
9069 for cf_add_1lib in $LIBS
9070 do
9071         for cf_add_2lib in $cf_add_libs
9072         do
9073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9074                 then
9075                         cf_add_1lib=
9076                         break
9077                 fi
9078         done
9079         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9080 done
9081 LIBS="$cf_add_libs"
9082
9083         cat >conftest.$ac_ext <<_ACEOF
9084 #line 9084 "configure"
9085 #include "confdefs.h"
9086
9087 int
9088 main ()
9089 {
9090
9091   ;
9092   return 0;
9093 }
9094 _ACEOF
9095 rm -f conftest.$ac_objext conftest$ac_exeext
9096 if { (eval echo "$as_me:9096: \"$ac_link\"") >&5
9097   (eval $ac_link) 2>&5
9098   ac_status=$?
9099   echo "$as_me:9099: \$? = $ac_status" >&5
9100   (exit $ac_status); } &&
9101          { ac_try='test -s conftest$ac_exeext'
9102   { (eval echo "$as_me:9102: \"$ac_try\"") >&5
9103   (eval $ac_try) 2>&5
9104   ac_status=$?
9105   echo "$as_me:9105: \$? = $ac_status" >&5
9106   (exit $ac_status); }; }; then
9107   cf_rpath_space=no
9108 else
9109   echo "$as_me: failed program was:" >&5
9110 cat conftest.$ac_ext >&5
9111 cf_rpath_space=yes
9112 fi
9113 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9114         LIBS="$cf_save_LIBS"
9115         echo "$as_me:9115: result: $cf_rpath_space" >&5
9116 echo "${ECHO_T}$cf_rpath_space" >&6
9117         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9118         ;;
9119 esac
9120
9121         RM_SHARED_OPTS=
9122         LOCAL_LDFLAGS=
9123         LOCAL_LDFLAGS2=
9124         LD_SHARED_OPTS=
9125         INSTALL_LIB="-m 644"
9126         : ${rel_builddir:=.}
9127
9128         shlibdir=$libdir
9129
9130         MAKE_DLLS="#"
9131
9132         cf_cv_do_symlinks=no
9133         cf_ld_rpath_opt=
9134         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9135
9136         echo "$as_me:9136: checking if release/abi version should be used for shared libs" >&5
9137 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9138
9139 # Check whether --with-shlib-version or --without-shlib-version was given.
9140 if test "${with_shlib_version+set}" = set; then
9141   withval="$with_shlib_version"
9142   test -z "$withval" && withval=auto
9143         case $withval in
9144         (yes)
9145                 cf_cv_shlib_version=auto
9146                 ;;
9147         (rel|abi|auto)
9148                 cf_cv_shlib_version=$withval
9149                 ;;
9150         (*)
9151                 echo "$as_me:9151: result: $withval" >&5
9152 echo "${ECHO_T}$withval" >&6
9153                 { { echo "$as_me:9153: error: option value must be one of: rel, abi, or auto" >&5
9154 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9155    { (exit 1); exit 1; }; }
9156                 ;;
9157         esac
9158
9159 else
9160   cf_cv_shlib_version=auto
9161 fi;
9162         echo "$as_me:9162: result: $cf_cv_shlib_version" >&5
9163 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9164
9165         cf_cv_rm_so_locs=no
9166         cf_try_cflags=
9167
9168         # Some less-capable ports of gcc support only -fpic
9169         CC_SHARED_OPTS=
9170
9171         cf_try_fPIC=no
9172         if test "$GCC" = yes
9173         then
9174                 cf_try_fPIC=yes
9175         else
9176                 case $cf_cv_system_name in
9177                 (*linux*)       # e.g., PGI compiler
9178                         cf_try_fPIC=yes
9179                         ;;
9180                 esac
9181         fi
9182
9183         if test "$cf_try_fPIC" = yes
9184         then
9185                 echo "$as_me:9185: checking which $CC option to use" >&5
9186 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9187                 cf_save_CFLAGS="$CFLAGS"
9188                 for CC_SHARED_OPTS in -fPIC -fpic ''
9189                 do
9190                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9191                         cat >conftest.$ac_ext <<_ACEOF
9192 #line 9192 "configure"
9193 #include "confdefs.h"
9194 #include <stdio.h>
9195 int
9196 main ()
9197 {
9198 int x = 1
9199   ;
9200   return 0;
9201 }
9202 _ACEOF
9203 rm -f conftest.$ac_objext
9204 if { (eval echo "$as_me:9204: \"$ac_compile\"") >&5
9205   (eval $ac_compile) 2>&5
9206   ac_status=$?
9207   echo "$as_me:9207: \$? = $ac_status" >&5
9208   (exit $ac_status); } &&
9209          { ac_try='test -s conftest.$ac_objext'
9210   { (eval echo "$as_me:9210: \"$ac_try\"") >&5
9211   (eval $ac_try) 2>&5
9212   ac_status=$?
9213   echo "$as_me:9213: \$? = $ac_status" >&5
9214   (exit $ac_status); }; }; then
9215   break
9216 else
9217   echo "$as_me: failed program was:" >&5
9218 cat conftest.$ac_ext >&5
9219 fi
9220 rm -f conftest.$ac_objext conftest.$ac_ext
9221                 done
9222                 echo "$as_me:9222: result: $CC_SHARED_OPTS" >&5
9223 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9224                 CFLAGS="$cf_save_CFLAGS"
9225         fi
9226
9227         cf_cv_shlib_version_infix=no
9228
9229         case $cf_cv_system_name in
9230         (aix4.3-9*|aix[5-7]*)
9231                 if test "$GCC" = yes; then
9232                         CC_SHARED_OPTS='-Wl,-brtl'
9233                         MK_SHARED_LIB='${CC} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9234                 else
9235                         CC_SHARED_OPTS='-brtl'
9236                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9237                         MK_SHARED_LIB='${CC} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9238                 fi
9239                 ;;
9240         (beos*)
9241                 MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9242                 ;;
9243         (cygwin*)
9244                 CC_SHARED_OPTS=
9245                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9246                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9247                 cf_cv_shlib_version=cygdll
9248                 cf_cv_shlib_version_infix=cygdll
9249                 shlibdir=$bindir
9250                 MAKE_DLLS=
9251                 cat >mk_shared_lib.sh <<-CF_EOF
9252                 #!$SHELL
9253                 SHARED_LIB=\$1
9254                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9255                 shift
9256                 cat <<-EOF
9257                 Linking shared library
9258                 ** SHARED_LIB \$SHARED_LIB
9259                 ** IMPORT_LIB \$IMPORT_LIB
9260 EOF
9261                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9262 CF_EOF
9263                 chmod +x mk_shared_lib.sh
9264                 ;;
9265         (msys*)
9266                 CC_SHARED_OPTS=
9267                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9268                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9269                 cf_cv_shlib_version=msysdll
9270                 cf_cv_shlib_version_infix=msysdll
9271                 shlibdir=$bindir
9272                 MAKE_DLLS=
9273                 cat >mk_shared_lib.sh <<-CF_EOF
9274                 #!$SHELL
9275                 SHARED_LIB=\$1
9276                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9277                 shift
9278                 cat <<-EOF
9279                 Linking shared library
9280                 ** SHARED_LIB \$SHARED_LIB
9281                 ** IMPORT_LIB \$IMPORT_LIB
9282 EOF
9283                 exec \$* -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9284 CF_EOF
9285                 chmod +x mk_shared_lib.sh
9286                 ;;
9287         (darwin*)
9288                 cf_try_cflags="no-cpp-precomp"
9289                 CC_SHARED_OPTS="-dynamic"
9290                 MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9291                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9292                 cf_cv_shlib_version_infix=yes
9293                 echo "$as_me:9293: checking if ld -search_paths_first works" >&5
9294 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9295 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9296   echo $ECHO_N "(cached) $ECHO_C" >&6
9297 else
9298
9299                         cf_save_LDFLAGS=$LDFLAGS
9300                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9301                         cat >conftest.$ac_ext <<_ACEOF
9302 #line 9302 "configure"
9303 #include "confdefs.h"
9304
9305 int
9306 main ()
9307 {
9308 int i;
9309   ;
9310   return 0;
9311 }
9312 _ACEOF
9313 rm -f conftest.$ac_objext conftest$ac_exeext
9314 if { (eval echo "$as_me:9314: \"$ac_link\"") >&5
9315   (eval $ac_link) 2>&5
9316   ac_status=$?
9317   echo "$as_me:9317: \$? = $ac_status" >&5
9318   (exit $ac_status); } &&
9319          { ac_try='test -s conftest$ac_exeext'
9320   { (eval echo "$as_me:9320: \"$ac_try\"") >&5
9321   (eval $ac_try) 2>&5
9322   ac_status=$?
9323   echo "$as_me:9323: \$? = $ac_status" >&5
9324   (exit $ac_status); }; }; then
9325   cf_cv_ldflags_search_paths_first=yes
9326 else
9327   echo "$as_me: failed program was:" >&5
9328 cat conftest.$ac_ext >&5
9329 cf_cv_ldflags_search_paths_first=no
9330 fi
9331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9332                                 LDFLAGS=$cf_save_LDFLAGS
9333 fi
9334 echo "$as_me:9334: result: $cf_cv_ldflags_search_paths_first" >&5
9335 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9336                 if test $cf_cv_ldflags_search_paths_first = yes; then
9337                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9338                 fi
9339                 ;;
9340         (hpux[7-8]*)
9341                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9342                 if test "$GCC" != yes; then
9343                         CC_SHARED_OPTS='+Z'
9344                 fi
9345                 MK_SHARED_LIB='${LD} -b -o $@'
9346                 INSTALL_LIB="-m 555"
9347                 ;;
9348         (hpux*)
9349                 # (tested with gcc 2.7.2 -- I don't have c89)
9350                 if test "$GCC" = yes; then
9351                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9352                 else
9353                         CC_SHARED_OPTS='+Z'
9354                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9355                 fi
9356                 MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
9357                 # HP-UX shared libraries must be executable, and should be
9358                 # readonly to exploit a quirk in the memory manager.
9359                 INSTALL_LIB="-m 555"
9360                 ;;
9361         (interix*)
9362                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9363                 if test "$cf_cv_shlib_version" = rel; then
9364                         cf_shared_soname='`basename  .${REL_VERSION}`.${ABI_VERSION}'
9365                 else
9366                         cf_shared_soname='`basename `'
9367                 fi
9368                 CC_SHARED_OPTS=
9369                 MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o '
9370                 ;;
9371         (irix*)
9372                 if test "$cf_cv_enable_rpath" = yes ; then
9373                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9374                 fi
9375                 # tested with IRIX 5.2 and 'cc'.
9376                 if test "$GCC" != yes; then
9377                         CC_SHARED_OPTS='-KPIC'
9378                         MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
9379                 else
9380                         MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
9381                 fi
9382                 cf_cv_rm_so_locs=yes
9383                 ;;
9384         (linux*|gnu*|k*bsd*-gnu)
9385                 if test "$DFT_LWR_MODEL" = "shared" ; then
9386                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9387                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9388                 fi
9389                 if test "$cf_cv_enable_rpath" = yes ; then
9390                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9391                 fi
9392
9393         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9394         if test "$cf_cv_shlib_version" = rel; then
9395                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9396         else
9397                 cf_cv_shared_soname='`basename $@`'
9398         fi
9399
9400                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9401                 ;;
9402         (mingw*)
9403                 cf_cv_shlib_version=mingw
9404                 cf_cv_shlib_version_infix=mingw
9405                 shlibdir=$bindir
9406                 MAKE_DLLS=
9407                 if test "$DFT_LWR_MODEL" = "shared" ; then
9408                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9409                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9410                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9411                 fi
9412                 CC_SHARED_OPTS=
9413                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9414                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9415                 cat >mk_shared_lib.sh <<-CF_EOF
9416                 #!$SHELL
9417                 SHARED_LIB=\$1
9418                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9419                 shift
9420                 cat <<-EOF
9421                 Linking shared library
9422                 ** SHARED_LIB \$SHARED_LIB
9423                 ** IMPORT_LIB \$IMPORT_LIB
9424 EOF
9425                 exec \$* -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9426 CF_EOF
9427                 chmod +x mk_shared_lib.sh
9428                 ;;
9429         (openbsd[2-9].*|mirbsd*)
9430                 if test "$DFT_LWR_MODEL" = "shared" ; then
9431                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9432                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9433                 fi
9434                 if test "$cf_cv_enable_rpath" = yes ; then
9435                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9436                 fi
9437                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9438
9439         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9440         if test "$cf_cv_shlib_version" = rel; then
9441                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9442         else
9443                 cf_cv_shared_soname='`basename $@`'
9444         fi
9445
9446                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9447                 ;;
9448         (nto-qnx*|openbsd*|freebsd[12].*)
9449                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9450                 MK_SHARED_LIB='${LD} -Bshareable -o $@'
9451                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9452                 ;;
9453         (dragonfly*|freebsd*)
9454                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9455                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9456                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9457                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9458                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9459                 fi
9460
9461         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9462         if test "$cf_cv_shlib_version" = rel; then
9463                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9464         else
9465                 cf_cv_shared_soname='`basename $@`'
9466         fi
9467
9468                 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9469                 ;;
9470         (netbsd*)
9471                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9472                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9473                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9474                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9475                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9476                         if test "$cf_cv_shlib_version" = auto; then
9477                         if test -f /usr/libexec/ld.elf_so; then
9478                                 cf_cv_shlib_version=abi
9479                         else
9480                                 cf_cv_shlib_version=rel
9481                         fi
9482                         fi
9483
9484         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9485         if test "$cf_cv_shlib_version" = rel; then
9486                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9487         else
9488                 cf_cv_shared_soname='`basename $@`'
9489         fi
9490
9491                         MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9492                 else
9493                         MK_SHARED_LIB='${CC} -Wl,-shared -Wl,-Bshareable -o $@'
9494                 fi
9495                 ;;
9496         (osf*|mls+*)
9497                 # tested with OSF/1 V3.2 and 'cc'
9498                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9499                 # link with shared libs).
9500                 MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9501                 case $host_os in
9502                 (osf4*)
9503                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9504                         ;;
9505                 esac
9506                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9507                 if test "$DFT_LWR_MODEL" = "shared" ; then
9508                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9509                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9510                 fi
9511                 cf_cv_rm_so_locs=yes
9512                 ;;
9513         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9514                 # tested with osr5.0.5
9515                 if test "$GCC" != yes; then
9516                         CC_SHARED_OPTS='-belf -KPIC'
9517                 fi
9518                 MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9519                 if test "$cf_cv_enable_rpath" = yes ; then
9520                         # only way is to set LD_RUN_PATH but no switch for it
9521                         RUN_PATH=$libdir
9522                 fi
9523                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9524                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9525                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9526                 ;;
9527         (sunos4*)
9528                 # tested with SunOS 4.1.1 and gcc 2.7.0
9529                 if test "$GCC" != yes; then
9530                         CC_SHARED_OPTS='-KPIC'
9531                 fi
9532                 MK_SHARED_LIB='${LD} -assert pure-text -o $@'
9533                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9534                 ;;
9535         (solaris2*)
9536                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9537                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9538                 if test "$DFT_LWR_MODEL" = "shared" ; then
9539                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9540                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9541                 fi
9542                 if test "$cf_cv_enable_rpath" = yes ; then
9543                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9544                 fi
9545
9546         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9547         if test "$cf_cv_shlib_version" = rel; then
9548                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9549         else
9550                 cf_cv_shared_soname='`basename $@`'
9551         fi
9552
9553                 if test "$GCC" != yes; then
9554                         cf_save_CFLAGS="$CFLAGS"
9555                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9556                         do
9557                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9558                                 cat >conftest.$ac_ext <<_ACEOF
9559 #line 9559 "configure"
9560 #include "confdefs.h"
9561 #include <stdio.h>
9562 int
9563 main ()
9564 {
9565 printf("Hello\n");
9566   ;
9567   return 0;
9568 }
9569 _ACEOF
9570 rm -f conftest.$ac_objext
9571 if { (eval echo "$as_me:9571: \"$ac_compile\"") >&5
9572   (eval $ac_compile) 2>&5
9573   ac_status=$?
9574   echo "$as_me:9574: \$? = $ac_status" >&5
9575   (exit $ac_status); } &&
9576          { ac_try='test -s conftest.$ac_objext'
9577   { (eval echo "$as_me:9577: \"$ac_try\"") >&5
9578   (eval $ac_try) 2>&5
9579   ac_status=$?
9580   echo "$as_me:9580: \$? = $ac_status" >&5
9581   (exit $ac_status); }; }; then
9582   break
9583 else
9584   echo "$as_me: failed program was:" >&5
9585 cat conftest.$ac_ext >&5
9586 fi
9587 rm -f conftest.$ac_objext conftest.$ac_ext
9588                         done
9589                         CFLAGS="$cf_save_CFLAGS"
9590                         CC_SHARED_OPTS=$cf_shared_opts
9591                         MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
9592                 else
9593                         MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9594                 fi
9595                 ;;
9596         (sysv5uw7*|unix_sv*)
9597                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9598                 if test "$GCC" != yes; then
9599                         CC_SHARED_OPTS='-KPIC'
9600                 fi
9601                 MK_SHARED_LIB='${LD} -d y -G -o $@'
9602                 ;;
9603         (*)
9604                 CC_SHARED_OPTS='unknown'
9605                 MK_SHARED_LIB='echo unknown'
9606                 ;;
9607         esac
9608
9609         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9610         case "$cf_cv_shlib_version" in
9611         (rel|abi)
9612                 case "$MK_SHARED_LIB" in
9613                 (*'-o $@')
9614                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9615                         ;;
9616                 (*)
9617                         { echo "$as_me:9617: WARNING: ignored --with-shlib-version" >&5
9618 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9619                         ;;
9620                 esac
9621                 ;;
9622         esac
9623
9624         if test -n "$cf_try_cflags"
9625         then
9626 cat > conftest.$ac_ext <<EOF
9627 #line 9627 "${as_me:-configure}"
9628 #include <stdio.h>
9629 int main(int argc, char *argv[])
9630 {
9631         printf("hello\n");
9632         return (argv[argc-1] == 0) ;
9633 }
9634 EOF
9635                 cf_save_CFLAGS="$CFLAGS"
9636                 for cf_opt in $cf_try_cflags
9637                 do
9638                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9639                         echo "$as_me:9639: checking if CFLAGS option -$cf_opt works" >&5
9640 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9641                         if { (eval echo "$as_me:9641: \"$ac_compile\"") >&5
9642   (eval $ac_compile) 2>&5
9643   ac_status=$?
9644   echo "$as_me:9644: \$? = $ac_status" >&5
9645   (exit $ac_status); }; then
9646                                 echo "$as_me:9646: result: yes" >&5
9647 echo "${ECHO_T}yes" >&6
9648                                 cf_save_CFLAGS="$CFLAGS"
9649                         else
9650                                 echo "$as_me:9650: result: no" >&5
9651 echo "${ECHO_T}no" >&6
9652                         fi
9653                 done
9654                 CFLAGS="$cf_save_CFLAGS"
9655         fi
9656
9657         # RPATH_LIST is a colon-separated list of directories
9658         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9659         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9660
9661         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9662
9663         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9664
9665 echo "${as_me:-configure}:9665: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9666
9667         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9668
9669 echo "${as_me:-configure}:9669: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9670
9671 # The test/sample programs in the original tree link using rpath option.
9672 # Make it optional for packagers.
9673 if test -n "$LOCAL_LDFLAGS"
9674 then
9675         echo "$as_me:9675: checking if you want to link sample programs with rpath option" >&5
9676 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9677
9678 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9679 if test "${enable_rpath_link+set}" = set; then
9680   enableval="$enable_rpath_link"
9681   with_rpath_link=$enableval
9682 else
9683   with_rpath_link=yes
9684 fi;
9685         echo "$as_me:9685: result: $with_rpath_link" >&5
9686 echo "${ECHO_T}$with_rpath_link" >&6
9687         if test "$with_rpath_link" = no
9688         then
9689                 LOCAL_LDFLAGS=
9690                 LOCAL_LDFLAGS2=
9691         fi
9692 fi
9693
9694 ###############################################################################
9695
9696 ###   use option --enable-broken-linker to force on use of broken-linker support
9697 echo "$as_me:9697: checking if you want broken-linker support code" >&5
9698 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9699
9700 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9701 if test "${enable_broken_linker+set}" = set; then
9702   enableval="$enable_broken_linker"
9703   with_broken_linker=$enableval
9704 else
9705   with_broken_linker=${BROKEN_LINKER:-no}
9706 fi;
9707 echo "$as_me:9707: result: $with_broken_linker" >&5
9708 echo "${ECHO_T}$with_broken_linker" >&6
9709
9710 BROKEN_LINKER=0
9711 if test "$with_broken_linker" = yes ; then
9712         cat >>confdefs.h <<\EOF
9713 #define BROKEN_LINKER 1
9714 EOF
9715
9716         BROKEN_LINKER=1
9717 elif test "$DFT_LWR_MODEL" = shared ; then
9718         case $cf_cv_system_name in
9719         (cygwin*)
9720                 cat >>confdefs.h <<\EOF
9721 #define BROKEN_LINKER 1
9722 EOF
9723
9724                 BROKEN_LINKER=1
9725                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9726
9727 echo "${as_me:-configure}:9727: testing cygwin linker is broken anyway ..." 1>&5
9728
9729                 ;;
9730         esac
9731 fi
9732
9733 # Check to define _XOPEN_SOURCE "automatically"
9734
9735 cf_XOPEN_SOURCE=500
9736 cf_POSIX_C_SOURCE=199506L
9737 cf_xopen_source=
9738
9739 case $host_os in
9740 (aix[4-7]*)
9741         cf_xopen_source="-D_ALL_SOURCE"
9742         ;;
9743 (msys)
9744         cf_XOPEN_SOURCE=600
9745         ;;
9746 (darwin[0-8].*)
9747         cf_xopen_source="-D_APPLE_C_SOURCE"
9748         ;;
9749 (darwin*)
9750         cf_xopen_source="-D_DARWIN_C_SOURCE"
9751         cf_XOPEN_SOURCE=
9752         ;;
9753 (freebsd*|dragonfly*)
9754         # 5.x headers associate
9755         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
9756         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
9757         cf_POSIX_C_SOURCE=200112L
9758         cf_XOPEN_SOURCE=600
9759         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
9760         ;;
9761 (hpux11*)
9762         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
9763         ;;
9764 (hpux*)
9765         cf_xopen_source="-D_HPUX_SOURCE"
9766         ;;
9767 (irix[56].*)
9768         cf_xopen_source="-D_SGI_SOURCE"
9769         cf_XOPEN_SOURCE=
9770         ;;
9771 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
9772
9773 echo "$as_me:9773: checking if we must define _GNU_SOURCE" >&5
9774 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
9775 if test "${cf_cv_gnu_source+set}" = set; then
9776   echo $ECHO_N "(cached) $ECHO_C" >&6
9777 else
9778
9779 cat >conftest.$ac_ext <<_ACEOF
9780 #line 9780 "configure"
9781 #include "confdefs.h"
9782 #include <sys/types.h>
9783 int
9784 main ()
9785 {
9786
9787 #ifndef _XOPEN_SOURCE
9788 make an error
9789 #endif
9790   ;
9791   return 0;
9792 }
9793 _ACEOF
9794 rm -f conftest.$ac_objext
9795 if { (eval echo "$as_me:9795: \"$ac_compile\"") >&5
9796   (eval $ac_compile) 2>&5
9797   ac_status=$?
9798   echo "$as_me:9798: \$? = $ac_status" >&5
9799   (exit $ac_status); } &&
9800          { ac_try='test -s conftest.$ac_objext'
9801   { (eval echo "$as_me:9801: \"$ac_try\"") >&5
9802   (eval $ac_try) 2>&5
9803   ac_status=$?
9804   echo "$as_me:9804: \$? = $ac_status" >&5
9805   (exit $ac_status); }; }; then
9806   cf_cv_gnu_source=no
9807 else
9808   echo "$as_me: failed program was:" >&5
9809 cat conftest.$ac_ext >&5
9810 cf_save="$CPPFLAGS"
9811          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9812          cat >conftest.$ac_ext <<_ACEOF
9813 #line 9813 "configure"
9814 #include "confdefs.h"
9815 #include <sys/types.h>
9816 int
9817 main ()
9818 {
9819
9820 #ifdef _XOPEN_SOURCE
9821 make an error
9822 #endif
9823   ;
9824   return 0;
9825 }
9826 _ACEOF
9827 rm -f conftest.$ac_objext
9828 if { (eval echo "$as_me:9828: \"$ac_compile\"") >&5
9829   (eval $ac_compile) 2>&5
9830   ac_status=$?
9831   echo "$as_me:9831: \$? = $ac_status" >&5
9832   (exit $ac_status); } &&
9833          { ac_try='test -s conftest.$ac_objext'
9834   { (eval echo "$as_me:9834: \"$ac_try\"") >&5
9835   (eval $ac_try) 2>&5
9836   ac_status=$?
9837   echo "$as_me:9837: \$? = $ac_status" >&5
9838   (exit $ac_status); }; }; then
9839   cf_cv_gnu_source=no
9840 else
9841   echo "$as_me: failed program was:" >&5
9842 cat conftest.$ac_ext >&5
9843 cf_cv_gnu_source=yes
9844 fi
9845 rm -f conftest.$ac_objext conftest.$ac_ext
9846         CPPFLAGS="$cf_save"
9847
9848 fi
9849 rm -f conftest.$ac_objext conftest.$ac_ext
9850
9851 fi
9852 echo "$as_me:9852: result: $cf_cv_gnu_source" >&5
9853 echo "${ECHO_T}$cf_cv_gnu_source" >&6
9854
9855 if test "$cf_cv_gnu_source" = yes
9856 then
9857 echo "$as_me:9857: checking if we should also define _DEFAULT_SOURCE" >&5
9858 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
9859 if test "${cf_cv_default_source+set}" = set; then
9860   echo $ECHO_N "(cached) $ECHO_C" >&6
9861 else
9862
9863 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
9864         cat >conftest.$ac_ext <<_ACEOF
9865 #line 9865 "configure"
9866 #include "confdefs.h"
9867 #include <sys/types.h>
9868 int
9869 main ()
9870 {
9871
9872 #ifdef _DEFAULT_SOURCE
9873 make an error
9874 #endif
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f conftest.$ac_objext
9880 if { (eval echo "$as_me:9880: \"$ac_compile\"") >&5
9881   (eval $ac_compile) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit $ac_status); } &&
9885          { ac_try='test -s conftest.$ac_objext'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit $ac_status); }; }; then
9891   cf_cv_default_source=no
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat conftest.$ac_ext >&5
9895 cf_cv_default_source=yes
9896 fi
9897 rm -f conftest.$ac_objext conftest.$ac_ext
9898
9899 fi
9900 echo "$as_me:9900: result: $cf_cv_default_source" >&5
9901 echo "${ECHO_T}$cf_cv_default_source" >&6
9902 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
9903 fi
9904
9905         ;;
9906 (minix*)
9907         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
9908         ;;
9909 (mirbsd*)
9910         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
9911         cf_XOPEN_SOURCE=
9912
9913 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
9914
9915 cf_save_CFLAGS="$CFLAGS"
9916 cf_save_CPPFLAGS="$CPPFLAGS"
9917
9918 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
9919         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9920                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9921
9922 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
9923         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
9924                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
9925
9926 echo "$as_me:9926: checking if we should define _POSIX_C_SOURCE" >&5
9927 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
9928 if test "${cf_cv_posix_c_source+set}" = set; then
9929   echo $ECHO_N "(cached) $ECHO_C" >&6
9930 else
9931
9932 echo "${as_me:-configure}:9932: testing if the symbol is already defined go no further ..." 1>&5
9933
9934         cat >conftest.$ac_ext <<_ACEOF
9935 #line 9935 "configure"
9936 #include "confdefs.h"
9937 #include <sys/types.h>
9938 int
9939 main ()
9940 {
9941
9942 #ifndef _POSIX_C_SOURCE
9943 make an error
9944 #endif
9945   ;
9946   return 0;
9947 }
9948 _ACEOF
9949 rm -f conftest.$ac_objext
9950 if { (eval echo "$as_me:9950: \"$ac_compile\"") >&5
9951   (eval $ac_compile) 2>&5
9952   ac_status=$?
9953   echo "$as_me:9953: \$? = $ac_status" >&5
9954   (exit $ac_status); } &&
9955          { ac_try='test -s conftest.$ac_objext'
9956   { (eval echo "$as_me:9956: \"$ac_try\"") >&5
9957   (eval $ac_try) 2>&5
9958   ac_status=$?
9959   echo "$as_me:9959: \$? = $ac_status" >&5
9960   (exit $ac_status); }; }; then
9961   cf_cv_posix_c_source=no
9962 else
9963   echo "$as_me: failed program was:" >&5
9964 cat conftest.$ac_ext >&5
9965 cf_want_posix_source=no
9966          case .$cf_POSIX_C_SOURCE in
9967          (.[12]??*)
9968                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9969                 ;;
9970          (.2)
9971                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
9972                 cf_want_posix_source=yes
9973                 ;;
9974          (.*)
9975                 cf_want_posix_source=yes
9976                 ;;
9977          esac
9978          if test "$cf_want_posix_source" = yes ; then
9979                 cat >conftest.$ac_ext <<_ACEOF
9980 #line 9980 "configure"
9981 #include "confdefs.h"
9982 #include <sys/types.h>
9983 int
9984 main ()
9985 {
9986
9987 #ifdef _POSIX_SOURCE
9988 make an error
9989 #endif
9990   ;
9991   return 0;
9992 }
9993 _ACEOF
9994 rm -f conftest.$ac_objext
9995 if { (eval echo "$as_me:9995: \"$ac_compile\"") >&5
9996   (eval $ac_compile) 2>&5
9997   ac_status=$?
9998   echo "$as_me:9998: \$? = $ac_status" >&5
9999   (exit $ac_status); } &&
10000          { ac_try='test -s conftest.$ac_objext'
10001   { (eval echo "$as_me:10001: \"$ac_try\"") >&5
10002   (eval $ac_try) 2>&5
10003   ac_status=$?
10004   echo "$as_me:10004: \$? = $ac_status" >&5
10005   (exit $ac_status); }; }; then
10006   :
10007 else
10008   echo "$as_me: failed program was:" >&5
10009 cat conftest.$ac_ext >&5
10010 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10011 fi
10012 rm -f conftest.$ac_objext conftest.$ac_ext
10013          fi
10014
10015 echo "${as_me:-configure}:10015: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10016
10017          CFLAGS="$cf_trim_CFLAGS"
10018          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10019
10020 echo "${as_me:-configure}:10020: testing if the second compile does not leave our definition intact error ..." 1>&5
10021
10022          cat >conftest.$ac_ext <<_ACEOF
10023 #line 10023 "configure"
10024 #include "confdefs.h"
10025 #include <sys/types.h>
10026 int
10027 main ()
10028 {
10029
10030 #ifndef _POSIX_C_SOURCE
10031 make an error
10032 #endif
10033   ;
10034   return 0;
10035 }
10036 _ACEOF
10037 rm -f conftest.$ac_objext
10038 if { (eval echo "$as_me:10038: \"$ac_compile\"") >&5
10039   (eval $ac_compile) 2>&5
10040   ac_status=$?
10041   echo "$as_me:10041: \$? = $ac_status" >&5
10042   (exit $ac_status); } &&
10043          { ac_try='test -s conftest.$ac_objext'
10044   { (eval echo "$as_me:10044: \"$ac_try\"") >&5
10045   (eval $ac_try) 2>&5
10046   ac_status=$?
10047   echo "$as_me:10047: \$? = $ac_status" >&5
10048   (exit $ac_status); }; }; then
10049   :
10050 else
10051   echo "$as_me: failed program was:" >&5
10052 cat conftest.$ac_ext >&5
10053 cf_cv_posix_c_source=no
10054 fi
10055 rm -f conftest.$ac_objext conftest.$ac_ext
10056          CFLAGS="$cf_save_CFLAGS"
10057          CPPFLAGS="$cf_save_CPPFLAGS"
10058
10059 fi
10060 rm -f conftest.$ac_objext conftest.$ac_ext
10061
10062 fi
10063 echo "$as_me:10063: result: $cf_cv_posix_c_source" >&5
10064 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10065
10066 if test "$cf_cv_posix_c_source" != no ; then
10067         CFLAGS="$cf_trim_CFLAGS"
10068         CPPFLAGS="$cf_trim_CPPFLAGS"
10069
10070 cf_fix_cppflags=no
10071 cf_new_cflags=
10072 cf_new_cppflags=
10073 cf_new_extra_cppflags=
10074
10075 for cf_add_cflags in $cf_cv_posix_c_source
10076 do
10077 case $cf_fix_cppflags in
10078 (no)
10079         case $cf_add_cflags in
10080         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10081                 case $cf_add_cflags in
10082                 (-D*)
10083                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10084
10085                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10086                                 && test -z "${cf_tst_cflags}" \
10087                                 && cf_fix_cppflags=yes
10088
10089                         if test $cf_fix_cppflags = yes ; then
10090
10091         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10092         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10093
10094                                 continue
10095                         elif test "${cf_tst_cflags}" = "\"'" ; then
10096
10097         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10098         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10099
10100                                 continue
10101                         fi
10102                         ;;
10103                 esac
10104                 case "$CPPFLAGS" in
10105                 (*$cf_add_cflags)
10106                         ;;
10107                 (*)
10108                         case $cf_add_cflags in
10109                         (-D*)
10110                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10111
10112 CPPFLAGS=`echo "$CPPFLAGS" | \
10113         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10114                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10115
10116                                 ;;
10117                         esac
10118
10119         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10120         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10121
10122                         ;;
10123                 esac
10124                 ;;
10125         (*)
10126
10127         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10128         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10129
10130                 ;;
10131         esac
10132         ;;
10133 (yes)
10134
10135         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10136         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10137
10138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10139
10140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10141                 && test -z "${cf_tst_cflags}" \
10142                 && cf_fix_cppflags=no
10143         ;;
10144 esac
10145 done
10146
10147 if test -n "$cf_new_cflags" ; then
10148
10149         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10150         CFLAGS="${CFLAGS}$cf_new_cflags"
10151
10152 fi
10153
10154 if test -n "$cf_new_cppflags" ; then
10155
10156         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10157         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10158
10159 fi
10160
10161 if test -n "$cf_new_extra_cppflags" ; then
10162
10163         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10164         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10165
10166 fi
10167
10168 fi
10169
10170         ;;
10171 (netbsd*)
10172         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10173         ;;
10174 (openbsd[4-9]*)
10175         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10176         cf_xopen_source="-D_BSD_SOURCE"
10177         cf_XOPEN_SOURCE=600
10178         ;;
10179 (openbsd*)
10180         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10181         ;;
10182 (osf[45]*)
10183         cf_xopen_source="-D_OSF_SOURCE"
10184         ;;
10185 (nto-qnx*)
10186         cf_xopen_source="-D_QNX_SOURCE"
10187         ;;
10188 (sco*)
10189         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10190         ;;
10191 (solaris2.*)
10192         cf_xopen_source="-D__EXTENSIONS__"
10193         cf_cv_xopen_source=broken
10194         ;;
10195 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10196         cf_XOPEN_SOURCE=
10197         cf_POSIX_C_SOURCE=
10198         ;;
10199 (*)
10200
10201 echo "$as_me:10201: checking if we should define _XOPEN_SOURCE" >&5
10202 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10203 if test "${cf_cv_xopen_source+set}" = set; then
10204   echo $ECHO_N "(cached) $ECHO_C" >&6
10205 else
10206
10207         cat >conftest.$ac_ext <<_ACEOF
10208 #line 10208 "configure"
10209 #include "confdefs.h"
10210
10211 #include <stdlib.h>
10212 #include <string.h>
10213 #include <sys/types.h>
10214
10215 int
10216 main ()
10217 {
10218
10219 #ifndef _XOPEN_SOURCE
10220 make an error
10221 #endif
10222   ;
10223   return 0;
10224 }
10225 _ACEOF
10226 rm -f conftest.$ac_objext
10227 if { (eval echo "$as_me:10227: \"$ac_compile\"") >&5
10228   (eval $ac_compile) 2>&5
10229   ac_status=$?
10230   echo "$as_me:10230: \$? = $ac_status" >&5
10231   (exit $ac_status); } &&
10232          { ac_try='test -s conftest.$ac_objext'
10233   { (eval echo "$as_me:10233: \"$ac_try\"") >&5
10234   (eval $ac_try) 2>&5
10235   ac_status=$?
10236   echo "$as_me:10236: \$? = $ac_status" >&5
10237   (exit $ac_status); }; }; then
10238   cf_cv_xopen_source=no
10239 else
10240   echo "$as_me: failed program was:" >&5
10241 cat conftest.$ac_ext >&5
10242 cf_save="$CPPFLAGS"
10243          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10244          cat >conftest.$ac_ext <<_ACEOF
10245 #line 10245 "configure"
10246 #include "confdefs.h"
10247
10248 #include <stdlib.h>
10249 #include <string.h>
10250 #include <sys/types.h>
10251
10252 int
10253 main ()
10254 {
10255
10256 #ifdef _XOPEN_SOURCE
10257 make an error
10258 #endif
10259   ;
10260   return 0;
10261 }
10262 _ACEOF
10263 rm -f conftest.$ac_objext
10264 if { (eval echo "$as_me:10264: \"$ac_compile\"") >&5
10265   (eval $ac_compile) 2>&5
10266   ac_status=$?
10267   echo "$as_me:10267: \$? = $ac_status" >&5
10268   (exit $ac_status); } &&
10269          { ac_try='test -s conftest.$ac_objext'
10270   { (eval echo "$as_me:10270: \"$ac_try\"") >&5
10271   (eval $ac_try) 2>&5
10272   ac_status=$?
10273   echo "$as_me:10273: \$? = $ac_status" >&5
10274   (exit $ac_status); }; }; then
10275   cf_cv_xopen_source=no
10276 else
10277   echo "$as_me: failed program was:" >&5
10278 cat conftest.$ac_ext >&5
10279 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10280 fi
10281 rm -f conftest.$ac_objext conftest.$ac_ext
10282         CPPFLAGS="$cf_save"
10283
10284 fi
10285 rm -f conftest.$ac_objext conftest.$ac_ext
10286
10287 fi
10288 echo "$as_me:10288: result: $cf_cv_xopen_source" >&5
10289 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10290
10291 if test "$cf_cv_xopen_source" != no ; then
10292
10293 CFLAGS=`echo "$CFLAGS" | \
10294         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10295                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10296
10297 CPPFLAGS=`echo "$CPPFLAGS" | \
10298         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10299                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10300
10301         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10302
10303 cf_fix_cppflags=no
10304 cf_new_cflags=
10305 cf_new_cppflags=
10306 cf_new_extra_cppflags=
10307
10308 for cf_add_cflags in $cf_temp_xopen_source
10309 do
10310 case $cf_fix_cppflags in
10311 (no)
10312         case $cf_add_cflags in
10313         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10314                 case $cf_add_cflags in
10315                 (-D*)
10316                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10317
10318                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10319                                 && test -z "${cf_tst_cflags}" \
10320                                 && cf_fix_cppflags=yes
10321
10322                         if test $cf_fix_cppflags = yes ; then
10323
10324         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10325         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10326
10327                                 continue
10328                         elif test "${cf_tst_cflags}" = "\"'" ; then
10329
10330         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10331         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10332
10333                                 continue
10334                         fi
10335                         ;;
10336                 esac
10337                 case "$CPPFLAGS" in
10338                 (*$cf_add_cflags)
10339                         ;;
10340                 (*)
10341                         case $cf_add_cflags in
10342                         (-D*)
10343                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10344
10345 CPPFLAGS=`echo "$CPPFLAGS" | \
10346         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10347                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10348
10349                                 ;;
10350                         esac
10351
10352         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10353         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10354
10355                         ;;
10356                 esac
10357                 ;;
10358         (*)
10359
10360         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10361         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10362
10363                 ;;
10364         esac
10365         ;;
10366 (yes)
10367
10368         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10369         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10370
10371         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10372
10373         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10374                 && test -z "${cf_tst_cflags}" \
10375                 && cf_fix_cppflags=no
10376         ;;
10377 esac
10378 done
10379
10380 if test -n "$cf_new_cflags" ; then
10381
10382         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10383         CFLAGS="${CFLAGS}$cf_new_cflags"
10384
10385 fi
10386
10387 if test -n "$cf_new_cppflags" ; then
10388
10389         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10390         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10391
10392 fi
10393
10394 if test -n "$cf_new_extra_cppflags" ; then
10395
10396         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10397         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10398
10399 fi
10400
10401 fi
10402
10403 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10404
10405 cf_save_CFLAGS="$CFLAGS"
10406 cf_save_CPPFLAGS="$CPPFLAGS"
10407
10408 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10409         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10410                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10411
10412 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10413         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10414                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10415
10416 echo "$as_me:10416: checking if we should define _POSIX_C_SOURCE" >&5
10417 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10418 if test "${cf_cv_posix_c_source+set}" = set; then
10419   echo $ECHO_N "(cached) $ECHO_C" >&6
10420 else
10421
10422 echo "${as_me:-configure}:10422: testing if the symbol is already defined go no further ..." 1>&5
10423
10424         cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427 #include <sys/types.h>
10428 int
10429 main ()
10430 {
10431
10432 #ifndef _POSIX_C_SOURCE
10433 make an error
10434 #endif
10435   ;
10436   return 0;
10437 }
10438 _ACEOF
10439 rm -f conftest.$ac_objext
10440 if { (eval echo "$as_me:10440: \"$ac_compile\"") >&5
10441   (eval $ac_compile) 2>&5
10442   ac_status=$?
10443   echo "$as_me:10443: \$? = $ac_status" >&5
10444   (exit $ac_status); } &&
10445          { ac_try='test -s conftest.$ac_objext'
10446   { (eval echo "$as_me:10446: \"$ac_try\"") >&5
10447   (eval $ac_try) 2>&5
10448   ac_status=$?
10449   echo "$as_me:10449: \$? = $ac_status" >&5
10450   (exit $ac_status); }; }; then
10451   cf_cv_posix_c_source=no
10452 else
10453   echo "$as_me: failed program was:" >&5
10454 cat conftest.$ac_ext >&5
10455 cf_want_posix_source=no
10456          case .$cf_POSIX_C_SOURCE in
10457          (.[12]??*)
10458                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10459                 ;;
10460          (.2)
10461                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10462                 cf_want_posix_source=yes
10463                 ;;
10464          (.*)
10465                 cf_want_posix_source=yes
10466                 ;;
10467          esac
10468          if test "$cf_want_posix_source" = yes ; then
10469                 cat >conftest.$ac_ext <<_ACEOF
10470 #line 10470 "configure"
10471 #include "confdefs.h"
10472 #include <sys/types.h>
10473 int
10474 main ()
10475 {
10476
10477 #ifdef _POSIX_SOURCE
10478 make an error
10479 #endif
10480   ;
10481   return 0;
10482 }
10483 _ACEOF
10484 rm -f conftest.$ac_objext
10485 if { (eval echo "$as_me:10485: \"$ac_compile\"") >&5
10486   (eval $ac_compile) 2>&5
10487   ac_status=$?
10488   echo "$as_me:10488: \$? = $ac_status" >&5
10489   (exit $ac_status); } &&
10490          { ac_try='test -s conftest.$ac_objext'
10491   { (eval echo "$as_me:10491: \"$ac_try\"") >&5
10492   (eval $ac_try) 2>&5
10493   ac_status=$?
10494   echo "$as_me:10494: \$? = $ac_status" >&5
10495   (exit $ac_status); }; }; then
10496   :
10497 else
10498   echo "$as_me: failed program was:" >&5
10499 cat conftest.$ac_ext >&5
10500 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10501 fi
10502 rm -f conftest.$ac_objext conftest.$ac_ext
10503          fi
10504
10505 echo "${as_me:-configure}:10505: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10506
10507          CFLAGS="$cf_trim_CFLAGS"
10508          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10509
10510 echo "${as_me:-configure}:10510: testing if the second compile does not leave our definition intact error ..." 1>&5
10511
10512          cat >conftest.$ac_ext <<_ACEOF
10513 #line 10513 "configure"
10514 #include "confdefs.h"
10515 #include <sys/types.h>
10516 int
10517 main ()
10518 {
10519
10520 #ifndef _POSIX_C_SOURCE
10521 make an error
10522 #endif
10523   ;
10524   return 0;
10525 }
10526 _ACEOF
10527 rm -f conftest.$ac_objext
10528 if { (eval echo "$as_me:10528: \"$ac_compile\"") >&5
10529   (eval $ac_compile) 2>&5
10530   ac_status=$?
10531   echo "$as_me:10531: \$? = $ac_status" >&5
10532   (exit $ac_status); } &&
10533          { ac_try='test -s conftest.$ac_objext'
10534   { (eval echo "$as_me:10534: \"$ac_try\"") >&5
10535   (eval $ac_try) 2>&5
10536   ac_status=$?
10537   echo "$as_me:10537: \$? = $ac_status" >&5
10538   (exit $ac_status); }; }; then
10539   :
10540 else
10541   echo "$as_me: failed program was:" >&5
10542 cat conftest.$ac_ext >&5
10543 cf_cv_posix_c_source=no
10544 fi
10545 rm -f conftest.$ac_objext conftest.$ac_ext
10546          CFLAGS="$cf_save_CFLAGS"
10547          CPPFLAGS="$cf_save_CPPFLAGS"
10548
10549 fi
10550 rm -f conftest.$ac_objext conftest.$ac_ext
10551
10552 fi
10553 echo "$as_me:10553: result: $cf_cv_posix_c_source" >&5
10554 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10555
10556 if test "$cf_cv_posix_c_source" != no ; then
10557         CFLAGS="$cf_trim_CFLAGS"
10558         CPPFLAGS="$cf_trim_CPPFLAGS"
10559
10560 cf_fix_cppflags=no
10561 cf_new_cflags=
10562 cf_new_cppflags=
10563 cf_new_extra_cppflags=
10564
10565 for cf_add_cflags in $cf_cv_posix_c_source
10566 do
10567 case $cf_fix_cppflags in
10568 (no)
10569         case $cf_add_cflags in
10570         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10571                 case $cf_add_cflags in
10572                 (-D*)
10573                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10574
10575                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10576                                 && test -z "${cf_tst_cflags}" \
10577                                 && cf_fix_cppflags=yes
10578
10579                         if test $cf_fix_cppflags = yes ; then
10580
10581         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10582         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10583
10584                                 continue
10585                         elif test "${cf_tst_cflags}" = "\"'" ; then
10586
10587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10589
10590                                 continue
10591                         fi
10592                         ;;
10593                 esac
10594                 case "$CPPFLAGS" in
10595                 (*$cf_add_cflags)
10596                         ;;
10597                 (*)
10598                         case $cf_add_cflags in
10599                         (-D*)
10600                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10601
10602 CPPFLAGS=`echo "$CPPFLAGS" | \
10603         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10604                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10605
10606                                 ;;
10607                         esac
10608
10609         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10610         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10611
10612                         ;;
10613                 esac
10614                 ;;
10615         (*)
10616
10617         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10618         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10619
10620                 ;;
10621         esac
10622         ;;
10623 (yes)
10624
10625         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10626         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10627
10628         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10629
10630         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10631                 && test -z "${cf_tst_cflags}" \
10632                 && cf_fix_cppflags=no
10633         ;;
10634 esac
10635 done
10636
10637 if test -n "$cf_new_cflags" ; then
10638
10639         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10640         CFLAGS="${CFLAGS}$cf_new_cflags"
10641
10642 fi
10643
10644 if test -n "$cf_new_cppflags" ; then
10645
10646         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10647         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10648
10649 fi
10650
10651 if test -n "$cf_new_extra_cppflags" ; then
10652
10653         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10654         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10655
10656 fi
10657
10658 fi
10659
10660         ;;
10661 esac
10662
10663 if test -n "$cf_xopen_source" ; then
10664
10665 cf_fix_cppflags=no
10666 cf_new_cflags=
10667 cf_new_cppflags=
10668 cf_new_extra_cppflags=
10669
10670 for cf_add_cflags in $cf_xopen_source
10671 do
10672 case $cf_fix_cppflags in
10673 (no)
10674         case $cf_add_cflags in
10675         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10676                 case $cf_add_cflags in
10677                 (-D*)
10678                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10679
10680                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10681                                 && test -z "${cf_tst_cflags}" \
10682                                 && cf_fix_cppflags=yes
10683
10684                         if test $cf_fix_cppflags = yes ; then
10685
10686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10688
10689                                 continue
10690                         elif test "${cf_tst_cflags}" = "\"'" ; then
10691
10692         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10693         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10694
10695                                 continue
10696                         fi
10697                         ;;
10698                 esac
10699                 case "$CPPFLAGS" in
10700                 (*$cf_add_cflags)
10701                         ;;
10702                 (*)
10703                         case $cf_add_cflags in
10704                         (-D*)
10705                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10706
10707 CPPFLAGS=`echo "$CPPFLAGS" | \
10708         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10709                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10710
10711                                 ;;
10712                         esac
10713
10714         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10715         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10716
10717                         ;;
10718                 esac
10719                 ;;
10720         (*)
10721
10722         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10723         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10724
10725                 ;;
10726         esac
10727         ;;
10728 (yes)
10729
10730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10732
10733         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10734
10735         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10736                 && test -z "${cf_tst_cflags}" \
10737                 && cf_fix_cppflags=no
10738         ;;
10739 esac
10740 done
10741
10742 if test -n "$cf_new_cflags" ; then
10743         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
10744
10745 echo "${as_me:-configure}:10745: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
10746
10747         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10748         CFLAGS="${CFLAGS}$cf_new_cflags"
10749
10750 fi
10751
10752 if test -n "$cf_new_cppflags" ; then
10753         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
10754
10755 echo "${as_me:-configure}:10755: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
10756
10757         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10758         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10759
10760 fi
10761
10762 if test -n "$cf_new_extra_cppflags" ; then
10763         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
10764
10765 echo "${as_me:-configure}:10765: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
10766
10767         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10768         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10769
10770 fi
10771
10772 fi
10773
10774 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
10775         echo "$as_me:10775: checking if _XOPEN_SOURCE really is set" >&5
10776 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
10777         cat >conftest.$ac_ext <<_ACEOF
10778 #line 10778 "configure"
10779 #include "confdefs.h"
10780 #include <stdlib.h>
10781 int
10782 main ()
10783 {
10784
10785 #ifndef _XOPEN_SOURCE
10786 make an error
10787 #endif
10788   ;
10789   return 0;
10790 }
10791 _ACEOF
10792 rm -f conftest.$ac_objext
10793 if { (eval echo "$as_me:10793: \"$ac_compile\"") >&5
10794   (eval $ac_compile) 2>&5
10795   ac_status=$?
10796   echo "$as_me:10796: \$? = $ac_status" >&5
10797   (exit $ac_status); } &&
10798          { ac_try='test -s conftest.$ac_objext'
10799   { (eval echo "$as_me:10799: \"$ac_try\"") >&5
10800   (eval $ac_try) 2>&5
10801   ac_status=$?
10802   echo "$as_me:10802: \$? = $ac_status" >&5
10803   (exit $ac_status); }; }; then
10804   cf_XOPEN_SOURCE_set=yes
10805 else
10806   echo "$as_me: failed program was:" >&5
10807 cat conftest.$ac_ext >&5
10808 cf_XOPEN_SOURCE_set=no
10809 fi
10810 rm -f conftest.$ac_objext conftest.$ac_ext
10811         echo "$as_me:10811: result: $cf_XOPEN_SOURCE_set" >&5
10812 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
10813         if test $cf_XOPEN_SOURCE_set = yes
10814         then
10815                 cat >conftest.$ac_ext <<_ACEOF
10816 #line 10816 "configure"
10817 #include "confdefs.h"
10818 #include <stdlib.h>
10819 int
10820 main ()
10821 {
10822
10823 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
10824 make an error
10825 #endif
10826   ;
10827   return 0;
10828 }
10829 _ACEOF
10830 rm -f conftest.$ac_objext
10831 if { (eval echo "$as_me:10831: \"$ac_compile\"") >&5
10832   (eval $ac_compile) 2>&5
10833   ac_status=$?
10834   echo "$as_me:10834: \$? = $ac_status" >&5
10835   (exit $ac_status); } &&
10836          { ac_try='test -s conftest.$ac_objext'
10837   { (eval echo "$as_me:10837: \"$ac_try\"") >&5
10838   (eval $ac_try) 2>&5
10839   ac_status=$?
10840   echo "$as_me:10840: \$? = $ac_status" >&5
10841   (exit $ac_status); }; }; then
10842   cf_XOPEN_SOURCE_set_ok=yes
10843 else
10844   echo "$as_me: failed program was:" >&5
10845 cat conftest.$ac_ext >&5
10846 cf_XOPEN_SOURCE_set_ok=no
10847 fi
10848 rm -f conftest.$ac_objext conftest.$ac_ext
10849                 if test $cf_XOPEN_SOURCE_set_ok = no
10850                 then
10851                         { echo "$as_me:10851: WARNING: _XOPEN_SOURCE is lower than requested" >&5
10852 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
10853                 fi
10854         else
10855
10856 echo "$as_me:10856: checking if we should define _XOPEN_SOURCE" >&5
10857 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10858 if test "${cf_cv_xopen_source+set}" = set; then
10859   echo $ECHO_N "(cached) $ECHO_C" >&6
10860 else
10861
10862         cat >conftest.$ac_ext <<_ACEOF
10863 #line 10863 "configure"
10864 #include "confdefs.h"
10865
10866 #include <stdlib.h>
10867 #include <string.h>
10868 #include <sys/types.h>
10869
10870 int
10871 main ()
10872 {
10873
10874 #ifndef _XOPEN_SOURCE
10875 make an error
10876 #endif
10877   ;
10878   return 0;
10879 }
10880 _ACEOF
10881 rm -f conftest.$ac_objext
10882 if { (eval echo "$as_me:10882: \"$ac_compile\"") >&5
10883   (eval $ac_compile) 2>&5
10884   ac_status=$?
10885   echo "$as_me:10885: \$? = $ac_status" >&5
10886   (exit $ac_status); } &&
10887          { ac_try='test -s conftest.$ac_objext'
10888   { (eval echo "$as_me:10888: \"$ac_try\"") >&5
10889   (eval $ac_try) 2>&5
10890   ac_status=$?
10891   echo "$as_me:10891: \$? = $ac_status" >&5
10892   (exit $ac_status); }; }; then
10893   cf_cv_xopen_source=no
10894 else
10895   echo "$as_me: failed program was:" >&5
10896 cat conftest.$ac_ext >&5
10897 cf_save="$CPPFLAGS"
10898          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10899          cat >conftest.$ac_ext <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902
10903 #include <stdlib.h>
10904 #include <string.h>
10905 #include <sys/types.h>
10906
10907 int
10908 main ()
10909 {
10910
10911 #ifdef _XOPEN_SOURCE
10912 make an error
10913 #endif
10914   ;
10915   return 0;
10916 }
10917 _ACEOF
10918 rm -f conftest.$ac_objext
10919 if { (eval echo "$as_me:10919: \"$ac_compile\"") >&5
10920   (eval $ac_compile) 2>&5
10921   ac_status=$?
10922   echo "$as_me:10922: \$? = $ac_status" >&5
10923   (exit $ac_status); } &&
10924          { ac_try='test -s conftest.$ac_objext'
10925   { (eval echo "$as_me:10925: \"$ac_try\"") >&5
10926   (eval $ac_try) 2>&5
10927   ac_status=$?
10928   echo "$as_me:10928: \$? = $ac_status" >&5
10929   (exit $ac_status); }; }; then
10930   cf_cv_xopen_source=no
10931 else
10932   echo "$as_me: failed program was:" >&5
10933 cat conftest.$ac_ext >&5
10934 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10935 fi
10936 rm -f conftest.$ac_objext conftest.$ac_ext
10937         CPPFLAGS="$cf_save"
10938
10939 fi
10940 rm -f conftest.$ac_objext conftest.$ac_ext
10941
10942 fi
10943 echo "$as_me:10943: result: $cf_cv_xopen_source" >&5
10944 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10945
10946 if test "$cf_cv_xopen_source" != no ; then
10947
10948 CFLAGS=`echo "$CFLAGS" | \
10949         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10950                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10951
10952 CPPFLAGS=`echo "$CPPFLAGS" | \
10953         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10954                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10955
10956         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10957
10958 cf_fix_cppflags=no
10959 cf_new_cflags=
10960 cf_new_cppflags=
10961 cf_new_extra_cppflags=
10962
10963 for cf_add_cflags in $cf_temp_xopen_source
10964 do
10965 case $cf_fix_cppflags in
10966 (no)
10967         case $cf_add_cflags in
10968         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10969                 case $cf_add_cflags in
10970                 (-D*)
10971                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10972
10973                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10974                                 && test -z "${cf_tst_cflags}" \
10975                                 && cf_fix_cppflags=yes
10976
10977                         if test $cf_fix_cppflags = yes ; then
10978
10979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10981
10982                                 continue
10983                         elif test "${cf_tst_cflags}" = "\"'" ; then
10984
10985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10987
10988                                 continue
10989                         fi
10990                         ;;
10991                 esac
10992                 case "$CPPFLAGS" in
10993                 (*$cf_add_cflags)
10994                         ;;
10995                 (*)
10996                         case $cf_add_cflags in
10997                         (-D*)
10998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10999
11000 CPPFLAGS=`echo "$CPPFLAGS" | \
11001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11003
11004                                 ;;
11005                         esac
11006
11007         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11008         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11009
11010                         ;;
11011                 esac
11012                 ;;
11013         (*)
11014
11015         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11016         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11017
11018                 ;;
11019         esac
11020         ;;
11021 (yes)
11022
11023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11025
11026         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11027
11028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11029                 && test -z "${cf_tst_cflags}" \
11030                 && cf_fix_cppflags=no
11031         ;;
11032 esac
11033 done
11034
11035 if test -n "$cf_new_cflags" ; then
11036
11037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11038         CFLAGS="${CFLAGS}$cf_new_cflags"
11039
11040 fi
11041
11042 if test -n "$cf_new_cppflags" ; then
11043
11044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11045         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11046
11047 fi
11048
11049 if test -n "$cf_new_extra_cppflags" ; then
11050
11051         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11052         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11053
11054 fi
11055
11056 fi
11057
11058         fi
11059 fi
11060
11061 # Check whether --enable-largefile or --disable-largefile was given.
11062 if test "${enable_largefile+set}" = set; then
11063   enableval="$enable_largefile"
11064
11065 fi;
11066 if test "$enable_largefile" != no; then
11067
11068   echo "$as_me:11068: checking for special C compiler options needed for large files" >&5
11069 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
11070 if test "${ac_cv_sys_largefile_CC+set}" = set; then
11071   echo $ECHO_N "(cached) $ECHO_C" >&6
11072 else
11073   ac_cv_sys_largefile_CC=no
11074      if test "$GCC" != yes; then
11075        ac_save_CC=$CC
11076        while :; do
11077          # IRIX 6.2 and later do not support large files by default,
11078          # so use the C compiler's -n32 option if that helps.
11079          cat >conftest.$ac_ext <<_ACEOF
11080 #line 11080 "configure"
11081 #include "confdefs.h"
11082 #include <sys/types.h>
11083  /* Check that off_t can represent 2**63 - 1 correctly.
11084     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11085     since some C++ compilers masquerading as C compilers
11086     incorrectly reject 9223372036854775807.  */
11087 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11088   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11089                        && LARGE_OFF_T % 2147483647 == 1)
11090                       ? 1 : -1];
11091 int
11092 main ()
11093 {
11094
11095   ;
11096   return 0;
11097 }
11098 _ACEOF
11099          rm -f conftest.$ac_objext
11100 if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5
11101   (eval $ac_compile) 2>&5
11102   ac_status=$?
11103   echo "$as_me:11103: \$? = $ac_status" >&5
11104   (exit $ac_status); } &&
11105          { ac_try='test -s conftest.$ac_objext'
11106   { (eval echo "$as_me:11106: \"$ac_try\"") >&5
11107   (eval $ac_try) 2>&5
11108   ac_status=$?
11109   echo "$as_me:11109: \$? = $ac_status" >&5
11110   (exit $ac_status); }; }; then
11111   break
11112 else
11113   echo "$as_me: failed program was:" >&5
11114 cat conftest.$ac_ext >&5
11115 fi
11116 rm -f conftest.$ac_objext
11117          CC="$CC -n32"
11118          rm -f conftest.$ac_objext
11119 if { (eval echo "$as_me:11119: \"$ac_compile\"") >&5
11120   (eval $ac_compile) 2>&5
11121   ac_status=$?
11122   echo "$as_me:11122: \$? = $ac_status" >&5
11123   (exit $ac_status); } &&
11124          { ac_try='test -s conftest.$ac_objext'
11125   { (eval echo "$as_me:11125: \"$ac_try\"") >&5
11126   (eval $ac_try) 2>&5
11127   ac_status=$?
11128   echo "$as_me:11128: \$? = $ac_status" >&5
11129   (exit $ac_status); }; }; then
11130   ac_cv_sys_largefile_CC=' -n32'; break
11131 else
11132   echo "$as_me: failed program was:" >&5
11133 cat conftest.$ac_ext >&5
11134 fi
11135 rm -f conftest.$ac_objext
11136          break
11137        done
11138        CC=$ac_save_CC
11139        rm -f conftest.$ac_ext
11140     fi
11141 fi
11142 echo "$as_me:11142: result: $ac_cv_sys_largefile_CC" >&5
11143 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11144   if test "$ac_cv_sys_largefile_CC" != no; then
11145     CC=$CC$ac_cv_sys_largefile_CC
11146   fi
11147
11148   echo "$as_me:11148: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11149 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11150 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11151   echo $ECHO_N "(cached) $ECHO_C" >&6
11152 else
11153   while :; do
11154   ac_cv_sys_file_offset_bits=no
11155   cat >conftest.$ac_ext <<_ACEOF
11156 #line 11156 "configure"
11157 #include "confdefs.h"
11158 #include <sys/types.h>
11159  /* Check that off_t can represent 2**63 - 1 correctly.
11160     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11161     since some C++ compilers masquerading as C compilers
11162     incorrectly reject 9223372036854775807.  */
11163 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11164   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11165                        && LARGE_OFF_T % 2147483647 == 1)
11166                       ? 1 : -1];
11167 int
11168 main ()
11169 {
11170
11171   ;
11172   return 0;
11173 }
11174 _ACEOF
11175 rm -f conftest.$ac_objext
11176 if { (eval echo "$as_me:11176: \"$ac_compile\"") >&5
11177   (eval $ac_compile) 2>&5
11178   ac_status=$?
11179   echo "$as_me:11179: \$? = $ac_status" >&5
11180   (exit $ac_status); } &&
11181          { ac_try='test -s conftest.$ac_objext'
11182   { (eval echo "$as_me:11182: \"$ac_try\"") >&5
11183   (eval $ac_try) 2>&5
11184   ac_status=$?
11185   echo "$as_me:11185: \$? = $ac_status" >&5
11186   (exit $ac_status); }; }; then
11187   break
11188 else
11189   echo "$as_me: failed program was:" >&5
11190 cat conftest.$ac_ext >&5
11191 fi
11192 rm -f conftest.$ac_objext conftest.$ac_ext
11193   cat >conftest.$ac_ext <<_ACEOF
11194 #line 11194 "configure"
11195 #include "confdefs.h"
11196 #define _FILE_OFFSET_BITS 64
11197 #include <sys/types.h>
11198  /* Check that off_t can represent 2**63 - 1 correctly.
11199     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11200     since some C++ compilers masquerading as C compilers
11201     incorrectly reject 9223372036854775807.  */
11202 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11203   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11204                        && LARGE_OFF_T % 2147483647 == 1)
11205                       ? 1 : -1];
11206 int
11207 main ()
11208 {
11209
11210   ;
11211   return 0;
11212 }
11213 _ACEOF
11214 rm -f conftest.$ac_objext
11215 if { (eval echo "$as_me:11215: \"$ac_compile\"") >&5
11216   (eval $ac_compile) 2>&5
11217   ac_status=$?
11218   echo "$as_me:11218: \$? = $ac_status" >&5
11219   (exit $ac_status); } &&
11220          { ac_try='test -s conftest.$ac_objext'
11221   { (eval echo "$as_me:11221: \"$ac_try\"") >&5
11222   (eval $ac_try) 2>&5
11223   ac_status=$?
11224   echo "$as_me:11224: \$? = $ac_status" >&5
11225   (exit $ac_status); }; }; then
11226   ac_cv_sys_file_offset_bits=64; break
11227 else
11228   echo "$as_me: failed program was:" >&5
11229 cat conftest.$ac_ext >&5
11230 fi
11231 rm -f conftest.$ac_objext conftest.$ac_ext
11232   break
11233 done
11234 fi
11235 echo "$as_me:11235: result: $ac_cv_sys_file_offset_bits" >&5
11236 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11237 if test "$ac_cv_sys_file_offset_bits" != no; then
11238
11239 cat >>confdefs.h <<EOF
11240 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11241 EOF
11242
11243 fi
11244 rm -rf conftest*
11245   echo "$as_me:11245: checking for _LARGE_FILES value needed for large files" >&5
11246 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11247 if test "${ac_cv_sys_large_files+set}" = set; then
11248   echo $ECHO_N "(cached) $ECHO_C" >&6
11249 else
11250   while :; do
11251   ac_cv_sys_large_files=no
11252   cat >conftest.$ac_ext <<_ACEOF
11253 #line 11253 "configure"
11254 #include "confdefs.h"
11255 #include <sys/types.h>
11256  /* Check that off_t can represent 2**63 - 1 correctly.
11257     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11258     since some C++ compilers masquerading as C compilers
11259     incorrectly reject 9223372036854775807.  */
11260 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11261   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11262                        && LARGE_OFF_T % 2147483647 == 1)
11263                       ? 1 : -1];
11264 int
11265 main ()
11266 {
11267
11268   ;
11269   return 0;
11270 }
11271 _ACEOF
11272 rm -f conftest.$ac_objext
11273 if { (eval echo "$as_me:11273: \"$ac_compile\"") >&5
11274   (eval $ac_compile) 2>&5
11275   ac_status=$?
11276   echo "$as_me:11276: \$? = $ac_status" >&5
11277   (exit $ac_status); } &&
11278          { ac_try='test -s conftest.$ac_objext'
11279   { (eval echo "$as_me:11279: \"$ac_try\"") >&5
11280   (eval $ac_try) 2>&5
11281   ac_status=$?
11282   echo "$as_me:11282: \$? = $ac_status" >&5
11283   (exit $ac_status); }; }; then
11284   break
11285 else
11286   echo "$as_me: failed program was:" >&5
11287 cat conftest.$ac_ext >&5
11288 fi
11289 rm -f conftest.$ac_objext conftest.$ac_ext
11290   cat >conftest.$ac_ext <<_ACEOF
11291 #line 11291 "configure"
11292 #include "confdefs.h"
11293 #define _LARGE_FILES 1
11294 #include <sys/types.h>
11295  /* Check that off_t can represent 2**63 - 1 correctly.
11296     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11297     since some C++ compilers masquerading as C compilers
11298     incorrectly reject 9223372036854775807.  */
11299 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11300   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11301                        && LARGE_OFF_T % 2147483647 == 1)
11302                       ? 1 : -1];
11303 int
11304 main ()
11305 {
11306
11307   ;
11308   return 0;
11309 }
11310 _ACEOF
11311 rm -f conftest.$ac_objext
11312 if { (eval echo "$as_me:11312: \"$ac_compile\"") >&5
11313   (eval $ac_compile) 2>&5
11314   ac_status=$?
11315   echo "$as_me:11315: \$? = $ac_status" >&5
11316   (exit $ac_status); } &&
11317          { ac_try='test -s conftest.$ac_objext'
11318   { (eval echo "$as_me:11318: \"$ac_try\"") >&5
11319   (eval $ac_try) 2>&5
11320   ac_status=$?
11321   echo "$as_me:11321: \$? = $ac_status" >&5
11322   (exit $ac_status); }; }; then
11323   ac_cv_sys_large_files=1; break
11324 else
11325   echo "$as_me: failed program was:" >&5
11326 cat conftest.$ac_ext >&5
11327 fi
11328 rm -f conftest.$ac_objext conftest.$ac_ext
11329   break
11330 done
11331 fi
11332 echo "$as_me:11332: result: $ac_cv_sys_large_files" >&5
11333 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11334 if test "$ac_cv_sys_large_files" != no; then
11335
11336 cat >>confdefs.h <<EOF
11337 #define _LARGE_FILES $ac_cv_sys_large_files
11338 EOF
11339
11340 fi
11341 rm -rf conftest*
11342 fi
11343
11344         if test "$enable_largefile" != no ; then
11345         echo "$as_me:11345: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11346 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11347 if test "${ac_cv_sys_largefile_source+set}" = set; then
11348   echo $ECHO_N "(cached) $ECHO_C" >&6
11349 else
11350   while :; do
11351   ac_cv_sys_largefile_source=no
11352   cat >conftest.$ac_ext <<_ACEOF
11353 #line 11353 "configure"
11354 #include "confdefs.h"
11355 #include <stdio.h>
11356 int
11357 main ()
11358 {
11359 return !fseeko;
11360   ;
11361   return 0;
11362 }
11363 _ACEOF
11364 rm -f conftest.$ac_objext
11365 if { (eval echo "$as_me:11365: \"$ac_compile\"") >&5
11366   (eval $ac_compile) 2>&5
11367   ac_status=$?
11368   echo "$as_me:11368: \$? = $ac_status" >&5
11369   (exit $ac_status); } &&
11370          { ac_try='test -s conftest.$ac_objext'
11371   { (eval echo "$as_me:11371: \"$ac_try\"") >&5
11372   (eval $ac_try) 2>&5
11373   ac_status=$?
11374   echo "$as_me:11374: \$? = $ac_status" >&5
11375   (exit $ac_status); }; }; then
11376   break
11377 else
11378   echo "$as_me: failed program was:" >&5
11379 cat conftest.$ac_ext >&5
11380 fi
11381 rm -f conftest.$ac_objext conftest.$ac_ext
11382   cat >conftest.$ac_ext <<_ACEOF
11383 #line 11383 "configure"
11384 #include "confdefs.h"
11385 #define _LARGEFILE_SOURCE 1
11386 #include <stdio.h>
11387 int
11388 main ()
11389 {
11390 return !fseeko;
11391   ;
11392   return 0;
11393 }
11394 _ACEOF
11395 rm -f conftest.$ac_objext
11396 if { (eval echo "$as_me:11396: \"$ac_compile\"") >&5
11397   (eval $ac_compile) 2>&5
11398   ac_status=$?
11399   echo "$as_me:11399: \$? = $ac_status" >&5
11400   (exit $ac_status); } &&
11401          { ac_try='test -s conftest.$ac_objext'
11402   { (eval echo "$as_me:11402: \"$ac_try\"") >&5
11403   (eval $ac_try) 2>&5
11404   ac_status=$?
11405   echo "$as_me:11405: \$? = $ac_status" >&5
11406   (exit $ac_status); }; }; then
11407   ac_cv_sys_largefile_source=1; break
11408 else
11409   echo "$as_me: failed program was:" >&5
11410 cat conftest.$ac_ext >&5
11411 fi
11412 rm -f conftest.$ac_objext conftest.$ac_ext
11413   break
11414 done
11415 fi
11416 echo "$as_me:11416: result: $ac_cv_sys_largefile_source" >&5
11417 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11418 if test "$ac_cv_sys_largefile_source" != no; then
11419
11420 cat >>confdefs.h <<EOF
11421 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11422 EOF
11423
11424 fi
11425 rm -rf conftest*
11426
11427 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11428 # in glibc 2.1.3, but that breaks too many other things.
11429 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11430 echo "$as_me:11430: checking for fseeko" >&5
11431 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11432 if test "${ac_cv_func_fseeko+set}" = set; then
11433   echo $ECHO_N "(cached) $ECHO_C" >&6
11434 else
11435   cat >conftest.$ac_ext <<_ACEOF
11436 #line 11436 "configure"
11437 #include "confdefs.h"
11438 #include <stdio.h>
11439 int
11440 main ()
11441 {
11442 return fseeko && fseeko (stdin, 0, 0);
11443   ;
11444   return 0;
11445 }
11446 _ACEOF
11447 rm -f conftest.$ac_objext conftest$ac_exeext
11448 if { (eval echo "$as_me:11448: \"$ac_link\"") >&5
11449   (eval $ac_link) 2>&5
11450   ac_status=$?
11451   echo "$as_me:11451: \$? = $ac_status" >&5
11452   (exit $ac_status); } &&
11453          { ac_try='test -s conftest$ac_exeext'
11454   { (eval echo "$as_me:11454: \"$ac_try\"") >&5
11455   (eval $ac_try) 2>&5
11456   ac_status=$?
11457   echo "$as_me:11457: \$? = $ac_status" >&5
11458   (exit $ac_status); }; }; then
11459   ac_cv_func_fseeko=yes
11460 else
11461   echo "$as_me: failed program was:" >&5
11462 cat conftest.$ac_ext >&5
11463 ac_cv_func_fseeko=no
11464 fi
11465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11466 fi
11467 echo "$as_me:11467: result: $ac_cv_func_fseeko" >&5
11468 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11469 if test $ac_cv_func_fseeko = yes; then
11470
11471 cat >>confdefs.h <<\EOF
11472 #define HAVE_FSEEKO 1
11473 EOF
11474
11475 fi
11476
11477         # Normally we would collect these definitions in the config.h,
11478         # but (like _XOPEN_SOURCE), some environments rely on having these
11479         # defined before any of the system headers are included.  Another
11480         # case comes up with C++, e.g., on AIX the compiler compiles the
11481         # header files by themselves before looking at the body files it is
11482         # told to compile.  For ncurses, those header files do not include
11483         # the config.h
11484         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11485         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11486         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11487
11488         echo "$as_me:11488: checking whether to use struct dirent64" >&5
11489 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11490 if test "${cf_cv_struct_dirent64+set}" = set; then
11491   echo $ECHO_N "(cached) $ECHO_C" >&6
11492 else
11493
11494                 cat >conftest.$ac_ext <<_ACEOF
11495 #line 11495 "configure"
11496 #include "confdefs.h"
11497
11498 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
11499 #include <sys/types.h>
11500 #include <dirent.h>
11501
11502 int
11503 main ()
11504 {
11505
11506                 /* if transitional largefile support is setup, this is true */
11507                 extern struct dirent64 * readdir(DIR *);
11508                 struct dirent64 *x = readdir((DIR *)0);
11509                 struct dirent *y = readdir((DIR *)0);
11510                 int z = x - y;
11511
11512   ;
11513   return 0;
11514 }
11515 _ACEOF
11516 rm -f conftest.$ac_objext
11517 if { (eval echo "$as_me:11517: \"$ac_compile\"") >&5
11518   (eval $ac_compile) 2>&5
11519   ac_status=$?
11520   echo "$as_me:11520: \$? = $ac_status" >&5
11521   (exit $ac_status); } &&
11522          { ac_try='test -s conftest.$ac_objext'
11523   { (eval echo "$as_me:11523: \"$ac_try\"") >&5
11524   (eval $ac_try) 2>&5
11525   ac_status=$?
11526   echo "$as_me:11526: \$? = $ac_status" >&5
11527   (exit $ac_status); }; }; then
11528   cf_cv_struct_dirent64=yes
11529 else
11530   echo "$as_me: failed program was:" >&5
11531 cat conftest.$ac_ext >&5
11532 cf_cv_struct_dirent64=no
11533 fi
11534 rm -f conftest.$ac_objext conftest.$ac_ext
11535
11536 fi
11537 echo "$as_me:11537: result: $cf_cv_struct_dirent64" >&5
11538 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11539         test "$cf_cv_struct_dirent64" = yes &&
11540 cat >>confdefs.h <<\EOF
11541 #define HAVE_STRUCT_DIRENT64 1
11542 EOF
11543
11544         fi
11545
11546 ### Enable compiling-in rcs id's
11547 echo "$as_me:11547: checking if RCS identifiers should be compiled-in" >&5
11548 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11549
11550 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11551 if test "${with_rcs_ids+set}" = set; then
11552   withval="$with_rcs_ids"
11553   with_rcs_ids=$withval
11554 else
11555   with_rcs_ids=no
11556 fi;
11557 echo "$as_me:11557: result: $with_rcs_ids" >&5
11558 echo "${ECHO_T}$with_rcs_ids" >&6
11559 test "$with_rcs_ids" = yes &&
11560 cat >>confdefs.h <<\EOF
11561 #define USE_RCS_IDS 1
11562 EOF
11563
11564 ###############################################################################
11565
11566 ### Note that some functions (such as const) are normally disabled anyway.
11567 echo "$as_me:11567: checking if you want to build with function extensions" >&5
11568 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11569
11570 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11571 if test "${enable_ext_funcs+set}" = set; then
11572   enableval="$enable_ext_funcs"
11573   with_ext_funcs=$enableval
11574 else
11575   with_ext_funcs=yes
11576 fi;
11577 echo "$as_me:11577: result: $with_ext_funcs" >&5
11578 echo "${ECHO_T}$with_ext_funcs" >&6
11579 if test "$with_ext_funcs" = yes ; then
11580         NCURSES_EXT_FUNCS=1
11581
11582 cat >>confdefs.h <<\EOF
11583 #define HAVE_USE_DEFAULT_COLORS 1
11584 EOF
11585
11586 cat >>confdefs.h <<\EOF
11587 #define NCURSES_EXT_FUNCS 1
11588 EOF
11589
11590 else
11591         NCURSES_EXT_FUNCS=0
11592 fi
11593
11594 ###   use option --enable-const to turn on use of const beyond that in XSI.
11595 echo "$as_me:11595: checking for extended use of const keyword" >&5
11596 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11597
11598 # Check whether --enable-const or --disable-const was given.
11599 if test "${enable_const+set}" = set; then
11600   enableval="$enable_const"
11601   with_ext_const=$enableval
11602 else
11603   with_ext_const=no
11604 fi;
11605 echo "$as_me:11605: result: $with_ext_const" >&5
11606 echo "${ECHO_T}$with_ext_const" >&6
11607 NCURSES_CONST='/*nothing*/'
11608 if test "$with_ext_const" = yes ; then
11609         NCURSES_CONST=const
11610 fi
11611
11612 ###############################################################################
11613 # These options are relatively safe to experiment with.
11614
11615 echo "$as_me:11615: checking if you want all development code" >&5
11616 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11617
11618 # Check whether --with-develop or --without-develop was given.
11619 if test "${with_develop+set}" = set; then
11620   withval="$with_develop"
11621   with_develop=$withval
11622 else
11623   with_develop=no
11624 fi;
11625 echo "$as_me:11625: result: $with_develop" >&5
11626 echo "${ECHO_T}$with_develop" >&6
11627
11628 ###############################################################################
11629 # These are just experimental, probably should not be in a package:
11630
11631 # This is still experimental (20080329), but should ultimately be moved to
11632 # the script-block --with-normal, etc.
11633
11634 echo "$as_me:11634: checking if you want to link with the pthread library" >&5
11635 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11636
11637 # Check whether --with-pthread or --without-pthread was given.
11638 if test "${with_pthread+set}" = set; then
11639   withval="$with_pthread"
11640   with_pthread=$withval
11641 else
11642   with_pthread=no
11643 fi;
11644 echo "$as_me:11644: result: $with_pthread" >&5
11645 echo "${ECHO_T}$with_pthread" >&6
11646
11647 if test "$with_pthread" != no ; then
11648         echo "$as_me:11648: checking for pthread.h" >&5
11649 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11650 if test "${ac_cv_header_pthread_h+set}" = set; then
11651   echo $ECHO_N "(cached) $ECHO_C" >&6
11652 else
11653   cat >conftest.$ac_ext <<_ACEOF
11654 #line 11654 "configure"
11655 #include "confdefs.h"
11656 #include <pthread.h>
11657 _ACEOF
11658 if { (eval echo "$as_me:11658: \"$ac_cpp conftest.$ac_ext\"") >&5
11659   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11660   ac_status=$?
11661   egrep -v '^ *\+' conftest.er1 >conftest.err
11662   rm -f conftest.er1
11663   cat conftest.err >&5
11664   echo "$as_me:11664: \$? = $ac_status" >&5
11665   (exit $ac_status); } >/dev/null; then
11666   if test -s conftest.err; then
11667     ac_cpp_err=$ac_c_preproc_warn_flag
11668   else
11669     ac_cpp_err=
11670   fi
11671 else
11672   ac_cpp_err=yes
11673 fi
11674 if test -z "$ac_cpp_err"; then
11675   ac_cv_header_pthread_h=yes
11676 else
11677   echo "$as_me: failed program was:" >&5
11678   cat conftest.$ac_ext >&5
11679   ac_cv_header_pthread_h=no
11680 fi
11681 rm -f conftest.err conftest.$ac_ext
11682 fi
11683 echo "$as_me:11683: result: $ac_cv_header_pthread_h" >&5
11684 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11685 if test $ac_cv_header_pthread_h = yes; then
11686
11687 cat >>confdefs.h <<\EOF
11688 #define HAVE_PTHREADS_H 1
11689 EOF
11690
11691         for cf_lib_pthread in pthread c_r
11692         do
11693             echo "$as_me:11693: checking if we can link with the $cf_lib_pthread library" >&5
11694 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11695             cf_save_LIBS="$LIBS"
11696
11697 cf_add_libs="-l$cf_lib_pthread"
11698 # Filter out duplicates - this happens with badly-designed ".pc" files...
11699 for cf_add_1lib in $LIBS
11700 do
11701         for cf_add_2lib in $cf_add_libs
11702         do
11703                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11704                 then
11705                         cf_add_1lib=
11706                         break
11707                 fi
11708         done
11709         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11710 done
11711 LIBS="$cf_add_libs"
11712
11713             cat >conftest.$ac_ext <<_ACEOF
11714 #line 11714 "configure"
11715 #include "confdefs.h"
11716
11717 #include <pthread.h>
11718
11719 int
11720 main ()
11721 {
11722
11723                 int rc = pthread_create(0,0,0,0);
11724                 int r2 = pthread_mutexattr_settype(0, 0);
11725
11726   ;
11727   return 0;
11728 }
11729 _ACEOF
11730 rm -f conftest.$ac_objext conftest$ac_exeext
11731 if { (eval echo "$as_me:11731: \"$ac_link\"") >&5
11732   (eval $ac_link) 2>&5
11733   ac_status=$?
11734   echo "$as_me:11734: \$? = $ac_status" >&5
11735   (exit $ac_status); } &&
11736          { ac_try='test -s conftest$ac_exeext'
11737   { (eval echo "$as_me:11737: \"$ac_try\"") >&5
11738   (eval $ac_try) 2>&5
11739   ac_status=$?
11740   echo "$as_me:11740: \$? = $ac_status" >&5
11741   (exit $ac_status); }; }; then
11742   with_pthread=yes
11743 else
11744   echo "$as_me: failed program was:" >&5
11745 cat conftest.$ac_ext >&5
11746 with_pthread=no
11747 fi
11748 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11749             LIBS="$cf_save_LIBS"
11750             echo "$as_me:11750: result: $with_pthread" >&5
11751 echo "${ECHO_T}$with_pthread" >&6
11752             test "$with_pthread" = yes && break
11753         done
11754
11755         if test "$with_pthread" = yes ; then
11756
11757 cf_add_libs="-l$cf_lib_pthread"
11758 # Filter out duplicates - this happens with badly-designed ".pc" files...
11759 for cf_add_1lib in $LIBS
11760 do
11761         for cf_add_2lib in $cf_add_libs
11762         do
11763                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11764                 then
11765                         cf_add_1lib=
11766                         break
11767                 fi
11768         done
11769         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11770 done
11771 LIBS="$cf_add_libs"
11772
11773 cat >>confdefs.h <<\EOF
11774 #define HAVE_LIBPTHREADS 1
11775 EOF
11776
11777         else
11778             { { echo "$as_me:11778: error: Cannot link with pthread library" >&5
11779 echo "$as_me: error: Cannot link with pthread library" >&2;}
11780    { (exit 1); exit 1; }; }
11781         fi
11782
11783 fi
11784
11785 fi
11786
11787 echo "$as_me:11787: checking if you want to use weak-symbols for pthreads" >&5
11788 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
11789
11790 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
11791 if test "${enable_weak_symbols+set}" = set; then
11792   enableval="$enable_weak_symbols"
11793   use_weak_symbols=$withval
11794 else
11795   use_weak_symbols=no
11796 fi;
11797 echo "$as_me:11797: result: $use_weak_symbols" >&5
11798 echo "${ECHO_T}$use_weak_symbols" >&6
11799 if test "$use_weak_symbols" = yes ; then
11800
11801 echo "$as_me:11801: checking if $CC supports weak symbols" >&5
11802 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
11803 if test "${cf_cv_weak_symbols+set}" = set; then
11804   echo $ECHO_N "(cached) $ECHO_C" >&6
11805 else
11806
11807 cat >conftest.$ac_ext <<_ACEOF
11808 #line 11808 "configure"
11809 #include "confdefs.h"
11810
11811 #include <stdio.h>
11812 int
11813 main ()
11814 {
11815
11816 #if defined(__GNUC__)
11817 #  if defined __USE_ISOC99
11818 #    define _cat_pragma(exp)    _Pragma(#exp)
11819 #    define _weak_pragma(exp)   _cat_pragma(weak name)
11820 #  else
11821 #    define _weak_pragma(exp)
11822 #  endif
11823 #  define _declare(name)        __extension__ extern __typeof__(name) name
11824 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
11825 #endif
11826
11827 weak_symbol(fopen);
11828
11829   ;
11830   return 0;
11831 }
11832 _ACEOF
11833 rm -f conftest.$ac_objext
11834 if { (eval echo "$as_me:11834: \"$ac_compile\"") >&5
11835   (eval $ac_compile) 2>&5
11836   ac_status=$?
11837   echo "$as_me:11837: \$? = $ac_status" >&5
11838   (exit $ac_status); } &&
11839          { ac_try='test -s conftest.$ac_objext'
11840   { (eval echo "$as_me:11840: \"$ac_try\"") >&5
11841   (eval $ac_try) 2>&5
11842   ac_status=$?
11843   echo "$as_me:11843: \$? = $ac_status" >&5
11844   (exit $ac_status); }; }; then
11845   cf_cv_weak_symbols=yes
11846 else
11847   echo "$as_me: failed program was:" >&5
11848 cat conftest.$ac_ext >&5
11849 cf_cv_weak_symbols=no
11850 fi
11851 rm -f conftest.$ac_objext conftest.$ac_ext
11852
11853 fi
11854 echo "$as_me:11854: result: $cf_cv_weak_symbols" >&5
11855 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
11856
11857 else
11858         cf_cv_weak_symbols=no
11859 fi
11860
11861 if test $cf_cv_weak_symbols = yes ; then
11862
11863 cat >>confdefs.h <<\EOF
11864 #define USE_WEAK_SYMBOLS 1
11865 EOF
11866
11867 fi
11868
11869 PTHREAD=
11870 if test "$with_pthread" = "yes" ; then
11871
11872 cat >>confdefs.h <<\EOF
11873 #define USE_PTHREADS 1
11874 EOF
11875
11876         enable_reentrant=yes
11877         if test $cf_cv_weak_symbols = yes ; then
11878                 PTHREAD=-lpthread
11879         fi
11880 fi
11881
11882 # OpenSUSE is installing ncurses6, using reentrant option.
11883 echo "$as_me:11883: checking for _nc_TABSIZE" >&5
11884 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
11885 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
11886   echo $ECHO_N "(cached) $ECHO_C" >&6
11887 else
11888   cat >conftest.$ac_ext <<_ACEOF
11889 #line 11889 "configure"
11890 #include "confdefs.h"
11891 /* System header to define __stub macros and hopefully few prototypes,
11892     which can conflict with char _nc_TABSIZE (); below.  */
11893 #include <assert.h>
11894 /* Override any gcc2 internal prototype to avoid an error.  */
11895 #ifdef __cplusplus
11896 extern "C"
11897 #endif
11898 /* We use char because int might match the return type of a gcc2
11899    builtin and then its argument prototype would still apply.  */
11900 char _nc_TABSIZE ();
11901 char (*f) ();
11902
11903 int
11904 main ()
11905 {
11906 /* The GNU C library defines this for functions which it implements
11907     to always fail with ENOSYS.  Some functions are actually named
11908     something starting with __ and the normal name is an alias.  */
11909 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
11910 choke me
11911 #else
11912 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11913 #endif
11914
11915   ;
11916   return 0;
11917 }
11918 _ACEOF
11919 rm -f conftest.$ac_objext conftest$ac_exeext
11920 if { (eval echo "$as_me:11920: \"$ac_link\"") >&5
11921   (eval $ac_link) 2>&5
11922   ac_status=$?
11923   echo "$as_me:11923: \$? = $ac_status" >&5
11924   (exit $ac_status); } &&
11925          { ac_try='test -s conftest$ac_exeext'
11926   { (eval echo "$as_me:11926: \"$ac_try\"") >&5
11927   (eval $ac_try) 2>&5
11928   ac_status=$?
11929   echo "$as_me:11929: \$? = $ac_status" >&5
11930   (exit $ac_status); }; }; then
11931   ac_cv_func__nc_TABSIZE=yes
11932 else
11933   echo "$as_me: failed program was:" >&5
11934 cat conftest.$ac_ext >&5
11935 ac_cv_func__nc_TABSIZE=no
11936 fi
11937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11938 fi
11939 echo "$as_me:11939: result: $ac_cv_func__nc_TABSIZE" >&5
11940 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
11941 if test $ac_cv_func__nc_TABSIZE = yes; then
11942   assume_reentrant=yes
11943 else
11944   assume_reentrant=no
11945 fi
11946
11947 # Reentrant code has to be opaque; there's little advantage to making ncurses
11948 # opaque outside of that, so there is no --enable-opaque option.  We can use
11949 # this option without --with-pthreads, but this will be always set for
11950 # pthreads.
11951 echo "$as_me:11951: checking if you want experimental reentrant code" >&5
11952 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
11953
11954 # Check whether --enable-reentrant or --disable-reentrant was given.
11955 if test "${enable_reentrant+set}" = set; then
11956   enableval="$enable_reentrant"
11957   with_reentrant=$enableval
11958 else
11959   with_reentrant=$assume_reentrant
11960 fi;
11961 echo "$as_me:11961: result: $with_reentrant" >&5
11962 echo "${ECHO_T}$with_reentrant" >&6
11963 if test "$with_reentrant" = yes ; then
11964         cf_cv_enable_reentrant=1
11965         if test $cf_cv_weak_symbols = yes ; then
11966
11967 # remove pthread library from $LIBS
11968 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
11969
11970         elif test "$assume_reentrant" = no ; then
11971                 LIB_SUFFIX="t${LIB_SUFFIX}"
11972         fi
11973
11974 cat >>confdefs.h <<\EOF
11975 #define USE_REENTRANT 1
11976 EOF
11977
11978 else
11979         cf_cv_enable_reentrant=0
11980 fi
11981
11982 ### Allow using a different wrap-prefix
11983 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
11984         echo "$as_me:11984: checking for prefix used to wrap public variables" >&5
11985 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
11986
11987 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
11988 if test "${with_wrap_prefix+set}" = set; then
11989   withval="$with_wrap_prefix"
11990   NCURSES_WRAP_PREFIX=$withval
11991 else
11992   NCURSES_WRAP_PREFIX=_nc_
11993 fi;
11994         echo "$as_me:11994: result: $NCURSES_WRAP_PREFIX" >&5
11995 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
11996 else
11997         NCURSES_WRAP_PREFIX=_nc_
11998 fi
11999
12000 cat >>confdefs.h <<EOF
12001 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
12002 EOF
12003
12004 ###############################################################################
12005
12006 ###     use option --disable-echo to suppress full display compiling commands
12007
12008 echo "$as_me:12008: checking if you want to see long compiling messages" >&5
12009 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
12010
12011 # Check whether --enable-echo or --disable-echo was given.
12012 if test "${enable_echo+set}" = set; then
12013   enableval="$enable_echo"
12014   test "$enableval" != no && enableval=yes
12015         if test "$enableval" != "yes" ; then
12016
12017         ECHO_LT='--silent'
12018         ECHO_LD='@echo linking $@;'
12019         RULE_CC='@echo compiling $<'
12020         SHOW_CC='@echo compiling $@'
12021         ECHO_CC='@'
12022
12023         else
12024
12025         ECHO_LT=''
12026         ECHO_LD=''
12027         RULE_CC=''
12028         SHOW_CC=''
12029         ECHO_CC=''
12030
12031         fi
12032 else
12033   enableval=yes
12034
12035         ECHO_LT=''
12036         ECHO_LD=''
12037         RULE_CC=''
12038         SHOW_CC=''
12039         ECHO_CC=''
12040
12041 fi;
12042 echo "$as_me:12042: result: $enableval" >&5
12043 echo "${ECHO_T}$enableval" >&6
12044
12045 ###     use option --enable-warnings to turn on all gcc warnings
12046 echo "$as_me:12046: checking if you want to see compiler warnings" >&5
12047 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
12048
12049 # Check whether --enable-warnings or --disable-warnings was given.
12050 if test "${enable_warnings+set}" = set; then
12051   enableval="$enable_warnings"
12052   with_warnings=$enableval
12053 fi;
12054 echo "$as_me:12054: result: $with_warnings" >&5
12055 echo "${ECHO_T}$with_warnings" >&6
12056
12057 if test "x$with_warnings" = "xyes"; then
12058
12059         ADAFLAGS="$ADAFLAGS -gnatg"
12060
12061 INTEL_COMPILER=no
12062
12063 if test "$GCC" = yes ; then
12064         case $host_os in
12065         (linux*|gnu*)
12066                 echo "$as_me:12066: checking if this is really Intel C compiler" >&5
12067 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
12068                 cf_save_CFLAGS="$CFLAGS"
12069                 CFLAGS="$CFLAGS -no-gcc"
12070                 cat >conftest.$ac_ext <<_ACEOF
12071 #line 12071 "configure"
12072 #include "confdefs.h"
12073
12074 int
12075 main ()
12076 {
12077
12078 #ifdef __INTEL_COMPILER
12079 #else
12080 make an error
12081 #endif
12082
12083   ;
12084   return 0;
12085 }
12086 _ACEOF
12087 rm -f conftest.$ac_objext
12088 if { (eval echo "$as_me:12088: \"$ac_compile\"") >&5
12089   (eval $ac_compile) 2>&5
12090   ac_status=$?
12091   echo "$as_me:12091: \$? = $ac_status" >&5
12092   (exit $ac_status); } &&
12093          { ac_try='test -s conftest.$ac_objext'
12094   { (eval echo "$as_me:12094: \"$ac_try\"") >&5
12095   (eval $ac_try) 2>&5
12096   ac_status=$?
12097   echo "$as_me:12097: \$? = $ac_status" >&5
12098   (exit $ac_status); }; }; then
12099   INTEL_COMPILER=yes
12100 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
12101
12102 else
12103   echo "$as_me: failed program was:" >&5
12104 cat conftest.$ac_ext >&5
12105 fi
12106 rm -f conftest.$ac_objext conftest.$ac_ext
12107                 CFLAGS="$cf_save_CFLAGS"
12108                 echo "$as_me:12108: result: $INTEL_COMPILER" >&5
12109 echo "${ECHO_T}$INTEL_COMPILER" >&6
12110                 ;;
12111         esac
12112 fi
12113
12114 CLANG_COMPILER=no
12115
12116 if test "$GCC" = yes ; then
12117         echo "$as_me:12117: checking if this is really Clang C compiler" >&5
12118 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
12119         cf_save_CFLAGS="$CFLAGS"
12120         CFLAGS="$CFLAGS -Qunused-arguments"
12121         cat >conftest.$ac_ext <<_ACEOF
12122 #line 12122 "configure"
12123 #include "confdefs.h"
12124
12125 int
12126 main ()
12127 {
12128
12129 #ifdef __clang__
12130 #else
12131 make an error
12132 #endif
12133
12134   ;
12135   return 0;
12136 }
12137 _ACEOF
12138 rm -f conftest.$ac_objext
12139 if { (eval echo "$as_me:12139: \"$ac_compile\"") >&5
12140   (eval $ac_compile) 2>&5
12141   ac_status=$?
12142   echo "$as_me:12142: \$? = $ac_status" >&5
12143   (exit $ac_status); } &&
12144          { ac_try='test -s conftest.$ac_objext'
12145   { (eval echo "$as_me:12145: \"$ac_try\"") >&5
12146   (eval $ac_try) 2>&5
12147   ac_status=$?
12148   echo "$as_me:12148: \$? = $ac_status" >&5
12149   (exit $ac_status); }; }; then
12150   CLANG_COMPILER=yes
12151 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12152
12153 else
12154   echo "$as_me: failed program was:" >&5
12155 cat conftest.$ac_ext >&5
12156 fi
12157 rm -f conftest.$ac_objext conftest.$ac_ext
12158         CFLAGS="$cf_save_CFLAGS"
12159         echo "$as_me:12159: result: $CLANG_COMPILER" >&5
12160 echo "${ECHO_T}$CLANG_COMPILER" >&6
12161 fi
12162
12163 cat > conftest.$ac_ext <<EOF
12164 #line 12164 "${as_me:-configure}"
12165 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12166 EOF
12167
12168 if test "$INTEL_COMPILER" = yes
12169 then
12170 # The "-wdXXX" options suppress warnings:
12171 # remark #1419: external declaration in primary source file
12172 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12173 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12174 # remark #193: zero used for undefined preprocessing identifier
12175 # remark #593: variable "curs_sb_left_arrow" was set but never used
12176 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12177 # remark #869: parameter "tw" was never referenced
12178 # remark #981: operands are evaluated in unspecified order
12179 # warning #279: controlling expression is constant
12180
12181         { echo "$as_me:12181: checking for $CC warning options..." >&5
12182 echo "$as_me: checking for $CC warning options..." >&6;}
12183         cf_save_CFLAGS="$CFLAGS"
12184         EXTRA_CFLAGS="-Wall"
12185         for cf_opt in \
12186                 wd1419 \
12187                 wd1683 \
12188                 wd1684 \
12189                 wd193 \
12190                 wd593 \
12191                 wd279 \
12192                 wd810 \
12193                 wd869 \
12194                 wd981
12195         do
12196                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12197                 if { (eval echo "$as_me:12197: \"$ac_compile\"") >&5
12198   (eval $ac_compile) 2>&5
12199   ac_status=$?
12200   echo "$as_me:12200: \$? = $ac_status" >&5
12201   (exit $ac_status); }; then
12202                         test -n "$verbose" && echo "$as_me:12202: result: ... -$cf_opt" >&5
12203 echo "${ECHO_T}... -$cf_opt" >&6
12204                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12205                 fi
12206         done
12207         CFLAGS="$cf_save_CFLAGS"
12208
12209 elif test "$GCC" = yes
12210 then
12211         { echo "$as_me:12211: checking for $CC warning options..." >&5
12212 echo "$as_me: checking for $CC warning options..." >&6;}
12213         cf_save_CFLAGS="$CFLAGS"
12214         EXTRA_CFLAGS=
12215         cf_warn_CONST=""
12216         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12217         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12218         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12219         for cf_opt in W Wall \
12220                 Wbad-function-cast \
12221                 Wcast-align \
12222                 Wcast-qual \
12223                 Wdeclaration-after-statement \
12224                 Wextra \
12225                 Winline \
12226                 Wmissing-declarations \
12227                 Wmissing-prototypes \
12228                 Wnested-externs \
12229                 Wpointer-arith \
12230                 Wshadow \
12231                 Wstrict-prototypes \
12232                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12233         do
12234                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12235                 if { (eval echo "$as_me:12235: \"$ac_compile\"") >&5
12236   (eval $ac_compile) 2>&5
12237   ac_status=$?
12238   echo "$as_me:12238: \$? = $ac_status" >&5
12239   (exit $ac_status); }; then
12240                         test -n "$verbose" && echo "$as_me:12240: result: ... -$cf_opt" >&5
12241 echo "${ECHO_T}... -$cf_opt" >&6
12242                         case $cf_opt in
12243                         (Wcast-qual)
12244                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12245                                 ;;
12246                         (Winline)
12247                                 case $GCC_VERSION in
12248                                 ([34].*)
12249                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12250
12251 echo "${as_me:-configure}:12251: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12252
12253                                         continue;;
12254                                 esac
12255                                 ;;
12256                         (Wpointer-arith)
12257                                 case $GCC_VERSION in
12258                                 ([12].*)
12259                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12260
12261 echo "${as_me:-configure}:12261: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12262
12263                                         continue;;
12264                                 esac
12265                                 ;;
12266                         esac
12267                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12268                 fi
12269         done
12270         CFLAGS="$cf_save_CFLAGS"
12271 fi
12272 rm -rf conftest*
12273
12274 fi
12275
12276 if test "$GCC" = yes
12277 then
12278 cat > conftest.i <<EOF
12279 #ifndef GCC_PRINTF
12280 #define GCC_PRINTF 0
12281 #endif
12282 #ifndef GCC_SCANF
12283 #define GCC_SCANF 0
12284 #endif
12285 #ifndef GCC_NORETURN
12286 #define GCC_NORETURN /* nothing */
12287 #endif
12288 #ifndef GCC_UNUSED
12289 #define GCC_UNUSED /* nothing */
12290 #endif
12291 EOF
12292 if test "$GCC" = yes
12293 then
12294         { echo "$as_me:12294: checking for $CC __attribute__ directives..." >&5
12295 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12296 cat > conftest.$ac_ext <<EOF
12297 #line 12297 "${as_me:-configure}"
12298 #include "confdefs.h"
12299 #include "conftest.h"
12300 #include "conftest.i"
12301 #if     GCC_PRINTF
12302 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12303 #else
12304 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12305 #endif
12306 #if     GCC_SCANF
12307 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12308 #else
12309 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12310 #endif
12311 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12312 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12313 extern void foo(void) GCC_NORETURN;
12314 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12315 EOF
12316         cf_printf_attribute=no
12317         cf_scanf_attribute=no
12318         for cf_attribute in scanf printf unused noreturn
12319         do
12320
12321 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12322
12323                 cf_directive="__attribute__(($cf_attribute))"
12324                 echo "checking for $CC $cf_directive" 1>&5
12325
12326                 case $cf_attribute in
12327                 (printf)
12328                         cf_printf_attribute=yes
12329                         cat >conftest.h <<EOF
12330 #define GCC_$cf_ATTRIBUTE 1
12331 EOF
12332                         ;;
12333                 (scanf)
12334                         cf_scanf_attribute=yes
12335                         cat >conftest.h <<EOF
12336 #define GCC_$cf_ATTRIBUTE 1
12337 EOF
12338                         ;;
12339                 (*)
12340                         cat >conftest.h <<EOF
12341 #define GCC_$cf_ATTRIBUTE $cf_directive
12342 EOF
12343                         ;;
12344                 esac
12345
12346                 if { (eval echo "$as_me:12346: \"$ac_compile\"") >&5
12347   (eval $ac_compile) 2>&5
12348   ac_status=$?
12349   echo "$as_me:12349: \$? = $ac_status" >&5
12350   (exit $ac_status); }; then
12351                         test -n "$verbose" && echo "$as_me:12351: result: ... $cf_attribute" >&5
12352 echo "${ECHO_T}... $cf_attribute" >&6
12353                         cat conftest.h >>confdefs.h
12354                         case $cf_attribute in
12355                         (noreturn)
12356
12357 cat >>confdefs.h <<EOF
12358 #define GCC_NORETURN $cf_directive
12359 EOF
12360
12361                                 ;;
12362                         (printf)
12363                                 cf_value='/* nothing */'
12364                                 if test "$cf_printf_attribute" != no ; then
12365                                         cf_value='__attribute__((format(printf,fmt,var)))'
12366
12367 cat >>confdefs.h <<\EOF
12368 #define GCC_PRINTF 1
12369 EOF
12370
12371                                 fi
12372
12373 cat >>confdefs.h <<EOF
12374 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12375 EOF
12376
12377                                 ;;
12378                         (scanf)
12379                                 cf_value='/* nothing */'
12380                                 if test "$cf_scanf_attribute" != no ; then
12381                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12382
12383 cat >>confdefs.h <<\EOF
12384 #define GCC_SCANF 1
12385 EOF
12386
12387                                 fi
12388
12389 cat >>confdefs.h <<EOF
12390 #define GCC_SCANFLIKE(fmt,var) $cf_value
12391 EOF
12392
12393                                 ;;
12394                         (unused)
12395
12396 cat >>confdefs.h <<EOF
12397 #define GCC_UNUSED $cf_directive
12398 EOF
12399
12400                                 ;;
12401                         esac
12402                 fi
12403         done
12404 else
12405         fgrep define conftest.i >>confdefs.h
12406 fi
12407 rm -rf conftest*
12408 fi
12409
12410 ###     use option --enable-assertions to turn on generation of assertion code
12411 echo "$as_me:12411: checking if you want to enable runtime assertions" >&5
12412 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12413
12414 # Check whether --enable-assertions or --disable-assertions was given.
12415 if test "${enable_assertions+set}" = set; then
12416   enableval="$enable_assertions"
12417   with_assertions=$enableval
12418 else
12419   with_assertions=no
12420 fi;
12421 echo "$as_me:12421: result: $with_assertions" >&5
12422 echo "${ECHO_T}$with_assertions" >&6
12423 if test -n "$GCC"
12424 then
12425         if test "$with_assertions" = no
12426         then
12427                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12428         else
12429
12430         ADAFLAGS="$ADAFLAGS -gnata"
12431
12432         fi
12433 fi
12434
12435 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12436
12437 cat >>confdefs.h <<\EOF
12438 #define HAVE_NC_ALLOC_H 1
12439 EOF
12440
12441 ###     use option --enable-expanded to generate certain macros as functions
12442
12443 # Check whether --enable-expanded or --disable-expanded was given.
12444 if test "${enable_expanded+set}" = set; then
12445   enableval="$enable_expanded"
12446   test "$enableval" = yes &&
12447 cat >>confdefs.h <<\EOF
12448 #define NCURSES_EXPANDED 1
12449 EOF
12450
12451 fi;
12452
12453 ###     use option --disable-macros to suppress macros in favor of functions
12454
12455 # Check whether --enable-macros or --disable-macros was given.
12456 if test "${enable_macros+set}" = set; then
12457   enableval="$enable_macros"
12458   test "$enableval" = no &&
12459 cat >>confdefs.h <<\EOF
12460 #define NCURSES_NOMACROS 1
12461 EOF
12462
12463 fi;
12464
12465 # Normally we only add trace() to the debug-library.  Allow this to be
12466 # extended to all models of the ncurses library:
12467 cf_all_traces=no
12468 case "$CFLAGS $CPPFLAGS" in
12469 (*-DTRACE*)
12470         cf_all_traces=yes
12471         ;;
12472 esac
12473
12474 echo "$as_me:12474: checking whether to add trace feature to all models" >&5
12475 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12476
12477 # Check whether --with-trace or --without-trace was given.
12478 if test "${with_trace+set}" = set; then
12479   withval="$with_trace"
12480   cf_with_trace=$withval
12481 else
12482   cf_with_trace=$cf_all_traces
12483 fi;
12484 echo "$as_me:12484: result: $cf_with_trace" >&5
12485 echo "${ECHO_T}$cf_with_trace" >&6
12486
12487 if test "$cf_with_trace" = yes ; then
12488         ADA_TRACE=TRUE
12489
12490 cf_fix_cppflags=no
12491 cf_new_cflags=
12492 cf_new_cppflags=
12493 cf_new_extra_cppflags=
12494
12495 for cf_add_cflags in -DTRACE
12496 do
12497 case $cf_fix_cppflags in
12498 (no)
12499         case $cf_add_cflags in
12500         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12501                 case $cf_add_cflags in
12502                 (-D*)
12503                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12504
12505                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12506                                 && test -z "${cf_tst_cflags}" \
12507                                 && cf_fix_cppflags=yes
12508
12509                         if test $cf_fix_cppflags = yes ; then
12510
12511         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12512         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12513
12514                                 continue
12515                         elif test "${cf_tst_cflags}" = "\"'" ; then
12516
12517         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12518         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12519
12520                                 continue
12521                         fi
12522                         ;;
12523                 esac
12524                 case "$CPPFLAGS" in
12525                 (*$cf_add_cflags)
12526                         ;;
12527                 (*)
12528                         case $cf_add_cflags in
12529                         (-D*)
12530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12531
12532 CPPFLAGS=`echo "$CPPFLAGS" | \
12533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12535
12536                                 ;;
12537                         esac
12538
12539         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12540         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12541
12542                         ;;
12543                 esac
12544                 ;;
12545         (*)
12546
12547         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12548         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12549
12550                 ;;
12551         esac
12552         ;;
12553 (yes)
12554
12555         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12556         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12557
12558         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12559
12560         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12561                 && test -z "${cf_tst_cflags}" \
12562                 && cf_fix_cppflags=no
12563         ;;
12564 esac
12565 done
12566
12567 if test -n "$cf_new_cflags" ; then
12568
12569         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12570         CFLAGS="${CFLAGS}$cf_new_cflags"
12571
12572 fi
12573
12574 if test -n "$cf_new_cppflags" ; then
12575
12576         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12577         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12578
12579 fi
12580
12581 if test -n "$cf_new_extra_cppflags" ; then
12582
12583         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12584         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12585
12586 fi
12587
12588 else
12589         ADA_TRACE=FALSE
12590 fi
12591
12592 echo "$as_me:12592: checking if we want to use GNAT projects" >&5
12593 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12594
12595 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12596 if test "${enable_gnat_projects+set}" = set; then
12597   enableval="$enable_gnat_projects"
12598   test "$enableval" != no && enableval=yes
12599         if test "$enableval" != "yes" ; then
12600     enable_gnat_projects=no
12601         else
12602                 enable_gnat_projects=yes
12603         fi
12604 else
12605   enableval=yes
12606         enable_gnat_projects=yes
12607
12608 fi;
12609 echo "$as_me:12609: result: $enable_gnat_projects" >&5
12610 echo "${ECHO_T}$enable_gnat_projects" >&6
12611
12612 ###     Checks for libraries.
12613 case $cf_cv_system_name in
12614 (*mingw32*)
12615         ;;
12616 (*)
12617 echo "$as_me:12617: checking for gettimeofday" >&5
12618 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12619 if test "${ac_cv_func_gettimeofday+set}" = set; then
12620   echo $ECHO_N "(cached) $ECHO_C" >&6
12621 else
12622   cat >conftest.$ac_ext <<_ACEOF
12623 #line 12623 "configure"
12624 #include "confdefs.h"
12625 /* System header to define __stub macros and hopefully few prototypes,
12626     which can conflict with char gettimeofday (); below.  */
12627 #include <assert.h>
12628 /* Override any gcc2 internal prototype to avoid an error.  */
12629 #ifdef __cplusplus
12630 extern "C"
12631 #endif
12632 /* We use char because int might match the return type of a gcc2
12633    builtin and then its argument prototype would still apply.  */
12634 char gettimeofday ();
12635 char (*f) ();
12636
12637 int
12638 main ()
12639 {
12640 /* The GNU C library defines this for functions which it implements
12641     to always fail with ENOSYS.  Some functions are actually named
12642     something starting with __ and the normal name is an alias.  */
12643 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12644 choke me
12645 #else
12646 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12647 #endif
12648
12649   ;
12650   return 0;
12651 }
12652 _ACEOF
12653 rm -f conftest.$ac_objext conftest$ac_exeext
12654 if { (eval echo "$as_me:12654: \"$ac_link\"") >&5
12655   (eval $ac_link) 2>&5
12656   ac_status=$?
12657   echo "$as_me:12657: \$? = $ac_status" >&5
12658   (exit $ac_status); } &&
12659          { ac_try='test -s conftest$ac_exeext'
12660   { (eval echo "$as_me:12660: \"$ac_try\"") >&5
12661   (eval $ac_try) 2>&5
12662   ac_status=$?
12663   echo "$as_me:12663: \$? = $ac_status" >&5
12664   (exit $ac_status); }; }; then
12665   ac_cv_func_gettimeofday=yes
12666 else
12667   echo "$as_me: failed program was:" >&5
12668 cat conftest.$ac_ext >&5
12669 ac_cv_func_gettimeofday=no
12670 fi
12671 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12672 fi
12673 echo "$as_me:12673: result: $ac_cv_func_gettimeofday" >&5
12674 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12675 if test $ac_cv_func_gettimeofday = yes; then
12676   cat >>confdefs.h <<\EOF
12677 #define HAVE_GETTIMEOFDAY 1
12678 EOF
12679
12680 else
12681
12682 echo "$as_me:12682: checking for gettimeofday in -lbsd" >&5
12683 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12684 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12685   echo $ECHO_N "(cached) $ECHO_C" >&6
12686 else
12687   ac_check_lib_save_LIBS=$LIBS
12688 LIBS="-lbsd  $LIBS"
12689 cat >conftest.$ac_ext <<_ACEOF
12690 #line 12690 "configure"
12691 #include "confdefs.h"
12692
12693 /* Override any gcc2 internal prototype to avoid an error.  */
12694 #ifdef __cplusplus
12695 extern "C"
12696 #endif
12697 /* We use char because int might match the return type of a gcc2
12698    builtin and then its argument prototype would still apply.  */
12699 char gettimeofday ();
12700 int
12701 main ()
12702 {
12703 gettimeofday ();
12704   ;
12705   return 0;
12706 }
12707 _ACEOF
12708 rm -f conftest.$ac_objext conftest$ac_exeext
12709 if { (eval echo "$as_me:12709: \"$ac_link\"") >&5
12710   (eval $ac_link) 2>&5
12711   ac_status=$?
12712   echo "$as_me:12712: \$? = $ac_status" >&5
12713   (exit $ac_status); } &&
12714          { ac_try='test -s conftest$ac_exeext'
12715   { (eval echo "$as_me:12715: \"$ac_try\"") >&5
12716   (eval $ac_try) 2>&5
12717   ac_status=$?
12718   echo "$as_me:12718: \$? = $ac_status" >&5
12719   (exit $ac_status); }; }; then
12720   ac_cv_lib_bsd_gettimeofday=yes
12721 else
12722   echo "$as_me: failed program was:" >&5
12723 cat conftest.$ac_ext >&5
12724 ac_cv_lib_bsd_gettimeofday=no
12725 fi
12726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12727 LIBS=$ac_check_lib_save_LIBS
12728 fi
12729 echo "$as_me:12729: result: $ac_cv_lib_bsd_gettimeofday" >&5
12730 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
12731 if test $ac_cv_lib_bsd_gettimeofday = yes; then
12732
12733 cat >>confdefs.h <<\EOF
12734 #define HAVE_GETTIMEOFDAY 1
12735 EOF
12736
12737         LIBS="$LIBS -lbsd"
12738 fi
12739
12740 fi
12741         ;;
12742 esac
12743
12744 ###     Checks for header files.
12745 echo "$as_me:12745: checking for ANSI C header files" >&5
12746 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
12747 if test "${ac_cv_header_stdc+set}" = set; then
12748   echo $ECHO_N "(cached) $ECHO_C" >&6
12749 else
12750   cat >conftest.$ac_ext <<_ACEOF
12751 #line 12751 "configure"
12752 #include "confdefs.h"
12753 #include <stdlib.h>
12754 #include <stdarg.h>
12755 #include <string.h>
12756 #include <float.h>
12757
12758 _ACEOF
12759 if { (eval echo "$as_me:12759: \"$ac_cpp conftest.$ac_ext\"") >&5
12760   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12761   ac_status=$?
12762   egrep -v '^ *\+' conftest.er1 >conftest.err
12763   rm -f conftest.er1
12764   cat conftest.err >&5
12765   echo "$as_me:12765: \$? = $ac_status" >&5
12766   (exit $ac_status); } >/dev/null; then
12767   if test -s conftest.err; then
12768     ac_cpp_err=$ac_c_preproc_warn_flag
12769   else
12770     ac_cpp_err=
12771   fi
12772 else
12773   ac_cpp_err=yes
12774 fi
12775 if test -z "$ac_cpp_err"; then
12776   ac_cv_header_stdc=yes
12777 else
12778   echo "$as_me: failed program was:" >&5
12779   cat conftest.$ac_ext >&5
12780   ac_cv_header_stdc=no
12781 fi
12782 rm -f conftest.err conftest.$ac_ext
12783
12784 if test $ac_cv_header_stdc = yes; then
12785   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
12786   cat >conftest.$ac_ext <<_ACEOF
12787 #line 12787 "configure"
12788 #include "confdefs.h"
12789 #include <string.h>
12790
12791 _ACEOF
12792 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12793   egrep "memchr" >/dev/null 2>&1; then
12794   :
12795 else
12796   ac_cv_header_stdc=no
12797 fi
12798 rm -rf conftest*
12799
12800 fi
12801
12802 if test $ac_cv_header_stdc = yes; then
12803   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
12804   cat >conftest.$ac_ext <<_ACEOF
12805 #line 12805 "configure"
12806 #include "confdefs.h"
12807 #include <stdlib.h>
12808
12809 _ACEOF
12810 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12811   egrep "free" >/dev/null 2>&1; then
12812   :
12813 else
12814   ac_cv_header_stdc=no
12815 fi
12816 rm -rf conftest*
12817
12818 fi
12819
12820 if test $ac_cv_header_stdc = yes; then
12821   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
12822   if test "$cross_compiling" = yes; then
12823   :
12824 else
12825   cat >conftest.$ac_ext <<_ACEOF
12826 #line 12826 "configure"
12827 #include "confdefs.h"
12828 #include <ctype.h>
12829 #if ((' ' & 0x0FF) == 0x020)
12830 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
12831 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
12832 #else
12833 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
12834                      || ('j' <= (c) && (c) <= 'r') \
12835                      || ('s' <= (c) && (c) <= 'z'))
12836 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
12837 #endif
12838
12839 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
12840 int
12841 main ()
12842 {
12843   int i;
12844   for (i = 0; i < 256; i++)
12845     if (XOR (islower (i), ISLOWER (i))
12846         || toupper (i) != TOUPPER (i))
12847       $ac_main_return(2);
12848   $ac_main_return (0);
12849 }
12850 _ACEOF
12851 rm -f conftest$ac_exeext
12852 if { (eval echo "$as_me:12852: \"$ac_link\"") >&5
12853   (eval $ac_link) 2>&5
12854   ac_status=$?
12855   echo "$as_me:12855: \$? = $ac_status" >&5
12856   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12857   { (eval echo "$as_me:12857: \"$ac_try\"") >&5
12858   (eval $ac_try) 2>&5
12859   ac_status=$?
12860   echo "$as_me:12860: \$? = $ac_status" >&5
12861   (exit $ac_status); }; }; then
12862   :
12863 else
12864   echo "$as_me: program exited with status $ac_status" >&5
12865 echo "$as_me: failed program was:" >&5
12866 cat conftest.$ac_ext >&5
12867 ac_cv_header_stdc=no
12868 fi
12869 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12870 fi
12871 fi
12872 fi
12873 echo "$as_me:12873: result: $ac_cv_header_stdc" >&5
12874 echo "${ECHO_T}$ac_cv_header_stdc" >&6
12875 if test $ac_cv_header_stdc = yes; then
12876
12877 cat >>confdefs.h <<\EOF
12878 #define STDC_HEADERS 1
12879 EOF
12880
12881 fi
12882
12883 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
12884
12885 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
12886                   inttypes.h stdint.h unistd.h
12887 do
12888 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
12889 echo "$as_me:12889: checking for $ac_header" >&5
12890 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
12891 if eval "test \"\${$as_ac_Header+set}\" = set"; then
12892   echo $ECHO_N "(cached) $ECHO_C" >&6
12893 else
12894   cat >conftest.$ac_ext <<_ACEOF
12895 #line 12895 "configure"
12896 #include "confdefs.h"
12897 $ac_includes_default
12898 #include <$ac_header>
12899 _ACEOF
12900 rm -f conftest.$ac_objext
12901 if { (eval echo "$as_me:12901: \"$ac_compile\"") >&5
12902   (eval $ac_compile) 2>&5
12903   ac_status=$?
12904   echo "$as_me:12904: \$? = $ac_status" >&5
12905   (exit $ac_status); } &&
12906          { ac_try='test -s conftest.$ac_objext'
12907   { (eval echo "$as_me:12907: \"$ac_try\"") >&5
12908   (eval $ac_try) 2>&5
12909   ac_status=$?
12910   echo "$as_me:12910: \$? = $ac_status" >&5
12911   (exit $ac_status); }; }; then
12912   eval "$as_ac_Header=yes"
12913 else
12914   echo "$as_me: failed program was:" >&5
12915 cat conftest.$ac_ext >&5
12916 eval "$as_ac_Header=no"
12917 fi
12918 rm -f conftest.$ac_objext conftest.$ac_ext
12919 fi
12920 echo "$as_me:12920: result: `eval echo '${'$as_ac_Header'}'`" >&5
12921 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
12922 if test `eval echo '${'$as_ac_Header'}'` = yes; then
12923   cat >>confdefs.h <<EOF
12924 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
12925 EOF
12926
12927 fi
12928 done
12929
12930 echo "$as_me:12930: checking for signed char" >&5
12931 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
12932 if test "${ac_cv_type_signed_char+set}" = set; then
12933   echo $ECHO_N "(cached) $ECHO_C" >&6
12934 else
12935   cat >conftest.$ac_ext <<_ACEOF
12936 #line 12936 "configure"
12937 #include "confdefs.h"
12938 $ac_includes_default
12939 int
12940 main ()
12941 {
12942 if ((signed char *) 0)
12943   return 0;
12944 if (sizeof (signed char))
12945   return 0;
12946   ;
12947   return 0;
12948 }
12949 _ACEOF
12950 rm -f conftest.$ac_objext
12951 if { (eval echo "$as_me:12951: \"$ac_compile\"") >&5
12952   (eval $ac_compile) 2>&5
12953   ac_status=$?
12954   echo "$as_me:12954: \$? = $ac_status" >&5
12955   (exit $ac_status); } &&
12956          { ac_try='test -s conftest.$ac_objext'
12957   { (eval echo "$as_me:12957: \"$ac_try\"") >&5
12958   (eval $ac_try) 2>&5
12959   ac_status=$?
12960   echo "$as_me:12960: \$? = $ac_status" >&5
12961   (exit $ac_status); }; }; then
12962   ac_cv_type_signed_char=yes
12963 else
12964   echo "$as_me: failed program was:" >&5
12965 cat conftest.$ac_ext >&5
12966 ac_cv_type_signed_char=no
12967 fi
12968 rm -f conftest.$ac_objext conftest.$ac_ext
12969 fi
12970 echo "$as_me:12970: result: $ac_cv_type_signed_char" >&5
12971 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
12972
12973 echo "$as_me:12973: checking size of signed char" >&5
12974 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
12975 if test "${ac_cv_sizeof_signed_char+set}" = set; then
12976   echo $ECHO_N "(cached) $ECHO_C" >&6
12977 else
12978   if test "$ac_cv_type_signed_char" = yes; then
12979   if test "$cross_compiling" = yes; then
12980   # Depending upon the size, compute the lo and hi bounds.
12981 cat >conftest.$ac_ext <<_ACEOF
12982 #line 12982 "configure"
12983 #include "confdefs.h"
12984 $ac_includes_default
12985 int
12986 main ()
12987 {
12988 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
12989   ;
12990   return 0;
12991 }
12992 _ACEOF
12993 rm -f conftest.$ac_objext
12994 if { (eval echo "$as_me:12994: \"$ac_compile\"") >&5
12995   (eval $ac_compile) 2>&5
12996   ac_status=$?
12997   echo "$as_me:12997: \$? = $ac_status" >&5
12998   (exit $ac_status); } &&
12999          { ac_try='test -s conftest.$ac_objext'
13000   { (eval echo "$as_me:13000: \"$ac_try\"") >&5
13001   (eval $ac_try) 2>&5
13002   ac_status=$?
13003   echo "$as_me:13003: \$? = $ac_status" >&5
13004   (exit $ac_status); }; }; then
13005   ac_lo=0 ac_mid=0
13006   while :; do
13007     cat >conftest.$ac_ext <<_ACEOF
13008 #line 13008 "configure"
13009 #include "confdefs.h"
13010 $ac_includes_default
13011 int
13012 main ()
13013 {
13014 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13015   ;
13016   return 0;
13017 }
13018 _ACEOF
13019 rm -f conftest.$ac_objext
13020 if { (eval echo "$as_me:13020: \"$ac_compile\"") >&5
13021   (eval $ac_compile) 2>&5
13022   ac_status=$?
13023   echo "$as_me:13023: \$? = $ac_status" >&5
13024   (exit $ac_status); } &&
13025          { ac_try='test -s conftest.$ac_objext'
13026   { (eval echo "$as_me:13026: \"$ac_try\"") >&5
13027   (eval $ac_try) 2>&5
13028   ac_status=$?
13029   echo "$as_me:13029: \$? = $ac_status" >&5
13030   (exit $ac_status); }; }; then
13031   ac_hi=$ac_mid; break
13032 else
13033   echo "$as_me: failed program was:" >&5
13034 cat conftest.$ac_ext >&5
13035 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
13036 fi
13037 rm -f conftest.$ac_objext conftest.$ac_ext
13038   done
13039 else
13040   echo "$as_me: failed program was:" >&5
13041 cat conftest.$ac_ext >&5
13042 ac_hi=-1 ac_mid=-1
13043   while :; do
13044     cat >conftest.$ac_ext <<_ACEOF
13045 #line 13045 "configure"
13046 #include "confdefs.h"
13047 $ac_includes_default
13048 int
13049 main ()
13050 {
13051 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
13052   ;
13053   return 0;
13054 }
13055 _ACEOF
13056 rm -f conftest.$ac_objext
13057 if { (eval echo "$as_me:13057: \"$ac_compile\"") >&5
13058   (eval $ac_compile) 2>&5
13059   ac_status=$?
13060   echo "$as_me:13060: \$? = $ac_status" >&5
13061   (exit $ac_status); } &&
13062          { ac_try='test -s conftest.$ac_objext'
13063   { (eval echo "$as_me:13063: \"$ac_try\"") >&5
13064   (eval $ac_try) 2>&5
13065   ac_status=$?
13066   echo "$as_me:13066: \$? = $ac_status" >&5
13067   (exit $ac_status); }; }; then
13068   ac_lo=$ac_mid; break
13069 else
13070   echo "$as_me: failed program was:" >&5
13071 cat conftest.$ac_ext >&5
13072 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
13073 fi
13074 rm -f conftest.$ac_objext conftest.$ac_ext
13075   done
13076 fi
13077 rm -f conftest.$ac_objext conftest.$ac_ext
13078 # Binary search between lo and hi bounds.
13079 while test "x$ac_lo" != "x$ac_hi"; do
13080   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
13081   cat >conftest.$ac_ext <<_ACEOF
13082 #line 13082 "configure"
13083 #include "confdefs.h"
13084 $ac_includes_default
13085 int
13086 main ()
13087 {
13088 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13089   ;
13090   return 0;
13091 }
13092 _ACEOF
13093 rm -f conftest.$ac_objext
13094 if { (eval echo "$as_me:13094: \"$ac_compile\"") >&5
13095   (eval $ac_compile) 2>&5
13096   ac_status=$?
13097   echo "$as_me:13097: \$? = $ac_status" >&5
13098   (exit $ac_status); } &&
13099          { ac_try='test -s conftest.$ac_objext'
13100   { (eval echo "$as_me:13100: \"$ac_try\"") >&5
13101   (eval $ac_try) 2>&5
13102   ac_status=$?
13103   echo "$as_me:13103: \$? = $ac_status" >&5
13104   (exit $ac_status); }; }; then
13105   ac_hi=$ac_mid
13106 else
13107   echo "$as_me: failed program was:" >&5
13108 cat conftest.$ac_ext >&5
13109 ac_lo=`expr $ac_mid + 1`
13110 fi
13111 rm -f conftest.$ac_objext conftest.$ac_ext
13112 done
13113 ac_cv_sizeof_signed_char=$ac_lo
13114 else
13115   if test "$cross_compiling" = yes; then
13116   { { echo "$as_me:13116: error: cannot run test program while cross compiling" >&5
13117 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
13118    { (exit 1); exit 1; }; }
13119 else
13120   cat >conftest.$ac_ext <<_ACEOF
13121 #line 13121 "configure"
13122 #include "confdefs.h"
13123 $ac_includes_default
13124 int
13125 main ()
13126 {
13127 FILE *f = fopen ("conftest.val", "w");
13128 if (!f)
13129   $ac_main_return (1);
13130 fprintf (f, "%d", (sizeof (signed char)));
13131 fclose (f);
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest$ac_exeext
13137 if { (eval echo "$as_me:13137: \"$ac_link\"") >&5
13138   (eval $ac_link) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13142   { (eval echo "$as_me:13142: \"$ac_try\"") >&5
13143   (eval $ac_try) 2>&5
13144   ac_status=$?
13145   echo "$as_me:13145: \$? = $ac_status" >&5
13146   (exit $ac_status); }; }; then
13147   ac_cv_sizeof_signed_char=`cat conftest.val`
13148 else
13149   echo "$as_me: program exited with status $ac_status" >&5
13150 echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 fi
13153 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13154 fi
13155 fi
13156 rm -f conftest.val
13157 else
13158   ac_cv_sizeof_signed_char=0
13159 fi
13160 fi
13161 echo "$as_me:13161: result: $ac_cv_sizeof_signed_char" >&5
13162 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13163 cat >>confdefs.h <<EOF
13164 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13165 EOF
13166
13167 echo "$as_me:13167: checking for ANSI C header files" >&5
13168 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13169 if test "${ac_cv_header_stdc+set}" = set; then
13170   echo $ECHO_N "(cached) $ECHO_C" >&6
13171 else
13172   cat >conftest.$ac_ext <<_ACEOF
13173 #line 13173 "configure"
13174 #include "confdefs.h"
13175 #include <stdlib.h>
13176 #include <stdarg.h>
13177 #include <string.h>
13178 #include <float.h>
13179
13180 _ACEOF
13181 if { (eval echo "$as_me:13181: \"$ac_cpp conftest.$ac_ext\"") >&5
13182   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13183   ac_status=$?
13184   egrep -v '^ *\+' conftest.er1 >conftest.err
13185   rm -f conftest.er1
13186   cat conftest.err >&5
13187   echo "$as_me:13187: \$? = $ac_status" >&5
13188   (exit $ac_status); } >/dev/null; then
13189   if test -s conftest.err; then
13190     ac_cpp_err=$ac_c_preproc_warn_flag
13191   else
13192     ac_cpp_err=
13193   fi
13194 else
13195   ac_cpp_err=yes
13196 fi
13197 if test -z "$ac_cpp_err"; then
13198   ac_cv_header_stdc=yes
13199 else
13200   echo "$as_me: failed program was:" >&5
13201   cat conftest.$ac_ext >&5
13202   ac_cv_header_stdc=no
13203 fi
13204 rm -f conftest.err conftest.$ac_ext
13205
13206 if test $ac_cv_header_stdc = yes; then
13207   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13208   cat >conftest.$ac_ext <<_ACEOF
13209 #line 13209 "configure"
13210 #include "confdefs.h"
13211 #include <string.h>
13212
13213 _ACEOF
13214 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13215   egrep "memchr" >/dev/null 2>&1; then
13216   :
13217 else
13218   ac_cv_header_stdc=no
13219 fi
13220 rm -rf conftest*
13221
13222 fi
13223
13224 if test $ac_cv_header_stdc = yes; then
13225   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13226   cat >conftest.$ac_ext <<_ACEOF
13227 #line 13227 "configure"
13228 #include "confdefs.h"
13229 #include <stdlib.h>
13230
13231 _ACEOF
13232 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13233   egrep "free" >/dev/null 2>&1; then
13234   :
13235 else
13236   ac_cv_header_stdc=no
13237 fi
13238 rm -rf conftest*
13239
13240 fi
13241
13242 if test $ac_cv_header_stdc = yes; then
13243   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13244   if test "$cross_compiling" = yes; then
13245   :
13246 else
13247   cat >conftest.$ac_ext <<_ACEOF
13248 #line 13248 "configure"
13249 #include "confdefs.h"
13250 #include <ctype.h>
13251 #if ((' ' & 0x0FF) == 0x020)
13252 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13253 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13254 #else
13255 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13256                      || ('j' <= (c) && (c) <= 'r') \
13257                      || ('s' <= (c) && (c) <= 'z'))
13258 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13259 #endif
13260
13261 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13262 int
13263 main ()
13264 {
13265   int i;
13266   for (i = 0; i < 256; i++)
13267     if (XOR (islower (i), ISLOWER (i))
13268         || toupper (i) != TOUPPER (i))
13269       $ac_main_return(2);
13270   $ac_main_return (0);
13271 }
13272 _ACEOF
13273 rm -f conftest$ac_exeext
13274 if { (eval echo "$as_me:13274: \"$ac_link\"") >&5
13275   (eval $ac_link) 2>&5
13276   ac_status=$?
13277   echo "$as_me:13277: \$? = $ac_status" >&5
13278   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13279   { (eval echo "$as_me:13279: \"$ac_try\"") >&5
13280   (eval $ac_try) 2>&5
13281   ac_status=$?
13282   echo "$as_me:13282: \$? = $ac_status" >&5
13283   (exit $ac_status); }; }; then
13284   :
13285 else
13286   echo "$as_me: program exited with status $ac_status" >&5
13287 echo "$as_me: failed program was:" >&5
13288 cat conftest.$ac_ext >&5
13289 ac_cv_header_stdc=no
13290 fi
13291 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13292 fi
13293 fi
13294 fi
13295 echo "$as_me:13295: result: $ac_cv_header_stdc" >&5
13296 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13297 if test $ac_cv_header_stdc = yes; then
13298
13299 cat >>confdefs.h <<\EOF
13300 #define STDC_HEADERS 1
13301 EOF
13302
13303 fi
13304
13305 ac_header_dirent=no
13306 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13307   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13308 echo "$as_me:13308: checking for $ac_hdr that defines DIR" >&5
13309 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13310 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13311   echo $ECHO_N "(cached) $ECHO_C" >&6
13312 else
13313   cat >conftest.$ac_ext <<_ACEOF
13314 #line 13314 "configure"
13315 #include "confdefs.h"
13316 #include <sys/types.h>
13317 #include <$ac_hdr>
13318
13319 int
13320 main ()
13321 {
13322 if ((DIR *) 0)
13323 return 0;
13324   ;
13325   return 0;
13326 }
13327 _ACEOF
13328 rm -f conftest.$ac_objext
13329 if { (eval echo "$as_me:13329: \"$ac_compile\"") >&5
13330   (eval $ac_compile) 2>&5
13331   ac_status=$?
13332   echo "$as_me:13332: \$? = $ac_status" >&5
13333   (exit $ac_status); } &&
13334          { ac_try='test -s conftest.$ac_objext'
13335   { (eval echo "$as_me:13335: \"$ac_try\"") >&5
13336   (eval $ac_try) 2>&5
13337   ac_status=$?
13338   echo "$as_me:13338: \$? = $ac_status" >&5
13339   (exit $ac_status); }; }; then
13340   eval "$as_ac_Header=yes"
13341 else
13342   echo "$as_me: failed program was:" >&5
13343 cat conftest.$ac_ext >&5
13344 eval "$as_ac_Header=no"
13345 fi
13346 rm -f conftest.$ac_objext conftest.$ac_ext
13347 fi
13348 echo "$as_me:13348: result: `eval echo '${'$as_ac_Header'}'`" >&5
13349 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13350 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13351   cat >>confdefs.h <<EOF
13352 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13353 EOF
13354
13355 ac_header_dirent=$ac_hdr; break
13356 fi
13357
13358 done
13359 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13360 if test $ac_header_dirent = dirent.h; then
13361   echo "$as_me:13361: checking for opendir in -ldir" >&5
13362 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13363 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13364   echo $ECHO_N "(cached) $ECHO_C" >&6
13365 else
13366   ac_check_lib_save_LIBS=$LIBS
13367 LIBS="-ldir  $LIBS"
13368 cat >conftest.$ac_ext <<_ACEOF
13369 #line 13369 "configure"
13370 #include "confdefs.h"
13371
13372 /* Override any gcc2 internal prototype to avoid an error.  */
13373 #ifdef __cplusplus
13374 extern "C"
13375 #endif
13376 /* We use char because int might match the return type of a gcc2
13377    builtin and then its argument prototype would still apply.  */
13378 char opendir ();
13379 int
13380 main ()
13381 {
13382 opendir ();
13383   ;
13384   return 0;
13385 }
13386 _ACEOF
13387 rm -f conftest.$ac_objext conftest$ac_exeext
13388 if { (eval echo "$as_me:13388: \"$ac_link\"") >&5
13389   (eval $ac_link) 2>&5
13390   ac_status=$?
13391   echo "$as_me:13391: \$? = $ac_status" >&5
13392   (exit $ac_status); } &&
13393          { ac_try='test -s conftest$ac_exeext'
13394   { (eval echo "$as_me:13394: \"$ac_try\"") >&5
13395   (eval $ac_try) 2>&5
13396   ac_status=$?
13397   echo "$as_me:13397: \$? = $ac_status" >&5
13398   (exit $ac_status); }; }; then
13399   ac_cv_lib_dir_opendir=yes
13400 else
13401   echo "$as_me: failed program was:" >&5
13402 cat conftest.$ac_ext >&5
13403 ac_cv_lib_dir_opendir=no
13404 fi
13405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13406 LIBS=$ac_check_lib_save_LIBS
13407 fi
13408 echo "$as_me:13408: result: $ac_cv_lib_dir_opendir" >&5
13409 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13410 if test $ac_cv_lib_dir_opendir = yes; then
13411   LIBS="$LIBS -ldir"
13412 fi
13413
13414 else
13415   echo "$as_me:13415: checking for opendir in -lx" >&5
13416 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13417 if test "${ac_cv_lib_x_opendir+set}" = set; then
13418   echo $ECHO_N "(cached) $ECHO_C" >&6
13419 else
13420   ac_check_lib_save_LIBS=$LIBS
13421 LIBS="-lx  $LIBS"
13422 cat >conftest.$ac_ext <<_ACEOF
13423 #line 13423 "configure"
13424 #include "confdefs.h"
13425
13426 /* Override any gcc2 internal prototype to avoid an error.  */
13427 #ifdef __cplusplus
13428 extern "C"
13429 #endif
13430 /* We use char because int might match the return type of a gcc2
13431    builtin and then its argument prototype would still apply.  */
13432 char opendir ();
13433 int
13434 main ()
13435 {
13436 opendir ();
13437   ;
13438   return 0;
13439 }
13440 _ACEOF
13441 rm -f conftest.$ac_objext conftest$ac_exeext
13442 if { (eval echo "$as_me:13442: \"$ac_link\"") >&5
13443   (eval $ac_link) 2>&5
13444   ac_status=$?
13445   echo "$as_me:13445: \$? = $ac_status" >&5
13446   (exit $ac_status); } &&
13447          { ac_try='test -s conftest$ac_exeext'
13448   { (eval echo "$as_me:13448: \"$ac_try\"") >&5
13449   (eval $ac_try) 2>&5
13450   ac_status=$?
13451   echo "$as_me:13451: \$? = $ac_status" >&5
13452   (exit $ac_status); }; }; then
13453   ac_cv_lib_x_opendir=yes
13454 else
13455   echo "$as_me: failed program was:" >&5
13456 cat conftest.$ac_ext >&5
13457 ac_cv_lib_x_opendir=no
13458 fi
13459 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13460 LIBS=$ac_check_lib_save_LIBS
13461 fi
13462 echo "$as_me:13462: result: $ac_cv_lib_x_opendir" >&5
13463 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13464 if test $ac_cv_lib_x_opendir = yes; then
13465   LIBS="$LIBS -lx"
13466 fi
13467
13468 fi
13469
13470 echo "$as_me:13470: checking whether time.h and sys/time.h may both be included" >&5
13471 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13472 if test "${ac_cv_header_time+set}" = set; then
13473   echo $ECHO_N "(cached) $ECHO_C" >&6
13474 else
13475   cat >conftest.$ac_ext <<_ACEOF
13476 #line 13476 "configure"
13477 #include "confdefs.h"
13478 #include <sys/types.h>
13479 #include <sys/time.h>
13480 #include <time.h>
13481
13482 int
13483 main ()
13484 {
13485 if ((struct tm *) 0)
13486 return 0;
13487   ;
13488   return 0;
13489 }
13490 _ACEOF
13491 rm -f conftest.$ac_objext
13492 if { (eval echo "$as_me:13492: \"$ac_compile\"") >&5
13493   (eval $ac_compile) 2>&5
13494   ac_status=$?
13495   echo "$as_me:13495: \$? = $ac_status" >&5
13496   (exit $ac_status); } &&
13497          { ac_try='test -s conftest.$ac_objext'
13498   { (eval echo "$as_me:13498: \"$ac_try\"") >&5
13499   (eval $ac_try) 2>&5
13500   ac_status=$?
13501   echo "$as_me:13501: \$? = $ac_status" >&5
13502   (exit $ac_status); }; }; then
13503   ac_cv_header_time=yes
13504 else
13505   echo "$as_me: failed program was:" >&5
13506 cat conftest.$ac_ext >&5
13507 ac_cv_header_time=no
13508 fi
13509 rm -f conftest.$ac_objext conftest.$ac_ext
13510 fi
13511 echo "$as_me:13511: result: $ac_cv_header_time" >&5
13512 echo "${ECHO_T}$ac_cv_header_time" >&6
13513 if test $ac_cv_header_time = yes; then
13514
13515 cat >>confdefs.h <<\EOF
13516 #define TIME_WITH_SYS_TIME 1
13517 EOF
13518
13519 fi
13520
13521 ###     checks for compiler characteristics
13522 ac_ext=c
13523 ac_cpp='$CPP $CPPFLAGS'
13524 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13525 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13526 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13527 ac_main_return=return
13528
13529 echo "$as_me:13529: checking for an ANSI C-conforming const" >&5
13530 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13531 if test "${ac_cv_c_const+set}" = set; then
13532   echo $ECHO_N "(cached) $ECHO_C" >&6
13533 else
13534   cat >conftest.$ac_ext <<_ACEOF
13535 #line 13535 "configure"
13536 #include "confdefs.h"
13537
13538 int
13539 main ()
13540 {
13541 /* FIXME: Include the comments suggested by Paul. */
13542 #ifndef __cplusplus
13543   /* Ultrix mips cc rejects this.  */
13544   typedef int charset[2];
13545   const charset x;
13546   /* SunOS 4.1.1 cc rejects this.  */
13547   char const *const *ccp;
13548   char **p;
13549   /* NEC SVR4.0.2 mips cc rejects this.  */
13550   struct point {int x, y;};
13551   static struct point const zero = {0,0};
13552   /* AIX XL C 1.02.0.0 rejects this.
13553      It does not let you subtract one const X* pointer from another in
13554      an arm of an if-expression whose if-part is not a constant
13555      expression */
13556   const char *g = "string";
13557   ccp = &g + (g ? g-g : 0);
13558   /* HPUX 7.0 cc rejects these. */
13559   ++ccp;
13560   p = (char**) ccp;
13561   ccp = (char const *const *) p;
13562   { /* SCO 3.2v4 cc rejects this.  */
13563     char *t;
13564     char const *s = 0 ? (char *) 0 : (char const *) 0;
13565
13566     *t++ = 0;
13567   }
13568   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13569     int x[] = {25, 17};
13570     const int *foo = &x[0];
13571     ++foo;
13572   }
13573   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13574     typedef const int *iptr;
13575     iptr p = 0;
13576     ++p;
13577   }
13578   { /* AIX XL C 1.02.0.0 rejects this saying
13579        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13580     struct s { int j; const int *ap[3]; };
13581     struct s *b; b->j = 5;
13582   }
13583   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13584     const int foo = 10;
13585   }
13586 #endif
13587
13588   ;
13589   return 0;
13590 }
13591 _ACEOF
13592 rm -f conftest.$ac_objext
13593 if { (eval echo "$as_me:13593: \"$ac_compile\"") >&5
13594   (eval $ac_compile) 2>&5
13595   ac_status=$?
13596   echo "$as_me:13596: \$? = $ac_status" >&5
13597   (exit $ac_status); } &&
13598          { ac_try='test -s conftest.$ac_objext'
13599   { (eval echo "$as_me:13599: \"$ac_try\"") >&5
13600   (eval $ac_try) 2>&5
13601   ac_status=$?
13602   echo "$as_me:13602: \$? = $ac_status" >&5
13603   (exit $ac_status); }; }; then
13604   ac_cv_c_const=yes
13605 else
13606   echo "$as_me: failed program was:" >&5
13607 cat conftest.$ac_ext >&5
13608 ac_cv_c_const=no
13609 fi
13610 rm -f conftest.$ac_objext conftest.$ac_ext
13611 fi
13612 echo "$as_me:13612: result: $ac_cv_c_const" >&5
13613 echo "${ECHO_T}$ac_cv_c_const" >&6
13614 if test $ac_cv_c_const = no; then
13615
13616 cat >>confdefs.h <<\EOF
13617 #define const
13618 EOF
13619
13620 fi
13621
13622 ###     Checks for external-data
13623
13624 echo "$as_me:13624: checking if data-only library module links" >&5
13625 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13626 if test "${cf_cv_link_dataonly+set}" = set; then
13627   echo $ECHO_N "(cached) $ECHO_C" >&6
13628 else
13629
13630         rm -f conftest.a
13631         cat >conftest.$ac_ext <<EOF
13632 #line 13632 "configure"
13633 int     testdata[3] = { 123, 456, 789 };
13634 EOF
13635         if { (eval echo "$as_me:13635: \"$ac_compile\"") >&5
13636   (eval $ac_compile) 2>&5
13637   ac_status=$?
13638   echo "$as_me:13638: \$? = $ac_status" >&5
13639   (exit $ac_status); } ; then
13640                 mv conftest.o data.o && \
13641                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13642         fi
13643         rm -f conftest.$ac_ext data.o
13644         cat >conftest.$ac_ext <<EOF
13645 #line 13645 "configure"
13646 int     testfunc()
13647 {
13648 #if defined(NeXT)
13649         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13650 #else
13651         extern int testdata[3];
13652         return testdata[0] == 123
13653            &&  testdata[1] == 456
13654            &&  testdata[2] == 789;
13655 #endif
13656 }
13657 EOF
13658         if { (eval echo "$as_me:13658: \"$ac_compile\"") >&5
13659   (eval $ac_compile) 2>&5
13660   ac_status=$?
13661   echo "$as_me:13661: \$? = $ac_status" >&5
13662   (exit $ac_status); }; then
13663                 mv conftest.o func.o && \
13664                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13665         fi
13666         rm -f conftest.$ac_ext func.o
13667         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13668         cf_saveLIBS="$LIBS"
13669         LIBS="conftest.a $LIBS"
13670         if test "$cross_compiling" = yes; then
13671   cf_cv_link_dataonly=unknown
13672 else
13673   cat >conftest.$ac_ext <<_ACEOF
13674 #line 13674 "configure"
13675 #include "confdefs.h"
13676
13677         int main(void)
13678         {
13679                 extern int testfunc();
13680                 ${cf_cv_main_return:-return} (!testfunc());
13681         }
13682
13683 _ACEOF
13684 rm -f conftest$ac_exeext
13685 if { (eval echo "$as_me:13685: \"$ac_link\"") >&5
13686   (eval $ac_link) 2>&5
13687   ac_status=$?
13688   echo "$as_me:13688: \$? = $ac_status" >&5
13689   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13690   { (eval echo "$as_me:13690: \"$ac_try\"") >&5
13691   (eval $ac_try) 2>&5
13692   ac_status=$?
13693   echo "$as_me:13693: \$? = $ac_status" >&5
13694   (exit $ac_status); }; }; then
13695   cf_cv_link_dataonly=yes
13696 else
13697   echo "$as_me: program exited with status $ac_status" >&5
13698 echo "$as_me: failed program was:" >&5
13699 cat conftest.$ac_ext >&5
13700 cf_cv_link_dataonly=no
13701 fi
13702 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13703 fi
13704         LIBS="$cf_saveLIBS"
13705
13706 fi
13707
13708 echo "$as_me:13708: result: $cf_cv_link_dataonly" >&5
13709 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13710
13711 if test "$cf_cv_link_dataonly" = no ; then
13712
13713 cat >>confdefs.h <<\EOF
13714 #define BROKEN_LINKER 1
13715 EOF
13716
13717         BROKEN_LINKER=1
13718 fi
13719
13720 ###     Checks for library functions.
13721
13722 for ac_header in \
13723 unistd.h \
13724
13725 do
13726 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13727 echo "$as_me:13727: checking for $ac_header" >&5
13728 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13729 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13730   echo $ECHO_N "(cached) $ECHO_C" >&6
13731 else
13732   cat >conftest.$ac_ext <<_ACEOF
13733 #line 13733 "configure"
13734 #include "confdefs.h"
13735 #include <$ac_header>
13736 _ACEOF
13737 if { (eval echo "$as_me:13737: \"$ac_cpp conftest.$ac_ext\"") >&5
13738   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13739   ac_status=$?
13740   egrep -v '^ *\+' conftest.er1 >conftest.err
13741   rm -f conftest.er1
13742   cat conftest.err >&5
13743   echo "$as_me:13743: \$? = $ac_status" >&5
13744   (exit $ac_status); } >/dev/null; then
13745   if test -s conftest.err; then
13746     ac_cpp_err=$ac_c_preproc_warn_flag
13747   else
13748     ac_cpp_err=
13749   fi
13750 else
13751   ac_cpp_err=yes
13752 fi
13753 if test -z "$ac_cpp_err"; then
13754   eval "$as_ac_Header=yes"
13755 else
13756   echo "$as_me: failed program was:" >&5
13757   cat conftest.$ac_ext >&5
13758   eval "$as_ac_Header=no"
13759 fi
13760 rm -f conftest.err conftest.$ac_ext
13761 fi
13762 echo "$as_me:13762: result: `eval echo '${'$as_ac_Header'}'`" >&5
13763 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13764 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13765   cat >>confdefs.h <<EOF
13766 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13767 EOF
13768
13769 fi
13770 done
13771
13772 echo "$as_me:13772: checking for working mkstemp" >&5
13773 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
13774 if test "${cf_cv_func_mkstemp+set}" = set; then
13775   echo $ECHO_N "(cached) $ECHO_C" >&6
13776 else
13777
13778 rm -rf conftest*
13779 if test "$cross_compiling" = yes; then
13780   cf_cv_func_mkstemp=maybe
13781 else
13782   cat >conftest.$ac_ext <<_ACEOF
13783 #line 13783 "configure"
13784 #include "confdefs.h"
13785
13786 #include <sys/types.h>
13787 #ifdef HAVE_UNISTD_H
13788 #include <unistd.h>
13789 #endif
13790 #include <stdlib.h>
13791 #include <stdio.h>
13792 #include <string.h>
13793 #include <sys/stat.h>
13794 int main(void)
13795 {
13796         char *tmpl = "conftestXXXXXX";
13797         char name[2][80];
13798         int n;
13799         int result = 0;
13800         int fd;
13801         struct stat sb;
13802
13803         umask(077);
13804         for (n = 0; n < 2; ++n) {
13805                 strcpy(name[n], tmpl);
13806                 if ((fd = mkstemp(name[n])) >= 0) {
13807                         if (!strcmp(name[n], tmpl)
13808                          || stat(name[n], &sb) != 0
13809                          || (sb.st_mode & S_IFMT) != S_IFREG
13810                          || (sb.st_mode & 077) != 0) {
13811                                 result = 1;
13812                         }
13813                         close(fd);
13814                 }
13815         }
13816         if (result == 0
13817          && !strcmp(name[0], name[1]))
13818                 result = 1;
13819         ${cf_cv_main_return:-return}(result);
13820 }
13821
13822 _ACEOF
13823 rm -f conftest$ac_exeext
13824 if { (eval echo "$as_me:13824: \"$ac_link\"") >&5
13825   (eval $ac_link) 2>&5
13826   ac_status=$?
13827   echo "$as_me:13827: \$? = $ac_status" >&5
13828   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13829   { (eval echo "$as_me:13829: \"$ac_try\"") >&5
13830   (eval $ac_try) 2>&5
13831   ac_status=$?
13832   echo "$as_me:13832: \$? = $ac_status" >&5
13833   (exit $ac_status); }; }; then
13834   cf_cv_func_mkstemp=yes
13835
13836 else
13837   echo "$as_me: program exited with status $ac_status" >&5
13838 echo "$as_me: failed program was:" >&5
13839 cat conftest.$ac_ext >&5
13840 cf_cv_func_mkstemp=no
13841
13842 fi
13843 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13844 fi
13845
13846 fi
13847 echo "$as_me:13847: result: $cf_cv_func_mkstemp" >&5
13848 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
13849 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
13850         echo "$as_me:13850: checking for mkstemp" >&5
13851 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
13852 if test "${ac_cv_func_mkstemp+set}" = set; then
13853   echo $ECHO_N "(cached) $ECHO_C" >&6
13854 else
13855   cat >conftest.$ac_ext <<_ACEOF
13856 #line 13856 "configure"
13857 #include "confdefs.h"
13858 /* System header to define __stub macros and hopefully few prototypes,
13859     which can conflict with char mkstemp (); below.  */
13860 #include <assert.h>
13861 /* Override any gcc2 internal prototype to avoid an error.  */
13862 #ifdef __cplusplus
13863 extern "C"
13864 #endif
13865 /* We use char because int might match the return type of a gcc2
13866    builtin and then its argument prototype would still apply.  */
13867 char mkstemp ();
13868 char (*f) ();
13869
13870 int
13871 main ()
13872 {
13873 /* The GNU C library defines this for functions which it implements
13874     to always fail with ENOSYS.  Some functions are actually named
13875     something starting with __ and the normal name is an alias.  */
13876 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
13877 choke me
13878 #else
13879 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13880 #endif
13881
13882   ;
13883   return 0;
13884 }
13885 _ACEOF
13886 rm -f conftest.$ac_objext conftest$ac_exeext
13887 if { (eval echo "$as_me:13887: \"$ac_link\"") >&5
13888   (eval $ac_link) 2>&5
13889   ac_status=$?
13890   echo "$as_me:13890: \$? = $ac_status" >&5
13891   (exit $ac_status); } &&
13892          { ac_try='test -s conftest$ac_exeext'
13893   { (eval echo "$as_me:13893: \"$ac_try\"") >&5
13894   (eval $ac_try) 2>&5
13895   ac_status=$?
13896   echo "$as_me:13896: \$? = $ac_status" >&5
13897   (exit $ac_status); }; }; then
13898   ac_cv_func_mkstemp=yes
13899 else
13900   echo "$as_me: failed program was:" >&5
13901 cat conftest.$ac_ext >&5
13902 ac_cv_func_mkstemp=no
13903 fi
13904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13905 fi
13906 echo "$as_me:13906: result: $ac_cv_func_mkstemp" >&5
13907 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
13908
13909 fi
13910 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
13911
13912 cat >>confdefs.h <<\EOF
13913 #define HAVE_MKSTEMP 1
13914 EOF
13915
13916 fi
13917
13918 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
13919         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13920         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
13921 fi
13922
13923 cf_with_ada=yes
13924 if test "$cf_with_ada" != "no" ; then
13925
13926 cf_ada_make=gnatmake
13927 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
13928 set dummy $cf_ada_make; ac_word=$2
13929 echo "$as_me:13929: checking for $ac_word" >&5
13930 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13931 if test "${ac_cv_prog_gnat_exists+set}" = set; then
13932   echo $ECHO_N "(cached) $ECHO_C" >&6
13933 else
13934   if test -n "$gnat_exists"; then
13935   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
13936 else
13937   ac_save_IFS=$IFS; IFS=$ac_path_separator
13938 ac_dummy="$PATH"
13939 for ac_dir in $ac_dummy; do
13940   IFS=$ac_save_IFS
13941   test -z "$ac_dir" && ac_dir=.
13942   $as_executable_p "$ac_dir/$ac_word" || continue
13943 ac_cv_prog_gnat_exists="yes"
13944 echo "$as_me:13944: found $ac_dir/$ac_word" >&5
13945 break
13946 done
13947
13948   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
13949 fi
13950 fi
13951 gnat_exists=$ac_cv_prog_gnat_exists
13952 if test -n "$gnat_exists"; then
13953   echo "$as_me:13953: result: $gnat_exists" >&5
13954 echo "${ECHO_T}$gnat_exists" >&6
13955 else
13956   echo "$as_me:13956: result: no" >&5
13957 echo "${ECHO_T}no" >&6
13958 fi
13959
13960 if test "$ac_cv_prog_gnat_exists" = no; then
13961         cf_ada_make=
13962         cf_cv_prog_gnat_correct=no
13963 else
13964
13965 echo "$as_me:13965: checking for gnat version" >&5
13966 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
13967 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
13968         grep '[0-9].[0-9][0-9]*' |\
13969         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
13970 echo "$as_me:13970: result: $cf_gnat_version" >&5
13971 echo "${ECHO_T}$cf_gnat_version" >&6
13972
13973 case $cf_gnat_version in
13974 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
13975         cf_cv_prog_gnat_correct=yes
13976         ;;
13977 (*)
13978         { echo "$as_me:13978: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
13979 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
13980         cf_cv_prog_gnat_correct=no
13981         ;;
13982 esac
13983
13984         # Extract the first word of "m4", so it can be a program name with args.
13985 set dummy m4; ac_word=$2
13986 echo "$as_me:13986: checking for $ac_word" >&5
13987 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13988 if test "${ac_cv_prog_M4_exists+set}" = set; then
13989   echo $ECHO_N "(cached) $ECHO_C" >&6
13990 else
13991   if test -n "$M4_exists"; then
13992   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
13993 else
13994   ac_save_IFS=$IFS; IFS=$ac_path_separator
13995 ac_dummy="$PATH"
13996 for ac_dir in $ac_dummy; do
13997   IFS=$ac_save_IFS
13998   test -z "$ac_dir" && ac_dir=.
13999   $as_executable_p "$ac_dir/$ac_word" || continue
14000 ac_cv_prog_M4_exists="yes"
14001 echo "$as_me:14001: found $ac_dir/$ac_word" >&5
14002 break
14003 done
14004
14005   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
14006 fi
14007 fi
14008 M4_exists=$ac_cv_prog_M4_exists
14009 if test -n "$M4_exists"; then
14010   echo "$as_me:14010: result: $M4_exists" >&5
14011 echo "${ECHO_T}$M4_exists" >&6
14012 else
14013   echo "$as_me:14013: result: no" >&5
14014 echo "${ECHO_T}no" >&6
14015 fi
14016
14017         if test "$ac_cv_prog_M4_exists" = no; then
14018                 cf_cv_prog_gnat_correct=no
14019                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
14020         fi
14021         if test "$cf_cv_prog_gnat_correct" = yes; then
14022                 echo "$as_me:14022: checking if GNAT works" >&5
14023 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
14024
14025 rm -rf conftest* *~conftest*
14026 cat >>conftest.ads <<CF_EOF
14027 procedure conftest;
14028 CF_EOF
14029 cat >>conftest.adb <<CF_EOF
14030 with Text_IO;
14031 with GNAT.OS_Lib;
14032 procedure conftest is
14033 begin
14034    Text_IO.Put ("Hello World");
14035    Text_IO.New_Line;
14036    GNAT.OS_Lib.OS_Exit (0);
14037 end conftest;
14038 CF_EOF
14039 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14040    if ( ./conftest 1>&5 2>&1 ) ; then
14041       cf_cv_prog_gnat_correct=yes
14042    else
14043       cf_cv_prog_gnat_correct=no
14044    fi
14045 else
14046    cf_cv_prog_gnat_correct=no
14047 fi
14048 rm -rf conftest* *~conftest*
14049
14050                 echo "$as_me:14050: result: $cf_cv_prog_gnat_correct" >&5
14051 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
14052         fi
14053 fi
14054
14055         if test "$cf_cv_prog_gnat_correct" = yes; then
14056
14057         echo "$as_me:14057: checking optimization options for ADAFLAGS" >&5
14058 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
14059         case "$CFLAGS" in
14060         (*-g*)
14061
14062         ADAFLAGS="$ADAFLAGS -g"
14063
14064                 ;;
14065         esac
14066         case "$CFLAGS" in
14067         (*-O*)
14068                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
14069
14070         ADAFLAGS="$ADAFLAGS $cf_O_flag"
14071
14072                 ;;
14073         esac
14074         echo "$as_me:14074: result: $ADAFLAGS" >&5
14075 echo "${ECHO_T}$ADAFLAGS" >&6
14076
14077 echo "$as_me:14077: checking if GNATPREP supports -T option" >&5
14078 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
14079 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
14080   echo $ECHO_N "(cached) $ECHO_C" >&6
14081 else
14082
14083 cf_cv_gnatprep_opt_t=no
14084 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
14085
14086 fi
14087 echo "$as_me:14087: result: $cf_cv_gnatprep_opt_t" >&5
14088 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
14089 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
14090
14091 echo "$as_me:14091: checking if GNAT supports generics" >&5
14092 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
14093 case $cf_gnat_version in
14094 (3.[1-9]*|[4-9].*)
14095         cf_gnat_generics=yes
14096         ;;
14097 (*)
14098         cf_gnat_generics=no
14099         ;;
14100 esac
14101 echo "$as_me:14101: result: $cf_gnat_generics" >&5
14102 echo "${ECHO_T}$cf_gnat_generics" >&6
14103
14104 if test "$cf_gnat_generics" = yes
14105 then
14106         cf_compile_generics=generics
14107         cf_generic_objects="\${GENOBJS}"
14108 else
14109         cf_compile_generics=
14110         cf_generic_objects=
14111 fi
14112
14113 echo "$as_me:14113: checking if GNAT supports SIGINT" >&5
14114 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
14115 if test "${cf_cv_gnat_sigint+set}" = set; then
14116   echo $ECHO_N "(cached) $ECHO_C" >&6
14117 else
14118
14119 rm -rf conftest* *~conftest*
14120 cat >>conftest.ads <<CF_EOF
14121 with Ada.Interrupts.Names;
14122
14123 package ConfTest is
14124
14125    pragma Warnings (Off);  --  the next pragma exists since 3.11p
14126    pragma Unreserve_All_Interrupts;
14127    pragma Warnings (On);
14128
14129    protected Process is
14130       procedure Stop;
14131       function Continue return Boolean;
14132       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
14133    private
14134       Done : Boolean := False;
14135    end Process;
14136
14137 end ConfTest;
14138 CF_EOF
14139 cat >>conftest.adb <<CF_EOF
14140 package body ConfTest is
14141    protected body Process is
14142       procedure Stop is
14143       begin
14144          Done := True;
14145       end Stop;
14146       function Continue return Boolean is
14147       begin
14148          return not Done;
14149       end Continue;
14150    end Process;
14151 end ConfTest;
14152 CF_EOF
14153 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14154       cf_cv_gnat_sigint=yes
14155 else
14156    cf_cv_gnat_sigint=no
14157 fi
14158 rm -rf conftest* *~conftest*
14159
14160 fi
14161 echo "$as_me:14161: result: $cf_cv_gnat_sigint" >&5
14162 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
14163
14164 if test $cf_cv_gnat_sigint = yes ; then
14165         USE_GNAT_SIGINT=""
14166 else
14167         USE_GNAT_SIGINT="#"
14168 fi
14169
14170 cf_gnat_libraries=no
14171 cf_gnat_projects=no
14172
14173 if test "$enable_gnat_projects" != no ; then
14174 echo "$as_me:14174: checking if GNAT supports project files" >&5
14175 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
14176 case $cf_gnat_version in
14177 (3.[0-9]*)
14178         ;;
14179 (*)
14180         case $cf_cv_system_name in
14181         (cygwin*|msys*)
14182                 ;;
14183         (*)
14184                 mkdir conftest.src conftest.bin conftest.lib
14185                 cd conftest.src
14186                 rm -rf conftest* *~conftest*
14187                 cat >>library.gpr <<CF_EOF
14188 project Library is
14189   Kind := External ("LIB_KIND");
14190   for Library_Name use "ConfTest";
14191   for Object_Dir use ".";
14192   for Library_ALI_Dir use External("LIBRARY_DIR");
14193   for Library_Version use External ("SONAME");
14194   for Library_Kind use Kind;
14195   for Library_Dir use External("BUILD_DIR");
14196   Source_Dir := External ("SOURCE_DIR");
14197   for Source_Dirs use (Source_Dir);
14198 end Library;
14199 CF_EOF
14200                 cat >>confpackage.ads <<CF_EOF
14201 package ConfPackage is
14202    procedure conftest;
14203 end ConfPackage;
14204 CF_EOF
14205                 cat >>confpackage.adb <<CF_EOF
14206 with Text_IO;
14207 package body ConfPackage is
14208    procedure conftest is
14209    begin
14210       Text_IO.Put ("Hello World");
14211       Text_IO.New_Line;
14212    end conftest;
14213 end ConfPackage;
14214 CF_EOF
14215                 if ( $cf_ada_make $ADAFLAGS \
14216                                 -Plibrary.gpr \
14217                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14218                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14219                                 -XSOURCE_DIR=`pwd` \
14220                                 -XSONAME=libConfTest.so.1 \
14221                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
14222                         cf_gnat_projects=yes
14223                 fi
14224                 cd ..
14225                 if test -f conftest.lib/confpackage.ali
14226                 then
14227                         cf_gnat_libraries=yes
14228                 fi
14229                 rm -rf conftest* *~conftest*
14230                 ;;
14231         esac
14232         ;;
14233 esac
14234 echo "$as_me:14234: result: $cf_gnat_projects" >&5
14235 echo "${ECHO_T}$cf_gnat_projects" >&6
14236 fi # enable_gnat_projects
14237
14238 if test $cf_gnat_projects = yes
14239 then
14240         echo "$as_me:14240: checking if GNAT supports libraries" >&5
14241 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14242         echo "$as_me:14242: result: $cf_gnat_libraries" >&5
14243 echo "${ECHO_T}$cf_gnat_libraries" >&6
14244 fi
14245
14246 if test "$cf_gnat_projects" = yes
14247 then
14248         USE_OLD_MAKERULES="#"
14249         USE_GNAT_PROJECTS=""
14250 else
14251         USE_OLD_MAKERULES=""
14252         USE_GNAT_PROJECTS="#"
14253 fi
14254
14255 if test "$cf_gnat_libraries" = yes
14256 then
14257         USE_GNAT_LIBRARIES=""
14258 else
14259         USE_GNAT_LIBRARIES="#"
14260 fi
14261
14262 echo "$as_me:14262: checking for ada-compiler" >&5
14263 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14264
14265 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14266 if test "${with_ada_compiler+set}" = set; then
14267   withval="$with_ada_compiler"
14268   cf_ada_compiler=$withval
14269 else
14270   cf_ada_compiler=gnatmake
14271 fi;
14272
14273 echo "$as_me:14273: result: $cf_ada_compiler" >&5
14274 echo "${ECHO_T}$cf_ada_compiler" >&6
14275
14276                 cf_ada_package=terminal_interface
14277
14278 echo "$as_me:14278: checking for ada-include" >&5
14279 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14280
14281 # Check whether --with-ada-include or --without-ada-include was given.
14282 if test "${with_ada_include+set}" = set; then
14283   withval="$with_ada_include"
14284
14285 else
14286   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14287 fi; if test -n "$prefix/share/ada/adainclude" ; then
14288
14289 if test "x$prefix" != xNONE; then
14290         cf_path_syntax="$prefix"
14291 else
14292         cf_path_syntax="$ac_default_prefix"
14293 fi
14294
14295 case ".$withval" in
14296 (.\$\(*\)*|.\'*\'*)
14297         ;;
14298 (..|./*|.\\*)
14299         ;;
14300 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14301         ;;
14302 (.\${*prefix}*|.\${*dir}*)
14303         eval withval="$withval"
14304         case ".$withval" in
14305         (.NONE/*)
14306                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14307                 ;;
14308         esac
14309         ;;
14310 (.no|.NONE/*)
14311         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14312         ;;
14313 (*)
14314         { { echo "$as_me:14314: error: expected a pathname, not \"$withval\"" >&5
14315 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14316    { (exit 1); exit 1; }; }
14317         ;;
14318 esac
14319
14320 fi
14321 eval ADA_INCLUDE="$withval"
14322
14323 echo "$as_me:14323: result: $ADA_INCLUDE" >&5
14324 echo "${ECHO_T}$ADA_INCLUDE" >&6
14325
14326 echo "$as_me:14326: checking for ada-objects" >&5
14327 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14328
14329 # Check whether --with-ada-objects or --without-ada-objects was given.
14330 if test "${with_ada_objects+set}" = set; then
14331   withval="$with_ada_objects"
14332
14333 else
14334   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14335 fi; if test -n "$prefix/lib/ada/adalib" ; then
14336
14337 if test "x$prefix" != xNONE; then
14338         cf_path_syntax="$prefix"
14339 else
14340         cf_path_syntax="$ac_default_prefix"
14341 fi
14342
14343 case ".$withval" in
14344 (.\$\(*\)*|.\'*\'*)
14345         ;;
14346 (..|./*|.\\*)
14347         ;;
14348 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14349         ;;
14350 (.\${*prefix}*|.\${*dir}*)
14351         eval withval="$withval"
14352         case ".$withval" in
14353         (.NONE/*)
14354                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14355                 ;;
14356         esac
14357         ;;
14358 (.no|.NONE/*)
14359         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14360         ;;
14361 (*)
14362         { { echo "$as_me:14362: error: expected a pathname, not \"$withval\"" >&5
14363 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14364    { (exit 1); exit 1; }; }
14365         ;;
14366 esac
14367
14368 fi
14369 eval ADA_OBJECTS="$withval"
14370
14371 echo "$as_me:14371: result: $ADA_OBJECTS" >&5
14372 echo "${ECHO_T}$ADA_OBJECTS" >&6
14373
14374 echo "$as_me:14374: checking if an Ada95 shared-library should be built" >&5
14375 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14376
14377 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14378 if test "${with_ada_sharedlib+set}" = set; then
14379   withval="$with_ada_sharedlib"
14380   with_ada_sharedlib=$withval
14381 else
14382   with_ada_sharedlib=no
14383 fi;
14384 echo "$as_me:14384: result: $with_ada_sharedlib" >&5
14385 echo "${ECHO_T}$with_ada_sharedlib" >&6
14386
14387 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14388 MAKE_ADA_SHAREDLIB="#"
14389
14390 if test "x$with_ada_sharedlib" != xno
14391 then
14392         MAKE_ADA_SHAREDLIB=
14393         if test "x$with_ada_sharedlib" != xyes
14394         then
14395                 ADA_SHAREDLIB="$with_ada_sharedlib"
14396         fi
14397 fi
14398
14399         else
14400                 { { echo "$as_me:14400: error: No usable Ada compiler found" >&5
14401 echo "$as_me: error: No usable Ada compiler found" >&2;}
14402    { (exit 1); exit 1; }; }
14403         fi
14404 else
14405         { { echo "$as_me:14405: error: The Ada compiler is needed for this package" >&5
14406 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14407    { (exit 1); exit 1; }; }
14408 fi
14409
14410 ################################################################################
14411
14412 # not needed
14413 TINFO_LDFLAGS2=
14414
14415 TINFO_LIBS=
14416
14417 ### Construct the list of include-directories to be generated
14418
14419 if test "$srcdir" != "."; then
14420         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14421 fi
14422 CPPFLAGS="-I../include $CPPFLAGS"
14423 if test "$srcdir" != "."; then
14424         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14425 fi
14426 CPPFLAGS="-I. $CPPFLAGS"
14427
14428 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14429 if test "$srcdir" != "."; then
14430         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14431 fi
14432 if test "$GCC" != yes; then
14433         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14434 elif test "$includedir" != "/usr/include"; then
14435         if test "$includedir" = '${prefix}/include' ; then
14436                 if test x$prefix != x/usr ; then
14437                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14438                 fi
14439         else
14440                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14441         fi
14442 fi
14443
14444 ### Build up pieces for makefile rules
14445 echo "$as_me:14445: checking default library suffix" >&5
14446 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14447
14448         case $DFT_LWR_MODEL in
14449         (libtool) DFT_ARG_SUFFIX=''   ;;
14450         (normal)  DFT_ARG_SUFFIX=''   ;;
14451         (debug)   DFT_ARG_SUFFIX='_g' ;;
14452         (profile) DFT_ARG_SUFFIX='_p' ;;
14453         (shared)  DFT_ARG_SUFFIX=''   ;;
14454         esac
14455         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14456 echo "$as_me:14456: result: $DFT_ARG_SUFFIX" >&5
14457 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14458
14459 echo "$as_me:14459: checking default library-dependency suffix" >&5
14460 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14461
14462         case X$DFT_LWR_MODEL in
14463         (Xlibtool)
14464                 DFT_LIB_SUFFIX='.la'
14465                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14466                 ;;
14467         (Xdebug)
14468                 DFT_LIB_SUFFIX='_g.a'
14469                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14470                 ;;
14471         (Xprofile)
14472                 DFT_LIB_SUFFIX='_p.a'
14473                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14474                 ;;
14475         (Xshared)
14476                 case $cf_cv_system_name in
14477                 (aix[5-7]*)
14478                         DFT_LIB_SUFFIX='.so'
14479                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14480                         ;;
14481                 (cygwin*|msys*|mingw*)
14482                         DFT_LIB_SUFFIX='.dll'
14483                         DFT_DEP_SUFFIX='.dll.a'
14484                         ;;
14485                 (darwin*)
14486                         DFT_LIB_SUFFIX='.dylib'
14487                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14488                         ;;
14489                 (hpux*)
14490                         case $target in
14491                         (ia64*)
14492                                 DFT_LIB_SUFFIX='.so'
14493                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14494                                 ;;
14495                         (*)
14496                                 DFT_LIB_SUFFIX='.sl'
14497                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14498                                 ;;
14499                         esac
14500                         ;;
14501                 (*)
14502                         DFT_LIB_SUFFIX='.so'
14503                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14504                         ;;
14505                 esac
14506                 ;;
14507         (*)
14508                 DFT_LIB_SUFFIX='.a'
14509                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14510                 ;;
14511         esac
14512         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14513         then
14514                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14515                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14516         fi
14517 echo "$as_me:14517: result: $DFT_DEP_SUFFIX" >&5
14518 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14519
14520 echo "$as_me:14520: checking default object directory" >&5
14521 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14522
14523         case $DFT_LWR_MODEL in
14524         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14525         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14526         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14527         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14528         (shared)
14529                 case $cf_cv_system_name in
14530                 (cygwin|msys)
14531                         DFT_OBJ_SUBDIR='objects' ;;
14532                 (*)
14533                         DFT_OBJ_SUBDIR='obj_s' ;;
14534                 esac
14535         esac
14536 echo "$as_me:14536: result: $DFT_OBJ_SUBDIR" >&5
14537 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14538
14539 ### Set up low-level terminfo dependencies for makefiles.
14540
14541 if test "$DFT_LWR_MODEL" = shared ; then
14542         case $cf_cv_system_name in
14543         (cygwin*)
14544                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14545                 ;;
14546         (msys*)
14547                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14548                 ;;
14549         esac
14550 fi
14551
14552 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14553
14554 ### Construct the list of subdirectories for which we'll customize makefiles
14555 ### with the appropriate compile-rules.
14556
14557 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14558
14559 cat >>confdefs.h <<EOF
14560 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14561 EOF
14562
14563 ### Now that we're done running tests, add the compiler-warnings, if any
14564
14565 cf_fix_cppflags=no
14566 cf_new_cflags=
14567 cf_new_cppflags=
14568 cf_new_extra_cppflags=
14569
14570 for cf_add_cflags in $EXTRA_CFLAGS
14571 do
14572 case $cf_fix_cppflags in
14573 (no)
14574         case $cf_add_cflags in
14575         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14576                 case $cf_add_cflags in
14577                 (-D*)
14578                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14579
14580                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14581                                 && test -z "${cf_tst_cflags}" \
14582                                 && cf_fix_cppflags=yes
14583
14584                         if test $cf_fix_cppflags = yes ; then
14585
14586         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14587         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14588
14589                                 continue
14590                         elif test "${cf_tst_cflags}" = "\"'" ; then
14591
14592         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14593         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14594
14595                                 continue
14596                         fi
14597                         ;;
14598                 esac
14599                 case "$CPPFLAGS" in
14600                 (*$cf_add_cflags)
14601                         ;;
14602                 (*)
14603                         case $cf_add_cflags in
14604                         (-D*)
14605                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14606
14607 CPPFLAGS=`echo "$CPPFLAGS" | \
14608         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14609                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14610
14611                                 ;;
14612                         esac
14613
14614         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14615         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14616
14617                         ;;
14618                 esac
14619                 ;;
14620         (*)
14621
14622         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14623         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14624
14625                 ;;
14626         esac
14627         ;;
14628 (yes)
14629
14630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14632
14633         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14634
14635         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14636                 && test -z "${cf_tst_cflags}" \
14637                 && cf_fix_cppflags=no
14638         ;;
14639 esac
14640 done
14641
14642 if test -n "$cf_new_cflags" ; then
14643
14644         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14645         CFLAGS="${CFLAGS}$cf_new_cflags"
14646
14647 fi
14648
14649 if test -n "$cf_new_cppflags" ; then
14650
14651         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14652         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14653
14654 fi
14655
14656 if test -n "$cf_new_extra_cppflags" ; then
14657
14658         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14659         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14660
14661 fi
14662
14663 ################################################################################
14664
14665 TEST_ARG2=
14666
14667 TEST_LIBS2=
14668
14669 NCURSES_SHLIB2="sh -c"
14670
14671 ADA_SUBDIRS="include gen src doc"
14672 if test "x$cf_with_tests" != "xno" ; then
14673         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14674 fi
14675 for cf_dir in $ADA_SUBDIRS
14676 do
14677         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14678 done
14679
14680 NCURSES_TREE="#"
14681
14682 EXTERNAL_TREE=
14683
14684 # match layout used by make-tar.sh
14685 ADAHTML_DIR=../doc/ada
14686
14687 if test "x$cross_compiling" = xyes ; then
14688         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14689 else
14690         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14691 fi
14692
14693 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14694 ac_config_commands="$ac_config_commands default"
14695 cat >confcache <<\_ACEOF
14696 # This file is a shell script that caches the results of configure
14697 # tests run on this system so they can be shared between configure
14698 # scripts and configure runs, see configure's option --config-cache.
14699 # It is not useful on other systems.  If it contains results you don't
14700 # want to keep, you may remove or edit it.
14701 #
14702 # config.status only pays attention to the cache file if you give it
14703 # the --recheck option to rerun configure.
14704 #
14705 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14706 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14707 # following values.
14708
14709 _ACEOF
14710
14711 # The following way of writing the cache mishandles newlines in values,
14712 # but we know of no workaround that is simple, portable, and efficient.
14713 # So, don't put newlines in cache variables' values.
14714 # Ultrix sh set writes to stderr and can't be redirected directly,
14715 # and sets the high bit in the cache file unless we assign to the vars.
14716 {
14717   (set) 2>&1 |
14718     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14719     *ac_space=\ *)
14720       # `set' does not quote correctly, so add quotes (double-quote
14721       # substitution turns \\\\ into \\, and sed turns \\ into \).
14722       sed -n \
14723         "s/'/'\\\\''/g;
14724           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14725       ;;
14726     *)
14727       # `set' quotes correctly as required by POSIX, so do not add quotes.
14728       sed -n \
14729         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
14730       ;;
14731     esac;
14732 } |
14733   sed '
14734      t clear
14735      : clear
14736      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
14737      t end
14738      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
14739      : end' >>confcache
14740 if cmp -s $cache_file confcache; then :; else
14741   if test -w $cache_file; then
14742     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
14743     cat confcache >$cache_file
14744   else
14745     echo "not updating unwritable cache $cache_file"
14746   fi
14747 fi
14748 rm -f confcache
14749
14750 test "x$prefix" = xNONE && prefix=$ac_default_prefix
14751 # Let make expand exec_prefix.
14752 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
14753
14754 # VPATH may cause trouble with some makes, so we remove $(srcdir),
14755 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
14756 # trailing colons and then remove the whole line if VPATH becomes empty
14757 # (actually we leave an empty line to preserve line numbers).
14758 if test "x$srcdir" = x.; then
14759   ac_vpsub='/^[         ]*VPATH[        ]*=/{
14760 s/:*\$(srcdir):*/:/;
14761 s/:*\${srcdir}:*/:/;
14762 s/:*@srcdir@:*/:/;
14763 s/^\([^=]*=[    ]*\):*/\1/;
14764 s/:*$//;
14765 s/^[^=]*=[      ]*$//;
14766 }'
14767 fi
14768
14769 DEFS=-DHAVE_CONFIG_H
14770
14771 : ${CONFIG_STATUS=./config.status}
14772 ac_clean_files_save=$ac_clean_files
14773 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
14774 { echo "$as_me:14774: creating $CONFIG_STATUS" >&5
14775 echo "$as_me: creating $CONFIG_STATUS" >&6;}
14776 cat >$CONFIG_STATUS <<_ACEOF
14777 #! $SHELL
14778 # Generated automatically by configure.
14779 # Run this file to recreate the current configuration.
14780 # Compiler output produced by configure, useful for debugging
14781 # configure, is in config.log if it exists.
14782
14783 debug=false
14784 SHELL=\${CONFIG_SHELL-$SHELL}
14785 ac_cs_invocation="\$0 \$@"
14786
14787 _ACEOF
14788
14789 cat >>$CONFIG_STATUS <<\_ACEOF
14790 # Be Bourne compatible
14791 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
14792   emulate sh
14793   NULLCMD=:
14794 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
14795   set -o posix
14796 fi
14797
14798 # Name of the executable.
14799 as_me=`echo "$0" |sed 's,.*[\\/],,'`
14800
14801 if expr a : '\(a\)' >/dev/null 2>&1; then
14802   as_expr=expr
14803 else
14804   as_expr=false
14805 fi
14806
14807 rm -f conf$$ conf$$.exe conf$$.file
14808 echo >conf$$.file
14809 if ln -s conf$$.file conf$$ 2>/dev/null; then
14810   # We could just check for DJGPP; but this test a) works b) is more generic
14811   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
14812   if test -f conf$$.exe; then
14813     # Don't use ln at all; we don't have any links
14814     as_ln_s='cp -p'
14815   else
14816     as_ln_s='ln -s'
14817   fi
14818 elif ln conf$$.file conf$$ 2>/dev/null; then
14819   as_ln_s=ln
14820 else
14821   as_ln_s='cp -p'
14822 fi
14823 rm -f conf$$ conf$$.exe conf$$.file
14824
14825 as_executable_p="test -f"
14826
14827 # Support unset when possible.
14828 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
14829   as_unset=unset
14830 else
14831   as_unset=false
14832 fi
14833
14834 # NLS nuisances.
14835 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
14836 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
14837 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
14838 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
14839 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
14840 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
14841 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
14842 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
14843
14844 # IFS
14845 # We need space, tab and new line, in precisely that order.
14846 as_nl='
14847 '
14848 IFS="   $as_nl"
14849
14850 # CDPATH.
14851 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
14852
14853 exec 6>&1
14854
14855 _ACEOF
14856
14857 # Files that config.status was made for.
14858 if test -n "$ac_config_files"; then
14859   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
14860 fi
14861
14862 if test -n "$ac_config_headers"; then
14863   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
14864 fi
14865
14866 if test -n "$ac_config_links"; then
14867   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
14868 fi
14869
14870 if test -n "$ac_config_commands"; then
14871   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
14872 fi
14873
14874 cat >>$CONFIG_STATUS <<\EOF
14875
14876 ac_cs_usage="\
14877 \`$as_me' instantiates files from templates according to the
14878 current configuration.
14879
14880 Usage: $0 [OPTIONS] [FILE]...
14881
14882   -h, --help       print this help, then exit
14883   -V, --version    print version number, then exit
14884   -d, --debug      don't remove temporary files
14885       --recheck    update $as_me by reconfiguring in the same conditions
14886   --file=FILE[:TEMPLATE]
14887                    instantiate the configuration file FILE
14888   --header=FILE[:TEMPLATE]
14889                    instantiate the configuration header FILE
14890
14891 Configuration files:
14892 $config_files
14893
14894 Configuration headers:
14895 $config_headers
14896
14897 Configuration commands:
14898 $config_commands
14899
14900 Report bugs to <dickey@invisible-island.net>."
14901 EOF
14902
14903 cat >>$CONFIG_STATUS <<EOF
14904 ac_cs_version="\\
14905 config.status
14906 configured by $0, generated by GNU Autoconf 2.52.20150926,
14907   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
14908
14909 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
14910 Free Software Foundation, Inc.
14911 This config.status script is free software; the Free Software Foundation
14912 gives unlimited permission to copy, distribute and modify it."
14913 srcdir=$srcdir
14914 INSTALL="$INSTALL"
14915 EOF
14916
14917 cat >>$CONFIG_STATUS <<\EOF
14918 # If no file are specified by the user, then we need to provide default
14919 # value.  By we need to know if files were specified by the user.
14920 ac_need_defaults=:
14921 while test $# != 0
14922 do
14923   case $1 in
14924   --*=*)
14925     ac_option=`expr "x$1" : 'x\([^=]*\)='`
14926     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
14927     shift
14928     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
14929     shift
14930     ;;
14931   -*);;
14932   *) # This is not an option, so the user has probably given explicit
14933      # arguments.
14934      ac_need_defaults=false;;
14935   esac
14936
14937   case $1 in
14938   # Handling of the options.
14939 EOF
14940 cat >>$CONFIG_STATUS <<EOF
14941   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
14942     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
14943     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
14944 EOF
14945 cat >>$CONFIG_STATUS <<\EOF
14946   --version | --vers* | -V )
14947     echo "$ac_cs_version"; exit 0 ;;
14948   --he | --h)
14949     # Conflict between --help and --header
14950     { { echo "$as_me:14950: error: ambiguous option: $1
14951 Try \`$0 --help' for more information." >&5
14952 echo "$as_me: error: ambiguous option: $1
14953 Try \`$0 --help' for more information." >&2;}
14954    { (exit 1); exit 1; }; };;
14955   --help | --hel | -h )
14956     echo "$ac_cs_usage"; exit 0 ;;
14957   --debug | --d* | -d )
14958     debug=: ;;
14959   --file | --fil | --fi | --f )
14960     shift
14961     CONFIG_FILES="$CONFIG_FILES $1"
14962     ac_need_defaults=false;;
14963   --header | --heade | --head | --hea )
14964     shift
14965     CONFIG_HEADERS="$CONFIG_HEADERS $1"
14966     ac_need_defaults=false;;
14967
14968   # This is an error.
14969   -*) { { echo "$as_me:14969: error: unrecognized option: $1
14970 Try \`$0 --help' for more information." >&5
14971 echo "$as_me: error: unrecognized option: $1
14972 Try \`$0 --help' for more information." >&2;}
14973    { (exit 1); exit 1; }; } ;;
14974
14975   *) ac_config_targets="$ac_config_targets $1" ;;
14976
14977   esac
14978   shift
14979 done
14980
14981 exec 5>>config.log
14982 cat >&5 << _ACEOF
14983
14984 ## ----------------------- ##
14985 ## Running config.status.  ##
14986 ## ----------------------- ##
14987
14988 This file was extended by $as_me 2.52.20150926, executed with
14989   CONFIG_FILES    = $CONFIG_FILES
14990   CONFIG_HEADERS  = $CONFIG_HEADERS
14991   CONFIG_LINKS    = $CONFIG_LINKS
14992   CONFIG_COMMANDS = $CONFIG_COMMANDS
14993   > $ac_cs_invocation
14994 on `(hostname || uname -n) 2>/dev/null | sed 1q`
14995
14996 _ACEOF
14997 EOF
14998
14999 cat >>$CONFIG_STATUS <<EOF
15000 #
15001 # INIT-COMMANDS section.
15002 #
15003
15004 ### Special initialization commands, used to pass information from the
15005 ### configuration-run into config.status
15006
15007 AWK="$AWK"
15008 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
15009 DFT_LWR_MODEL="$DFT_LWR_MODEL"
15010 LIB_NAME="$LIB_NAME"
15011 LIB_PREFIX="$LIB_PREFIX"
15012 LIB_SUFFIX="$LIB_SUFFIX"
15013 LN_S="$LN_S"
15014 NCURSES_MAJOR="$NCURSES_MAJOR"
15015 NCURSES_MINOR="$NCURSES_MINOR"
15016 NCURSES_PATCH="$NCURSES_PATCH"
15017 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
15018 cf_cv_abi_version="$cf_cv_abi_version"
15019 cf_cv_rel_version="$cf_cv_rel_version"
15020 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
15021 cf_cv_shared_soname='$cf_cv_shared_soname'
15022 cf_cv_shlib_version="$cf_cv_shlib_version"
15023 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
15024 cf_cv_system_name="$cf_cv_system_name"
15025 host="$host"
15026 target="$target"
15027
15028 EOF
15029
15030 cat >>$CONFIG_STATUS <<\EOF
15031 for ac_config_target in $ac_config_targets
15032 do
15033   case "$ac_config_target" in
15034   # Handling of arguments.
15035   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
15036   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
15037   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15038   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15039   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
15040   *) { { echo "$as_me:15040: error: invalid argument: $ac_config_target" >&5
15041 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15042    { (exit 1); exit 1; }; };;
15043   esac
15044 done
15045
15046 # If the user did not use the arguments to specify the items to instantiate,
15047 # then the envvar interface is used.  Set only those that are not.
15048 # We use the long form for the default assignment because of an extremely
15049 # bizarre bug on SunOS 4.1.3.
15050 if $ac_need_defaults; then
15051   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15052   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15053   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15054 fi
15055
15056 # Create a temporary directory, and hook for its removal unless debugging.
15057 $debug ||
15058 {
15059   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15060   trap '{ (exit 1); exit 1; }' 1 2 13 15
15061 }
15062
15063 # Create a (secure) tmp directory for tmp files.
15064 : ${TMPDIR=/tmp}
15065 {
15066   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15067   test -n "$tmp" && test -d "$tmp"
15068 }  ||
15069 {
15070   tmp=$TMPDIR/cs$$-$RANDOM
15071   (umask 077 && mkdir $tmp)
15072 } ||
15073 {
15074    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15075    { (exit 1); exit 1; }
15076 }
15077
15078 EOF
15079
15080 cat >>$CONFIG_STATUS <<EOF
15081
15082 #
15083 # CONFIG_FILES section.
15084 #
15085
15086 # No need to generate the scripts if there are no CONFIG_FILES.
15087 # This happens for instance when ./config.status config.h
15088 if test -n "\$CONFIG_FILES"; then
15089   # Protect against being on the right side of a sed subst in config.status.
15090   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15091    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15092 s,@SHELL@,$SHELL,;t t
15093 s,@exec_prefix@,$exec_prefix,;t t
15094 s,@prefix@,$prefix,;t t
15095 s,@program_transform_name@,$program_transform_name,;t t
15096 s,@bindir@,$bindir,;t t
15097 s,@sbindir@,$sbindir,;t t
15098 s,@libexecdir@,$libexecdir,;t t
15099 s,@datarootdir@,$datarootdir,;t t
15100 s,@datadir@,$datadir,;t t
15101 s,@sysconfdir@,$sysconfdir,;t t
15102 s,@sharedstatedir@,$sharedstatedir,;t t
15103 s,@localstatedir@,$localstatedir,;t t
15104 s,@libdir@,$libdir,;t t
15105 s,@includedir@,$includedir,;t t
15106 s,@oldincludedir@,$oldincludedir,;t t
15107 s,@infodir@,$infodir,;t t
15108 s,@mandir@,$mandir,;t t
15109 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15110 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15111 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15112 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15113 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15114 s,@build_alias@,$build_alias,;t t
15115 s,@host_alias@,$host_alias,;t t
15116 s,@target_alias@,$target_alias,;t t
15117 s,@ECHO_C@,$ECHO_C,;t t
15118 s,@ECHO_N@,$ECHO_N,;t t
15119 s,@ECHO_T@,$ECHO_T,;t t
15120 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15121 s,@DEFS@,$DEFS,;t t
15122 s,@LIBS@,$LIBS,;t t
15123 s,@top_builddir@,$top_builddir,;t t
15124 s,@build@,$build,;t t
15125 s,@build_cpu@,$build_cpu,;t t
15126 s,@build_vendor@,$build_vendor,;t t
15127 s,@build_os@,$build_os,;t t
15128 s,@host@,$host,;t t
15129 s,@host_cpu@,$host_cpu,;t t
15130 s,@host_vendor@,$host_vendor,;t t
15131 s,@host_os@,$host_os,;t t
15132 s,@target@,$target,;t t
15133 s,@target_cpu@,$target_cpu,;t t
15134 s,@target_vendor@,$target_vendor,;t t
15135 s,@target_os@,$target_os,;t t
15136 s,@CC@,$CC,;t t
15137 s,@CFLAGS@,$CFLAGS,;t t
15138 s,@LDFLAGS@,$LDFLAGS,;t t
15139 s,@CPPFLAGS@,$CPPFLAGS,;t t
15140 s,@ac_ct_CC@,$ac_ct_CC,;t t
15141 s,@EXEEXT@,$EXEEXT,;t t
15142 s,@OBJEXT@,$OBJEXT,;t t
15143 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15144 s,@CPP@,$CPP,;t t
15145 s,@AWK@,$AWK,;t t
15146 s,@EGREP@,$EGREP,;t t
15147 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15148 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15149 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15150 s,@LN_S@,$LN_S,;t t
15151 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15152 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
15153 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
15154 s,@SET_MAKE@,$SET_MAKE,;t t
15155 s,@CTAGS@,$CTAGS,;t t
15156 s,@ETAGS@,$ETAGS,;t t
15157 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15158 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15159 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
15160 s,@RANLIB@,$RANLIB,;t t
15161 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
15162 s,@LD@,$LD,;t t
15163 s,@ac_ct_LD@,$ac_ct_LD,;t t
15164 s,@AR@,$AR,;t t
15165 s,@ac_ct_AR@,$ac_ct_AR,;t t
15166 s,@ARFLAGS@,$ARFLAGS,;t t
15167 s,@DESTDIR@,$DESTDIR,;t t
15168 s,@BUILD_CC@,$BUILD_CC,;t t
15169 s,@BUILD_CPP@,$BUILD_CPP,;t t
15170 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
15171 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
15172 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
15173 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
15174 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
15175 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
15176 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
15177 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15178 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15179 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
15180 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
15181 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
15182 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
15183 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15184 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15185 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
15186 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
15187 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
15188 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
15189 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
15190 s,@CC_G_OPT@,$CC_G_OPT,;t t
15191 s,@LD_MODEL@,$LD_MODEL,;t t
15192 s,@shlibdir@,$shlibdir,;t t
15193 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
15194 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15195 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
15196 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15197 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
15198 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
15199 s,@LINK_PROGS@,$LINK_PROGS,;t t
15200 s,@LINK_TESTS@,$LINK_TESTS,;t t
15201 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
15202 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15203 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
15204 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
15205 s,@RPATH_LIST@,$RPATH_LIST,;t t
15206 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
15207 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
15208 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
15209 s,@PTHREAD@,$PTHREAD,;t t
15210 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
15211 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15212 s,@ECHO_LT@,$ECHO_LT,;t t
15213 s,@ECHO_LD@,$ECHO_LD,;t t
15214 s,@RULE_CC@,$RULE_CC,;t t
15215 s,@SHOW_CC@,$SHOW_CC,;t t
15216 s,@ECHO_CC@,$ECHO_CC,;t t
15217 s,@ADAFLAGS@,$ADAFLAGS,;t t
15218 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15219 s,@ADA_TRACE@,$ADA_TRACE,;t t
15220 s,@gnat_exists@,$gnat_exists,;t t
15221 s,@M4_exists@,$M4_exists,;t t
15222 s,@cf_ada_make@,$cf_ada_make,;t t
15223 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
15224 s,@cf_compile_generics@,$cf_compile_generics,;t t
15225 s,@cf_generic_objects@,$cf_generic_objects,;t t
15226 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
15227 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15228 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15229 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15230 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15231 s,@cf_ada_package@,$cf_ada_package,;t t
15232 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15233 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15234 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15235 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15236 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15237 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15238 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15239 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15240 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15241 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15242 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15243 s,@TEST_ARG2@,$TEST_ARG2,;t t
15244 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15245 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15246 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15247 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15248 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15249 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15250 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15251 CEOF
15252
15253 EOF
15254
15255   cat >>$CONFIG_STATUS <<\EOF
15256   # Split the substitutions into bite-sized pieces for seds with
15257   # small command number limits, like on Digital OSF/1 and HP-UX.
15258   ac_max_sed_lines=48
15259   ac_sed_frag=1 # Number of current file.
15260   ac_beg=1 # First line for current file.
15261   ac_end=$ac_max_sed_lines # Line after last line for current file.
15262   ac_more_lines=:
15263   ac_sed_cmds=
15264   while $ac_more_lines; do
15265     if test $ac_beg -gt 1; then
15266       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15267     else
15268       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15269     fi
15270     if test ! -s $tmp/subs.frag; then
15271       ac_more_lines=false
15272     else
15273       # The purpose of the label and of the branching condition is to
15274       # speed up the sed processing (if there are no `@' at all, there
15275       # is no need to browse any of the substitutions).
15276       # These are the two extra sed commands mentioned above.
15277       (echo ':t
15278   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15279       # It is possible to make a multiline substitution using escaped newlines.
15280       # Ensure that we do not split the substitution between script fragments.
15281       ac_BEG=$ac_end
15282       ac_END=`expr $ac_end + $ac_max_sed_lines`
15283       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15284       if test -s $tmp/subs.next; then
15285         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15286         if test ! -s $tmp/subs.edit; then
15287           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15288           if test ! -s $tmp/subs.edit; then
15289             if test $ac_beg -gt 1; then
15290               ac_end=`expr $ac_end - 1`
15291               continue
15292             fi
15293           fi
15294         fi
15295       fi
15296
15297       if test -z "$ac_sed_cmds"; then
15298         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15299       else
15300         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15301       fi
15302       ac_sed_frag=`expr $ac_sed_frag + 1`
15303       ac_beg=$ac_end
15304       ac_end=`expr $ac_end + $ac_max_sed_lines`
15305     fi
15306   done
15307   if test -z "$ac_sed_cmds"; then
15308     ac_sed_cmds=cat
15309   fi
15310 fi # test -n "$CONFIG_FILES"
15311
15312 EOF
15313 cat >>$CONFIG_STATUS <<\EOF
15314 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15315   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15316   case $ac_file in
15317   - | *:- | *:-:* ) # input from stdin
15318         cat >$tmp/stdin
15319         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15320         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15321   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15322         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15323   * )   ac_file_in=$ac_file.in ;;
15324   esac
15325
15326   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15327   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15328          X"$ac_file" : 'X\(//\)[^/]' \| \
15329          X"$ac_file" : 'X\(//\)$' \| \
15330          X"$ac_file" : 'X\(/\)' \| \
15331          .     : '\(.\)' 2>/dev/null ||
15332 echo X"$ac_file" |
15333     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15334           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15335           /^X\(\/\/\)$/{ s//\1/; q; }
15336           /^X\(\/\).*/{ s//\1/; q; }
15337           s/.*/./; q'`
15338   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15339     { case "$ac_dir" in
15340   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15341   *)                      as_incr_dir=.;;
15342 esac
15343 as_dummy="$ac_dir"
15344 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15345   case $as_mkdir_dir in
15346     # Skip DOS drivespec
15347     ?:) as_incr_dir=$as_mkdir_dir ;;
15348     *)
15349       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15350       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15351     ;;
15352   esac
15353 done; }
15354
15355     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15356     # A "../" for each directory in $ac_dir_suffix.
15357     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15358   else
15359     ac_dir_suffix= ac_dots=
15360   fi
15361
15362   case $srcdir in
15363   .)  ac_srcdir=.
15364       if test -z "$ac_dots"; then
15365          ac_top_srcdir=.
15366       else
15367          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15368       fi ;;
15369   [\\/]* | ?:[\\/]* )
15370       ac_srcdir=$srcdir$ac_dir_suffix;
15371       ac_top_srcdir=$srcdir ;;
15372   *) # Relative path.
15373     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15374     ac_top_srcdir=$ac_dots$srcdir ;;
15375   esac
15376
15377   case $INSTALL in
15378   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15379   *) ac_INSTALL=$ac_dots$INSTALL ;;
15380   esac
15381
15382   if test x"$ac_file" != x-; then
15383     { echo "$as_me:15383: creating $ac_file" >&5
15384 echo "$as_me: creating $ac_file" >&6;}
15385     rm -f "$ac_file"
15386   fi
15387   # Let's still pretend it is `configure' which instantiates (i.e., don't
15388   # use $as_me), people would be surprised to read:
15389   #    /* config.h.  Generated automatically by config.status.  */
15390   configure_input="Generated automatically from `echo $ac_file_in |
15391                                                  sed 's,.*/,,'` by configure."
15392
15393   # First look for the input files in the build tree, otherwise in the
15394   # src tree.
15395   ac_file_inputs=`IFS=:
15396     for f in $ac_file_in; do
15397       case $f in
15398       -) echo $tmp/stdin ;;
15399       [\\/$]*)
15400          # Absolute (can't be DOS-style, as IFS=:)
15401          test -f "$f" || { { echo "$as_me:15401: error: cannot find input file: $f" >&5
15402 echo "$as_me: error: cannot find input file: $f" >&2;}
15403    { (exit 1); exit 1; }; }
15404          echo $f;;
15405       *) # Relative
15406          if test -f "$f"; then
15407            # Build tree
15408            echo $f
15409          elif test -f "$srcdir/$f"; then
15410            # Source tree
15411            echo $srcdir/$f
15412          else
15413            # /dev/null tree
15414            { { echo "$as_me:15414: error: cannot find input file: $f" >&5
15415 echo "$as_me: error: cannot find input file: $f" >&2;}
15416    { (exit 1); exit 1; }; }
15417          fi;;
15418       esac
15419     done` || { (exit 1); exit 1; }
15420 EOF
15421 cat >>$CONFIG_STATUS <<\EOF
15422   ac_warn_datarootdir=no
15423   if test x"$ac_file" != x-; then
15424     for ac_item in $ac_file_inputs
15425     do
15426       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15427       if test -n "$ac_seen"; then
15428         ac_used=`grep '@datarootdir@' $ac_item`
15429         if test -z "$ac_used"; then
15430           { echo "$as_me:15430: WARNING: datarootdir was used implicitly but not set:
15431 $ac_seen" >&5
15432 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15433 $ac_seen" >&2;}
15434           ac_warn_datarootdir=yes
15435         fi
15436       fi
15437       ac_seen=`grep '${datarootdir}' $ac_item`
15438       if test -n "$ac_seen"; then
15439         { echo "$as_me:15439: WARNING: datarootdir was used explicitly but not set:
15440 $ac_seen" >&5
15441 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15442 $ac_seen" >&2;}
15443         ac_warn_datarootdir=yes
15444       fi
15445     done
15446   fi
15447
15448 if test "x$ac_warn_datarootdir" = xyes; then
15449   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15450 fi
15451
15452 EOF
15453 cat >>$CONFIG_STATUS <<EOF
15454   sed "$ac_vpsub
15455 $extrasub
15456 EOF
15457 cat >>$CONFIG_STATUS <<\EOF
15458 :t
15459 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15460 s,@configure_input@,$configure_input,;t t
15461 s,@srcdir@,$ac_srcdir,;t t
15462 s,@top_srcdir@,$ac_top_srcdir,;t t
15463 s,@INSTALL@,$ac_INSTALL,;t t
15464 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15465   rm -f $tmp/stdin
15466   if test x"$ac_file" != x-; then
15467     cp $tmp/out $ac_file
15468
15469     for ac_name in prefix exec_prefix datarootdir
15470     do
15471         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15472         if test -n "$ac_seen"; then
15473             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15474             if test -z "$ac_init"; then
15475               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15476               { echo "$as_me:15476: WARNING: Variable $ac_name is used but was not set:
15477 $ac_seen" >&5
15478 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15479 $ac_seen" >&2;}
15480             fi
15481         fi
15482     done
15483     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15484     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15485     if test -s $tmp/out; then
15486       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15487       { echo "$as_me:15487: WARNING: Some variables may not be substituted:
15488 $ac_seen" >&5
15489 echo "$as_me: WARNING: Some variables may not be substituted:
15490 $ac_seen" >&2;}
15491     fi
15492   else
15493     cat $tmp/out
15494   fi
15495   rm -f $tmp/out
15496
15497 done
15498 EOF
15499 cat >>$CONFIG_STATUS <<\EOF
15500
15501 #
15502 # CONFIG_HEADER section.
15503 #
15504
15505 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15506 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15507 #
15508 # ac_d sets the value in "#define NAME VALUE" lines.
15509 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15510 ac_dB='[        ].*$,\1#\2'
15511 ac_dC=' '
15512 ac_dD=',;t'
15513 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15514 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15515 ac_iB='\([      ]\),\1#\2define\3'
15516 ac_iC=' '
15517 ac_iD='\4,;t'
15518 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15519 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15520 ac_uB='$,\1#\2define\3'
15521 ac_uC=' '
15522 ac_uD=',;t'
15523
15524 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15525   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15526   case $ac_file in
15527   - | *:- | *:-:* ) # input from stdin
15528         cat >$tmp/stdin
15529         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15530         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15531   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15532         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15533   * )   ac_file_in=$ac_file.in ;;
15534   esac
15535
15536   test x"$ac_file" != x- && { echo "$as_me:15536: creating $ac_file" >&5
15537 echo "$as_me: creating $ac_file" >&6;}
15538
15539   # First look for the input files in the build tree, otherwise in the
15540   # src tree.
15541   ac_file_inputs=`IFS=:
15542     for f in $ac_file_in; do
15543       case $f in
15544       -) echo $tmp/stdin ;;
15545       [\\/$]*)
15546          # Absolute (can't be DOS-style, as IFS=:)
15547          test -f "$f" || { { echo "$as_me:15547: error: cannot find input file: $f" >&5
15548 echo "$as_me: error: cannot find input file: $f" >&2;}
15549    { (exit 1); exit 1; }; }
15550          echo $f;;
15551       *) # Relative
15552          if test -f "$f"; then
15553            # Build tree
15554            echo $f
15555          elif test -f "$srcdir/$f"; then
15556            # Source tree
15557            echo $srcdir/$f
15558          else
15559            # /dev/null tree
15560            { { echo "$as_me:15560: error: cannot find input file: $f" >&5
15561 echo "$as_me: error: cannot find input file: $f" >&2;}
15562    { (exit 1); exit 1; }; }
15563          fi;;
15564       esac
15565     done` || { (exit 1); exit 1; }
15566   # Remove the trailing spaces.
15567   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15568
15569 EOF
15570
15571 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15572 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15573 # be either 'cat' or 'sort'.
15574 cat confdefs.h | uniq >conftest.vals
15575
15576 # Break up conftest.vals because some shells have a limit on
15577 # the size of here documents, and old seds have small limits too.
15578
15579 rm -f conftest.tail
15580 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15581 while grep . conftest.vals >/dev/null
15582 do
15583   # Write chunks of a limited-size here document to conftest.frag.
15584   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15585   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15586   echo 'CEOF' >> $CONFIG_STATUS
15587   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15588   rm -f conftest.vals
15589   mv conftest.tail conftest.vals
15590 done
15591 rm -f conftest.vals
15592
15593 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15594 # marker @DEFS@.
15595 echo '  cat >> conftest.edit <<CEOF
15596 /@DEFS@/r conftest.frag
15597 /@DEFS@/d
15598 CEOF
15599 sed -f conftest.edit $tmp/in > $tmp/out
15600 rm -f $tmp/in
15601 mv $tmp/out $tmp/in
15602 rm -f conftest.edit conftest.frag
15603 ' >> $CONFIG_STATUS
15604
15605 cat >>$CONFIG_STATUS <<\EOF
15606   # Let's still pretend it is `configure' which instantiates (i.e., don't
15607   # use $as_me), people would be surprised to read:
15608   #    /* config.h.  Generated automatically by config.status.  */
15609   if test x"$ac_file" = x-; then
15610     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15611   else
15612     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15613   fi
15614   cat $tmp/in >>$tmp/config.h
15615   rm -f $tmp/in
15616   if test x"$ac_file" != x-; then
15617     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15618       { echo "$as_me:15618: $ac_file is unchanged" >&5
15619 echo "$as_me: $ac_file is unchanged" >&6;}
15620     else
15621       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15622          X"$ac_file" : 'X\(//\)[^/]' \| \
15623          X"$ac_file" : 'X\(//\)$' \| \
15624          X"$ac_file" : 'X\(/\)' \| \
15625          .     : '\(.\)' 2>/dev/null ||
15626 echo X"$ac_file" |
15627     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15628           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15629           /^X\(\/\/\)$/{ s//\1/; q; }
15630           /^X\(\/\).*/{ s//\1/; q; }
15631           s/.*/./; q'`
15632       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15633         { case "$ac_dir" in
15634   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15635   *)                      as_incr_dir=.;;
15636 esac
15637 as_dummy="$ac_dir"
15638 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15639   case $as_mkdir_dir in
15640     # Skip DOS drivespec
15641     ?:) as_incr_dir=$as_mkdir_dir ;;
15642     *)
15643       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15644       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15645     ;;
15646   esac
15647 done; }
15648
15649       fi
15650       rm -f $ac_file
15651       mv $tmp/config.h $ac_file
15652     fi
15653   else
15654     cat $tmp/config.h
15655     rm -f $tmp/config.h
15656   fi
15657 done
15658 EOF
15659 cat >>$CONFIG_STATUS <<\EOF
15660 #
15661 # CONFIG_COMMANDS section.
15662 #
15663 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15664   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15665   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15666
15667   case $ac_dest in
15668     default )
15669 if test -z "$USE_OLD_MAKERULES" ; then
15670         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15671 fi
15672  ;;
15673   esac
15674 done
15675 EOF
15676
15677 cat >>$CONFIG_STATUS <<\EOF
15678
15679 { (exit 0); exit 0; }
15680 EOF
15681 chmod +x $CONFIG_STATUS
15682 ac_clean_files=$ac_clean_files_save
15683
15684 # configure is writing to config.log, and then calls config.status.
15685 # config.status does its own redirection, appending to config.log.
15686 # Unfortunately, on DOS this fails, as config.log is still kept open
15687 # by configure, so config.status won't be able to write to it; its
15688 # output is simply discarded.  So we exec the FD to /dev/null,
15689 # effectively closing config.log, so it can be properly (re)opened and
15690 # appended to by config.status.  When coming back to configure, we
15691 # need to make the FD available again.
15692 if test "$no_create" != yes; then
15693   ac_cs_success=:
15694   exec 5>/dev/null
15695   $SHELL $CONFIG_STATUS || ac_cs_success=false
15696   exec 5>>config.log
15697   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15698   # would make configure fail if this is the last instruction.
15699   $ac_cs_success || { (exit 1); exit 1; }
15700 fi
15701 ${MAKE:-make} preinstall