]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/configure
ncurses 6.0 - patch 20180106
[ncurses.git] / Ada95 / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.64 .
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated by Autoconf 2.52.20170501.
5 #
6 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
7 # Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Avoid depending upon Character Ranges.
12 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
15 as_cr_digits='0123456789'
16 as_cr_alnum=$as_cr_Letters$as_cr_digits
17
18 # Sed expression to map a string onto a valid variable name.
19 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
20
21 # Sed expression to map a string onto a valid CPP name.
22 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
23
24 # Be Bourne compatible
25 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
26   emulate sh
27   NULLCMD=:
28 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
29   set -o posix
30 fi
31
32 # Name of the executable.
33 as_me=`echo "$0" |sed 's,.*[\\/],,'`
34
35 if expr a : '\(a\)' >/dev/null 2>&1; then
36   as_expr=expr
37 else
38   as_expr=false
39 fi
40
41 rm -f conf$$ conf$$.exe conf$$.file
42 echo >conf$$.file
43 if ln -s conf$$.file conf$$ 2>/dev/null; then
44   # We could just check for DJGPP; but this test a) works b) is more generic
45   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
46   if test -f conf$$.exe; then
47     # Don't use ln at all; we don't have any links
48     as_ln_s='cp -p'
49   else
50     as_ln_s='ln -s'
51   fi
52 elif ln conf$$.file conf$$ 2>/dev/null; then
53   as_ln_s=ln
54 else
55   as_ln_s='cp -p'
56 fi
57 rm -f conf$$ conf$$.exe conf$$.file
58
59 as_executable_p="test -f"
60
61 # Support unset when possible.
62 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
63   as_unset=unset
64 else
65   as_unset=false
66 fi
67
68 # NLS nuisances.
69 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
70 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
71 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
72 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
73 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
74 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
75 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
76 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
77
78 # IFS
79 # We need space, tab and new line, in precisely that order.
80 as_nl='
81 '
82 IFS="   $as_nl"
83
84 # CDPATH.
85 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
86
87 # Name of the host.
88 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
89 # so uname gets run too.
90 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
91
92 exec 6>&1
93
94 #
95 # Initializations.
96 #
97 ac_default_prefix=/usr/local
98 cross_compiling=no
99 subdirs=
100 MFLAGS= MAKEFLAGS=
101 SHELL=${CONFIG_SHELL-/bin/sh}
102
103 # Maximum number of lines to put in a shell here document.
104 # This variable seems obsolete.  It should probably be removed, and
105 # only ac_max_sed_lines should be used.
106 : ${ac_max_here_lines=38}
107
108 ac_unique_file="gen/gen.c"
109 # Factoring default headers for most tests.
110 ac_includes_default="\
111 #include <stdio.h>
112 #if HAVE_SYS_TYPES_H
113 # include <sys/types.h>
114 #endif
115 #if HAVE_SYS_STAT_H
116 # include <sys/stat.h>
117 #endif
118 #if STDC_HEADERS
119 # include <stdlib.h>
120 # include <stddef.h>
121 #else
122 # if HAVE_STDLIB_H
123 #  include <stdlib.h>
124 # endif
125 #endif
126 #if HAVE_STRING_H
127 # if !STDC_HEADERS && HAVE_MEMORY_H
128 #  include <memory.h>
129 # endif
130 # include <string.h>
131 #endif
132 #if HAVE_STRINGS_H
133 # include <strings.h>
134 #endif
135 #if HAVE_INTTYPES_H
136 # include <inttypes.h>
137 #else
138 # if HAVE_STDINT_H
139 #  include <stdint.h>
140 # endif
141 #endif
142 #if HAVE_UNISTD_H
143 # include <unistd.h>
144 #endif"
145
146 # Initialize some variables set by options.
147 ac_init_help=
148 ac_init_version=false
149 # The variables have the same names as the options, with
150 # dashes changed to underlines.
151 cache_file=/dev/null
152 exec_prefix=NONE
153 no_create=
154 no_recursion=
155 prefix=NONE
156 program_prefix=NONE
157 program_suffix=NONE
158 program_transform_name=s,x,x,
159 silent=
160 site=
161 srcdir=
162 verbose=
163 x_includes=NONE
164 x_libraries=NONE
165
166 # Installation directory options.
167 # These are left unexpanded so users can "make install exec_prefix=/foo"
168 # and all the variables that are supposed to be based on exec_prefix
169 # by default will actually change.
170 # Use braces instead of parens because sh, perl, etc. also accept them.
171 bindir='${exec_prefix}/bin'
172 sbindir='${exec_prefix}/sbin'
173 libexecdir='${exec_prefix}/libexec'
174 datarootdir='${prefix}/share'
175 datadir='${datarootdir}'
176 sysconfdir='${prefix}/etc'
177 sharedstatedir='${prefix}/com'
178 localstatedir='${prefix}/var'
179 libdir='${exec_prefix}/lib'
180 includedir='${prefix}/include'
181 oldincludedir='/usr/include'
182 infodir='${datarootdir}/info'
183 mandir='${datarootdir}/man'
184
185 # Identity of this package.
186 PACKAGE_NAME=
187 PACKAGE_TARNAME=
188 PACKAGE_VERSION=
189 PACKAGE_STRING=
190 PACKAGE_BUGREPORT=
191
192 ac_prev=
193 for ac_option
194 do
195   # If the previous option needs an argument, assign it.
196   if test -n "$ac_prev"; then
197     eval "$ac_prev=\$ac_option"
198     ac_prev=
199     continue
200   fi
201
202   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
203
204   # Accept the important Cygnus configure options, so we can diagnose typos.
205
206   case $ac_option in
207
208   -bindir | --bindir | --bindi | --bind | --bin | --bi)
209     ac_prev=bindir ;;
210   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
211     bindir=$ac_optarg ;;
212
213   -build | --build | --buil | --bui | --bu)
214     ac_prev=build_alias ;;
215   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
216     build_alias=$ac_optarg ;;
217
218   -cache-file | --cache-file | --cache-fil | --cache-fi \
219   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
220     ac_prev=cache_file ;;
221   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
222   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
223     cache_file=$ac_optarg ;;
224
225   --config-cache | -C)
226     cache_file=config.cache ;;
227
228   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
229     ac_prev=datadir ;;
230   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
231   | --da=*)
232     datadir=$ac_optarg ;;
233
234   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
235   | --dataroo | --dataro | --datar)
236     ac_prev=datarootdir ;;
237   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
238   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
239     datarootdir=$ac_optarg ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
243     # Reject names that are not valid shell variable names.
244     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
245       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
246    { (exit 1); exit 1; }; }
247     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
248     eval "enable_$ac_feature=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
252     # Reject names that are not valid shell variable names.
253     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
254       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
255    { (exit 1); exit 1; }; }
256     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
257     case $ac_option in
258       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_$ac_feature='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix=$ac_optarg ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he | -h)
277     ac_init_help=long ;;
278   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
279     ac_init_help=recursive ;;
280   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
281     ac_init_help=short ;;
282
283   -host | --host | --hos | --ho)
284     ac_prev=host_alias ;;
285   -host=* | --host=* | --hos=* | --ho=*)
286     host_alias=$ac_optarg ;;
287
288   -includedir | --includedir | --includedi | --included | --include \
289   | --includ | --inclu | --incl | --inc)
290     ac_prev=includedir ;;
291   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
292   | --includ=* | --inclu=* | --incl=* | --inc=*)
293     includedir=$ac_optarg ;;
294
295   -infodir | --infodir | --infodi | --infod | --info | --inf)
296     ac_prev=infodir ;;
297   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
298     infodir=$ac_optarg ;;
299
300   -libdir | --libdir | --libdi | --libd)
301     ac_prev=libdir ;;
302   -libdir=* | --libdir=* | --libdi=* | --libd=*)
303     libdir=$ac_optarg ;;
304
305   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
306   | --libexe | --libex | --libe)
307     ac_prev=libexecdir ;;
308   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
309   | --libexe=* | --libex=* | --libe=*)
310     libexecdir=$ac_optarg ;;
311
312   -localstatedir | --localstatedir | --localstatedi | --localstated \
313   | --localstate | --localstat | --localsta | --localst \
314   | --locals | --local | --loca | --loc | --lo)
315     ac_prev=localstatedir ;;
316   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
317   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
318   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
319     localstatedir=$ac_optarg ;;
320
321   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
322     ac_prev=mandir ;;
323   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
324     mandir=$ac_optarg ;;
325
326   -nfp | --nfp | --nf)
327     # Obsolete; use --without-fp.
328     with_fp=no ;;
329
330   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
331   | --no-cr | --no-c)
332     no_create=yes ;;
333
334   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
335   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
336     no_recursion=yes ;;
337
338   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
339   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
340   | --oldin | --oldi | --old | --ol | --o)
341     ac_prev=oldincludedir ;;
342   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
343   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
344   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
345     oldincludedir=$ac_optarg ;;
346
347   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
348     ac_prev=prefix ;;
349   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
350     prefix=$ac_optarg ;;
351
352   -program-prefix | --program-prefix | --program-prefi | --program-pref \
353   | --program-pre | --program-pr | --program-p)
354     ac_prev=program_prefix ;;
355   -program-prefix=* | --program-prefix=* | --program-prefi=* \
356   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
357     program_prefix=$ac_optarg ;;
358
359   -program-suffix | --program-suffix | --program-suffi | --program-suff \
360   | --program-suf | --program-su | --program-s)
361     ac_prev=program_suffix ;;
362   -program-suffix=* | --program-suffix=* | --program-suffi=* \
363   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
364     program_suffix=$ac_optarg ;;
365
366   -program-transform-name | --program-transform-name \
367   | --program-transform-nam | --program-transform-na \
368   | --program-transform-n | --program-transform- \
369   | --program-transform | --program-transfor \
370   | --program-transfo | --program-transf \
371   | --program-trans | --program-tran \
372   | --progr-tra | --program-tr | --program-t)
373     ac_prev=program_transform_name ;;
374   -program-transform-name=* | --program-transform-name=* \
375   | --program-transform-nam=* | --program-transform-na=* \
376   | --program-transform-n=* | --program-transform-=* \
377   | --program-transform=* | --program-transfor=* \
378   | --program-transfo=* | --program-transf=* \
379   | --program-trans=* | --program-tran=* \
380   | --progr-tra=* | --program-tr=* | --program-t=*)
381     program_transform_name=$ac_optarg ;;
382
383   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
384   | -silent | --silent | --silen | --sile | --sil)
385     silent=yes ;;
386
387   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
388     ac_prev=sbindir ;;
389   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
390   | --sbi=* | --sb=*)
391     sbindir=$ac_optarg ;;
392
393   -sharedstatedir | --sharedstatedir | --sharedstatedi \
394   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
395   | --sharedst | --shareds | --shared | --share | --shar \
396   | --sha | --sh)
397     ac_prev=sharedstatedir ;;
398   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
399   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
400   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
401   | --sha=* | --sh=*)
402     sharedstatedir=$ac_optarg ;;
403
404   -site | --site | --sit)
405     ac_prev=site ;;
406   -site=* | --site=* | --sit=*)
407     site=$ac_optarg ;;
408
409   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
410     ac_prev=srcdir ;;
411   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
412     srcdir=$ac_optarg ;;
413
414   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
415   | --syscon | --sysco | --sysc | --sys | --sy)
416     ac_prev=sysconfdir ;;
417   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
418   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
419     sysconfdir=$ac_optarg ;;
420
421   -target | --target | --targe | --targ | --tar | --ta | --t)
422     ac_prev=target_alias ;;
423   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
424     target_alias=$ac_optarg ;;
425
426   -v | -verbose | --verbose | --verbos | --verbo | --verb)
427     verbose=yes ;;
428
429   -version | --version | --versio | --versi | --vers | -V)
430     ac_init_version=: ;;
431
432   -with-* | --with-*)
433     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid package name: $ac_package" >&2
437    { (exit 1); exit 1; }; }
438     ac_package=`echo $ac_package| sed 's/-/_/g'`
439     case $ac_option in
440       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
441       *) ac_optarg=yes ;;
442     esac
443     eval "with_$ac_package='$ac_optarg'" ;;
444
445   -without-* | --without-*)
446     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
447     # Reject names that are not valid shell variable names.
448     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
449       { echo "$as_me: error: invalid package name: $ac_package" >&2
450    { (exit 1); exit 1; }; }
451     ac_package=`echo $ac_package | sed 's/-/_/g'`
452     eval "with_$ac_package=no" ;;
453
454   --x)
455     # Obsolete; use --with-x.
456     with_x=yes ;;
457
458   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
459   | --x-incl | --x-inc | --x-in | --x-i)
460     ac_prev=x_includes ;;
461   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
462   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
463     x_includes=$ac_optarg ;;
464
465   -x-libraries | --x-libraries | --x-librarie | --x-librari \
466   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
467     ac_prev=x_libraries ;;
468   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
469   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
470     x_libraries=$ac_optarg ;;
471
472   -*) { echo "$as_me: error: unrecognized option: $ac_option
473 Try \`$0 --help' for more information." >&2
474    { (exit 1); exit 1; }; }
475     ;;
476
477   *=*)
478     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
479     # Reject names that are not valid shell variable names.
480     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
481       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
482    { (exit 1); exit 1; }; }
483     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
484     eval "$ac_envvar='$ac_optarg'"
485     export $ac_envvar ;;
486
487   *)
488     # FIXME: should be removed in autoconf 3.0.
489     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
490     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
491       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
492     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
493     ;;
494
495   esac
496 done
497
498 if test -n "$ac_prev"; then
499   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
500   { echo "$as_me: error: missing argument to $ac_option" >&2
501    { (exit 1); exit 1; }; }
502 fi
503
504 # Be sure to have absolute paths.
505 for ac_var in exec_prefix prefix
506 do
507   eval ac_val=$`echo $ac_var`
508   case $ac_val in
509     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
510     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
511    { (exit 1); exit 1; }; };;
512   esac
513 done
514
515 # Be sure to have absolute paths.
516 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
517               localstatedir libdir includedir oldincludedir infodir mandir
518 do
519   eval ac_val=$`echo $ac_var`
520   case $ac_val in
521     [\\/$]* | ?:[\\/]* ) ;;
522     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
523    { (exit 1); exit 1; }; };;
524   esac
525 done
526
527 # There might be people who depend on the old broken behavior: `$host'
528 # used to hold the argument of --host etc.
529 build=$build_alias
530 host=$host_alias
531 target=$target_alias
532
533 # FIXME: should be removed in autoconf 3.0.
534 if test "x$host_alias" != x; then
535   if test "x$build_alias" = x; then
536     cross_compiling=maybe
537     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
538     If a cross compiler is detected then cross compile mode will be used." >&2
539   elif test "x$build_alias" != "x$host_alias"; then
540     cross_compiling=yes
541   fi
542 fi
543
544 ac_tool_prefix=
545 test -n "$host_alias" && ac_tool_prefix=$host_alias-
546
547 test "$silent" = yes && exec 6>/dev/null
548
549 # Find the source files, if location was not specified.
550 if test -z "$srcdir"; then
551   ac_srcdir_defaulted=yes
552   # Try the directory containing this script, then its parent.
553   ac_prog=$0
554   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
555   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
556   srcdir=$ac_confdir
557   if test ! -r $srcdir/$ac_unique_file; then
558     srcdir=..
559   fi
560 else
561   ac_srcdir_defaulted=no
562 fi
563 if test ! -r $srcdir/$ac_unique_file; then
564   if test "$ac_srcdir_defaulted" = yes; then
565     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
566    { (exit 1); exit 1; }; }
567   else
568     { echo "$as_me: error: cannot find sources in $srcdir" >&2
569    { (exit 1); exit 1; }; }
570   fi
571 fi
572 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
573 ac_env_build_alias_set=${build_alias+set}
574 ac_env_build_alias_value=$build_alias
575 ac_cv_env_build_alias_set=${build_alias+set}
576 ac_cv_env_build_alias_value=$build_alias
577 ac_env_host_alias_set=${host_alias+set}
578 ac_env_host_alias_value=$host_alias
579 ac_cv_env_host_alias_set=${host_alias+set}
580 ac_cv_env_host_alias_value=$host_alias
581 ac_env_target_alias_set=${target_alias+set}
582 ac_env_target_alias_value=$target_alias
583 ac_cv_env_target_alias_set=${target_alias+set}
584 ac_cv_env_target_alias_value=$target_alias
585 ac_env_CC_set=${CC+set}
586 ac_env_CC_value=$CC
587 ac_cv_env_CC_set=${CC+set}
588 ac_cv_env_CC_value=$CC
589 ac_env_CFLAGS_set=${CFLAGS+set}
590 ac_env_CFLAGS_value=$CFLAGS
591 ac_cv_env_CFLAGS_set=${CFLAGS+set}
592 ac_cv_env_CFLAGS_value=$CFLAGS
593 ac_env_LDFLAGS_set=${LDFLAGS+set}
594 ac_env_LDFLAGS_value=$LDFLAGS
595 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
596 ac_cv_env_LDFLAGS_value=$LDFLAGS
597 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
598 ac_env_CPPFLAGS_value=$CPPFLAGS
599 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
600 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
601 ac_env_CPP_set=${CPP+set}
602 ac_env_CPP_value=$CPP
603 ac_cv_env_CPP_set=${CPP+set}
604 ac_cv_env_CPP_value=$CPP
605
606 #
607 # Report the --help message.
608 #
609 if test "$ac_init_help" = "long"; then
610   # Omit some internal or obsolete options to make the list less imposing.
611   # This message is too long to be a string in the A/UX 3.1 sh.
612   cat <<EOF
613 \`configure' configures this package to adapt to many kinds of systems.
614
615 Usage: $0 [OPTION]... [VAR=VALUE]...
616
617 To assign environment variables (e.g., CC, CFLAGS...), specify them as
618 VAR=VALUE.  See below for descriptions of some of the useful variables.
619
620 Defaults for the options are specified in brackets.
621
622 Configuration:
623   -h, --help              display this help and exit
624       --help=short        display options specific to this package
625       --help=recursive    display the short help of all the included packages
626   -V, --version           display version information and exit
627   -q, --quiet, --silent   do not print \`checking...' messages
628       --cache-file=FILE   cache test results in FILE [disabled]
629   -C, --config-cache      alias for \`--cache-file=config.cache'
630   -n, --no-create         do not create output files
631       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
632
633 EOF
634
635   cat <<EOF
636 Installation directories:
637   --prefix=PREFIX         install architecture-independent files in PREFIX
638                           [$ac_default_prefix]
639   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
640                           [PREFIX]
641
642 By default, \`make install' will install all the files in
643 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
644 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
645 for instance \`--prefix=\$HOME'.
646
647 For better control, use the options below.
648
649 Fine tuning of the installation directories:
650   --bindir=DIR            user executables [EPREFIX/bin]
651   --sbindir=DIR           system admin executables [EPREFIX/sbin]
652   --libexecdir=DIR        program executables [EPREFIX/libexec]
653   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
654   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
655   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
656   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
657   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
658   --libdir=DIR            object code libraries [EPREFIX/lib]
659   --includedir=DIR        C header files [PREFIX/include]
660   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
661   --infodir=DIR           info documentation [DATAROOTDIR/info]
662   --mandir=DIR            man documentation [DATAROOTDIR/man]
663 EOF
664
665   cat <<\EOF
666
667 Program names:
668   --program-prefix=PREFIX            prepend PREFIX to installed program names
669   --program-suffix=SUFFIX            append SUFFIX to installed program names
670   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
671
672 System types:
673   --build=BUILD           configure for building on BUILD [guessed]
674   --host=HOST       build programs to run on HOST [BUILD]
675   --target=TARGET   configure for building compilers for TARGET [HOST]
676 EOF
677 fi
678
679 if test -n "$ac_init_help"; then
680
681   cat <<\EOF
682
683 Optional Packages:
684   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
685   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
686
687 Optional Features:
688   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
689   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
690
691   --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.20170501.  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 (void)
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 (void)
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 (void)
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 (void)
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 (void)
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 (void)
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 (void)
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 clang c99 c89 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 test -n "$BUILD_CC" || BUILD_CC="none"
3449
3450 fi;
3451         echo "$as_me:3451: checking for native build C compiler" >&5
3452 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
3453         echo "$as_me:3453: result: $BUILD_CC" >&5
3454 echo "${ECHO_T}$BUILD_CC" >&6
3455
3456         echo "$as_me:3456: checking for native build C preprocessor" >&5
3457 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
3458
3459 # Check whether --with-build-cpp or --without-build-cpp was given.
3460 if test "${with_build_cpp+set}" = set; then
3461   withval="$with_build_cpp"
3462   BUILD_CPP="$withval"
3463 else
3464   BUILD_CPP='${BUILD_CC} -E'
3465 fi;
3466         echo "$as_me:3466: result: $BUILD_CPP" >&5
3467 echo "${ECHO_T}$BUILD_CPP" >&6
3468
3469         echo "$as_me:3469: checking for native build C flags" >&5
3470 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
3471
3472 # Check whether --with-build-cflags or --without-build-cflags was given.
3473 if test "${with_build_cflags+set}" = set; then
3474   withval="$with_build_cflags"
3475   BUILD_CFLAGS="$withval"
3476 fi;
3477         echo "$as_me:3477: result: $BUILD_CFLAGS" >&5
3478 echo "${ECHO_T}$BUILD_CFLAGS" >&6
3479
3480         echo "$as_me:3480: checking for native build C preprocessor-flags" >&5
3481 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
3482
3483 # Check whether --with-build-cppflags or --without-build-cppflags was given.
3484 if test "${with_build_cppflags+set}" = set; then
3485   withval="$with_build_cppflags"
3486   BUILD_CPPFLAGS="$withval"
3487 fi;
3488         echo "$as_me:3488: result: $BUILD_CPPFLAGS" >&5
3489 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
3490
3491         echo "$as_me:3491: checking for native build linker-flags" >&5
3492 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
3493
3494 # Check whether --with-build-ldflags or --without-build-ldflags was given.
3495 if test "${with_build_ldflags+set}" = set; then
3496   withval="$with_build_ldflags"
3497   BUILD_LDFLAGS="$withval"
3498 fi;
3499         echo "$as_me:3499: result: $BUILD_LDFLAGS" >&5
3500 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
3501
3502         echo "$as_me:3502: checking for native build linker-libraries" >&5
3503 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
3504
3505 # Check whether --with-build-libs or --without-build-libs was given.
3506 if test "${with_build_libs+set}" = set; then
3507   withval="$with_build_libs"
3508   BUILD_LIBS="$withval"
3509 fi;
3510         echo "$as_me:3510: result: $BUILD_LIBS" >&5
3511 echo "${ECHO_T}$BUILD_LIBS" >&6
3512
3513         # this assumes we're on Unix.
3514         BUILD_EXEEXT=
3515         BUILD_OBJEXT=o
3516
3517         : ${BUILD_CC:='${CC}'}
3518
3519         if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
3520                 { { echo "$as_me:3520: error: Cross-build requires two compilers.
3521 Use --with-build-cc to specify the native compiler." >&5
3522 echo "$as_me: error: Cross-build requires two compilers.
3523 Use --with-build-cc to specify the native compiler." >&2;}
3524    { (exit 1); exit 1; }; }
3525         fi
3526
3527 else
3528         : ${BUILD_CC:='${CC}'}
3529         : ${BUILD_CPP:='${CPP}'}
3530         : ${BUILD_CFLAGS:='${CFLAGS}'}
3531         : ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
3532         : ${BUILD_LDFLAGS:='${LDFLAGS}'}
3533         : ${BUILD_LIBS:='${LIBS}'}
3534         : ${BUILD_EXEEXT:='$x'}
3535         : ${BUILD_OBJEXT:='o'}
3536 fi
3537
3538 ###############################################################################
3539
3540 ### Options to allow the user to specify the set of libraries which are used.
3541 ### Use "--without-normal --with-shared" to allow the default model to be
3542 ### shared, for example.
3543 cf_list_models=""
3544
3545 echo "$as_me:3545: checking if you want to build shared C-objects" >&5
3546 echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
3547
3548 # Check whether --with-shared or --without-shared was given.
3549 if test "${with_shared+set}" = set; then
3550   withval="$with_shared"
3551   with_shared=$withval
3552 else
3553   with_shared=no
3554 fi;
3555 echo "$as_me:3555: result: $with_shared" >&5
3556 echo "${ECHO_T}$with_shared" >&6
3557 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
3558
3559 echo "$as_me:3559: checking for specified models" >&5
3560 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
3561 test -z "$cf_list_models" && cf_list_models=normal
3562 echo "$as_me:3562: result: $cf_list_models" >&5
3563 echo "${ECHO_T}$cf_list_models" >&6
3564
3565 ### Use the first model as the default, and save its suffix for use in building
3566 ### up test-applications.
3567 echo "$as_me:3567: checking for default model" >&5
3568 echo $ECHO_N "checking for default model... $ECHO_C" >&6
3569 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
3570 echo "$as_me:3570: result: $DFT_LWR_MODEL" >&5
3571 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
3572
3573 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3574
3575 echo "$as_me:3575: checking for specific curses-directory" >&5
3576 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
3577
3578 # Check whether --with-curses-dir or --without-curses-dir was given.
3579 if test "${with_curses_dir+set}" = set; then
3580   withval="$with_curses_dir"
3581   cf_cv_curses_dir=$withval
3582 else
3583   cf_cv_curses_dir=no
3584 fi;
3585 echo "$as_me:3585: result: $cf_cv_curses_dir" >&5
3586 echo "${ECHO_T}$cf_cv_curses_dir" >&6
3587
3588 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3589 then
3590
3591 if test "x$prefix" != xNONE; then
3592         cf_path_syntax="$prefix"
3593 else
3594         cf_path_syntax="$ac_default_prefix"
3595 fi
3596
3597 case ".$withval" in
3598 (.\$\(*\)*|.\'*\'*)
3599         ;;
3600 (..|./*|.\\*)
3601         ;;
3602 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
3603         ;;
3604 (.\${*prefix}*|.\${*dir}*)
3605         eval withval="$withval"
3606         case ".$withval" in
3607         (.NONE/*)
3608                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3609                 ;;
3610         esac
3611         ;;
3612 (.no|.NONE/*)
3613         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
3614         ;;
3615 (*)
3616         { { echo "$as_me:3616: error: expected a pathname, not \"$withval\"" >&5
3617 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
3618    { (exit 1); exit 1; }; }
3619         ;;
3620 esac
3621
3622         if test -d "$cf_cv_curses_dir"
3623         then
3624
3625 if test -n "$cf_cv_curses_dir/include" ; then
3626   for cf_add_incdir in $cf_cv_curses_dir/include
3627   do
3628         while test $cf_add_incdir != /usr/include
3629         do
3630           if test -d $cf_add_incdir
3631           then
3632                 cf_have_incdir=no
3633                 if test -n "$CFLAGS$CPPFLAGS" ; then
3634                   # a loop is needed to ensure we can add subdirs of existing dirs
3635                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
3636                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
3637                           cf_have_incdir=yes; break
3638                         fi
3639                   done
3640                 fi
3641
3642                 if test "$cf_have_incdir" = no ; then
3643                   if test "$cf_add_incdir" = /usr/local/include ; then
3644                         if test "$GCC" = yes
3645                         then
3646                           cf_save_CPPFLAGS=$CPPFLAGS
3647                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3648                           cat >conftest.$ac_ext <<_ACEOF
3649 #line 3649 "configure"
3650 #include "confdefs.h"
3651 #include <stdio.h>
3652 int
3653 main (void)
3654 {
3655 printf("Hello")
3656   ;
3657   return 0;
3658 }
3659 _ACEOF
3660 rm -f conftest.$ac_objext
3661 if { (eval echo "$as_me:3661: \"$ac_compile\"") >&5
3662   (eval $ac_compile) 2>&5
3663   ac_status=$?
3664   echo "$as_me:3664: \$? = $ac_status" >&5
3665   (exit $ac_status); } &&
3666          { ac_try='test -s conftest.$ac_objext'
3667   { (eval echo "$as_me:3667: \"$ac_try\"") >&5
3668   (eval $ac_try) 2>&5
3669   ac_status=$?
3670   echo "$as_me:3670: \$? = $ac_status" >&5
3671   (exit $ac_status); }; }; then
3672   :
3673 else
3674   echo "$as_me: failed program was:" >&5
3675 cat conftest.$ac_ext >&5
3676 cf_have_incdir=yes
3677 fi
3678 rm -f conftest.$ac_objext conftest.$ac_ext
3679                           CPPFLAGS=$cf_save_CPPFLAGS
3680                         fi
3681                   fi
3682                 fi
3683
3684                 if test "$cf_have_incdir" = no ; then
3685                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
3686
3687 echo "${as_me:-configure}:3687: testing adding $cf_add_incdir to include-path ..." 1>&5
3688
3689                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
3690
3691                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
3692                   test "$cf_top_incdir" = "$cf_add_incdir" && break
3693                   cf_add_incdir="$cf_top_incdir"
3694                 else
3695                   break
3696                 fi
3697           else
3698                 break
3699           fi
3700         done
3701   done
3702 fi
3703
3704 if test -n "$cf_cv_curses_dir/lib" ; then
3705         for cf_add_libdir in $cf_cv_curses_dir/lib
3706         do
3707                 if test $cf_add_libdir = /usr/lib ; then
3708                         :
3709                 elif test -d $cf_add_libdir
3710                 then
3711                         cf_have_libdir=no
3712                         if test -n "$LDFLAGS$LIBS" ; then
3713                                 # a loop is needed to ensure we can add subdirs of existing dirs
3714                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
3715                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
3716                                                 cf_have_libdir=yes; break
3717                                         fi
3718                                 done
3719                         fi
3720                         if test "$cf_have_libdir" = no ; then
3721                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
3722
3723 echo "${as_me:-configure}:3723: testing adding $cf_add_libdir to library-path ..." 1>&5
3724
3725                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
3726                         fi
3727                 fi
3728         done
3729 fi
3730
3731         fi
3732 fi
3733
3734 cf_ncuconfig_root=ncurses
3735 cf_have_ncuconfig=no
3736
3737 if test "x${PKG_CONFIG:=none}" != xnone; then
3738         echo "$as_me:3738: checking pkg-config for $cf_ncuconfig_root" >&5
3739 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
3740         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3741                 echo "$as_me:3741: result: yes" >&5
3742 echo "${ECHO_T}yes" >&6
3743
3744                 echo "$as_me:3744: checking if the $cf_ncuconfig_root package files work" >&5
3745 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
3746                 cf_have_ncuconfig=unknown
3747
3748                 cf_save_CPPFLAGS="$CPPFLAGS"
3749                 cf_save_LIBS="$LIBS"
3750
3751                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
3752
3753 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
3754 # Filter out duplicates - this happens with badly-designed ".pc" files...
3755 for cf_add_1lib in $LIBS
3756 do
3757         for cf_add_2lib in $cf_add_libs
3758         do
3759                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3760                 then
3761                         cf_add_1lib=
3762                         break
3763                 fi
3764         done
3765         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3766 done
3767 LIBS="$cf_add_libs"
3768
3769                 cat >conftest.$ac_ext <<_ACEOF
3770 #line 3770 "configure"
3771 #include "confdefs.h"
3772 #include <${cf_cv_ncurses_header:-curses.h}>
3773 int
3774 main (void)
3775 {
3776 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
3777   ;
3778   return 0;
3779 }
3780 _ACEOF
3781 rm -f conftest.$ac_objext conftest$ac_exeext
3782 if { (eval echo "$as_me:3782: \"$ac_link\"") >&5
3783   (eval $ac_link) 2>&5
3784   ac_status=$?
3785   echo "$as_me:3785: \$? = $ac_status" >&5
3786   (exit $ac_status); } &&
3787          { ac_try='test -s conftest$ac_exeext'
3788   { (eval echo "$as_me:3788: \"$ac_try\"") >&5
3789   (eval $ac_try) 2>&5
3790   ac_status=$?
3791   echo "$as_me:3791: \$? = $ac_status" >&5
3792   (exit $ac_status); }; }; then
3793   if test "$cross_compiling" = yes; then
3794   cf_have_ncuconfig=maybe
3795 else
3796   cat >conftest.$ac_ext <<_ACEOF
3797 #line 3797 "configure"
3798 #include "confdefs.h"
3799 #include <${cf_cv_ncurses_header:-curses.h}>
3800                                 int main(void)
3801                                 { char *xx = curses_version(); return (xx == 0); }
3802 _ACEOF
3803 rm -f conftest$ac_exeext
3804 if { (eval echo "$as_me:3804: \"$ac_link\"") >&5
3805   (eval $ac_link) 2>&5
3806   ac_status=$?
3807   echo "$as_me:3807: \$? = $ac_status" >&5
3808   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3809   { (eval echo "$as_me:3809: \"$ac_try\"") >&5
3810   (eval $ac_try) 2>&5
3811   ac_status=$?
3812   echo "$as_me:3812: \$? = $ac_status" >&5
3813   (exit $ac_status); }; }; then
3814   cf_have_ncuconfig=yes
3815 else
3816   echo "$as_me: program exited with status $ac_status" >&5
3817 echo "$as_me: failed program was:" >&5
3818 cat conftest.$ac_ext >&5
3819 cf_have_ncuconfig=no
3820 fi
3821 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3822 fi
3823 else
3824   echo "$as_me: failed program was:" >&5
3825 cat conftest.$ac_ext >&5
3826 cf_have_ncuconfig=no
3827 fi
3828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3829                 echo "$as_me:3829: result: $cf_have_ncuconfig" >&5
3830 echo "${ECHO_T}$cf_have_ncuconfig" >&6
3831                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3832                 if test "$cf_have_ncuconfig" != "yes"
3833                 then
3834                         CPPFLAGS="$cf_save_CPPFLAGS"
3835                         LIBS="$cf_save_LIBS"
3836                         NCURSES_CONFIG_PKG=none
3837                 else
3838
3839 cat >>confdefs.h <<\EOF
3840 #define NCURSES 1
3841 EOF
3842
3843                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3844                 fi
3845
3846 echo "$as_me:3846: checking for terminfo header" >&5
3847 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
3848 if test "${cf_cv_term_header+set}" = set; then
3849   echo $ECHO_N "(cached) $ECHO_C" >&6
3850 else
3851
3852 case ${cf_cv_ncurses_header} in
3853 (*/ncurses.h|*/ncursesw.h)
3854         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
3855         ;;
3856 (*)
3857         cf_term_header=term.h
3858         ;;
3859 esac
3860
3861 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
3862 do
3863 cat >conftest.$ac_ext <<_ACEOF
3864 #line 3864 "configure"
3865 #include "confdefs.h"
3866 #include <stdio.h>
3867 #include <${cf_cv_ncurses_header:-curses.h}>
3868 #include <$cf_test>
3869
3870 int
3871 main (void)
3872 {
3873 int x = auto_left_margin
3874   ;
3875   return 0;
3876 }
3877 _ACEOF
3878 rm -f conftest.$ac_objext
3879 if { (eval echo "$as_me:3879: \"$ac_compile\"") >&5
3880   (eval $ac_compile) 2>&5
3881   ac_status=$?
3882   echo "$as_me:3882: \$? = $ac_status" >&5
3883   (exit $ac_status); } &&
3884          { ac_try='test -s conftest.$ac_objext'
3885   { (eval echo "$as_me:3885: \"$ac_try\"") >&5
3886   (eval $ac_try) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); }; }; then
3890
3891         cf_cv_term_header="$cf_test"
3892 else
3893   echo "$as_me: failed program was:" >&5
3894 cat conftest.$ac_ext >&5
3895
3896         cf_cv_term_header=unknown
3897
3898 fi
3899 rm -f conftest.$ac_objext conftest.$ac_ext
3900         test "$cf_cv_term_header" != unknown && break
3901 done
3902
3903 fi
3904 echo "$as_me:3904: result: $cf_cv_term_header" >&5
3905 echo "${ECHO_T}$cf_cv_term_header" >&6
3906
3907 # Set definitions to allow ifdef'ing to accommodate subdirectories
3908
3909 case $cf_cv_term_header in
3910 (*term.h)
3911
3912 cat >>confdefs.h <<\EOF
3913 #define HAVE_TERM_H 1
3914 EOF
3915
3916         ;;
3917 esac
3918
3919 case $cf_cv_term_header in
3920 (ncurses/term.h)
3921
3922 cat >>confdefs.h <<\EOF
3923 #define HAVE_NCURSES_TERM_H 1
3924 EOF
3925
3926         ;;
3927 (ncursesw/term.h)
3928
3929 cat >>confdefs.h <<\EOF
3930 #define HAVE_NCURSESW_TERM_H 1
3931 EOF
3932
3933         ;;
3934 esac
3935
3936         else
3937                 echo "$as_me:3937: result: no" >&5
3938 echo "${ECHO_T}no" >&6
3939                 NCURSES_CONFIG_PKG=none
3940         fi
3941 else
3942         NCURSES_CONFIG_PKG=none
3943 fi
3944
3945 if test "x$cf_have_ncuconfig" = "xno"; then
3946         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
3947
3948 if test -n "$ac_tool_prefix"; then
3949   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3950   do
3951     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3952 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3953 echo "$as_me:3953: checking for $ac_word" >&5
3954 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3955 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
3956   echo $ECHO_N "(cached) $ECHO_C" >&6
3957 else
3958   if test -n "$NCURSES_CONFIG"; then
3959   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
3960 else
3961   ac_save_IFS=$IFS; IFS=$ac_path_separator
3962 ac_dummy="$PATH"
3963 for ac_dir in $ac_dummy; do
3964   IFS=$ac_save_IFS
3965   test -z "$ac_dir" && ac_dir=.
3966   $as_executable_p "$ac_dir/$ac_word" || continue
3967 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
3968 echo "$as_me:3968: found $ac_dir/$ac_word" >&5
3969 break
3970 done
3971
3972 fi
3973 fi
3974 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
3975 if test -n "$NCURSES_CONFIG"; then
3976   echo "$as_me:3976: result: $NCURSES_CONFIG" >&5
3977 echo "${ECHO_T}$NCURSES_CONFIG" >&6
3978 else
3979   echo "$as_me:3979: result: no" >&5
3980 echo "${ECHO_T}no" >&6
3981 fi
3982
3983     test -n "$NCURSES_CONFIG" && break
3984   done
3985 fi
3986 if test -z "$NCURSES_CONFIG"; then
3987   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
3988   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
3989 do
3990   # Extract the first word of "$ac_prog", so it can be a program name with args.
3991 set dummy $ac_prog; ac_word=$2
3992 echo "$as_me:3992: checking for $ac_word" >&5
3993 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3994 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
3995   echo $ECHO_N "(cached) $ECHO_C" >&6
3996 else
3997   if test -n "$ac_ct_NCURSES_CONFIG"; then
3998   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
3999 else
4000   ac_save_IFS=$IFS; IFS=$ac_path_separator
4001 ac_dummy="$PATH"
4002 for ac_dir in $ac_dummy; do
4003   IFS=$ac_save_IFS
4004   test -z "$ac_dir" && ac_dir=.
4005   $as_executable_p "$ac_dir/$ac_word" || continue
4006 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
4007 echo "$as_me:4007: found $ac_dir/$ac_word" >&5
4008 break
4009 done
4010
4011 fi
4012 fi
4013 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
4014 if test -n "$ac_ct_NCURSES_CONFIG"; then
4015   echo "$as_me:4015: result: $ac_ct_NCURSES_CONFIG" >&5
4016 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
4017 else
4018   echo "$as_me:4018: result: no" >&5
4019 echo "${ECHO_T}no" >&6
4020 fi
4021
4022   test -n "$ac_ct_NCURSES_CONFIG" && break
4023 done
4024 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
4025
4026   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
4027 fi
4028
4029         if test "$NCURSES_CONFIG" != none ; then
4030
4031                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
4032
4033 cf_add_libs="`$NCURSES_CONFIG --libs`"
4034 # Filter out duplicates - this happens with badly-designed ".pc" files...
4035 for cf_add_1lib in $LIBS
4036 do
4037         for cf_add_2lib in $cf_add_libs
4038         do
4039                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4040                 then
4041                         cf_add_1lib=
4042                         break
4043                 fi
4044         done
4045         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4046 done
4047 LIBS="$cf_add_libs"
4048
4049                 # even with config script, some packages use no-override for curses.h
4050
4051 echo "$as_me:4051: checking if we have identified curses headers" >&5
4052 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4053 if test "${cf_cv_ncurses_header+set}" = set; then
4054   echo $ECHO_N "(cached) $ECHO_C" >&6
4055 else
4056
4057 cf_cv_ncurses_header=none
4058 for cf_header in \
4059         ncurses.h ncurses/ncurses.h \
4060         curses.h ncurses/curses.h
4061 do
4062 cat >conftest.$ac_ext <<_ACEOF
4063 #line 4063 "configure"
4064 #include "confdefs.h"
4065 #include <${cf_header}>
4066 int
4067 main (void)
4068 {
4069 initscr(); tgoto("?", 0,0)
4070   ;
4071   return 0;
4072 }
4073 _ACEOF
4074 rm -f conftest.$ac_objext
4075 if { (eval echo "$as_me:4075: \"$ac_compile\"") >&5
4076   (eval $ac_compile) 2>&5
4077   ac_status=$?
4078   echo "$as_me:4078: \$? = $ac_status" >&5
4079   (exit $ac_status); } &&
4080          { ac_try='test -s conftest.$ac_objext'
4081   { (eval echo "$as_me:4081: \"$ac_try\"") >&5
4082   (eval $ac_try) 2>&5
4083   ac_status=$?
4084   echo "$as_me:4084: \$? = $ac_status" >&5
4085   (exit $ac_status); }; }; then
4086   cf_cv_ncurses_header=$cf_header; break
4087 else
4088   echo "$as_me: failed program was:" >&5
4089 cat conftest.$ac_ext >&5
4090 fi
4091 rm -f conftest.$ac_objext conftest.$ac_ext
4092 done
4093
4094 fi
4095 echo "$as_me:4095: result: $cf_cv_ncurses_header" >&5
4096 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4097
4098 if test "$cf_cv_ncurses_header" = none ; then
4099         { { echo "$as_me:4099: error: No curses header-files found" >&5
4100 echo "$as_me: error: No curses header-files found" >&2;}
4101    { (exit 1); exit 1; }; }
4102 fi
4103
4104 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4105
4106 for ac_header in $cf_cv_ncurses_header
4107 do
4108 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4109 echo "$as_me:4109: checking for $ac_header" >&5
4110 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4111 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4112   echo $ECHO_N "(cached) $ECHO_C" >&6
4113 else
4114   cat >conftest.$ac_ext <<_ACEOF
4115 #line 4115 "configure"
4116 #include "confdefs.h"
4117 #include <$ac_header>
4118 _ACEOF
4119 if { (eval echo "$as_me:4119: \"$ac_cpp conftest.$ac_ext\"") >&5
4120   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4121   ac_status=$?
4122   egrep -v '^ *\+' conftest.er1 >conftest.err
4123   rm -f conftest.er1
4124   cat conftest.err >&5
4125   echo "$as_me:4125: \$? = $ac_status" >&5
4126   (exit $ac_status); } >/dev/null; then
4127   if test -s conftest.err; then
4128     ac_cpp_err=$ac_c_preproc_warn_flag
4129   else
4130     ac_cpp_err=
4131   fi
4132 else
4133   ac_cpp_err=yes
4134 fi
4135 if test -z "$ac_cpp_err"; then
4136   eval "$as_ac_Header=yes"
4137 else
4138   echo "$as_me: failed program was:" >&5
4139   cat conftest.$ac_ext >&5
4140   eval "$as_ac_Header=no"
4141 fi
4142 rm -f conftest.err conftest.$ac_ext
4143 fi
4144 echo "$as_me:4144: result: `eval echo '${'$as_ac_Header'}'`" >&5
4145 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4146 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4147   cat >>confdefs.h <<EOF
4148 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4149 EOF
4150
4151 fi
4152 done
4153
4154 cat >>confdefs.h <<\EOF
4155 #define NCURSES 1
4156 EOF
4157
4158 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4159
4160                 cat >>confdefs.h <<EOF
4161 #define $cf_nculib_ROOT 1
4162 EOF
4163
4164                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
4165
4166         else
4167
4168 cf_ncuhdr_root=ncurses
4169
4170 test -n "$cf_cv_curses_dir" && \
4171 test "$cf_cv_curses_dir" != "no" && { \
4172
4173 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
4174   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
4175   do
4176         while test $cf_add_incdir != /usr/include
4177         do
4178           if test -d $cf_add_incdir
4179           then
4180                 cf_have_incdir=no
4181                 if test -n "$CFLAGS$CPPFLAGS" ; then
4182                   # a loop is needed to ensure we can add subdirs of existing dirs
4183                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4184                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4185                           cf_have_incdir=yes; break
4186                         fi
4187                   done
4188                 fi
4189
4190                 if test "$cf_have_incdir" = no ; then
4191                   if test "$cf_add_incdir" = /usr/local/include ; then
4192                         if test "$GCC" = yes
4193                         then
4194                           cf_save_CPPFLAGS=$CPPFLAGS
4195                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4196                           cat >conftest.$ac_ext <<_ACEOF
4197 #line 4197 "configure"
4198 #include "confdefs.h"
4199 #include <stdio.h>
4200 int
4201 main (void)
4202 {
4203 printf("Hello")
4204   ;
4205   return 0;
4206 }
4207 _ACEOF
4208 rm -f conftest.$ac_objext
4209 if { (eval echo "$as_me:4209: \"$ac_compile\"") >&5
4210   (eval $ac_compile) 2>&5
4211   ac_status=$?
4212   echo "$as_me:4212: \$? = $ac_status" >&5
4213   (exit $ac_status); } &&
4214          { ac_try='test -s conftest.$ac_objext'
4215   { (eval echo "$as_me:4215: \"$ac_try\"") >&5
4216   (eval $ac_try) 2>&5
4217   ac_status=$?
4218   echo "$as_me:4218: \$? = $ac_status" >&5
4219   (exit $ac_status); }; }; then
4220   :
4221 else
4222   echo "$as_me: failed program was:" >&5
4223 cat conftest.$ac_ext >&5
4224 cf_have_incdir=yes
4225 fi
4226 rm -f conftest.$ac_objext conftest.$ac_ext
4227                           CPPFLAGS=$cf_save_CPPFLAGS
4228                         fi
4229                   fi
4230                 fi
4231
4232                 if test "$cf_have_incdir" = no ; then
4233                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4234
4235 echo "${as_me:-configure}:4235: testing adding $cf_add_incdir to include-path ..." 1>&5
4236
4237                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4238
4239                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4240                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4241                   cf_add_incdir="$cf_top_incdir"
4242                 else
4243                   break
4244                 fi
4245           else
4246                 break
4247           fi
4248         done
4249   done
4250 fi
4251
4252 }
4253
4254 echo "$as_me:4254: checking for $cf_ncuhdr_root header in include-path" >&5
4255 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
4256 if test "${cf_cv_ncurses_h+set}" = set; then
4257   echo $ECHO_N "(cached) $ECHO_C" >&6
4258 else
4259
4260         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
4261         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
4262         for cf_header in $cf_header_list
4263         do
4264
4265         cat >conftest.$ac_ext <<_ACEOF
4266 #line 4266 "configure"
4267 #include "confdefs.h"
4268
4269 #include <$cf_header>
4270 int
4271 main (void)
4272 {
4273
4274 #ifdef NCURSES_VERSION
4275
4276 printf("%s\n", NCURSES_VERSION);
4277 #else
4278 #ifdef __NCURSES_H
4279 printf("old\n");
4280 #else
4281         make an error
4282 #endif
4283 #endif
4284
4285   ;
4286   return 0;
4287 }
4288 _ACEOF
4289 rm -f conftest.$ac_objext
4290 if { (eval echo "$as_me:4290: \"$ac_compile\"") >&5
4291   (eval $ac_compile) 2>&5
4292   ac_status=$?
4293   echo "$as_me:4293: \$? = $ac_status" >&5
4294   (exit $ac_status); } &&
4295          { ac_try='test -s conftest.$ac_objext'
4296   { (eval echo "$as_me:4296: \"$ac_try\"") >&5
4297   (eval $ac_try) 2>&5
4298   ac_status=$?
4299   echo "$as_me:4299: \$? = $ac_status" >&5
4300   (exit $ac_status); }; }; then
4301   cf_cv_ncurses_h=$cf_header
4302
4303 else
4304   echo "$as_me: failed program was:" >&5
4305 cat conftest.$ac_ext >&5
4306 cf_cv_ncurses_h=no
4307 fi
4308 rm -f conftest.$ac_objext conftest.$ac_ext
4309
4310                 test "$cf_cv_ncurses_h" != no && break
4311         done
4312
4313 fi
4314 echo "$as_me:4314: result: $cf_cv_ncurses_h" >&5
4315 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
4316
4317 if test "$cf_cv_ncurses_h" != no ; then
4318         cf_cv_ncurses_header=$cf_cv_ncurses_h
4319 else
4320
4321 echo "$as_me:4321: checking for $cf_ncuhdr_root include-path" >&5
4322 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
4323 if test "${cf_cv_ncurses_h2+set}" = set; then
4324   echo $ECHO_N "(cached) $ECHO_C" >&6
4325 else
4326
4327         test -n "$verbose" && echo
4328
4329 cf_search=
4330
4331 # collect the current set of include-directories from compiler flags
4332 cf_header_path_list=""
4333 if test -n "${CFLAGS}${CPPFLAGS}" ; then
4334         for cf_header_path in $CPPFLAGS $CFLAGS
4335         do
4336                 case $cf_header_path in
4337                 (-I*)
4338                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
4339
4340 test "x$cf_header_path" != "xNONE" && \
4341 test -d "$cf_header_path" && \
4342  {
4343         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
4344         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
4345         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
4346         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
4347         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
4348         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"
4349 }
4350
4351                         cf_header_path_list="$cf_header_path_list $cf_search"
4352                         ;;
4353                 esac
4354         done
4355 fi
4356
4357 # add the variations for the package we are looking for
4358
4359 cf_search=
4360
4361 test "x$prefix" != "xNONE" && \
4362 test -d "$prefix" && \
4363  {
4364         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
4365         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
4366         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
4367         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
4368         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
4369         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
4370 }
4371
4372 for cf_subdir_prefix in \
4373         /usr \
4374         /usr/local \
4375         /usr/pkg \
4376         /opt \
4377         /opt/local \
4378         $HOME
4379 do
4380
4381 test "x$cf_subdir_prefix" != "x$prefix" && \
4382 test -d "$cf_subdir_prefix" && \
4383 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
4384         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
4385         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
4386         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
4387         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
4388         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
4389         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"
4390 }
4391
4392 done
4393
4394 test "$includedir" != NONE && \
4395 test "$includedir" != "/usr/include" && \
4396 test -d "$includedir" && {
4397         test -d $includedir &&    cf_search="$cf_search $includedir"
4398         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
4399 }
4400
4401 test "$oldincludedir" != NONE && \
4402 test "$oldincludedir" != "/usr/include" && \
4403 test -d "$oldincludedir" && {
4404         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
4405         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
4406 }
4407
4408 cf_search="$cf_search $cf_header_path_list"
4409
4410         test -n "$verbose" && echo search path $cf_search
4411         cf_save2_CPPFLAGS="$CPPFLAGS"
4412         for cf_incdir in $cf_search
4413         do
4414
4415 if test -n "$cf_incdir" ; then
4416   for cf_add_incdir in $cf_incdir
4417   do
4418         while test $cf_add_incdir != /usr/include
4419         do
4420           if test -d $cf_add_incdir
4421           then
4422                 cf_have_incdir=no
4423                 if test -n "$CFLAGS$CPPFLAGS" ; then
4424                   # a loop is needed to ensure we can add subdirs of existing dirs
4425                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4426                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4427                           cf_have_incdir=yes; break
4428                         fi
4429                   done
4430                 fi
4431
4432                 if test "$cf_have_incdir" = no ; then
4433                   if test "$cf_add_incdir" = /usr/local/include ; then
4434                         if test "$GCC" = yes
4435                         then
4436                           cf_save_CPPFLAGS=$CPPFLAGS
4437                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4438                           cat >conftest.$ac_ext <<_ACEOF
4439 #line 4439 "configure"
4440 #include "confdefs.h"
4441 #include <stdio.h>
4442 int
4443 main (void)
4444 {
4445 printf("Hello")
4446   ;
4447   return 0;
4448 }
4449 _ACEOF
4450 rm -f conftest.$ac_objext
4451 if { (eval echo "$as_me:4451: \"$ac_compile\"") >&5
4452   (eval $ac_compile) 2>&5
4453   ac_status=$?
4454   echo "$as_me:4454: \$? = $ac_status" >&5
4455   (exit $ac_status); } &&
4456          { ac_try='test -s conftest.$ac_objext'
4457   { (eval echo "$as_me:4457: \"$ac_try\"") >&5
4458   (eval $ac_try) 2>&5
4459   ac_status=$?
4460   echo "$as_me:4460: \$? = $ac_status" >&5
4461   (exit $ac_status); }; }; then
4462   :
4463 else
4464   echo "$as_me: failed program was:" >&5
4465 cat conftest.$ac_ext >&5
4466 cf_have_incdir=yes
4467 fi
4468 rm -f conftest.$ac_objext conftest.$ac_ext
4469                           CPPFLAGS=$cf_save_CPPFLAGS
4470                         fi
4471                   fi
4472                 fi
4473
4474                 if test "$cf_have_incdir" = no ; then
4475                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4476
4477 echo "${as_me:-configure}:4477: testing adding $cf_add_incdir to include-path ..." 1>&5
4478
4479                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4480
4481                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4482                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4483                   cf_add_incdir="$cf_top_incdir"
4484                 else
4485                   break
4486                 fi
4487           else
4488                 break
4489           fi
4490         done
4491   done
4492 fi
4493
4494                 for cf_header in \
4495                         ncurses.h \
4496                         curses.h
4497                 do
4498
4499         cat >conftest.$ac_ext <<_ACEOF
4500 #line 4500 "configure"
4501 #include "confdefs.h"
4502
4503 #include <$cf_header>
4504 int
4505 main (void)
4506 {
4507
4508 #ifdef NCURSES_VERSION
4509
4510 printf("%s\n", NCURSES_VERSION);
4511 #else
4512 #ifdef __NCURSES_H
4513 printf("old\n");
4514 #else
4515         make an error
4516 #endif
4517 #endif
4518
4519   ;
4520   return 0;
4521 }
4522 _ACEOF
4523 rm -f conftest.$ac_objext
4524 if { (eval echo "$as_me:4524: \"$ac_compile\"") >&5
4525   (eval $ac_compile) 2>&5
4526   ac_status=$?
4527   echo "$as_me:4527: \$? = $ac_status" >&5
4528   (exit $ac_status); } &&
4529          { ac_try='test -s conftest.$ac_objext'
4530   { (eval echo "$as_me:4530: \"$ac_try\"") >&5
4531   (eval $ac_try) 2>&5
4532   ac_status=$?
4533   echo "$as_me:4533: \$? = $ac_status" >&5
4534   (exit $ac_status); }; }; then
4535   cf_cv_ncurses_h2=$cf_header
4536
4537 else
4538   echo "$as_me: failed program was:" >&5
4539 cat conftest.$ac_ext >&5
4540 cf_cv_ncurses_h2=no
4541 fi
4542 rm -f conftest.$ac_objext conftest.$ac_ext
4543
4544                         if test "$cf_cv_ncurses_h2" != no ; then
4545                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
4546                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
4547                                 break
4548                         fi
4549                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
4550                 done
4551                 CPPFLAGS="$cf_save2_CPPFLAGS"
4552                 test "$cf_cv_ncurses_h2" != no && break
4553         done
4554         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4554: error: not found" >&5
4555 echo "$as_me: error: not found" >&2;}
4556    { (exit 1); exit 1; }; }
4557
4558 fi
4559 echo "$as_me:4559: result: $cf_cv_ncurses_h2" >&5
4560 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
4561
4562         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
4563         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
4564         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
4565                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
4566         fi
4567
4568 if test -n "$cf_1st_incdir" ; then
4569   for cf_add_incdir in $cf_1st_incdir
4570   do
4571         while test $cf_add_incdir != /usr/include
4572         do
4573           if test -d $cf_add_incdir
4574           then
4575                 cf_have_incdir=no
4576                 if test -n "$CFLAGS$CPPFLAGS" ; then
4577                   # a loop is needed to ensure we can add subdirs of existing dirs
4578                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4579                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4580                           cf_have_incdir=yes; break
4581                         fi
4582                   done
4583                 fi
4584
4585                 if test "$cf_have_incdir" = no ; then
4586                   if test "$cf_add_incdir" = /usr/local/include ; then
4587                         if test "$GCC" = yes
4588                         then
4589                           cf_save_CPPFLAGS=$CPPFLAGS
4590                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4591                           cat >conftest.$ac_ext <<_ACEOF
4592 #line 4592 "configure"
4593 #include "confdefs.h"
4594 #include <stdio.h>
4595 int
4596 main (void)
4597 {
4598 printf("Hello")
4599   ;
4600   return 0;
4601 }
4602 _ACEOF
4603 rm -f conftest.$ac_objext
4604 if { (eval echo "$as_me:4604: \"$ac_compile\"") >&5
4605   (eval $ac_compile) 2>&5
4606   ac_status=$?
4607   echo "$as_me:4607: \$? = $ac_status" >&5
4608   (exit $ac_status); } &&
4609          { ac_try='test -s conftest.$ac_objext'
4610   { (eval echo "$as_me:4610: \"$ac_try\"") >&5
4611   (eval $ac_try) 2>&5
4612   ac_status=$?
4613   echo "$as_me:4613: \$? = $ac_status" >&5
4614   (exit $ac_status); }; }; then
4615   :
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat conftest.$ac_ext >&5
4619 cf_have_incdir=yes
4620 fi
4621 rm -f conftest.$ac_objext conftest.$ac_ext
4622                           CPPFLAGS=$cf_save_CPPFLAGS
4623                         fi
4624                   fi
4625                 fi
4626
4627                 if test "$cf_have_incdir" = no ; then
4628                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4629
4630 echo "${as_me:-configure}:4630: testing adding $cf_add_incdir to include-path ..." 1>&5
4631
4632                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4633
4634                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4635                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4636                   cf_add_incdir="$cf_top_incdir"
4637                 else
4638                   break
4639                 fi
4640           else
4641                 break
4642           fi
4643         done
4644   done
4645 fi
4646
4647 fi
4648
4649 # Set definitions to allow ifdef'ing for ncurses.h
4650
4651 case $cf_cv_ncurses_header in
4652 (*ncurses.h)
4653
4654 cat >>confdefs.h <<\EOF
4655 #define HAVE_NCURSES_H 1
4656 EOF
4657
4658         ;;
4659 esac
4660
4661 case $cf_cv_ncurses_header in
4662 (ncurses/curses.h|ncurses/ncurses.h)
4663
4664 cat >>confdefs.h <<\EOF
4665 #define HAVE_NCURSES_NCURSES_H 1
4666 EOF
4667
4668         ;;
4669 (ncursesw/curses.h|ncursesw/ncurses.h)
4670
4671 cat >>confdefs.h <<\EOF
4672 #define HAVE_NCURSESW_NCURSES_H 1
4673 EOF
4674
4675         ;;
4676 esac
4677
4678 echo "$as_me:4678: checking for terminfo header" >&5
4679 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4680 if test "${cf_cv_term_header+set}" = set; then
4681   echo $ECHO_N "(cached) $ECHO_C" >&6
4682 else
4683
4684 case ${cf_cv_ncurses_header} in
4685 (*/ncurses.h|*/ncursesw.h)
4686         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4687         ;;
4688 (*)
4689         cf_term_header=term.h
4690         ;;
4691 esac
4692
4693 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4694 do
4695 cat >conftest.$ac_ext <<_ACEOF
4696 #line 4696 "configure"
4697 #include "confdefs.h"
4698 #include <stdio.h>
4699 #include <${cf_cv_ncurses_header:-curses.h}>
4700 #include <$cf_test>
4701
4702 int
4703 main (void)
4704 {
4705 int x = auto_left_margin
4706   ;
4707   return 0;
4708 }
4709 _ACEOF
4710 rm -f conftest.$ac_objext
4711 if { (eval echo "$as_me:4711: \"$ac_compile\"") >&5
4712   (eval $ac_compile) 2>&5
4713   ac_status=$?
4714   echo "$as_me:4714: \$? = $ac_status" >&5
4715   (exit $ac_status); } &&
4716          { ac_try='test -s conftest.$ac_objext'
4717   { (eval echo "$as_me:4717: \"$ac_try\"") >&5
4718   (eval $ac_try) 2>&5
4719   ac_status=$?
4720   echo "$as_me:4720: \$? = $ac_status" >&5
4721   (exit $ac_status); }; }; then
4722
4723         cf_cv_term_header="$cf_test"
4724 else
4725   echo "$as_me: failed program was:" >&5
4726 cat conftest.$ac_ext >&5
4727
4728         cf_cv_term_header=unknown
4729
4730 fi
4731 rm -f conftest.$ac_objext conftest.$ac_ext
4732         test "$cf_cv_term_header" != unknown && break
4733 done
4734
4735 fi
4736 echo "$as_me:4736: result: $cf_cv_term_header" >&5
4737 echo "${ECHO_T}$cf_cv_term_header" >&6
4738
4739 # Set definitions to allow ifdef'ing to accommodate subdirectories
4740
4741 case $cf_cv_term_header in
4742 (*term.h)
4743
4744 cat >>confdefs.h <<\EOF
4745 #define HAVE_TERM_H 1
4746 EOF
4747
4748         ;;
4749 esac
4750
4751 case $cf_cv_term_header in
4752 (ncurses/term.h)
4753
4754 cat >>confdefs.h <<\EOF
4755 #define HAVE_NCURSES_TERM_H 1
4756 EOF
4757
4758         ;;
4759 (ncursesw/term.h)
4760
4761 cat >>confdefs.h <<\EOF
4762 #define HAVE_NCURSESW_TERM_H 1
4763 EOF
4764
4765         ;;
4766 esac
4767
4768 # some applications need this, but should check for NCURSES_VERSION
4769
4770 cat >>confdefs.h <<\EOF
4771 #define NCURSES 1
4772 EOF
4773
4774 echo "$as_me:4774: checking for ncurses version" >&5
4775 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4776 if test "${cf_cv_ncurses_version+set}" = set; then
4777   echo $ECHO_N "(cached) $ECHO_C" >&6
4778 else
4779
4780         cf_cv_ncurses_version=no
4781         cf_tempfile=out$$
4782         rm -f $cf_tempfile
4783         if test "$cross_compiling" = yes; then
4784
4785         # This will not work if the preprocessor splits the line after the
4786         # Autoconf token.  The 'unproto' program does that.
4787         cat > conftest.$ac_ext <<EOF
4788 #include <${cf_cv_ncurses_header:-curses.h}>
4789 #undef Autoconf
4790 #ifdef NCURSES_VERSION
4791 Autoconf NCURSES_VERSION
4792 #else
4793 #ifdef __NCURSES_H
4794 Autoconf "old"
4795 #endif
4796 ;
4797 #endif
4798 EOF
4799         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4800         { (eval echo "$as_me:4800: \"$cf_try\"") >&5
4801   (eval $cf_try) 2>&5
4802   ac_status=$?
4803   echo "$as_me:4803: \$? = $ac_status" >&5
4804   (exit $ac_status); }
4805         if test -f conftest.out ; then
4806                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4807                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4808                 rm -f conftest.out
4809         fi
4810
4811 else
4812   cat >conftest.$ac_ext <<_ACEOF
4813 #line 4813 "configure"
4814 #include "confdefs.h"
4815
4816 #include <${cf_cv_ncurses_header:-curses.h}>
4817 #include <stdio.h>
4818 int main(void)
4819 {
4820         FILE *fp = fopen("$cf_tempfile", "w");
4821 #ifdef NCURSES_VERSION
4822 # ifdef NCURSES_VERSION_PATCH
4823         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4824 # else
4825         fprintf(fp, "%s\n", NCURSES_VERSION);
4826 # endif
4827 #else
4828 # ifdef __NCURSES_H
4829         fprintf(fp, "old\n");
4830 # else
4831         make an error
4832 # endif
4833 #endif
4834         ${cf_cv_main_return:-return}(0);
4835 }
4836 _ACEOF
4837 rm -f conftest$ac_exeext
4838 if { (eval echo "$as_me:4838: \"$ac_link\"") >&5
4839   (eval $ac_link) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4843   { (eval echo "$as_me:4843: \"$ac_try\"") >&5
4844   (eval $ac_try) 2>&5
4845   ac_status=$?
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); }; }; then
4848
4849         cf_cv_ncurses_version=`cat $cf_tempfile`
4850 else
4851   echo "$as_me: program exited with status $ac_status" >&5
4852 echo "$as_me: failed program was:" >&5
4853 cat conftest.$ac_ext >&5
4854 fi
4855 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4856 fi
4857         rm -f $cf_tempfile
4858
4859 fi
4860 echo "$as_me:4860: result: $cf_cv_ncurses_version" >&5
4861 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4862 test "$cf_cv_ncurses_version" = no ||
4863 cat >>confdefs.h <<\EOF
4864 #define NCURSES 1
4865 EOF
4866
4867 cf_nculib_root=ncurses
4868         # This works, except for the special case where we find gpm, but
4869         # ncurses is in a nonstandard location via $LIBS, and we really want
4870         # to link gpm.
4871 cf_ncurses_LIBS=""
4872 cf_ncurses_SAVE="$LIBS"
4873 echo "$as_me:4873: checking for Gpm_Open in -lgpm" >&5
4874 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
4875 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
4876   echo $ECHO_N "(cached) $ECHO_C" >&6
4877 else
4878   ac_check_lib_save_LIBS=$LIBS
4879 LIBS="-lgpm  $LIBS"
4880 cat >conftest.$ac_ext <<_ACEOF
4881 #line 4881 "configure"
4882 #include "confdefs.h"
4883
4884 /* Override any gcc2 internal prototype to avoid an error.  */
4885 #ifdef __cplusplus
4886 extern "C"
4887 #endif
4888 /* We use char because int might match the return type of a gcc2
4889    builtin and then its argument prototype would still apply.  */
4890 char Gpm_Open ();
4891 int
4892 main (void)
4893 {
4894 Gpm_Open ();
4895   ;
4896   return 0;
4897 }
4898 _ACEOF
4899 rm -f conftest.$ac_objext conftest$ac_exeext
4900 if { (eval echo "$as_me:4900: \"$ac_link\"") >&5
4901   (eval $ac_link) 2>&5
4902   ac_status=$?
4903   echo "$as_me:4903: \$? = $ac_status" >&5
4904   (exit $ac_status); } &&
4905          { ac_try='test -s conftest$ac_exeext'
4906   { (eval echo "$as_me:4906: \"$ac_try\"") >&5
4907   (eval $ac_try) 2>&5
4908   ac_status=$?
4909   echo "$as_me:4909: \$? = $ac_status" >&5
4910   (exit $ac_status); }; }; then
4911   ac_cv_lib_gpm_Gpm_Open=yes
4912 else
4913   echo "$as_me: failed program was:" >&5
4914 cat conftest.$ac_ext >&5
4915 ac_cv_lib_gpm_Gpm_Open=no
4916 fi
4917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4918 LIBS=$ac_check_lib_save_LIBS
4919 fi
4920 echo "$as_me:4920: result: $ac_cv_lib_gpm_Gpm_Open" >&5
4921 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
4922 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
4923   echo "$as_me:4923: checking for initscr in -lgpm" >&5
4924 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
4925 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
4926   echo $ECHO_N "(cached) $ECHO_C" >&6
4927 else
4928   ac_check_lib_save_LIBS=$LIBS
4929 LIBS="-lgpm  $LIBS"
4930 cat >conftest.$ac_ext <<_ACEOF
4931 #line 4931 "configure"
4932 #include "confdefs.h"
4933
4934 /* Override any gcc2 internal prototype to avoid an error.  */
4935 #ifdef __cplusplus
4936 extern "C"
4937 #endif
4938 /* We use char because int might match the return type of a gcc2
4939    builtin and then its argument prototype would still apply.  */
4940 char initscr ();
4941 int
4942 main (void)
4943 {
4944 initscr ();
4945   ;
4946   return 0;
4947 }
4948 _ACEOF
4949 rm -f conftest.$ac_objext conftest$ac_exeext
4950 if { (eval echo "$as_me:4950: \"$ac_link\"") >&5
4951   (eval $ac_link) 2>&5
4952   ac_status=$?
4953   echo "$as_me:4953: \$? = $ac_status" >&5
4954   (exit $ac_status); } &&
4955          { ac_try='test -s conftest$ac_exeext'
4956   { (eval echo "$as_me:4956: \"$ac_try\"") >&5
4957   (eval $ac_try) 2>&5
4958   ac_status=$?
4959   echo "$as_me:4959: \$? = $ac_status" >&5
4960   (exit $ac_status); }; }; then
4961   ac_cv_lib_gpm_initscr=yes
4962 else
4963   echo "$as_me: failed program was:" >&5
4964 cat conftest.$ac_ext >&5
4965 ac_cv_lib_gpm_initscr=no
4966 fi
4967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4968 LIBS=$ac_check_lib_save_LIBS
4969 fi
4970 echo "$as_me:4970: result: $ac_cv_lib_gpm_initscr" >&5
4971 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
4972 if test $ac_cv_lib_gpm_initscr = yes; then
4973   LIBS="$cf_ncurses_SAVE"
4974 else
4975   cf_ncurses_LIBS="-lgpm"
4976 fi
4977
4978 fi
4979
4980 case $host_os in
4981 (freebsd*)
4982         # This is only necessary if you are linking against an obsolete
4983         # version of ncurses (but it should do no harm, since it's static).
4984         if test "$cf_nculib_root" = ncurses ; then
4985                 echo "$as_me:4985: checking for tgoto in -lmytinfo" >&5
4986 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4987 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4988   echo $ECHO_N "(cached) $ECHO_C" >&6
4989 else
4990   ac_check_lib_save_LIBS=$LIBS
4991 LIBS="-lmytinfo  $LIBS"
4992 cat >conftest.$ac_ext <<_ACEOF
4993 #line 4993 "configure"
4994 #include "confdefs.h"
4995
4996 /* Override any gcc2 internal prototype to avoid an error.  */
4997 #ifdef __cplusplus
4998 extern "C"
4999 #endif
5000 /* We use char because int might match the return type of a gcc2
5001    builtin and then its argument prototype would still apply.  */
5002 char tgoto ();
5003 int
5004 main (void)
5005 {
5006 tgoto ();
5007   ;
5008   return 0;
5009 }
5010 _ACEOF
5011 rm -f conftest.$ac_objext conftest$ac_exeext
5012 if { (eval echo "$as_me:5012: \"$ac_link\"") >&5
5013   (eval $ac_link) 2>&5
5014   ac_status=$?
5015   echo "$as_me:5015: \$? = $ac_status" >&5
5016   (exit $ac_status); } &&
5017          { ac_try='test -s conftest$ac_exeext'
5018   { (eval echo "$as_me:5018: \"$ac_try\"") >&5
5019   (eval $ac_try) 2>&5
5020   ac_status=$?
5021   echo "$as_me:5021: \$? = $ac_status" >&5
5022   (exit $ac_status); }; }; then
5023   ac_cv_lib_mytinfo_tgoto=yes
5024 else
5025   echo "$as_me: failed program was:" >&5
5026 cat conftest.$ac_ext >&5
5027 ac_cv_lib_mytinfo_tgoto=no
5028 fi
5029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5030 LIBS=$ac_check_lib_save_LIBS
5031 fi
5032 echo "$as_me:5032: result: $ac_cv_lib_mytinfo_tgoto" >&5
5033 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5034 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5035   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
5036 fi
5037
5038         fi
5039         ;;
5040 esac
5041
5042 cf_add_libs="$cf_ncurses_LIBS"
5043 # Filter out duplicates - this happens with badly-designed ".pc" files...
5044 for cf_add_1lib in $LIBS
5045 do
5046         for cf_add_2lib in $cf_add_libs
5047         do
5048                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5049                 then
5050                         cf_add_1lib=
5051                         break
5052                 fi
5053         done
5054         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5055 done
5056 LIBS="$cf_add_libs"
5057
5058 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5059 then
5060
5061 cf_add_libs="-l$cf_nculib_root"
5062 # Filter out duplicates - this happens with badly-designed ".pc" files...
5063 for cf_add_1lib in $LIBS
5064 do
5065         for cf_add_2lib in $cf_add_libs
5066         do
5067                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5068                 then
5069                         cf_add_1lib=
5070                         break
5071                 fi
5072         done
5073         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5074 done
5075 LIBS="$cf_add_libs"
5076
5077 else
5078
5079         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
5080         cf_libdir=""
5081         echo "$as_me:5081: checking for initscr" >&5
5082 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
5083 if test "${ac_cv_func_initscr+set}" = set; then
5084   echo $ECHO_N "(cached) $ECHO_C" >&6
5085 else
5086   cat >conftest.$ac_ext <<_ACEOF
5087 #line 5087 "configure"
5088 #include "confdefs.h"
5089 /* System header to define __stub macros and hopefully few prototypes,
5090     which can conflict with char initscr (); below.  */
5091 #include <assert.h>
5092 /* Override any gcc2 internal prototype to avoid an error.  */
5093 #ifdef __cplusplus
5094 extern "C"
5095 #endif
5096 /* We use char because int might match the return type of a gcc2
5097    builtin and then its argument prototype would still apply.  */
5098 char initscr ();
5099 char (*f) ();
5100
5101 int
5102 main (void)
5103 {
5104 /* The GNU C library defines this for functions which it implements
5105     to always fail with ENOSYS.  Some functions are actually named
5106     something starting with __ and the normal name is an alias.  */
5107 #if defined (__stub_initscr) || defined (__stub___initscr)
5108 choke me
5109 #else
5110 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5111 #endif
5112
5113   ;
5114   return 0;
5115 }
5116 _ACEOF
5117 rm -f conftest.$ac_objext conftest$ac_exeext
5118 if { (eval echo "$as_me:5118: \"$ac_link\"") >&5
5119   (eval $ac_link) 2>&5
5120   ac_status=$?
5121   echo "$as_me:5121: \$? = $ac_status" >&5
5122   (exit $ac_status); } &&
5123          { ac_try='test -s conftest$ac_exeext'
5124   { (eval echo "$as_me:5124: \"$ac_try\"") >&5
5125   (eval $ac_try) 2>&5
5126   ac_status=$?
5127   echo "$as_me:5127: \$? = $ac_status" >&5
5128   (exit $ac_status); }; }; then
5129   ac_cv_func_initscr=yes
5130 else
5131   echo "$as_me: failed program was:" >&5
5132 cat conftest.$ac_ext >&5
5133 ac_cv_func_initscr=no
5134 fi
5135 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5136 fi
5137 echo "$as_me:5137: result: $ac_cv_func_initscr" >&5
5138 echo "${ECHO_T}$ac_cv_func_initscr" >&6
5139 if test $ac_cv_func_initscr = yes; then
5140   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5141 else
5142
5143                 cf_save_LIBS="$LIBS"
5144                 echo "$as_me:5144: checking for initscr in -l$cf_nculib_root" >&5
5145 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
5146                 LIBS="-l$cf_nculib_root $LIBS"
5147                 cat >conftest.$ac_ext <<_ACEOF
5148 #line 5148 "configure"
5149 #include "confdefs.h"
5150 #include <${cf_cv_ncurses_header:-curses.h}>
5151 int
5152 main (void)
5153 {
5154 initscr()
5155   ;
5156   return 0;
5157 }
5158 _ACEOF
5159 rm -f conftest.$ac_objext conftest$ac_exeext
5160 if { (eval echo "$as_me:5160: \"$ac_link\"") >&5
5161   (eval $ac_link) 2>&5
5162   ac_status=$?
5163   echo "$as_me:5163: \$? = $ac_status" >&5
5164   (exit $ac_status); } &&
5165          { ac_try='test -s conftest$ac_exeext'
5166   { (eval echo "$as_me:5166: \"$ac_try\"") >&5
5167   (eval $ac_try) 2>&5
5168   ac_status=$?
5169   echo "$as_me:5169: \$? = $ac_status" >&5
5170   (exit $ac_status); }; }; then
5171   echo "$as_me:5171: result: yes" >&5
5172 echo "${ECHO_T}yes" >&6
5173                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5174
5175 else
5176   echo "$as_me: failed program was:" >&5
5177 cat conftest.$ac_ext >&5
5178 echo "$as_me:5178: result: no" >&5
5179 echo "${ECHO_T}no" >&6
5180
5181 cf_search=
5182 cf_library_path_list=""
5183 if test -n "${LDFLAGS}${LIBS}" ; then
5184         for cf_library_path in $LDFLAGS $LIBS
5185         do
5186                 case $cf_library_path in
5187                 (-L*)
5188                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5189
5190 test "x$cf_library_path" != "xNONE" && \
5191 test -d "$cf_library_path" && \
5192  {
5193         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5194         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5195         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
5196         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
5197         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
5198         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"
5199 }
5200
5201                         cf_library_path_list="$cf_library_path_list $cf_search"
5202                         ;;
5203                 esac
5204         done
5205 fi
5206
5207 cf_search=
5208
5209 test "x$prefix" != "xNONE" && \
5210 test -d "$prefix" && \
5211  {
5212         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5213         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5214         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
5215         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
5216         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
5217         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
5218 }
5219
5220 for cf_subdir_prefix in \
5221         /usr \
5222         /usr/local \
5223         /usr/pkg \
5224         /opt \
5225         /opt/local \
5226         $HOME
5227 do
5228
5229 test "x$cf_subdir_prefix" != "x$prefix" && \
5230 test -d "$cf_subdir_prefix" && \
5231 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5232         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5233         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5234         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
5235         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
5236         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
5237         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"
5238 }
5239
5240 done
5241
5242 cf_search="$cf_library_path_list $cf_search"
5243
5244                         for cf_libdir in $cf_search
5245                         do
5246                                 echo "$as_me:5246: checking for -l$cf_nculib_root in $cf_libdir" >&5
5247 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
5248                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
5249                                 cat >conftest.$ac_ext <<_ACEOF
5250 #line 5250 "configure"
5251 #include "confdefs.h"
5252 #include <${cf_cv_ncurses_header:-curses.h}>
5253 int
5254 main (void)
5255 {
5256 initscr()
5257   ;
5258   return 0;
5259 }
5260 _ACEOF
5261 rm -f conftest.$ac_objext conftest$ac_exeext
5262 if { (eval echo "$as_me:5262: \"$ac_link\"") >&5
5263   (eval $ac_link) 2>&5
5264   ac_status=$?
5265   echo "$as_me:5265: \$? = $ac_status" >&5
5266   (exit $ac_status); } &&
5267          { ac_try='test -s conftest$ac_exeext'
5268   { (eval echo "$as_me:5268: \"$ac_try\"") >&5
5269   (eval $ac_try) 2>&5
5270   ac_status=$?
5271   echo "$as_me:5271: \$? = $ac_status" >&5
5272   (exit $ac_status); }; }; then
5273   echo "$as_me:5273: result: yes" >&5
5274 echo "${ECHO_T}yes" >&6
5275                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
5276                                          break
5277 else
5278   echo "$as_me: failed program was:" >&5
5279 cat conftest.$ac_ext >&5
5280 echo "$as_me:5280: result: no" >&5
5281 echo "${ECHO_T}no" >&6
5282                                          LIBS="$cf_save_LIBS"
5283 fi
5284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5285                         done
5286
5287 fi
5288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5289
5290 fi
5291
5292 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
5293
5294 if test $cf_found_library = no ; then
5295         { { echo "$as_me:5295: error: Cannot link $cf_nculib_root library" >&5
5296 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
5297    { (exit 1); exit 1; }; }
5298 fi
5299
5300 fi
5301
5302 if test -n "$cf_ncurses_LIBS" ; then
5303         echo "$as_me:5303: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
5304 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
5305         cf_ncurses_SAVE="$LIBS"
5306         for p in $cf_ncurses_LIBS ; do
5307                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
5308                 if test "$q" != "$LIBS" ; then
5309                         LIBS="$q"
5310                 fi
5311         done
5312         cat >conftest.$ac_ext <<_ACEOF
5313 #line 5313 "configure"
5314 #include "confdefs.h"
5315 #include <${cf_cv_ncurses_header:-curses.h}>
5316 int
5317 main (void)
5318 {
5319 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5320   ;
5321   return 0;
5322 }
5323 _ACEOF
5324 rm -f conftest.$ac_objext conftest$ac_exeext
5325 if { (eval echo "$as_me:5325: \"$ac_link\"") >&5
5326   (eval $ac_link) 2>&5
5327   ac_status=$?
5328   echo "$as_me:5328: \$? = $ac_status" >&5
5329   (exit $ac_status); } &&
5330          { ac_try='test -s conftest$ac_exeext'
5331   { (eval echo "$as_me:5331: \"$ac_try\"") >&5
5332   (eval $ac_try) 2>&5
5333   ac_status=$?
5334   echo "$as_me:5334: \$? = $ac_status" >&5
5335   (exit $ac_status); }; }; then
5336   echo "$as_me:5336: result: yes" >&5
5337 echo "${ECHO_T}yes" >&6
5338 else
5339   echo "$as_me: failed program was:" >&5
5340 cat conftest.$ac_ext >&5
5341 echo "$as_me:5341: result: no" >&5
5342 echo "${ECHO_T}no" >&6
5343                  LIBS="$cf_ncurses_SAVE"
5344 fi
5345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5346 fi
5347
5348 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
5349
5350 cat >>confdefs.h <<EOF
5351 #define $cf_nculib_ROOT 1
5352 EOF
5353
5354         fi
5355 else
5356         NCURSES_CONFIG=none
5357 fi
5358
5359 echo "$as_me:5359: checking if you want wide-character code" >&5
5360 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
5361
5362 # Check whether --enable-widec or --disable-widec was given.
5363 if test "${enable_widec+set}" = set; then
5364   enableval="$enable_widec"
5365   with_widec=$enableval
5366 else
5367   with_widec=no
5368 fi;
5369 echo "$as_me:5369: result: $with_widec" >&5
5370 echo "${ECHO_T}$with_widec" >&6
5371 if test "$with_widec" = yes ; then
5372
5373 echo "$as_me:5373: checking for multibyte character support" >&5
5374 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5375 if test "${cf_cv_utf8_lib+set}" = set; then
5376   echo $ECHO_N "(cached) $ECHO_C" >&6
5377 else
5378
5379         cf_save_LIBS="$LIBS"
5380         cat >conftest.$ac_ext <<_ACEOF
5381 #line 5381 "configure"
5382 #include "confdefs.h"
5383
5384 #include <stdlib.h>
5385 int
5386 main (void)
5387 {
5388 putwc(0,0);
5389   ;
5390   return 0;
5391 }
5392 _ACEOF
5393 rm -f conftest.$ac_objext conftest$ac_exeext
5394 if { (eval echo "$as_me:5394: \"$ac_link\"") >&5
5395   (eval $ac_link) 2>&5
5396   ac_status=$?
5397   echo "$as_me:5397: \$? = $ac_status" >&5
5398   (exit $ac_status); } &&
5399          { ac_try='test -s conftest$ac_exeext'
5400   { (eval echo "$as_me:5400: \"$ac_try\"") >&5
5401   (eval $ac_try) 2>&5
5402   ac_status=$?
5403   echo "$as_me:5403: \$? = $ac_status" >&5
5404   (exit $ac_status); }; }; then
5405   cf_cv_utf8_lib=yes
5406 else
5407   echo "$as_me: failed program was:" >&5
5408 cat conftest.$ac_ext >&5
5409
5410 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5411 # will be set on completion of the AC_TRY_LINK below.
5412 cf_cv_header_path_utf8=
5413 cf_cv_library_path_utf8=
5414
5415 echo "${as_me:-configure}:5415: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5416
5417 cf_save_LIBS="$LIBS"
5418
5419 cat >conftest.$ac_ext <<_ACEOF
5420 #line 5420 "configure"
5421 #include "confdefs.h"
5422
5423 #include <libutf8.h>
5424 int
5425 main (void)
5426 {
5427 putwc(0,0);
5428   ;
5429   return 0;
5430 }
5431 _ACEOF
5432 rm -f conftest.$ac_objext conftest$ac_exeext
5433 if { (eval echo "$as_me:5433: \"$ac_link\"") >&5
5434   (eval $ac_link) 2>&5
5435   ac_status=$?
5436   echo "$as_me:5436: \$? = $ac_status" >&5
5437   (exit $ac_status); } &&
5438          { ac_try='test -s conftest$ac_exeext'
5439   { (eval echo "$as_me:5439: \"$ac_try\"") >&5
5440   (eval $ac_try) 2>&5
5441   ac_status=$?
5442   echo "$as_me:5442: \$? = $ac_status" >&5
5443   (exit $ac_status); }; }; then
5444
5445         cf_cv_find_linkage_utf8=yes
5446         cf_cv_header_path_utf8=/usr/include
5447         cf_cv_library_path_utf8=/usr/lib
5448
5449 else
5450   echo "$as_me: failed program was:" >&5
5451 cat conftest.$ac_ext >&5
5452
5453 LIBS="-lutf8  $cf_save_LIBS"
5454
5455 cat >conftest.$ac_ext <<_ACEOF
5456 #line 5456 "configure"
5457 #include "confdefs.h"
5458
5459 #include <libutf8.h>
5460 int
5461 main (void)
5462 {
5463 putwc(0,0);
5464   ;
5465   return 0;
5466 }
5467 _ACEOF
5468 rm -f conftest.$ac_objext conftest$ac_exeext
5469 if { (eval echo "$as_me:5469: \"$ac_link\"") >&5
5470   (eval $ac_link) 2>&5
5471   ac_status=$?
5472   echo "$as_me:5472: \$? = $ac_status" >&5
5473   (exit $ac_status); } &&
5474          { ac_try='test -s conftest$ac_exeext'
5475   { (eval echo "$as_me:5475: \"$ac_try\"") >&5
5476   (eval $ac_try) 2>&5
5477   ac_status=$?
5478   echo "$as_me:5478: \$? = $ac_status" >&5
5479   (exit $ac_status); }; }; then
5480
5481         cf_cv_find_linkage_utf8=yes
5482         cf_cv_header_path_utf8=/usr/include
5483         cf_cv_library_path_utf8=/usr/lib
5484         cf_cv_library_file_utf8="-lutf8"
5485
5486 else
5487   echo "$as_me: failed program was:" >&5
5488 cat conftest.$ac_ext >&5
5489
5490         cf_cv_find_linkage_utf8=no
5491         LIBS="$cf_save_LIBS"
5492
5493         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5494
5495 echo "${as_me:-configure}:5495: testing find linkage for utf8 library ..." 1>&5
5496
5497 echo "${as_me:-configure}:5497: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5498
5499         cf_save_CPPFLAGS="$CPPFLAGS"
5500         cf_test_CPPFLAGS="$CPPFLAGS"
5501
5502 cf_search=
5503
5504 # collect the current set of include-directories from compiler flags
5505 cf_header_path_list=""
5506 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5507         for cf_header_path in $CPPFLAGS $CFLAGS
5508         do
5509                 case $cf_header_path in
5510                 (-I*)
5511                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5512
5513 test "x$cf_header_path" != "xNONE" && \
5514 test -d "$cf_header_path" && \
5515  {
5516         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5517         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5518         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5519         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5520         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5521         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5522 }
5523
5524                         cf_header_path_list="$cf_header_path_list $cf_search"
5525                         ;;
5526                 esac
5527         done
5528 fi
5529
5530 # add the variations for the package we are looking for
5531
5532 cf_search=
5533
5534 test "x$prefix" != "xNONE" && \
5535 test -d "$prefix" && \
5536  {
5537         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5538         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5539         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5540         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5541         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5542         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5543 }
5544
5545 for cf_subdir_prefix in \
5546         /usr \
5547         /usr/local \
5548         /usr/pkg \
5549         /opt \
5550         /opt/local \
5551         $HOME
5552 do
5553
5554 test "x$cf_subdir_prefix" != "x$prefix" && \
5555 test -d "$cf_subdir_prefix" && \
5556 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5557         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5558         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5559         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5560         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5561         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5562         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5563 }
5564
5565 done
5566
5567 test "$includedir" != NONE && \
5568 test "$includedir" != "/usr/include" && \
5569 test -d "$includedir" && {
5570         test -d $includedir &&    cf_search="$cf_search $includedir"
5571         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5572 }
5573
5574 test "$oldincludedir" != NONE && \
5575 test "$oldincludedir" != "/usr/include" && \
5576 test -d "$oldincludedir" && {
5577         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5578         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5579 }
5580
5581 cf_search="$cf_search $cf_header_path_list"
5582
5583         for cf_cv_header_path_utf8 in $cf_search
5584         do
5585                 if test -d $cf_cv_header_path_utf8 ; then
5586                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5587
5588 echo "${as_me:-configure}:5588: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5589
5590                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5591                         cat >conftest.$ac_ext <<_ACEOF
5592 #line 5592 "configure"
5593 #include "confdefs.h"
5594
5595 #include <libutf8.h>
5596 int
5597 main (void)
5598 {
5599 putwc(0,0);
5600   ;
5601   return 0;
5602 }
5603 _ACEOF
5604 rm -f conftest.$ac_objext
5605 if { (eval echo "$as_me:5605: \"$ac_compile\"") >&5
5606   (eval $ac_compile) 2>&5
5607   ac_status=$?
5608   echo "$as_me:5608: \$? = $ac_status" >&5
5609   (exit $ac_status); } &&
5610          { ac_try='test -s conftest.$ac_objext'
5611   { (eval echo "$as_me:5611: \"$ac_try\"") >&5
5612   (eval $ac_try) 2>&5
5613   ac_status=$?
5614   echo "$as_me:5614: \$? = $ac_status" >&5
5615   (exit $ac_status); }; }; then
5616
5617                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5618
5619 echo "${as_me:-configure}:5619: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5620
5621                                 cf_cv_find_linkage_utf8=maybe
5622                                 cf_test_CPPFLAGS="$CPPFLAGS"
5623                                 break
5624 else
5625   echo "$as_me: failed program was:" >&5
5626 cat conftest.$ac_ext >&5
5627
5628                                 CPPFLAGS="$cf_save_CPPFLAGS"
5629
5630 fi
5631 rm -f conftest.$ac_objext conftest.$ac_ext
5632                 fi
5633         done
5634
5635         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5636
5637 echo "${as_me:-configure}:5637: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5638
5639                 cf_save_LIBS="$LIBS"
5640                 cf_save_LDFLAGS="$LDFLAGS"
5641
5642                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5643
5644 cf_search=
5645 cf_library_path_list=""
5646 if test -n "${LDFLAGS}${LIBS}" ; then
5647         for cf_library_path in $LDFLAGS $LIBS
5648         do
5649                 case $cf_library_path in
5650                 (-L*)
5651                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5652
5653 test "x$cf_library_path" != "xNONE" && \
5654 test -d "$cf_library_path" && \
5655  {
5656         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5657         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5658         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5659         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5660         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5661         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5662 }
5663
5664                         cf_library_path_list="$cf_library_path_list $cf_search"
5665                         ;;
5666                 esac
5667         done
5668 fi
5669
5670 cf_search=
5671
5672 test "x$prefix" != "xNONE" && \
5673 test -d "$prefix" && \
5674  {
5675         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5676         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5677         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5678         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5679         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5680         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5681 }
5682
5683 for cf_subdir_prefix in \
5684         /usr \
5685         /usr/local \
5686         /usr/pkg \
5687         /opt \
5688         /opt/local \
5689         $HOME
5690 do
5691
5692 test "x$cf_subdir_prefix" != "x$prefix" && \
5693 test -d "$cf_subdir_prefix" && \
5694 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5695         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5696         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5697         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5698         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5699         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5700         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5701 }
5702
5703 done
5704
5705 cf_search="$cf_library_path_list $cf_search"
5706
5707                         for cf_cv_library_path_utf8 in $cf_search
5708                         do
5709                                 if test -d $cf_cv_library_path_utf8 ; then
5710                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5711
5712 echo "${as_me:-configure}:5712: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5713
5714                                         CPPFLAGS="$cf_test_CPPFLAGS"
5715                                         LIBS="-lutf8  $cf_save_LIBS"
5716                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5717                                         cat >conftest.$ac_ext <<_ACEOF
5718 #line 5718 "configure"
5719 #include "confdefs.h"
5720
5721 #include <libutf8.h>
5722 int
5723 main (void)
5724 {
5725 putwc(0,0);
5726   ;
5727   return 0;
5728 }
5729 _ACEOF
5730 rm -f conftest.$ac_objext conftest$ac_exeext
5731 if { (eval echo "$as_me:5731: \"$ac_link\"") >&5
5732   (eval $ac_link) 2>&5
5733   ac_status=$?
5734   echo "$as_me:5734: \$? = $ac_status" >&5
5735   (exit $ac_status); } &&
5736          { ac_try='test -s conftest$ac_exeext'
5737   { (eval echo "$as_me:5737: \"$ac_try\"") >&5
5738   (eval $ac_try) 2>&5
5739   ac_status=$?
5740   echo "$as_me:5740: \$? = $ac_status" >&5
5741   (exit $ac_status); }; }; then
5742
5743                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5744
5745 echo "${as_me:-configure}:5745: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5746
5747                                         cf_cv_find_linkage_utf8=yes
5748                                         cf_cv_library_file_utf8="-lutf8"
5749                                         break
5750 else
5751   echo "$as_me: failed program was:" >&5
5752 cat conftest.$ac_ext >&5
5753
5754                                         CPPFLAGS="$cf_save_CPPFLAGS"
5755                                         LIBS="$cf_save_LIBS"
5756                                         LDFLAGS="$cf_save_LDFLAGS"
5757
5758 fi
5759 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5760                                 fi
5761                         done
5762                         CPPFLAGS="$cf_save_CPPFLAGS"
5763                         LDFLAGS="$cf_save_LDFLAGS"
5764                 fi
5765
5766         else
5767                 cf_cv_find_linkage_utf8=no
5768         fi
5769
5770 fi
5771 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5772
5773 fi
5774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5775
5776 LIBS="$cf_save_LIBS"
5777
5778 if test "$cf_cv_find_linkage_utf8" = yes ; then
5779 cf_cv_utf8_lib=add-on
5780 else
5781 cf_cv_utf8_lib=no
5782 fi
5783
5784 fi
5785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5786 fi
5787 echo "$as_me:5787: result: $cf_cv_utf8_lib" >&5
5788 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5789
5790 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5791 # ncurses/ncursesw:
5792 if test "$cf_cv_utf8_lib" = "add-on" ; then
5793
5794 cat >>confdefs.h <<\EOF
5795 #define HAVE_LIBUTF8_H 1
5796 EOF
5797
5798 if test -n "$cf_cv_header_path_utf8" ; then
5799   for cf_add_incdir in $cf_cv_header_path_utf8
5800   do
5801         while test $cf_add_incdir != /usr/include
5802         do
5803           if test -d $cf_add_incdir
5804           then
5805                 cf_have_incdir=no
5806                 if test -n "$CFLAGS$CPPFLAGS" ; then
5807                   # a loop is needed to ensure we can add subdirs of existing dirs
5808                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5809                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5810                           cf_have_incdir=yes; break
5811                         fi
5812                   done
5813                 fi
5814
5815                 if test "$cf_have_incdir" = no ; then
5816                   if test "$cf_add_incdir" = /usr/local/include ; then
5817                         if test "$GCC" = yes
5818                         then
5819                           cf_save_CPPFLAGS=$CPPFLAGS
5820                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5821                           cat >conftest.$ac_ext <<_ACEOF
5822 #line 5822 "configure"
5823 #include "confdefs.h"
5824 #include <stdio.h>
5825 int
5826 main (void)
5827 {
5828 printf("Hello")
5829   ;
5830   return 0;
5831 }
5832 _ACEOF
5833 rm -f conftest.$ac_objext
5834 if { (eval echo "$as_me:5834: \"$ac_compile\"") >&5
5835   (eval $ac_compile) 2>&5
5836   ac_status=$?
5837   echo "$as_me:5837: \$? = $ac_status" >&5
5838   (exit $ac_status); } &&
5839          { ac_try='test -s conftest.$ac_objext'
5840   { (eval echo "$as_me:5840: \"$ac_try\"") >&5
5841   (eval $ac_try) 2>&5
5842   ac_status=$?
5843   echo "$as_me:5843: \$? = $ac_status" >&5
5844   (exit $ac_status); }; }; then
5845   :
5846 else
5847   echo "$as_me: failed program was:" >&5
5848 cat conftest.$ac_ext >&5
5849 cf_have_incdir=yes
5850 fi
5851 rm -f conftest.$ac_objext conftest.$ac_ext
5852                           CPPFLAGS=$cf_save_CPPFLAGS
5853                         fi
5854                   fi
5855                 fi
5856
5857                 if test "$cf_have_incdir" = no ; then
5858                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5859
5860 echo "${as_me:-configure}:5860: testing adding $cf_add_incdir to include-path ..." 1>&5
5861
5862                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5863
5864                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5865                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5866                   cf_add_incdir="$cf_top_incdir"
5867                 else
5868                   break
5869                 fi
5870           else
5871                 break
5872           fi
5873         done
5874   done
5875 fi
5876
5877 if test -n "$cf_cv_library_path_utf8" ; then
5878         for cf_add_libdir in $cf_cv_library_path_utf8
5879         do
5880                 if test $cf_add_libdir = /usr/lib ; then
5881                         :
5882                 elif test -d $cf_add_libdir
5883                 then
5884                         cf_have_libdir=no
5885                         if test -n "$LDFLAGS$LIBS" ; then
5886                                 # a loop is needed to ensure we can add subdirs of existing dirs
5887                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5888                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5889                                                 cf_have_libdir=yes; break
5890                                         fi
5891                                 done
5892                         fi
5893                         if test "$cf_have_libdir" = no ; then
5894                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5895
5896 echo "${as_me:-configure}:5896: testing adding $cf_add_libdir to library-path ..." 1>&5
5897
5898                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5899                         fi
5900                 fi
5901         done
5902 fi
5903
5904 cf_add_libs="$cf_cv_library_file_utf8"
5905 # Filter out duplicates - this happens with badly-designed ".pc" files...
5906 for cf_add_1lib in $LIBS
5907 do
5908         for cf_add_2lib in $cf_add_libs
5909         do
5910                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5911                 then
5912                         cf_add_1lib=
5913                         break
5914                 fi
5915         done
5916         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5917 done
5918 LIBS="$cf_add_libs"
5919
5920 fi
5921
5922 cf_ncuconfig_root=ncursesw
5923 cf_have_ncuconfig=no
5924
5925 if test "x${PKG_CONFIG:=none}" != xnone; then
5926         echo "$as_me:5926: checking pkg-config for $cf_ncuconfig_root" >&5
5927 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
5928         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
5929                 echo "$as_me:5929: result: yes" >&5
5930 echo "${ECHO_T}yes" >&6
5931
5932                 echo "$as_me:5932: checking if the $cf_ncuconfig_root package files work" >&5
5933 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
5934                 cf_have_ncuconfig=unknown
5935
5936                 cf_save_CPPFLAGS="$CPPFLAGS"
5937                 cf_save_LIBS="$LIBS"
5938
5939                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
5940
5941 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
5942 # Filter out duplicates - this happens with badly-designed ".pc" files...
5943 for cf_add_1lib in $LIBS
5944 do
5945         for cf_add_2lib in $cf_add_libs
5946         do
5947                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5948                 then
5949                         cf_add_1lib=
5950                         break
5951                 fi
5952         done
5953         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5954 done
5955 LIBS="$cf_add_libs"
5956
5957                 cat >conftest.$ac_ext <<_ACEOF
5958 #line 5958 "configure"
5959 #include "confdefs.h"
5960 #include <${cf_cv_ncurses_header:-curses.h}>
5961 int
5962 main (void)
5963 {
5964 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
5965   ;
5966   return 0;
5967 }
5968 _ACEOF
5969 rm -f conftest.$ac_objext conftest$ac_exeext
5970 if { (eval echo "$as_me:5970: \"$ac_link\"") >&5
5971   (eval $ac_link) 2>&5
5972   ac_status=$?
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } &&
5975          { ac_try='test -s conftest$ac_exeext'
5976   { (eval echo "$as_me:5976: \"$ac_try\"") >&5
5977   (eval $ac_try) 2>&5
5978   ac_status=$?
5979   echo "$as_me:5979: \$? = $ac_status" >&5
5980   (exit $ac_status); }; }; then
5981   if test "$cross_compiling" = yes; then
5982   cf_have_ncuconfig=maybe
5983 else
5984   cat >conftest.$ac_ext <<_ACEOF
5985 #line 5985 "configure"
5986 #include "confdefs.h"
5987 #include <${cf_cv_ncurses_header:-curses.h}>
5988                                 int main(void)
5989                                 { char *xx = curses_version(); return (xx == 0); }
5990 _ACEOF
5991 rm -f conftest$ac_exeext
5992 if { (eval echo "$as_me:5992: \"$ac_link\"") >&5
5993   (eval $ac_link) 2>&5
5994   ac_status=$?
5995   echo "$as_me:5995: \$? = $ac_status" >&5
5996   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5997   { (eval echo "$as_me:5997: \"$ac_try\"") >&5
5998   (eval $ac_try) 2>&5
5999   ac_status=$?
6000   echo "$as_me:6000: \$? = $ac_status" >&5
6001   (exit $ac_status); }; }; then
6002   cf_have_ncuconfig=yes
6003 else
6004   echo "$as_me: program exited with status $ac_status" >&5
6005 echo "$as_me: failed program was:" >&5
6006 cat conftest.$ac_ext >&5
6007 cf_have_ncuconfig=no
6008 fi
6009 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6010 fi
6011 else
6012   echo "$as_me: failed program was:" >&5
6013 cat conftest.$ac_ext >&5
6014 cf_have_ncuconfig=no
6015 fi
6016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6017                 echo "$as_me:6017: result: $cf_have_ncuconfig" >&5
6018 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6019                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6020                 if test "$cf_have_ncuconfig" != "yes"
6021                 then
6022                         CPPFLAGS="$cf_save_CPPFLAGS"
6023                         LIBS="$cf_save_LIBS"
6024                         NCURSES_CONFIG_PKG=none
6025                 else
6026
6027 cat >>confdefs.h <<\EOF
6028 #define NCURSES 1
6029 EOF
6030
6031                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6032                 fi
6033
6034 echo "$as_me:6034: checking for terminfo header" >&5
6035 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6036 if test "${cf_cv_term_header+set}" = set; then
6037   echo $ECHO_N "(cached) $ECHO_C" >&6
6038 else
6039
6040 case ${cf_cv_ncurses_header} in
6041 (*/ncurses.h|*/ncursesw.h)
6042         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6043         ;;
6044 (*)
6045         cf_term_header=term.h
6046         ;;
6047 esac
6048
6049 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6050 do
6051 cat >conftest.$ac_ext <<_ACEOF
6052 #line 6052 "configure"
6053 #include "confdefs.h"
6054 #include <stdio.h>
6055 #include <${cf_cv_ncurses_header:-curses.h}>
6056 #include <$cf_test>
6057
6058 int
6059 main (void)
6060 {
6061 int x = auto_left_margin
6062   ;
6063   return 0;
6064 }
6065 _ACEOF
6066 rm -f conftest.$ac_objext
6067 if { (eval echo "$as_me:6067: \"$ac_compile\"") >&5
6068   (eval $ac_compile) 2>&5
6069   ac_status=$?
6070   echo "$as_me:6070: \$? = $ac_status" >&5
6071   (exit $ac_status); } &&
6072          { ac_try='test -s conftest.$ac_objext'
6073   { (eval echo "$as_me:6073: \"$ac_try\"") >&5
6074   (eval $ac_try) 2>&5
6075   ac_status=$?
6076   echo "$as_me:6076: \$? = $ac_status" >&5
6077   (exit $ac_status); }; }; then
6078
6079         cf_cv_term_header="$cf_test"
6080 else
6081   echo "$as_me: failed program was:" >&5
6082 cat conftest.$ac_ext >&5
6083
6084         cf_cv_term_header=unknown
6085
6086 fi
6087 rm -f conftest.$ac_objext conftest.$ac_ext
6088         test "$cf_cv_term_header" != unknown && break
6089 done
6090
6091 fi
6092 echo "$as_me:6092: result: $cf_cv_term_header" >&5
6093 echo "${ECHO_T}$cf_cv_term_header" >&6
6094
6095 # Set definitions to allow ifdef'ing to accommodate subdirectories
6096
6097 case $cf_cv_term_header in
6098 (*term.h)
6099
6100 cat >>confdefs.h <<\EOF
6101 #define HAVE_TERM_H 1
6102 EOF
6103
6104         ;;
6105 esac
6106
6107 case $cf_cv_term_header in
6108 (ncurses/term.h)
6109
6110 cat >>confdefs.h <<\EOF
6111 #define HAVE_NCURSES_TERM_H 1
6112 EOF
6113
6114         ;;
6115 (ncursesw/term.h)
6116
6117 cat >>confdefs.h <<\EOF
6118 #define HAVE_NCURSESW_TERM_H 1
6119 EOF
6120
6121         ;;
6122 esac
6123
6124         else
6125                 echo "$as_me:6125: result: no" >&5
6126 echo "${ECHO_T}no" >&6
6127                 NCURSES_CONFIG_PKG=none
6128         fi
6129 else
6130         NCURSES_CONFIG_PKG=none
6131 fi
6132
6133 if test "x$cf_have_ncuconfig" = "xno"; then
6134         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6135
6136 if test -n "$ac_tool_prefix"; then
6137   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6138   do
6139     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6140 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6141 echo "$as_me:6141: checking for $ac_word" >&5
6142 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6143 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6144   echo $ECHO_N "(cached) $ECHO_C" >&6
6145 else
6146   if test -n "$NCURSES_CONFIG"; then
6147   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6148 else
6149   ac_save_IFS=$IFS; IFS=$ac_path_separator
6150 ac_dummy="$PATH"
6151 for ac_dir in $ac_dummy; do
6152   IFS=$ac_save_IFS
6153   test -z "$ac_dir" && ac_dir=.
6154   $as_executable_p "$ac_dir/$ac_word" || continue
6155 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6156 echo "$as_me:6156: found $ac_dir/$ac_word" >&5
6157 break
6158 done
6159
6160 fi
6161 fi
6162 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6163 if test -n "$NCURSES_CONFIG"; then
6164   echo "$as_me:6164: result: $NCURSES_CONFIG" >&5
6165 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6166 else
6167   echo "$as_me:6167: result: no" >&5
6168 echo "${ECHO_T}no" >&6
6169 fi
6170
6171     test -n "$NCURSES_CONFIG" && break
6172   done
6173 fi
6174 if test -z "$NCURSES_CONFIG"; then
6175   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6176   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6177 do
6178   # Extract the first word of "$ac_prog", so it can be a program name with args.
6179 set dummy $ac_prog; ac_word=$2
6180 echo "$as_me:6180: checking for $ac_word" >&5
6181 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6182 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6183   echo $ECHO_N "(cached) $ECHO_C" >&6
6184 else
6185   if test -n "$ac_ct_NCURSES_CONFIG"; then
6186   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6187 else
6188   ac_save_IFS=$IFS; IFS=$ac_path_separator
6189 ac_dummy="$PATH"
6190 for ac_dir in $ac_dummy; do
6191   IFS=$ac_save_IFS
6192   test -z "$ac_dir" && ac_dir=.
6193   $as_executable_p "$ac_dir/$ac_word" || continue
6194 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6195 echo "$as_me:6195: found $ac_dir/$ac_word" >&5
6196 break
6197 done
6198
6199 fi
6200 fi
6201 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6202 if test -n "$ac_ct_NCURSES_CONFIG"; then
6203   echo "$as_me:6203: result: $ac_ct_NCURSES_CONFIG" >&5
6204 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6205 else
6206   echo "$as_me:6206: result: no" >&5
6207 echo "${ECHO_T}no" >&6
6208 fi
6209
6210   test -n "$ac_ct_NCURSES_CONFIG" && break
6211 done
6212 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6213
6214   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6215 fi
6216
6217         if test "$NCURSES_CONFIG" != none ; then
6218
6219                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6220
6221 cf_add_libs="`$NCURSES_CONFIG --libs`"
6222 # Filter out duplicates - this happens with badly-designed ".pc" files...
6223 for cf_add_1lib in $LIBS
6224 do
6225         for cf_add_2lib in $cf_add_libs
6226         do
6227                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6228                 then
6229                         cf_add_1lib=
6230                         break
6231                 fi
6232         done
6233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6234 done
6235 LIBS="$cf_add_libs"
6236
6237                 # even with config script, some packages use no-override for curses.h
6238
6239 echo "$as_me:6239: checking if we have identified curses headers" >&5
6240 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6241 if test "${cf_cv_ncurses_header+set}" = set; then
6242   echo $ECHO_N "(cached) $ECHO_C" >&6
6243 else
6244
6245 cf_cv_ncurses_header=none
6246 for cf_header in \
6247         ncurses.h ncursesw/ncurses.h \
6248         curses.h ncursesw/curses.h
6249 do
6250 cat >conftest.$ac_ext <<_ACEOF
6251 #line 6251 "configure"
6252 #include "confdefs.h"
6253 #include <${cf_header}>
6254 int
6255 main (void)
6256 {
6257 initscr(); tgoto("?", 0,0)
6258   ;
6259   return 0;
6260 }
6261 _ACEOF
6262 rm -f conftest.$ac_objext
6263 if { (eval echo "$as_me:6263: \"$ac_compile\"") >&5
6264   (eval $ac_compile) 2>&5
6265   ac_status=$?
6266   echo "$as_me:6266: \$? = $ac_status" >&5
6267   (exit $ac_status); } &&
6268          { ac_try='test -s conftest.$ac_objext'
6269   { (eval echo "$as_me:6269: \"$ac_try\"") >&5
6270   (eval $ac_try) 2>&5
6271   ac_status=$?
6272   echo "$as_me:6272: \$? = $ac_status" >&5
6273   (exit $ac_status); }; }; then
6274   cf_cv_ncurses_header=$cf_header; break
6275 else
6276   echo "$as_me: failed program was:" >&5
6277 cat conftest.$ac_ext >&5
6278 fi
6279 rm -f conftest.$ac_objext conftest.$ac_ext
6280 done
6281
6282 fi
6283 echo "$as_me:6283: result: $cf_cv_ncurses_header" >&5
6284 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6285
6286 if test "$cf_cv_ncurses_header" = none ; then
6287         { { echo "$as_me:6287: error: No curses header-files found" >&5
6288 echo "$as_me: error: No curses header-files found" >&2;}
6289    { (exit 1); exit 1; }; }
6290 fi
6291
6292 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6293
6294 for ac_header in $cf_cv_ncurses_header
6295 do
6296 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6297 echo "$as_me:6297: checking for $ac_header" >&5
6298 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6299 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6300   echo $ECHO_N "(cached) $ECHO_C" >&6
6301 else
6302   cat >conftest.$ac_ext <<_ACEOF
6303 #line 6303 "configure"
6304 #include "confdefs.h"
6305 #include <$ac_header>
6306 _ACEOF
6307 if { (eval echo "$as_me:6307: \"$ac_cpp conftest.$ac_ext\"") >&5
6308   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6309   ac_status=$?
6310   egrep -v '^ *\+' conftest.er1 >conftest.err
6311   rm -f conftest.er1
6312   cat conftest.err >&5
6313   echo "$as_me:6313: \$? = $ac_status" >&5
6314   (exit $ac_status); } >/dev/null; then
6315   if test -s conftest.err; then
6316     ac_cpp_err=$ac_c_preproc_warn_flag
6317   else
6318     ac_cpp_err=
6319   fi
6320 else
6321   ac_cpp_err=yes
6322 fi
6323 if test -z "$ac_cpp_err"; then
6324   eval "$as_ac_Header=yes"
6325 else
6326   echo "$as_me: failed program was:" >&5
6327   cat conftest.$ac_ext >&5
6328   eval "$as_ac_Header=no"
6329 fi
6330 rm -f conftest.err conftest.$ac_ext
6331 fi
6332 echo "$as_me:6332: result: `eval echo '${'$as_ac_Header'}'`" >&5
6333 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6334 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6335   cat >>confdefs.h <<EOF
6336 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6337 EOF
6338
6339 fi
6340 done
6341
6342 cat >>confdefs.h <<\EOF
6343 #define NCURSES 1
6344 EOF
6345
6346 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6347
6348                 cat >>confdefs.h <<EOF
6349 #define $cf_nculib_ROOT 1
6350 EOF
6351
6352                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6353
6354         else
6355
6356 cf_ncuhdr_root=ncursesw
6357
6358 test -n "$cf_cv_curses_dir" && \
6359 test "$cf_cv_curses_dir" != "no" && { \
6360
6361 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6362   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6363   do
6364         while test $cf_add_incdir != /usr/include
6365         do
6366           if test -d $cf_add_incdir
6367           then
6368                 cf_have_incdir=no
6369                 if test -n "$CFLAGS$CPPFLAGS" ; then
6370                   # a loop is needed to ensure we can add subdirs of existing dirs
6371                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6372                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6373                           cf_have_incdir=yes; break
6374                         fi
6375                   done
6376                 fi
6377
6378                 if test "$cf_have_incdir" = no ; then
6379                   if test "$cf_add_incdir" = /usr/local/include ; then
6380                         if test "$GCC" = yes
6381                         then
6382                           cf_save_CPPFLAGS=$CPPFLAGS
6383                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6384                           cat >conftest.$ac_ext <<_ACEOF
6385 #line 6385 "configure"
6386 #include "confdefs.h"
6387 #include <stdio.h>
6388 int
6389 main (void)
6390 {
6391 printf("Hello")
6392   ;
6393   return 0;
6394 }
6395 _ACEOF
6396 rm -f conftest.$ac_objext
6397 if { (eval echo "$as_me:6397: \"$ac_compile\"") >&5
6398   (eval $ac_compile) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit $ac_status); } &&
6402          { ac_try='test -s conftest.$ac_objext'
6403   { (eval echo "$as_me:6403: \"$ac_try\"") >&5
6404   (eval $ac_try) 2>&5
6405   ac_status=$?
6406   echo "$as_me:6406: \$? = $ac_status" >&5
6407   (exit $ac_status); }; }; then
6408   :
6409 else
6410   echo "$as_me: failed program was:" >&5
6411 cat conftest.$ac_ext >&5
6412 cf_have_incdir=yes
6413 fi
6414 rm -f conftest.$ac_objext conftest.$ac_ext
6415                           CPPFLAGS=$cf_save_CPPFLAGS
6416                         fi
6417                   fi
6418                 fi
6419
6420                 if test "$cf_have_incdir" = no ; then
6421                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6422
6423 echo "${as_me:-configure}:6423: testing adding $cf_add_incdir to include-path ..." 1>&5
6424
6425                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6426
6427                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6428                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6429                   cf_add_incdir="$cf_top_incdir"
6430                 else
6431                   break
6432                 fi
6433           else
6434                 break
6435           fi
6436         done
6437   done
6438 fi
6439
6440 }
6441
6442 echo "$as_me:6442: checking for $cf_ncuhdr_root header in include-path" >&5
6443 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6444 if test "${cf_cv_ncurses_h+set}" = set; then
6445   echo $ECHO_N "(cached) $ECHO_C" >&6
6446 else
6447
6448         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6449         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6450         for cf_header in $cf_header_list
6451         do
6452
6453         cat >conftest.$ac_ext <<_ACEOF
6454 #line 6454 "configure"
6455 #include "confdefs.h"
6456
6457 #define _XOPEN_SOURCE_EXTENDED
6458 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
6459 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
6460
6461 #include <$cf_header>
6462 int
6463 main (void)
6464 {
6465
6466 #ifdef NCURSES_VERSION
6467
6468 #ifndef WACS_BSSB
6469         make an error
6470 #endif
6471
6472 printf("%s\n", NCURSES_VERSION);
6473 #else
6474 #ifdef __NCURSES_H
6475 printf("old\n");
6476 #else
6477         make an error
6478 #endif
6479 #endif
6480
6481   ;
6482   return 0;
6483 }
6484 _ACEOF
6485 rm -f conftest.$ac_objext
6486 if { (eval echo "$as_me:6486: \"$ac_compile\"") >&5
6487   (eval $ac_compile) 2>&5
6488   ac_status=$?
6489   echo "$as_me:6489: \$? = $ac_status" >&5
6490   (exit $ac_status); } &&
6491          { ac_try='test -s conftest.$ac_objext'
6492   { (eval echo "$as_me:6492: \"$ac_try\"") >&5
6493   (eval $ac_try) 2>&5
6494   ac_status=$?
6495   echo "$as_me:6495: \$? = $ac_status" >&5
6496   (exit $ac_status); }; }; then
6497   cf_cv_ncurses_h=$cf_header
6498
6499 else
6500   echo "$as_me: failed program was:" >&5
6501 cat conftest.$ac_ext >&5
6502 cf_cv_ncurses_h=no
6503 fi
6504 rm -f conftest.$ac_objext conftest.$ac_ext
6505
6506                 test "$cf_cv_ncurses_h" != no && break
6507         done
6508
6509 fi
6510 echo "$as_me:6510: result: $cf_cv_ncurses_h" >&5
6511 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6512
6513 if test "$cf_cv_ncurses_h" != no ; then
6514         cf_cv_ncurses_header=$cf_cv_ncurses_h
6515 else
6516
6517 echo "$as_me:6517: checking for $cf_ncuhdr_root include-path" >&5
6518 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6519 if test "${cf_cv_ncurses_h2+set}" = set; then
6520   echo $ECHO_N "(cached) $ECHO_C" >&6
6521 else
6522
6523         test -n "$verbose" && echo
6524
6525 cf_search=
6526
6527 # collect the current set of include-directories from compiler flags
6528 cf_header_path_list=""
6529 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6530         for cf_header_path in $CPPFLAGS $CFLAGS
6531         do
6532                 case $cf_header_path in
6533                 (-I*)
6534                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6535
6536 test "x$cf_header_path" != "xNONE" && \
6537 test -d "$cf_header_path" && \
6538  {
6539         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6540         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6541         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6542         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6543         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6544         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"
6545 }
6546
6547                         cf_header_path_list="$cf_header_path_list $cf_search"
6548                         ;;
6549                 esac
6550         done
6551 fi
6552
6553 # add the variations for the package we are looking for
6554
6555 cf_search=
6556
6557 test "x$prefix" != "xNONE" && \
6558 test -d "$prefix" && \
6559  {
6560         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6561         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6562         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6563         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6564         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6565         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6566 }
6567
6568 for cf_subdir_prefix in \
6569         /usr \
6570         /usr/local \
6571         /usr/pkg \
6572         /opt \
6573         /opt/local \
6574         $HOME
6575 do
6576
6577 test "x$cf_subdir_prefix" != "x$prefix" && \
6578 test -d "$cf_subdir_prefix" && \
6579 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6580         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6581         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6582         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6583         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6584         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6585         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"
6586 }
6587
6588 done
6589
6590 test "$includedir" != NONE && \
6591 test "$includedir" != "/usr/include" && \
6592 test -d "$includedir" && {
6593         test -d $includedir &&    cf_search="$cf_search $includedir"
6594         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6595 }
6596
6597 test "$oldincludedir" != NONE && \
6598 test "$oldincludedir" != "/usr/include" && \
6599 test -d "$oldincludedir" && {
6600         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6601         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6602 }
6603
6604 cf_search="$cf_search $cf_header_path_list"
6605
6606         test -n "$verbose" && echo search path $cf_search
6607         cf_save2_CPPFLAGS="$CPPFLAGS"
6608         for cf_incdir in $cf_search
6609         do
6610
6611 if test -n "$cf_incdir" ; then
6612   for cf_add_incdir in $cf_incdir
6613   do
6614         while test $cf_add_incdir != /usr/include
6615         do
6616           if test -d $cf_add_incdir
6617           then
6618                 cf_have_incdir=no
6619                 if test -n "$CFLAGS$CPPFLAGS" ; then
6620                   # a loop is needed to ensure we can add subdirs of existing dirs
6621                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6622                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6623                           cf_have_incdir=yes; break
6624                         fi
6625                   done
6626                 fi
6627
6628                 if test "$cf_have_incdir" = no ; then
6629                   if test "$cf_add_incdir" = /usr/local/include ; then
6630                         if test "$GCC" = yes
6631                         then
6632                           cf_save_CPPFLAGS=$CPPFLAGS
6633                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6634                           cat >conftest.$ac_ext <<_ACEOF
6635 #line 6635 "configure"
6636 #include "confdefs.h"
6637 #include <stdio.h>
6638 int
6639 main (void)
6640 {
6641 printf("Hello")
6642   ;
6643   return 0;
6644 }
6645 _ACEOF
6646 rm -f conftest.$ac_objext
6647 if { (eval echo "$as_me:6647: \"$ac_compile\"") >&5
6648   (eval $ac_compile) 2>&5
6649   ac_status=$?
6650   echo "$as_me:6650: \$? = $ac_status" >&5
6651   (exit $ac_status); } &&
6652          { ac_try='test -s conftest.$ac_objext'
6653   { (eval echo "$as_me:6653: \"$ac_try\"") >&5
6654   (eval $ac_try) 2>&5
6655   ac_status=$?
6656   echo "$as_me:6656: \$? = $ac_status" >&5
6657   (exit $ac_status); }; }; then
6658   :
6659 else
6660   echo "$as_me: failed program was:" >&5
6661 cat conftest.$ac_ext >&5
6662 cf_have_incdir=yes
6663 fi
6664 rm -f conftest.$ac_objext conftest.$ac_ext
6665                           CPPFLAGS=$cf_save_CPPFLAGS
6666                         fi
6667                   fi
6668                 fi
6669
6670                 if test "$cf_have_incdir" = no ; then
6671                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6672
6673 echo "${as_me:-configure}:6673: testing adding $cf_add_incdir to include-path ..." 1>&5
6674
6675                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6676
6677                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6678                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6679                   cf_add_incdir="$cf_top_incdir"
6680                 else
6681                   break
6682                 fi
6683           else
6684                 break
6685           fi
6686         done
6687   done
6688 fi
6689
6690                 for cf_header in \
6691                         ncurses.h \
6692                         curses.h
6693                 do
6694
6695         cat >conftest.$ac_ext <<_ACEOF
6696 #line 6696 "configure"
6697 #include "confdefs.h"
6698
6699 #include <$cf_header>
6700 int
6701 main (void)
6702 {
6703
6704 #ifdef NCURSES_VERSION
6705
6706 printf("%s\n", NCURSES_VERSION);
6707 #else
6708 #ifdef __NCURSES_H
6709 printf("old\n");
6710 #else
6711         make an error
6712 #endif
6713 #endif
6714
6715   ;
6716   return 0;
6717 }
6718 _ACEOF
6719 rm -f conftest.$ac_objext
6720 if { (eval echo "$as_me:6720: \"$ac_compile\"") >&5
6721   (eval $ac_compile) 2>&5
6722   ac_status=$?
6723   echo "$as_me:6723: \$? = $ac_status" >&5
6724   (exit $ac_status); } &&
6725          { ac_try='test -s conftest.$ac_objext'
6726   { (eval echo "$as_me:6726: \"$ac_try\"") >&5
6727   (eval $ac_try) 2>&5
6728   ac_status=$?
6729   echo "$as_me:6729: \$? = $ac_status" >&5
6730   (exit $ac_status); }; }; then
6731   cf_cv_ncurses_h2=$cf_header
6732
6733 else
6734   echo "$as_me: failed program was:" >&5
6735 cat conftest.$ac_ext >&5
6736 cf_cv_ncurses_h2=no
6737 fi
6738 rm -f conftest.$ac_objext conftest.$ac_ext
6739
6740                         if test "$cf_cv_ncurses_h2" != no ; then
6741                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6742                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6743                                 break
6744                         fi
6745                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6746                 done
6747                 CPPFLAGS="$cf_save2_CPPFLAGS"
6748                 test "$cf_cv_ncurses_h2" != no && break
6749         done
6750         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6750: error: not found" >&5
6751 echo "$as_me: error: not found" >&2;}
6752    { (exit 1); exit 1; }; }
6753
6754 fi
6755 echo "$as_me:6755: result: $cf_cv_ncurses_h2" >&5
6756 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6757
6758         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6759         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6760         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6761                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6762         fi
6763
6764 if test -n "$cf_1st_incdir" ; then
6765   for cf_add_incdir in $cf_1st_incdir
6766   do
6767         while test $cf_add_incdir != /usr/include
6768         do
6769           if test -d $cf_add_incdir
6770           then
6771                 cf_have_incdir=no
6772                 if test -n "$CFLAGS$CPPFLAGS" ; then
6773                   # a loop is needed to ensure we can add subdirs of existing dirs
6774                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6775                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6776                           cf_have_incdir=yes; break
6777                         fi
6778                   done
6779                 fi
6780
6781                 if test "$cf_have_incdir" = no ; then
6782                   if test "$cf_add_incdir" = /usr/local/include ; then
6783                         if test "$GCC" = yes
6784                         then
6785                           cf_save_CPPFLAGS=$CPPFLAGS
6786                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6787                           cat >conftest.$ac_ext <<_ACEOF
6788 #line 6788 "configure"
6789 #include "confdefs.h"
6790 #include <stdio.h>
6791 int
6792 main (void)
6793 {
6794 printf("Hello")
6795   ;
6796   return 0;
6797 }
6798 _ACEOF
6799 rm -f conftest.$ac_objext
6800 if { (eval echo "$as_me:6800: \"$ac_compile\"") >&5
6801   (eval $ac_compile) 2>&5
6802   ac_status=$?
6803   echo "$as_me:6803: \$? = $ac_status" >&5
6804   (exit $ac_status); } &&
6805          { ac_try='test -s conftest.$ac_objext'
6806   { (eval echo "$as_me:6806: \"$ac_try\"") >&5
6807   (eval $ac_try) 2>&5
6808   ac_status=$?
6809   echo "$as_me:6809: \$? = $ac_status" >&5
6810   (exit $ac_status); }; }; then
6811   :
6812 else
6813   echo "$as_me: failed program was:" >&5
6814 cat conftest.$ac_ext >&5
6815 cf_have_incdir=yes
6816 fi
6817 rm -f conftest.$ac_objext conftest.$ac_ext
6818                           CPPFLAGS=$cf_save_CPPFLAGS
6819                         fi
6820                   fi
6821                 fi
6822
6823                 if test "$cf_have_incdir" = no ; then
6824                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6825
6826 echo "${as_me:-configure}:6826: testing adding $cf_add_incdir to include-path ..." 1>&5
6827
6828                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6829
6830                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6831                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6832                   cf_add_incdir="$cf_top_incdir"
6833                 else
6834                   break
6835                 fi
6836           else
6837                 break
6838           fi
6839         done
6840   done
6841 fi
6842
6843 fi
6844
6845 # Set definitions to allow ifdef'ing for ncurses.h
6846
6847 case $cf_cv_ncurses_header in
6848 (*ncurses.h)
6849
6850 cat >>confdefs.h <<\EOF
6851 #define HAVE_NCURSES_H 1
6852 EOF
6853
6854         ;;
6855 esac
6856
6857 case $cf_cv_ncurses_header in
6858 (ncurses/curses.h|ncurses/ncurses.h)
6859
6860 cat >>confdefs.h <<\EOF
6861 #define HAVE_NCURSES_NCURSES_H 1
6862 EOF
6863
6864         ;;
6865 (ncursesw/curses.h|ncursesw/ncurses.h)
6866
6867 cat >>confdefs.h <<\EOF
6868 #define HAVE_NCURSESW_NCURSES_H 1
6869 EOF
6870
6871         ;;
6872 esac
6873
6874 echo "$as_me:6874: checking for terminfo header" >&5
6875 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6876 if test "${cf_cv_term_header+set}" = set; then
6877   echo $ECHO_N "(cached) $ECHO_C" >&6
6878 else
6879
6880 case ${cf_cv_ncurses_header} in
6881 (*/ncurses.h|*/ncursesw.h)
6882         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6883         ;;
6884 (*)
6885         cf_term_header=term.h
6886         ;;
6887 esac
6888
6889 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6890 do
6891 cat >conftest.$ac_ext <<_ACEOF
6892 #line 6892 "configure"
6893 #include "confdefs.h"
6894 #include <stdio.h>
6895 #include <${cf_cv_ncurses_header:-curses.h}>
6896 #include <$cf_test>
6897
6898 int
6899 main (void)
6900 {
6901 int x = auto_left_margin
6902   ;
6903   return 0;
6904 }
6905 _ACEOF
6906 rm -f conftest.$ac_objext
6907 if { (eval echo "$as_me:6907: \"$ac_compile\"") >&5
6908   (eval $ac_compile) 2>&5
6909   ac_status=$?
6910   echo "$as_me:6910: \$? = $ac_status" >&5
6911   (exit $ac_status); } &&
6912          { ac_try='test -s conftest.$ac_objext'
6913   { (eval echo "$as_me:6913: \"$ac_try\"") >&5
6914   (eval $ac_try) 2>&5
6915   ac_status=$?
6916   echo "$as_me:6916: \$? = $ac_status" >&5
6917   (exit $ac_status); }; }; then
6918
6919         cf_cv_term_header="$cf_test"
6920 else
6921   echo "$as_me: failed program was:" >&5
6922 cat conftest.$ac_ext >&5
6923
6924         cf_cv_term_header=unknown
6925
6926 fi
6927 rm -f conftest.$ac_objext conftest.$ac_ext
6928         test "$cf_cv_term_header" != unknown && break
6929 done
6930
6931 fi
6932 echo "$as_me:6932: result: $cf_cv_term_header" >&5
6933 echo "${ECHO_T}$cf_cv_term_header" >&6
6934
6935 # Set definitions to allow ifdef'ing to accommodate subdirectories
6936
6937 case $cf_cv_term_header in
6938 (*term.h)
6939
6940 cat >>confdefs.h <<\EOF
6941 #define HAVE_TERM_H 1
6942 EOF
6943
6944         ;;
6945 esac
6946
6947 case $cf_cv_term_header in
6948 (ncurses/term.h)
6949
6950 cat >>confdefs.h <<\EOF
6951 #define HAVE_NCURSES_TERM_H 1
6952 EOF
6953
6954         ;;
6955 (ncursesw/term.h)
6956
6957 cat >>confdefs.h <<\EOF
6958 #define HAVE_NCURSESW_TERM_H 1
6959 EOF
6960
6961         ;;
6962 esac
6963
6964 # some applications need this, but should check for NCURSES_VERSION
6965
6966 cat >>confdefs.h <<\EOF
6967 #define NCURSES 1
6968 EOF
6969
6970 echo "$as_me:6970: checking for ncurses version" >&5
6971 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6972 if test "${cf_cv_ncurses_version+set}" = set; then
6973   echo $ECHO_N "(cached) $ECHO_C" >&6
6974 else
6975
6976         cf_cv_ncurses_version=no
6977         cf_tempfile=out$$
6978         rm -f $cf_tempfile
6979         if test "$cross_compiling" = yes; then
6980
6981         # This will not work if the preprocessor splits the line after the
6982         # Autoconf token.  The 'unproto' program does that.
6983         cat > conftest.$ac_ext <<EOF
6984 #include <${cf_cv_ncurses_header:-curses.h}>
6985 #undef Autoconf
6986 #ifdef NCURSES_VERSION
6987 Autoconf NCURSES_VERSION
6988 #else
6989 #ifdef __NCURSES_H
6990 Autoconf "old"
6991 #endif
6992 ;
6993 #endif
6994 EOF
6995         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6996         { (eval echo "$as_me:6996: \"$cf_try\"") >&5
6997   (eval $cf_try) 2>&5
6998   ac_status=$?
6999   echo "$as_me:6999: \$? = $ac_status" >&5
7000   (exit $ac_status); }
7001         if test -f conftest.out ; then
7002                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7003                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7004                 rm -f conftest.out
7005         fi
7006
7007 else
7008   cat >conftest.$ac_ext <<_ACEOF
7009 #line 7009 "configure"
7010 #include "confdefs.h"
7011
7012 #include <${cf_cv_ncurses_header:-curses.h}>
7013 #include <stdio.h>
7014 int main(void)
7015 {
7016         FILE *fp = fopen("$cf_tempfile", "w");
7017 #ifdef NCURSES_VERSION
7018 # ifdef NCURSES_VERSION_PATCH
7019         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7020 # else
7021         fprintf(fp, "%s\n", NCURSES_VERSION);
7022 # endif
7023 #else
7024 # ifdef __NCURSES_H
7025         fprintf(fp, "old\n");
7026 # else
7027         make an error
7028 # endif
7029 #endif
7030         ${cf_cv_main_return:-return}(0);
7031 }
7032 _ACEOF
7033 rm -f conftest$ac_exeext
7034 if { (eval echo "$as_me:7034: \"$ac_link\"") >&5
7035   (eval $ac_link) 2>&5
7036   ac_status=$?
7037   echo "$as_me:7037: \$? = $ac_status" >&5
7038   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7039   { (eval echo "$as_me:7039: \"$ac_try\"") >&5
7040   (eval $ac_try) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); }; }; then
7044
7045         cf_cv_ncurses_version=`cat $cf_tempfile`
7046 else
7047   echo "$as_me: program exited with status $ac_status" >&5
7048 echo "$as_me: failed program was:" >&5
7049 cat conftest.$ac_ext >&5
7050 fi
7051 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7052 fi
7053         rm -f $cf_tempfile
7054
7055 fi
7056 echo "$as_me:7056: result: $cf_cv_ncurses_version" >&5
7057 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7058 test "$cf_cv_ncurses_version" = no ||
7059 cat >>confdefs.h <<\EOF
7060 #define NCURSES 1
7061 EOF
7062
7063 cf_nculib_root=ncursesw
7064         # This works, except for the special case where we find gpm, but
7065         # ncurses is in a nonstandard location via $LIBS, and we really want
7066         # to link gpm.
7067 cf_ncurses_LIBS=""
7068 cf_ncurses_SAVE="$LIBS"
7069 echo "$as_me:7069: checking for Gpm_Open in -lgpm" >&5
7070 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7071 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7072   echo $ECHO_N "(cached) $ECHO_C" >&6
7073 else
7074   ac_check_lib_save_LIBS=$LIBS
7075 LIBS="-lgpm  $LIBS"
7076 cat >conftest.$ac_ext <<_ACEOF
7077 #line 7077 "configure"
7078 #include "confdefs.h"
7079
7080 /* Override any gcc2 internal prototype to avoid an error.  */
7081 #ifdef __cplusplus
7082 extern "C"
7083 #endif
7084 /* We use char because int might match the return type of a gcc2
7085    builtin and then its argument prototype would still apply.  */
7086 char Gpm_Open ();
7087 int
7088 main (void)
7089 {
7090 Gpm_Open ();
7091   ;
7092   return 0;
7093 }
7094 _ACEOF
7095 rm -f conftest.$ac_objext conftest$ac_exeext
7096 if { (eval echo "$as_me:7096: \"$ac_link\"") >&5
7097   (eval $ac_link) 2>&5
7098   ac_status=$?
7099   echo "$as_me:7099: \$? = $ac_status" >&5
7100   (exit $ac_status); } &&
7101          { ac_try='test -s conftest$ac_exeext'
7102   { (eval echo "$as_me:7102: \"$ac_try\"") >&5
7103   (eval $ac_try) 2>&5
7104   ac_status=$?
7105   echo "$as_me:7105: \$? = $ac_status" >&5
7106   (exit $ac_status); }; }; then
7107   ac_cv_lib_gpm_Gpm_Open=yes
7108 else
7109   echo "$as_me: failed program was:" >&5
7110 cat conftest.$ac_ext >&5
7111 ac_cv_lib_gpm_Gpm_Open=no
7112 fi
7113 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7114 LIBS=$ac_check_lib_save_LIBS
7115 fi
7116 echo "$as_me:7116: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7117 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7118 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7119   echo "$as_me:7119: checking for initscr in -lgpm" >&5
7120 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7121 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7122   echo $ECHO_N "(cached) $ECHO_C" >&6
7123 else
7124   ac_check_lib_save_LIBS=$LIBS
7125 LIBS="-lgpm  $LIBS"
7126 cat >conftest.$ac_ext <<_ACEOF
7127 #line 7127 "configure"
7128 #include "confdefs.h"
7129
7130 /* Override any gcc2 internal prototype to avoid an error.  */
7131 #ifdef __cplusplus
7132 extern "C"
7133 #endif
7134 /* We use char because int might match the return type of a gcc2
7135    builtin and then its argument prototype would still apply.  */
7136 char initscr ();
7137 int
7138 main (void)
7139 {
7140 initscr ();
7141   ;
7142   return 0;
7143 }
7144 _ACEOF
7145 rm -f conftest.$ac_objext conftest$ac_exeext
7146 if { (eval echo "$as_me:7146: \"$ac_link\"") >&5
7147   (eval $ac_link) 2>&5
7148   ac_status=$?
7149   echo "$as_me:7149: \$? = $ac_status" >&5
7150   (exit $ac_status); } &&
7151          { ac_try='test -s conftest$ac_exeext'
7152   { (eval echo "$as_me:7152: \"$ac_try\"") >&5
7153   (eval $ac_try) 2>&5
7154   ac_status=$?
7155   echo "$as_me:7155: \$? = $ac_status" >&5
7156   (exit $ac_status); }; }; then
7157   ac_cv_lib_gpm_initscr=yes
7158 else
7159   echo "$as_me: failed program was:" >&5
7160 cat conftest.$ac_ext >&5
7161 ac_cv_lib_gpm_initscr=no
7162 fi
7163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7164 LIBS=$ac_check_lib_save_LIBS
7165 fi
7166 echo "$as_me:7166: result: $ac_cv_lib_gpm_initscr" >&5
7167 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7168 if test $ac_cv_lib_gpm_initscr = yes; then
7169   LIBS="$cf_ncurses_SAVE"
7170 else
7171   cf_ncurses_LIBS="-lgpm"
7172 fi
7173
7174 fi
7175
7176 case $host_os in
7177 (freebsd*)
7178         # This is only necessary if you are linking against an obsolete
7179         # version of ncurses (but it should do no harm, since it's static).
7180         if test "$cf_nculib_root" = ncurses ; then
7181                 echo "$as_me:7181: checking for tgoto in -lmytinfo" >&5
7182 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7183 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7184   echo $ECHO_N "(cached) $ECHO_C" >&6
7185 else
7186   ac_check_lib_save_LIBS=$LIBS
7187 LIBS="-lmytinfo  $LIBS"
7188 cat >conftest.$ac_ext <<_ACEOF
7189 #line 7189 "configure"
7190 #include "confdefs.h"
7191
7192 /* Override any gcc2 internal prototype to avoid an error.  */
7193 #ifdef __cplusplus
7194 extern "C"
7195 #endif
7196 /* We use char because int might match the return type of a gcc2
7197    builtin and then its argument prototype would still apply.  */
7198 char tgoto ();
7199 int
7200 main (void)
7201 {
7202 tgoto ();
7203   ;
7204   return 0;
7205 }
7206 _ACEOF
7207 rm -f conftest.$ac_objext conftest$ac_exeext
7208 if { (eval echo "$as_me:7208: \"$ac_link\"") >&5
7209   (eval $ac_link) 2>&5
7210   ac_status=$?
7211   echo "$as_me:7211: \$? = $ac_status" >&5
7212   (exit $ac_status); } &&
7213          { ac_try='test -s conftest$ac_exeext'
7214   { (eval echo "$as_me:7214: \"$ac_try\"") >&5
7215   (eval $ac_try) 2>&5
7216   ac_status=$?
7217   echo "$as_me:7217: \$? = $ac_status" >&5
7218   (exit $ac_status); }; }; then
7219   ac_cv_lib_mytinfo_tgoto=yes
7220 else
7221   echo "$as_me: failed program was:" >&5
7222 cat conftest.$ac_ext >&5
7223 ac_cv_lib_mytinfo_tgoto=no
7224 fi
7225 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7226 LIBS=$ac_check_lib_save_LIBS
7227 fi
7228 echo "$as_me:7228: result: $ac_cv_lib_mytinfo_tgoto" >&5
7229 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7230 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7231   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7232 fi
7233
7234         fi
7235         ;;
7236 esac
7237
7238 cf_add_libs="$cf_ncurses_LIBS"
7239 # Filter out duplicates - this happens with badly-designed ".pc" files...
7240 for cf_add_1lib in $LIBS
7241 do
7242         for cf_add_2lib in $cf_add_libs
7243         do
7244                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7245                 then
7246                         cf_add_1lib=
7247                         break
7248                 fi
7249         done
7250         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7251 done
7252 LIBS="$cf_add_libs"
7253
7254 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7255 then
7256
7257 cf_add_libs="-l$cf_nculib_root"
7258 # Filter out duplicates - this happens with badly-designed ".pc" files...
7259 for cf_add_1lib in $LIBS
7260 do
7261         for cf_add_2lib in $cf_add_libs
7262         do
7263                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7264                 then
7265                         cf_add_1lib=
7266                         break
7267                 fi
7268         done
7269         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7270 done
7271 LIBS="$cf_add_libs"
7272
7273 else
7274
7275         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7276         cf_libdir=""
7277         echo "$as_me:7277: checking for initscr" >&5
7278 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7279 if test "${ac_cv_func_initscr+set}" = set; then
7280   echo $ECHO_N "(cached) $ECHO_C" >&6
7281 else
7282   cat >conftest.$ac_ext <<_ACEOF
7283 #line 7283 "configure"
7284 #include "confdefs.h"
7285 /* System header to define __stub macros and hopefully few prototypes,
7286     which can conflict with char initscr (); below.  */
7287 #include <assert.h>
7288 /* Override any gcc2 internal prototype to avoid an error.  */
7289 #ifdef __cplusplus
7290 extern "C"
7291 #endif
7292 /* We use char because int might match the return type of a gcc2
7293    builtin and then its argument prototype would still apply.  */
7294 char initscr ();
7295 char (*f) ();
7296
7297 int
7298 main (void)
7299 {
7300 /* The GNU C library defines this for functions which it implements
7301     to always fail with ENOSYS.  Some functions are actually named
7302     something starting with __ and the normal name is an alias.  */
7303 #if defined (__stub_initscr) || defined (__stub___initscr)
7304 choke me
7305 #else
7306 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7307 #endif
7308
7309   ;
7310   return 0;
7311 }
7312 _ACEOF
7313 rm -f conftest.$ac_objext conftest$ac_exeext
7314 if { (eval echo "$as_me:7314: \"$ac_link\"") >&5
7315   (eval $ac_link) 2>&5
7316   ac_status=$?
7317   echo "$as_me:7317: \$? = $ac_status" >&5
7318   (exit $ac_status); } &&
7319          { ac_try='test -s conftest$ac_exeext'
7320   { (eval echo "$as_me:7320: \"$ac_try\"") >&5
7321   (eval $ac_try) 2>&5
7322   ac_status=$?
7323   echo "$as_me:7323: \$? = $ac_status" >&5
7324   (exit $ac_status); }; }; then
7325   ac_cv_func_initscr=yes
7326 else
7327   echo "$as_me: failed program was:" >&5
7328 cat conftest.$ac_ext >&5
7329 ac_cv_func_initscr=no
7330 fi
7331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7332 fi
7333 echo "$as_me:7333: result: $ac_cv_func_initscr" >&5
7334 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7335 if test $ac_cv_func_initscr = yes; then
7336   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7337 else
7338
7339                 cf_save_LIBS="$LIBS"
7340                 echo "$as_me:7340: checking for initscr in -l$cf_nculib_root" >&5
7341 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7342                 LIBS="-l$cf_nculib_root $LIBS"
7343                 cat >conftest.$ac_ext <<_ACEOF
7344 #line 7344 "configure"
7345 #include "confdefs.h"
7346 #include <${cf_cv_ncurses_header:-curses.h}>
7347 int
7348 main (void)
7349 {
7350 initscr()
7351   ;
7352   return 0;
7353 }
7354 _ACEOF
7355 rm -f conftest.$ac_objext conftest$ac_exeext
7356 if { (eval echo "$as_me:7356: \"$ac_link\"") >&5
7357   (eval $ac_link) 2>&5
7358   ac_status=$?
7359   echo "$as_me:7359: \$? = $ac_status" >&5
7360   (exit $ac_status); } &&
7361          { ac_try='test -s conftest$ac_exeext'
7362   { (eval echo "$as_me:7362: \"$ac_try\"") >&5
7363   (eval $ac_try) 2>&5
7364   ac_status=$?
7365   echo "$as_me:7365: \$? = $ac_status" >&5
7366   (exit $ac_status); }; }; then
7367   echo "$as_me:7367: result: yes" >&5
7368 echo "${ECHO_T}yes" >&6
7369                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7370
7371 else
7372   echo "$as_me: failed program was:" >&5
7373 cat conftest.$ac_ext >&5
7374 echo "$as_me:7374: result: no" >&5
7375 echo "${ECHO_T}no" >&6
7376
7377 cf_search=
7378 cf_library_path_list=""
7379 if test -n "${LDFLAGS}${LIBS}" ; then
7380         for cf_library_path in $LDFLAGS $LIBS
7381         do
7382                 case $cf_library_path in
7383                 (-L*)
7384                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7385
7386 test "x$cf_library_path" != "xNONE" && \
7387 test -d "$cf_library_path" && \
7388  {
7389         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7390         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7391         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7392         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7393         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7394         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"
7395 }
7396
7397                         cf_library_path_list="$cf_library_path_list $cf_search"
7398                         ;;
7399                 esac
7400         done
7401 fi
7402
7403 cf_search=
7404
7405 test "x$prefix" != "xNONE" && \
7406 test -d "$prefix" && \
7407  {
7408         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7409         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7410         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7411         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7412         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7413         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7414 }
7415
7416 for cf_subdir_prefix in \
7417         /usr \
7418         /usr/local \
7419         /usr/pkg \
7420         /opt \
7421         /opt/local \
7422         $HOME
7423 do
7424
7425 test "x$cf_subdir_prefix" != "x$prefix" && \
7426 test -d "$cf_subdir_prefix" && \
7427 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7428         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7429         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7430         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7431         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7432         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7433         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"
7434 }
7435
7436 done
7437
7438 cf_search="$cf_library_path_list $cf_search"
7439
7440                         for cf_libdir in $cf_search
7441                         do
7442                                 echo "$as_me:7442: checking for -l$cf_nculib_root in $cf_libdir" >&5
7443 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7444                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7445                                 cat >conftest.$ac_ext <<_ACEOF
7446 #line 7446 "configure"
7447 #include "confdefs.h"
7448 #include <${cf_cv_ncurses_header:-curses.h}>
7449 int
7450 main (void)
7451 {
7452 initscr()
7453   ;
7454   return 0;
7455 }
7456 _ACEOF
7457 rm -f conftest.$ac_objext conftest$ac_exeext
7458 if { (eval echo "$as_me:7458: \"$ac_link\"") >&5
7459   (eval $ac_link) 2>&5
7460   ac_status=$?
7461   echo "$as_me:7461: \$? = $ac_status" >&5
7462   (exit $ac_status); } &&
7463          { ac_try='test -s conftest$ac_exeext'
7464   { (eval echo "$as_me:7464: \"$ac_try\"") >&5
7465   (eval $ac_try) 2>&5
7466   ac_status=$?
7467   echo "$as_me:7467: \$? = $ac_status" >&5
7468   (exit $ac_status); }; }; then
7469   echo "$as_me:7469: result: yes" >&5
7470 echo "${ECHO_T}yes" >&6
7471                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7472                                          break
7473 else
7474   echo "$as_me: failed program was:" >&5
7475 cat conftest.$ac_ext >&5
7476 echo "$as_me:7476: result: no" >&5
7477 echo "${ECHO_T}no" >&6
7478                                          LIBS="$cf_save_LIBS"
7479 fi
7480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7481                         done
7482
7483 fi
7484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7485
7486 fi
7487
7488 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7489
7490 if test $cf_found_library = no ; then
7491         { { echo "$as_me:7491: error: Cannot link $cf_nculib_root library" >&5
7492 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7493    { (exit 1); exit 1; }; }
7494 fi
7495
7496 fi
7497
7498 if test -n "$cf_ncurses_LIBS" ; then
7499         echo "$as_me:7499: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7500 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7501         cf_ncurses_SAVE="$LIBS"
7502         for p in $cf_ncurses_LIBS ; do
7503                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7504                 if test "$q" != "$LIBS" ; then
7505                         LIBS="$q"
7506                 fi
7507         done
7508         cat >conftest.$ac_ext <<_ACEOF
7509 #line 7509 "configure"
7510 #include "confdefs.h"
7511 #include <${cf_cv_ncurses_header:-curses.h}>
7512 int
7513 main (void)
7514 {
7515 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7516   ;
7517   return 0;
7518 }
7519 _ACEOF
7520 rm -f conftest.$ac_objext conftest$ac_exeext
7521 if { (eval echo "$as_me:7521: \"$ac_link\"") >&5
7522   (eval $ac_link) 2>&5
7523   ac_status=$?
7524   echo "$as_me:7524: \$? = $ac_status" >&5
7525   (exit $ac_status); } &&
7526          { ac_try='test -s conftest$ac_exeext'
7527   { (eval echo "$as_me:7527: \"$ac_try\"") >&5
7528   (eval $ac_try) 2>&5
7529   ac_status=$?
7530   echo "$as_me:7530: \$? = $ac_status" >&5
7531   (exit $ac_status); }; }; then
7532   echo "$as_me:7532: result: yes" >&5
7533 echo "${ECHO_T}yes" >&6
7534 else
7535   echo "$as_me: failed program was:" >&5
7536 cat conftest.$ac_ext >&5
7537 echo "$as_me:7537: result: no" >&5
7538 echo "${ECHO_T}no" >&6
7539                  LIBS="$cf_ncurses_SAVE"
7540 fi
7541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7542 fi
7543
7544 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7545
7546 cat >>confdefs.h <<EOF
7547 #define $cf_nculib_ROOT 1
7548 EOF
7549
7550         fi
7551 else
7552         NCURSES_CONFIG=none
7553 fi
7554
7555 else
7556
7557 cf_ncuconfig_root=ncurses
7558 cf_have_ncuconfig=no
7559
7560 if test "x${PKG_CONFIG:=none}" != xnone; then
7561         echo "$as_me:7561: checking pkg-config for $cf_ncuconfig_root" >&5
7562 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7563         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7564                 echo "$as_me:7564: result: yes" >&5
7565 echo "${ECHO_T}yes" >&6
7566
7567                 echo "$as_me:7567: checking if the $cf_ncuconfig_root package files work" >&5
7568 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7569                 cf_have_ncuconfig=unknown
7570
7571                 cf_save_CPPFLAGS="$CPPFLAGS"
7572                 cf_save_LIBS="$LIBS"
7573
7574                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7575
7576 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7577 # Filter out duplicates - this happens with badly-designed ".pc" files...
7578 for cf_add_1lib in $LIBS
7579 do
7580         for cf_add_2lib in $cf_add_libs
7581         do
7582                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7583                 then
7584                         cf_add_1lib=
7585                         break
7586                 fi
7587         done
7588         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7589 done
7590 LIBS="$cf_add_libs"
7591
7592                 cat >conftest.$ac_ext <<_ACEOF
7593 #line 7593 "configure"
7594 #include "confdefs.h"
7595 #include <${cf_cv_ncurses_header:-curses.h}>
7596 int
7597 main (void)
7598 {
7599 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7600   ;
7601   return 0;
7602 }
7603 _ACEOF
7604 rm -f conftest.$ac_objext conftest$ac_exeext
7605 if { (eval echo "$as_me:7605: \"$ac_link\"") >&5
7606   (eval $ac_link) 2>&5
7607   ac_status=$?
7608   echo "$as_me:7608: \$? = $ac_status" >&5
7609   (exit $ac_status); } &&
7610          { ac_try='test -s conftest$ac_exeext'
7611   { (eval echo "$as_me:7611: \"$ac_try\"") >&5
7612   (eval $ac_try) 2>&5
7613   ac_status=$?
7614   echo "$as_me:7614: \$? = $ac_status" >&5
7615   (exit $ac_status); }; }; then
7616   if test "$cross_compiling" = yes; then
7617   cf_have_ncuconfig=maybe
7618 else
7619   cat >conftest.$ac_ext <<_ACEOF
7620 #line 7620 "configure"
7621 #include "confdefs.h"
7622 #include <${cf_cv_ncurses_header:-curses.h}>
7623                                 int main(void)
7624                                 { char *xx = curses_version(); return (xx == 0); }
7625 _ACEOF
7626 rm -f conftest$ac_exeext
7627 if { (eval echo "$as_me:7627: \"$ac_link\"") >&5
7628   (eval $ac_link) 2>&5
7629   ac_status=$?
7630   echo "$as_me:7630: \$? = $ac_status" >&5
7631   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7632   { (eval echo "$as_me:7632: \"$ac_try\"") >&5
7633   (eval $ac_try) 2>&5
7634   ac_status=$?
7635   echo "$as_me:7635: \$? = $ac_status" >&5
7636   (exit $ac_status); }; }; then
7637   cf_have_ncuconfig=yes
7638 else
7639   echo "$as_me: program exited with status $ac_status" >&5
7640 echo "$as_me: failed program was:" >&5
7641 cat conftest.$ac_ext >&5
7642 cf_have_ncuconfig=no
7643 fi
7644 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7645 fi
7646 else
7647   echo "$as_me: failed program was:" >&5
7648 cat conftest.$ac_ext >&5
7649 cf_have_ncuconfig=no
7650 fi
7651 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7652                 echo "$as_me:7652: result: $cf_have_ncuconfig" >&5
7653 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7654                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7655                 if test "$cf_have_ncuconfig" != "yes"
7656                 then
7657                         CPPFLAGS="$cf_save_CPPFLAGS"
7658                         LIBS="$cf_save_LIBS"
7659                         NCURSES_CONFIG_PKG=none
7660                 else
7661
7662 cat >>confdefs.h <<\EOF
7663 #define NCURSES 1
7664 EOF
7665
7666                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7667                 fi
7668
7669 echo "$as_me:7669: checking for terminfo header" >&5
7670 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7671 if test "${cf_cv_term_header+set}" = set; then
7672   echo $ECHO_N "(cached) $ECHO_C" >&6
7673 else
7674
7675 case ${cf_cv_ncurses_header} in
7676 (*/ncurses.h|*/ncursesw.h)
7677         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7678         ;;
7679 (*)
7680         cf_term_header=term.h
7681         ;;
7682 esac
7683
7684 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7685 do
7686 cat >conftest.$ac_ext <<_ACEOF
7687 #line 7687 "configure"
7688 #include "confdefs.h"
7689 #include <stdio.h>
7690 #include <${cf_cv_ncurses_header:-curses.h}>
7691 #include <$cf_test>
7692
7693 int
7694 main (void)
7695 {
7696 int x = auto_left_margin
7697   ;
7698   return 0;
7699 }
7700 _ACEOF
7701 rm -f conftest.$ac_objext
7702 if { (eval echo "$as_me:7702: \"$ac_compile\"") >&5
7703   (eval $ac_compile) 2>&5
7704   ac_status=$?
7705   echo "$as_me:7705: \$? = $ac_status" >&5
7706   (exit $ac_status); } &&
7707          { ac_try='test -s conftest.$ac_objext'
7708   { (eval echo "$as_me:7708: \"$ac_try\"") >&5
7709   (eval $ac_try) 2>&5
7710   ac_status=$?
7711   echo "$as_me:7711: \$? = $ac_status" >&5
7712   (exit $ac_status); }; }; then
7713
7714         cf_cv_term_header="$cf_test"
7715 else
7716   echo "$as_me: failed program was:" >&5
7717 cat conftest.$ac_ext >&5
7718
7719         cf_cv_term_header=unknown
7720
7721 fi
7722 rm -f conftest.$ac_objext conftest.$ac_ext
7723         test "$cf_cv_term_header" != unknown && break
7724 done
7725
7726 fi
7727 echo "$as_me:7727: result: $cf_cv_term_header" >&5
7728 echo "${ECHO_T}$cf_cv_term_header" >&6
7729
7730 # Set definitions to allow ifdef'ing to accommodate subdirectories
7731
7732 case $cf_cv_term_header in
7733 (*term.h)
7734
7735 cat >>confdefs.h <<\EOF
7736 #define HAVE_TERM_H 1
7737 EOF
7738
7739         ;;
7740 esac
7741
7742 case $cf_cv_term_header in
7743 (ncurses/term.h)
7744
7745 cat >>confdefs.h <<\EOF
7746 #define HAVE_NCURSES_TERM_H 1
7747 EOF
7748
7749         ;;
7750 (ncursesw/term.h)
7751
7752 cat >>confdefs.h <<\EOF
7753 #define HAVE_NCURSESW_TERM_H 1
7754 EOF
7755
7756         ;;
7757 esac
7758
7759         else
7760                 echo "$as_me:7760: result: no" >&5
7761 echo "${ECHO_T}no" >&6
7762                 NCURSES_CONFIG_PKG=none
7763         fi
7764 else
7765         NCURSES_CONFIG_PKG=none
7766 fi
7767
7768 if test "x$cf_have_ncuconfig" = "xno"; then
7769         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7770
7771 if test -n "$ac_tool_prefix"; then
7772   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7773   do
7774     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7775 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7776 echo "$as_me:7776: checking for $ac_word" >&5
7777 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7778 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7779   echo $ECHO_N "(cached) $ECHO_C" >&6
7780 else
7781   if test -n "$NCURSES_CONFIG"; then
7782   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7783 else
7784   ac_save_IFS=$IFS; IFS=$ac_path_separator
7785 ac_dummy="$PATH"
7786 for ac_dir in $ac_dummy; do
7787   IFS=$ac_save_IFS
7788   test -z "$ac_dir" && ac_dir=.
7789   $as_executable_p "$ac_dir/$ac_word" || continue
7790 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7791 echo "$as_me:7791: found $ac_dir/$ac_word" >&5
7792 break
7793 done
7794
7795 fi
7796 fi
7797 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7798 if test -n "$NCURSES_CONFIG"; then
7799   echo "$as_me:7799: result: $NCURSES_CONFIG" >&5
7800 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7801 else
7802   echo "$as_me:7802: result: no" >&5
7803 echo "${ECHO_T}no" >&6
7804 fi
7805
7806     test -n "$NCURSES_CONFIG" && break
7807   done
7808 fi
7809 if test -z "$NCURSES_CONFIG"; then
7810   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7811   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7812 do
7813   # Extract the first word of "$ac_prog", so it can be a program name with args.
7814 set dummy $ac_prog; ac_word=$2
7815 echo "$as_me:7815: checking for $ac_word" >&5
7816 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7817 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7818   echo $ECHO_N "(cached) $ECHO_C" >&6
7819 else
7820   if test -n "$ac_ct_NCURSES_CONFIG"; then
7821   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7822 else
7823   ac_save_IFS=$IFS; IFS=$ac_path_separator
7824 ac_dummy="$PATH"
7825 for ac_dir in $ac_dummy; do
7826   IFS=$ac_save_IFS
7827   test -z "$ac_dir" && ac_dir=.
7828   $as_executable_p "$ac_dir/$ac_word" || continue
7829 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7830 echo "$as_me:7830: found $ac_dir/$ac_word" >&5
7831 break
7832 done
7833
7834 fi
7835 fi
7836 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7837 if test -n "$ac_ct_NCURSES_CONFIG"; then
7838   echo "$as_me:7838: result: $ac_ct_NCURSES_CONFIG" >&5
7839 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7840 else
7841   echo "$as_me:7841: result: no" >&5
7842 echo "${ECHO_T}no" >&6
7843 fi
7844
7845   test -n "$ac_ct_NCURSES_CONFIG" && break
7846 done
7847 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7848
7849   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7850 fi
7851
7852         if test "$NCURSES_CONFIG" != none ; then
7853
7854                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7855
7856 cf_add_libs="`$NCURSES_CONFIG --libs`"
7857 # Filter out duplicates - this happens with badly-designed ".pc" files...
7858 for cf_add_1lib in $LIBS
7859 do
7860         for cf_add_2lib in $cf_add_libs
7861         do
7862                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7863                 then
7864                         cf_add_1lib=
7865                         break
7866                 fi
7867         done
7868         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7869 done
7870 LIBS="$cf_add_libs"
7871
7872                 # even with config script, some packages use no-override for curses.h
7873
7874 echo "$as_me:7874: checking if we have identified curses headers" >&5
7875 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7876 if test "${cf_cv_ncurses_header+set}" = set; then
7877   echo $ECHO_N "(cached) $ECHO_C" >&6
7878 else
7879
7880 cf_cv_ncurses_header=none
7881 for cf_header in \
7882         ncurses.h ncurses/ncurses.h \
7883         curses.h ncurses/curses.h
7884 do
7885 cat >conftest.$ac_ext <<_ACEOF
7886 #line 7886 "configure"
7887 #include "confdefs.h"
7888 #include <${cf_header}>
7889 int
7890 main (void)
7891 {
7892 initscr(); tgoto("?", 0,0)
7893   ;
7894   return 0;
7895 }
7896 _ACEOF
7897 rm -f conftest.$ac_objext
7898 if { (eval echo "$as_me:7898: \"$ac_compile\"") >&5
7899   (eval $ac_compile) 2>&5
7900   ac_status=$?
7901   echo "$as_me:7901: \$? = $ac_status" >&5
7902   (exit $ac_status); } &&
7903          { ac_try='test -s conftest.$ac_objext'
7904   { (eval echo "$as_me:7904: \"$ac_try\"") >&5
7905   (eval $ac_try) 2>&5
7906   ac_status=$?
7907   echo "$as_me:7907: \$? = $ac_status" >&5
7908   (exit $ac_status); }; }; then
7909   cf_cv_ncurses_header=$cf_header; break
7910 else
7911   echo "$as_me: failed program was:" >&5
7912 cat conftest.$ac_ext >&5
7913 fi
7914 rm -f conftest.$ac_objext conftest.$ac_ext
7915 done
7916
7917 fi
7918 echo "$as_me:7918: result: $cf_cv_ncurses_header" >&5
7919 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7920
7921 if test "$cf_cv_ncurses_header" = none ; then
7922         { { echo "$as_me:7922: error: No curses header-files found" >&5
7923 echo "$as_me: error: No curses header-files found" >&2;}
7924    { (exit 1); exit 1; }; }
7925 fi
7926
7927 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7928
7929 for ac_header in $cf_cv_ncurses_header
7930 do
7931 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7932 echo "$as_me:7932: checking for $ac_header" >&5
7933 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7934 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7935   echo $ECHO_N "(cached) $ECHO_C" >&6
7936 else
7937   cat >conftest.$ac_ext <<_ACEOF
7938 #line 7938 "configure"
7939 #include "confdefs.h"
7940 #include <$ac_header>
7941 _ACEOF
7942 if { (eval echo "$as_me:7942: \"$ac_cpp conftest.$ac_ext\"") >&5
7943   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7944   ac_status=$?
7945   egrep -v '^ *\+' conftest.er1 >conftest.err
7946   rm -f conftest.er1
7947   cat conftest.err >&5
7948   echo "$as_me:7948: \$? = $ac_status" >&5
7949   (exit $ac_status); } >/dev/null; then
7950   if test -s conftest.err; then
7951     ac_cpp_err=$ac_c_preproc_warn_flag
7952   else
7953     ac_cpp_err=
7954   fi
7955 else
7956   ac_cpp_err=yes
7957 fi
7958 if test -z "$ac_cpp_err"; then
7959   eval "$as_ac_Header=yes"
7960 else
7961   echo "$as_me: failed program was:" >&5
7962   cat conftest.$ac_ext >&5
7963   eval "$as_ac_Header=no"
7964 fi
7965 rm -f conftest.err conftest.$ac_ext
7966 fi
7967 echo "$as_me:7967: result: `eval echo '${'$as_ac_Header'}'`" >&5
7968 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7969 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7970   cat >>confdefs.h <<EOF
7971 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7972 EOF
7973
7974 fi
7975 done
7976
7977 cat >>confdefs.h <<\EOF
7978 #define NCURSES 1
7979 EOF
7980
7981 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7982
7983                 cat >>confdefs.h <<EOF
7984 #define $cf_nculib_ROOT 1
7985 EOF
7986
7987                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7988
7989         else
7990
7991 cf_ncuhdr_root=ncurses
7992
7993 test -n "$cf_cv_curses_dir" && \
7994 test "$cf_cv_curses_dir" != "no" && { \
7995
7996 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7997   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7998   do
7999         while test $cf_add_incdir != /usr/include
8000         do
8001           if test -d $cf_add_incdir
8002           then
8003                 cf_have_incdir=no
8004                 if test -n "$CFLAGS$CPPFLAGS" ; then
8005                   # a loop is needed to ensure we can add subdirs of existing dirs
8006                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8007                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8008                           cf_have_incdir=yes; break
8009                         fi
8010                   done
8011                 fi
8012
8013                 if test "$cf_have_incdir" = no ; then
8014                   if test "$cf_add_incdir" = /usr/local/include ; then
8015                         if test "$GCC" = yes
8016                         then
8017                           cf_save_CPPFLAGS=$CPPFLAGS
8018                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8019                           cat >conftest.$ac_ext <<_ACEOF
8020 #line 8020 "configure"
8021 #include "confdefs.h"
8022 #include <stdio.h>
8023 int
8024 main (void)
8025 {
8026 printf("Hello")
8027   ;
8028   return 0;
8029 }
8030 _ACEOF
8031 rm -f conftest.$ac_objext
8032 if { (eval echo "$as_me:8032: \"$ac_compile\"") >&5
8033   (eval $ac_compile) 2>&5
8034   ac_status=$?
8035   echo "$as_me:8035: \$? = $ac_status" >&5
8036   (exit $ac_status); } &&
8037          { ac_try='test -s conftest.$ac_objext'
8038   { (eval echo "$as_me:8038: \"$ac_try\"") >&5
8039   (eval $ac_try) 2>&5
8040   ac_status=$?
8041   echo "$as_me:8041: \$? = $ac_status" >&5
8042   (exit $ac_status); }; }; then
8043   :
8044 else
8045   echo "$as_me: failed program was:" >&5
8046 cat conftest.$ac_ext >&5
8047 cf_have_incdir=yes
8048 fi
8049 rm -f conftest.$ac_objext conftest.$ac_ext
8050                           CPPFLAGS=$cf_save_CPPFLAGS
8051                         fi
8052                   fi
8053                 fi
8054
8055                 if test "$cf_have_incdir" = no ; then
8056                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8057
8058 echo "${as_me:-configure}:8058: testing adding $cf_add_incdir to include-path ..." 1>&5
8059
8060                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8061
8062                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8063                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8064                   cf_add_incdir="$cf_top_incdir"
8065                 else
8066                   break
8067                 fi
8068           else
8069                 break
8070           fi
8071         done
8072   done
8073 fi
8074
8075 }
8076
8077 echo "$as_me:8077: checking for $cf_ncuhdr_root header in include-path" >&5
8078 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8079 if test "${cf_cv_ncurses_h+set}" = set; then
8080   echo $ECHO_N "(cached) $ECHO_C" >&6
8081 else
8082
8083         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8084         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8085         for cf_header in $cf_header_list
8086         do
8087
8088         cat >conftest.$ac_ext <<_ACEOF
8089 #line 8089 "configure"
8090 #include "confdefs.h"
8091
8092 #include <$cf_header>
8093 int
8094 main (void)
8095 {
8096
8097 #ifdef NCURSES_VERSION
8098
8099 printf("%s\n", NCURSES_VERSION);
8100 #else
8101 #ifdef __NCURSES_H
8102 printf("old\n");
8103 #else
8104         make an error
8105 #endif
8106 #endif
8107
8108   ;
8109   return 0;
8110 }
8111 _ACEOF
8112 rm -f conftest.$ac_objext
8113 if { (eval echo "$as_me:8113: \"$ac_compile\"") >&5
8114   (eval $ac_compile) 2>&5
8115   ac_status=$?
8116   echo "$as_me:8116: \$? = $ac_status" >&5
8117   (exit $ac_status); } &&
8118          { ac_try='test -s conftest.$ac_objext'
8119   { (eval echo "$as_me:8119: \"$ac_try\"") >&5
8120   (eval $ac_try) 2>&5
8121   ac_status=$?
8122   echo "$as_me:8122: \$? = $ac_status" >&5
8123   (exit $ac_status); }; }; then
8124   cf_cv_ncurses_h=$cf_header
8125
8126 else
8127   echo "$as_me: failed program was:" >&5
8128 cat conftest.$ac_ext >&5
8129 cf_cv_ncurses_h=no
8130 fi
8131 rm -f conftest.$ac_objext conftest.$ac_ext
8132
8133                 test "$cf_cv_ncurses_h" != no && break
8134         done
8135
8136 fi
8137 echo "$as_me:8137: result: $cf_cv_ncurses_h" >&5
8138 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8139
8140 if test "$cf_cv_ncurses_h" != no ; then
8141         cf_cv_ncurses_header=$cf_cv_ncurses_h
8142 else
8143
8144 echo "$as_me:8144: checking for $cf_ncuhdr_root include-path" >&5
8145 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8146 if test "${cf_cv_ncurses_h2+set}" = set; then
8147   echo $ECHO_N "(cached) $ECHO_C" >&6
8148 else
8149
8150         test -n "$verbose" && echo
8151
8152 cf_search=
8153
8154 # collect the current set of include-directories from compiler flags
8155 cf_header_path_list=""
8156 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8157         for cf_header_path in $CPPFLAGS $CFLAGS
8158         do
8159                 case $cf_header_path in
8160                 (-I*)
8161                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8162
8163 test "x$cf_header_path" != "xNONE" && \
8164 test -d "$cf_header_path" && \
8165  {
8166         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8167         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8168         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8169         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8170         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8171         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"
8172 }
8173
8174                         cf_header_path_list="$cf_header_path_list $cf_search"
8175                         ;;
8176                 esac
8177         done
8178 fi
8179
8180 # add the variations for the package we are looking for
8181
8182 cf_search=
8183
8184 test "x$prefix" != "xNONE" && \
8185 test -d "$prefix" && \
8186  {
8187         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8188         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8189         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8190         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8191         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8192         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8193 }
8194
8195 for cf_subdir_prefix in \
8196         /usr \
8197         /usr/local \
8198         /usr/pkg \
8199         /opt \
8200         /opt/local \
8201         $HOME
8202 do
8203
8204 test "x$cf_subdir_prefix" != "x$prefix" && \
8205 test -d "$cf_subdir_prefix" && \
8206 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8207         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8208         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8209         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8210         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8211         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8212         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"
8213 }
8214
8215 done
8216
8217 test "$includedir" != NONE && \
8218 test "$includedir" != "/usr/include" && \
8219 test -d "$includedir" && {
8220         test -d $includedir &&    cf_search="$cf_search $includedir"
8221         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8222 }
8223
8224 test "$oldincludedir" != NONE && \
8225 test "$oldincludedir" != "/usr/include" && \
8226 test -d "$oldincludedir" && {
8227         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8228         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8229 }
8230
8231 cf_search="$cf_search $cf_header_path_list"
8232
8233         test -n "$verbose" && echo search path $cf_search
8234         cf_save2_CPPFLAGS="$CPPFLAGS"
8235         for cf_incdir in $cf_search
8236         do
8237
8238 if test -n "$cf_incdir" ; then
8239   for cf_add_incdir in $cf_incdir
8240   do
8241         while test $cf_add_incdir != /usr/include
8242         do
8243           if test -d $cf_add_incdir
8244           then
8245                 cf_have_incdir=no
8246                 if test -n "$CFLAGS$CPPFLAGS" ; then
8247                   # a loop is needed to ensure we can add subdirs of existing dirs
8248                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8249                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8250                           cf_have_incdir=yes; break
8251                         fi
8252                   done
8253                 fi
8254
8255                 if test "$cf_have_incdir" = no ; then
8256                   if test "$cf_add_incdir" = /usr/local/include ; then
8257                         if test "$GCC" = yes
8258                         then
8259                           cf_save_CPPFLAGS=$CPPFLAGS
8260                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8261                           cat >conftest.$ac_ext <<_ACEOF
8262 #line 8262 "configure"
8263 #include "confdefs.h"
8264 #include <stdio.h>
8265 int
8266 main (void)
8267 {
8268 printf("Hello")
8269   ;
8270   return 0;
8271 }
8272 _ACEOF
8273 rm -f conftest.$ac_objext
8274 if { (eval echo "$as_me:8274: \"$ac_compile\"") >&5
8275   (eval $ac_compile) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit $ac_status); } &&
8279          { ac_try='test -s conftest.$ac_objext'
8280   { (eval echo "$as_me:8280: \"$ac_try\"") >&5
8281   (eval $ac_try) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit $ac_status); }; }; then
8285   :
8286 else
8287   echo "$as_me: failed program was:" >&5
8288 cat conftest.$ac_ext >&5
8289 cf_have_incdir=yes
8290 fi
8291 rm -f conftest.$ac_objext conftest.$ac_ext
8292                           CPPFLAGS=$cf_save_CPPFLAGS
8293                         fi
8294                   fi
8295                 fi
8296
8297                 if test "$cf_have_incdir" = no ; then
8298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8299
8300 echo "${as_me:-configure}:8300: testing adding $cf_add_incdir to include-path ..." 1>&5
8301
8302                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8303
8304                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8305                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8306                   cf_add_incdir="$cf_top_incdir"
8307                 else
8308                   break
8309                 fi
8310           else
8311                 break
8312           fi
8313         done
8314   done
8315 fi
8316
8317                 for cf_header in \
8318                         ncurses.h \
8319                         curses.h
8320                 do
8321
8322         cat >conftest.$ac_ext <<_ACEOF
8323 #line 8323 "configure"
8324 #include "confdefs.h"
8325
8326 #include <$cf_header>
8327 int
8328 main (void)
8329 {
8330
8331 #ifdef NCURSES_VERSION
8332
8333 printf("%s\n", NCURSES_VERSION);
8334 #else
8335 #ifdef __NCURSES_H
8336 printf("old\n");
8337 #else
8338         make an error
8339 #endif
8340 #endif
8341
8342   ;
8343   return 0;
8344 }
8345 _ACEOF
8346 rm -f conftest.$ac_objext
8347 if { (eval echo "$as_me:8347: \"$ac_compile\"") >&5
8348   (eval $ac_compile) 2>&5
8349   ac_status=$?
8350   echo "$as_me:8350: \$? = $ac_status" >&5
8351   (exit $ac_status); } &&
8352          { ac_try='test -s conftest.$ac_objext'
8353   { (eval echo "$as_me:8353: \"$ac_try\"") >&5
8354   (eval $ac_try) 2>&5
8355   ac_status=$?
8356   echo "$as_me:8356: \$? = $ac_status" >&5
8357   (exit $ac_status); }; }; then
8358   cf_cv_ncurses_h2=$cf_header
8359
8360 else
8361   echo "$as_me: failed program was:" >&5
8362 cat conftest.$ac_ext >&5
8363 cf_cv_ncurses_h2=no
8364 fi
8365 rm -f conftest.$ac_objext conftest.$ac_ext
8366
8367                         if test "$cf_cv_ncurses_h2" != no ; then
8368                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8369                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8370                                 break
8371                         fi
8372                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8373                 done
8374                 CPPFLAGS="$cf_save2_CPPFLAGS"
8375                 test "$cf_cv_ncurses_h2" != no && break
8376         done
8377         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8377: error: not found" >&5
8378 echo "$as_me: error: not found" >&2;}
8379    { (exit 1); exit 1; }; }
8380
8381 fi
8382 echo "$as_me:8382: result: $cf_cv_ncurses_h2" >&5
8383 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8384
8385         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8386         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8387         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8388                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8389         fi
8390
8391 if test -n "$cf_1st_incdir" ; then
8392   for cf_add_incdir in $cf_1st_incdir
8393   do
8394         while test $cf_add_incdir != /usr/include
8395         do
8396           if test -d $cf_add_incdir
8397           then
8398                 cf_have_incdir=no
8399                 if test -n "$CFLAGS$CPPFLAGS" ; then
8400                   # a loop is needed to ensure we can add subdirs of existing dirs
8401                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8402                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8403                           cf_have_incdir=yes; break
8404                         fi
8405                   done
8406                 fi
8407
8408                 if test "$cf_have_incdir" = no ; then
8409                   if test "$cf_add_incdir" = /usr/local/include ; then
8410                         if test "$GCC" = yes
8411                         then
8412                           cf_save_CPPFLAGS=$CPPFLAGS
8413                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8414                           cat >conftest.$ac_ext <<_ACEOF
8415 #line 8415 "configure"
8416 #include "confdefs.h"
8417 #include <stdio.h>
8418 int
8419 main (void)
8420 {
8421 printf("Hello")
8422   ;
8423   return 0;
8424 }
8425 _ACEOF
8426 rm -f conftest.$ac_objext
8427 if { (eval echo "$as_me:8427: \"$ac_compile\"") >&5
8428   (eval $ac_compile) 2>&5
8429   ac_status=$?
8430   echo "$as_me:8430: \$? = $ac_status" >&5
8431   (exit $ac_status); } &&
8432          { ac_try='test -s conftest.$ac_objext'
8433   { (eval echo "$as_me:8433: \"$ac_try\"") >&5
8434   (eval $ac_try) 2>&5
8435   ac_status=$?
8436   echo "$as_me:8436: \$? = $ac_status" >&5
8437   (exit $ac_status); }; }; then
8438   :
8439 else
8440   echo "$as_me: failed program was:" >&5
8441 cat conftest.$ac_ext >&5
8442 cf_have_incdir=yes
8443 fi
8444 rm -f conftest.$ac_objext conftest.$ac_ext
8445                           CPPFLAGS=$cf_save_CPPFLAGS
8446                         fi
8447                   fi
8448                 fi
8449
8450                 if test "$cf_have_incdir" = no ; then
8451                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8452
8453 echo "${as_me:-configure}:8453: testing adding $cf_add_incdir to include-path ..." 1>&5
8454
8455                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8456
8457                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8458                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8459                   cf_add_incdir="$cf_top_incdir"
8460                 else
8461                   break
8462                 fi
8463           else
8464                 break
8465           fi
8466         done
8467   done
8468 fi
8469
8470 fi
8471
8472 # Set definitions to allow ifdef'ing for ncurses.h
8473
8474 case $cf_cv_ncurses_header in
8475 (*ncurses.h)
8476
8477 cat >>confdefs.h <<\EOF
8478 #define HAVE_NCURSES_H 1
8479 EOF
8480
8481         ;;
8482 esac
8483
8484 case $cf_cv_ncurses_header in
8485 (ncurses/curses.h|ncurses/ncurses.h)
8486
8487 cat >>confdefs.h <<\EOF
8488 #define HAVE_NCURSES_NCURSES_H 1
8489 EOF
8490
8491         ;;
8492 (ncursesw/curses.h|ncursesw/ncurses.h)
8493
8494 cat >>confdefs.h <<\EOF
8495 #define HAVE_NCURSESW_NCURSES_H 1
8496 EOF
8497
8498         ;;
8499 esac
8500
8501 echo "$as_me:8501: checking for terminfo header" >&5
8502 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8503 if test "${cf_cv_term_header+set}" = set; then
8504   echo $ECHO_N "(cached) $ECHO_C" >&6
8505 else
8506
8507 case ${cf_cv_ncurses_header} in
8508 (*/ncurses.h|*/ncursesw.h)
8509         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8510         ;;
8511 (*)
8512         cf_term_header=term.h
8513         ;;
8514 esac
8515
8516 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8517 do
8518 cat >conftest.$ac_ext <<_ACEOF
8519 #line 8519 "configure"
8520 #include "confdefs.h"
8521 #include <stdio.h>
8522 #include <${cf_cv_ncurses_header:-curses.h}>
8523 #include <$cf_test>
8524
8525 int
8526 main (void)
8527 {
8528 int x = auto_left_margin
8529   ;
8530   return 0;
8531 }
8532 _ACEOF
8533 rm -f conftest.$ac_objext
8534 if { (eval echo "$as_me:8534: \"$ac_compile\"") >&5
8535   (eval $ac_compile) 2>&5
8536   ac_status=$?
8537   echo "$as_me:8537: \$? = $ac_status" >&5
8538   (exit $ac_status); } &&
8539          { ac_try='test -s conftest.$ac_objext'
8540   { (eval echo "$as_me:8540: \"$ac_try\"") >&5
8541   (eval $ac_try) 2>&5
8542   ac_status=$?
8543   echo "$as_me:8543: \$? = $ac_status" >&5
8544   (exit $ac_status); }; }; then
8545
8546         cf_cv_term_header="$cf_test"
8547 else
8548   echo "$as_me: failed program was:" >&5
8549 cat conftest.$ac_ext >&5
8550
8551         cf_cv_term_header=unknown
8552
8553 fi
8554 rm -f conftest.$ac_objext conftest.$ac_ext
8555         test "$cf_cv_term_header" != unknown && break
8556 done
8557
8558 fi
8559 echo "$as_me:8559: result: $cf_cv_term_header" >&5
8560 echo "${ECHO_T}$cf_cv_term_header" >&6
8561
8562 # Set definitions to allow ifdef'ing to accommodate subdirectories
8563
8564 case $cf_cv_term_header in
8565 (*term.h)
8566
8567 cat >>confdefs.h <<\EOF
8568 #define HAVE_TERM_H 1
8569 EOF
8570
8571         ;;
8572 esac
8573
8574 case $cf_cv_term_header in
8575 (ncurses/term.h)
8576
8577 cat >>confdefs.h <<\EOF
8578 #define HAVE_NCURSES_TERM_H 1
8579 EOF
8580
8581         ;;
8582 (ncursesw/term.h)
8583
8584 cat >>confdefs.h <<\EOF
8585 #define HAVE_NCURSESW_TERM_H 1
8586 EOF
8587
8588         ;;
8589 esac
8590
8591 # some applications need this, but should check for NCURSES_VERSION
8592
8593 cat >>confdefs.h <<\EOF
8594 #define NCURSES 1
8595 EOF
8596
8597 echo "$as_me:8597: checking for ncurses version" >&5
8598 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8599 if test "${cf_cv_ncurses_version+set}" = set; then
8600   echo $ECHO_N "(cached) $ECHO_C" >&6
8601 else
8602
8603         cf_cv_ncurses_version=no
8604         cf_tempfile=out$$
8605         rm -f $cf_tempfile
8606         if test "$cross_compiling" = yes; then
8607
8608         # This will not work if the preprocessor splits the line after the
8609         # Autoconf token.  The 'unproto' program does that.
8610         cat > conftest.$ac_ext <<EOF
8611 #include <${cf_cv_ncurses_header:-curses.h}>
8612 #undef Autoconf
8613 #ifdef NCURSES_VERSION
8614 Autoconf NCURSES_VERSION
8615 #else
8616 #ifdef __NCURSES_H
8617 Autoconf "old"
8618 #endif
8619 ;
8620 #endif
8621 EOF
8622         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8623         { (eval echo "$as_me:8623: \"$cf_try\"") >&5
8624   (eval $cf_try) 2>&5
8625   ac_status=$?
8626   echo "$as_me:8626: \$? = $ac_status" >&5
8627   (exit $ac_status); }
8628         if test -f conftest.out ; then
8629                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8630                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8631                 rm -f conftest.out
8632         fi
8633
8634 else
8635   cat >conftest.$ac_ext <<_ACEOF
8636 #line 8636 "configure"
8637 #include "confdefs.h"
8638
8639 #include <${cf_cv_ncurses_header:-curses.h}>
8640 #include <stdio.h>
8641 int main(void)
8642 {
8643         FILE *fp = fopen("$cf_tempfile", "w");
8644 #ifdef NCURSES_VERSION
8645 # ifdef NCURSES_VERSION_PATCH
8646         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8647 # else
8648         fprintf(fp, "%s\n", NCURSES_VERSION);
8649 # endif
8650 #else
8651 # ifdef __NCURSES_H
8652         fprintf(fp, "old\n");
8653 # else
8654         make an error
8655 # endif
8656 #endif
8657         ${cf_cv_main_return:-return}(0);
8658 }
8659 _ACEOF
8660 rm -f conftest$ac_exeext
8661 if { (eval echo "$as_me:8661: \"$ac_link\"") >&5
8662   (eval $ac_link) 2>&5
8663   ac_status=$?
8664   echo "$as_me:8664: \$? = $ac_status" >&5
8665   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8666   { (eval echo "$as_me:8666: \"$ac_try\"") >&5
8667   (eval $ac_try) 2>&5
8668   ac_status=$?
8669   echo "$as_me:8669: \$? = $ac_status" >&5
8670   (exit $ac_status); }; }; then
8671
8672         cf_cv_ncurses_version=`cat $cf_tempfile`
8673 else
8674   echo "$as_me: program exited with status $ac_status" >&5
8675 echo "$as_me: failed program was:" >&5
8676 cat conftest.$ac_ext >&5
8677 fi
8678 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8679 fi
8680         rm -f $cf_tempfile
8681
8682 fi
8683 echo "$as_me:8683: result: $cf_cv_ncurses_version" >&5
8684 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8685 test "$cf_cv_ncurses_version" = no ||
8686 cat >>confdefs.h <<\EOF
8687 #define NCURSES 1
8688 EOF
8689
8690 cf_nculib_root=ncurses
8691         # This works, except for the special case where we find gpm, but
8692         # ncurses is in a nonstandard location via $LIBS, and we really want
8693         # to link gpm.
8694 cf_ncurses_LIBS=""
8695 cf_ncurses_SAVE="$LIBS"
8696 echo "$as_me:8696: checking for Gpm_Open in -lgpm" >&5
8697 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8698 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8699   echo $ECHO_N "(cached) $ECHO_C" >&6
8700 else
8701   ac_check_lib_save_LIBS=$LIBS
8702 LIBS="-lgpm  $LIBS"
8703 cat >conftest.$ac_ext <<_ACEOF
8704 #line 8704 "configure"
8705 #include "confdefs.h"
8706
8707 /* Override any gcc2 internal prototype to avoid an error.  */
8708 #ifdef __cplusplus
8709 extern "C"
8710 #endif
8711 /* We use char because int might match the return type of a gcc2
8712    builtin and then its argument prototype would still apply.  */
8713 char Gpm_Open ();
8714 int
8715 main (void)
8716 {
8717 Gpm_Open ();
8718   ;
8719   return 0;
8720 }
8721 _ACEOF
8722 rm -f conftest.$ac_objext conftest$ac_exeext
8723 if { (eval echo "$as_me:8723: \"$ac_link\"") >&5
8724   (eval $ac_link) 2>&5
8725   ac_status=$?
8726   echo "$as_me:8726: \$? = $ac_status" >&5
8727   (exit $ac_status); } &&
8728          { ac_try='test -s conftest$ac_exeext'
8729   { (eval echo "$as_me:8729: \"$ac_try\"") >&5
8730   (eval $ac_try) 2>&5
8731   ac_status=$?
8732   echo "$as_me:8732: \$? = $ac_status" >&5
8733   (exit $ac_status); }; }; then
8734   ac_cv_lib_gpm_Gpm_Open=yes
8735 else
8736   echo "$as_me: failed program was:" >&5
8737 cat conftest.$ac_ext >&5
8738 ac_cv_lib_gpm_Gpm_Open=no
8739 fi
8740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8741 LIBS=$ac_check_lib_save_LIBS
8742 fi
8743 echo "$as_me:8743: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8744 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8745 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8746   echo "$as_me:8746: checking for initscr in -lgpm" >&5
8747 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8748 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8749   echo $ECHO_N "(cached) $ECHO_C" >&6
8750 else
8751   ac_check_lib_save_LIBS=$LIBS
8752 LIBS="-lgpm  $LIBS"
8753 cat >conftest.$ac_ext <<_ACEOF
8754 #line 8754 "configure"
8755 #include "confdefs.h"
8756
8757 /* Override any gcc2 internal prototype to avoid an error.  */
8758 #ifdef __cplusplus
8759 extern "C"
8760 #endif
8761 /* We use char because int might match the return type of a gcc2
8762    builtin and then its argument prototype would still apply.  */
8763 char initscr ();
8764 int
8765 main (void)
8766 {
8767 initscr ();
8768   ;
8769   return 0;
8770 }
8771 _ACEOF
8772 rm -f conftest.$ac_objext conftest$ac_exeext
8773 if { (eval echo "$as_me:8773: \"$ac_link\"") >&5
8774   (eval $ac_link) 2>&5
8775   ac_status=$?
8776   echo "$as_me:8776: \$? = $ac_status" >&5
8777   (exit $ac_status); } &&
8778          { ac_try='test -s conftest$ac_exeext'
8779   { (eval echo "$as_me:8779: \"$ac_try\"") >&5
8780   (eval $ac_try) 2>&5
8781   ac_status=$?
8782   echo "$as_me:8782: \$? = $ac_status" >&5
8783   (exit $ac_status); }; }; then
8784   ac_cv_lib_gpm_initscr=yes
8785 else
8786   echo "$as_me: failed program was:" >&5
8787 cat conftest.$ac_ext >&5
8788 ac_cv_lib_gpm_initscr=no
8789 fi
8790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8791 LIBS=$ac_check_lib_save_LIBS
8792 fi
8793 echo "$as_me:8793: result: $ac_cv_lib_gpm_initscr" >&5
8794 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8795 if test $ac_cv_lib_gpm_initscr = yes; then
8796   LIBS="$cf_ncurses_SAVE"
8797 else
8798   cf_ncurses_LIBS="-lgpm"
8799 fi
8800
8801 fi
8802
8803 case $host_os in
8804 (freebsd*)
8805         # This is only necessary if you are linking against an obsolete
8806         # version of ncurses (but it should do no harm, since it's static).
8807         if test "$cf_nculib_root" = ncurses ; then
8808                 echo "$as_me:8808: checking for tgoto in -lmytinfo" >&5
8809 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8810 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8811   echo $ECHO_N "(cached) $ECHO_C" >&6
8812 else
8813   ac_check_lib_save_LIBS=$LIBS
8814 LIBS="-lmytinfo  $LIBS"
8815 cat >conftest.$ac_ext <<_ACEOF
8816 #line 8816 "configure"
8817 #include "confdefs.h"
8818
8819 /* Override any gcc2 internal prototype to avoid an error.  */
8820 #ifdef __cplusplus
8821 extern "C"
8822 #endif
8823 /* We use char because int might match the return type of a gcc2
8824    builtin and then its argument prototype would still apply.  */
8825 char tgoto ();
8826 int
8827 main (void)
8828 {
8829 tgoto ();
8830   ;
8831   return 0;
8832 }
8833 _ACEOF
8834 rm -f conftest.$ac_objext conftest$ac_exeext
8835 if { (eval echo "$as_me:8835: \"$ac_link\"") >&5
8836   (eval $ac_link) 2>&5
8837   ac_status=$?
8838   echo "$as_me:8838: \$? = $ac_status" >&5
8839   (exit $ac_status); } &&
8840          { ac_try='test -s conftest$ac_exeext'
8841   { (eval echo "$as_me:8841: \"$ac_try\"") >&5
8842   (eval $ac_try) 2>&5
8843   ac_status=$?
8844   echo "$as_me:8844: \$? = $ac_status" >&5
8845   (exit $ac_status); }; }; then
8846   ac_cv_lib_mytinfo_tgoto=yes
8847 else
8848   echo "$as_me: failed program was:" >&5
8849 cat conftest.$ac_ext >&5
8850 ac_cv_lib_mytinfo_tgoto=no
8851 fi
8852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8853 LIBS=$ac_check_lib_save_LIBS
8854 fi
8855 echo "$as_me:8855: result: $ac_cv_lib_mytinfo_tgoto" >&5
8856 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8857 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8858   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8859 fi
8860
8861         fi
8862         ;;
8863 esac
8864
8865 cf_add_libs="$cf_ncurses_LIBS"
8866 # Filter out duplicates - this happens with badly-designed ".pc" files...
8867 for cf_add_1lib in $LIBS
8868 do
8869         for cf_add_2lib in $cf_add_libs
8870         do
8871                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8872                 then
8873                         cf_add_1lib=
8874                         break
8875                 fi
8876         done
8877         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8878 done
8879 LIBS="$cf_add_libs"
8880
8881 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8882 then
8883
8884 cf_add_libs="-l$cf_nculib_root"
8885 # Filter out duplicates - this happens with badly-designed ".pc" files...
8886 for cf_add_1lib in $LIBS
8887 do
8888         for cf_add_2lib in $cf_add_libs
8889         do
8890                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8891                 then
8892                         cf_add_1lib=
8893                         break
8894                 fi
8895         done
8896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8897 done
8898 LIBS="$cf_add_libs"
8899
8900 else
8901
8902         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8903         cf_libdir=""
8904         echo "$as_me:8904: checking for initscr" >&5
8905 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8906 if test "${ac_cv_func_initscr+set}" = set; then
8907   echo $ECHO_N "(cached) $ECHO_C" >&6
8908 else
8909   cat >conftest.$ac_ext <<_ACEOF
8910 #line 8910 "configure"
8911 #include "confdefs.h"
8912 /* System header to define __stub macros and hopefully few prototypes,
8913     which can conflict with char initscr (); below.  */
8914 #include <assert.h>
8915 /* Override any gcc2 internal prototype to avoid an error.  */
8916 #ifdef __cplusplus
8917 extern "C"
8918 #endif
8919 /* We use char because int might match the return type of a gcc2
8920    builtin and then its argument prototype would still apply.  */
8921 char initscr ();
8922 char (*f) ();
8923
8924 int
8925 main (void)
8926 {
8927 /* The GNU C library defines this for functions which it implements
8928     to always fail with ENOSYS.  Some functions are actually named
8929     something starting with __ and the normal name is an alias.  */
8930 #if defined (__stub_initscr) || defined (__stub___initscr)
8931 choke me
8932 #else
8933 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8934 #endif
8935
8936   ;
8937   return 0;
8938 }
8939 _ACEOF
8940 rm -f conftest.$ac_objext conftest$ac_exeext
8941 if { (eval echo "$as_me:8941: \"$ac_link\"") >&5
8942   (eval $ac_link) 2>&5
8943   ac_status=$?
8944   echo "$as_me:8944: \$? = $ac_status" >&5
8945   (exit $ac_status); } &&
8946          { ac_try='test -s conftest$ac_exeext'
8947   { (eval echo "$as_me:8947: \"$ac_try\"") >&5
8948   (eval $ac_try) 2>&5
8949   ac_status=$?
8950   echo "$as_me:8950: \$? = $ac_status" >&5
8951   (exit $ac_status); }; }; then
8952   ac_cv_func_initscr=yes
8953 else
8954   echo "$as_me: failed program was:" >&5
8955 cat conftest.$ac_ext >&5
8956 ac_cv_func_initscr=no
8957 fi
8958 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8959 fi
8960 echo "$as_me:8960: result: $ac_cv_func_initscr" >&5
8961 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8962 if test $ac_cv_func_initscr = yes; then
8963   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8964 else
8965
8966                 cf_save_LIBS="$LIBS"
8967                 echo "$as_me:8967: checking for initscr in -l$cf_nculib_root" >&5
8968 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8969                 LIBS="-l$cf_nculib_root $LIBS"
8970                 cat >conftest.$ac_ext <<_ACEOF
8971 #line 8971 "configure"
8972 #include "confdefs.h"
8973 #include <${cf_cv_ncurses_header:-curses.h}>
8974 int
8975 main (void)
8976 {
8977 initscr()
8978   ;
8979   return 0;
8980 }
8981 _ACEOF
8982 rm -f conftest.$ac_objext conftest$ac_exeext
8983 if { (eval echo "$as_me:8983: \"$ac_link\"") >&5
8984   (eval $ac_link) 2>&5
8985   ac_status=$?
8986   echo "$as_me:8986: \$? = $ac_status" >&5
8987   (exit $ac_status); } &&
8988          { ac_try='test -s conftest$ac_exeext'
8989   { (eval echo "$as_me:8989: \"$ac_try\"") >&5
8990   (eval $ac_try) 2>&5
8991   ac_status=$?
8992   echo "$as_me:8992: \$? = $ac_status" >&5
8993   (exit $ac_status); }; }; then
8994   echo "$as_me:8994: result: yes" >&5
8995 echo "${ECHO_T}yes" >&6
8996                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8997
8998 else
8999   echo "$as_me: failed program was:" >&5
9000 cat conftest.$ac_ext >&5
9001 echo "$as_me:9001: result: no" >&5
9002 echo "${ECHO_T}no" >&6
9003
9004 cf_search=
9005 cf_library_path_list=""
9006 if test -n "${LDFLAGS}${LIBS}" ; then
9007         for cf_library_path in $LDFLAGS $LIBS
9008         do
9009                 case $cf_library_path in
9010                 (-L*)
9011                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9012
9013 test "x$cf_library_path" != "xNONE" && \
9014 test -d "$cf_library_path" && \
9015  {
9016         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9017         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9018         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9019         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9020         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9021         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"
9022 }
9023
9024                         cf_library_path_list="$cf_library_path_list $cf_search"
9025                         ;;
9026                 esac
9027         done
9028 fi
9029
9030 cf_search=
9031
9032 test "x$prefix" != "xNONE" && \
9033 test -d "$prefix" && \
9034  {
9035         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9036         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9037         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9038         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9039         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9040         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9041 }
9042
9043 for cf_subdir_prefix in \
9044         /usr \
9045         /usr/local \
9046         /usr/pkg \
9047         /opt \
9048         /opt/local \
9049         $HOME
9050 do
9051
9052 test "x$cf_subdir_prefix" != "x$prefix" && \
9053 test -d "$cf_subdir_prefix" && \
9054 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9055         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9056         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9057         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9058         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9059         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9060         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"
9061 }
9062
9063 done
9064
9065 cf_search="$cf_library_path_list $cf_search"
9066
9067                         for cf_libdir in $cf_search
9068                         do
9069                                 echo "$as_me:9069: checking for -l$cf_nculib_root in $cf_libdir" >&5
9070 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9071                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9072                                 cat >conftest.$ac_ext <<_ACEOF
9073 #line 9073 "configure"
9074 #include "confdefs.h"
9075 #include <${cf_cv_ncurses_header:-curses.h}>
9076 int
9077 main (void)
9078 {
9079 initscr()
9080   ;
9081   return 0;
9082 }
9083 _ACEOF
9084 rm -f conftest.$ac_objext conftest$ac_exeext
9085 if { (eval echo "$as_me:9085: \"$ac_link\"") >&5
9086   (eval $ac_link) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit $ac_status); } &&
9090          { ac_try='test -s conftest$ac_exeext'
9091   { (eval echo "$as_me:9091: \"$ac_try\"") >&5
9092   (eval $ac_try) 2>&5
9093   ac_status=$?
9094   echo "$as_me:9094: \$? = $ac_status" >&5
9095   (exit $ac_status); }; }; then
9096   echo "$as_me:9096: result: yes" >&5
9097 echo "${ECHO_T}yes" >&6
9098                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9099                                          break
9100 else
9101   echo "$as_me: failed program was:" >&5
9102 cat conftest.$ac_ext >&5
9103 echo "$as_me:9103: result: no" >&5
9104 echo "${ECHO_T}no" >&6
9105                                          LIBS="$cf_save_LIBS"
9106 fi
9107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9108                         done
9109
9110 fi
9111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9112
9113 fi
9114
9115 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9116
9117 if test $cf_found_library = no ; then
9118         { { echo "$as_me:9118: error: Cannot link $cf_nculib_root library" >&5
9119 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9120    { (exit 1); exit 1; }; }
9121 fi
9122
9123 fi
9124
9125 if test -n "$cf_ncurses_LIBS" ; then
9126         echo "$as_me:9126: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9127 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9128         cf_ncurses_SAVE="$LIBS"
9129         for p in $cf_ncurses_LIBS ; do
9130                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9131                 if test "$q" != "$LIBS" ; then
9132                         LIBS="$q"
9133                 fi
9134         done
9135         cat >conftest.$ac_ext <<_ACEOF
9136 #line 9136 "configure"
9137 #include "confdefs.h"
9138 #include <${cf_cv_ncurses_header:-curses.h}>
9139 int
9140 main (void)
9141 {
9142 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9143   ;
9144   return 0;
9145 }
9146 _ACEOF
9147 rm -f conftest.$ac_objext conftest$ac_exeext
9148 if { (eval echo "$as_me:9148: \"$ac_link\"") >&5
9149   (eval $ac_link) 2>&5
9150   ac_status=$?
9151   echo "$as_me:9151: \$? = $ac_status" >&5
9152   (exit $ac_status); } &&
9153          { ac_try='test -s conftest$ac_exeext'
9154   { (eval echo "$as_me:9154: \"$ac_try\"") >&5
9155   (eval $ac_try) 2>&5
9156   ac_status=$?
9157   echo "$as_me:9157: \$? = $ac_status" >&5
9158   (exit $ac_status); }; }; then
9159   echo "$as_me:9159: result: yes" >&5
9160 echo "${ECHO_T}yes" >&6
9161 else
9162   echo "$as_me: failed program was:" >&5
9163 cat conftest.$ac_ext >&5
9164 echo "$as_me:9164: result: no" >&5
9165 echo "${ECHO_T}no" >&6
9166                  LIBS="$cf_ncurses_SAVE"
9167 fi
9168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9169 fi
9170
9171 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9172
9173 cat >>confdefs.h <<EOF
9174 #define $cf_nculib_ROOT 1
9175 EOF
9176
9177         fi
9178 else
9179         NCURSES_CONFIG=none
9180 fi
9181
9182 fi
9183
9184 if test "$NCURSES_CONFIG_PKG" != none ; then
9185         cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null`
9186
9187         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9188         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9189         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9190
9191         cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null`
9192         if test -z "$cf_cv_abi_version"
9193         then
9194                 cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null`
9195         fi
9196
9197 elif test "$NCURSES_CONFIG" != none ; then
9198
9199         cf_version=`$NCURSES_CONFIG --version 2>/dev/null`
9200
9201         NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
9202         NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'`
9203         NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'`
9204
9205         # ABI version is not available from headers
9206         cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null`
9207
9208 else
9209
9210         for cf_name in MAJOR MINOR PATCH
9211         do
9212         cat >conftest.$ac_ext <<CF_EOF
9213         #include <${cf_cv_ncurses_header:-curses.h}>
9214         AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
9215 CF_EOF
9216                 cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
9217                 { (eval echo "$as_me:9217: \"$cf_try\"") >&5
9218   (eval $cf_try) 2>&5
9219   ac_status=$?
9220   echo "$as_me:9220: \$? = $ac_status" >&5
9221   (exit $ac_status); }
9222                 if test -f conftest.out ; then
9223                         cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[   ][      ]*//"`
9224                         eval NCURSES_$cf_name=\"$cf_result\"
9225                         # cat conftest.$ac_ext
9226                         # cat conftest.out
9227                 fi
9228         done
9229
9230         cf_cv_abi_version=${NCURSES_MAJOR}
9231
9232 fi
9233
9234 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
9235
9236 cf_cv_timestamp=`date`
9237
9238 echo "$as_me:9238: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
9239 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
9240
9241 echo "$as_me:9241: checking if you want to have a library-prefix" >&5
9242 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6
9243
9244 # Check whether --with-lib-prefix or --without-lib-prefix was given.
9245 if test "${with_lib_prefix+set}" = set; then
9246   withval="$with_lib_prefix"
9247   with_lib_prefix=$withval
9248 else
9249   with_lib_prefix=auto
9250 fi;
9251 echo "$as_me:9251: result: $with_lib_prefix" >&5
9252 echo "${ECHO_T}$with_lib_prefix" >&6
9253
9254 if test $with_lib_prefix = auto
9255 then
9256
9257         case $cf_cv_system_name in
9258         (OS/2*|os2*)
9259                 if test "$DFT_LWR_MODEL" = libtool; then
9260                         LIB_PREFIX='lib'
9261                 else
9262                         LIB_PREFIX=''
9263                 fi
9264                 ;;
9265         (*)     LIB_PREFIX='lib'
9266                 ;;
9267         esac
9268 cf_prefix=$LIB_PREFIX
9269
9270 elif test $with_lib_prefix = no
9271 then
9272         LIB_PREFIX=
9273 else
9274         LIB_PREFIX=$with_lib_prefix
9275 fi
9276
9277 LIB_SUFFIX=
9278
9279 ###############################################################################
9280
9281 if test X"$CC_G_OPT" = X"" ; then
9282         CC_G_OPT='-g'
9283         test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
9284 fi
9285
9286 echo "$as_me:9286: checking for default loader flags" >&5
9287 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
9288 case $DFT_LWR_MODEL in
9289 (normal)  LD_MODEL=''   ;;
9290 (debug)   LD_MODEL=$CC_G_OPT ;;
9291 (profile) LD_MODEL='-pg';;
9292 (shared)  LD_MODEL=''   ;;
9293 esac
9294 echo "$as_me:9294: result: $LD_MODEL" >&5
9295 echo "${ECHO_T}$LD_MODEL" >&6
9296
9297 LD_RPATH_OPT=
9298 echo "$as_me:9298: checking for an rpath option" >&5
9299 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
9300 case $cf_cv_system_name in
9301 (irix*)
9302         if test "$GCC" = yes; then
9303                 LD_RPATH_OPT="-Wl,-rpath,"
9304         else
9305                 LD_RPATH_OPT="-rpath "
9306         fi
9307         ;;
9308 (linux*|gnu*|k*bsd*-gnu|freebsd*)
9309         LD_RPATH_OPT="-Wl,-rpath,"
9310         ;;
9311 (openbsd[2-9].*|mirbsd*)
9312         LD_RPATH_OPT="-Wl,-rpath,"
9313         ;;
9314 (dragonfly*)
9315         LD_RPATH_OPT="-rpath "
9316         ;;
9317 (netbsd*)
9318         LD_RPATH_OPT="-Wl,-rpath,"
9319         ;;
9320 (osf*|mls+*)
9321         LD_RPATH_OPT="-rpath "
9322         ;;
9323 (solaris2*)
9324         LD_RPATH_OPT="-R"
9325         ;;
9326 (*)
9327         ;;
9328 esac
9329 echo "$as_me:9329: result: $LD_RPATH_OPT" >&5
9330 echo "${ECHO_T}$LD_RPATH_OPT" >&6
9331
9332 case "x$LD_RPATH_OPT" in
9333 (x-R*)
9334         echo "$as_me:9334: checking if we need a space after rpath option" >&5
9335 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
9336         cf_save_LIBS="$LIBS"
9337
9338 cf_add_libs="${LD_RPATH_OPT}$libdir"
9339 # Filter out duplicates - this happens with badly-designed ".pc" files...
9340 for cf_add_1lib in $LIBS
9341 do
9342         for cf_add_2lib in $cf_add_libs
9343         do
9344                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9345                 then
9346                         cf_add_1lib=
9347                         break
9348                 fi
9349         done
9350         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9351 done
9352 LIBS="$cf_add_libs"
9353
9354         cat >conftest.$ac_ext <<_ACEOF
9355 #line 9355 "configure"
9356 #include "confdefs.h"
9357
9358 int
9359 main (void)
9360 {
9361
9362   ;
9363   return 0;
9364 }
9365 _ACEOF
9366 rm -f conftest.$ac_objext conftest$ac_exeext
9367 if { (eval echo "$as_me:9367: \"$ac_link\"") >&5
9368   (eval $ac_link) 2>&5
9369   ac_status=$?
9370   echo "$as_me:9370: \$? = $ac_status" >&5
9371   (exit $ac_status); } &&
9372          { ac_try='test -s conftest$ac_exeext'
9373   { (eval echo "$as_me:9373: \"$ac_try\"") >&5
9374   (eval $ac_try) 2>&5
9375   ac_status=$?
9376   echo "$as_me:9376: \$? = $ac_status" >&5
9377   (exit $ac_status); }; }; then
9378   cf_rpath_space=no
9379 else
9380   echo "$as_me: failed program was:" >&5
9381 cat conftest.$ac_ext >&5
9382 cf_rpath_space=yes
9383 fi
9384 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9385         LIBS="$cf_save_LIBS"
9386         echo "$as_me:9386: result: $cf_rpath_space" >&5
9387 echo "${ECHO_T}$cf_rpath_space" >&6
9388         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
9389         ;;
9390 esac
9391
9392         RM_SHARED_OPTS=
9393         LOCAL_LDFLAGS=
9394         LOCAL_LDFLAGS2=
9395         LD_SHARED_OPTS=
9396         INSTALL_LIB="-m 644"
9397         : ${rel_builddir:=.}
9398
9399         shlibdir=$libdir
9400
9401         MAKE_DLLS="#"
9402
9403         cf_cv_do_symlinks=no
9404         cf_ld_rpath_opt=
9405         test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
9406
9407         echo "$as_me:9407: checking if release/abi version should be used for shared libs" >&5
9408 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
9409
9410 # Check whether --with-shlib-version or --without-shlib-version was given.
9411 if test "${with_shlib_version+set}" = set; then
9412   withval="$with_shlib_version"
9413   test -z "$withval" && withval=auto
9414         case $withval in
9415         (yes)
9416                 cf_cv_shlib_version=auto
9417                 ;;
9418         (rel|abi|auto)
9419                 cf_cv_shlib_version=$withval
9420                 ;;
9421         (*)
9422                 echo "$as_me:9422: result: $withval" >&5
9423 echo "${ECHO_T}$withval" >&6
9424                 { { echo "$as_me:9424: error: option value must be one of: rel, abi, or auto" >&5
9425 echo "$as_me: error: option value must be one of: rel, abi, or auto" >&2;}
9426    { (exit 1); exit 1; }; }
9427                 ;;
9428         esac
9429
9430 else
9431   cf_cv_shlib_version=auto
9432 fi;
9433         echo "$as_me:9433: result: $cf_cv_shlib_version" >&5
9434 echo "${ECHO_T}$cf_cv_shlib_version" >&6
9435
9436         cf_cv_rm_so_locs=no
9437         cf_try_cflags=
9438
9439         # Some less-capable ports of gcc support only -fpic
9440         CC_SHARED_OPTS=
9441
9442         cf_try_fPIC=no
9443         if test "$GCC" = yes
9444         then
9445                 cf_try_fPIC=yes
9446         else
9447                 case $cf_cv_system_name in
9448                 (*linux*)       # e.g., PGI compiler
9449                         cf_try_fPIC=yes
9450                         ;;
9451                 esac
9452         fi
9453
9454         if test "$cf_try_fPIC" = yes
9455         then
9456                 echo "$as_me:9456: checking which $CC option to use" >&5
9457 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
9458                 cf_save_CFLAGS="$CFLAGS"
9459                 for CC_SHARED_OPTS in -fPIC -fpic ''
9460                 do
9461                         CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
9462                         cat >conftest.$ac_ext <<_ACEOF
9463 #line 9463 "configure"
9464 #include "confdefs.h"
9465 #include <stdio.h>
9466 int
9467 main (void)
9468 {
9469 int x = 1
9470   ;
9471   return 0;
9472 }
9473 _ACEOF
9474 rm -f conftest.$ac_objext
9475 if { (eval echo "$as_me:9475: \"$ac_compile\"") >&5
9476   (eval $ac_compile) 2>&5
9477   ac_status=$?
9478   echo "$as_me:9478: \$? = $ac_status" >&5
9479   (exit $ac_status); } &&
9480          { ac_try='test -s conftest.$ac_objext'
9481   { (eval echo "$as_me:9481: \"$ac_try\"") >&5
9482   (eval $ac_try) 2>&5
9483   ac_status=$?
9484   echo "$as_me:9484: \$? = $ac_status" >&5
9485   (exit $ac_status); }; }; then
9486   break
9487 else
9488   echo "$as_me: failed program was:" >&5
9489 cat conftest.$ac_ext >&5
9490 fi
9491 rm -f conftest.$ac_objext conftest.$ac_ext
9492                 done
9493                 echo "$as_me:9493: result: $CC_SHARED_OPTS" >&5
9494 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
9495                 CFLAGS="$cf_save_CFLAGS"
9496         fi
9497
9498         cf_cv_shlib_version_infix=no
9499
9500         case $cf_cv_system_name in
9501         (aix4.3-9*|aix[5-7]*)
9502                 if test "$GCC" = yes; then
9503                         CC_SHARED_OPTS='-Wl,-brtl'
9504                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9505                 else
9506                         CC_SHARED_OPTS='-brtl'
9507                         # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
9508                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o $@'
9509                 fi
9510                 ;;
9511         (beos*)
9512                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
9513                 ;;
9514         (cygwin*)
9515                 CC_SHARED_OPTS=
9516                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9517                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9518                 cf_cv_shlib_version=cygdll
9519                 cf_cv_shlib_version_infix=cygdll
9520                 shlibdir=$bindir
9521                 MAKE_DLLS=
9522                 cat >mk_shared_lib.sh <<-CF_EOF
9523                 #!$SHELL
9524                 SHARED_LIB=\$1
9525                 IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9526                 shift
9527                 cat <<-EOF
9528                 Linking shared library
9529                 ** SHARED_LIB \$SHARED_LIB
9530                 ** IMPORT_LIB \$IMPORT_LIB
9531 EOF
9532                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9533 CF_EOF
9534                 chmod +x mk_shared_lib.sh
9535                 ;;
9536         (msys*)
9537                 CC_SHARED_OPTS=
9538                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9539                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9540                 cf_cv_shlib_version=msysdll
9541                 cf_cv_shlib_version_infix=msysdll
9542                 shlibdir=$bindir
9543                 MAKE_DLLS=
9544                 cat >mk_shared_lib.sh <<-CF_EOF
9545                 #!$SHELL
9546                 SHARED_LIB=\$1
9547                 IMPORT_LIB=\`echo "\$1" | sed -e 's/msys-/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
9548                 shift
9549                 cat <<-EOF
9550                 Linking shared library
9551                 ** SHARED_LIB \$SHARED_LIB
9552                 ** IMPORT_LIB \$IMPORT_LIB
9553 EOF
9554                 exec \$* ${LDFLAGS} -shared -Wl,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9555 CF_EOF
9556                 chmod +x mk_shared_lib.sh
9557                 ;;
9558         (darwin*)
9559                 cf_try_cflags="no-cpp-precomp"
9560                 CC_SHARED_OPTS="-dynamic"
9561                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
9562                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
9563                 cf_cv_shlib_version_infix=yes
9564                 echo "$as_me:9564: checking if ld -search_paths_first works" >&5
9565 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
9566 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
9567   echo $ECHO_N "(cached) $ECHO_C" >&6
9568 else
9569
9570                         cf_save_LDFLAGS=$LDFLAGS
9571                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9572                         cat >conftest.$ac_ext <<_ACEOF
9573 #line 9573 "configure"
9574 #include "confdefs.h"
9575
9576 int
9577 main (void)
9578 {
9579 int i;
9580   ;
9581   return 0;
9582 }
9583 _ACEOF
9584 rm -f conftest.$ac_objext conftest$ac_exeext
9585 if { (eval echo "$as_me:9585: \"$ac_link\"") >&5
9586   (eval $ac_link) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); } &&
9590          { ac_try='test -s conftest$ac_exeext'
9591   { (eval echo "$as_me:9591: \"$ac_try\"") >&5
9592   (eval $ac_try) 2>&5
9593   ac_status=$?
9594   echo "$as_me:9594: \$? = $ac_status" >&5
9595   (exit $ac_status); }; }; then
9596   cf_cv_ldflags_search_paths_first=yes
9597 else
9598   echo "$as_me: failed program was:" >&5
9599 cat conftest.$ac_ext >&5
9600 cf_cv_ldflags_search_paths_first=no
9601 fi
9602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9603                                 LDFLAGS=$cf_save_LDFLAGS
9604 fi
9605 echo "$as_me:9605: result: $cf_cv_ldflags_search_paths_first" >&5
9606 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
9607                 if test $cf_cv_ldflags_search_paths_first = yes; then
9608                         LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
9609                 fi
9610                 ;;
9611         (hpux[7-8]*)
9612                 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
9613                 if test "$GCC" != yes; then
9614                         CC_SHARED_OPTS='+Z'
9615                 fi
9616                 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $@'
9617                 INSTALL_LIB="-m 555"
9618                 ;;
9619         (hpux*)
9620                 # (tested with gcc 2.7.2 -- I don't have c89)
9621                 if test "$GCC" = yes; then
9622                         LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
9623                 else
9624                         CC_SHARED_OPTS='+Z'
9625                         LD_SHARED_OPTS='-Wl,+b,${libdir}'
9626                 fi
9627                 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $@'
9628                 # HP-UX shared libraries must be executable, and should be
9629                 # readonly to exploit a quirk in the memory manager.
9630                 INSTALL_LIB="-m 555"
9631                 ;;
9632         (interix*)
9633                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9634                 if test "$cf_cv_shlib_version" = rel; then
9635                         cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9636                 else
9637                         cf_shared_soname='`basename $@`'
9638                 fi
9639                 CC_SHARED_OPTS=
9640                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $@'
9641                 ;;
9642         (irix*)
9643                 if test "$cf_cv_enable_rpath" = yes ; then
9644                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9645                 fi
9646                 # tested with IRIX 5.2 and 'cc'.
9647                 if test "$GCC" != yes; then
9648                         CC_SHARED_OPTS='-KPIC'
9649                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $@` -o $@'
9650                 else
9651                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $@` -o $@'
9652                 fi
9653                 cf_cv_rm_so_locs=yes
9654                 ;;
9655         (linux*|gnu*|k*bsd*-gnu)
9656                 if test "$DFT_LWR_MODEL" = "shared" ; then
9657                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9658                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9659                 fi
9660                 if test "$cf_cv_enable_rpath" = yes ; then
9661                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9662                 fi
9663
9664         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9665         if test "$cf_cv_shlib_version" = rel; then
9666                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9667         else
9668                 cf_cv_shared_soname='`basename $@`'
9669         fi
9670
9671                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9672                 ;;
9673         (mingw*)
9674                 cf_cv_shlib_version=mingw
9675                 cf_cv_shlib_version_infix=mingw
9676                 shlibdir=$bindir
9677                 MAKE_DLLS=
9678                 if test "$DFT_LWR_MODEL" = "shared" ; then
9679                         LOCAL_LDFLAGS="-Wl,--enable-auto-import"
9680                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9681                         EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
9682                 fi
9683                 CC_SHARED_OPTS=
9684                 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
9685                 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
9686                 cat >mk_shared_lib.sh <<-CF_EOF
9687                 #!$SHELL
9688                 SHARED_LIB=\$1
9689                 IMPORT_LIB=\`echo "\$1" | sed -e 's/[0-9]*\.dll$/.dll.a/'\`
9690                 shift
9691                 cat <<-EOF
9692                 Linking shared library
9693                 ** SHARED_LIB \$SHARED_LIB
9694                 ** IMPORT_LIB \$IMPORT_LIB
9695 EOF
9696                 exec \$* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\${IMPORT_LIB} -Wl,--export-all-symbols -o \${SHARED_LIB}
9697 CF_EOF
9698                 chmod +x mk_shared_lib.sh
9699                 ;;
9700         (openbsd[2-9].*|mirbsd*)
9701                 if test "$DFT_LWR_MODEL" = "shared" ; then
9702                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9703                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9704                 fi
9705                 if test "$cf_cv_enable_rpath" = yes ; then
9706                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9707                 fi
9708                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9709
9710         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9711         if test "$cf_cv_shlib_version" = rel; then
9712                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9713         else
9714                 cf_cv_shared_soname='`basename $@`'
9715         fi
9716
9717                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9718                 ;;
9719         (nto-qnx*|openbsd*|freebsd[12].*)
9720                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9721                 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $@'
9722                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9723                 ;;
9724         (dragonfly*|freebsd*)
9725                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9726                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9727                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9728                         LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
9729                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9730                 fi
9731
9732         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9733         if test "$cf_cv_shlib_version" = rel; then
9734                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9735         else
9736                 cf_cv_shared_soname='`basename $@`'
9737         fi
9738
9739                 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
9740                 ;;
9741         (netbsd*)
9742                 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
9743                 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
9744                         LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
9745                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9746                         EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
9747                         if test "$cf_cv_shlib_version" = auto; then
9748                         if test -f /usr/libexec/ld.elf_so; then
9749                                 cf_cv_shlib_version=abi
9750                         else
9751                                 cf_cv_shlib_version=rel
9752                         fi
9753                         fi
9754
9755         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9756         if test "$cf_cv_shlib_version" = rel; then
9757                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9758         else
9759                 cf_cv_shared_soname='`basename $@`'
9760         fi
9761
9762                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
9763                 else
9764                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $@'
9765                 fi
9766                 ;;
9767         (osf*|mls+*)
9768                 # tested with OSF/1 V3.2 and 'cc'
9769                 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
9770                 # link with shared libs).
9771                 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
9772                 case $host_os in
9773                 (osf4*)
9774                         MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
9775                         ;;
9776                 esac
9777                 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
9778                 if test "$DFT_LWR_MODEL" = "shared" ; then
9779                         LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
9780                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9781                 fi
9782                 cf_cv_rm_so_locs=yes
9783                 ;;
9784         (sco3.2v5*)  # also uw2* and UW7: hops 13-Apr-98
9785                 # tested with osr5.0.5
9786                 if test "$GCC" != yes; then
9787                         CC_SHARED_OPTS='-belf -KPIC'
9788                 fi
9789                 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
9790                 if test "$cf_cv_enable_rpath" = yes ; then
9791                         # only way is to set LD_RUN_PATH but no switch for it
9792                         RUN_PATH=$libdir
9793                 fi
9794                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9795                 LINK_PROGS='LD_RUN_PATH=${libdir}'
9796                 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
9797                 ;;
9798         (sunos4*)
9799                 # tested with SunOS 4.1.1 and gcc 2.7.0
9800                 if test "$GCC" != yes; then
9801                         CC_SHARED_OPTS='-KPIC'
9802                 fi
9803                 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $@'
9804                 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9805                 ;;
9806         (solaris2*)
9807                 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
9808                 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
9809                 if test "$DFT_LWR_MODEL" = "shared" ; then
9810                         LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
9811                         LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
9812                 fi
9813                 if test "$cf_cv_enable_rpath" = yes ; then
9814                         EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
9815                 fi
9816
9817         test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
9818         if test "$cf_cv_shlib_version" = rel; then
9819                 cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
9820         else
9821                 cf_cv_shared_soname='`basename $@`'
9822         fi
9823
9824                 if test "$GCC" != yes; then
9825                         cf_save_CFLAGS="$CFLAGS"
9826                         for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
9827                         do
9828                                 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
9829                                 cat >conftest.$ac_ext <<_ACEOF
9830 #line 9830 "configure"
9831 #include "confdefs.h"
9832 #include <stdio.h>
9833 int
9834 main (void)
9835 {
9836 printf("Hello\n");
9837   ;
9838   return 0;
9839 }
9840 _ACEOF
9841 rm -f conftest.$ac_objext
9842 if { (eval echo "$as_me:9842: \"$ac_compile\"") >&5
9843   (eval $ac_compile) 2>&5
9844   ac_status=$?
9845   echo "$as_me:9845: \$? = $ac_status" >&5
9846   (exit $ac_status); } &&
9847          { ac_try='test -s conftest.$ac_objext'
9848   { (eval echo "$as_me:9848: \"$ac_try\"") >&5
9849   (eval $ac_try) 2>&5
9850   ac_status=$?
9851   echo "$as_me:9851: \$? = $ac_status" >&5
9852   (exit $ac_status); }; }; then
9853   break
9854 else
9855   echo "$as_me: failed program was:" >&5
9856 cat conftest.$ac_ext >&5
9857 fi
9858 rm -f conftest.$ac_objext conftest.$ac_ext
9859                         done
9860                         CFLAGS="$cf_save_CFLAGS"
9861                         CC_SHARED_OPTS=$cf_shared_opts
9862                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $@'
9863                 else
9864                         MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
9865                 fi
9866                 ;;
9867         (sysv5uw7*|unix_sv*)
9868                 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
9869                 if test "$GCC" != yes; then
9870                         CC_SHARED_OPTS='-KPIC'
9871                 fi
9872                 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o $@'
9873                 ;;
9874         (*)
9875                 CC_SHARED_OPTS='unknown'
9876                 MK_SHARED_LIB='echo unknown'
9877                 ;;
9878         esac
9879
9880         # This works if the last tokens in $MK_SHARED_LIB are the -o target.
9881         case "$cf_cv_shlib_version" in
9882         (rel|abi)
9883                 case "$MK_SHARED_LIB" in
9884                 (*'-o $@')
9885                         test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
9886                         ;;
9887                 (*)
9888                         { echo "$as_me:9888: WARNING: ignored --with-shlib-version" >&5
9889 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
9890                         ;;
9891                 esac
9892                 ;;
9893         esac
9894
9895         if test -n "$cf_try_cflags"
9896         then
9897 cat > conftest.$ac_ext <<EOF
9898 #line 9898 "${as_me:-configure}"
9899 #include <stdio.h>
9900 int main(int argc, char *argv[])
9901 {
9902         printf("hello\n");
9903         return (argv[argc-1] == 0) ;
9904 }
9905 EOF
9906                 cf_save_CFLAGS="$CFLAGS"
9907                 for cf_opt in $cf_try_cflags
9908                 do
9909                         CFLAGS="$cf_save_CFLAGS -$cf_opt"
9910                         echo "$as_me:9910: checking if CFLAGS option -$cf_opt works" >&5
9911 echo $ECHO_N "checking if CFLAGS option -$cf_opt works... $ECHO_C" >&6
9912                         if { (eval echo "$as_me:9912: \"$ac_compile\"") >&5
9913   (eval $ac_compile) 2>&5
9914   ac_status=$?
9915   echo "$as_me:9915: \$? = $ac_status" >&5
9916   (exit $ac_status); }; then
9917                                 echo "$as_me:9917: result: yes" >&5
9918 echo "${ECHO_T}yes" >&6
9919                                 cf_save_CFLAGS="$CFLAGS"
9920                         else
9921                                 echo "$as_me:9921: result: no" >&5
9922 echo "${ECHO_T}no" >&6
9923                         fi
9924                 done
9925                 CFLAGS="$cf_save_CFLAGS"
9926         fi
9927
9928         # RPATH_LIST is a colon-separated list of directories
9929         test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
9930         test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
9931
9932         test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
9933
9934         test -n "$verbose" && echo "    CC_SHARED_OPTS: $CC_SHARED_OPTS" 1>&6
9935
9936 echo "${as_me:-configure}:9936: testing CC_SHARED_OPTS: $CC_SHARED_OPTS ..." 1>&5
9937
9938         test -n "$verbose" && echo "    MK_SHARED_LIB:  $MK_SHARED_LIB" 1>&6
9939
9940 echo "${as_me:-configure}:9940: testing MK_SHARED_LIB:  $MK_SHARED_LIB ..." 1>&5
9941
9942 # The test/sample programs in the original tree link using rpath option.
9943 # Make it optional for packagers.
9944 if test -n "$LOCAL_LDFLAGS"
9945 then
9946         echo "$as_me:9946: checking if you want to link sample programs with rpath option" >&5
9947 echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
9948
9949 # Check whether --enable-rpath-link or --disable-rpath-link was given.
9950 if test "${enable_rpath_link+set}" = set; then
9951   enableval="$enable_rpath_link"
9952   with_rpath_link=$enableval
9953 else
9954   with_rpath_link=yes
9955 fi;
9956         echo "$as_me:9956: result: $with_rpath_link" >&5
9957 echo "${ECHO_T}$with_rpath_link" >&6
9958         if test "$with_rpath_link" = no
9959         then
9960                 LOCAL_LDFLAGS=
9961                 LOCAL_LDFLAGS2=
9962         fi
9963 fi
9964
9965 ###############################################################################
9966
9967 ###   use option --enable-broken-linker to force on use of broken-linker support
9968 echo "$as_me:9968: checking if you want broken-linker support code" >&5
9969 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
9970
9971 # Check whether --enable-broken_linker or --disable-broken_linker was given.
9972 if test "${enable_broken_linker+set}" = set; then
9973   enableval="$enable_broken_linker"
9974   with_broken_linker=$enableval
9975 else
9976   with_broken_linker=${BROKEN_LINKER:-no}
9977 fi;
9978 echo "$as_me:9978: result: $with_broken_linker" >&5
9979 echo "${ECHO_T}$with_broken_linker" >&6
9980
9981 BROKEN_LINKER=0
9982 if test "$with_broken_linker" = yes ; then
9983         cat >>confdefs.h <<\EOF
9984 #define BROKEN_LINKER 1
9985 EOF
9986
9987         BROKEN_LINKER=1
9988 elif test "$DFT_LWR_MODEL" = shared ; then
9989         case $cf_cv_system_name in
9990         (cygwin*)
9991                 cat >>confdefs.h <<\EOF
9992 #define BROKEN_LINKER 1
9993 EOF
9994
9995                 BROKEN_LINKER=1
9996                 test -n "$verbose" && echo "    cygwin linker is broken anyway" 1>&6
9997
9998 echo "${as_me:-configure}:9998: testing cygwin linker is broken anyway ..." 1>&5
9999
10000                 ;;
10001         esac
10002 fi
10003
10004 # Check to define _XOPEN_SOURCE "automatically"
10005
10006 cf_XOPEN_SOURCE=500
10007 cf_POSIX_C_SOURCE=199506L
10008 cf_xopen_source=
10009
10010 case $host_os in
10011 (aix[4-7]*)
10012         cf_xopen_source="-D_ALL_SOURCE"
10013         ;;
10014 (msys)
10015         cf_XOPEN_SOURCE=600
10016         ;;
10017 (darwin[0-8].*)
10018         cf_xopen_source="-D_APPLE_C_SOURCE"
10019         ;;
10020 (darwin*)
10021         cf_xopen_source="-D_DARWIN_C_SOURCE"
10022         cf_XOPEN_SOURCE=
10023         ;;
10024 (freebsd*|dragonfly*)
10025         # 5.x headers associate
10026         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
10027         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
10028         cf_POSIX_C_SOURCE=200112L
10029         cf_XOPEN_SOURCE=600
10030         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10031         ;;
10032 (hpux11*)
10033         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
10034         ;;
10035 (hpux*)
10036         cf_xopen_source="-D_HPUX_SOURCE"
10037         ;;
10038 (irix[56].*)
10039         cf_xopen_source="-D_SGI_SOURCE"
10040         cf_XOPEN_SOURCE=
10041         ;;
10042 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
10043
10044 echo "$as_me:10044: checking if we must define _GNU_SOURCE" >&5
10045 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
10046 if test "${cf_cv_gnu_source+set}" = set; then
10047   echo $ECHO_N "(cached) $ECHO_C" >&6
10048 else
10049
10050 cat >conftest.$ac_ext <<_ACEOF
10051 #line 10051 "configure"
10052 #include "confdefs.h"
10053 #include <sys/types.h>
10054 int
10055 main (void)
10056 {
10057
10058 #ifndef _XOPEN_SOURCE
10059 make an error
10060 #endif
10061   ;
10062   return 0;
10063 }
10064 _ACEOF
10065 rm -f conftest.$ac_objext
10066 if { (eval echo "$as_me:10066: \"$ac_compile\"") >&5
10067   (eval $ac_compile) 2>&5
10068   ac_status=$?
10069   echo "$as_me:10069: \$? = $ac_status" >&5
10070   (exit $ac_status); } &&
10071          { ac_try='test -s conftest.$ac_objext'
10072   { (eval echo "$as_me:10072: \"$ac_try\"") >&5
10073   (eval $ac_try) 2>&5
10074   ac_status=$?
10075   echo "$as_me:10075: \$? = $ac_status" >&5
10076   (exit $ac_status); }; }; then
10077   cf_cv_gnu_source=no
10078 else
10079   echo "$as_me: failed program was:" >&5
10080 cat conftest.$ac_ext >&5
10081 cf_save="$CPPFLAGS"
10082          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10083          cat >conftest.$ac_ext <<_ACEOF
10084 #line 10084 "configure"
10085 #include "confdefs.h"
10086 #include <sys/types.h>
10087 int
10088 main (void)
10089 {
10090
10091 #ifdef _XOPEN_SOURCE
10092 make an error
10093 #endif
10094   ;
10095   return 0;
10096 }
10097 _ACEOF
10098 rm -f conftest.$ac_objext
10099 if { (eval echo "$as_me:10099: \"$ac_compile\"") >&5
10100   (eval $ac_compile) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit $ac_status); } &&
10104          { ac_try='test -s conftest.$ac_objext'
10105   { (eval echo "$as_me:10105: \"$ac_try\"") >&5
10106   (eval $ac_try) 2>&5
10107   ac_status=$?
10108   echo "$as_me:10108: \$? = $ac_status" >&5
10109   (exit $ac_status); }; }; then
10110   cf_cv_gnu_source=no
10111 else
10112   echo "$as_me: failed program was:" >&5
10113 cat conftest.$ac_ext >&5
10114 cf_cv_gnu_source=yes
10115 fi
10116 rm -f conftest.$ac_objext conftest.$ac_ext
10117         CPPFLAGS="$cf_save"
10118
10119 fi
10120 rm -f conftest.$ac_objext conftest.$ac_ext
10121
10122 fi
10123 echo "$as_me:10123: result: $cf_cv_gnu_source" >&5
10124 echo "${ECHO_T}$cf_cv_gnu_source" >&6
10125
10126 if test "$cf_cv_gnu_source" = yes
10127 then
10128 echo "$as_me:10128: checking if we should also define _DEFAULT_SOURCE" >&5
10129 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
10130 if test "${cf_cv_default_source+set}" = set; then
10131   echo $ECHO_N "(cached) $ECHO_C" >&6
10132 else
10133
10134 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
10135         cat >conftest.$ac_ext <<_ACEOF
10136 #line 10136 "configure"
10137 #include "confdefs.h"
10138 #include <sys/types.h>
10139 int
10140 main (void)
10141 {
10142
10143 #ifdef _DEFAULT_SOURCE
10144 make an error
10145 #endif
10146   ;
10147   return 0;
10148 }
10149 _ACEOF
10150 rm -f conftest.$ac_objext
10151 if { (eval echo "$as_me:10151: \"$ac_compile\"") >&5
10152   (eval $ac_compile) 2>&5
10153   ac_status=$?
10154   echo "$as_me:10154: \$? = $ac_status" >&5
10155   (exit $ac_status); } &&
10156          { ac_try='test -s conftest.$ac_objext'
10157   { (eval echo "$as_me:10157: \"$ac_try\"") >&5
10158   (eval $ac_try) 2>&5
10159   ac_status=$?
10160   echo "$as_me:10160: \$? = $ac_status" >&5
10161   (exit $ac_status); }; }; then
10162   cf_cv_default_source=no
10163 else
10164   echo "$as_me: failed program was:" >&5
10165 cat conftest.$ac_ext >&5
10166 cf_cv_default_source=yes
10167 fi
10168 rm -f conftest.$ac_objext conftest.$ac_ext
10169
10170 fi
10171 echo "$as_me:10171: result: $cf_cv_default_source" >&5
10172 echo "${ECHO_T}$cf_cv_default_source" >&6
10173 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
10174 fi
10175
10176         ;;
10177 (minix*)
10178         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
10179         ;;
10180 (mirbsd*)
10181         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
10182         cf_XOPEN_SOURCE=
10183
10184 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10185
10186 cf_save_CFLAGS="$CFLAGS"
10187 cf_save_CPPFLAGS="$CPPFLAGS"
10188
10189 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10190         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10191                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10192
10193 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10194         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10195                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10196
10197 echo "$as_me:10197: checking if we should define _POSIX_C_SOURCE" >&5
10198 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10199 if test "${cf_cv_posix_c_source+set}" = set; then
10200   echo $ECHO_N "(cached) $ECHO_C" >&6
10201 else
10202
10203 echo "${as_me:-configure}:10203: testing if the symbol is already defined go no further ..." 1>&5
10204
10205         cat >conftest.$ac_ext <<_ACEOF
10206 #line 10206 "configure"
10207 #include "confdefs.h"
10208 #include <sys/types.h>
10209 int
10210 main (void)
10211 {
10212
10213 #ifndef _POSIX_C_SOURCE
10214 make an error
10215 #endif
10216   ;
10217   return 0;
10218 }
10219 _ACEOF
10220 rm -f conftest.$ac_objext
10221 if { (eval echo "$as_me:10221: \"$ac_compile\"") >&5
10222   (eval $ac_compile) 2>&5
10223   ac_status=$?
10224   echo "$as_me:10224: \$? = $ac_status" >&5
10225   (exit $ac_status); } &&
10226          { ac_try='test -s conftest.$ac_objext'
10227   { (eval echo "$as_me:10227: \"$ac_try\"") >&5
10228   (eval $ac_try) 2>&5
10229   ac_status=$?
10230   echo "$as_me:10230: \$? = $ac_status" >&5
10231   (exit $ac_status); }; }; then
10232   cf_cv_posix_c_source=no
10233 else
10234   echo "$as_me: failed program was:" >&5
10235 cat conftest.$ac_ext >&5
10236 cf_want_posix_source=no
10237          case .$cf_POSIX_C_SOURCE in
10238          (.[12]??*)
10239                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10240                 ;;
10241          (.2)
10242                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10243                 cf_want_posix_source=yes
10244                 ;;
10245          (.*)
10246                 cf_want_posix_source=yes
10247                 ;;
10248          esac
10249          if test "$cf_want_posix_source" = yes ; then
10250                 cat >conftest.$ac_ext <<_ACEOF
10251 #line 10251 "configure"
10252 #include "confdefs.h"
10253 #include <sys/types.h>
10254 int
10255 main (void)
10256 {
10257
10258 #ifdef _POSIX_SOURCE
10259 make an error
10260 #endif
10261   ;
10262   return 0;
10263 }
10264 _ACEOF
10265 rm -f conftest.$ac_objext
10266 if { (eval echo "$as_me:10266: \"$ac_compile\"") >&5
10267   (eval $ac_compile) 2>&5
10268   ac_status=$?
10269   echo "$as_me:10269: \$? = $ac_status" >&5
10270   (exit $ac_status); } &&
10271          { ac_try='test -s conftest.$ac_objext'
10272   { (eval echo "$as_me:10272: \"$ac_try\"") >&5
10273   (eval $ac_try) 2>&5
10274   ac_status=$?
10275   echo "$as_me:10275: \$? = $ac_status" >&5
10276   (exit $ac_status); }; }; then
10277   :
10278 else
10279   echo "$as_me: failed program was:" >&5
10280 cat conftest.$ac_ext >&5
10281 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10282 fi
10283 rm -f conftest.$ac_objext conftest.$ac_ext
10284          fi
10285
10286 echo "${as_me:-configure}:10286: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10287
10288          CFLAGS="$cf_trim_CFLAGS"
10289          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10290
10291 echo "${as_me:-configure}:10291: testing if the second compile does not leave our definition intact error ..." 1>&5
10292
10293          cat >conftest.$ac_ext <<_ACEOF
10294 #line 10294 "configure"
10295 #include "confdefs.h"
10296 #include <sys/types.h>
10297 int
10298 main (void)
10299 {
10300
10301 #ifndef _POSIX_C_SOURCE
10302 make an error
10303 #endif
10304   ;
10305   return 0;
10306 }
10307 _ACEOF
10308 rm -f conftest.$ac_objext
10309 if { (eval echo "$as_me:10309: \"$ac_compile\"") >&5
10310   (eval $ac_compile) 2>&5
10311   ac_status=$?
10312   echo "$as_me:10312: \$? = $ac_status" >&5
10313   (exit $ac_status); } &&
10314          { ac_try='test -s conftest.$ac_objext'
10315   { (eval echo "$as_me:10315: \"$ac_try\"") >&5
10316   (eval $ac_try) 2>&5
10317   ac_status=$?
10318   echo "$as_me:10318: \$? = $ac_status" >&5
10319   (exit $ac_status); }; }; then
10320   :
10321 else
10322   echo "$as_me: failed program was:" >&5
10323 cat conftest.$ac_ext >&5
10324 cf_cv_posix_c_source=no
10325 fi
10326 rm -f conftest.$ac_objext conftest.$ac_ext
10327          CFLAGS="$cf_save_CFLAGS"
10328          CPPFLAGS="$cf_save_CPPFLAGS"
10329
10330 fi
10331 rm -f conftest.$ac_objext conftest.$ac_ext
10332
10333 fi
10334 echo "$as_me:10334: result: $cf_cv_posix_c_source" >&5
10335 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10336
10337 if test "$cf_cv_posix_c_source" != no ; then
10338         CFLAGS="$cf_trim_CFLAGS"
10339         CPPFLAGS="$cf_trim_CPPFLAGS"
10340
10341 cf_fix_cppflags=no
10342 cf_new_cflags=
10343 cf_new_cppflags=
10344 cf_new_extra_cppflags=
10345
10346 for cf_add_cflags in $cf_cv_posix_c_source
10347 do
10348 case $cf_fix_cppflags in
10349 (no)
10350         case $cf_add_cflags in
10351         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10352                 case $cf_add_cflags in
10353                 (-D*)
10354                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10355
10356                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10357                                 && test -z "${cf_tst_cflags}" \
10358                                 && cf_fix_cppflags=yes
10359
10360                         if test $cf_fix_cppflags = yes ; then
10361
10362         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10363         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10364
10365                                 continue
10366                         elif test "${cf_tst_cflags}" = "\"'" ; then
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                                 continue
10372                         fi
10373                         ;;
10374                 esac
10375                 case "$CPPFLAGS" in
10376                 (*$cf_add_cflags)
10377                         ;;
10378                 (*)
10379                         case $cf_add_cflags in
10380                         (-D*)
10381                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10382
10383 CPPFLAGS=`echo "$CPPFLAGS" | \
10384         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10385                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10386
10387                                 ;;
10388                         esac
10389
10390         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10391         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10392
10393                         ;;
10394                 esac
10395                 ;;
10396         (*)
10397
10398         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10399         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10400
10401                 ;;
10402         esac
10403         ;;
10404 (yes)
10405
10406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10408
10409         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10410
10411         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10412                 && test -z "${cf_tst_cflags}" \
10413                 && cf_fix_cppflags=no
10414         ;;
10415 esac
10416 done
10417
10418 if test -n "$cf_new_cflags" ; then
10419
10420         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10421         CFLAGS="${CFLAGS}$cf_new_cflags"
10422
10423 fi
10424
10425 if test -n "$cf_new_cppflags" ; then
10426
10427         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10428         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10429
10430 fi
10431
10432 if test -n "$cf_new_extra_cppflags" ; then
10433
10434         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10435         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10436
10437 fi
10438
10439 fi
10440
10441         ;;
10442 (netbsd*)
10443         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
10444         ;;
10445 (openbsd[4-9]*)
10446         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
10447         cf_xopen_source="-D_BSD_SOURCE"
10448         cf_XOPEN_SOURCE=600
10449         ;;
10450 (openbsd*)
10451         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
10452         ;;
10453 (osf[45]*)
10454         cf_xopen_source="-D_OSF_SOURCE"
10455         ;;
10456 (nto-qnx*)
10457         cf_xopen_source="-D_QNX_SOURCE"
10458         ;;
10459 (sco*)
10460         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
10461         ;;
10462 (solaris2.*)
10463         cf_xopen_source="-D__EXTENSIONS__"
10464         cf_cv_xopen_source=broken
10465         ;;
10466 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
10467         cf_XOPEN_SOURCE=
10468         cf_POSIX_C_SOURCE=
10469         ;;
10470 (*)
10471
10472 echo "$as_me:10472: checking if we should define _XOPEN_SOURCE" >&5
10473 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
10474 if test "${cf_cv_xopen_source+set}" = set; then
10475   echo $ECHO_N "(cached) $ECHO_C" >&6
10476 else
10477
10478         cat >conftest.$ac_ext <<_ACEOF
10479 #line 10479 "configure"
10480 #include "confdefs.h"
10481
10482 #include <stdlib.h>
10483 #include <string.h>
10484 #include <sys/types.h>
10485
10486 int
10487 main (void)
10488 {
10489
10490 #ifndef _XOPEN_SOURCE
10491 make an error
10492 #endif
10493   ;
10494   return 0;
10495 }
10496 _ACEOF
10497 rm -f conftest.$ac_objext
10498 if { (eval echo "$as_me:10498: \"$ac_compile\"") >&5
10499   (eval $ac_compile) 2>&5
10500   ac_status=$?
10501   echo "$as_me:10501: \$? = $ac_status" >&5
10502   (exit $ac_status); } &&
10503          { ac_try='test -s conftest.$ac_objext'
10504   { (eval echo "$as_me:10504: \"$ac_try\"") >&5
10505   (eval $ac_try) 2>&5
10506   ac_status=$?
10507   echo "$as_me:10507: \$? = $ac_status" >&5
10508   (exit $ac_status); }; }; then
10509   cf_cv_xopen_source=no
10510 else
10511   echo "$as_me: failed program was:" >&5
10512 cat conftest.$ac_ext >&5
10513 cf_save="$CPPFLAGS"
10514          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
10515          cat >conftest.$ac_ext <<_ACEOF
10516 #line 10516 "configure"
10517 #include "confdefs.h"
10518
10519 #include <stdlib.h>
10520 #include <string.h>
10521 #include <sys/types.h>
10522
10523 int
10524 main (void)
10525 {
10526
10527 #ifdef _XOPEN_SOURCE
10528 make an error
10529 #endif
10530   ;
10531   return 0;
10532 }
10533 _ACEOF
10534 rm -f conftest.$ac_objext
10535 if { (eval echo "$as_me:10535: \"$ac_compile\"") >&5
10536   (eval $ac_compile) 2>&5
10537   ac_status=$?
10538   echo "$as_me:10538: \$? = $ac_status" >&5
10539   (exit $ac_status); } &&
10540          { ac_try='test -s conftest.$ac_objext'
10541   { (eval echo "$as_me:10541: \"$ac_try\"") >&5
10542   (eval $ac_try) 2>&5
10543   ac_status=$?
10544   echo "$as_me:10544: \$? = $ac_status" >&5
10545   (exit $ac_status); }; }; then
10546   cf_cv_xopen_source=no
10547 else
10548   echo "$as_me: failed program was:" >&5
10549 cat conftest.$ac_ext >&5
10550 cf_cv_xopen_source=$cf_XOPEN_SOURCE
10551 fi
10552 rm -f conftest.$ac_objext conftest.$ac_ext
10553         CPPFLAGS="$cf_save"
10554
10555 fi
10556 rm -f conftest.$ac_objext conftest.$ac_ext
10557
10558 fi
10559 echo "$as_me:10559: result: $cf_cv_xopen_source" >&5
10560 echo "${ECHO_T}$cf_cv_xopen_source" >&6
10561
10562 if test "$cf_cv_xopen_source" != no ; then
10563
10564 CFLAGS=`echo "$CFLAGS" | \
10565         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10566                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10567
10568 CPPFLAGS=`echo "$CPPFLAGS" | \
10569         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
10570                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
10571
10572         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
10573
10574 cf_fix_cppflags=no
10575 cf_new_cflags=
10576 cf_new_cppflags=
10577 cf_new_extra_cppflags=
10578
10579 for cf_add_cflags in $cf_temp_xopen_source
10580 do
10581 case $cf_fix_cppflags in
10582 (no)
10583         case $cf_add_cflags in
10584         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10585                 case $cf_add_cflags in
10586                 (-D*)
10587                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10588
10589                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10590                                 && test -z "${cf_tst_cflags}" \
10591                                 && cf_fix_cppflags=yes
10592
10593                         if test $cf_fix_cppflags = yes ; then
10594
10595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10597
10598                                 continue
10599                         elif test "${cf_tst_cflags}" = "\"'" ; then
10600
10601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10603
10604                                 continue
10605                         fi
10606                         ;;
10607                 esac
10608                 case "$CPPFLAGS" in
10609                 (*$cf_add_cflags)
10610                         ;;
10611                 (*)
10612                         case $cf_add_cflags in
10613                         (-D*)
10614                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10615
10616 CPPFLAGS=`echo "$CPPFLAGS" | \
10617         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10618                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10619
10620                                 ;;
10621                         esac
10622
10623         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10624         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10625
10626                         ;;
10627                 esac
10628                 ;;
10629         (*)
10630
10631         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10632         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10633
10634                 ;;
10635         esac
10636         ;;
10637 (yes)
10638
10639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10641
10642         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10643
10644         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10645                 && test -z "${cf_tst_cflags}" \
10646                 && cf_fix_cppflags=no
10647         ;;
10648 esac
10649 done
10650
10651 if test -n "$cf_new_cflags" ; then
10652
10653         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10654         CFLAGS="${CFLAGS}$cf_new_cflags"
10655
10656 fi
10657
10658 if test -n "$cf_new_cppflags" ; then
10659
10660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10661         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10662
10663 fi
10664
10665 if test -n "$cf_new_extra_cppflags" ; then
10666
10667         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10668         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10669
10670 fi
10671
10672 fi
10673
10674 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
10675
10676 cf_save_CFLAGS="$CFLAGS"
10677 cf_save_CPPFLAGS="$CPPFLAGS"
10678
10679 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
10680         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10681                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10682
10683 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
10684         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
10685                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
10686
10687 echo "$as_me:10687: checking if we should define _POSIX_C_SOURCE" >&5
10688 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
10689 if test "${cf_cv_posix_c_source+set}" = set; then
10690   echo $ECHO_N "(cached) $ECHO_C" >&6
10691 else
10692
10693 echo "${as_me:-configure}:10693: testing if the symbol is already defined go no further ..." 1>&5
10694
10695         cat >conftest.$ac_ext <<_ACEOF
10696 #line 10696 "configure"
10697 #include "confdefs.h"
10698 #include <sys/types.h>
10699 int
10700 main (void)
10701 {
10702
10703 #ifndef _POSIX_C_SOURCE
10704 make an error
10705 #endif
10706   ;
10707   return 0;
10708 }
10709 _ACEOF
10710 rm -f conftest.$ac_objext
10711 if { (eval echo "$as_me:10711: \"$ac_compile\"") >&5
10712   (eval $ac_compile) 2>&5
10713   ac_status=$?
10714   echo "$as_me:10714: \$? = $ac_status" >&5
10715   (exit $ac_status); } &&
10716          { ac_try='test -s conftest.$ac_objext'
10717   { (eval echo "$as_me:10717: \"$ac_try\"") >&5
10718   (eval $ac_try) 2>&5
10719   ac_status=$?
10720   echo "$as_me:10720: \$? = $ac_status" >&5
10721   (exit $ac_status); }; }; then
10722   cf_cv_posix_c_source=no
10723 else
10724   echo "$as_me: failed program was:" >&5
10725 cat conftest.$ac_ext >&5
10726 cf_want_posix_source=no
10727          case .$cf_POSIX_C_SOURCE in
10728          (.[12]??*)
10729                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10730                 ;;
10731          (.2)
10732                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
10733                 cf_want_posix_source=yes
10734                 ;;
10735          (.*)
10736                 cf_want_posix_source=yes
10737                 ;;
10738          esac
10739          if test "$cf_want_posix_source" = yes ; then
10740                 cat >conftest.$ac_ext <<_ACEOF
10741 #line 10741 "configure"
10742 #include "confdefs.h"
10743 #include <sys/types.h>
10744 int
10745 main (void)
10746 {
10747
10748 #ifdef _POSIX_SOURCE
10749 make an error
10750 #endif
10751   ;
10752   return 0;
10753 }
10754 _ACEOF
10755 rm -f conftest.$ac_objext
10756 if { (eval echo "$as_me:10756: \"$ac_compile\"") >&5
10757   (eval $ac_compile) 2>&5
10758   ac_status=$?
10759   echo "$as_me:10759: \$? = $ac_status" >&5
10760   (exit $ac_status); } &&
10761          { ac_try='test -s conftest.$ac_objext'
10762   { (eval echo "$as_me:10762: \"$ac_try\"") >&5
10763   (eval $ac_try) 2>&5
10764   ac_status=$?
10765   echo "$as_me:10765: \$? = $ac_status" >&5
10766   (exit $ac_status); }; }; then
10767   :
10768 else
10769   echo "$as_me: failed program was:" >&5
10770 cat conftest.$ac_ext >&5
10771 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
10772 fi
10773 rm -f conftest.$ac_objext conftest.$ac_ext
10774          fi
10775
10776 echo "${as_me:-configure}:10776: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
10777
10778          CFLAGS="$cf_trim_CFLAGS"
10779          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
10780
10781 echo "${as_me:-configure}:10781: testing if the second compile does not leave our definition intact error ..." 1>&5
10782
10783          cat >conftest.$ac_ext <<_ACEOF
10784 #line 10784 "configure"
10785 #include "confdefs.h"
10786 #include <sys/types.h>
10787 int
10788 main (void)
10789 {
10790
10791 #ifndef _POSIX_C_SOURCE
10792 make an error
10793 #endif
10794   ;
10795   return 0;
10796 }
10797 _ACEOF
10798 rm -f conftest.$ac_objext
10799 if { (eval echo "$as_me:10799: \"$ac_compile\"") >&5
10800   (eval $ac_compile) 2>&5
10801   ac_status=$?
10802   echo "$as_me:10802: \$? = $ac_status" >&5
10803   (exit $ac_status); } &&
10804          { ac_try='test -s conftest.$ac_objext'
10805   { (eval echo "$as_me:10805: \"$ac_try\"") >&5
10806   (eval $ac_try) 2>&5
10807   ac_status=$?
10808   echo "$as_me:10808: \$? = $ac_status" >&5
10809   (exit $ac_status); }; }; then
10810   :
10811 else
10812   echo "$as_me: failed program was:" >&5
10813 cat conftest.$ac_ext >&5
10814 cf_cv_posix_c_source=no
10815 fi
10816 rm -f conftest.$ac_objext conftest.$ac_ext
10817          CFLAGS="$cf_save_CFLAGS"
10818          CPPFLAGS="$cf_save_CPPFLAGS"
10819
10820 fi
10821 rm -f conftest.$ac_objext conftest.$ac_ext
10822
10823 fi
10824 echo "$as_me:10824: result: $cf_cv_posix_c_source" >&5
10825 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
10826
10827 if test "$cf_cv_posix_c_source" != no ; then
10828         CFLAGS="$cf_trim_CFLAGS"
10829         CPPFLAGS="$cf_trim_CPPFLAGS"
10830
10831 cf_fix_cppflags=no
10832 cf_new_cflags=
10833 cf_new_cppflags=
10834 cf_new_extra_cppflags=
10835
10836 for cf_add_cflags in $cf_cv_posix_c_source
10837 do
10838 case $cf_fix_cppflags in
10839 (no)
10840         case $cf_add_cflags in
10841         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10842                 case $cf_add_cflags in
10843                 (-D*)
10844                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10845
10846                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10847                                 && test -z "${cf_tst_cflags}" \
10848                                 && cf_fix_cppflags=yes
10849
10850                         if test $cf_fix_cppflags = yes ; then
10851
10852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10854
10855                                 continue
10856                         elif test "${cf_tst_cflags}" = "\"'" ; then
10857
10858         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10859         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10860
10861                                 continue
10862                         fi
10863                         ;;
10864                 esac
10865                 case "$CPPFLAGS" in
10866                 (*$cf_add_cflags)
10867                         ;;
10868                 (*)
10869                         case $cf_add_cflags in
10870                         (-D*)
10871                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10872
10873 CPPFLAGS=`echo "$CPPFLAGS" | \
10874         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10875                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10876
10877                                 ;;
10878                         esac
10879
10880         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10881         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10882
10883                         ;;
10884                 esac
10885                 ;;
10886         (*)
10887
10888         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10889         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10890
10891                 ;;
10892         esac
10893         ;;
10894 (yes)
10895
10896         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10897         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10898
10899         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10900
10901         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10902                 && test -z "${cf_tst_cflags}" \
10903                 && cf_fix_cppflags=no
10904         ;;
10905 esac
10906 done
10907
10908 if test -n "$cf_new_cflags" ; then
10909
10910         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10911         CFLAGS="${CFLAGS}$cf_new_cflags"
10912
10913 fi
10914
10915 if test -n "$cf_new_cppflags" ; then
10916
10917         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10918         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10919
10920 fi
10921
10922 if test -n "$cf_new_extra_cppflags" ; then
10923
10924         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10925         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10926
10927 fi
10928
10929 fi
10930
10931         ;;
10932 esac
10933
10934 if test -n "$cf_xopen_source" ; then
10935
10936 cf_fix_cppflags=no
10937 cf_new_cflags=
10938 cf_new_cppflags=
10939 cf_new_extra_cppflags=
10940
10941 for cf_add_cflags in $cf_xopen_source
10942 do
10943 case $cf_fix_cppflags in
10944 (no)
10945         case $cf_add_cflags in
10946         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10947                 case $cf_add_cflags in
10948                 (-D*)
10949                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10950
10951                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10952                                 && test -z "${cf_tst_cflags}" \
10953                                 && cf_fix_cppflags=yes
10954
10955                         if test $cf_fix_cppflags = yes ; then
10956
10957         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10958         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10959
10960                                 continue
10961                         elif test "${cf_tst_cflags}" = "\"'" ; then
10962
10963         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10964         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10965
10966                                 continue
10967                         fi
10968                         ;;
10969                 esac
10970                 case "$CPPFLAGS" in
10971                 (*$cf_add_cflags)
10972                         ;;
10973                 (*)
10974                         case $cf_add_cflags in
10975                         (-D*)
10976                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10977
10978 CPPFLAGS=`echo "$CPPFLAGS" | \
10979         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10980                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10981
10982                                 ;;
10983                         esac
10984
10985         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10986         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10987
10988                         ;;
10989                 esac
10990                 ;;
10991         (*)
10992
10993         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10994         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10995
10996                 ;;
10997         esac
10998         ;;
10999 (yes)
11000
11001         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11002         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11003
11004         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11005
11006         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11007                 && test -z "${cf_tst_cflags}" \
11008                 && cf_fix_cppflags=no
11009         ;;
11010 esac
11011 done
11012
11013 if test -n "$cf_new_cflags" ; then
11014         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11015
11016 echo "${as_me:-configure}:11016: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11017
11018         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11019         CFLAGS="${CFLAGS}$cf_new_cflags"
11020
11021 fi
11022
11023 if test -n "$cf_new_cppflags" ; then
11024         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11025
11026 echo "${as_me:-configure}:11026: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11027
11028         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11029         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11030
11031 fi
11032
11033 if test -n "$cf_new_extra_cppflags" ; then
11034         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11035
11036 echo "${as_me:-configure}:11036: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11037
11038         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11039         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11040
11041 fi
11042
11043 fi
11044
11045 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
11046         echo "$as_me:11046: checking if _XOPEN_SOURCE really is set" >&5
11047 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
11048         cat >conftest.$ac_ext <<_ACEOF
11049 #line 11049 "configure"
11050 #include "confdefs.h"
11051 #include <stdlib.h>
11052 int
11053 main (void)
11054 {
11055
11056 #ifndef _XOPEN_SOURCE
11057 make an error
11058 #endif
11059   ;
11060   return 0;
11061 }
11062 _ACEOF
11063 rm -f conftest.$ac_objext
11064 if { (eval echo "$as_me:11064: \"$ac_compile\"") >&5
11065   (eval $ac_compile) 2>&5
11066   ac_status=$?
11067   echo "$as_me:11067: \$? = $ac_status" >&5
11068   (exit $ac_status); } &&
11069          { ac_try='test -s conftest.$ac_objext'
11070   { (eval echo "$as_me:11070: \"$ac_try\"") >&5
11071   (eval $ac_try) 2>&5
11072   ac_status=$?
11073   echo "$as_me:11073: \$? = $ac_status" >&5
11074   (exit $ac_status); }; }; then
11075   cf_XOPEN_SOURCE_set=yes
11076 else
11077   echo "$as_me: failed program was:" >&5
11078 cat conftest.$ac_ext >&5
11079 cf_XOPEN_SOURCE_set=no
11080 fi
11081 rm -f conftest.$ac_objext conftest.$ac_ext
11082         echo "$as_me:11082: result: $cf_XOPEN_SOURCE_set" >&5
11083 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
11084         if test $cf_XOPEN_SOURCE_set = yes
11085         then
11086                 cat >conftest.$ac_ext <<_ACEOF
11087 #line 11087 "configure"
11088 #include "confdefs.h"
11089 #include <stdlib.h>
11090 int
11091 main (void)
11092 {
11093
11094 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
11095 make an error
11096 #endif
11097   ;
11098   return 0;
11099 }
11100 _ACEOF
11101 rm -f conftest.$ac_objext
11102 if { (eval echo "$as_me:11102: \"$ac_compile\"") >&5
11103   (eval $ac_compile) 2>&5
11104   ac_status=$?
11105   echo "$as_me:11105: \$? = $ac_status" >&5
11106   (exit $ac_status); } &&
11107          { ac_try='test -s conftest.$ac_objext'
11108   { (eval echo "$as_me:11108: \"$ac_try\"") >&5
11109   (eval $ac_try) 2>&5
11110   ac_status=$?
11111   echo "$as_me:11111: \$? = $ac_status" >&5
11112   (exit $ac_status); }; }; then
11113   cf_XOPEN_SOURCE_set_ok=yes
11114 else
11115   echo "$as_me: failed program was:" >&5
11116 cat conftest.$ac_ext >&5
11117 cf_XOPEN_SOURCE_set_ok=no
11118 fi
11119 rm -f conftest.$ac_objext conftest.$ac_ext
11120                 if test $cf_XOPEN_SOURCE_set_ok = no
11121                 then
11122                         { echo "$as_me:11122: WARNING: _XOPEN_SOURCE is lower than requested" >&5
11123 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
11124                 fi
11125         else
11126
11127 echo "$as_me:11127: checking if we should define _XOPEN_SOURCE" >&5
11128 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
11129 if test "${cf_cv_xopen_source+set}" = set; then
11130   echo $ECHO_N "(cached) $ECHO_C" >&6
11131 else
11132
11133         cat >conftest.$ac_ext <<_ACEOF
11134 #line 11134 "configure"
11135 #include "confdefs.h"
11136
11137 #include <stdlib.h>
11138 #include <string.h>
11139 #include <sys/types.h>
11140
11141 int
11142 main (void)
11143 {
11144
11145 #ifndef _XOPEN_SOURCE
11146 make an error
11147 #endif
11148   ;
11149   return 0;
11150 }
11151 _ACEOF
11152 rm -f conftest.$ac_objext
11153 if { (eval echo "$as_me:11153: \"$ac_compile\"") >&5
11154   (eval $ac_compile) 2>&5
11155   ac_status=$?
11156   echo "$as_me:11156: \$? = $ac_status" >&5
11157   (exit $ac_status); } &&
11158          { ac_try='test -s conftest.$ac_objext'
11159   { (eval echo "$as_me:11159: \"$ac_try\"") >&5
11160   (eval $ac_try) 2>&5
11161   ac_status=$?
11162   echo "$as_me:11162: \$? = $ac_status" >&5
11163   (exit $ac_status); }; }; then
11164   cf_cv_xopen_source=no
11165 else
11166   echo "$as_me: failed program was:" >&5
11167 cat conftest.$ac_ext >&5
11168 cf_save="$CPPFLAGS"
11169          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
11170          cat >conftest.$ac_ext <<_ACEOF
11171 #line 11171 "configure"
11172 #include "confdefs.h"
11173
11174 #include <stdlib.h>
11175 #include <string.h>
11176 #include <sys/types.h>
11177
11178 int
11179 main (void)
11180 {
11181
11182 #ifdef _XOPEN_SOURCE
11183 make an error
11184 #endif
11185   ;
11186   return 0;
11187 }
11188 _ACEOF
11189 rm -f conftest.$ac_objext
11190 if { (eval echo "$as_me:11190: \"$ac_compile\"") >&5
11191   (eval $ac_compile) 2>&5
11192   ac_status=$?
11193   echo "$as_me:11193: \$? = $ac_status" >&5
11194   (exit $ac_status); } &&
11195          { ac_try='test -s conftest.$ac_objext'
11196   { (eval echo "$as_me:11196: \"$ac_try\"") >&5
11197   (eval $ac_try) 2>&5
11198   ac_status=$?
11199   echo "$as_me:11199: \$? = $ac_status" >&5
11200   (exit $ac_status); }; }; then
11201   cf_cv_xopen_source=no
11202 else
11203   echo "$as_me: failed program was:" >&5
11204 cat conftest.$ac_ext >&5
11205 cf_cv_xopen_source=$cf_XOPEN_SOURCE
11206 fi
11207 rm -f conftest.$ac_objext conftest.$ac_ext
11208         CPPFLAGS="$cf_save"
11209
11210 fi
11211 rm -f conftest.$ac_objext conftest.$ac_ext
11212
11213 fi
11214 echo "$as_me:11214: result: $cf_cv_xopen_source" >&5
11215 echo "${ECHO_T}$cf_cv_xopen_source" >&6
11216
11217 if test "$cf_cv_xopen_source" != no ; then
11218
11219 CFLAGS=`echo "$CFLAGS" | \
11220         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11221                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11222
11223 CPPFLAGS=`echo "$CPPFLAGS" | \
11224         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
11225                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
11226
11227         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
11228
11229 cf_fix_cppflags=no
11230 cf_new_cflags=
11231 cf_new_cppflags=
11232 cf_new_extra_cppflags=
11233
11234 for cf_add_cflags in $cf_temp_xopen_source
11235 do
11236 case $cf_fix_cppflags in
11237 (no)
11238         case $cf_add_cflags in
11239         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11240                 case $cf_add_cflags in
11241                 (-D*)
11242                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11243
11244                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11245                                 && test -z "${cf_tst_cflags}" \
11246                                 && cf_fix_cppflags=yes
11247
11248                         if test $cf_fix_cppflags = yes ; then
11249
11250         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11251         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11252
11253                                 continue
11254                         elif test "${cf_tst_cflags}" = "\"'" ; then
11255
11256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11258
11259                                 continue
11260                         fi
11261                         ;;
11262                 esac
11263                 case "$CPPFLAGS" in
11264                 (*$cf_add_cflags)
11265                         ;;
11266                 (*)
11267                         case $cf_add_cflags in
11268                         (-D*)
11269                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11270
11271 CPPFLAGS=`echo "$CPPFLAGS" | \
11272         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11273                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11274
11275                                 ;;
11276                         esac
11277
11278         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11279         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11280
11281                         ;;
11282                 esac
11283                 ;;
11284         (*)
11285
11286         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11287         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11288
11289                 ;;
11290         esac
11291         ;;
11292 (yes)
11293
11294         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11295         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11296
11297         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11298
11299         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11300                 && test -z "${cf_tst_cflags}" \
11301                 && cf_fix_cppflags=no
11302         ;;
11303 esac
11304 done
11305
11306 if test -n "$cf_new_cflags" ; then
11307
11308         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11309         CFLAGS="${CFLAGS}$cf_new_cflags"
11310
11311 fi
11312
11313 if test -n "$cf_new_cppflags" ; then
11314
11315         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11316         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11317
11318 fi
11319
11320 if test -n "$cf_new_extra_cppflags" ; then
11321
11322         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11323         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11324
11325 fi
11326
11327 fi
11328
11329         fi
11330 fi
11331
11332 # Check whether --enable-largefile or --disable-largefile was given.
11333 if test "${enable_largefile+set}" = set; then
11334   enableval="$enable_largefile"
11335
11336 fi;
11337 if test "$enable_largefile" != no; then
11338
11339   echo "$as_me:11339: checking for special C compiler options needed for large files" >&5
11340 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
11341 if test "${ac_cv_sys_largefile_CC+set}" = set; then
11342   echo $ECHO_N "(cached) $ECHO_C" >&6
11343 else
11344   ac_cv_sys_largefile_CC=no
11345      if test "$GCC" != yes; then
11346        ac_save_CC=$CC
11347        while :; do
11348          # IRIX 6.2 and later do not support large files by default,
11349          # so use the C compiler's -n32 option if that helps.
11350          cat >conftest.$ac_ext <<_ACEOF
11351 #line 11351 "configure"
11352 #include "confdefs.h"
11353 #include <sys/types.h>
11354  /* Check that off_t can represent 2**63 - 1 correctly.
11355     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11356     since some C++ compilers masquerading as C compilers
11357     incorrectly reject 9223372036854775807.  */
11358 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11359   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11360                        && LARGE_OFF_T % 2147483647 == 1)
11361                       ? 1 : -1];
11362 int
11363 main (void)
11364 {
11365
11366   ;
11367   return 0;
11368 }
11369 _ACEOF
11370          rm -f conftest.$ac_objext
11371 if { (eval echo "$as_me:11371: \"$ac_compile\"") >&5
11372   (eval $ac_compile) 2>&5
11373   ac_status=$?
11374   echo "$as_me:11374: \$? = $ac_status" >&5
11375   (exit $ac_status); } &&
11376          { ac_try='test -s conftest.$ac_objext'
11377   { (eval echo "$as_me:11377: \"$ac_try\"") >&5
11378   (eval $ac_try) 2>&5
11379   ac_status=$?
11380   echo "$as_me:11380: \$? = $ac_status" >&5
11381   (exit $ac_status); }; }; then
11382   break
11383 else
11384   echo "$as_me: failed program was:" >&5
11385 cat conftest.$ac_ext >&5
11386 fi
11387 rm -f conftest.$ac_objext
11388          CC="$CC -n32"
11389          rm -f conftest.$ac_objext
11390 if { (eval echo "$as_me:11390: \"$ac_compile\"") >&5
11391   (eval $ac_compile) 2>&5
11392   ac_status=$?
11393   echo "$as_me:11393: \$? = $ac_status" >&5
11394   (exit $ac_status); } &&
11395          { ac_try='test -s conftest.$ac_objext'
11396   { (eval echo "$as_me:11396: \"$ac_try\"") >&5
11397   (eval $ac_try) 2>&5
11398   ac_status=$?
11399   echo "$as_me:11399: \$? = $ac_status" >&5
11400   (exit $ac_status); }; }; then
11401   ac_cv_sys_largefile_CC=' -n32'; break
11402 else
11403   echo "$as_me: failed program was:" >&5
11404 cat conftest.$ac_ext >&5
11405 fi
11406 rm -f conftest.$ac_objext
11407          break
11408        done
11409        CC=$ac_save_CC
11410        rm -f conftest.$ac_ext
11411     fi
11412 fi
11413 echo "$as_me:11413: result: $ac_cv_sys_largefile_CC" >&5
11414 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
11415   if test "$ac_cv_sys_largefile_CC" != no; then
11416     CC=$CC$ac_cv_sys_largefile_CC
11417   fi
11418
11419   echo "$as_me:11419: checking for _FILE_OFFSET_BITS value needed for large files" >&5
11420 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
11421 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
11422   echo $ECHO_N "(cached) $ECHO_C" >&6
11423 else
11424   while :; do
11425   ac_cv_sys_file_offset_bits=no
11426   cat >conftest.$ac_ext <<_ACEOF
11427 #line 11427 "configure"
11428 #include "confdefs.h"
11429 #include <sys/types.h>
11430  /* Check that off_t can represent 2**63 - 1 correctly.
11431     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11432     since some C++ compilers masquerading as C compilers
11433     incorrectly reject 9223372036854775807.  */
11434 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11435   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11436                        && LARGE_OFF_T % 2147483647 == 1)
11437                       ? 1 : -1];
11438 int
11439 main (void)
11440 {
11441
11442   ;
11443   return 0;
11444 }
11445 _ACEOF
11446 rm -f conftest.$ac_objext
11447 if { (eval echo "$as_me:11447: \"$ac_compile\"") >&5
11448   (eval $ac_compile) 2>&5
11449   ac_status=$?
11450   echo "$as_me:11450: \$? = $ac_status" >&5
11451   (exit $ac_status); } &&
11452          { ac_try='test -s conftest.$ac_objext'
11453   { (eval echo "$as_me:11453: \"$ac_try\"") >&5
11454   (eval $ac_try) 2>&5
11455   ac_status=$?
11456   echo "$as_me:11456: \$? = $ac_status" >&5
11457   (exit $ac_status); }; }; then
11458   break
11459 else
11460   echo "$as_me: failed program was:" >&5
11461 cat conftest.$ac_ext >&5
11462 fi
11463 rm -f conftest.$ac_objext conftest.$ac_ext
11464   cat >conftest.$ac_ext <<_ACEOF
11465 #line 11465 "configure"
11466 #include "confdefs.h"
11467 #define _FILE_OFFSET_BITS 64
11468 #include <sys/types.h>
11469  /* Check that off_t can represent 2**63 - 1 correctly.
11470     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11471     since some C++ compilers masquerading as C compilers
11472     incorrectly reject 9223372036854775807.  */
11473 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11474   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11475                        && LARGE_OFF_T % 2147483647 == 1)
11476                       ? 1 : -1];
11477 int
11478 main (void)
11479 {
11480
11481   ;
11482   return 0;
11483 }
11484 _ACEOF
11485 rm -f conftest.$ac_objext
11486 if { (eval echo "$as_me:11486: \"$ac_compile\"") >&5
11487   (eval $ac_compile) 2>&5
11488   ac_status=$?
11489   echo "$as_me:11489: \$? = $ac_status" >&5
11490   (exit $ac_status); } &&
11491          { ac_try='test -s conftest.$ac_objext'
11492   { (eval echo "$as_me:11492: \"$ac_try\"") >&5
11493   (eval $ac_try) 2>&5
11494   ac_status=$?
11495   echo "$as_me:11495: \$? = $ac_status" >&5
11496   (exit $ac_status); }; }; then
11497   ac_cv_sys_file_offset_bits=64; break
11498 else
11499   echo "$as_me: failed program was:" >&5
11500 cat conftest.$ac_ext >&5
11501 fi
11502 rm -f conftest.$ac_objext conftest.$ac_ext
11503   break
11504 done
11505 fi
11506 echo "$as_me:11506: result: $ac_cv_sys_file_offset_bits" >&5
11507 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
11508 if test "$ac_cv_sys_file_offset_bits" != no; then
11509
11510 cat >>confdefs.h <<EOF
11511 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
11512 EOF
11513
11514 fi
11515 rm -rf conftest*
11516   echo "$as_me:11516: checking for _LARGE_FILES value needed for large files" >&5
11517 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
11518 if test "${ac_cv_sys_large_files+set}" = set; then
11519   echo $ECHO_N "(cached) $ECHO_C" >&6
11520 else
11521   while :; do
11522   ac_cv_sys_large_files=no
11523   cat >conftest.$ac_ext <<_ACEOF
11524 #line 11524 "configure"
11525 #include "confdefs.h"
11526 #include <sys/types.h>
11527  /* Check that off_t can represent 2**63 - 1 correctly.
11528     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11529     since some C++ compilers masquerading as C compilers
11530     incorrectly reject 9223372036854775807.  */
11531 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11532   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11533                        && LARGE_OFF_T % 2147483647 == 1)
11534                       ? 1 : -1];
11535 int
11536 main (void)
11537 {
11538
11539   ;
11540   return 0;
11541 }
11542 _ACEOF
11543 rm -f conftest.$ac_objext
11544 if { (eval echo "$as_me:11544: \"$ac_compile\"") >&5
11545   (eval $ac_compile) 2>&5
11546   ac_status=$?
11547   echo "$as_me:11547: \$? = $ac_status" >&5
11548   (exit $ac_status); } &&
11549          { ac_try='test -s conftest.$ac_objext'
11550   { (eval echo "$as_me:11550: \"$ac_try\"") >&5
11551   (eval $ac_try) 2>&5
11552   ac_status=$?
11553   echo "$as_me:11553: \$? = $ac_status" >&5
11554   (exit $ac_status); }; }; then
11555   break
11556 else
11557   echo "$as_me: failed program was:" >&5
11558 cat conftest.$ac_ext >&5
11559 fi
11560 rm -f conftest.$ac_objext conftest.$ac_ext
11561   cat >conftest.$ac_ext <<_ACEOF
11562 #line 11562 "configure"
11563 #include "confdefs.h"
11564 #define _LARGE_FILES 1
11565 #include <sys/types.h>
11566  /* Check that off_t can represent 2**63 - 1 correctly.
11567     We can't simply define LARGE_OFF_T to be 9223372036854775807,
11568     since some C++ compilers masquerading as C compilers
11569     incorrectly reject 9223372036854775807.  */
11570 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
11571   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
11572                        && LARGE_OFF_T % 2147483647 == 1)
11573                       ? 1 : -1];
11574 int
11575 main (void)
11576 {
11577
11578   ;
11579   return 0;
11580 }
11581 _ACEOF
11582 rm -f conftest.$ac_objext
11583 if { (eval echo "$as_me:11583: \"$ac_compile\"") >&5
11584   (eval $ac_compile) 2>&5
11585   ac_status=$?
11586   echo "$as_me:11586: \$? = $ac_status" >&5
11587   (exit $ac_status); } &&
11588          { ac_try='test -s conftest.$ac_objext'
11589   { (eval echo "$as_me:11589: \"$ac_try\"") >&5
11590   (eval $ac_try) 2>&5
11591   ac_status=$?
11592   echo "$as_me:11592: \$? = $ac_status" >&5
11593   (exit $ac_status); }; }; then
11594   ac_cv_sys_large_files=1; break
11595 else
11596   echo "$as_me: failed program was:" >&5
11597 cat conftest.$ac_ext >&5
11598 fi
11599 rm -f conftest.$ac_objext conftest.$ac_ext
11600   break
11601 done
11602 fi
11603 echo "$as_me:11603: result: $ac_cv_sys_large_files" >&5
11604 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
11605 if test "$ac_cv_sys_large_files" != no; then
11606
11607 cat >>confdefs.h <<EOF
11608 #define _LARGE_FILES $ac_cv_sys_large_files
11609 EOF
11610
11611 fi
11612 rm -rf conftest*
11613 fi
11614
11615         if test "$enable_largefile" != no ; then
11616         echo "$as_me:11616: checking for _LARGEFILE_SOURCE value needed for large files" >&5
11617 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
11618 if test "${ac_cv_sys_largefile_source+set}" = set; then
11619   echo $ECHO_N "(cached) $ECHO_C" >&6
11620 else
11621   while :; do
11622   ac_cv_sys_largefile_source=no
11623   cat >conftest.$ac_ext <<_ACEOF
11624 #line 11624 "configure"
11625 #include "confdefs.h"
11626 #include <stdio.h>
11627 int
11628 main (void)
11629 {
11630 return !fseeko;
11631   ;
11632   return 0;
11633 }
11634 _ACEOF
11635 rm -f conftest.$ac_objext
11636 if { (eval echo "$as_me:11636: \"$ac_compile\"") >&5
11637   (eval $ac_compile) 2>&5
11638   ac_status=$?
11639   echo "$as_me:11639: \$? = $ac_status" >&5
11640   (exit $ac_status); } &&
11641          { ac_try='test -s conftest.$ac_objext'
11642   { (eval echo "$as_me:11642: \"$ac_try\"") >&5
11643   (eval $ac_try) 2>&5
11644   ac_status=$?
11645   echo "$as_me:11645: \$? = $ac_status" >&5
11646   (exit $ac_status); }; }; then
11647   break
11648 else
11649   echo "$as_me: failed program was:" >&5
11650 cat conftest.$ac_ext >&5
11651 fi
11652 rm -f conftest.$ac_objext conftest.$ac_ext
11653   cat >conftest.$ac_ext <<_ACEOF
11654 #line 11654 "configure"
11655 #include "confdefs.h"
11656 #define _LARGEFILE_SOURCE 1
11657 #include <stdio.h>
11658 int
11659 main (void)
11660 {
11661 return !fseeko;
11662   ;
11663   return 0;
11664 }
11665 _ACEOF
11666 rm -f conftest.$ac_objext
11667 if { (eval echo "$as_me:11667: \"$ac_compile\"") >&5
11668   (eval $ac_compile) 2>&5
11669   ac_status=$?
11670   echo "$as_me:11670: \$? = $ac_status" >&5
11671   (exit $ac_status); } &&
11672          { ac_try='test -s conftest.$ac_objext'
11673   { (eval echo "$as_me:11673: \"$ac_try\"") >&5
11674   (eval $ac_try) 2>&5
11675   ac_status=$?
11676   echo "$as_me:11676: \$? = $ac_status" >&5
11677   (exit $ac_status); }; }; then
11678   ac_cv_sys_largefile_source=1; break
11679 else
11680   echo "$as_me: failed program was:" >&5
11681 cat conftest.$ac_ext >&5
11682 fi
11683 rm -f conftest.$ac_objext conftest.$ac_ext
11684   break
11685 done
11686 fi
11687 echo "$as_me:11687: result: $ac_cv_sys_largefile_source" >&5
11688 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
11689 if test "$ac_cv_sys_largefile_source" != no; then
11690
11691 cat >>confdefs.h <<EOF
11692 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
11693 EOF
11694
11695 fi
11696 rm -rf conftest*
11697
11698 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
11699 # in glibc 2.1.3, but that breaks too many other things.
11700 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
11701 echo "$as_me:11701: checking for fseeko" >&5
11702 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
11703 if test "${ac_cv_func_fseeko+set}" = set; then
11704   echo $ECHO_N "(cached) $ECHO_C" >&6
11705 else
11706   cat >conftest.$ac_ext <<_ACEOF
11707 #line 11707 "configure"
11708 #include "confdefs.h"
11709 #include <stdio.h>
11710 int
11711 main (void)
11712 {
11713 return fseeko && fseeko (stdin, 0, 0);
11714   ;
11715   return 0;
11716 }
11717 _ACEOF
11718 rm -f conftest.$ac_objext conftest$ac_exeext
11719 if { (eval echo "$as_me:11719: \"$ac_link\"") >&5
11720   (eval $ac_link) 2>&5
11721   ac_status=$?
11722   echo "$as_me:11722: \$? = $ac_status" >&5
11723   (exit $ac_status); } &&
11724          { ac_try='test -s conftest$ac_exeext'
11725   { (eval echo "$as_me:11725: \"$ac_try\"") >&5
11726   (eval $ac_try) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit $ac_status); }; }; then
11730   ac_cv_func_fseeko=yes
11731 else
11732   echo "$as_me: failed program was:" >&5
11733 cat conftest.$ac_ext >&5
11734 ac_cv_func_fseeko=no
11735 fi
11736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11737 fi
11738 echo "$as_me:11738: result: $ac_cv_func_fseeko" >&5
11739 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
11740 if test $ac_cv_func_fseeko = yes; then
11741
11742 cat >>confdefs.h <<\EOF
11743 #define HAVE_FSEEKO 1
11744 EOF
11745
11746 fi
11747
11748         # Normally we would collect these definitions in the config.h,
11749         # but (like _XOPEN_SOURCE), some environments rely on having these
11750         # defined before any of the system headers are included.  Another
11751         # case comes up with C++, e.g., on AIX the compiler compiles the
11752         # header files by themselves before looking at the body files it is
11753         # told to compile.  For ncurses, those header files do not include
11754         # the config.h
11755         test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
11756         test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
11757         test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
11758
11759         echo "$as_me:11759: checking whether to use struct dirent64" >&5
11760 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
11761 if test "${cf_cv_struct_dirent64+set}" = set; then
11762   echo $ECHO_N "(cached) $ECHO_C" >&6
11763 else
11764
11765                 cat >conftest.$ac_ext <<_ACEOF
11766 #line 11766 "configure"
11767 #include "confdefs.h"
11768
11769 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
11770 #include <sys/types.h>
11771 #include <dirent.h>
11772
11773 int
11774 main (void)
11775 {
11776
11777                 /* if transitional largefile support is setup, this is true */
11778                 extern struct dirent64 * readdir(DIR *);
11779                 struct dirent64 *x = readdir((DIR *)0);
11780                 struct dirent *y = readdir((DIR *)0);
11781                 int z = x - y;
11782
11783   ;
11784   return 0;
11785 }
11786 _ACEOF
11787 rm -f conftest.$ac_objext
11788 if { (eval echo "$as_me:11788: \"$ac_compile\"") >&5
11789   (eval $ac_compile) 2>&5
11790   ac_status=$?
11791   echo "$as_me:11791: \$? = $ac_status" >&5
11792   (exit $ac_status); } &&
11793          { ac_try='test -s conftest.$ac_objext'
11794   { (eval echo "$as_me:11794: \"$ac_try\"") >&5
11795   (eval $ac_try) 2>&5
11796   ac_status=$?
11797   echo "$as_me:11797: \$? = $ac_status" >&5
11798   (exit $ac_status); }; }; then
11799   cf_cv_struct_dirent64=yes
11800 else
11801   echo "$as_me: failed program was:" >&5
11802 cat conftest.$ac_ext >&5
11803 cf_cv_struct_dirent64=no
11804 fi
11805 rm -f conftest.$ac_objext conftest.$ac_ext
11806
11807 fi
11808 echo "$as_me:11808: result: $cf_cv_struct_dirent64" >&5
11809 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
11810         test "$cf_cv_struct_dirent64" = yes &&
11811 cat >>confdefs.h <<\EOF
11812 #define HAVE_STRUCT_DIRENT64 1
11813 EOF
11814
11815         fi
11816
11817 ### Enable compiling-in rcs id's
11818 echo "$as_me:11818: checking if RCS identifiers should be compiled-in" >&5
11819 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
11820
11821 # Check whether --with-rcs-ids or --without-rcs-ids was given.
11822 if test "${with_rcs_ids+set}" = set; then
11823   withval="$with_rcs_ids"
11824   with_rcs_ids=$withval
11825 else
11826   with_rcs_ids=no
11827 fi;
11828 echo "$as_me:11828: result: $with_rcs_ids" >&5
11829 echo "${ECHO_T}$with_rcs_ids" >&6
11830 test "$with_rcs_ids" = yes &&
11831 cat >>confdefs.h <<\EOF
11832 #define USE_RCS_IDS 1
11833 EOF
11834
11835 ###############################################################################
11836
11837 ### Note that some functions (such as const) are normally disabled anyway.
11838 echo "$as_me:11838: checking if you want to build with function extensions" >&5
11839 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
11840
11841 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
11842 if test "${enable_ext_funcs+set}" = set; then
11843   enableval="$enable_ext_funcs"
11844   with_ext_funcs=$enableval
11845 else
11846   with_ext_funcs=yes
11847 fi;
11848 echo "$as_me:11848: result: $with_ext_funcs" >&5
11849 echo "${ECHO_T}$with_ext_funcs" >&6
11850 if test "$with_ext_funcs" = yes ; then
11851         NCURSES_EXT_FUNCS=1
11852
11853 cat >>confdefs.h <<\EOF
11854 #define HAVE_USE_DEFAULT_COLORS 1
11855 EOF
11856
11857 cat >>confdefs.h <<\EOF
11858 #define NCURSES_EXT_FUNCS 1
11859 EOF
11860
11861 else
11862         NCURSES_EXT_FUNCS=0
11863 fi
11864
11865 ###   use option --enable-const to turn on use of const beyond that in XSI.
11866 echo "$as_me:11866: checking for extended use of const keyword" >&5
11867 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
11868
11869 # Check whether --enable-const or --disable-const was given.
11870 if test "${enable_const+set}" = set; then
11871   enableval="$enable_const"
11872   with_ext_const=$enableval
11873 else
11874   with_ext_const=no
11875 fi;
11876 echo "$as_me:11876: result: $with_ext_const" >&5
11877 echo "${ECHO_T}$with_ext_const" >&6
11878 NCURSES_CONST='/*nothing*/'
11879 if test "$with_ext_const" = yes ; then
11880         NCURSES_CONST=const
11881 fi
11882
11883 ###############################################################################
11884 # These options are relatively safe to experiment with.
11885
11886 echo "$as_me:11886: checking if you want all development code" >&5
11887 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
11888
11889 # Check whether --with-develop or --without-develop was given.
11890 if test "${with_develop+set}" = set; then
11891   withval="$with_develop"
11892   with_develop=$withval
11893 else
11894   with_develop=no
11895 fi;
11896 echo "$as_me:11896: result: $with_develop" >&5
11897 echo "${ECHO_T}$with_develop" >&6
11898
11899 ###############################################################################
11900 # These are just experimental, probably should not be in a package:
11901
11902 # This is still experimental (20080329), but should ultimately be moved to
11903 # the script-block --with-normal, etc.
11904
11905 echo "$as_me:11905: checking if you want to link with the pthread library" >&5
11906 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
11907
11908 # Check whether --with-pthread or --without-pthread was given.
11909 if test "${with_pthread+set}" = set; then
11910   withval="$with_pthread"
11911   with_pthread=$withval
11912 else
11913   with_pthread=no
11914 fi;
11915 echo "$as_me:11915: result: $with_pthread" >&5
11916 echo "${ECHO_T}$with_pthread" >&6
11917
11918 if test "$with_pthread" != no ; then
11919         echo "$as_me:11919: checking for pthread.h" >&5
11920 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
11921 if test "${ac_cv_header_pthread_h+set}" = set; then
11922   echo $ECHO_N "(cached) $ECHO_C" >&6
11923 else
11924   cat >conftest.$ac_ext <<_ACEOF
11925 #line 11925 "configure"
11926 #include "confdefs.h"
11927 #include <pthread.h>
11928 _ACEOF
11929 if { (eval echo "$as_me:11929: \"$ac_cpp conftest.$ac_ext\"") >&5
11930   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11931   ac_status=$?
11932   egrep -v '^ *\+' conftest.er1 >conftest.err
11933   rm -f conftest.er1
11934   cat conftest.err >&5
11935   echo "$as_me:11935: \$? = $ac_status" >&5
11936   (exit $ac_status); } >/dev/null; then
11937   if test -s conftest.err; then
11938     ac_cpp_err=$ac_c_preproc_warn_flag
11939   else
11940     ac_cpp_err=
11941   fi
11942 else
11943   ac_cpp_err=yes
11944 fi
11945 if test -z "$ac_cpp_err"; then
11946   ac_cv_header_pthread_h=yes
11947 else
11948   echo "$as_me: failed program was:" >&5
11949   cat conftest.$ac_ext >&5
11950   ac_cv_header_pthread_h=no
11951 fi
11952 rm -f conftest.err conftest.$ac_ext
11953 fi
11954 echo "$as_me:11954: result: $ac_cv_header_pthread_h" >&5
11955 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
11956 if test $ac_cv_header_pthread_h = yes; then
11957
11958 cat >>confdefs.h <<\EOF
11959 #define HAVE_PTHREADS_H 1
11960 EOF
11961
11962         for cf_lib_pthread in pthread c_r
11963         do
11964             echo "$as_me:11964: checking if we can link with the $cf_lib_pthread library" >&5
11965 echo $ECHO_N "checking if we can link with the $cf_lib_pthread library... $ECHO_C" >&6
11966             cf_save_LIBS="$LIBS"
11967
11968 cf_add_libs="-l$cf_lib_pthread"
11969 # Filter out duplicates - this happens with badly-designed ".pc" files...
11970 for cf_add_1lib in $LIBS
11971 do
11972         for cf_add_2lib in $cf_add_libs
11973         do
11974                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11975                 then
11976                         cf_add_1lib=
11977                         break
11978                 fi
11979         done
11980         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11981 done
11982 LIBS="$cf_add_libs"
11983
11984             cat >conftest.$ac_ext <<_ACEOF
11985 #line 11985 "configure"
11986 #include "confdefs.h"
11987
11988 #include <pthread.h>
11989
11990 int
11991 main (void)
11992 {
11993
11994                 int rc = pthread_create(0,0,0,0);
11995                 int r2 = pthread_mutexattr_settype(0, 0);
11996
11997   ;
11998   return 0;
11999 }
12000 _ACEOF
12001 rm -f conftest.$ac_objext conftest$ac_exeext
12002 if { (eval echo "$as_me:12002: \"$ac_link\"") >&5
12003   (eval $ac_link) 2>&5
12004   ac_status=$?
12005   echo "$as_me:12005: \$? = $ac_status" >&5
12006   (exit $ac_status); } &&
12007          { ac_try='test -s conftest$ac_exeext'
12008   { (eval echo "$as_me:12008: \"$ac_try\"") >&5
12009   (eval $ac_try) 2>&5
12010   ac_status=$?
12011   echo "$as_me:12011: \$? = $ac_status" >&5
12012   (exit $ac_status); }; }; then
12013   with_pthread=yes
12014 else
12015   echo "$as_me: failed program was:" >&5
12016 cat conftest.$ac_ext >&5
12017 with_pthread=no
12018 fi
12019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12020             LIBS="$cf_save_LIBS"
12021             echo "$as_me:12021: result: $with_pthread" >&5
12022 echo "${ECHO_T}$with_pthread" >&6
12023             test "$with_pthread" = yes && break
12024         done
12025
12026         if test "$with_pthread" = yes ; then
12027
12028 cf_add_libs="-l$cf_lib_pthread"
12029 # Filter out duplicates - this happens with badly-designed ".pc" files...
12030 for cf_add_1lib in $LIBS
12031 do
12032         for cf_add_2lib in $cf_add_libs
12033         do
12034                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12035                 then
12036                         cf_add_1lib=
12037                         break
12038                 fi
12039         done
12040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12041 done
12042 LIBS="$cf_add_libs"
12043
12044 cat >>confdefs.h <<\EOF
12045 #define HAVE_LIBPTHREADS 1
12046 EOF
12047
12048         else
12049             { { echo "$as_me:12049: error: Cannot link with pthread library" >&5
12050 echo "$as_me: error: Cannot link with pthread library" >&2;}
12051    { (exit 1); exit 1; }; }
12052         fi
12053
12054 fi
12055
12056 fi
12057
12058 echo "$as_me:12058: checking if you want to use weak-symbols for pthreads" >&5
12059 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
12060
12061 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
12062 if test "${enable_weak_symbols+set}" = set; then
12063   enableval="$enable_weak_symbols"
12064   use_weak_symbols=$withval
12065 else
12066   use_weak_symbols=no
12067 fi;
12068 echo "$as_me:12068: result: $use_weak_symbols" >&5
12069 echo "${ECHO_T}$use_weak_symbols" >&6
12070 if test "$use_weak_symbols" = yes ; then
12071
12072 echo "$as_me:12072: checking if $CC supports weak symbols" >&5
12073 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
12074 if test "${cf_cv_weak_symbols+set}" = set; then
12075   echo $ECHO_N "(cached) $ECHO_C" >&6
12076 else
12077
12078 cat >conftest.$ac_ext <<_ACEOF
12079 #line 12079 "configure"
12080 #include "confdefs.h"
12081
12082 #include <stdio.h>
12083 int
12084 main (void)
12085 {
12086
12087 #if defined(__GNUC__)
12088 #  if defined __USE_ISOC99
12089 #    define _cat_pragma(exp)    _Pragma(#exp)
12090 #    define _weak_pragma(exp)   _cat_pragma(weak name)
12091 #  else
12092 #    define _weak_pragma(exp)
12093 #  endif
12094 #  define _declare(name)        __extension__ extern __typeof__(name) name
12095 #  define weak_symbol(name)     _weak_pragma(name) _declare(name) __attribute__((weak))
12096 #endif
12097
12098 weak_symbol(fopen);
12099
12100   ;
12101   return 0;
12102 }
12103 _ACEOF
12104 rm -f conftest.$ac_objext
12105 if { (eval echo "$as_me:12105: \"$ac_compile\"") >&5
12106   (eval $ac_compile) 2>&5
12107   ac_status=$?
12108   echo "$as_me:12108: \$? = $ac_status" >&5
12109   (exit $ac_status); } &&
12110          { ac_try='test -s conftest.$ac_objext'
12111   { (eval echo "$as_me:12111: \"$ac_try\"") >&5
12112   (eval $ac_try) 2>&5
12113   ac_status=$?
12114   echo "$as_me:12114: \$? = $ac_status" >&5
12115   (exit $ac_status); }; }; then
12116   cf_cv_weak_symbols=yes
12117 else
12118   echo "$as_me: failed program was:" >&5
12119 cat conftest.$ac_ext >&5
12120 cf_cv_weak_symbols=no
12121 fi
12122 rm -f conftest.$ac_objext conftest.$ac_ext
12123
12124 fi
12125 echo "$as_me:12125: result: $cf_cv_weak_symbols" >&5
12126 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
12127
12128 else
12129         cf_cv_weak_symbols=no
12130 fi
12131
12132 if test $cf_cv_weak_symbols = yes ; then
12133
12134 cat >>confdefs.h <<\EOF
12135 #define USE_WEAK_SYMBOLS 1
12136 EOF
12137
12138 fi
12139
12140 PTHREAD=
12141 if test "$with_pthread" = "yes" ; then
12142
12143 cat >>confdefs.h <<\EOF
12144 #define USE_PTHREADS 1
12145 EOF
12146
12147         enable_reentrant=yes
12148         if test $cf_cv_weak_symbols = yes ; then
12149                 PTHREAD=-lpthread
12150         fi
12151 fi
12152
12153 # OpenSUSE is installing ncurses6, using reentrant option.
12154 echo "$as_me:12154: checking for _nc_TABSIZE" >&5
12155 echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
12156 if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
12157   echo $ECHO_N "(cached) $ECHO_C" >&6
12158 else
12159   cat >conftest.$ac_ext <<_ACEOF
12160 #line 12160 "configure"
12161 #include "confdefs.h"
12162 /* System header to define __stub macros and hopefully few prototypes,
12163     which can conflict with char _nc_TABSIZE (); below.  */
12164 #include <assert.h>
12165 /* Override any gcc2 internal prototype to avoid an error.  */
12166 #ifdef __cplusplus
12167 extern "C"
12168 #endif
12169 /* We use char because int might match the return type of a gcc2
12170    builtin and then its argument prototype would still apply.  */
12171 char _nc_TABSIZE ();
12172 char (*f) ();
12173
12174 int
12175 main (void)
12176 {
12177 /* The GNU C library defines this for functions which it implements
12178     to always fail with ENOSYS.  Some functions are actually named
12179     something starting with __ and the normal name is an alias.  */
12180 #if defined (__stub__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
12181 choke me
12182 #else
12183 f = _nc_TABSIZE; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12184 #endif
12185
12186   ;
12187   return 0;
12188 }
12189 _ACEOF
12190 rm -f conftest.$ac_objext conftest$ac_exeext
12191 if { (eval echo "$as_me:12191: \"$ac_link\"") >&5
12192   (eval $ac_link) 2>&5
12193   ac_status=$?
12194   echo "$as_me:12194: \$? = $ac_status" >&5
12195   (exit $ac_status); } &&
12196          { ac_try='test -s conftest$ac_exeext'
12197   { (eval echo "$as_me:12197: \"$ac_try\"") >&5
12198   (eval $ac_try) 2>&5
12199   ac_status=$?
12200   echo "$as_me:12200: \$? = $ac_status" >&5
12201   (exit $ac_status); }; }; then
12202   ac_cv_func__nc_TABSIZE=yes
12203 else
12204   echo "$as_me: failed program was:" >&5
12205 cat conftest.$ac_ext >&5
12206 ac_cv_func__nc_TABSIZE=no
12207 fi
12208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12209 fi
12210 echo "$as_me:12210: result: $ac_cv_func__nc_TABSIZE" >&5
12211 echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
12212 if test $ac_cv_func__nc_TABSIZE = yes; then
12213   assume_reentrant=yes
12214 else
12215   assume_reentrant=no
12216 fi
12217
12218 # Reentrant code has to be opaque; there's little advantage to making ncurses
12219 # opaque outside of that, so there is no --enable-opaque option.  We can use
12220 # this option without --with-pthreads, but this will be always set for
12221 # pthreads.
12222 echo "$as_me:12222: checking if you want experimental reentrant code" >&5
12223 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
12224
12225 # Check whether --enable-reentrant or --disable-reentrant was given.
12226 if test "${enable_reentrant+set}" = set; then
12227   enableval="$enable_reentrant"
12228   with_reentrant=$enableval
12229 else
12230   with_reentrant=$assume_reentrant
12231 fi;
12232 echo "$as_me:12232: result: $with_reentrant" >&5
12233 echo "${ECHO_T}$with_reentrant" >&6
12234 if test "$with_reentrant" = yes ; then
12235         cf_cv_enable_reentrant=1
12236         if test $cf_cv_weak_symbols = yes ; then
12237
12238 # remove pthread library from $LIBS
12239 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[       ]//g' -e 's/-lpthread$//'`
12240
12241         elif test "$assume_reentrant" = no ; then
12242                 LIB_SUFFIX="t${LIB_SUFFIX}"
12243         fi
12244
12245 cat >>confdefs.h <<\EOF
12246 #define USE_REENTRANT 1
12247 EOF
12248
12249 else
12250         cf_cv_enable_reentrant=0
12251 fi
12252
12253 ### Allow using a different wrap-prefix
12254 if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
12255         echo "$as_me:12255: checking for prefix used to wrap public variables" >&5
12256 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
12257
12258 # Check whether --with-wrap-prefix or --without-wrap-prefix was given.
12259 if test "${with_wrap_prefix+set}" = set; then
12260   withval="$with_wrap_prefix"
12261   NCURSES_WRAP_PREFIX=$withval
12262 else
12263   NCURSES_WRAP_PREFIX=_nc_
12264 fi;
12265         echo "$as_me:12265: result: $NCURSES_WRAP_PREFIX" >&5
12266 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
12267 else
12268         NCURSES_WRAP_PREFIX=_nc_
12269 fi
12270
12271 cat >>confdefs.h <<EOF
12272 #define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
12273 EOF
12274
12275 ###############################################################################
12276
12277 ###     use option --disable-echo to suppress full display compiling commands
12278
12279 echo "$as_me:12279: checking if you want to see long compiling messages" >&5
12280 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
12281
12282 # Check whether --enable-echo or --disable-echo was given.
12283 if test "${enable_echo+set}" = set; then
12284   enableval="$enable_echo"
12285   test "$enableval" != no && enableval=yes
12286         if test "$enableval" != "yes" ; then
12287
12288         ECHO_LT='--silent'
12289         ECHO_LD='@echo linking $@;'
12290         RULE_CC='@echo compiling $<'
12291         SHOW_CC='@echo compiling $@'
12292         ECHO_CC='@'
12293
12294         else
12295
12296         ECHO_LT=''
12297         ECHO_LD=''
12298         RULE_CC=''
12299         SHOW_CC=''
12300         ECHO_CC=''
12301
12302         fi
12303 else
12304   enableval=yes
12305
12306         ECHO_LT=''
12307         ECHO_LD=''
12308         RULE_CC=''
12309         SHOW_CC=''
12310         ECHO_CC=''
12311
12312 fi;
12313 echo "$as_me:12313: result: $enableval" >&5
12314 echo "${ECHO_T}$enableval" >&6
12315
12316 ###     use option --enable-warnings to turn on all gcc warnings
12317 echo "$as_me:12317: checking if you want to see compiler warnings" >&5
12318 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
12319
12320 # Check whether --enable-warnings or --disable-warnings was given.
12321 if test "${enable_warnings+set}" = set; then
12322   enableval="$enable_warnings"
12323   with_warnings=$enableval
12324 fi;
12325 echo "$as_me:12325: result: $with_warnings" >&5
12326 echo "${ECHO_T}$with_warnings" >&6
12327
12328 if test "x$with_warnings" = "xyes"; then
12329
12330         ADAFLAGS="$ADAFLAGS -gnatg"
12331
12332 INTEL_COMPILER=no
12333
12334 if test "$GCC" = yes ; then
12335         case $host_os in
12336         (linux*|gnu*)
12337                 echo "$as_me:12337: checking if this is really Intel C compiler" >&5
12338 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
12339                 cf_save_CFLAGS="$CFLAGS"
12340                 CFLAGS="$CFLAGS -no-gcc"
12341                 cat >conftest.$ac_ext <<_ACEOF
12342 #line 12342 "configure"
12343 #include "confdefs.h"
12344
12345 int
12346 main (void)
12347 {
12348
12349 #ifdef __INTEL_COMPILER
12350 #else
12351 make an error
12352 #endif
12353
12354   ;
12355   return 0;
12356 }
12357 _ACEOF
12358 rm -f conftest.$ac_objext
12359 if { (eval echo "$as_me:12359: \"$ac_compile\"") >&5
12360   (eval $ac_compile) 2>&5
12361   ac_status=$?
12362   echo "$as_me:12362: \$? = $ac_status" >&5
12363   (exit $ac_status); } &&
12364          { ac_try='test -s conftest.$ac_objext'
12365   { (eval echo "$as_me:12365: \"$ac_try\"") >&5
12366   (eval $ac_try) 2>&5
12367   ac_status=$?
12368   echo "$as_me:12368: \$? = $ac_status" >&5
12369   (exit $ac_status); }; }; then
12370   INTEL_COMPILER=yes
12371 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
12372
12373 else
12374   echo "$as_me: failed program was:" >&5
12375 cat conftest.$ac_ext >&5
12376 fi
12377 rm -f conftest.$ac_objext conftest.$ac_ext
12378                 CFLAGS="$cf_save_CFLAGS"
12379                 echo "$as_me:12379: result: $INTEL_COMPILER" >&5
12380 echo "${ECHO_T}$INTEL_COMPILER" >&6
12381                 ;;
12382         esac
12383 fi
12384
12385 CLANG_COMPILER=no
12386
12387 if test "$GCC" = yes ; then
12388         echo "$as_me:12388: checking if this is really Clang C compiler" >&5
12389 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
12390         cf_save_CFLAGS="$CFLAGS"
12391         CFLAGS="$CFLAGS -Qunused-arguments"
12392         cat >conftest.$ac_ext <<_ACEOF
12393 #line 12393 "configure"
12394 #include "confdefs.h"
12395
12396 int
12397 main (void)
12398 {
12399
12400 #ifdef __clang__
12401 #else
12402 make an error
12403 #endif
12404
12405   ;
12406   return 0;
12407 }
12408 _ACEOF
12409 rm -f conftest.$ac_objext
12410 if { (eval echo "$as_me:12410: \"$ac_compile\"") >&5
12411   (eval $ac_compile) 2>&5
12412   ac_status=$?
12413   echo "$as_me:12413: \$? = $ac_status" >&5
12414   (exit $ac_status); } &&
12415          { ac_try='test -s conftest.$ac_objext'
12416   { (eval echo "$as_me:12416: \"$ac_try\"") >&5
12417   (eval $ac_try) 2>&5
12418   ac_status=$?
12419   echo "$as_me:12419: \$? = $ac_status" >&5
12420   (exit $ac_status); }; }; then
12421   CLANG_COMPILER=yes
12422 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
12423
12424 else
12425   echo "$as_me: failed program was:" >&5
12426 cat conftest.$ac_ext >&5
12427 fi
12428 rm -f conftest.$ac_objext conftest.$ac_ext
12429         CFLAGS="$cf_save_CFLAGS"
12430         echo "$as_me:12430: result: $CLANG_COMPILER" >&5
12431 echo "${ECHO_T}$CLANG_COMPILER" >&6
12432 fi
12433
12434 cat > conftest.$ac_ext <<EOF
12435 #line 12435 "${as_me:-configure}"
12436 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
12437 EOF
12438
12439 if test "$INTEL_COMPILER" = yes
12440 then
12441 # The "-wdXXX" options suppress warnings:
12442 # remark #1419: external declaration in primary source file
12443 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
12444 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
12445 # remark #193: zero used for undefined preprocessing identifier
12446 # remark #593: variable "curs_sb_left_arrow" was set but never used
12447 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
12448 # remark #869: parameter "tw" was never referenced
12449 # remark #981: operands are evaluated in unspecified order
12450 # warning #279: controlling expression is constant
12451
12452         { echo "$as_me:12452: checking for $CC warning options..." >&5
12453 echo "$as_me: checking for $CC warning options..." >&6;}
12454         cf_save_CFLAGS="$CFLAGS"
12455         EXTRA_CFLAGS="-Wall"
12456         for cf_opt in \
12457                 wd1419 \
12458                 wd1683 \
12459                 wd1684 \
12460                 wd193 \
12461                 wd593 \
12462                 wd279 \
12463                 wd810 \
12464                 wd869 \
12465                 wd981
12466         do
12467                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12468                 if { (eval echo "$as_me:12468: \"$ac_compile\"") >&5
12469   (eval $ac_compile) 2>&5
12470   ac_status=$?
12471   echo "$as_me:12471: \$? = $ac_status" >&5
12472   (exit $ac_status); }; then
12473                         test -n "$verbose" && echo "$as_me:12473: result: ... -$cf_opt" >&5
12474 echo "${ECHO_T}... -$cf_opt" >&6
12475                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12476                 fi
12477         done
12478         CFLAGS="$cf_save_CFLAGS"
12479
12480 elif test "$GCC" = yes
12481 then
12482         { echo "$as_me:12482: checking for $CC warning options..." >&5
12483 echo "$as_me: checking for $CC warning options..." >&6;}
12484         cf_save_CFLAGS="$CFLAGS"
12485         EXTRA_CFLAGS=
12486         cf_warn_CONST=""
12487         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
12488         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
12489         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
12490         for cf_opt in W Wall \
12491                 Wbad-function-cast \
12492                 Wcast-align \
12493                 Wcast-qual \
12494                 Wdeclaration-after-statement \
12495                 Wextra \
12496                 Winline \
12497                 Wmissing-declarations \
12498                 Wmissing-prototypes \
12499                 Wnested-externs \
12500                 Wpointer-arith \
12501                 Wshadow \
12502                 Wstrict-prototypes \
12503                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas Wswitch-enum
12504         do
12505                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
12506                 if { (eval echo "$as_me:12506: \"$ac_compile\"") >&5
12507   (eval $ac_compile) 2>&5
12508   ac_status=$?
12509   echo "$as_me:12509: \$? = $ac_status" >&5
12510   (exit $ac_status); }; then
12511                         test -n "$verbose" && echo "$as_me:12511: result: ... -$cf_opt" >&5
12512 echo "${ECHO_T}... -$cf_opt" >&6
12513                         case $cf_opt in
12514                         (Wcast-qual)
12515                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
12516                                 ;;
12517                         (Winline)
12518                                 case $GCC_VERSION in
12519                                 ([34].*)
12520                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12521
12522 echo "${as_me:-configure}:12522: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12523
12524                                         continue;;
12525                                 esac
12526                                 ;;
12527                         (Wpointer-arith)
12528                                 case $GCC_VERSION in
12529                                 ([12].*)
12530                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
12531
12532 echo "${as_me:-configure}:12532: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
12533
12534                                         continue;;
12535                                 esac
12536                                 ;;
12537                         esac
12538                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
12539                 fi
12540         done
12541         CFLAGS="$cf_save_CFLAGS"
12542 fi
12543 rm -rf conftest*
12544
12545 fi
12546
12547 if test "$GCC" = yes
12548 then
12549 cat > conftest.i <<EOF
12550 #ifndef GCC_PRINTF
12551 #define GCC_PRINTF 0
12552 #endif
12553 #ifndef GCC_SCANF
12554 #define GCC_SCANF 0
12555 #endif
12556 #ifndef GCC_NORETURN
12557 #define GCC_NORETURN /* nothing */
12558 #endif
12559 #ifndef GCC_UNUSED
12560 #define GCC_UNUSED /* nothing */
12561 #endif
12562 EOF
12563 if test "$GCC" = yes
12564 then
12565         { echo "$as_me:12565: checking for $CC __attribute__ directives..." >&5
12566 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
12567 cat > conftest.$ac_ext <<EOF
12568 #line 12568 "${as_me:-configure}"
12569 #include "confdefs.h"
12570 #include "conftest.h"
12571 #include "conftest.i"
12572 #if     GCC_PRINTF
12573 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
12574 #else
12575 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
12576 #endif
12577 #if     GCC_SCANF
12578 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
12579 #else
12580 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
12581 #endif
12582 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
12583 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
12584 extern void foo(void) GCC_NORETURN;
12585 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
12586 EOF
12587         cf_printf_attribute=no
12588         cf_scanf_attribute=no
12589         for cf_attribute in scanf printf unused noreturn
12590         do
12591
12592 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12593
12594                 cf_directive="__attribute__(($cf_attribute))"
12595                 echo "checking for $CC $cf_directive" 1>&5
12596
12597                 case $cf_attribute in
12598                 (printf)
12599                         cf_printf_attribute=yes
12600                         cat >conftest.h <<EOF
12601 #define GCC_$cf_ATTRIBUTE 1
12602 EOF
12603                         ;;
12604                 (scanf)
12605                         cf_scanf_attribute=yes
12606                         cat >conftest.h <<EOF
12607 #define GCC_$cf_ATTRIBUTE 1
12608 EOF
12609                         ;;
12610                 (*)
12611                         cat >conftest.h <<EOF
12612 #define GCC_$cf_ATTRIBUTE $cf_directive
12613 EOF
12614                         ;;
12615                 esac
12616
12617                 if { (eval echo "$as_me:12617: \"$ac_compile\"") >&5
12618   (eval $ac_compile) 2>&5
12619   ac_status=$?
12620   echo "$as_me:12620: \$? = $ac_status" >&5
12621   (exit $ac_status); }; then
12622                         test -n "$verbose" && echo "$as_me:12622: result: ... $cf_attribute" >&5
12623 echo "${ECHO_T}... $cf_attribute" >&6
12624                         cat conftest.h >>confdefs.h
12625                         case $cf_attribute in
12626                         (noreturn)
12627
12628 cat >>confdefs.h <<EOF
12629 #define GCC_NORETURN $cf_directive
12630 EOF
12631
12632                                 ;;
12633                         (printf)
12634                                 cf_value='/* nothing */'
12635                                 if test "$cf_printf_attribute" != no ; then
12636                                         cf_value='__attribute__((format(printf,fmt,var)))'
12637
12638 cat >>confdefs.h <<\EOF
12639 #define GCC_PRINTF 1
12640 EOF
12641
12642                                 fi
12643
12644 cat >>confdefs.h <<EOF
12645 #define GCC_PRINTFLIKE(fmt,var) $cf_value
12646 EOF
12647
12648                                 ;;
12649                         (scanf)
12650                                 cf_value='/* nothing */'
12651                                 if test "$cf_scanf_attribute" != no ; then
12652                                         cf_value='__attribute__((format(scanf,fmt,var)))'
12653
12654 cat >>confdefs.h <<\EOF
12655 #define GCC_SCANF 1
12656 EOF
12657
12658                                 fi
12659
12660 cat >>confdefs.h <<EOF
12661 #define GCC_SCANFLIKE(fmt,var) $cf_value
12662 EOF
12663
12664                                 ;;
12665                         (unused)
12666
12667 cat >>confdefs.h <<EOF
12668 #define GCC_UNUSED $cf_directive
12669 EOF
12670
12671                                 ;;
12672                         esac
12673                 fi
12674         done
12675 else
12676         fgrep define conftest.i >>confdefs.h
12677 fi
12678 rm -rf conftest*
12679 fi
12680
12681 ###     use option --enable-assertions to turn on generation of assertion code
12682 echo "$as_me:12682: checking if you want to enable runtime assertions" >&5
12683 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
12684
12685 # Check whether --enable-assertions or --disable-assertions was given.
12686 if test "${enable_assertions+set}" = set; then
12687   enableval="$enable_assertions"
12688   with_assertions=$enableval
12689 else
12690   with_assertions=no
12691 fi;
12692 echo "$as_me:12692: result: $with_assertions" >&5
12693 echo "${ECHO_T}$with_assertions" >&6
12694 if test -n "$GCC"
12695 then
12696         if test "$with_assertions" = no
12697         then
12698                 CPPFLAGS="$CPPFLAGS -DNDEBUG"
12699         else
12700
12701         ADAFLAGS="$ADAFLAGS -gnata"
12702
12703         fi
12704 fi
12705
12706 ###     use option --disable-leaks to suppress "permanent" leaks, for testing
12707
12708 cat >>confdefs.h <<\EOF
12709 #define HAVE_NC_ALLOC_H 1
12710 EOF
12711
12712 ###     use option --enable-expanded to generate certain macros as functions
12713
12714 # Check whether --enable-expanded or --disable-expanded was given.
12715 if test "${enable_expanded+set}" = set; then
12716   enableval="$enable_expanded"
12717   test "$enableval" = yes &&
12718 cat >>confdefs.h <<\EOF
12719 #define NCURSES_EXPANDED 1
12720 EOF
12721
12722 fi;
12723
12724 ###     use option --disable-macros to suppress macros in favor of functions
12725
12726 # Check whether --enable-macros or --disable-macros was given.
12727 if test "${enable_macros+set}" = set; then
12728   enableval="$enable_macros"
12729   test "$enableval" = no &&
12730 cat >>confdefs.h <<\EOF
12731 #define NCURSES_NOMACROS 1
12732 EOF
12733
12734 fi;
12735
12736 # Normally we only add trace() to the debug-library.  Allow this to be
12737 # extended to all models of the ncurses library:
12738 cf_all_traces=no
12739 case "$CFLAGS $CPPFLAGS" in
12740 (*-DTRACE*)
12741         cf_all_traces=yes
12742         ;;
12743 esac
12744
12745 echo "$as_me:12745: checking whether to add trace feature to all models" >&5
12746 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
12747
12748 # Check whether --with-trace or --without-trace was given.
12749 if test "${with_trace+set}" = set; then
12750   withval="$with_trace"
12751   cf_with_trace=$withval
12752 else
12753   cf_with_trace=$cf_all_traces
12754 fi;
12755 echo "$as_me:12755: result: $cf_with_trace" >&5
12756 echo "${ECHO_T}$cf_with_trace" >&6
12757
12758 if test "$cf_with_trace" = yes ; then
12759         ADA_TRACE=TRUE
12760
12761 cf_fix_cppflags=no
12762 cf_new_cflags=
12763 cf_new_cppflags=
12764 cf_new_extra_cppflags=
12765
12766 for cf_add_cflags in -DTRACE
12767 do
12768 case $cf_fix_cppflags in
12769 (no)
12770         case $cf_add_cflags in
12771         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12772                 case $cf_add_cflags in
12773                 (-D*)
12774                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12775
12776                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12777                                 && test -z "${cf_tst_cflags}" \
12778                                 && cf_fix_cppflags=yes
12779
12780                         if test $cf_fix_cppflags = yes ; then
12781
12782         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12783         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12784
12785                                 continue
12786                         elif test "${cf_tst_cflags}" = "\"'" ; then
12787
12788         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12789         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12790
12791                                 continue
12792                         fi
12793                         ;;
12794                 esac
12795                 case "$CPPFLAGS" in
12796                 (*$cf_add_cflags)
12797                         ;;
12798                 (*)
12799                         case $cf_add_cflags in
12800                         (-D*)
12801                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12802
12803 CPPFLAGS=`echo "$CPPFLAGS" | \
12804         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12805                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12806
12807                                 ;;
12808                         esac
12809
12810         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12811         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12812
12813                         ;;
12814                 esac
12815                 ;;
12816         (*)
12817
12818         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12819         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12820
12821                 ;;
12822         esac
12823         ;;
12824 (yes)
12825
12826         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12827         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12828
12829         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12830
12831         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12832                 && test -z "${cf_tst_cflags}" \
12833                 && cf_fix_cppflags=no
12834         ;;
12835 esac
12836 done
12837
12838 if test -n "$cf_new_cflags" ; then
12839
12840         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12841         CFLAGS="${CFLAGS}$cf_new_cflags"
12842
12843 fi
12844
12845 if test -n "$cf_new_cppflags" ; then
12846
12847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12848         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12849
12850 fi
12851
12852 if test -n "$cf_new_extra_cppflags" ; then
12853
12854         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12855         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12856
12857 fi
12858
12859 else
12860         ADA_TRACE=FALSE
12861 fi
12862
12863 echo "$as_me:12863: checking if we want to use GNAT projects" >&5
12864 echo $ECHO_N "checking if we want to use GNAT projects... $ECHO_C" >&6
12865
12866 # Check whether --enable-gnat-projects or --disable-gnat-projects was given.
12867 if test "${enable_gnat_projects+set}" = set; then
12868   enableval="$enable_gnat_projects"
12869   test "$enableval" != no && enableval=yes
12870         if test "$enableval" != "yes" ; then
12871     enable_gnat_projects=no
12872         else
12873                 enable_gnat_projects=yes
12874         fi
12875 else
12876   enableval=yes
12877         enable_gnat_projects=yes
12878
12879 fi;
12880 echo "$as_me:12880: result: $enable_gnat_projects" >&5
12881 echo "${ECHO_T}$enable_gnat_projects" >&6
12882
12883 ###     Checks for libraries.
12884 case $cf_cv_system_name in
12885 (*mingw32*)
12886         ;;
12887 (*)
12888 echo "$as_me:12888: checking for gettimeofday" >&5
12889 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
12890 if test "${ac_cv_func_gettimeofday+set}" = set; then
12891   echo $ECHO_N "(cached) $ECHO_C" >&6
12892 else
12893   cat >conftest.$ac_ext <<_ACEOF
12894 #line 12894 "configure"
12895 #include "confdefs.h"
12896 /* System header to define __stub macros and hopefully few prototypes,
12897     which can conflict with char gettimeofday (); below.  */
12898 #include <assert.h>
12899 /* Override any gcc2 internal prototype to avoid an error.  */
12900 #ifdef __cplusplus
12901 extern "C"
12902 #endif
12903 /* We use char because int might match the return type of a gcc2
12904    builtin and then its argument prototype would still apply.  */
12905 char gettimeofday ();
12906 char (*f) ();
12907
12908 int
12909 main (void)
12910 {
12911 /* The GNU C library defines this for functions which it implements
12912     to always fail with ENOSYS.  Some functions are actually named
12913     something starting with __ and the normal name is an alias.  */
12914 #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
12915 choke me
12916 #else
12917 f = gettimeofday; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12918 #endif
12919
12920   ;
12921   return 0;
12922 }
12923 _ACEOF
12924 rm -f conftest.$ac_objext conftest$ac_exeext
12925 if { (eval echo "$as_me:12925: \"$ac_link\"") >&5
12926   (eval $ac_link) 2>&5
12927   ac_status=$?
12928   echo "$as_me:12928: \$? = $ac_status" >&5
12929   (exit $ac_status); } &&
12930          { ac_try='test -s conftest$ac_exeext'
12931   { (eval echo "$as_me:12931: \"$ac_try\"") >&5
12932   (eval $ac_try) 2>&5
12933   ac_status=$?
12934   echo "$as_me:12934: \$? = $ac_status" >&5
12935   (exit $ac_status); }; }; then
12936   ac_cv_func_gettimeofday=yes
12937 else
12938   echo "$as_me: failed program was:" >&5
12939 cat conftest.$ac_ext >&5
12940 ac_cv_func_gettimeofday=no
12941 fi
12942 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12943 fi
12944 echo "$as_me:12944: result: $ac_cv_func_gettimeofday" >&5
12945 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
12946 if test $ac_cv_func_gettimeofday = yes; then
12947   cat >>confdefs.h <<\EOF
12948 #define HAVE_GETTIMEOFDAY 1
12949 EOF
12950
12951 else
12952
12953 echo "$as_me:12953: checking for gettimeofday in -lbsd" >&5
12954 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
12955 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
12956   echo $ECHO_N "(cached) $ECHO_C" >&6
12957 else
12958   ac_check_lib_save_LIBS=$LIBS
12959 LIBS="-lbsd  $LIBS"
12960 cat >conftest.$ac_ext <<_ACEOF
12961 #line 12961 "configure"
12962 #include "confdefs.h"
12963
12964 /* Override any gcc2 internal prototype to avoid an error.  */
12965 #ifdef __cplusplus
12966 extern "C"
12967 #endif
12968 /* We use char because int might match the return type of a gcc2
12969    builtin and then its argument prototype would still apply.  */
12970 char gettimeofday ();
12971 int
12972 main (void)
12973 {
12974 gettimeofday ();
12975   ;
12976   return 0;
12977 }
12978 _ACEOF
12979 rm -f conftest.$ac_objext conftest$ac_exeext
12980 if { (eval echo "$as_me:12980: \"$ac_link\"") >&5
12981   (eval $ac_link) 2>&5
12982   ac_status=$?
12983   echo "$as_me:12983: \$? = $ac_status" >&5
12984   (exit $ac_status); } &&
12985          { ac_try='test -s conftest$ac_exeext'
12986   { (eval echo "$as_me:12986: \"$ac_try\"") >&5
12987   (eval $ac_try) 2>&5
12988   ac_status=$?
12989   echo "$as_me:12989: \$? = $ac_status" >&5
12990   (exit $ac_status); }; }; then
12991   ac_cv_lib_bsd_gettimeofday=yes
12992 else
12993   echo "$as_me: failed program was:" >&5
12994 cat conftest.$ac_ext >&5
12995 ac_cv_lib_bsd_gettimeofday=no
12996 fi
12997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12998 LIBS=$ac_check_lib_save_LIBS
12999 fi
13000 echo "$as_me:13000: result: $ac_cv_lib_bsd_gettimeofday" >&5
13001 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
13002 if test $ac_cv_lib_bsd_gettimeofday = yes; then
13003
13004 cat >>confdefs.h <<\EOF
13005 #define HAVE_GETTIMEOFDAY 1
13006 EOF
13007
13008         LIBS="$LIBS -lbsd"
13009 fi
13010
13011 fi
13012         ;;
13013 esac
13014
13015 ###     Checks for header files.
13016 echo "$as_me:13016: checking for ANSI C header files" >&5
13017 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13018 if test "${ac_cv_header_stdc+set}" = set; then
13019   echo $ECHO_N "(cached) $ECHO_C" >&6
13020 else
13021   cat >conftest.$ac_ext <<_ACEOF
13022 #line 13022 "configure"
13023 #include "confdefs.h"
13024 #include <stdlib.h>
13025 #include <stdarg.h>
13026 #include <string.h>
13027 #include <float.h>
13028
13029 _ACEOF
13030 if { (eval echo "$as_me:13030: \"$ac_cpp conftest.$ac_ext\"") >&5
13031   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13032   ac_status=$?
13033   egrep -v '^ *\+' conftest.er1 >conftest.err
13034   rm -f conftest.er1
13035   cat conftest.err >&5
13036   echo "$as_me:13036: \$? = $ac_status" >&5
13037   (exit $ac_status); } >/dev/null; then
13038   if test -s conftest.err; then
13039     ac_cpp_err=$ac_c_preproc_warn_flag
13040   else
13041     ac_cpp_err=
13042   fi
13043 else
13044   ac_cpp_err=yes
13045 fi
13046 if test -z "$ac_cpp_err"; then
13047   ac_cv_header_stdc=yes
13048 else
13049   echo "$as_me: failed program was:" >&5
13050   cat conftest.$ac_ext >&5
13051   ac_cv_header_stdc=no
13052 fi
13053 rm -f conftest.err conftest.$ac_ext
13054
13055 if test $ac_cv_header_stdc = yes; then
13056   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13057   cat >conftest.$ac_ext <<_ACEOF
13058 #line 13058 "configure"
13059 #include "confdefs.h"
13060 #include <string.h>
13061
13062 _ACEOF
13063 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13064   egrep "memchr" >/dev/null 2>&1; then
13065   :
13066 else
13067   ac_cv_header_stdc=no
13068 fi
13069 rm -rf conftest*
13070
13071 fi
13072
13073 if test $ac_cv_header_stdc = yes; then
13074   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13075   cat >conftest.$ac_ext <<_ACEOF
13076 #line 13076 "configure"
13077 #include "confdefs.h"
13078 #include <stdlib.h>
13079
13080 _ACEOF
13081 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13082   egrep "free" >/dev/null 2>&1; then
13083   :
13084 else
13085   ac_cv_header_stdc=no
13086 fi
13087 rm -rf conftest*
13088
13089 fi
13090
13091 if test $ac_cv_header_stdc = yes; then
13092   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13093   if test "$cross_compiling" = yes; then
13094   :
13095 else
13096   cat >conftest.$ac_ext <<_ACEOF
13097 #line 13097 "configure"
13098 #include "confdefs.h"
13099 #include <ctype.h>
13100 #if ((' ' & 0x0FF) == 0x020)
13101 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13102 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13103 #else
13104 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13105                      || ('j' <= (c) && (c) <= 'r') \
13106                      || ('s' <= (c) && (c) <= 'z'))
13107 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13108 #endif
13109
13110 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13111 int
13112 main (void)
13113 {
13114   int i;
13115   for (i = 0; i < 256; i++)
13116     if (XOR (islower (i), ISLOWER (i))
13117         || toupper (i) != TOUPPER (i))
13118       $ac_main_return(2);
13119   $ac_main_return (0);
13120 }
13121 _ACEOF
13122 rm -f conftest$ac_exeext
13123 if { (eval echo "$as_me:13123: \"$ac_link\"") >&5
13124   (eval $ac_link) 2>&5
13125   ac_status=$?
13126   echo "$as_me:13126: \$? = $ac_status" >&5
13127   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13128   { (eval echo "$as_me:13128: \"$ac_try\"") >&5
13129   (eval $ac_try) 2>&5
13130   ac_status=$?
13131   echo "$as_me:13131: \$? = $ac_status" >&5
13132   (exit $ac_status); }; }; then
13133   :
13134 else
13135   echo "$as_me: program exited with status $ac_status" >&5
13136 echo "$as_me: failed program was:" >&5
13137 cat conftest.$ac_ext >&5
13138 ac_cv_header_stdc=no
13139 fi
13140 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13141 fi
13142 fi
13143 fi
13144 echo "$as_me:13144: result: $ac_cv_header_stdc" >&5
13145 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13146 if test $ac_cv_header_stdc = yes; then
13147
13148 cat >>confdefs.h <<\EOF
13149 #define STDC_HEADERS 1
13150 EOF
13151
13152 fi
13153
13154 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
13155
13156 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
13157                   inttypes.h stdint.h unistd.h
13158 do
13159 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13160 echo "$as_me:13160: checking for $ac_header" >&5
13161 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13162 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13163   echo $ECHO_N "(cached) $ECHO_C" >&6
13164 else
13165   cat >conftest.$ac_ext <<_ACEOF
13166 #line 13166 "configure"
13167 #include "confdefs.h"
13168 $ac_includes_default
13169 #include <$ac_header>
13170 _ACEOF
13171 rm -f conftest.$ac_objext
13172 if { (eval echo "$as_me:13172: \"$ac_compile\"") >&5
13173   (eval $ac_compile) 2>&5
13174   ac_status=$?
13175   echo "$as_me:13175: \$? = $ac_status" >&5
13176   (exit $ac_status); } &&
13177          { ac_try='test -s conftest.$ac_objext'
13178   { (eval echo "$as_me:13178: \"$ac_try\"") >&5
13179   (eval $ac_try) 2>&5
13180   ac_status=$?
13181   echo "$as_me:13181: \$? = $ac_status" >&5
13182   (exit $ac_status); }; }; then
13183   eval "$as_ac_Header=yes"
13184 else
13185   echo "$as_me: failed program was:" >&5
13186 cat conftest.$ac_ext >&5
13187 eval "$as_ac_Header=no"
13188 fi
13189 rm -f conftest.$ac_objext conftest.$ac_ext
13190 fi
13191 echo "$as_me:13191: result: `eval echo '${'$as_ac_Header'}'`" >&5
13192 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13193 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13194   cat >>confdefs.h <<EOF
13195 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13196 EOF
13197
13198 fi
13199 done
13200
13201 echo "$as_me:13201: checking for signed char" >&5
13202 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
13203 if test "${ac_cv_type_signed_char+set}" = set; then
13204   echo $ECHO_N "(cached) $ECHO_C" >&6
13205 else
13206   cat >conftest.$ac_ext <<_ACEOF
13207 #line 13207 "configure"
13208 #include "confdefs.h"
13209 $ac_includes_default
13210 int
13211 main (void)
13212 {
13213 if ((signed char *) 0)
13214   return 0;
13215 if (sizeof (signed char))
13216   return 0;
13217   ;
13218   return 0;
13219 }
13220 _ACEOF
13221 rm -f conftest.$ac_objext
13222 if { (eval echo "$as_me:13222: \"$ac_compile\"") >&5
13223   (eval $ac_compile) 2>&5
13224   ac_status=$?
13225   echo "$as_me:13225: \$? = $ac_status" >&5
13226   (exit $ac_status); } &&
13227          { ac_try='test -s conftest.$ac_objext'
13228   { (eval echo "$as_me:13228: \"$ac_try\"") >&5
13229   (eval $ac_try) 2>&5
13230   ac_status=$?
13231   echo "$as_me:13231: \$? = $ac_status" >&5
13232   (exit $ac_status); }; }; then
13233   ac_cv_type_signed_char=yes
13234 else
13235   echo "$as_me: failed program was:" >&5
13236 cat conftest.$ac_ext >&5
13237 ac_cv_type_signed_char=no
13238 fi
13239 rm -f conftest.$ac_objext conftest.$ac_ext
13240 fi
13241 echo "$as_me:13241: result: $ac_cv_type_signed_char" >&5
13242 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
13243
13244 echo "$as_me:13244: checking size of signed char" >&5
13245 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
13246 if test "${ac_cv_sizeof_signed_char+set}" = set; then
13247   echo $ECHO_N "(cached) $ECHO_C" >&6
13248 else
13249   if test "$ac_cv_type_signed_char" = yes; then
13250   if test "$cross_compiling" = yes; then
13251   # Depending upon the size, compute the lo and hi bounds.
13252 cat >conftest.$ac_ext <<_ACEOF
13253 #line 13253 "configure"
13254 #include "confdefs.h"
13255 $ac_includes_default
13256 int
13257 main (void)
13258 {
13259 int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)]
13260   ;
13261   return 0;
13262 }
13263 _ACEOF
13264 rm -f conftest.$ac_objext
13265 if { (eval echo "$as_me:13265: \"$ac_compile\"") >&5
13266   (eval $ac_compile) 2>&5
13267   ac_status=$?
13268   echo "$as_me:13268: \$? = $ac_status" >&5
13269   (exit $ac_status); } &&
13270          { ac_try='test -s conftest.$ac_objext'
13271   { (eval echo "$as_me:13271: \"$ac_try\"") >&5
13272   (eval $ac_try) 2>&5
13273   ac_status=$?
13274   echo "$as_me:13274: \$? = $ac_status" >&5
13275   (exit $ac_status); }; }; then
13276   ac_lo=0 ac_mid=0
13277   while :; do
13278     cat >conftest.$ac_ext <<_ACEOF
13279 #line 13279 "configure"
13280 #include "confdefs.h"
13281 $ac_includes_default
13282 int
13283 main (void)
13284 {
13285 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13286   ;
13287   return 0;
13288 }
13289 _ACEOF
13290 rm -f conftest.$ac_objext
13291 if { (eval echo "$as_me:13291: \"$ac_compile\"") >&5
13292   (eval $ac_compile) 2>&5
13293   ac_status=$?
13294   echo "$as_me:13294: \$? = $ac_status" >&5
13295   (exit $ac_status); } &&
13296          { ac_try='test -s conftest.$ac_objext'
13297   { (eval echo "$as_me:13297: \"$ac_try\"") >&5
13298   (eval $ac_try) 2>&5
13299   ac_status=$?
13300   echo "$as_me:13300: \$? = $ac_status" >&5
13301   (exit $ac_status); }; }; then
13302   ac_hi=$ac_mid; break
13303 else
13304   echo "$as_me: failed program was:" >&5
13305 cat conftest.$ac_ext >&5
13306 ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
13307 fi
13308 rm -f conftest.$ac_objext conftest.$ac_ext
13309   done
13310 else
13311   echo "$as_me: failed program was:" >&5
13312 cat conftest.$ac_ext >&5
13313 ac_hi=-1 ac_mid=-1
13314   while :; do
13315     cat >conftest.$ac_ext <<_ACEOF
13316 #line 13316 "configure"
13317 #include "confdefs.h"
13318 $ac_includes_default
13319 int
13320 main (void)
13321 {
13322 int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)]
13323   ;
13324   return 0;
13325 }
13326 _ACEOF
13327 rm -f conftest.$ac_objext
13328 if { (eval echo "$as_me:13328: \"$ac_compile\"") >&5
13329   (eval $ac_compile) 2>&5
13330   ac_status=$?
13331   echo "$as_me:13331: \$? = $ac_status" >&5
13332   (exit $ac_status); } &&
13333          { ac_try='test -s conftest.$ac_objext'
13334   { (eval echo "$as_me:13334: \"$ac_try\"") >&5
13335   (eval $ac_try) 2>&5
13336   ac_status=$?
13337   echo "$as_me:13337: \$? = $ac_status" >&5
13338   (exit $ac_status); }; }; then
13339   ac_lo=$ac_mid; break
13340 else
13341   echo "$as_me: failed program was:" >&5
13342 cat conftest.$ac_ext >&5
13343 ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
13344 fi
13345 rm -f conftest.$ac_objext conftest.$ac_ext
13346   done
13347 fi
13348 rm -f conftest.$ac_objext conftest.$ac_ext
13349 # Binary search between lo and hi bounds.
13350 while test "x$ac_lo" != "x$ac_hi"; do
13351   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
13352   cat >conftest.$ac_ext <<_ACEOF
13353 #line 13353 "configure"
13354 #include "confdefs.h"
13355 $ac_includes_default
13356 int
13357 main (void)
13358 {
13359 int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)]
13360   ;
13361   return 0;
13362 }
13363 _ACEOF
13364 rm -f conftest.$ac_objext
13365 if { (eval echo "$as_me:13365: \"$ac_compile\"") >&5
13366   (eval $ac_compile) 2>&5
13367   ac_status=$?
13368   echo "$as_me:13368: \$? = $ac_status" >&5
13369   (exit $ac_status); } &&
13370          { ac_try='test -s conftest.$ac_objext'
13371   { (eval echo "$as_me:13371: \"$ac_try\"") >&5
13372   (eval $ac_try) 2>&5
13373   ac_status=$?
13374   echo "$as_me:13374: \$? = $ac_status" >&5
13375   (exit $ac_status); }; }; then
13376   ac_hi=$ac_mid
13377 else
13378   echo "$as_me: failed program was:" >&5
13379 cat conftest.$ac_ext >&5
13380 ac_lo=`expr $ac_mid + 1`
13381 fi
13382 rm -f conftest.$ac_objext conftest.$ac_ext
13383 done
13384 ac_cv_sizeof_signed_char=$ac_lo
13385 else
13386   if test "$cross_compiling" = yes; then
13387   { { echo "$as_me:13387: error: cannot run test program while cross compiling" >&5
13388 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
13389    { (exit 1); exit 1; }; }
13390 else
13391   cat >conftest.$ac_ext <<_ACEOF
13392 #line 13392 "configure"
13393 #include "confdefs.h"
13394 $ac_includes_default
13395 int
13396 main (void)
13397 {
13398 FILE *f = fopen ("conftest.val", "w");
13399 if (!f)
13400   $ac_main_return (1);
13401 fprintf (f, "%d", (sizeof (signed char)));
13402 fclose (f);
13403   ;
13404   return 0;
13405 }
13406 _ACEOF
13407 rm -f conftest$ac_exeext
13408 if { (eval echo "$as_me:13408: \"$ac_link\"") >&5
13409   (eval $ac_link) 2>&5
13410   ac_status=$?
13411   echo "$as_me:13411: \$? = $ac_status" >&5
13412   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13413   { (eval echo "$as_me:13413: \"$ac_try\"") >&5
13414   (eval $ac_try) 2>&5
13415   ac_status=$?
13416   echo "$as_me:13416: \$? = $ac_status" >&5
13417   (exit $ac_status); }; }; then
13418   ac_cv_sizeof_signed_char=`cat conftest.val`
13419 else
13420   echo "$as_me: program exited with status $ac_status" >&5
13421 echo "$as_me: failed program was:" >&5
13422 cat conftest.$ac_ext >&5
13423 fi
13424 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13425 fi
13426 fi
13427 rm -f conftest.val
13428 else
13429   ac_cv_sizeof_signed_char=0
13430 fi
13431 fi
13432 echo "$as_me:13432: result: $ac_cv_sizeof_signed_char" >&5
13433 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
13434 cat >>confdefs.h <<EOF
13435 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
13436 EOF
13437
13438 echo "$as_me:13438: checking for ANSI C header files" >&5
13439 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13440 if test "${ac_cv_header_stdc+set}" = set; then
13441   echo $ECHO_N "(cached) $ECHO_C" >&6
13442 else
13443   cat >conftest.$ac_ext <<_ACEOF
13444 #line 13444 "configure"
13445 #include "confdefs.h"
13446 #include <stdlib.h>
13447 #include <stdarg.h>
13448 #include <string.h>
13449 #include <float.h>
13450
13451 _ACEOF
13452 if { (eval echo "$as_me:13452: \"$ac_cpp conftest.$ac_ext\"") >&5
13453   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13454   ac_status=$?
13455   egrep -v '^ *\+' conftest.er1 >conftest.err
13456   rm -f conftest.er1
13457   cat conftest.err >&5
13458   echo "$as_me:13458: \$? = $ac_status" >&5
13459   (exit $ac_status); } >/dev/null; then
13460   if test -s conftest.err; then
13461     ac_cpp_err=$ac_c_preproc_warn_flag
13462   else
13463     ac_cpp_err=
13464   fi
13465 else
13466   ac_cpp_err=yes
13467 fi
13468 if test -z "$ac_cpp_err"; then
13469   ac_cv_header_stdc=yes
13470 else
13471   echo "$as_me: failed program was:" >&5
13472   cat conftest.$ac_ext >&5
13473   ac_cv_header_stdc=no
13474 fi
13475 rm -f conftest.err conftest.$ac_ext
13476
13477 if test $ac_cv_header_stdc = yes; then
13478   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13479   cat >conftest.$ac_ext <<_ACEOF
13480 #line 13480 "configure"
13481 #include "confdefs.h"
13482 #include <string.h>
13483
13484 _ACEOF
13485 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13486   egrep "memchr" >/dev/null 2>&1; then
13487   :
13488 else
13489   ac_cv_header_stdc=no
13490 fi
13491 rm -rf conftest*
13492
13493 fi
13494
13495 if test $ac_cv_header_stdc = yes; then
13496   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13497   cat >conftest.$ac_ext <<_ACEOF
13498 #line 13498 "configure"
13499 #include "confdefs.h"
13500 #include <stdlib.h>
13501
13502 _ACEOF
13503 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13504   egrep "free" >/dev/null 2>&1; then
13505   :
13506 else
13507   ac_cv_header_stdc=no
13508 fi
13509 rm -rf conftest*
13510
13511 fi
13512
13513 if test $ac_cv_header_stdc = yes; then
13514   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13515   if test "$cross_compiling" = yes; then
13516   :
13517 else
13518   cat >conftest.$ac_ext <<_ACEOF
13519 #line 13519 "configure"
13520 #include "confdefs.h"
13521 #include <ctype.h>
13522 #if ((' ' & 0x0FF) == 0x020)
13523 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13524 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13525 #else
13526 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13527                      || ('j' <= (c) && (c) <= 'r') \
13528                      || ('s' <= (c) && (c) <= 'z'))
13529 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13530 #endif
13531
13532 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13533 int
13534 main (void)
13535 {
13536   int i;
13537   for (i = 0; i < 256; i++)
13538     if (XOR (islower (i), ISLOWER (i))
13539         || toupper (i) != TOUPPER (i))
13540       $ac_main_return(2);
13541   $ac_main_return (0);
13542 }
13543 _ACEOF
13544 rm -f conftest$ac_exeext
13545 if { (eval echo "$as_me:13545: \"$ac_link\"") >&5
13546   (eval $ac_link) 2>&5
13547   ac_status=$?
13548   echo "$as_me:13548: \$? = $ac_status" >&5
13549   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13550   { (eval echo "$as_me:13550: \"$ac_try\"") >&5
13551   (eval $ac_try) 2>&5
13552   ac_status=$?
13553   echo "$as_me:13553: \$? = $ac_status" >&5
13554   (exit $ac_status); }; }; then
13555   :
13556 else
13557   echo "$as_me: program exited with status $ac_status" >&5
13558 echo "$as_me: failed program was:" >&5
13559 cat conftest.$ac_ext >&5
13560 ac_cv_header_stdc=no
13561 fi
13562 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13563 fi
13564 fi
13565 fi
13566 echo "$as_me:13566: result: $ac_cv_header_stdc" >&5
13567 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13568 if test $ac_cv_header_stdc = yes; then
13569
13570 cat >>confdefs.h <<\EOF
13571 #define STDC_HEADERS 1
13572 EOF
13573
13574 fi
13575
13576 ac_header_dirent=no
13577 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
13578   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
13579 echo "$as_me:13579: checking for $ac_hdr that defines DIR" >&5
13580 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
13581 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13582   echo $ECHO_N "(cached) $ECHO_C" >&6
13583 else
13584   cat >conftest.$ac_ext <<_ACEOF
13585 #line 13585 "configure"
13586 #include "confdefs.h"
13587 #include <sys/types.h>
13588 #include <$ac_hdr>
13589
13590 int
13591 main (void)
13592 {
13593 if ((DIR *) 0)
13594 return 0;
13595   ;
13596   return 0;
13597 }
13598 _ACEOF
13599 rm -f conftest.$ac_objext
13600 if { (eval echo "$as_me:13600: \"$ac_compile\"") >&5
13601   (eval $ac_compile) 2>&5
13602   ac_status=$?
13603   echo "$as_me:13603: \$? = $ac_status" >&5
13604   (exit $ac_status); } &&
13605          { ac_try='test -s conftest.$ac_objext'
13606   { (eval echo "$as_me:13606: \"$ac_try\"") >&5
13607   (eval $ac_try) 2>&5
13608   ac_status=$?
13609   echo "$as_me:13609: \$? = $ac_status" >&5
13610   (exit $ac_status); }; }; then
13611   eval "$as_ac_Header=yes"
13612 else
13613   echo "$as_me: failed program was:" >&5
13614 cat conftest.$ac_ext >&5
13615 eval "$as_ac_Header=no"
13616 fi
13617 rm -f conftest.$ac_objext conftest.$ac_ext
13618 fi
13619 echo "$as_me:13619: result: `eval echo '${'$as_ac_Header'}'`" >&5
13620 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13621 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13622   cat >>confdefs.h <<EOF
13623 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
13624 EOF
13625
13626 ac_header_dirent=$ac_hdr; break
13627 fi
13628
13629 done
13630 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
13631 if test $ac_header_dirent = dirent.h; then
13632   echo "$as_me:13632: checking for opendir in -ldir" >&5
13633 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
13634 if test "${ac_cv_lib_dir_opendir+set}" = set; then
13635   echo $ECHO_N "(cached) $ECHO_C" >&6
13636 else
13637   ac_check_lib_save_LIBS=$LIBS
13638 LIBS="-ldir  $LIBS"
13639 cat >conftest.$ac_ext <<_ACEOF
13640 #line 13640 "configure"
13641 #include "confdefs.h"
13642
13643 /* Override any gcc2 internal prototype to avoid an error.  */
13644 #ifdef __cplusplus
13645 extern "C"
13646 #endif
13647 /* We use char because int might match the return type of a gcc2
13648    builtin and then its argument prototype would still apply.  */
13649 char opendir ();
13650 int
13651 main (void)
13652 {
13653 opendir ();
13654   ;
13655   return 0;
13656 }
13657 _ACEOF
13658 rm -f conftest.$ac_objext conftest$ac_exeext
13659 if { (eval echo "$as_me:13659: \"$ac_link\"") >&5
13660   (eval $ac_link) 2>&5
13661   ac_status=$?
13662   echo "$as_me:13662: \$? = $ac_status" >&5
13663   (exit $ac_status); } &&
13664          { ac_try='test -s conftest$ac_exeext'
13665   { (eval echo "$as_me:13665: \"$ac_try\"") >&5
13666   (eval $ac_try) 2>&5
13667   ac_status=$?
13668   echo "$as_me:13668: \$? = $ac_status" >&5
13669   (exit $ac_status); }; }; then
13670   ac_cv_lib_dir_opendir=yes
13671 else
13672   echo "$as_me: failed program was:" >&5
13673 cat conftest.$ac_ext >&5
13674 ac_cv_lib_dir_opendir=no
13675 fi
13676 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13677 LIBS=$ac_check_lib_save_LIBS
13678 fi
13679 echo "$as_me:13679: result: $ac_cv_lib_dir_opendir" >&5
13680 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
13681 if test $ac_cv_lib_dir_opendir = yes; then
13682   LIBS="$LIBS -ldir"
13683 fi
13684
13685 else
13686   echo "$as_me:13686: checking for opendir in -lx" >&5
13687 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
13688 if test "${ac_cv_lib_x_opendir+set}" = set; then
13689   echo $ECHO_N "(cached) $ECHO_C" >&6
13690 else
13691   ac_check_lib_save_LIBS=$LIBS
13692 LIBS="-lx  $LIBS"
13693 cat >conftest.$ac_ext <<_ACEOF
13694 #line 13694 "configure"
13695 #include "confdefs.h"
13696
13697 /* Override any gcc2 internal prototype to avoid an error.  */
13698 #ifdef __cplusplus
13699 extern "C"
13700 #endif
13701 /* We use char because int might match the return type of a gcc2
13702    builtin and then its argument prototype would still apply.  */
13703 char opendir ();
13704 int
13705 main (void)
13706 {
13707 opendir ();
13708   ;
13709   return 0;
13710 }
13711 _ACEOF
13712 rm -f conftest.$ac_objext conftest$ac_exeext
13713 if { (eval echo "$as_me:13713: \"$ac_link\"") >&5
13714   (eval $ac_link) 2>&5
13715   ac_status=$?
13716   echo "$as_me:13716: \$? = $ac_status" >&5
13717   (exit $ac_status); } &&
13718          { ac_try='test -s conftest$ac_exeext'
13719   { (eval echo "$as_me:13719: \"$ac_try\"") >&5
13720   (eval $ac_try) 2>&5
13721   ac_status=$?
13722   echo "$as_me:13722: \$? = $ac_status" >&5
13723   (exit $ac_status); }; }; then
13724   ac_cv_lib_x_opendir=yes
13725 else
13726   echo "$as_me: failed program was:" >&5
13727 cat conftest.$ac_ext >&5
13728 ac_cv_lib_x_opendir=no
13729 fi
13730 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13731 LIBS=$ac_check_lib_save_LIBS
13732 fi
13733 echo "$as_me:13733: result: $ac_cv_lib_x_opendir" >&5
13734 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
13735 if test $ac_cv_lib_x_opendir = yes; then
13736   LIBS="$LIBS -lx"
13737 fi
13738
13739 fi
13740
13741 echo "$as_me:13741: checking whether time.h and sys/time.h may both be included" >&5
13742 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13743 if test "${ac_cv_header_time+set}" = set; then
13744   echo $ECHO_N "(cached) $ECHO_C" >&6
13745 else
13746   cat >conftest.$ac_ext <<_ACEOF
13747 #line 13747 "configure"
13748 #include "confdefs.h"
13749 #include <sys/types.h>
13750 #include <sys/time.h>
13751 #include <time.h>
13752
13753 int
13754 main (void)
13755 {
13756 if ((struct tm *) 0)
13757 return 0;
13758   ;
13759   return 0;
13760 }
13761 _ACEOF
13762 rm -f conftest.$ac_objext
13763 if { (eval echo "$as_me:13763: \"$ac_compile\"") >&5
13764   (eval $ac_compile) 2>&5
13765   ac_status=$?
13766   echo "$as_me:13766: \$? = $ac_status" >&5
13767   (exit $ac_status); } &&
13768          { ac_try='test -s conftest.$ac_objext'
13769   { (eval echo "$as_me:13769: \"$ac_try\"") >&5
13770   (eval $ac_try) 2>&5
13771   ac_status=$?
13772   echo "$as_me:13772: \$? = $ac_status" >&5
13773   (exit $ac_status); }; }; then
13774   ac_cv_header_time=yes
13775 else
13776   echo "$as_me: failed program was:" >&5
13777 cat conftest.$ac_ext >&5
13778 ac_cv_header_time=no
13779 fi
13780 rm -f conftest.$ac_objext conftest.$ac_ext
13781 fi
13782 echo "$as_me:13782: result: $ac_cv_header_time" >&5
13783 echo "${ECHO_T}$ac_cv_header_time" >&6
13784 if test $ac_cv_header_time = yes; then
13785
13786 cat >>confdefs.h <<\EOF
13787 #define TIME_WITH_SYS_TIME 1
13788 EOF
13789
13790 fi
13791
13792 ###     checks for compiler characteristics
13793 ac_ext=c
13794 ac_cpp='$CPP $CPPFLAGS'
13795 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13796 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13797 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13798 ac_main_return=return
13799
13800 echo "$as_me:13800: checking for an ANSI C-conforming const" >&5
13801 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
13802 if test "${ac_cv_c_const+set}" = set; then
13803   echo $ECHO_N "(cached) $ECHO_C" >&6
13804 else
13805   cat >conftest.$ac_ext <<_ACEOF
13806 #line 13806 "configure"
13807 #include "confdefs.h"
13808
13809 int
13810 main (void)
13811 {
13812 /* FIXME: Include the comments suggested by Paul. */
13813 #ifndef __cplusplus
13814   /* Ultrix mips cc rejects this.  */
13815   typedef int charset[2];
13816   const charset x;
13817   /* SunOS 4.1.1 cc rejects this.  */
13818   char const *const *ccp;
13819   char **p;
13820   /* NEC SVR4.0.2 mips cc rejects this.  */
13821   struct point {int x, y;};
13822   static struct point const zero = {0,0};
13823   /* AIX XL C 1.02.0.0 rejects this.
13824      It does not let you subtract one const X* pointer from another in
13825      an arm of an if-expression whose if-part is not a constant
13826      expression */
13827   const char *g = "string";
13828   ccp = &g + (g ? g-g : 0);
13829   /* HPUX 7.0 cc rejects these. */
13830   ++ccp;
13831   p = (char**) ccp;
13832   ccp = (char const *const *) p;
13833   { /* SCO 3.2v4 cc rejects this.  */
13834     char *t;
13835     char const *s = 0 ? (char *) 0 : (char const *) 0;
13836
13837     *t++ = 0;
13838   }
13839   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13840     int x[] = {25, 17};
13841     const int *foo = &x[0];
13842     ++foo;
13843   }
13844   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13845     typedef const int *iptr;
13846     iptr p = 0;
13847     ++p;
13848   }
13849   { /* AIX XL C 1.02.0.0 rejects this saying
13850        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13851     struct s { int j; const int *ap[3]; };
13852     struct s *b; b->j = 5;
13853   }
13854   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13855     const int foo = 10;
13856   }
13857 #endif
13858
13859   ;
13860   return 0;
13861 }
13862 _ACEOF
13863 rm -f conftest.$ac_objext
13864 if { (eval echo "$as_me:13864: \"$ac_compile\"") >&5
13865   (eval $ac_compile) 2>&5
13866   ac_status=$?
13867   echo "$as_me:13867: \$? = $ac_status" >&5
13868   (exit $ac_status); } &&
13869          { ac_try='test -s conftest.$ac_objext'
13870   { (eval echo "$as_me:13870: \"$ac_try\"") >&5
13871   (eval $ac_try) 2>&5
13872   ac_status=$?
13873   echo "$as_me:13873: \$? = $ac_status" >&5
13874   (exit $ac_status); }; }; then
13875   ac_cv_c_const=yes
13876 else
13877   echo "$as_me: failed program was:" >&5
13878 cat conftest.$ac_ext >&5
13879 ac_cv_c_const=no
13880 fi
13881 rm -f conftest.$ac_objext conftest.$ac_ext
13882 fi
13883 echo "$as_me:13883: result: $ac_cv_c_const" >&5
13884 echo "${ECHO_T}$ac_cv_c_const" >&6
13885 if test $ac_cv_c_const = no; then
13886
13887 cat >>confdefs.h <<\EOF
13888 #define const
13889 EOF
13890
13891 fi
13892
13893 ###     Checks for external-data
13894
13895 echo "$as_me:13895: checking if data-only library module links" >&5
13896 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
13897 if test "${cf_cv_link_dataonly+set}" = set; then
13898   echo $ECHO_N "(cached) $ECHO_C" >&6
13899 else
13900
13901         rm -f conftest.a
13902         cat >conftest.$ac_ext <<EOF
13903 #line 13903 "configure"
13904 int     testdata[3] = { 123, 456, 789 };
13905 EOF
13906         if { (eval echo "$as_me:13906: \"$ac_compile\"") >&5
13907   (eval $ac_compile) 2>&5
13908   ac_status=$?
13909   echo "$as_me:13909: \$? = $ac_status" >&5
13910   (exit $ac_status); } ; then
13911                 mv conftest.o data.o && \
13912                 ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
13913         fi
13914         rm -f conftest.$ac_ext data.o
13915         cat >conftest.$ac_ext <<EOF
13916 #line 13916 "configure"
13917 int     testfunc(void)
13918 {
13919 #if defined(NeXT)
13920         ${cf_cv_main_return:-return}(1);        /* I'm told this linker is broken */
13921 #else
13922         extern int testdata[3];
13923         return testdata[0] == 123
13924            &&  testdata[1] == 456
13925            &&  testdata[2] == 789;
13926 #endif
13927 }
13928 EOF
13929         if { (eval echo "$as_me:13929: \"$ac_compile\"") >&5
13930   (eval $ac_compile) 2>&5
13931   ac_status=$?
13932   echo "$as_me:13932: \$? = $ac_status" >&5
13933   (exit $ac_status); }; then
13934                 mv conftest.o func.o && \
13935                 ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
13936         fi
13937         rm -f conftest.$ac_ext func.o
13938         ( eval $RANLIB conftest.a ) 2>&5 >/dev/null
13939         cf_saveLIBS="$LIBS"
13940         LIBS="conftest.a $LIBS"
13941         if test "$cross_compiling" = yes; then
13942   cf_cv_link_dataonly=unknown
13943 else
13944   cat >conftest.$ac_ext <<_ACEOF
13945 #line 13945 "configure"
13946 #include "confdefs.h"
13947
13948         int main(void)
13949         {
13950                 extern int testfunc();
13951                 ${cf_cv_main_return:-return} (!testfunc());
13952         }
13953
13954 _ACEOF
13955 rm -f conftest$ac_exeext
13956 if { (eval echo "$as_me:13956: \"$ac_link\"") >&5
13957   (eval $ac_link) 2>&5
13958   ac_status=$?
13959   echo "$as_me:13959: \$? = $ac_status" >&5
13960   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13961   { (eval echo "$as_me:13961: \"$ac_try\"") >&5
13962   (eval $ac_try) 2>&5
13963   ac_status=$?
13964   echo "$as_me:13964: \$? = $ac_status" >&5
13965   (exit $ac_status); }; }; then
13966   cf_cv_link_dataonly=yes
13967 else
13968   echo "$as_me: program exited with status $ac_status" >&5
13969 echo "$as_me: failed program was:" >&5
13970 cat conftest.$ac_ext >&5
13971 cf_cv_link_dataonly=no
13972 fi
13973 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13974 fi
13975         LIBS="$cf_saveLIBS"
13976
13977 fi
13978
13979 echo "$as_me:13979: result: $cf_cv_link_dataonly" >&5
13980 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
13981
13982 if test "$cf_cv_link_dataonly" = no ; then
13983
13984 cat >>confdefs.h <<\EOF
13985 #define BROKEN_LINKER 1
13986 EOF
13987
13988         BROKEN_LINKER=1
13989 fi
13990
13991 ###     Checks for library functions.
13992
13993 for ac_header in \
13994 unistd.h \
13995
13996 do
13997 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13998 echo "$as_me:13998: checking for $ac_header" >&5
13999 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14000 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14001   echo $ECHO_N "(cached) $ECHO_C" >&6
14002 else
14003   cat >conftest.$ac_ext <<_ACEOF
14004 #line 14004 "configure"
14005 #include "confdefs.h"
14006 #include <$ac_header>
14007 _ACEOF
14008 if { (eval echo "$as_me:14008: \"$ac_cpp conftest.$ac_ext\"") >&5
14009   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14010   ac_status=$?
14011   egrep -v '^ *\+' conftest.er1 >conftest.err
14012   rm -f conftest.er1
14013   cat conftest.err >&5
14014   echo "$as_me:14014: \$? = $ac_status" >&5
14015   (exit $ac_status); } >/dev/null; then
14016   if test -s conftest.err; then
14017     ac_cpp_err=$ac_c_preproc_warn_flag
14018   else
14019     ac_cpp_err=
14020   fi
14021 else
14022   ac_cpp_err=yes
14023 fi
14024 if test -z "$ac_cpp_err"; then
14025   eval "$as_ac_Header=yes"
14026 else
14027   echo "$as_me: failed program was:" >&5
14028   cat conftest.$ac_ext >&5
14029   eval "$as_ac_Header=no"
14030 fi
14031 rm -f conftest.err conftest.$ac_ext
14032 fi
14033 echo "$as_me:14033: result: `eval echo '${'$as_ac_Header'}'`" >&5
14034 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14035 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14036   cat >>confdefs.h <<EOF
14037 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14038 EOF
14039
14040 fi
14041 done
14042
14043 echo "$as_me:14043: checking for working mkstemp" >&5
14044 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
14045 if test "${cf_cv_func_mkstemp+set}" = set; then
14046   echo $ECHO_N "(cached) $ECHO_C" >&6
14047 else
14048
14049 rm -rf conftest*
14050 if test "$cross_compiling" = yes; then
14051   cf_cv_func_mkstemp=maybe
14052 else
14053   cat >conftest.$ac_ext <<_ACEOF
14054 #line 14054 "configure"
14055 #include "confdefs.h"
14056
14057 #include <sys/types.h>
14058 #ifdef HAVE_UNISTD_H
14059 #include <unistd.h>
14060 #endif
14061 #include <stdlib.h>
14062 #include <stdio.h>
14063 #include <string.h>
14064 #include <sys/stat.h>
14065 int main(void)
14066 {
14067         char *tmpl = "conftestXXXXXX";
14068         char name[2][80];
14069         int n;
14070         int result = 0;
14071         int fd;
14072         struct stat sb;
14073
14074         umask(077);
14075         for (n = 0; n < 2; ++n) {
14076                 strcpy(name[n], tmpl);
14077                 if ((fd = mkstemp(name[n])) >= 0) {
14078                         if (!strcmp(name[n], tmpl)
14079                          || stat(name[n], &sb) != 0
14080                          || (sb.st_mode & S_IFMT) != S_IFREG
14081                          || (sb.st_mode & 077) != 0) {
14082                                 result = 1;
14083                         }
14084                         close(fd);
14085                 }
14086         }
14087         if (result == 0
14088          && !strcmp(name[0], name[1]))
14089                 result = 1;
14090         ${cf_cv_main_return:-return}(result);
14091 }
14092
14093 _ACEOF
14094 rm -f conftest$ac_exeext
14095 if { (eval echo "$as_me:14095: \"$ac_link\"") >&5
14096   (eval $ac_link) 2>&5
14097   ac_status=$?
14098   echo "$as_me:14098: \$? = $ac_status" >&5
14099   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14100   { (eval echo "$as_me:14100: \"$ac_try\"") >&5
14101   (eval $ac_try) 2>&5
14102   ac_status=$?
14103   echo "$as_me:14103: \$? = $ac_status" >&5
14104   (exit $ac_status); }; }; then
14105   cf_cv_func_mkstemp=yes
14106
14107 else
14108   echo "$as_me: program exited with status $ac_status" >&5
14109 echo "$as_me: failed program was:" >&5
14110 cat conftest.$ac_ext >&5
14111 cf_cv_func_mkstemp=no
14112
14113 fi
14114 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14115 fi
14116
14117 fi
14118 echo "$as_me:14118: result: $cf_cv_func_mkstemp" >&5
14119 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
14120 if test "x$cf_cv_func_mkstemp" = xmaybe ; then
14121         echo "$as_me:14121: checking for mkstemp" >&5
14122 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
14123 if test "${ac_cv_func_mkstemp+set}" = set; then
14124   echo $ECHO_N "(cached) $ECHO_C" >&6
14125 else
14126   cat >conftest.$ac_ext <<_ACEOF
14127 #line 14127 "configure"
14128 #include "confdefs.h"
14129 /* System header to define __stub macros and hopefully few prototypes,
14130     which can conflict with char mkstemp (); below.  */
14131 #include <assert.h>
14132 /* Override any gcc2 internal prototype to avoid an error.  */
14133 #ifdef __cplusplus
14134 extern "C"
14135 #endif
14136 /* We use char because int might match the return type of a gcc2
14137    builtin and then its argument prototype would still apply.  */
14138 char mkstemp ();
14139 char (*f) ();
14140
14141 int
14142 main (void)
14143 {
14144 /* The GNU C library defines this for functions which it implements
14145     to always fail with ENOSYS.  Some functions are actually named
14146     something starting with __ and the normal name is an alias.  */
14147 #if defined (__stub_mkstemp) || defined (__stub___mkstemp)
14148 choke me
14149 #else
14150 f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14151 #endif
14152
14153   ;
14154   return 0;
14155 }
14156 _ACEOF
14157 rm -f conftest.$ac_objext conftest$ac_exeext
14158 if { (eval echo "$as_me:14158: \"$ac_link\"") >&5
14159   (eval $ac_link) 2>&5
14160   ac_status=$?
14161   echo "$as_me:14161: \$? = $ac_status" >&5
14162   (exit $ac_status); } &&
14163          { ac_try='test -s conftest$ac_exeext'
14164   { (eval echo "$as_me:14164: \"$ac_try\"") >&5
14165   (eval $ac_try) 2>&5
14166   ac_status=$?
14167   echo "$as_me:14167: \$? = $ac_status" >&5
14168   (exit $ac_status); }; }; then
14169   ac_cv_func_mkstemp=yes
14170 else
14171   echo "$as_me: failed program was:" >&5
14172 cat conftest.$ac_ext >&5
14173 ac_cv_func_mkstemp=no
14174 fi
14175 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14176 fi
14177 echo "$as_me:14177: result: $ac_cv_func_mkstemp" >&5
14178 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
14179
14180 fi
14181 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
14182
14183 cat >>confdefs.h <<\EOF
14184 #define HAVE_MKSTEMP 1
14185 EOF
14186
14187 fi
14188
14189 if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
14190         CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14191         CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
14192 fi
14193
14194 cf_with_ada=yes
14195 if test "$cf_with_ada" != "no" ; then
14196
14197 cf_ada_make=gnatmake
14198 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
14199 set dummy $cf_ada_make; ac_word=$2
14200 echo "$as_me:14200: checking for $ac_word" >&5
14201 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14202 if test "${ac_cv_prog_gnat_exists+set}" = set; then
14203   echo $ECHO_N "(cached) $ECHO_C" >&6
14204 else
14205   if test -n "$gnat_exists"; then
14206   ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
14207 else
14208   ac_save_IFS=$IFS; IFS=$ac_path_separator
14209 ac_dummy="$PATH"
14210 for ac_dir in $ac_dummy; do
14211   IFS=$ac_save_IFS
14212   test -z "$ac_dir" && ac_dir=.
14213   $as_executable_p "$ac_dir/$ac_word" || continue
14214 ac_cv_prog_gnat_exists="yes"
14215 echo "$as_me:14215: found $ac_dir/$ac_word" >&5
14216 break
14217 done
14218
14219   test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
14220 fi
14221 fi
14222 gnat_exists=$ac_cv_prog_gnat_exists
14223 if test -n "$gnat_exists"; then
14224   echo "$as_me:14224: result: $gnat_exists" >&5
14225 echo "${ECHO_T}$gnat_exists" >&6
14226 else
14227   echo "$as_me:14227: result: no" >&5
14228 echo "${ECHO_T}no" >&6
14229 fi
14230
14231 if test "$ac_cv_prog_gnat_exists" = no; then
14232         cf_ada_make=
14233         cf_cv_prog_gnat_correct=no
14234 else
14235
14236 echo "$as_me:14236: checking for gnat version" >&5
14237 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
14238 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
14239         grep '[0-9].[0-9][0-9]*' |\
14240         sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
14241 echo "$as_me:14241: result: $cf_gnat_version" >&5
14242 echo "${ECHO_T}$cf_gnat_version" >&6
14243
14244 case $cf_gnat_version in
14245 (3.1[1-9]*|3.[2-9]*|[4-9].*|20[0-9][0-9])
14246         cf_cv_prog_gnat_correct=yes
14247         ;;
14248 (*)
14249         { echo "$as_me:14249: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
14250 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
14251         cf_cv_prog_gnat_correct=no
14252         ;;
14253 esac
14254
14255         # Extract the first word of "m4", so it can be a program name with args.
14256 set dummy m4; ac_word=$2
14257 echo "$as_me:14257: checking for $ac_word" >&5
14258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14259 if test "${ac_cv_prog_M4_exists+set}" = set; then
14260   echo $ECHO_N "(cached) $ECHO_C" >&6
14261 else
14262   if test -n "$M4_exists"; then
14263   ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
14264 else
14265   ac_save_IFS=$IFS; IFS=$ac_path_separator
14266 ac_dummy="$PATH"
14267 for ac_dir in $ac_dummy; do
14268   IFS=$ac_save_IFS
14269   test -z "$ac_dir" && ac_dir=.
14270   $as_executable_p "$ac_dir/$ac_word" || continue
14271 ac_cv_prog_M4_exists="yes"
14272 echo "$as_me:14272: found $ac_dir/$ac_word" >&5
14273 break
14274 done
14275
14276   test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
14277 fi
14278 fi
14279 M4_exists=$ac_cv_prog_M4_exists
14280 if test -n "$M4_exists"; then
14281   echo "$as_me:14281: result: $M4_exists" >&5
14282 echo "${ECHO_T}$M4_exists" >&6
14283 else
14284   echo "$as_me:14284: result: no" >&5
14285 echo "${ECHO_T}no" >&6
14286 fi
14287
14288         if test "$ac_cv_prog_M4_exists" = no; then
14289                 cf_cv_prog_gnat_correct=no
14290                 echo Ada95 binding required program m4 not found. Ada95 binding disabled.
14291         fi
14292         if test "$cf_cv_prog_gnat_correct" = yes; then
14293                 echo "$as_me:14293: checking if GNAT works" >&5
14294 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
14295
14296 rm -rf conftest* *~conftest*
14297 cat >>conftest.ads <<CF_EOF
14298 procedure conftest;
14299 CF_EOF
14300 cat >>conftest.adb <<CF_EOF
14301 with Text_IO;
14302 with GNAT.OS_Lib;
14303 procedure conftest is
14304 begin
14305    Text_IO.Put ("Hello World");
14306    Text_IO.New_Line;
14307    GNAT.OS_Lib.OS_Exit (0);
14308 end conftest;
14309 CF_EOF
14310 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14311    if ( ./conftest 1>&5 2>&1 ) ; then
14312       cf_cv_prog_gnat_correct=yes
14313    else
14314       cf_cv_prog_gnat_correct=no
14315    fi
14316 else
14317    cf_cv_prog_gnat_correct=no
14318 fi
14319 rm -rf conftest* *~conftest*
14320
14321                 echo "$as_me:14321: result: $cf_cv_prog_gnat_correct" >&5
14322 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
14323         fi
14324 fi
14325
14326         if test "$cf_cv_prog_gnat_correct" = yes; then
14327
14328         echo "$as_me:14328: checking optimization options for ADAFLAGS" >&5
14329 echo $ECHO_N "checking optimization options for ADAFLAGS... $ECHO_C" >&6
14330         case "$CFLAGS" in
14331         (*-g*)
14332
14333         ADAFLAGS="$ADAFLAGS -g"
14334
14335                 ;;
14336         esac
14337         case "$CFLAGS" in
14338         (*-O*)
14339                 cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[         ].*//'`
14340
14341         ADAFLAGS="$ADAFLAGS $cf_O_flag"
14342
14343                 ;;
14344         esac
14345         echo "$as_me:14345: result: $ADAFLAGS" >&5
14346 echo "${ECHO_T}$ADAFLAGS" >&6
14347
14348 echo "$as_me:14348: checking if GNATPREP supports -T option" >&5
14349 echo $ECHO_N "checking if GNATPREP supports -T option... $ECHO_C" >&6
14350 if test "${cf_cv_gnatprep_opt_t+set}" = set; then
14351   echo $ECHO_N "(cached) $ECHO_C" >&6
14352 else
14353
14354 cf_cv_gnatprep_opt_t=no
14355 gnatprep -T 2>/dev/null >/dev/null && cf_cv_gnatprep_opt_t=yes
14356
14357 fi
14358 echo "$as_me:14358: result: $cf_cv_gnatprep_opt_t" >&5
14359 echo "${ECHO_T}$cf_cv_gnatprep_opt_t" >&6
14360 test "$cf_cv_gnatprep_opt_t" = yes && GNATPREP_OPTS="-T $GNATPREP_OPTS"
14361
14362 echo "$as_me:14362: checking if GNAT supports generics" >&5
14363 echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
14364 case $cf_gnat_version in
14365 (3.[1-9]*|[4-9].*)
14366         cf_gnat_generics=yes
14367         ;;
14368 (*)
14369         cf_gnat_generics=no
14370         ;;
14371 esac
14372 echo "$as_me:14372: result: $cf_gnat_generics" >&5
14373 echo "${ECHO_T}$cf_gnat_generics" >&6
14374
14375 if test "$cf_gnat_generics" = yes
14376 then
14377         cf_compile_generics=generics
14378         cf_generic_objects="\${GENOBJS}"
14379 else
14380         cf_compile_generics=
14381         cf_generic_objects=
14382 fi
14383
14384 echo "$as_me:14384: checking if GNAT supports SIGINT" >&5
14385 echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
14386 if test "${cf_cv_gnat_sigint+set}" = set; then
14387   echo $ECHO_N "(cached) $ECHO_C" >&6
14388 else
14389
14390 rm -rf conftest* *~conftest*
14391 cat >>conftest.ads <<CF_EOF
14392 with Ada.Interrupts.Names;
14393
14394 package ConfTest is
14395
14396    pragma Warnings (Off);  --  the next pragma exists since 3.11p
14397    pragma Unreserve_All_Interrupts;
14398    pragma Warnings (On);
14399
14400    protected Process is
14401       procedure Stop;
14402       function Continue return Boolean;
14403       pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
14404    private
14405       Done : Boolean := False;
14406    end Process;
14407
14408 end ConfTest;
14409 CF_EOF
14410 cat >>conftest.adb <<CF_EOF
14411 package body ConfTest is
14412    protected body Process is
14413       procedure Stop is
14414       begin
14415          Done := True;
14416       end Stop;
14417       function Continue return Boolean is
14418       begin
14419          return not Done;
14420       end Continue;
14421    end Process;
14422 end ConfTest;
14423 CF_EOF
14424 if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
14425       cf_cv_gnat_sigint=yes
14426 else
14427    cf_cv_gnat_sigint=no
14428 fi
14429 rm -rf conftest* *~conftest*
14430
14431 fi
14432 echo "$as_me:14432: result: $cf_cv_gnat_sigint" >&5
14433 echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
14434
14435 if test $cf_cv_gnat_sigint = yes ; then
14436         USE_GNAT_SIGINT=""
14437 else
14438         USE_GNAT_SIGINT="#"
14439 fi
14440
14441 cf_gnat_libraries=no
14442 cf_gnat_projects=no
14443
14444 if test "$enable_gnat_projects" != no ; then
14445 echo "$as_me:14445: checking if GNAT supports project files" >&5
14446 echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
14447 case $cf_gnat_version in
14448 (3.[0-9]*)
14449         ;;
14450 (*)
14451         case $cf_cv_system_name in
14452         (cygwin*|msys*)
14453                 ;;
14454         (*)
14455                 mkdir conftest.src conftest.bin conftest.lib
14456                 cd conftest.src
14457                 rm -rf conftest* *~conftest*
14458                 cat >>library.gpr <<CF_EOF
14459 project Library is
14460   Kind := External ("LIB_KIND");
14461   for Library_Name use "ConfTest";
14462   for Object_Dir use ".";
14463   for Library_ALI_Dir use External("LIBRARY_DIR");
14464   for Library_Version use External ("SONAME");
14465   for Library_Kind use Kind;
14466   for Library_Dir use External("BUILD_DIR");
14467   Source_Dir := External ("SOURCE_DIR");
14468   for Source_Dirs use (Source_Dir);
14469 end Library;
14470 CF_EOF
14471                 cat >>confpackage.ads <<CF_EOF
14472 package ConfPackage is
14473    procedure conftest;
14474 end ConfPackage;
14475 CF_EOF
14476                 cat >>confpackage.adb <<CF_EOF
14477 with Text_IO;
14478 package body ConfPackage is
14479    procedure conftest is
14480    begin
14481       Text_IO.Put ("Hello World");
14482       Text_IO.New_Line;
14483    end conftest;
14484 end ConfPackage;
14485 CF_EOF
14486                 if ( $cf_ada_make $ADAFLAGS \
14487                                 -Plibrary.gpr \
14488                                 -XBUILD_DIR=`cd ../conftest.bin;pwd` \
14489                                 -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
14490                                 -XSOURCE_DIR=`pwd` \
14491                                 -XSONAME=libConfTest.so.1 \
14492                                 -XLIB_KIND=static 1>&5 2>&1 ) ; then
14493                         cf_gnat_projects=yes
14494                 fi
14495                 cd ..
14496                 if test -f conftest.lib/confpackage.ali
14497                 then
14498                         cf_gnat_libraries=yes
14499                 fi
14500                 rm -rf conftest* *~conftest*
14501                 ;;
14502         esac
14503         ;;
14504 esac
14505 echo "$as_me:14505: result: $cf_gnat_projects" >&5
14506 echo "${ECHO_T}$cf_gnat_projects" >&6
14507 fi # enable_gnat_projects
14508
14509 if test $cf_gnat_projects = yes
14510 then
14511         echo "$as_me:14511: checking if GNAT supports libraries" >&5
14512 echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
14513         echo "$as_me:14513: result: $cf_gnat_libraries" >&5
14514 echo "${ECHO_T}$cf_gnat_libraries" >&6
14515 fi
14516
14517 if test "$cf_gnat_projects" = yes
14518 then
14519         USE_OLD_MAKERULES="#"
14520         USE_GNAT_PROJECTS=""
14521 else
14522         USE_OLD_MAKERULES=""
14523         USE_GNAT_PROJECTS="#"
14524 fi
14525
14526 if test "$cf_gnat_libraries" = yes
14527 then
14528         USE_GNAT_LIBRARIES=""
14529 else
14530         USE_GNAT_LIBRARIES="#"
14531 fi
14532
14533 echo "$as_me:14533: checking for ada-compiler" >&5
14534 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
14535
14536 # Check whether --with-ada-compiler or --without-ada-compiler was given.
14537 if test "${with_ada_compiler+set}" = set; then
14538   withval="$with_ada_compiler"
14539   cf_ada_compiler=$withval
14540 else
14541   cf_ada_compiler=gnatmake
14542 fi;
14543
14544 echo "$as_me:14544: result: $cf_ada_compiler" >&5
14545 echo "${ECHO_T}$cf_ada_compiler" >&6
14546
14547                 cf_ada_package=terminal_interface
14548
14549 echo "$as_me:14549: checking for ada-include" >&5
14550 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
14551
14552 # Check whether --with-ada-include or --without-ada-include was given.
14553 if test "${with_ada_include+set}" = set; then
14554   withval="$with_ada_include"
14555
14556 else
14557   withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
14558 fi; if test -n "$prefix/share/ada/adainclude" ; then
14559
14560 if test "x$prefix" != xNONE; then
14561         cf_path_syntax="$prefix"
14562 else
14563         cf_path_syntax="$ac_default_prefix"
14564 fi
14565
14566 case ".$withval" in
14567 (.\$\(*\)*|.\'*\'*)
14568         ;;
14569 (..|./*|.\\*)
14570         ;;
14571 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14572         ;;
14573 (.\${*prefix}*|.\${*dir}*)
14574         eval withval="$withval"
14575         case ".$withval" in
14576         (.NONE/*)
14577                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14578                 ;;
14579         esac
14580         ;;
14581 (.no|.NONE/*)
14582         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14583         ;;
14584 (*)
14585         { { echo "$as_me:14585: error: expected a pathname, not \"$withval\"" >&5
14586 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14587    { (exit 1); exit 1; }; }
14588         ;;
14589 esac
14590
14591 fi
14592 eval ADA_INCLUDE="$withval"
14593
14594 echo "$as_me:14594: result: $ADA_INCLUDE" >&5
14595 echo "${ECHO_T}$ADA_INCLUDE" >&6
14596
14597 echo "$as_me:14597: checking for ada-objects" >&5
14598 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
14599
14600 # Check whether --with-ada-objects or --without-ada-objects was given.
14601 if test "${with_ada_objects+set}" = set; then
14602   withval="$with_ada_objects"
14603
14604 else
14605   withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
14606 fi; if test -n "$prefix/lib/ada/adalib" ; then
14607
14608 if test "x$prefix" != xNONE; then
14609         cf_path_syntax="$prefix"
14610 else
14611         cf_path_syntax="$ac_default_prefix"
14612 fi
14613
14614 case ".$withval" in
14615 (.\$\(*\)*|.\'*\'*)
14616         ;;
14617 (..|./*|.\\*)
14618         ;;
14619 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14620         ;;
14621 (.\${*prefix}*|.\${*dir}*)
14622         eval withval="$withval"
14623         case ".$withval" in
14624         (.NONE/*)
14625                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14626                 ;;
14627         esac
14628         ;;
14629 (.no|.NONE/*)
14630         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
14631         ;;
14632 (*)
14633         { { echo "$as_me:14633: error: expected a pathname, not \"$withval\"" >&5
14634 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
14635    { (exit 1); exit 1; }; }
14636         ;;
14637 esac
14638
14639 fi
14640 eval ADA_OBJECTS="$withval"
14641
14642 echo "$as_me:14642: result: $ADA_OBJECTS" >&5
14643 echo "${ECHO_T}$ADA_OBJECTS" >&6
14644
14645 echo "$as_me:14645: checking if an Ada95 shared-library should be built" >&5
14646 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
14647
14648 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
14649 if test "${with_ada_sharedlib+set}" = set; then
14650   withval="$with_ada_sharedlib"
14651   with_ada_sharedlib=$withval
14652 else
14653   with_ada_sharedlib=no
14654 fi;
14655 echo "$as_me:14655: result: $with_ada_sharedlib" >&5
14656 echo "${ECHO_T}$with_ada_sharedlib" >&6
14657
14658 ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
14659 MAKE_ADA_SHAREDLIB="#"
14660
14661 if test "x$with_ada_sharedlib" != xno
14662 then
14663         MAKE_ADA_SHAREDLIB=
14664         if test "x$with_ada_sharedlib" != xyes
14665         then
14666                 ADA_SHAREDLIB="$with_ada_sharedlib"
14667         fi
14668 fi
14669
14670         else
14671                 { { echo "$as_me:14671: error: No usable Ada compiler found" >&5
14672 echo "$as_me: error: No usable Ada compiler found" >&2;}
14673    { (exit 1); exit 1; }; }
14674         fi
14675 else
14676         { { echo "$as_me:14676: error: The Ada compiler is needed for this package" >&5
14677 echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
14678    { (exit 1); exit 1; }; }
14679 fi
14680
14681 ################################################################################
14682
14683 # not needed
14684 TINFO_LDFLAGS2=
14685
14686 TINFO_LIBS=
14687
14688 ### Construct the list of include-directories to be generated
14689
14690 if test "$srcdir" != "."; then
14691         CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
14692 fi
14693 CPPFLAGS="-I../include $CPPFLAGS"
14694 if test "$srcdir" != "."; then
14695         CPPFLAGS="-I\${srcdir} $CPPFLAGS"
14696 fi
14697 CPPFLAGS="-I. $CPPFLAGS"
14698
14699 ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
14700 if test "$srcdir" != "."; then
14701         ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
14702 fi
14703 if test "$GCC" != yes; then
14704         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14705 elif test "$includedir" != "/usr/include"; then
14706         if test "$includedir" = '${prefix}/include' ; then
14707                 if test x$prefix != x/usr ; then
14708                         ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14709                 fi
14710         else
14711                 ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
14712         fi
14713 fi
14714
14715 ### Build up pieces for makefile rules
14716 echo "$as_me:14716: checking default library suffix" >&5
14717 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
14718
14719         case $DFT_LWR_MODEL in
14720         (libtool) DFT_ARG_SUFFIX=''   ;;
14721         (normal)  DFT_ARG_SUFFIX=''   ;;
14722         (debug)   DFT_ARG_SUFFIX='_g' ;;
14723         (profile) DFT_ARG_SUFFIX='_p' ;;
14724         (shared)  DFT_ARG_SUFFIX=''   ;;
14725         esac
14726         test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
14727 echo "$as_me:14727: result: $DFT_ARG_SUFFIX" >&5
14728 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
14729
14730 echo "$as_me:14730: checking default library-dependency suffix" >&5
14731 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
14732
14733         case X$DFT_LWR_MODEL in
14734         (Xlibtool)
14735                 DFT_LIB_SUFFIX='.la'
14736                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14737                 ;;
14738         (Xdebug)
14739                 DFT_LIB_SUFFIX='_g.a'
14740                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14741                 ;;
14742         (Xprofile)
14743                 DFT_LIB_SUFFIX='_p.a'
14744                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14745                 ;;
14746         (Xshared)
14747                 case $cf_cv_system_name in
14748                 (aix[5-7]*)
14749                         DFT_LIB_SUFFIX='.so'
14750                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14751                         ;;
14752                 (cygwin*|msys*|mingw*)
14753                         DFT_LIB_SUFFIX='.dll'
14754                         DFT_DEP_SUFFIX='.dll.a'
14755                         ;;
14756                 (darwin*)
14757                         DFT_LIB_SUFFIX='.dylib'
14758                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14759                         ;;
14760                 (hpux*)
14761                         case $target in
14762                         (ia64*)
14763                                 DFT_LIB_SUFFIX='.so'
14764                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14765                                 ;;
14766                         (*)
14767                                 DFT_LIB_SUFFIX='.sl'
14768                                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14769                                 ;;
14770                         esac
14771                         ;;
14772                 (*)
14773                         DFT_LIB_SUFFIX='.so'
14774                         DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14775                         ;;
14776                 esac
14777                 ;;
14778         (*)
14779                 DFT_LIB_SUFFIX='.a'
14780                 DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
14781                 ;;
14782         esac
14783         if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
14784         then
14785                 DFT_LIB_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_LIB_SUFFIX}"
14786                 DFT_DEP_SUFFIX="${LIB_SUFFIX}${EXTRA_SUFFIX}${DFT_DEP_SUFFIX}"
14787         fi
14788 echo "$as_me:14788: result: $DFT_DEP_SUFFIX" >&5
14789 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
14790
14791 echo "$as_me:14791: checking default object directory" >&5
14792 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
14793
14794         case $DFT_LWR_MODEL in
14795         (libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
14796         (normal)  DFT_OBJ_SUBDIR='objects' ;;
14797         (debug)   DFT_OBJ_SUBDIR='obj_g' ;;
14798         (profile) DFT_OBJ_SUBDIR='obj_p' ;;
14799         (shared)
14800                 case $cf_cv_system_name in
14801                 (cygwin|msys)
14802                         DFT_OBJ_SUBDIR='objects' ;;
14803                 (*)
14804                         DFT_OBJ_SUBDIR='obj_s' ;;
14805                 esac
14806         esac
14807 echo "$as_me:14807: result: $DFT_OBJ_SUBDIR" >&5
14808 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
14809
14810 ### Set up low-level terminfo dependencies for makefiles.
14811
14812 if test "$DFT_LWR_MODEL" = shared ; then
14813         case $cf_cv_system_name in
14814         (cygwin*)
14815                 # "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
14816                 ;;
14817         (msys*)
14818                 # "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
14819                 ;;
14820         esac
14821 fi
14822
14823 USE_CFG_SUFFIX=${DFT_ARG_SUFFIX}
14824
14825 ### Construct the list of subdirectories for which we'll customize makefiles
14826 ### with the appropriate compile-rules.
14827
14828 SUB_MAKEFILES="gen/adacurses${USE_ARG_SUFFIX}-config:gen/adacurses-config.in"
14829
14830 cat >>confdefs.h <<EOF
14831 #define NCURSES_PATHSEP '$PATH_SEPARATOR'
14832 EOF
14833
14834 ### Now that we're done running tests, add the compiler-warnings, if any
14835
14836 cf_fix_cppflags=no
14837 cf_new_cflags=
14838 cf_new_cppflags=
14839 cf_new_extra_cppflags=
14840
14841 for cf_add_cflags in $EXTRA_CFLAGS
14842 do
14843 case $cf_fix_cppflags in
14844 (no)
14845         case $cf_add_cflags in
14846         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14847                 case $cf_add_cflags in
14848                 (-D*)
14849                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14850
14851                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14852                                 && test -z "${cf_tst_cflags}" \
14853                                 && cf_fix_cppflags=yes
14854
14855                         if test $cf_fix_cppflags = yes ; then
14856
14857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14859
14860                                 continue
14861                         elif test "${cf_tst_cflags}" = "\"'" ; then
14862
14863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14865
14866                                 continue
14867                         fi
14868                         ;;
14869                 esac
14870                 case "$CPPFLAGS" in
14871                 (*$cf_add_cflags)
14872                         ;;
14873                 (*)
14874                         case $cf_add_cflags in
14875                         (-D*)
14876                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14877
14878 CPPFLAGS=`echo "$CPPFLAGS" | \
14879         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14880                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14881
14882                                 ;;
14883                         esac
14884
14885         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14886         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14887
14888                         ;;
14889                 esac
14890                 ;;
14891         (*)
14892
14893         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14894         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14895
14896                 ;;
14897         esac
14898         ;;
14899 (yes)
14900
14901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14903
14904         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14905
14906         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14907                 && test -z "${cf_tst_cflags}" \
14908                 && cf_fix_cppflags=no
14909         ;;
14910 esac
14911 done
14912
14913 if test -n "$cf_new_cflags" ; then
14914
14915         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14916         CFLAGS="${CFLAGS}$cf_new_cflags"
14917
14918 fi
14919
14920 if test -n "$cf_new_cppflags" ; then
14921
14922         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14923         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14924
14925 fi
14926
14927 if test -n "$cf_new_extra_cppflags" ; then
14928
14929         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14930         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14931
14932 fi
14933
14934 ################################################################################
14935
14936 TEST_ARG2=
14937
14938 TEST_LIBS2=
14939
14940 NCURSES_SHLIB2="sh -c"
14941
14942 ADA_SUBDIRS="include gen src doc"
14943 if test "x$cf_with_tests" != "xno" ; then
14944         ADA_SUBDIRS="$ADA_SUBDIRS samples"
14945 fi
14946 for cf_dir in $ADA_SUBDIRS
14947 do
14948         SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
14949 done
14950
14951 NCURSES_TREE="#"
14952
14953 EXTERNAL_TREE=
14954
14955 # match layout used by make-tar.sh
14956 ADAHTML_DIR=../doc/ada
14957
14958 if test "x$cross_compiling" = xyes ; then
14959         ADAGEN_LDFLAGS='$(CROSS_LDFLAGS)'
14960 else
14961         ADAGEN_LDFLAGS='$(NATIVE_LDFLAGS)'
14962 fi
14963
14964 ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile"
14965 ac_config_commands="$ac_config_commands default"
14966 cat >confcache <<\_ACEOF
14967 # This file is a shell script that caches the results of configure
14968 # tests run on this system so they can be shared between configure
14969 # scripts and configure runs, see configure's option --config-cache.
14970 # It is not useful on other systems.  If it contains results you don't
14971 # want to keep, you may remove or edit it.
14972 #
14973 # config.status only pays attention to the cache file if you give it
14974 # the --recheck option to rerun configure.
14975 #
14976 # `ac_cv_env_foo' variables (set or unset) will be overriden when
14977 # loading this file, other *unset* `ac_cv_foo' will be assigned the
14978 # following values.
14979
14980 _ACEOF
14981
14982 # The following way of writing the cache mishandles newlines in values,
14983 # but we know of no workaround that is simple, portable, and efficient.
14984 # So, don't put newlines in cache variables' values.
14985 # Ultrix sh set writes to stderr and can't be redirected directly,
14986 # and sets the high bit in the cache file unless we assign to the vars.
14987 {
14988   (set) 2>&1 |
14989     case `(ac_space=' '; set | grep ac_space) 2>&1` in
14990     *ac_space=\ *)
14991       # `set' does not quote correctly, so add quotes (double-quote
14992       # substitution turns \\\\ into \\, and sed turns \\ into \).
14993       sed -n \
14994         "s/'/'\\\\''/g;
14995           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
14996       ;;
14997     *)
14998       # `set' quotes correctly as required by POSIX, so do not add quotes.
14999       sed -n \
15000         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
15001       ;;
15002     esac;
15003 } |
15004   sed '
15005      t clear
15006      : clear
15007      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
15008      t end
15009      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
15010      : end' >>confcache
15011 if cmp -s $cache_file confcache; then :; else
15012   if test -w $cache_file; then
15013     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
15014     cat confcache >$cache_file
15015   else
15016     echo "not updating unwritable cache $cache_file"
15017   fi
15018 fi
15019 rm -f confcache
15020
15021 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15022 # Let make expand exec_prefix.
15023 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15024
15025 # VPATH may cause trouble with some makes, so we remove $(srcdir),
15026 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
15027 # trailing colons and then remove the whole line if VPATH becomes empty
15028 # (actually we leave an empty line to preserve line numbers).
15029 if test "x$srcdir" = x.; then
15030   ac_vpsub='/^[         ]*VPATH[        ]*=/{
15031 s/:*\$(srcdir):*/:/;
15032 s/:*\${srcdir}:*/:/;
15033 s/:*@srcdir@:*/:/;
15034 s/^\([^=]*=[    ]*\):*/\1/;
15035 s/:*$//;
15036 s/^[^=]*=[      ]*$//;
15037 }'
15038 fi
15039
15040 DEFS=-DHAVE_CONFIG_H
15041
15042 : ${CONFIG_STATUS=./config.status}
15043 ac_clean_files_save=$ac_clean_files
15044 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
15045 { echo "$as_me:15045: creating $CONFIG_STATUS" >&5
15046 echo "$as_me: creating $CONFIG_STATUS" >&6;}
15047 cat >$CONFIG_STATUS <<_ACEOF
15048 #! $SHELL
15049 # Generated automatically by configure.
15050 # Run this file to recreate the current configuration.
15051 # Compiler output produced by configure, useful for debugging
15052 # configure, is in config.log if it exists.
15053
15054 debug=false
15055 SHELL=\${CONFIG_SHELL-$SHELL}
15056 ac_cs_invocation="\$0 \$@"
15057
15058 _ACEOF
15059
15060 cat >>$CONFIG_STATUS <<\_ACEOF
15061 # Be Bourne compatible
15062 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15063   emulate sh
15064   NULLCMD=:
15065 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
15066   set -o posix
15067 fi
15068
15069 # Name of the executable.
15070 as_me=`echo "$0" |sed 's,.*[\\/],,'`
15071
15072 if expr a : '\(a\)' >/dev/null 2>&1; then
15073   as_expr=expr
15074 else
15075   as_expr=false
15076 fi
15077
15078 rm -f conf$$ conf$$.exe conf$$.file
15079 echo >conf$$.file
15080 if ln -s conf$$.file conf$$ 2>/dev/null; then
15081   # We could just check for DJGPP; but this test a) works b) is more generic
15082   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
15083   if test -f conf$$.exe; then
15084     # Don't use ln at all; we don't have any links
15085     as_ln_s='cp -p'
15086   else
15087     as_ln_s='ln -s'
15088   fi
15089 elif ln conf$$.file conf$$ 2>/dev/null; then
15090   as_ln_s=ln
15091 else
15092   as_ln_s='cp -p'
15093 fi
15094 rm -f conf$$ conf$$.exe conf$$.file
15095
15096 as_executable_p="test -f"
15097
15098 # Support unset when possible.
15099 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
15100   as_unset=unset
15101 else
15102   as_unset=false
15103 fi
15104
15105 # NLS nuisances.
15106 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
15107 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
15108 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
15109 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
15110 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
15111 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
15112 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
15113 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
15114
15115 # IFS
15116 # We need space, tab and new line, in precisely that order.
15117 as_nl='
15118 '
15119 IFS="   $as_nl"
15120
15121 # CDPATH.
15122 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
15123
15124 exec 6>&1
15125
15126 _ACEOF
15127
15128 # Files that config.status was made for.
15129 if test -n "$ac_config_files"; then
15130   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
15131 fi
15132
15133 if test -n "$ac_config_headers"; then
15134   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
15135 fi
15136
15137 if test -n "$ac_config_links"; then
15138   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
15139 fi
15140
15141 if test -n "$ac_config_commands"; then
15142   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
15143 fi
15144
15145 cat >>$CONFIG_STATUS <<\EOF
15146
15147 ac_cs_usage="\
15148 \`$as_me' instantiates files from templates according to the
15149 current configuration.
15150
15151 Usage: $0 [OPTIONS] [FILE]...
15152
15153   -h, --help       print this help, then exit
15154   -V, --version    print version number, then exit
15155   -d, --debug      don't remove temporary files
15156       --recheck    update $as_me by reconfiguring in the same conditions
15157   --file=FILE[:TEMPLATE]
15158                    instantiate the configuration file FILE
15159   --header=FILE[:TEMPLATE]
15160                    instantiate the configuration header FILE
15161
15162 Configuration files:
15163 $config_files
15164
15165 Configuration headers:
15166 $config_headers
15167
15168 Configuration commands:
15169 $config_commands
15170
15171 Report bugs to <dickey@invisible-island.net>."
15172 EOF
15173
15174 cat >>$CONFIG_STATUS <<EOF
15175 ac_cs_version="\\
15176 config.status
15177 configured by $0, generated by GNU Autoconf 2.52.20170501,
15178   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
15179
15180 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
15181 Free Software Foundation, Inc.
15182 This config.status script is free software; the Free Software Foundation
15183 gives unlimited permission to copy, distribute and modify it."
15184 srcdir=$srcdir
15185 INSTALL="$INSTALL"
15186 EOF
15187
15188 cat >>$CONFIG_STATUS <<\EOF
15189 # If no file are specified by the user, then we need to provide default
15190 # value.  By we need to know if files were specified by the user.
15191 ac_need_defaults=:
15192 while test $# != 0
15193 do
15194   case $1 in
15195   --*=*)
15196     ac_option=`expr "x$1" : 'x\([^=]*\)='`
15197     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
15198     shift
15199     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
15200     shift
15201     ;;
15202   -*);;
15203   *) # This is not an option, so the user has probably given explicit
15204      # arguments.
15205      ac_need_defaults=false;;
15206   esac
15207
15208   case $1 in
15209   # Handling of the options.
15210 EOF
15211 cat >>$CONFIG_STATUS <<EOF
15212   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15213     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
15214     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
15215 EOF
15216 cat >>$CONFIG_STATUS <<\EOF
15217   --version | --vers* | -V )
15218     echo "$ac_cs_version"; exit 0 ;;
15219   --he | --h)
15220     # Conflict between --help and --header
15221     { { echo "$as_me:15221: error: ambiguous option: $1
15222 Try \`$0 --help' for more information." >&5
15223 echo "$as_me: error: ambiguous option: $1
15224 Try \`$0 --help' for more information." >&2;}
15225    { (exit 1); exit 1; }; };;
15226   --help | --hel | -h )
15227     echo "$ac_cs_usage"; exit 0 ;;
15228   --debug | --d* | -d )
15229     debug=: ;;
15230   --file | --fil | --fi | --f )
15231     shift
15232     CONFIG_FILES="$CONFIG_FILES $1"
15233     ac_need_defaults=false;;
15234   --header | --heade | --head | --hea )
15235     shift
15236     CONFIG_HEADERS="$CONFIG_HEADERS $1"
15237     ac_need_defaults=false;;
15238
15239   # This is an error.
15240   -*) { { echo "$as_me:15240: error: unrecognized option: $1
15241 Try \`$0 --help' for more information." >&5
15242 echo "$as_me: error: unrecognized option: $1
15243 Try \`$0 --help' for more information." >&2;}
15244    { (exit 1); exit 1; }; } ;;
15245
15246   *) ac_config_targets="$ac_config_targets $1" ;;
15247
15248   esac
15249   shift
15250 done
15251
15252 exec 5>>config.log
15253 cat >&5 << _ACEOF
15254
15255 ## ----------------------- ##
15256 ## Running config.status.  ##
15257 ## ----------------------- ##
15258
15259 This file was extended by $as_me 2.52.20170501, executed with
15260   CONFIG_FILES    = $CONFIG_FILES
15261   CONFIG_HEADERS  = $CONFIG_HEADERS
15262   CONFIG_LINKS    = $CONFIG_LINKS
15263   CONFIG_COMMANDS = $CONFIG_COMMANDS
15264   > $ac_cs_invocation
15265 on `(hostname || uname -n) 2>/dev/null | sed 1q`
15266
15267 _ACEOF
15268 EOF
15269
15270 cat >>$CONFIG_STATUS <<EOF
15271 #
15272 # INIT-COMMANDS section.
15273 #
15274
15275 ### Special initialization commands, used to pass information from the
15276 ### configuration-run into config.status
15277
15278 AWK="$AWK"
15279 DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
15280 DFT_LWR_MODEL="$DFT_LWR_MODEL"
15281 LIB_NAME="$LIB_NAME"
15282 LIB_PREFIX="$LIB_PREFIX"
15283 LIB_SUFFIX="$LIB_SUFFIX"
15284 LN_S="$LN_S"
15285 NCURSES_MAJOR="$NCURSES_MAJOR"
15286 NCURSES_MINOR="$NCURSES_MINOR"
15287 NCURSES_PATCH="$NCURSES_PATCH"
15288 USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
15289 cf_cv_abi_version="$cf_cv_abi_version"
15290 cf_cv_rel_version="$cf_cv_rel_version"
15291 cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
15292 cf_cv_shared_soname='$cf_cv_shared_soname'
15293 cf_cv_shlib_version="$cf_cv_shlib_version"
15294 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
15295 cf_cv_system_name="$cf_cv_system_name"
15296 host="$host"
15297 target="$target"
15298
15299 EOF
15300
15301 cat >>$CONFIG_STATUS <<\EOF
15302 for ac_config_target in $ac_config_targets
15303 do
15304   case "$ac_config_target" in
15305   # Handling of arguments.
15306   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
15307   "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
15308   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
15309   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
15310   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
15311   *) { { echo "$as_me:15311: error: invalid argument: $ac_config_target" >&5
15312 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
15313    { (exit 1); exit 1; }; };;
15314   esac
15315 done
15316
15317 # If the user did not use the arguments to specify the items to instantiate,
15318 # then the envvar interface is used.  Set only those that are not.
15319 # We use the long form for the default assignment because of an extremely
15320 # bizarre bug on SunOS 4.1.3.
15321 if $ac_need_defaults; then
15322   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
15323   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
15324   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
15325 fi
15326
15327 # Create a temporary directory, and hook for its removal unless debugging.
15328 $debug ||
15329 {
15330   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
15331   trap '{ (exit 1); exit 1; }' 1 2 13 15
15332 }
15333
15334 # Create a (secure) tmp directory for tmp files.
15335 : ${TMPDIR=/tmp}
15336 {
15337   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
15338   test -n "$tmp" && test -d "$tmp"
15339 }  ||
15340 {
15341   tmp=$TMPDIR/cs$$-$RANDOM
15342   (umask 077 && mkdir $tmp)
15343 } ||
15344 {
15345    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
15346    { (exit 1); exit 1; }
15347 }
15348
15349 EOF
15350
15351 cat >>$CONFIG_STATUS <<EOF
15352
15353 #
15354 # CONFIG_FILES section.
15355 #
15356
15357 # No need to generate the scripts if there are no CONFIG_FILES.
15358 # This happens for instance when ./config.status config.h
15359 if test -n "\$CONFIG_FILES"; then
15360   # Protect against being on the right side of a sed subst in config.status.
15361   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
15362    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
15363 s,@SHELL@,$SHELL,;t t
15364 s,@exec_prefix@,$exec_prefix,;t t
15365 s,@prefix@,$prefix,;t t
15366 s,@program_transform_name@,$program_transform_name,;t t
15367 s,@bindir@,$bindir,;t t
15368 s,@sbindir@,$sbindir,;t t
15369 s,@libexecdir@,$libexecdir,;t t
15370 s,@datarootdir@,$datarootdir,;t t
15371 s,@datadir@,$datadir,;t t
15372 s,@sysconfdir@,$sysconfdir,;t t
15373 s,@sharedstatedir@,$sharedstatedir,;t t
15374 s,@localstatedir@,$localstatedir,;t t
15375 s,@libdir@,$libdir,;t t
15376 s,@includedir@,$includedir,;t t
15377 s,@oldincludedir@,$oldincludedir,;t t
15378 s,@infodir@,$infodir,;t t
15379 s,@mandir@,$mandir,;t t
15380 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
15381 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
15382 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
15383 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
15384 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
15385 s,@build_alias@,$build_alias,;t t
15386 s,@host_alias@,$host_alias,;t t
15387 s,@target_alias@,$target_alias,;t t
15388 s,@ECHO_C@,$ECHO_C,;t t
15389 s,@ECHO_N@,$ECHO_N,;t t
15390 s,@ECHO_T@,$ECHO_T,;t t
15391 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
15392 s,@DEFS@,$DEFS,;t t
15393 s,@LIBS@,$LIBS,;t t
15394 s,@top_builddir@,$top_builddir,;t t
15395 s,@build@,$build,;t t
15396 s,@build_cpu@,$build_cpu,;t t
15397 s,@build_vendor@,$build_vendor,;t t
15398 s,@build_os@,$build_os,;t t
15399 s,@host@,$host,;t t
15400 s,@host_cpu@,$host_cpu,;t t
15401 s,@host_vendor@,$host_vendor,;t t
15402 s,@host_os@,$host_os,;t t
15403 s,@target@,$target,;t t
15404 s,@target_cpu@,$target_cpu,;t t
15405 s,@target_vendor@,$target_vendor,;t t
15406 s,@target_os@,$target_os,;t t
15407 s,@CC@,$CC,;t t
15408 s,@CFLAGS@,$CFLAGS,;t t
15409 s,@LDFLAGS@,$LDFLAGS,;t t
15410 s,@CPPFLAGS@,$CPPFLAGS,;t t
15411 s,@ac_ct_CC@,$ac_ct_CC,;t t
15412 s,@EXEEXT@,$EXEEXT,;t t
15413 s,@OBJEXT@,$OBJEXT,;t t
15414 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
15415 s,@CPP@,$CPP,;t t
15416 s,@AWK@,$AWK,;t t
15417 s,@EGREP@,$EGREP,;t t
15418 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
15419 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
15420 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
15421 s,@LN_S@,$LN_S,;t t
15422 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
15423 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
15424 s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
15425 s,@SET_MAKE@,$SET_MAKE,;t t
15426 s,@CTAGS@,$CTAGS,;t t
15427 s,@ETAGS@,$ETAGS,;t t
15428 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
15429 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
15430 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
15431 s,@RANLIB@,$RANLIB,;t t
15432 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
15433 s,@LD@,$LD,;t t
15434 s,@ac_ct_LD@,$ac_ct_LD,;t t
15435 s,@AR@,$AR,;t t
15436 s,@ac_ct_AR@,$ac_ct_AR,;t t
15437 s,@ARFLAGS@,$ARFLAGS,;t t
15438 s,@DESTDIR@,$DESTDIR,;t t
15439 s,@BUILD_CC@,$BUILD_CC,;t t
15440 s,@BUILD_CPP@,$BUILD_CPP,;t t
15441 s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
15442 s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
15443 s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
15444 s,@BUILD_LIBS@,$BUILD_LIBS,;t t
15445 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
15446 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
15447 s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
15448 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
15449 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
15450 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
15451 s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
15452 s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
15453 s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
15454 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
15455 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
15456 s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
15457 s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
15458 s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
15459 s,@LIB_PREFIX@,$LIB_PREFIX,;t t
15460 s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
15461 s,@CC_G_OPT@,$CC_G_OPT,;t t
15462 s,@LD_MODEL@,$LD_MODEL,;t t
15463 s,@shlibdir@,$shlibdir,;t t
15464 s,@MAKE_DLLS@,$MAKE_DLLS,;t t
15465 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
15466 s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
15467 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
15468 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
15469 s,@RM_SHARED_OPTS@,$RM_SHARED_OPTS,;t t
15470 s,@LINK_PROGS@,$LINK_PROGS,;t t
15471 s,@LINK_TESTS@,$LINK_TESTS,;t t
15472 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
15473 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
15474 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
15475 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
15476 s,@RPATH_LIST@,$RPATH_LIST,;t t
15477 s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
15478 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
15479 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
15480 s,@PTHREAD@,$PTHREAD,;t t
15481 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
15482 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
15483 s,@ECHO_LT@,$ECHO_LT,;t t
15484 s,@ECHO_LD@,$ECHO_LD,;t t
15485 s,@RULE_CC@,$RULE_CC,;t t
15486 s,@SHOW_CC@,$SHOW_CC,;t t
15487 s,@ECHO_CC@,$ECHO_CC,;t t
15488 s,@ADAFLAGS@,$ADAFLAGS,;t t
15489 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
15490 s,@ADA_TRACE@,$ADA_TRACE,;t t
15491 s,@gnat_exists@,$gnat_exists,;t t
15492 s,@M4_exists@,$M4_exists,;t t
15493 s,@cf_ada_make@,$cf_ada_make,;t t
15494 s,@GNATPREP_OPTS@,$GNATPREP_OPTS,;t t
15495 s,@cf_compile_generics@,$cf_compile_generics,;t t
15496 s,@cf_generic_objects@,$cf_generic_objects,;t t
15497 s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
15498 s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
15499 s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
15500 s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
15501 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
15502 s,@cf_ada_package@,$cf_ada_package,;t t
15503 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
15504 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
15505 s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
15506 s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
15507 s,@TINFO_LDFLAGS2@,$TINFO_LDFLAGS2,;t t
15508 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
15509 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
15510 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
15511 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
15512 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
15513 s,@USE_CFG_SUFFIX@,$USE_CFG_SUFFIX,;t t
15514 s,@TEST_ARG2@,$TEST_ARG2,;t t
15515 s,@TEST_LIBS2@,$TEST_LIBS2,;t t
15516 s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
15517 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
15518 s,@NCURSES_TREE@,$NCURSES_TREE,;t t
15519 s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
15520 s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
15521 s,@ADAGEN_LDFLAGS@,$ADAGEN_LDFLAGS,;t t
15522 CEOF
15523
15524 EOF
15525
15526   cat >>$CONFIG_STATUS <<\EOF
15527   # Split the substitutions into bite-sized pieces for seds with
15528   # small command number limits, like on Digital OSF/1 and HP-UX.
15529   ac_max_sed_lines=48
15530   ac_sed_frag=1 # Number of current file.
15531   ac_beg=1 # First line for current file.
15532   ac_end=$ac_max_sed_lines # Line after last line for current file.
15533   ac_more_lines=:
15534   ac_sed_cmds=
15535   while $ac_more_lines; do
15536     if test $ac_beg -gt 1; then
15537       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15538     else
15539       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
15540     fi
15541     if test ! -s $tmp/subs.frag; then
15542       ac_more_lines=false
15543     else
15544       # The purpose of the label and of the branching condition is to
15545       # speed up the sed processing (if there are no `@' at all, there
15546       # is no need to browse any of the substitutions).
15547       # These are the two extra sed commands mentioned above.
15548       (echo ':t
15549   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
15550       # It is possible to make a multiline substitution using escaped newlines.
15551       # Ensure that we do not split the substitution between script fragments.
15552       ac_BEG=$ac_end
15553       ac_END=`expr $ac_end + $ac_max_sed_lines`
15554       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
15555       if test -s $tmp/subs.next; then
15556         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
15557         if test ! -s $tmp/subs.edit; then
15558           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
15559           if test ! -s $tmp/subs.edit; then
15560             if test $ac_beg -gt 1; then
15561               ac_end=`expr $ac_end - 1`
15562               continue
15563             fi
15564           fi
15565         fi
15566       fi
15567
15568       if test -z "$ac_sed_cmds"; then
15569         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
15570       else
15571         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
15572       fi
15573       ac_sed_frag=`expr $ac_sed_frag + 1`
15574       ac_beg=$ac_end
15575       ac_end=`expr $ac_end + $ac_max_sed_lines`
15576     fi
15577   done
15578   if test -z "$ac_sed_cmds"; then
15579     ac_sed_cmds=cat
15580   fi
15581 fi # test -n "$CONFIG_FILES"
15582
15583 EOF
15584 cat >>$CONFIG_STATUS <<\EOF
15585 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
15586   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15587   case $ac_file in
15588   - | *:- | *:-:* ) # input from stdin
15589         cat >$tmp/stdin
15590         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15591         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15592   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15593         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15594   * )   ac_file_in=$ac_file.in ;;
15595   esac
15596
15597   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
15598   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15599          X"$ac_file" : 'X\(//\)[^/]' \| \
15600          X"$ac_file" : 'X\(//\)$' \| \
15601          X"$ac_file" : 'X\(/\)' \| \
15602          .     : '\(.\)' 2>/dev/null ||
15603 echo X"$ac_file" |
15604     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15605           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15606           /^X\(\/\/\)$/{ s//\1/; q; }
15607           /^X\(\/\).*/{ s//\1/; q; }
15608           s/.*/./; q'`
15609   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15610     { case "$ac_dir" in
15611   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15612   *)                      as_incr_dir=.;;
15613 esac
15614 as_dummy="$ac_dir"
15615 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15616   case $as_mkdir_dir in
15617     # Skip DOS drivespec
15618     ?:) as_incr_dir=$as_mkdir_dir ;;
15619     *)
15620       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15621       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15622     ;;
15623   esac
15624 done; }
15625
15626     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
15627     # A "../" for each directory in $ac_dir_suffix.
15628     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
15629   else
15630     ac_dir_suffix= ac_dots=
15631   fi
15632
15633   case $srcdir in
15634   .)  ac_srcdir=.
15635       if test -z "$ac_dots"; then
15636          ac_top_srcdir=.
15637       else
15638          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
15639       fi ;;
15640   [\\/]* | ?:[\\/]* )
15641       ac_srcdir=$srcdir$ac_dir_suffix;
15642       ac_top_srcdir=$srcdir ;;
15643   *) # Relative path.
15644     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
15645     ac_top_srcdir=$ac_dots$srcdir ;;
15646   esac
15647
15648   case $INSTALL in
15649   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
15650   *) ac_INSTALL=$ac_dots$INSTALL ;;
15651   esac
15652
15653   if test x"$ac_file" != x-; then
15654     { echo "$as_me:15654: creating $ac_file" >&5
15655 echo "$as_me: creating $ac_file" >&6;}
15656     rm -f "$ac_file"
15657   fi
15658   # Let's still pretend it is `configure' which instantiates (i.e., don't
15659   # use $as_me), people would be surprised to read:
15660   #    /* config.h.  Generated automatically by config.status.  */
15661   configure_input="Generated automatically from `echo $ac_file_in |
15662                                                  sed 's,.*/,,'` by configure."
15663
15664   # First look for the input files in the build tree, otherwise in the
15665   # src tree.
15666   ac_file_inputs=`IFS=:
15667     for f in $ac_file_in; do
15668       case $f in
15669       -) echo $tmp/stdin ;;
15670       [\\/$]*)
15671          # Absolute (can't be DOS-style, as IFS=:)
15672          test -f "$f" || { { echo "$as_me:15672: error: cannot find input file: $f" >&5
15673 echo "$as_me: error: cannot find input file: $f" >&2;}
15674    { (exit 1); exit 1; }; }
15675          echo $f;;
15676       *) # Relative
15677          if test -f "$f"; then
15678            # Build tree
15679            echo $f
15680          elif test -f "$srcdir/$f"; then
15681            # Source tree
15682            echo $srcdir/$f
15683          else
15684            # /dev/null tree
15685            { { echo "$as_me:15685: error: cannot find input file: $f" >&5
15686 echo "$as_me: error: cannot find input file: $f" >&2;}
15687    { (exit 1); exit 1; }; }
15688          fi;;
15689       esac
15690     done` || { (exit 1); exit 1; }
15691 EOF
15692 cat >>$CONFIG_STATUS <<\EOF
15693   ac_warn_datarootdir=no
15694   if test x"$ac_file" != x-; then
15695     for ac_item in $ac_file_inputs
15696     do
15697       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
15698       if test -n "$ac_seen"; then
15699         ac_used=`grep '@datarootdir@' $ac_item`
15700         if test -z "$ac_used"; then
15701           { echo "$as_me:15701: WARNING: datarootdir was used implicitly but not set:
15702 $ac_seen" >&5
15703 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
15704 $ac_seen" >&2;}
15705           ac_warn_datarootdir=yes
15706         fi
15707       fi
15708       ac_seen=`grep '${datarootdir}' $ac_item`
15709       if test -n "$ac_seen"; then
15710         { echo "$as_me:15710: WARNING: datarootdir was used explicitly but not set:
15711 $ac_seen" >&5
15712 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
15713 $ac_seen" >&2;}
15714         ac_warn_datarootdir=yes
15715       fi
15716     done
15717   fi
15718
15719 if test "x$ac_warn_datarootdir" = xyes; then
15720   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
15721 fi
15722
15723 EOF
15724 cat >>$CONFIG_STATUS <<EOF
15725   sed "$ac_vpsub
15726 $extrasub
15727 EOF
15728 cat >>$CONFIG_STATUS <<\EOF
15729 :t
15730 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
15731 s,@configure_input@,$configure_input,;t t
15732 s,@srcdir@,$ac_srcdir,;t t
15733 s,@top_srcdir@,$ac_top_srcdir,;t t
15734 s,@INSTALL@,$ac_INSTALL,;t t
15735 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
15736   rm -f $tmp/stdin
15737   if test x"$ac_file" != x-; then
15738     cp $tmp/out $ac_file
15739
15740     for ac_name in prefix exec_prefix datarootdir
15741     do
15742         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
15743         if test -n "$ac_seen"; then
15744             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
15745             if test -z "$ac_init"; then
15746               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
15747               { echo "$as_me:15747: WARNING: Variable $ac_name is used but was not set:
15748 $ac_seen" >&5
15749 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
15750 $ac_seen" >&2;}
15751             fi
15752         fi
15753     done
15754     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
15755     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
15756     if test -s $tmp/out; then
15757       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
15758       { echo "$as_me:15758: WARNING: Some variables may not be substituted:
15759 $ac_seen" >&5
15760 echo "$as_me: WARNING: Some variables may not be substituted:
15761 $ac_seen" >&2;}
15762     fi
15763   else
15764     cat $tmp/out
15765   fi
15766   rm -f $tmp/out
15767
15768 done
15769 EOF
15770 cat >>$CONFIG_STATUS <<\EOF
15771
15772 #
15773 # CONFIG_HEADER section.
15774 #
15775
15776 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
15777 # NAME is the cpp macro being defined and VALUE is the value it is being given.
15778 #
15779 # ac_d sets the value in "#define NAME VALUE" lines.
15780 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
15781 ac_dB='[        ].*$,\1#\2'
15782 ac_dC=' '
15783 ac_dD=',;t'
15784 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
15785 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15786 ac_iB='\([      ]\),\1#\2define\3'
15787 ac_iC=' '
15788 ac_iD='\4,;t'
15789 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
15790 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
15791 ac_uB='$,\1#\2define\3'
15792 ac_uC=' '
15793 ac_uD=',;t'
15794
15795 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
15796   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
15797   case $ac_file in
15798   - | *:- | *:-:* ) # input from stdin
15799         cat >$tmp/stdin
15800         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15801         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15802   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
15803         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
15804   * )   ac_file_in=$ac_file.in ;;
15805   esac
15806
15807   test x"$ac_file" != x- && { echo "$as_me:15807: creating $ac_file" >&5
15808 echo "$as_me: creating $ac_file" >&6;}
15809
15810   # First look for the input files in the build tree, otherwise in the
15811   # src tree.
15812   ac_file_inputs=`IFS=:
15813     for f in $ac_file_in; do
15814       case $f in
15815       -) echo $tmp/stdin ;;
15816       [\\/$]*)
15817          # Absolute (can't be DOS-style, as IFS=:)
15818          test -f "$f" || { { echo "$as_me:15818: error: cannot find input file: $f" >&5
15819 echo "$as_me: error: cannot find input file: $f" >&2;}
15820    { (exit 1); exit 1; }; }
15821          echo $f;;
15822       *) # Relative
15823          if test -f "$f"; then
15824            # Build tree
15825            echo $f
15826          elif test -f "$srcdir/$f"; then
15827            # Source tree
15828            echo $srcdir/$f
15829          else
15830            # /dev/null tree
15831            { { echo "$as_me:15831: error: cannot find input file: $f" >&5
15832 echo "$as_me: error: cannot find input file: $f" >&2;}
15833    { (exit 1); exit 1; }; }
15834          fi;;
15835       esac
15836     done` || { (exit 1); exit 1; }
15837   # Remove the trailing spaces.
15838   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
15839
15840 EOF
15841
15842 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
15843 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
15844 # be either 'cat' or 'sort'.
15845 cat confdefs.h | uniq >conftest.vals
15846
15847 # Break up conftest.vals because some shells have a limit on
15848 # the size of here documents, and old seds have small limits too.
15849
15850 rm -f conftest.tail
15851 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
15852 while grep . conftest.vals >/dev/null
15853 do
15854   # Write chunks of a limited-size here document to conftest.frag.
15855   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
15856   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
15857   echo 'CEOF' >> $CONFIG_STATUS
15858   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
15859   rm -f conftest.vals
15860   mv conftest.tail conftest.vals
15861 done
15862 rm -f conftest.vals
15863
15864 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
15865 # marker @DEFS@.
15866 echo '  cat >> conftest.edit <<CEOF
15867 /@DEFS@/r conftest.frag
15868 /@DEFS@/d
15869 CEOF
15870 sed -f conftest.edit $tmp/in > $tmp/out
15871 rm -f $tmp/in
15872 mv $tmp/out $tmp/in
15873 rm -f conftest.edit conftest.frag
15874 ' >> $CONFIG_STATUS
15875
15876 cat >>$CONFIG_STATUS <<\EOF
15877   # Let's still pretend it is `configure' which instantiates (i.e., don't
15878   # use $as_me), people would be surprised to read:
15879   #    /* config.h.  Generated automatically by config.status.  */
15880   if test x"$ac_file" = x-; then
15881     echo "/* Generated automatically by configure.  */" >$tmp/config.h
15882   else
15883     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
15884   fi
15885   cat $tmp/in >>$tmp/config.h
15886   rm -f $tmp/in
15887   if test x"$ac_file" != x-; then
15888     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
15889       { echo "$as_me:15889: $ac_file is unchanged" >&5
15890 echo "$as_me: $ac_file is unchanged" >&6;}
15891     else
15892       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
15893          X"$ac_file" : 'X\(//\)[^/]' \| \
15894          X"$ac_file" : 'X\(//\)$' \| \
15895          X"$ac_file" : 'X\(/\)' \| \
15896          .     : '\(.\)' 2>/dev/null ||
15897 echo X"$ac_file" |
15898     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
15899           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
15900           /^X\(\/\/\)$/{ s//\1/; q; }
15901           /^X\(\/\).*/{ s//\1/; q; }
15902           s/.*/./; q'`
15903       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
15904         { case "$ac_dir" in
15905   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
15906   *)                      as_incr_dir=.;;
15907 esac
15908 as_dummy="$ac_dir"
15909 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
15910   case $as_mkdir_dir in
15911     # Skip DOS drivespec
15912     ?:) as_incr_dir=$as_mkdir_dir ;;
15913     *)
15914       as_incr_dir=$as_incr_dir/$as_mkdir_dir
15915       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
15916     ;;
15917   esac
15918 done; }
15919
15920       fi
15921       rm -f $ac_file
15922       mv $tmp/config.h $ac_file
15923     fi
15924   else
15925     cat $tmp/config.h
15926     rm -f $tmp/config.h
15927   fi
15928 done
15929 EOF
15930 cat >>$CONFIG_STATUS <<\EOF
15931 #
15932 # CONFIG_COMMANDS section.
15933 #
15934 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
15935   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
15936   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
15937
15938   case $ac_dest in
15939     default )
15940 if test -z "$USE_OLD_MAKERULES" ; then
15941         $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
15942 fi
15943  ;;
15944   esac
15945 done
15946 EOF
15947
15948 cat >>$CONFIG_STATUS <<\EOF
15949
15950 { (exit 0); exit 0; }
15951 EOF
15952 chmod +x $CONFIG_STATUS
15953 ac_clean_files=$ac_clean_files_save
15954
15955 # configure is writing to config.log, and then calls config.status.
15956 # config.status does its own redirection, appending to config.log.
15957 # Unfortunately, on DOS this fails, as config.log is still kept open
15958 # by configure, so config.status won't be able to write to it; its
15959 # output is simply discarded.  So we exec the FD to /dev/null,
15960 # effectively closing config.log, so it can be properly (re)opened and
15961 # appended to by config.status.  When coming back to configure, we
15962 # need to make the FD available again.
15963 if test "$no_create" != yes; then
15964   ac_cs_success=:
15965   exec 5>/dev/null
15966   $SHELL $CONFIG_STATUS || ac_cs_success=false
15967   exec 5>>config.log
15968   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
15969   # would make configure fail if this is the last instruction.
15970   $ac_cs_success || { (exit 1); exit 1; }
15971 fi
15972 ${MAKE:-make} preinstall